=== Australcode Points and Rewards for WooCommerce ===
Contributors: australcode
Tags: woocommerce, loyalty, rewards, points, loyalty program
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.2
Stable tag: 1.0.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Loyalty points for WooCommerce: earn on every order and redeem from a wallet — no coupon codes — on a fast custom-table ledger that scales.

== Description ==

Australcode Points and Rewards is a loyalty plugin for WooCommerce with one design goal: a points program that stays fast and predictable as your store grows. Points live in dedicated, append-only ledger tables and are redeemed straight from a wallet at checkout — no coupon codes to manage. Customers earn on every order and you control earning, redemption and display from a clean WordPress admin.

**Free features**

* Earn points on every order, at a rate you choose, awarded when the order is processing or completed.
* Per-product and per-category earning multipliers, and per-product/category exclusions.
* Redeem points for a cart discount (wallet or coupon style), with a minimum-to-redeem and a max-percentage-of-cart cap.
* "Earn X points" message on product pages and in the cart.
* My Account rewards area with balance, lifetime totals and history.
* Optional floating points widget.
* Custom point labels (e.g. "stars"), accent color and an opt-in dark mode.
* HPOS-compatible (WooCommerce High-Performance Order Storage).
* Built on custom tables for fast, scalable reads — no autoloaded option bloat.

**Pro features** (unlocked with a license)

* Extra earning bonuses: signup, daily-login streak, first order, approved review, birthday, profile completion, order-count milestone, cart-total threshold and lifetime-spend milestone.
* Earning rules engine: multipliers or flat bonuses by category, customer role, order total and date range, applied first-match by priority, with a one-click dry-run preview over recent orders.
* Advanced redemption: spend points on rewards you define — a fixed-amount coupon, a percentage discount or free shipping — single-use, with restrictions, expiry and an automatic refund if a coupon goes unused.
* Unlimited VIP tiers with per-tier earning multipliers, storefront badges (colour + icon) and a My Account progress bar, plus time-boxed campaigns ("double points weekend").
* Two-sided referral program: customers share a link and both sides earn on the friend's first order.
* Pro customer management: bulk add/subtract/expire, CSV import of adjustments with a dry-run preview, and block/unblock customers.
* Dedicated transactional emails: a points-expiry reminder and an optional manual-adjustment notice (standard WooCommerce emails).
* Points expiration with a configurable window.

