=== Black Popup - Popups & Cart Sync ===
Contributors: blackpopup
Tags: popup, woocommerce, email, marketing, conversion
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Popups, supercharged: one platform, hundreds of use cases. Increase sales and subscribers with popups visitors actually love.

== Description ==

Black Popup - Popups & Cart Sync connects your WooCommerce storefront to the Black Popup popup platform **only after you opt in** in the plugin settings. **Nothing is loaded on the storefront by default.**

When enabled by a site administrator, the plugin:

- Loads the Black Popup engine from our CDN
- Exposes `window.popupData` from saved plugin configuration
- Syncs `recent_products` and `cart_products` in the visitor browser (localStorage)
- Provides a secured cart-track REST endpoint for iframe-based add-to-cart from popups
- Provides an AJAX endpoint for cart line item sync

== External services ==

This plugin can connect to external services operated by Black Popup **only when a site administrator enables storefront integration** under **Settings > Black Popup - Popups & Cart Sync**. The integration is **off by default**; no remote scripts run and no visitor data is sent until you check the opt-in box and save.

**Black Popup popup runtime (script.blackpopup.com)**

* **What it is used for:** Loading and running popup campaigns, forms, and WooCommerce cart actions configured in your Black Popup account.
* **What data is sent and when (only while integration is enabled):**
  * On storefront page loads: Site ID, popup configuration (`window.popupData`), and WooCommerce product/cart context synced in the browser (`recent_products`, `cart_products`).
  * When a visitor submits a popup form or triggers add-to-cart: fields the popup collects (for example email), plus product IDs needed to add items to the cart.
  * Campaign analytics events (for example popup views) may be sent by the runtime when a popup is shown.
* **Service provider:** Black Popup — [Terms of use](https://www.blackpopup.com/terms), [Privacy policy](https://www.blackpopup.com/privacy)

By enabling this plugin's storefront integration you agree to these services' terms and privacy policies.

== Installation ==

1. Upload the `blackpopup-popups-cart-sync` folder to `/wp-content/plugins/` or install the zip in wp-admin.
2. Activate **Black Popup - Popups & Cart Sync**.
3. Go to **Settings > Black Popup - Popups & Cart Sync**.
4. Check **Enable Black Popup on the storefront (opt-in)** and enter your Site ID, then save.

Until step 4 is completed, the plugin does not load remote scripts or send data to Black Popup services.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

WooCommerce is required for cart sync and add-to-cart features. The popup script is not loaded until you opt in, regardless of WooCommerce.

= Is visitor tracking enabled by default? =

No. Storefront integration is disabled until a site administrator explicitly enables it in settings.

= Which REST namespace should I use? =

Use `blackpopup/v1`. Legacy `kite/v1` routes are kept for backward compatibility when integration is enabled.

== Changelog ==

= 1.2.3 =
* Storefront integration opt-in checkbox (off by default); no remote loading until enabled.
* Cart/track REST route requires nonce and same-site referer; routes not registered when disabled.
* AJAX cart sync requires nonce when enabled.
* External services legal links updated to app.blackpopup.com.

= 1.2.2 =
* Aligned package name, slug, folder, and text domain to blackpopup-popups-cart-sync.

= 1.2.1 =
* WordPress.org review fixes: wp_enqueue inline scripts, unique bppcs_ prefixes, external services documentation, text domain aligned to blackpopup-popups-cart-sync.

== Upgrade Notice ==

= 1.2.3 =
You must enable storefront integration in settings after upgrading; integration is off by default.
