WordPress.org

Plugin Directory

Repeatwright – Customer Segments, RFM & Retention for WooCommerce

Repeatwright – Customer Segments, RFM & Retention for WooCommerce

Description

Repeatwright turns your existing WooCommerce orders into customer intelligence. It groups every customer into one of eleven RFM segments (Champions, Loyal, At Risk, Can’t Lose, Lost …), shows your repeat purchase rate and average lifetime value, and plots cohort retention month by month. Everything is computed on your server from your orders. No data leaves your site.

Overview

  • Customers, repeat rate, average lifetime value, orders per customer, median days between orders and 90‑day active customers. When the repeat rate counts only customers whose first order falls inside the selected range (the default), it is also compared with the previous period of the same length.
  • RFM grid with customer count, revenue and share per segment. Click a tile to see the customers.
  • Lifetime value distribution, new vs returning revenue by month and your top customers.

Customers

  • Filter by segment, spend, orders, last order date, country, acquisition source, tag, product, category or coupon.
  • Bulk export to CSV (the selected rows, or every customer matching the filter), copy emails, add tags, or create a WooCommerce coupon restricted to those customers’ email addresses. Repeatwright adds at most 500 addresses to one coupon; this is Repeatwright’s own limit and the repeatwright_coupon_email_limit filter changes it.
  • Customer drawer with the order timeline, RFM explanation, top products, tags, notes, consent state and unsubscribe toggle.
  • Segment badge in the WordPress users list and a customer summary box on every order.

Segments

  • Visual rule builder with AND / OR groups: spend, orders, recency, first order, average order, country, source, tags, products bought, categories bought, coupons used, RFM segment, marketing opt‑in and, when WooCommerce Subscriptions is active, whether the customer has an active subscription.
  • Live count while you edit. Membership is refreshed nightly, after a full recalculation, when a segment is saved and when you click Refresh.
  • Export, copy emails, coupon or email any segment.

Cohorts

  • Retention heatmap by month of first order; toggle between percentage, customers and revenue.

Emails

  • Send a message to any segment through WooCommerce’s own email template with merge tags ({first_name}, {coupon_code}, {orders}, {total_spent} …).
  • Test send, schedule for a date and time in the site timezone, throttled batches through Action Scheduler (one batch per minute until everyone is sent), a per‑recipient log (the screen shows the latest 200 entries) and an automatic unsubscribe link.
  • Consent gate: when opt‑in is required, only customers whose orders carry a marketing opt‑in receive emails. The opt‑in is read from the order meta key mailchimp_woocommerce_is_subscribed (written by Mailchimp for WooCommerce), from the keys _wc_marketing_optin and marketing_optin (WooCommerce itself does not write them; a checkout field plugin or custom code can) or, when none of those keys is set on the order, from the repeatwright_order_optin filter. Required by default when the store’s base country is in the EEA (the EU plus Iceland, Liechtenstein and Norway), the United Kingdom or Switzerland.

Developers

Filters: repeatwright_order_amount, repeatwright_count_order, repeatwright_counted_statuses, repeatwright_order_source, repeatwright_order_optin, repeatwright_segment_key, repeatwright_segment_fields, repeatwright_segment_rules, repeatwright_merge_tags, repeatwright_email_allowed, repeatwright_capability, repeatwright_ltv_buckets, repeatwright_coupon_email_limit, repeatwright_batch_time_budget.
Actions: repeatwright_stats_computed, repeatwright_customer_updated, repeatwright_segment_entered, repeatwright_segment_left, repeatwright_email_sent, repeatwright_unsubscribed.
Helper: repeatwright_customer_segment( $email_or_user_id ).
WP-CLI: wp repeatwright recalc run|status|cancel, wp repeatwright segments list|refresh, wp repeatwright export --segment=<id> --file=<name>.csv (the file is written to the repeatwright folder in uploads, with a random suffix added to the name).
REST: repeatwright/v1 (overview, customers, segments, cohorts, emails, settings).

More plugins by Emtiaz Zahid

  • Launchmender: 44 pre-launch checks with one-click fixes, a manual checklist and a client handoff report
  • Faultwright: PHP errors, JavaScript errors, failed cron jobs, emails and updates on one timeline
  • Stalemender: content audit that gives every post a Freshness Score (0–100) and tells you why
  • Waymender: finds broken links without hammering your server, logs 404s and fixes both in one click
  • Anchormender: internal link suggestions while you write, an orphan post report and bulk internal linking

Privacy

Repeatwright stores, in your own database, a summary per customer built from your orders:

  • Billing first name, last name, email address and country from the most recent order, and the linked WordPress user id.
  • Order aggregates: number of orders and refunds, total spent, order currency, first and last order dates, average order value, the products, top product, top category and coupons bought and the months they were bought in, RFM scores and segment.
  • The acquisition source: the UTM source (or source type) that WooCommerce order attribution recorded on the order.
  • The marketing opt-in state read from the order, whether the customer has unsubscribed, and any tags and notes your staff add.
  • Segment membership: which RFM and custom segments each customer belongs to and the date they entered each one.
  • For segment emails: the list of customers each email was sent to and a per-recipient log (sent, failed or skipped, with the reason and time).

The summary is kept for as long as the plugin is installed and removed on uninstall unless “Keep customer stats, segments and emails when the plugin is uninstalled” is on under Settings Advanced. The per-recipient email log, and the recipient list of sent or cancelled emails, are deleted by the nightly job once they are older than the number of days set under Settings Consent (30 by default); the email’s subject, body and sent/skipped counts are kept. This plugin does not contact any external service; emails are sent through your site’s own mailer.

