=== CodeFaeries Top Customers ===
Contributors: lwsdevelopers
Tags: woocommerce, customers, analytics, reports, csv
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.8
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 customer age, 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 — customer name, revenue, order count, average cart, frequency, and customer since
* 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
* Ignore and restore customers — keep staff, test or wholesale accounts out of the ranking
* 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, with anonymized customers reported as a single aggregate row

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

**Top Customers Pro** is a separate add-on that builds on this plugin with advanced customer segmentation, lifecycle analysis, RFM scoring, automated email campaigns, and custom scheduled reports. This free plugin is complete on its own and never expires.

== Installation ==

WooCommerce 7.0 or later is required; activation is refused below that version.

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 and transients created by the plugin are removed. Otherwise, your settings are preserved so you can reinstall later. The plugin creates no database table and schedules no cron job.

== 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.8 - 2026-10-05 =
* Fixed: amounts and dates in the customer table and its charts follow your WordPress language instead of your browser's.
* Fixed: the RFM Score column separates the score from the segment name.
* Fixed: the help tab's support link leads to the contact page.
* Fixed: on a site that also runs a CodeFaeries Pro plugin, this plugin's bundled toolkit can no longer take the place of the Pro's and cause a critical error.
* Improved: an add-on can leave part of an order's total out of customer revenue, which Top Customers Pro uses to exclude products, categories and payment methods.
* Improved: the bundled admin toolkit is updated to its latest release.
* Compatibility: tested up to WordPress 7.1.

= 1.0.5 - 2026-06-19 =
* Improved: usage tracking has been removed entirely from the free plugin — it no longer collects any data or contacts external services.
* Improved: the contextual help tab and readme now state clearly that the plugin makes no outbound network requests — all processing stays on your site.
* Improved: simplified the admin navigation by removing the locked Pro teaser tabs.
* Improved: updated the bundled charting library to Chart.js 4.5.1.

= 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: documentation now lists the opt-in telemetry service the plugin can contact.
* Improved: distribution package hardened for the WordPress.org Plugin Directory.

= 1.0.3 - 2026-05-11 =
* Compatibility: minimum PHP requirement stated as 7.4, which is what the plugin has always needed.
* Code quality: passes WordPress Plugin Check cleanly.

= 1.0.2 =
* Fixed: removed repeated "Invalid plugin file" errors that WooCommerce logged on every admin request when the plugin runs alongside its Pro add-on.

= 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.
* Fixed: correct loading when the plugin runs alongside its Pro add-on.

= 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.
* Opt-in anonymized telemetry.
* HPOS and legacy order-table support.

== Upgrade Notice ==

= 1.0.8 =
Recommended update: prevents a possible critical error alongside a CodeFaeries Pro plugin, and amounts and dates follow your WordPress language. Tested up to WordPress 7.1.

= 1.0.5 =
Recommended update — usage tracking removed entirely; the plugin no longer contacts any external service.

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

= 1.0.3 =
Recommended update — Plugin Check compliance. Minimum PHP stays 7.4.

= 1.0.0 =
Initial public release.
