=== GoalPrevail Tab Notifications ===
Contributors: goalprevail
Donate link: https://goalprevail.com/
Tags: tab notification, browser tab, cart abandonment, woocommerce, favicon badge
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Win back wandering visitors. When someone switches tabs or minimises the browser, the page title flashes a "come back" reminder — perfect for carts.

== Description ==

People open ten tabs and forget about yours. **GoalPrevail Tab Notifications** brings them back the way the big sites do it: the moment a visitor switches to another tab or minimises the browser, your page title starts to flash a friendly reminder, and a little `(1)` counter ticks up — just like an unread Facebook message. When they come back, the original title (and favicon) snap straight back into place.

It's built for the highest-intent moment in any store: **a shopper with a full cart who tabbed away to "think about it".**

* **Title flashing** — alternate between the real page title and your message (e.g. `👋 Come back!`), or use the calmer "Replace" mode that swaps the title just once.
* **Facebook-style counter** — an optional `(1)`, `(2)`… badge that counts how many times the visitor wandered off, so it reads like a genuine notification.
* **Favicon badge** — stamp a coloured dot (with the counter) over your site icon, drawn live in the browser. Falls back gracefully if the icon can't be read.
* **Cart & checkout aware** — when WooCommerce is active, target cart and checkout only, with a dedicated cart message and an "only when the cart actually has items" guard.
* **Flexible targeting** — every page, WooCommerce cart/checkout, or a hand-picked list of pages (by ID, path like `/pricing/`, or `home`).
* **Message rotation** — list several lines and they cycle as the title flashes.
* **Tunable** — set the flash speed, a delay before it starts, and a "stop after N flashes" cap so it never becomes annoying.
* **Two triggers** — fire only when the tab is hidden (switch / minimise), or also when the whole window loses focus.
* **Won't nag you** — hidden from logged-in administrators by default.
* **Welcome them back** — optionally greet returning visitors with a short message before the real title slides back.
* **Know when to stop** — choose who sees it (everyone, guests, or signed-in users), exclude pages you never want it on, and cap how many times it fires in one visit.
* **Live preview** — a mock browser tab right in the settings screen flashes as you type, so you can dial it in before going live.

Everything happens client-side and is fully reversible: the visitor's original tab title and favicon are always restored when they return. Nothing is collected about you or your visitors, and the front end never contacts a third party.

Built by [Goal Prevail](https://goalprevail.com/) — a small senior team building WordPress plugins, WooCommerce stores and SaaS. It adds nothing to your front end except the reminder you configure.

== Installation ==

1. Upload the `goalprevail-tab-notifications` folder to `/wp-content/plugins/`, or install via Plugins → Add New.
2. Activate it.
3. Visit **GoalPrevail Plugins → Tab Notifications** to set your message and where it shows. The defaults flash `👋 Come back!` on every page with the counter on.

== Frequently Asked Questions ==

= Does it work when the browser is minimised? =
Yes. Minimising the window, or switching to another tab, both hide the page — that's when the reminder kicks in. If you also want it to fire when the visitor clicks away to a different application (while your tab is still visible), switch the trigger to "Also when the window loses focus".

= Will the visitor's tab title stay broken? =
No. The original title — and the favicon, if you badge it — are restored the instant the visitor comes back to the tab.

= Do I need WooCommerce? =
Only for the "Cart & checkout only" targeting and the dedicated cart message. Everything else works on any WordPress site.

= Why isn't it showing for me? =
By default the reminder is hidden from logged-in administrators so you don't nag yourself. Test in a private/incognito window, or turn that option off under "Where it shows".

= Does it collect any data or call home? =
No tracking of any kind. The reminder itself is entirely client-side — nothing about your visitors is stored or sent anywhere, and the front end of your site makes no external requests.

The one exception is entirely in the admin: the **GoalPrevail Plugins** dashboard screen asks the official WordPress.org plugin API (api.wordpress.org) which other GoalPrevail plugins exist, so it can list them. That request only happens when you open that screen, the answer is cached for a day, and no information about you or your site is sent.

= It shows for the wrong people on my cached site =
Targeting options that depend on who is visiting — "logged-out visitors only", "logged-in users only" and "don't show it to administrators" — are decided on the server as the page is built. If a full-page cache serves one visitor's copy of a page to everyone, they all get whatever was decided for the first visitor. Most caching plugins already bypass the cache for logged-in users, which resolves it; cart and checkout pages are normally excluded from caching too. If you rely on those options, exclude the affected pages from your page cache.

== External services ==

This plugin queries the official WordPress.org plugin directory API when you open the **GoalPrevail Plugins** dashboard screen in wp-admin, to list the other plugins published by this author. It sends only the author name being searched for — no data about you, your site or your visitors — and caches the result for 24 hours. Nothing is requested on the front end of your site.

Service: WordPress.org plugin API — https://api.wordpress.org/plugins/info/1.2/
Terms of service: https://wordpress.org/about/
Privacy policy: https://wordpress.org/about/privacy/

== Screenshots ==

1. The settings screen with a live mock-tab preview.
2. A flashing tab title with the Facebook-style (1) counter.
3. WooCommerce cart/checkout targeting.

== Changelog ==

= 1.0.0 =
* Initial release: win back visitors who switch tabs with title flashing, a (1) counter and a favicon badge.
* Flash speed, delay and stop-after controls, message rotation, and two triggers.
* "Welcome back" greeting when the visitor returns, plus a (1) counter that persists across navigation in the same session.
* Audience targeting (everyone, logged-out only, or logged-in only), page exclusions, and a per-session cap so it never becomes annoying.
* WooCommerce cart/checkout targeting and an admin live preview.

== Upgrade Notice ==

= 1.0.0 =
First release.
