=== SPP Abandoned Cart Tab Alert ===
Contributors: spp
Tags: woocommerce, cart, abandoned cart, browser tab, conversion
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Recover distracted multi-tab shoppers by alternating the browser tab title when they switch away from a page with cart items.

== Description ==

SPP Abandoned Cart Tab Alert is a lightweight WooCommerce companion plugin. When a shopper has items in their cart and switches to another browser tab, the page title alternates between the original title and your custom alert message — a simple nudge to come back and finish checkout.

**Features**

* Runs only when the WooCommerce cart session contains items
* Uses the native Page Visibility API (`visibilitychange`) — no polling, no heavy scripts
* Customizable alert tab title and toggle interval
* Settings under **WooCommerce → Cart Tab Alert**
* Inline footer script with WooCommerce HPOS compatibility

**How it works**

1. WooCommerce cart data is read when the page loads.
2. A lightweight inline script runs on the store front end when the cart has items.
3. When the tab becomes hidden, JavaScript alternates `document.title` between the original page title and your alert message.
4. When the shopper returns to the tab, the original title is restored.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install through the WordPress plugins screen.
2. Activate the plugin through the **Plugins** screen.
3. Ensure WooCommerce is installed and active.
4. Optional: configure the alert message under **WooCommerce → Cart Tab Alert**.

== Frequently Asked Questions ==

= Does this plugin work without WooCommerce? =

No. WooCommerce is required because the plugin checks the live cart session for items before loading the script.

= Which pages does the script load on? =

Any front-end page where the shopper has one or more items in their WooCommerce cart.

= Will this affect SEO? =

No. Title changes happen only in the visitor's browser after they switch tabs; search engines do not execute this behavior during crawling.

== Screenshots ==

1. Settings page for alert title and toggle interval.

== Changelog ==

= 1.1.1 =
* Move settings page to WooCommerce → Cart Tab Alert for easier access.
* Keep a fallback settings link under Settings.

= 1.1.0 =
* Rebuild tab alert with inline footer script for reliable cart detection.
* Add WooCommerce cart cookie fallback and HPOS compatibility declaration.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.1 =
Settings moved to WooCommerce → Cart Tab Alert. Improved cart detection reliability.
