=== CommerScope - Behavioural Analytics for Woo ===
Contributors: upluggit
Tags: woocommerce, analytics, funnel, abandoned cart, ecommerce
Requires at least: 5.6
Tested up to: 7.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight WooCommerce analytics plugin to track conversion rates, checkouts, cart abandonment, and checkout field friction diagnostics.

== Description ==

CommerScope is a privacy-first, lightweight WooCommerce analytics and conversion rate optimization (CRO) plugin. It automatically tracks customer shopping behaviors, conversion funnels, checkout form interactions, and field-level friction in real-time. 

Unlike heavy script trackers that slow down page loads, CommerScope runs entirely on your own server. It stores analytics in custom database tables, uses lightweight native telemetry, and has zero external dependencies or API overhead.

Identify exactly which products convert best, discover where shoppers drop off in your checkout form, track field completion times, and detect form validation errors instantly inside a premium admin dashboard.

== Key Features ==

* **WooCommerce Funnel Analytics:** Tracks and visualizes the complete checkout journey: Product Views ➡️ Cart Additions ➡️ Checkout Starts ➡️ Completed Purchases.
* **Checkout Field Friction Analysis:** Ranks billing and shipping fields by average focus duration, validation errors, and abandonment rates to pinpoint friction points.
* **Product Conversion Tracking:** Displays views, cart additions, completed orders, and precise conversion rates for each individual product.
* **Abandoned Cart Metrics:** Identifies unique checkout sessions that were abandoned, calculating abandonment rates to improve your checkout conversion rates.
* **2-Row KPI Metrics Dashboard:** Monitor Gross Sales, Order Count, Average Order Value (AOV), Unique Visitors, and Conversion Rates on a clean desktop grid.
* **Date Range Filtering:** Filter your e-commerce data using relative presets (7, 30, or 90 days) or custom calendar dates.
* **High-Performance Order Storage (HPOS) Ready:** Query database tables directly for instant manual status change reflections, compatible with WooCommerce HPOS.
* **Privacy-First & GDPR Compliant:** Never records personal customer data, billing addresses, keystrokes, or credit card details. Only focus timing and validation error states are tracked.
* **Pruning and DB Maintenance:** Auto-prunes older analytics logs daily (15-365 days retention) to keep your database database footprint minimal.

== Installation ==

1. Upload the `commerscope` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Access the dashboard by clicking on the **CommerScope** item in your WordPress admin sidebar menu.

== Frequently Asked Questions ==

= Is this a WooCommerce funnel builder plugin? =
No. CommerScope is a WooCommerce analytics and checkout form diagnostics plugin. It does not create custom checkout pages or modify your WooCommerce checkout template. Instead, it tracks and visualizes conversion rates on your existing pages.

= Is it GDPR compliant? =
Yes. CommerScope is fully GDPR compliant. The frontend tracking script only records binary field statuses (e.g. filled/unfilled), form validation error notices, and timers. It never logs keystrokes, personal details, or sensitive billing info.

= Does it support WooCommerce HPOS (High-Performance Order Storage)? =
Yes. CommerScope automatically checks if HPOS is active on your site, querying the primary WooCommerce orders table to instantly reflect manual status changes.

= How does automatic data pruning work? =
The plugin runs a daily cron job that automatically cleans up analytics logs older than your chosen data retention window (default 30 days). You can set custom retention periods or disable pruning entirely.

== Screenshots ==

1. CommerScope main analytics dashboard showing key KPI metrics, WooCommerce conversion funnel, and product conversion tables.
2. Checkout Field Friction diagnostics mapping Billing and Shipping field focus times, error counts, and drop-offs.
3. Interactive settings panel drawer with customized admin exclusions, database table data retention policies, and data pruning controls.

== Changelog ==

= 1.0.0 =
* Initial release of CommerScope (formerly FieldFriction Analytics).
* Added WooCommerce conversion funnel and checkout field tracking.
* Added product conversion stats.
* Added Unique Visitors KPI card and two-row card grid.
* Added custom date range calendar selector.
