=== Pulsely — Ad-blocker-Proof WordPress Analytics ===
Contributors: pulsely
Tags: analytics, visitors, statistics, privacy, self-hosted, gdpr, heatmap, utm, ad-blocker
Requires at least: 5.6
Tested up to: 6.5
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The only WordPress analytics plugin ad-blockers can't disable. Server-side pageview tracking in PHP — bypasses uBlock, Brave, ITP. All data stays on your server.

== Description ==

**Pulsely** is a hybrid-tracking WordPress analytics plugin that records pageviews **server-side, in PHP**, before any JavaScript executes. This means uBlock Origin, Brave Shield, Privacy Badger, Safari Intelligent Tracking Prevention, and every consumer ad-blocker — all of which break Google Analytics — **cannot suppress your visitor data**.

A lightweight 3 KB JavaScript layer adds clicks, scroll depth, and engagement timing on top. Everything stays on your own server.

= Why server-side tracking matters =

Every other analytics tool — Google, Plausible, Fathom, Burst, MonsterInsights — relies on a JavaScript snippet. Between 6% and 26% of your visitors block those scripts. Tech-savvy audiences? Up to 60%. Pulsely captures the pageview before that script ever loads.

= What it tracks =

* **Pageviews** captured server-side via PHP `template_redirect` hook (ad-blocker-proof)
* **Clicks** on links and buttons (JS layer)
* **Scroll depth** at 25 / 50 / 75 / 100 percent (JS layer)
* **UTM parameters** (source, medium, campaign, term, content)
* **Device fingerprint** — browser, OS, device class, screen size — *no PII*
* **Hashed IP** for unique visitor counts (you can disable hashing)

= Dashboard =

* KPIs: visitors, pageviews, pages-per-visit, clicks
* Daily visitor chart
* Hourly heatmap (day-of-week × hour)
* Top pages, top clicks, top UTM sources
* Devices and browsers breakdown
* Visitors list with full session timelines

= Pricing =

Pulsely is a paid plugin: **£14.99 / month**, billed worldwide via Paddle. A **48-hour free trial starts on activation** — no card needed. After the trial, you'll be asked to subscribe to keep tracking.

If you cancel, you keep access until the end of your billing period. Your data is never deleted when the subscription ends — it just waits for you.

= Privacy =

* All data stays on your WordPress database
* IPs are hashed before storage by default
* GDPR-friendly cookie consent banner is shown on first visit
* Auto-creates a Privacy Policy page on activation
* No data is ever sent to Pulsely or any other third party (the licence server only sees your domain and key)

== Installation ==

1. Upload the `pulsely` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload.
2. Activate the plugin. Your 48-hour free trial begins automatically.
3. Visit **Pulsely → Dashboard** to see your stats roll in.
4. Before the trial ends, head to **Pulsely → License**, subscribe, and paste the key emailed to you by Paddle.

== Frequently Asked Questions ==

= Is Pulsely really self-hosted? =

Yes. Visitor data is stored exclusively in your WordPress database, in two tables (`wp_pulsely_visitors` and `wp_pulsely_events`). The only outbound network call is a once-a-day check against our licence server to confirm your subscription status — that request includes your domain and licence key, nothing else.

= What happens when my trial ends? =

The dashboard shows a lock screen and the tracker stops injecting JavaScript. Your existing data is preserved — as soon as you subscribe and activate a key, everything reappears.

= What if I cancel my subscription? =

Your access continues until the end of the current billing period. After that the plugin locks, but your data is preserved. Resubscribe at any time and pick up where you left off.

= My payment failed — what now? =

You'll see a banner in the WordPress admin saying "Payment failed — update card." We give you a short grace window before locking, but please update your payment method as soon as possible to avoid interruption.

= Can I move my licence to another site? =

Yes. Go to **Pulsely → License** on the old site and click "Deactivate this site." Then enter the same key on the new site.

= Does Pulsely work with caching plugins? =