CSV exports contain names, email addresses and order statistics. Exports from the admin screen are downloaded by your browser and not stored on the server. wp repeatwright export --file=<name>.csv writes the file to the repeatwright folder inside your uploads directory, adding a random 16-character suffix to the name so it cannot be guessed, and places an index.php and a deny-all .htaccess in that folder (the .htaccess only works on Apache-style servers). The command prints the full path. Move or delete the file once you have it. Uninstalling the plugin deletes that folder unless that same setting is on.

The plugin registers a personal data exporter and eraser with the WordPress privacy tools (Tools Export / Erase Personal Data). The export contains the stored summary for that address (including staff notes, consent and unsubscribe state, acquisition source, currency, products, categories, coupons, RFM scores and active months), its segment memberships with the date each was entered, and its segment email log entries. Erasure anonymises the customer record, deletes its segment memberships and remembers the address (as a hash) so a later recalculation does not rebuild it. When WooCommerce removes the personal data from an order (an erasure request, the “Remove personal data” order action or its personal data retention settings), Repeatwright rebuilds that customer’s summary from their remaining orders and anonymises it when no counted order with that address is left. A suggested paragraph for your privacy policy is added under Settings Privacy Policy Guide.

Consent: segment emails only go to customers the store may contact. When “Require marketing opt-in” is on, the opt-in is read from the order meta key mailchimp_woocommerce_is_subscribed (written by Mailchimp for WooCommerce), from the keys _wc_marketing_optin and marketing_optin (WooCommerce itself has no opt-in field and does not write them; a checkout field plugin or custom code can) or, when none of those keys is set on the order, supplied through the repeatwright_order_optin filter. The setting is on by default when the store’s base country is in the EEA (the EU plus Iceland, Liechtenstein and Norway), the United Kingdom or Switzerland, off elsewhere, and can be changed under Settings Consent. Every email carries an unsubscribe link and List-Unsubscribe headers, and unsubscribed customers are never emailed again.

Screenshots

Installation

  1. Install and activate WooCommerce 9.0 or newer.
  2. Upload the plugin folder to /wp-content/plugins/ or install it from the Plugins screen, then activate it.
  3. Go to WooCommerce Customer Insights and click Start to build the first set of customer stats. Large stores are processed in batches in the background.
  4. Optionally review Settings Data (counted statuses, excluded roles) and Settings Consent.

FAQ

Does Repeatwright send my data anywhere?

No. Orders are aggregated inside your own database and emails go out through WooCommerce’s mail transport. There are no external API calls.

Which orders are counted?

By default orders with the Completed and Processing statuses. Spend is always net of refunds; fully refunded orders count as an order with zero spend unless you turn that off. When WooCommerce Subscriptions is active, its renewal orders are counted too unless you turn off “Count subscription renewal orders” under Settings Data. Change statuses, excluded roles and excluded emails under Settings Data (an entry such as @example.com excludes every address at that domain), or use the repeatwright_counted_statuses filter.

How are RFM scores computed?

Recency, frequency and monetary value are each scored 1–5. By default the cut points are quintiles of your customer base within the recency window (730 days), so scores are relative to your own store. Switch to fixed thresholds under Settings RFM. Customers with no order inside the window are Lost.

Are guest orders included?

Yes. By default guest orders are merged with a registered account when the billing email matches. Turn “Merge guest orders with registered accounts” off under Settings Data to keep them apart: a registered customer’s stats then come only from the orders placed with their account (under the account’s email address), guest orders stay separate customers, and a guest order placed with the email address of a registered account is not counted, because that address already belongs to the account. Run a recalculation after changing the setting.

Does it work with High-Performance Order Storage (HPOS)?

Yes. Repeatwright declares HPOS compatibility and loads orders with wc_get_orders(). The full recalculation pages through order IDs with one query on whichever orders table is active.

How does it stay up to date?

Once the first full recalculation has completed, a nightly job rescores every customer and refreshes segments and cohorts, and a customer’s summary is also refreshed when one of their orders is created, changes status, is refunded, trashed, restored or deleted: the update is queued about 30 seconds after the change and processed on the next Action Scheduler run (WP-Cron). Nothing is updated this way before the first full recalculation has completed. Changes made while a full recalculation is running, the first one included, are held back and applied when it finishes or is cancelled.

Can I use segments in other plugins?

Yes. repeatwright_customer_segment( $email_or_user_id ) returns the segment key, and every segment can be exported as CSV or turned into a WooCommerce coupon with email restrictions. repeatwright_segment_entered / repeatwright_segment_left fire for the customers who joined or left a segment when its membership is refreshed: nightly, after a full recalculation, when the segment is saved, when you click Refresh or with wp repeatwright segments refresh. They do not fire instantly when an order comes in.

Does the plugin send anything to its author?

No. Repeatwright has no server of its own, sends no usage statistics or telemetry, and makes no outbound requests at all. Segments, scores and reports are calculated from your WooCommerce orders on your own server, and segment emails are sent through WordPress and WooCommerce’s own mailer.

Does Repeatwright bundle Action Scheduler?

No. Repeatwright uses the Action Scheduler that ships with WooCommerce for its background jobs (recalculation batches, order updates and email batches). It does not include a copy of its own.

Where is the JavaScript source?

The admin screen is a React app. Its readable source is in assets/src/admin/; assets/build/admin.js is the compiled bundle produced by @wordpress/scripts from package.json and webpack.config.js. Rebuild it with npm ci && npm run build inside the plugin directory.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Repeatwright – Customer Segments, RFM & Retention for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release: RFM segments, overview KPIs, customer explorer, segment builder, cohort retention, segment emails with consent gate, coupons, CSV export, privacy tools, WP-CLI and REST API.