=== Loyalty for WooCommerce - Points and Rewards / Loyalty Program ===
Contributors: yoohw, baonguyen0310
Tags: loyalty, points, rewards, woocommerce, customer retention
Requires at least: 6.3
Tested up to: 7.0
WC tested up to: 10.8
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Create a flexible loyalty and rewards program for WooCommerce—reward customers with points, increase retention, and grow repeat sales.

== Description ==

**Loyalty for WooCommerce – Points and Rewards / Loyalty Program** helps you turn one-time buyers into loyal customers by rewarding meaningful actions with points that can be redeemed for discounts.

Built specifically for WooCommerce, the plugin integrates cleanly into your existing store workflow—orders, cart, checkout, and customer accounts—without slowing down checkout or conflicting with coupons.

Whether you want to:
- Increase repeat purchases  
- Prevent discount abuse  
- Reward long-term customers  
- Or build a scalable loyalty system  

this plugin gives you a solid foundation—**free to start, powerful when upgraded**.

[Premium version](https://yoohw.com/product/woocommerce-loyalty/) | [Documentation](https://yoohw.com/docs/category/woocommerce-loyalty/) | [Support](https://yoohw.com/support/) | [Demo](https://sandbox.yoohw.com/demo/wclp_demo.html)

== Highlights (Free Version) ==

- Earn points for purchases and core customer actions
- Redeem points directly at cart or checkout
- Show a frontend Loyalty bubble with program rules and customer reward details
- Prevent stacking points with coupons (single-discount logic)
- Admin points log with manual reward/deduct tools
- Lightweight, translation-ready, and developer-friendly

> Need advanced product/category rules, redeemable products, referrals, and automation? **Upgrade to Premium anytime.**

== Features ==

* **Points for Purchases & Actions**
  - Award points based on order totals
  - Support for additional actions such as account registration and reviews

* **Flexible Points Redemption**
  - Redeem points as cart or checkout discounts
  - Clear customer-facing messaging during checkout
  - Optional single-use discount logic to prevent abuse

* **Frontend Loyalty Bubble**
  - Display a floating Loyalty bubble on the storefront
  - Explain active reward levels, earning rules, bonus rewards, and redemption options
  - Show logged-in customers their current level, available points, and progress
  - Let guests quickly discover the program and create an account
  - Choose bottom-left or bottom-right placement in Customization settings

* **Discount Control & Fair Usage**
  - Block coupon usage when points are applied (and vice versa)
  - Support WooCommerce “Individual use only” behavior for point-based discounts

* **Admin Points Management**
  - View a full points transaction log per customer
  - Manually reward or deduct points from the admin dashboard
  - Clear descriptions and color-coded point changes

* **WooCommerce Native Integration**
  - Compatible with Classic Checkout, Block Checkout, and third-party checkout plugins
  - Works with WooCommerce coupons, fees, and order totals
  - HPOS compatible

* **Translation & Developer Friendly**
  - Fully translation-ready (.pot included)
  - Clean hooks and filters for customization

== Premium Features ==

Upgrade to **Loyalty for WooCommerce – Premium** to unlock a complete loyalty and retention system.

=== Tiered Loyalty Levels ===
- Create unlimited loyalty levels (Bronze, Silver, Gold, VIP, etc.)
- Automatically upgrade or downgrade users based on earned points
- Assign exclusive perks and discounts per tier
- Optional periodic resets (monthly, quarterly, yearly)

=== Advanced Points Rules ===
- Choose which **order statuses** earn or deduct points
- Include or exclude **taxes, shipping, and coupons** from calculations
- Set product-level and category-level earning rules
- Enable **point expiration** with flexible timing rules

=== Bonus & Achievement Points ===
Earn points for:
- Account registration
- Daily login
- First purchase
- Birthday & account anniversary
- Profile completion
- Product reviews
- Order milestones & lifetime spend
- High-value orders
- Selected payment methods
- Win-back after inactivity
- Custom achievement rules

=== Smart Redemption Options ===
- Redeem points as:
  - Cart discounts
  - Coupon codes
  - Free shipping rewards
  - Selected products
- Minimum redemption thresholds
- Automatic coupon expiration rules

=== Referral System ===
- Link-based referral tracking
- Coupon-based referral rewards
- Reward both referrer and referee
- Customizable coupon formats and values

=== Front-End Display & Transparency ===
- Show points balance and tier progress in **My Account**
- Display earning messages on product, cart, and checkout pages
- Clear, trust-building explanations of how points are earned and spent

=== Automated Notifications ===
- Email alerts when users earn or redeem points
- Notifications for tier upgrades
- Expiration reminders for unused points

> **Get Premium:** https://yoohw.com/  
Includes priority support, frequent updates, and full documentation.

== Benefits & Use Cases ==

* **Increase Repeat Purchases** – Give customers a reason to come back
* **Protect Margins** – Prevent stacking discounts and coupon abuse
* **Reward Loyalty Fairly** – Transparent rules build trust
* **Boost Engagement** – Encourage reviews, logins, and account activity
* **Scale with Confidence** – Works for small shops and high-volume stores

Have questions or feature ideas?  
Visit our [Support Forum](https://wordpress.org/support/plugin/loyalty-for-woocommerce/) or [contact us](https://yoohw.com/contact-us).

== Installation ==

1. **Upload Plugin**: Upload the `loyalty-for-woocommerce` folder to `/wp-content/plugins/`.
2. **Activate Plugin**: Activate through **Plugins → Installed Plugins**.
3. **Prerequisites**: Ensure **WooCommerce** is installed and active.
4. **Quick Start**: Go to **WooCommerce → Settings → Loyalty** to set earning and redemption rules.

== Frequently Asked Questions ==

**Q: How do customers redeem their points?**  
A: On Cart or Checkout, a **Redeem Points** control appears when a customer’s balance is sufficient. They pick an amount, and the discount is applied automatically.

**Q: How do I create or modify loyalty tiers (levels)?** *(Premium)*  
A: Go to **WooCommerce → Settings → Loyalty → Levels**. Add levels, set thresholds, and configure perks. You can also enable automatic monthly/quarterly/yearly resets.

**Q: How do I change the point-to-currency conversion rate?**  
A: Go to **WooCommerce → Settings → Loyalty → General** and set the conversion (e.g., **100 points = $5**). Discounts recalculate automatically during redemption.

**Q: Can I import customer point balances?**  
A: Yes. Use **WooCommerce → Settings → Loyalty → Tools → Import/Export**. Download the CSV sample, edit offline, and re-upload to sync.

**Q: Does it support point expiration?** *(Premium)*  
A: Yes. Enable expiration and define rules (duration, grace, notices) under **Loyalty → General → Expiration**.

**Q: Is it translation-ready?**  
A: Yes. A `.pot` file is included in `/languages/`. Use **Loco Translate** or **Poedit**.

== Compatibility ==

- Works with standard WooCommerce product types and most popular payment/shipping setups.
- Designed to be theme-friendly; frontend templates can be overridden.
- Developers: actions and filters available for deeper integration.

== Developer Notes ==

- Hooks are available across earning, redemption, and logging flows to customize behavior.
- All user-facing strings are localized.
- GDPR-friendly: the plugin stores only the data needed for loyalty accounting (points, actions, timestamps).

== Changelog ==

= 1.2.1 (Jun 6, 2026) =
* Fix: Added a WooCommerce runtime guard for older WordPress versions that do not enforce plugin dependencies.
* Fix: Removed unnecessary guest AJAX handlers from loyalty points actions.
* Improve: Cleaned translation text domains, translator comments, and package metadata for WordPress.org readiness.

= 1.2.0 (Jun 1, 2026) =
* New: Added a frontend Loyalty bubble that explains the active free loyalty program, including reward levels, earning rules, bonus rewards, point redemption, and customer reward summary.
* New: Added Customization settings for Loyalty bubble visibility and bottom-left/bottom-right placement.
* New: Added premium previews for Advanced earning rules and Redeem products in the General settings.

= 1.1.5 (Apr 27, 2026) =
* Improve: Optimized and cleaned functionality. 
* Improve: WooCommerce 10.7 compatibility.

= 1.1.4 (Feb 6, 2026) =
* Improve: WooCommerce version 10.5 compatibility.

= 1.1.3 (Oct 15, 2025) =
* Fix: Uncaught TypeError `call_user_func_array()` throws “class not found”.
* Fix: Added the null-coalescing fallback fixes the immediate warnings in the first start.
* Fix: Added the missing default settings of the message for guest.

= 1.1.2 (Jun 13, 2025) =
* New: Integrated the WooCommerce Advanced Accounts plugin.
* Update: Reorder the `Loyalty` settings tab.
* Fix: Issue of the JavaScript performance in account page.
* Improve: WooCommerce version 9.3 compatibility.

= 1.1.1 (May 6, 2025) =
* New: Added membercard background and border color options.
* Improve: Updated the frontend CSS displaying.

= 1.1.0 (Apr 24, 2025) =
* New: Added optionals to display the message for guests on the shop and product pages.
* New: Added option to set the message icon.
* Update: Loyalty card displaying on mobile screens.
* Improve: WordPress compatibility to 6.8.
* Improve: WooCommerce compatibility.

= 1.0.9 (Feb 25, 2025) =
* New: Extra points - Daily login.
* New: Extra points - Level up.
* Fix: Cannot load more points table on the My Account page.

= 1.0.8 (Feb 18, 2025) =
* Fix: Error during leaving a review for the product.
* Improve: WooCommerce compatibility.

= 1.0.7 (Jan 22, 2025) =
* Fix: Update to work on some sites with `dbDelta()` enforces strict checks.

= 1.0.6 (Jan 13, 2025) =
* New: Added Tools > Redefine the loyalty level option.
* Improve: Updated to display points, log modals immediately.
* Improve: Added CSS for upload form of import tool.

= 1.0.5 (Dec 29, 2024) =
* New: Added Tools > Import user points and earning points.
* Improve: Display level name instead of level slug and some improvements at email notifications.

= 1.0.4 (Dec 20, 2024) =
* Improve: The loyalty is only available for those user roles that have set.
* Improve: Point card heading updated.

= 1.0.3 (Dec 14, 2024) =
* Fix: The notice cannot be dismissed.

= 1.0.2 (Dec 12, 2024) =
* Fix: Missing the Add / Remove roles button.
* Improve: The notices will only display for administrators.

= 1.0.1 (Dec 7, 2024) =
* Improve: Close points log modal when clicking outside of the form.
* Improve: Added missing language strings.
* Fix: Empty log message. 

= 1.0.0 (Nov 6, 2024) =
* First released.
