=== Wren Loyalty – Points & Rewards for WooCommerce ===
Contributors: wrenplugins
Tags: loyalty, points, rewards, loyalty program, woocommerce
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A points and rewards program for WooCommerce. Customers earn points on every order and redeem them at checkout. Block checkout ready.

== Description ==

**Wren Loyalty** turns one-time buyers into regulars. Customers earn points when they shop and spend them as a discount on their next order. It takes about two minutes to set up, and it works with both the new block checkout and the classic checkout.

Wren Loyalty's free version is a complete program, not a demo.

= What you get, free =

* **Points on every order.** Set how many points customers earn per dollar (or euro, pound…) spent. Choose whether shipping, taxes and fees count, and how to round.
* **Redeem at checkout.** Customers pick how many points to use with a slider in the cart or checkout. Works in the **Cart and Checkout blocks** and in classic shortcode carts.
* **Spending rules.** Points-to-currency rate, minimum points, minimum order, maximum discount (percent or fixed), and an option to exclude sale items.
* **Welcome bonus** for new accounts and **review bonus** for verified buyers.
* **Per-product and per-category rules.** Fixed points for a product, or no points at all.
* **My Account → Rewards page** with balance, pending points, full history and "ways to earn".
* **Points on product pages**, updated live for variable products.
* **Guest prompt**: "Create an account and earn 58 points with this order."
* **Order emails** show points earned and used.
* **Accurate by design.** Every point is an entry in an append-only ledger. Refunds remove points proportionally, cancellations reverse them, and nothing is ever counted twice, even if an order changes status back and forth.
* **Balance check & repair** tool that compares every balance with the ledger.
* **Dashboard** with members, points outstanding, what they're worth, points issued and redeemed, and sales that used points.
* **Customers screen** to search any customer, see their history, and add or remove points with a reason.
* **One-click import** from WooCommerce Points and Rewards, YITH Points and Rewards, WPLoyalty, Points and Rewards for WooCommerce (WP Swings), MyRewards, Simple Points and Rewards and myCred. Preview first; safe to run twice.
* **CSV export** of every transaction.
* **WP-CLI** commands: `wp wren balance`, `wp wren adjust`, `wp wren sync-orders`, `wp wren doctor`, `wp wren import`.
* HPOS (custom order tables) compatible. Translation ready.

= Our promises =

* No nag banners, upsell popups or "rate us" boxes in your admin.
* No tracking. The plugin doesn't contact any outside server.
* Your data stays if you uninstall, unless you choose to delete it.

= Wren Loyalty Pro =

[Pro](https://wrenplugins.com/loyalty/) adds VIP tiers with earn multipliers, referrals, birthday points, points expiry with reminder emails, bonus-point campaigns, points for past orders, and priority support. It's $49/year for one site, or $179/year for unlimited sites. The renewal price never goes up, and Pro keeps working if you stop renewing.

== Installation ==

1. Install and activate WooCommerce.
2. Go to Plugins → Add New, search for "Wren Loyalty", then install and activate.
3. Open WooCommerce → Loyalty and follow the two-minute setup.

Switching from another loyalty plugin? Keep it active, open WooCommerce → Loyalty → Import & tools, preview and import, then deactivate the old plugin.

== Frequently Asked Questions ==

= Does it work with the block checkout? =

Yes. The points panel appears in the Cart and Checkout blocks and in classic shortcode carts and checkouts.

= When do customers get their points? =

When the order is Completed, by default. You can switch this to Processing (paid). Until then, customers see the points as pending in My Account.

= What happens when an order is refunded or cancelled? =

A partial refund removes points in proportion to the amount refunded. A cancelled or failed order removes the points it earned and gives back any points it used. A full refund gives back points used if you leave that setting on.

= How is the discount applied? =

As a cart discount, so it works with taxes and other coupons. Points are deducted when the order is placed and returned if the order is cancelled or fails.

= Can I give points manually? =

Yes. In WooCommerce → Loyalty → Customers, open a customer and add or remove points with a reason. The reason appears in the customer's history.

= Will my old plugin's points carry over? =

Yes, for the plugins listed above. The importer only reads their data and never changes it. Each customer is imported once, so running the import again is safe.

= Does it slow down my store? =

No. Balances are cached in their own table, so showing a balance is a single indexed lookup. Nothing runs on pages without loyalty content except a small stylesheet.

= Is it multisite compatible? =

Yes, each site in a network has its own program.

= Where is the source code for the JavaScript files? =

The files in `build/` are compiled from the human-readable source in `assets/src/`, which ships with the plugin. To rebuild them, install Node.js and run `npx @wordpress/scripts build` with `assets/src/admin/index.js` and `assets/src/checkout/index.js` as entry points.

== Screenshots ==

1. Two-minute setup with a live preview of what customers see.
2. Dashboard: members, points outstanding and their value, activity.
3. Customers: search, history and manual adjustments.
4. Redeeming points in the Checkout block.
5. My Account rewards page.
6. Importing balances from another loyalty plugin.

== Changelog ==

= 1.0.0 =
* First release.
