=== Time-Based Offers for WooCommerce ===
Contributors: discussionforall
Tags: woocommerce, discount, popup, timer, fomo, behavioral
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A smart, behavioral discount system that shows a time-limited discount popup when visitors stay on a product page for a configured duration.

== Description ==

Time-Based Offers for WooCommerce is a powerful extension designed to boost your conversion rates using behavioral triggers and FOMO (Fear Of Missing Out).

Instead of showing generic popups immediately, this plugin tracks how long a user spends looking at a specific product. If they stay on the page for your configured "Trigger Time" without buying, it automatically presents a targeted, time-limited discount offer to push them towards a purchase.

Major features include:
* **Behavioral Triggers**: Show offers only to engaged users after a specific time.
* **Two-Tier Offers**: Automatically present a secondary (better) offer if the user closes the first one.
* **Countdown Timers**: Create real urgency with visual countdown timers on the product and checkout pages.
* **Detailed Analytics**: Built-in dashboard to track Impressions, Claims, Purchases, and Revenue generated by your campaigns.
* **Flexible Targeting**: Apply rules to specific products, categories, or globally.
* **Advanced Scheduling**: Date ranges, days of week, and time windows.
* **Popup Customization**: Colors, fonts, logo, and live preview in Settings.
* **Server-Side Licensing**: Free trial (email) or Pro license key with remote verification.
* **HPOS Compatible**: Fully compatible with WooCommerce High-Performance Order Storage.

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory, or install the ZIP file via the WordPress plugin dashboard.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to **Time-Based Offers → Settings** and activate either:
   * **Free Trial** — enter the email you registered on our website, then Save Trial Email
   * **Pro Plan License** — enter your license key after purchase, then Save License
4. Navigate to **Time-Based Offers → Product Rules** to create your first discount campaign.

== Licensing ==

This plugin requires an active free trial or Pro license to run.

* **Free Trial**: Register on our website, then enter the same email in Settings → Free Trial.
* **Pro License**: Purchase on our website, then enter your license key in Settings → Pro Plan License.
* **Trial expired**: Product Rules are locked and storefront popups stop until you upgrade to Pro.

== Payment Methods ==

Payments are processed on our website via Paddle (not inside WordPress):

* Google Pay, Apple Pay, PayPal, Credit/Debit Card
* Free Trial: $0 — start from Pricing → Start Free Trial
* Pro Plan: one-time payment in USD or INR
* License key available in My Account after Pro purchase

== External services ==

This plugin is a client for the Time-Based Offers service at https://woosmartdiscounts.store. It does not work without an account (free trial or Pro license).

* License / trial check (verify-license.php): your license key or trial email, your site URL and the plugin version are sent when you save them in Settings and once a day.
* Discount rules (store-rules.php): your discount rules are stored on the service. When you create, edit or delete a rule, the rule settings and the product/category name are sent. Every 6 hours the plugin downloads a signed copy of your active rules.
* Discount claims (discount-claim.php): when a shopper claims a discount, the product ID, its category IDs, the rule ID and an anonymous shopper ID (a one-way hash of the WooCommerce session ID) are sent. No names, emails or order details of shoppers are sent.

Terms of service: https://woosmartdiscounts.store/terms-of-service.php
Privacy policy: https://woosmartdiscounts.store/privacy-policy.php

== Frequently Asked Questions ==

= Does it work with caching plugins? =
Yes, the plugin uses AJAX to deliver the popup and timer, making it compatible with caching plugins like WP Rocket and LiteSpeed Cache.

= What happens when my free trial expires? =
Product Rules cannot be edited, rules show as paused on the shop, and discount popups stop appearing. Activate a Pro license to continue.

= Do I need both trial email and license key? =
No. Use one or the other. A valid Pro license works even after trial expiry.

== Changelog ==

= 1.3.0 =
* Renamed plugin to Time-Based Offers for WooCommerce (new slug: time-based-offers-for-woocommerce).
* One plugin for trial and Pro — your account plan decides the features.
* Discount rules are now stored in your Time-Based Offers account (existing rules are moved automatically on first connection).
* Discount rules and discounts are signed by the Time-Based Offers service and verified by the plugin.

= 1.2.8 =
* Renamed plugin to Smart Discounts for WooCommerce (WordPress.org trademark compliance).
* Separate Free Trial and Pro Plan License settings sections.
* Server-side license verification with trial expiry enforcement.
* Product Rules and frontend locked when trial expires (no valid Pro license).
* Improved license cache and access control.

= 1.0.0 =
* Initial release.
