=== Wazlytics Analytics ===
Contributors: wazlytics
Tags: analytics, privacy, statistics, web analytics, cookie-free
Requires at least: 6.0
Tested up to: 6.9
Stable tag: 1.0.29
Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Privacy-focused web analytics for WordPress. Lightweight, cookie-free, and GDPR compliant.

== Description ==

Wazlytics is a privacy-focused web analytics platform that provides all the insights you need without compromising your visitors' privacy.

What this plugin adds beyond a script tag:

* Bypass ad-blockers via proxy mode — events and the tracker script flow through your own domain on randomised URLs that are cached locally
* Skip tracking for logged-in admins and editors so internal traffic doesn't pollute analytics
* WooCommerce purchase events fired server-side from the thank-you page
* Houzez real-estate analytics — server-side hooks capture inquiries, tours, favorites, saved searches, and listing publishes with forwarded visitor IP/UA so leads correlate with the visitor's browser pageviews
* Houzez registry sync — properties, agents, and agencies are pushed to Wazlytics whenever they're created or edited in WordPress
* Admin bar shortcut to your Wazlytics dashboard

Module choices (outbound links, file downloads, form submissions, web vitals) are configured in your Wazlytics dashboard — the plugin pulls the per-site bundle automatically.

== Compatibility ==

The tracker script ships with bypass attributes (`data-cfasync="false"`, `data-no-optimize="1"`, `data-no-minify="1"`, `data-no-defer="1"`, `data-skip-lazy="1"`) and per-vendor exclusion filters so popular optimisation plugins do not break it:

* WP Rocket — Delay JS + Minify exclusions registered automatically
* LiteSpeed Cache — Optimize + Defer exclusions registered automatically
* Autoptimize — JS aggregation exclusion registered automatically
* Cloudflare Rocket Loader — skipped via `data-cfasync="false"`
* W3 Total Cache — skipped via `data-no-minify="1"`

== Installation ==

1. Upload the `wazlytics` folder to `/wp-content/plugins/`
2. Activate the plugin through the Plugins menu
3. In your Wazlytics dashboard, open Settings → Integration and create a plugin token (it is shown once — copy it)
4. In WordPress, open the new Wazlytics menu (in the admin sidebar, below Posts), confirm the pre-filled Domain, paste the plugin token, and click Save & Verify
5. (Optional) Enable Proxy mode to bypass ad-blockers, or toggle WooCommerce tracking

== Frequently Asked Questions ==

= Do I need a Wazlytics account? =

Yes. Create one at wazlytics.com (or run a self-hosted instance), add your site, then create a plugin token under Settings → Integration to connect this plugin.

= Does this plugin set cookies? =

No. Wazlytics is fully cookie-free and does not use localStorage or fingerprinting.

= What does proxy mode do? =

Proxy mode routes the tracker JS and events through randomised paths on your own WordPress site so ad-blockers can't match them against generic analytics-blocking filter lists. The tracker JS is cached locally via a daily cron, and events are forwarded to Wazlytics with the visitor's real IP/UA preserved via signed headers.

= Does it work with WooCommerce? =

Yes. Enable "WooCommerce purchases" in Wazlytics → Advanced. The plugin fires a `purchase` event with the order ID and item count on the thank-you page.

= I run Houzez. What do I get? =

Houzez integration enables automatically once your Wazlytics dashboard reports the site as Houzez-enabled (or while the theme is detected during initial setup). You get server-side capture of contact-agent forms, tour scheduling, favorites, saved searches, listing publishes, plus property/agent/city context attached to every pageview, plus registry sync to Wazlytics.

== Changelog ==

= 1.0.29 =
* New: AI crawler tracking — see when ChatGPT, Claude, Perplexity, Google and other AI crawlers read your pages. Enabled per site on request — contact Wazlytics to turn it on.

= 1.0.28 =
* Fixed: Moving a listing to Pending Review now removes it from your dashboard. It was previously treated as still being on your site, so a listing you had taken down kept appearing in your reports and alerts.
* Added: A daily check that compares your dashboard against your site and removes any listing, agent, or agency that is no longer published there. This catches removals that were missed for any reason, including ones made before this version was installed.

= 1.0.27 =
* Fixed: Listings that your dashboard rejected were skipped silently, so they never appeared in your reports and there was no way to tell why. The plugin now receives the actual reason, which is what makes those listings fixable.
* Changed: A listing is no longer re-sent when nothing about it has changed. Sites whose listings are rewritten on a schedule — an MLS or feed import, for example — were sending thousands of identical updates a day. Edits you make still sync immediately.

= 1.0.26 =
* Fixed: Trashing or unpublishing a listing, agent, or agency now removes it from your dashboard right away. Previously only a permanent delete was reported, so a trashed listing could keep appearing in your reports and alerts until WordPress emptied the trash. Restoring or re-publishing brings it back.

= 1.0.25 =
* Changed: The plugin now keeps itself up to date automatically, so your site always runs the latest version without a manual click. To manage updates yourself instead, define WAZLYTICS_DISABLE_AUTO_UPDATE as true in wp-config.php.

= 1.0.24 =
* Added: Listings with an expiration date set in Houzez (Property Expirator) now surface a "Listing expiring" alert on your dashboard a few days before they go offline, so you can renew or relist in time. Listings without an expiration date are unaffected.

= 1.0.23 =
* Changed: Listings now sync to your dashboard the first time each one is viewed, instead of a one-time bulk catalogue import. Large catalogues no longer depend on a background sweep that could stall, so every listing that gets traffic appears in your analytics.

