=== Vexplug Customer Stats ===
Contributors: vexplug
Tags: woocommerce, customer analytics, sales reports, repeat orders, ecommerce
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.7.1
License: Commercial License

WooCommerce customer analytics with repeat-order, revenue, sales trend, lifetime and year-over-year reporting. A valid Vexplug commercial license is required.

== Changelog ==

= 1.7.1 =
* Fixed the Period / Lifetime overview switch so KPI values actually change.
* Added lifetime item totals and lifetime repeat KPI calculations.
* Converted the plugin to commercial-license-only distribution.
* Added activation, domain binding, validation and deactivation against the Vexplug Commercial License Server.
* Added license-required gating to analytics and CSV export.
* Added cached validation with a limited outage grace period for previously valid licenses.
* Added dedicated Customer Stats product ID: customer-stats.

= 1.6.6 =
* Hardened CSV export against spreadsheet formula injection.
* Moved CSV generation to a capability- and nonce-protected server-side endpoint for large customer lists.
* Removed the version-suffixed internal class name.

== Description ==

Vexplug Customer Stats gives WooCommerce store owners a clear view of customer and sales performance directly inside WordPress admin.

Key features include:

* Selected-period customer statistics.
* Lifetime customer, order and revenue overview.
* Repeat customer count and repeat rate.
* Repeat orders and repeat customer revenue.
* Items sold and average order value.
* Customer segments for new and repeat customers.
* Customer ranking and sortable customer intelligence.
* Orders and revenue trend charts.
* Year-over-year monthly comparison.
* Same-month daily comparison with last year.
* HPOS-compatible order analytics with a legacy-order fallback.
* Commercial license activation with Vexplug's license server.
* Local customer/order analytics; customer and order data is not transmitted to the license server.

The plugin reads order data already stored by WooCommerce. Only license metadata (license key, product ID and normalized domain) is sent to the Vexplug licensing server for activation and validation; customer and order analytics are not transmitted.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin through **Plugins > Add New > Upload Plugin**, or install it from the WordPress Plugin Directory.
3. Activate **Vexplug Customer Stats**.
4. Open **WooCommerce > Customer Stats License** and activate your commercial license.
5. Open **WooCommerce > Customer Stats**.

== Requirements ==

* WordPress 5.8 or later.
* PHP 7.4 or later.
* WooCommerce.

== Privacy ==

Vexplug Customer Stats reads customer, order, item and revenue information already stored by WooCommerce for display in the WordPress admin.

The plugin does not transmit this information to Vexplug or third-party services. It may temporarily cache calculated analytics in WordPress transients for performance. Cached values expire automatically.

Access to the analytics screen is restricted to users with WooCommerce management permissions.

== HPOS Compatibility ==

The plugin supports WooCommerce High-Performance Order Storage (HPOS). When HPOS is enabled, it reads the HPOS order and address tables and includes a compatibility fallback for installations where order storage is temporarily out of sync.

== Support ==

For support, use your Vexplug customer support channel.

== Changelog ==

= 1.7.0 =
* Converted the plugin to commercial-license-only distribution.
* Added activation, domain binding, validation and deactivation against the Vexplug Commercial License Server.
* Added license-required gating to analytics and CSV export.
* Added cached validation with a limited outage grace period for previously valid licenses.
* Added dedicated Customer Stats product ID: customer-stats.

= 1.6.5 =
* Added direct capability enforcement to the analytics screen.
* Fixed lifetime customer spending in customer tables and CSV export.
* Added real 1 / 2 / 3 / 4+ lifetime-order customer segmentation.
* Added WooCommerce HPOS compatibility declaration.
* Fixed uninstall cleanup to remove the current plugin cache prefix.
* Extended All Time reporting to cover modern WooCommerce order history from 1970 onward.
* Reduced repeated database table-existence checks during a request.


= 1.4.9 =
* Prepared the plugin for WordPress.org distribution.
* Added GPL license metadata and licensing file.
* Added WordPress privacy-policy guidance.
* Added uninstall cleanup for plugin transients.
* Removed admin notice suppression from the Customer Stats screen.
* Removed the unfinished RFM placeholder from the public release.
* Retained HPOS and legacy-order compatibility improvements.

= 1.4.8 =
* Improved HPOS customer-data compatibility.
* Added a fallback using the WooCommerce order-address table.
* Improved customer aggregation on HPOS installations.

= 1.4.7 =
* Improved HPOS customer and item calculations.
* Added support for processing/completed status variants.

== License ==

Vexplug Customer Stats is licensed under the GPLv2 or later.
