=== CodeFaeries Top Customers ===
Contributors: lwsdevelopers
Tags: woocommerce, customers, analytics, reports, csv
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Rank WooCommerce customers by revenue, orders, average cart, purchase frequency, and loyalty — with segments, charts, and CSV export.

== Description ==

CodeFaeries Top Customers adds a dedicated page under **WooCommerce → Top Customers** that ranks your shoppers so you can spot the customers who matter most at a glance.

**Highlights**

* Sortable ranking table — revenue, order count, average cart, frequency, loyalty
* Summary cards — totals and per-customer averages for any date range
* Segment pills — At-Risk, New, VIP, Regular, One-Time (priority-evaluated)
* Charts — Top-10 revenue bar chart and revenue concentration doughnut
* Customer detail panel — recent orders, top products, profile link
* Date-range presets + custom range
* Live search, column visibility toggles, and CSV export
* HPOS-ready (automatic detection of High-Performance Order Storage)
* Active-subscriber awareness (WooCommerce Subscriptions optional)
* GDPR personal-data exporter and eraser

**Only completed and processing orders are counted.** Pending, on-hold, cancelled, refunded, and failed orders are excluded from rankings and totals.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/codefaeries-top-customers`, or install it directly from the WordPress admin interface.
2. Activate the plugin through the **Plugins** menu.
3. Visit **WooCommerce → Top Customers**.

== Frequently Asked Questions ==

= My totals differ from the WooCommerce sales report. =
Top Customers only counts orders in the Completed or Processing status. Small differences from core reports are expected.

= Are guest orders included? =
Yes. Guests are grouped by billing email. Customers without a billing email cannot be ranked.

= Does it handle multiple currencies? =
No. Revenue is reported in your store's base currency without conversion.

= What happens on uninstall? =
If "Delete all plugin data when uninstalling" is enabled on the Top Customers page, all options, transients, and scheduled events created by the plugin are removed. Otherwise, your settings are preserved so you can reinstall later.

== Privacy & Data ==

All customer ranking data is computed locally from your own WooCommerce database. The plugin does not contact any external service: no data ever leaves your site. Customer avatars are drawn locally from name initials, so no requests are made to third-party avatar providers.

== Screenshots ==

1. Top Customers dashboard with summary cards, charts, and the ranking table.
2. Segment pills with live counts.
3. Customer detail slide-over panel.

== Changelog ==

= 1.0.4 - 2026-05-18 =
* Improved: customer avatars are now drawn locally from name initials — the plugin no longer contacts any external avatar service.
* Improved: distribution package hardened for the WordPress.org Plugin Directory.

= 1.0.3 - 2026-05-11 =
* Compatibility: minimum PHP requirement lowered to 7.3 — the plugin now runs on a wider range of hosts.
* Code quality: passes WordPress Plugin Check cleanly.

= 1.0.2 =
* Fixed: removed repeated "Invalid plugin file" errors that WooCommerce logged on every admin request.

= 1.0.1 =
* Fixed: database queries hardened and graceful handling when optional dependencies are missing.
* Fixed: stability fixes at plugin startup — internal services now initialize reliably alongside the shared toolkit.

= 1.0.0 =
First public release. CodeFaeries Top Customers ranks your WooCommerce customers by revenue, order count, and other lifetime metrics.

* Customer ranking dashboard with sortable columns and visual charts.
* Customer segments (top spenders, frequent buyers, and more).
* CSV export of the customer list.
* GDPR data exporter and eraser.
* HPOS and legacy order-table support.

== Upgrade Notice ==

= 1.0.4 =
Recommended update — clearer external-services disclosure and a hardened distribution package.

= 1.0.3 =
Recommended update — minimum PHP lowered to 7.3 (runs on more hosts) and Plugin Check compliance.

= 1.0.0 =
Initial public release.