= 1.0.22 =
* Added: Property search analytics now record the country buyers filter by, powering a new "Top countries" card on the Search Demand dashboard (shown only when buyers search by country).

= 1.0.21 =
* Fixed: Property contact form and schedule-tour leads were not recorded on sites served through a CDN (e.g. BunnyCDN). The visitor's real IP is now read from the CDN's forwarding headers so these leads are tracked instead of being filtered out as data-center traffic.

= 1.0.20 =
* Added: A collapsible sidebar in the embedded dashboard.
* Changed: The Statistics page now hides unrelated theme/plugin admin notices, like the settings page.

= 1.0.19 =
* Changed: The in-WordPress Statistics page now lives under the Wazlytics menu (keeping it highlighted), shows your site's URL as the title, and fills the full width of the admin area.
* Added: A "view it here" link in settings once the dashboard is enabled.

= 1.0.18 =
* Added: View your analytics dashboard inside the WordPress admin (Dashboard → Analytics and Wazlytics → Statistics).

= 1.0.17 =
* New: a top-level "Wazlytics" menu in the WordPress admin sidebar (just below Posts, with the Wazlytics icon) — your settings now live there instead of under Settings → Wazlytics.
* New installs no longer exclude Administrator and Editor from tracking by default, so right after setup you can visit your own site and confirm tracking works — important on low-traffic sites. Turn role exclusions on under Wazlytics → Advanced once you have real visitor traffic. Existing sites keep their current setting.

= 1.0.16 =
* Fix: property inquiry and tour-request leads now attach to the correct listing. They were tagged with Houzez's display reference (e.g. "HZ49") instead of the listing's post ID, so they showed as "Listing unavailable" and didn't count toward the listing's leads.

= 1.0.15 =
* Houzez integration now activates automatically on Houzez sites — it's detected from the active theme, so property, agent, lead and search tracking starts working the moment the plugin is connected, with no Houzez switch to flip. Your Wazlytics dashboard turns on its Houzez section by itself once the first data arrives.

= 1.0.14 =
* Fix: the connection status message could appear several times and overlap the header — it now shows once, in its proper place below the header.

= 1.0.13 =
* The settings screen now shows the Wazlytics logo.
* After activating the plugin, you're taken straight to the setup screen so you can connect your site right away.

= 1.0.12 =
* Automatic updates: Wazlytics now updates itself directly from wazlytics.com — you'll be notified in the WordPress Plugins screen when a new version is available and can update in one click, just like a directory plugin.

= 1.0.11 =
* Maintenance: registry sync and connection now use the v1 API endpoints. Update to stay compatible with the Wazlytics service.

= 1.0.10 =
* Track 404 error pages and WordPress search queries — enable them under Settings → Wazlytics → Enhanced measurements; results appear as goals in your dashboard with a per-page / per-term breakdown.

= 1.0.9 =
* Configure enhanced measurements (outbound links, file downloads, form submissions) directly in the plugin — changes sync to your Wazlytics dashboard.

= 1.0.8 =
* Connect using your domain + a plugin token created in the Wazlytics dashboard (Settings → Integration).
* The domain field is pre-filled from your site address.
* Upgrading from an earlier version? The connection method changed from Site ID to Domain + plugin token. After updating, open Settings → Wazlytics, confirm the pre-filled domain, create a plugin token in your dashboard under Settings → Integration, paste it, and click Save & Verify to re-connect.

= 1.0.7 =
* Houzez: sync the site's global currency (symbol + position) so Search Demand price ranges always use the theme's configured currency, independent of per-listing data

= 1.0.0 =
* Initial release
* Single-paste snippet-URL setup with Save & Verify handshake
* Randomised proxy URLs with daily-cron local cache of the tracker JS
* Site-token + forwarded IP/UA preserve visitor identity through the proxy
* Bypass attributes + filter exclusions for WP Rocket, LiteSpeed Cache, Autoptimize, Cloudflare Rocket Loader, and W3 Total Cache
* Outbound HTTP timeouts capped at 5 seconds so a slow upstream cannot lock the admin screen
* Admin notice when neither cURL nor allow_url_fopen is available
* WordPress role exclusion
* WooCommerce purchase tracking (opt-in)
* Houzez integration: server-side event capture + registry sync + pageview context
* Admin bar shortcut to the Wazlytics dashboard

== Upgrade Notice ==

= 1.0.29 =
Adds AI crawler tracking, enabled per site on request.

= 1.0.17 =
Adds a top-level Wazlytics menu in wp-admin. New installs count your own visits by default so you can verify tracking; existing sites keep their current role-exclusion setting. No action required.

= 1.0.16 =
Fixes property contact / tour leads not attaching to their listing. No action required.

= 1.0.15 =
Houzez integration now turns on automatically on Houzez sites — no Houzez switch to flip. No action required.

= 1.0.14 =
Fixes a duplicated connection status message on the settings screen. No action required.

= 1.0.13 =
Minor polish — the settings header now shows the Wazlytics logo, and activating the plugin takes you straight to setup. No action required.

= 1.0.12 =
Enables built-in automatic updates. This is the last manual update — install it once and future versions arrive with one click from the Plugins screen.

= 1.0.11 =
Maintenance update — re-syncs with the latest Wazlytics API. Update when prompted; no settings change required.

= 1.0.10 =
Adds optional 404 and WordPress-search tracking. No action required on upgrade.

= 1.0.9 =
Enhanced measurements can now be toggled in the plugin (Settings → Wazlytics). No action required on upgrade.

= 1.0.8 =
Connection method changed to Domain + plugin token. After updating, re-connect under Settings → Wazlytics — confirm your domain and paste a token created in your dashboard's Settings → Integration tab.