Yes. The tracker is a single small inline script that runs in the visitor's browser — it doesn't depend on dynamic page rendering.

= How big is the tracker? =

Around 2.4 KB unminified, loaded with `defer` so it never blocks page rendering.

== Screenshots ==

1. Dashboard with KPIs, daily chart, and hourly heatmap.
2. Top pages, top clicks, and UTM source breakdown.
3. Visitors list with per-session detail.
4. Session timeline showing pageviews, clicks, and scroll milestones.
5. Licence screen with current subscription status.

== Changelog ==

= 1.3.0 — 2026-05 =
* **WooCommerce revenue tracking** — completed orders are recorded with first-touch attribution (utm_source/medium/campaign/referrer), so you can see which traffic sources drove the most revenue. New "Revenue" admin page with totals, AOV, and source breakdown. Auto-detects WooCommerce; the page only appears when WC is active.
* **Goals** — three kinds of success conditions: URL match (visitor reaches a page), Click (visitor clicks a CSS selector), and Custom event (your code fires `window.psl.goal('event-name')`). Tracks unique-session conversion rate and optional goal value.
* **Email digest** — Monday-morning weekly summary email with last week's pageviews, visitors, top pages, top referrers, and goal completions, plus week-over-week comparison.
* **Slack / Discord / generic webhook notifications** — get pinged when a goal completes or when traffic spikes (current hour ≥ N× normal hourly average). Auto-detects webhook format from URL host.
* New tables: `wp_pulsely_goals`, `wp_pulsely_goal_hits`, `wp_pulsely_attribution`, `wp_pulsely_revenue`. Auto-created on upgrade.
* New REST endpoint: `pulsely/v1/goal` (anonymous, license-gated).
* Tracker JS bumped to ~3.6 KB to handle click goals and custom events.

= 1.2.0 — 2026-05 =
* **Live Visitors** — new admin page showing how many people are on your site right now and which pages they're reading. Auto-refreshes every 5 seconds.
* **Funnels** — define a sequence of URL patterns (landing → pricing → checkout) and Pulsely shows how many visitors completed each step, with drop-off rates.
* **Server-side tracking** (already shipped in 1.1.0, now documented) — Pulsely records pageviews directly in PHP via the `template_redirect` hook. Pageviews remain visible even when visitors run uBlock Origin, Brave Shields, Safari ITP, or any other ad-blocker. Click events and engagement metrics still come from the JS tracker; pageviews are double-checked from both sources and de-duplicated.
* New `wp_pulsely_funnels` table — adds itself automatically on plugin upgrade.
* New REST endpoints: `pulsely/v1/heartbeat` (anonymous, rate-limited) and `pulsely/v1/live` (admin-only).
* Tracker JS bumped from ~3 KB to ~3.4 KB to add the heartbeat loop.

= 1.1.0 — 2026-04 =
* Subscription model with 48-hour free trial.
* Daily licence re-check (was weekly in 1.0).
* New "Cancelled · access until [date]" status — you keep access through the paid period.
* "Payment failed — update card" banner for past-due subscriptions.
* Paddle webhook integration for `subscription_created`, `subscription_updated`, `subscription_cancelled`, `subscription_payment_success`, `subscription_payment_failed`.
* Improved consent banner with persistent decline option.
* Tracker hardened: scripts now use `XMLHttpRequest` with WP REST nonce.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.3.0 =
Adds Goals, WooCommerce revenue, weekly email digest, and webhook notifications. Four new tables auto-create on upgrade. No action required after upgrade — visit Pulsely → Goals to start tracking conversions.

= 1.2.0 =
Adds Live Visitors, Funnels, and documents server-side tracking. New `wp_pulsely_funnels` table is created automatically. No action required — funnel definitions you create are visible only to admins.

= 1.1.0 =
Major shift from one-time licence to monthly subscription. Existing 1.0 keys will continue to work until their renewal window — please reactivate to upgrade to the subscription model.