[Get Pro &rarr;](https://points-rewards.australcode.io)

== Installation ==

1. Upload the `australcode-points-rewards` folder to `/wp-content/plugins/`, or install it from the Plugins screen.
2. Activate the plugin through the "Plugins" menu in WordPress. WooCommerce must be active.
3. Go to **Australcode Rewards → Settings** to configure earning, redemption and display options.
4. (Pro) Go to **Australcode Rewards → Upgrade** to buy or activate a Pro license — checkout and activation are handled in-dashboard by Freemius, and you can manage the license later under **Australcode Rewards → Account**.

== Screenshots ==

1. Dashboard — points in circulation with a 30-day trend, top earners and who is active right now, all from a fast custom-table ledger.
2. My Account rewards area — customers see their points balance, redeem points on their current cart and review their full earn/redeem history.
3. Settings — configure earning, redemption and display, with inline guidance and a recommendation for each non-obvious option.
4. VIP tiers — reward your most loyal customers with higher earning multipliers (Pro).
5. Customers — per-customer balances and activity, all read from fast custom tables.
6. Campaigns — schedule limited-time earning multipliers, like a double-points weekend, that stack on your base rate (Pro).

== External services ==

This plugin uses Freemius to handle Pro licensing, checkout and plugin updates.
Freemius is the Merchant of Record for the Pro plan.

* **What it does:** Freemius powers the in-dashboard pricing/checkout for the Pro
  plan and, once you own a license, activates and validates it so Pro features
  can be unlocked on this site. It also serves automatic updates for the Pro
  build.
* **What data is sent and when:** if you opt in on the activation screen, basic
  non-sensitive environment data (site URL, WordPress/PHP versions, active
  plugin/theme) is sent to api.freemius.com to support licensing and updates.
  Opt-in is optional — a **Skip** button is shown, and the free version is fully
  functional without it. When you buy or activate a Pro license, your license
  key and site identifier are sent to validate it. No personal data of your
  store's customers is sent.
* **The service is only contacted for licensing/updates of the Pro plan** (and
  only after opt-in). The free version does not require contacting any external
  service to work.

Service provider: Freemius, Inc.
Terms of Service: https://freemius.com/terms/
Privacy Policy: https://freemius.com/privacy/

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes. Australcode Points and Rewards extends WooCommerce and will show a notice if WooCommerce is not active.

= Is it compatible with High-Performance Order Storage (HPOS)? =

Yes. It uses the WooCommerce order CRUD API and declares HPOS compatibility.

= How are points stored? =

In dedicated custom tables (balances and an append-only transaction ledger), so reads stay fast as your store grows.

= Can customers spend points on any order? =

You set the redemption rate, a minimum number of points required to redeem, and the maximum percentage of a cart that can be paid with points.

= Does it work with the block-based Cart and Checkout? =

Yes. The My Account rewards area and points redemption work with both the classic checkout and the WooCommerce Cart and Checkout blocks, so customers can apply their points wherever you've set up checkout.

= When do points expire? =

Never, by default. With a Pro license you can set an expiration window; points are then swept by a daily task.

= How is this different from other WooCommerce loyalty plugins? =

A few deliberate choices set it apart:

* **Redeem from a wallet, not a coupon.** Customers spend points directly at checkout — no auto-generated coupon codes to manage or clean up.
* **Built on custom tables, not user meta.** Balances and history live in dedicated, append-only ledger tables, so reads stay fast as your customer base grows.
* **Generous free tier.** Earning rules, redemption, the My Account area, product/cart messaging and dark mode are all free; Pro adds automation (bonuses, referrals, expiration, unlimited tiers and campaigns).
* **Clean, focused admin.** A single, uncluttered settings area rather than a sprawl of options.

= Do you offer support? =

Free users can ask questions in the WordPress.org support forum. A Pro license includes email support — write to info@australcode.io and we'll help you get your rewards program running.

== Changelog ==

= 1.0.1 =
* Fix: redeeming points now lowers the cart total by exactly the points' value in tax-inclusive stores. Previously the discount was inflated by the tax rate (e.g. it removed an extra 19% on top), because WooCommerce taxes negative fees. The redemption fee is now applied tax-free, so points settle the tax-inclusive total like a payment.

= 1.0.0 =
* Pro: advanced redemption — let customers spend points on rewards you define: a fixed-amount coupon, a percentage discount or free shipping. The plugin generates a single-use coupon they apply at checkout (classic or block-based).
* Pro: each reward has its own points cost, validity period, optional restrictions (minimum order, exclude sale items, specific categories) and a shareable/personal toggle.
* Pro: points are refunded automatically if a generated reward coupon expires without being used.

= 0.11.0 =
* Pro: earning rules — automate points with a multiplier (e.g. 2× points) or a flat bonus when an order matches conditions you set: product category, customer role, minimum order total and an active date range.
* Pro: rules run by priority — the first matching rule applies — and include a one-click “Test” that previews how a rule would have behaved over your recent orders.

= 0.10.0 =
* Pro: dedicated email that reminds customers their points are about to expire, a configurable number of days before (works with points expiration).
* Pro: optional email to a customer when you manually adjust their points from the Customers screen (off by default; bulk and CSV imports do not send it).
* Both emails are standard WooCommerce emails — enable, disable and customise them under WooCommerce → Settings → Emails.

= 0.9.0 =
* Customers: export your customers and their points balances to a CSV file (free).
* Pro: block or unblock a customer — a blocked customer stops earning and redeeming (manual admin adjustments still apply).
* Pro: bulk actions over selected customers — add points, subtract points, expire all points, or block/unblock.
* Pro: import a CSV of points adjustments (customer, points, reason), with a preview (dry run) before applying.
* Customers list now shows each customer's tier when VIP tiers are active.

= 0.8.0 =
* Pro: VIP tiers now have a colour and an optional icon, shown as a badge on the storefront.
* Pro: customers see a progress bar toward their next tier in the My Account Rewards area (and via the [acrwd_tier] shortcode/block), with how many points are left to reach it.

= 0.7.0 =
* Pro: new bonus — reward customers for completing their profile (name, phone and billing address).
* Pro: new bonus — reward customers when they reach a number of orders (e.g. their 5th order).
* Pro: new bonus — reward orders whose total reaches an amount you set, on every qualifying order.
* Pro: new bonus — reward customers when their lifetime spend crosses an amount.

= 0.6.0 =
* New: round earned points down, to the nearest, or up — your choice (down by default, so points never exceed the rate).
* New: award points on more than one order status — tick Processing as well as Completed if you award as soon as payment clears.
* New: choose whether points are earned on the price after coupons (default) or on the full price before coupons.
* New: option to skip products that are already on sale when calculating points.
* New: stop earning points on the part of an order paid for with redeemed points ("no points on points"), on by default.
* New: credit a customer's earlier guest orders when they create an account, matched by email (off by default).

= 0.5.0 =
* New: set the earning rate as a plain "for every X spent, give Y points" — no decimals to decode.
* New: a Messages tab to rewrite the storefront wording customers see (product, cart, redeem and order-email messages), in your own language.
* New: show the cash value of a customer's points balance in My Account and the [acrwd_balance] shortcode.
* New: choose where the "earn points" message appears on the product page.
* New: in-app Help (shortcodes, blocks, REST API and developer hooks) and Import (from YITH) admin pages.
* New: full Spanish (Chile and Spain) translations.

= 0.4.0 =
* New: a "Display & Widgets" settings tab to turn each storefront surface on or off (product message, cart message, My Account Rewards tab, order email, floating widget), plus the floating widget's corner.
* New: per-role earning multipliers are now a compact add/remove list instead of one row per role.
* New: shortcodes and matching Gutenberg blocks for the points balance, history, "earn X points" message and the redeem form — with attributes — so page builders (Elementor, Bricks, Divi) and the block editor can place them anywhere. Pro adds [acrwd_tier] and [acrwd_referral].
* Pro: a Referrals admin report shows who referred whom and how many converted, and the "Refer a friend" link gains a one-click Copy button.
* Fix: the customer search box no longer clips its placeholder text.

= 0.3.2 =
* Compliance: the free version no longer bundles the Pro feature code. VIP tiers, campaigns, two-sided referrals, bonus points (signup, daily login, first order, approved review, birthday) and points expiration now ship only in the Pro version. The free version is fully functional on its own.
* Admin: the menu icon now loads its CSS through the standard WordPress enqueue system.

= 0.3.1 =
* Maintenance: removed the "More by Australcode" cross-promotion section from the Upgrade screen.

= 0.3.0 =
* Admin: the customer points history and the locked Pro previews for tiers and campaigns now collapse to readable cards on mobile, matching the rest of the admin.
* Admin: refreshed admin styling — a sticky save bar on settings, clearer button states and responsive section headers.
* Maintenance: streamlined the plan model to Free and Pro, and refreshed bundled dependencies.

= 0.2.0 =
* Admin: edit existing tiers and campaigns in place (previously delete-and-recreate).
* Admin: the menu now shows the product glyph and full name, with inline guidance on the tier and campaign forms.
* Admin: the tiers and campaigns tables now collapse to readable cards on mobile, so the multiplier and edit/delete actions stay reachable on small screens.
* Frontend: the balance and history blocks now load their styles on any page (block-aware asset loading).
* i18n: complete es_CL and es_ES translations, including the Australcode family screen.

= 0.1.0 =
* Initial release: free earning (global rate + per-product/category overrides), redemption, My Account rewards, product/cart messages, floating widget, custom labels, dark mode, shortcodes and HPOS support.
* Pro: signup/daily-login/first-order/review/birthday bonuses, two-sided referrals, points expiration, unlimited tiers and campaigns, licensing via Freemius.

== Upgrade Notice ==

= 1.0.1 =
Fixes redemption discounts being inflated by the tax rate in tax-inclusive stores. No breaking changes.

= 0.4.0 =
New Display & Widgets settings, shortcodes and blocks for every rewards surface, a Pro referrals report, and UI fixes. No breaking changes.

= 0.3.2 =
Pro-only features now ship only in the Pro version; the free version stays fully functional. Internal compliance and styling fixes.

= 0.3.0 =
Mobile-friendly tables across the admin and refreshed styling. No breaking changes.

= 0.2.0 =
Edit tiers and campaigns in place, block-aware asset loading and complete es_CL/es_ES translations.

= 0.1.0 =
Initial release.
