=== Waitlytics – Back in Stock Alerts for WooCommerce ===
Contributors: eshbanbahadur
Tags: woocommerce, stock, inventory, back in stock, waitlist
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI stock forecasting, back-in-stock notifications & smart inventory management for WooCommerce.

== Description ==

**Waitlytics** transforms WooCommerce's basic stock management into an intelligent inventory system. Let customers subscribe to back-in-stock notifications, automatically email them when products restock, and (with Pro) get AI-powered demand forecasts that tell you what to reorder before you run out.

= Core Features (Free) =

* **"Notify Me" Form** — Automatically displays on out-of-stock product pages. Customers enter their email to get notified when the product is back.
* **Automatic Email Notifications** — When a product returns to stock, all subscribers are emailed automatically. No manual work needed.
* **Simple & Variable Products** — Works with simple products, variable products (per-variation), and backorder products.
* **Guest & Logged-in Support** — Both guest visitors and registered customers can subscribe.
* **Subscriber Management** — View all subscribers, their status, and which products they're waiting for.
* **Admin Alerts** — Get emailed when someone new subscribes or when stock falls below your threshold.
* **Unsubscribe Links** — Every notification email includes a one-click unsubscribe link.
* **HPOS Compatible** — Fully compatible with WooCommerce High-Performance Order Storage.
* **Lightweight & Fast** — No bloat. Loads only on pages where it's needed.

= Pro Features ($79/year) =

* **AI Demand Forecasting** — Uses AI to predict when products will go out of stock and recommends reorder quantities.
* **Smart Reorder Suggestions** — AI analyzes your sales velocity and tells you exactly what to order and when.
* **Stockout Cost Calculator** — See how much revenue you're losing from out-of-stock products.
* **Analytics Dashboard** — Track subscriber trends, most-wanted products, and conversion rates.
* **Custom Email Templates** — Design branded notification emails with a visual editor.
* **Popup Notification Form** — Eye-catching popup form for out-of-stock products.
* **Mailchimp & Klaviyo Sync** — Automatically add waitlist subscribers to your email marketing lists.
* **SMS & WhatsApp Notifications** — Notify customers via Twilio SMS or WhatsApp.
* **Double Opt-In** — GDPR-friendly double opt-in confirmation.
* **Google reCAPTCHA** — Protect forms from spam and bots.
* **CSV Export** — Download your subscriber list as CSV.
* **WooCommerce My Account** — Customers manage their stock alert subscriptions from their account page.
* **AI Weekly Report** — Automated email summary of inventory health and recommendations.

= Why Waitlytics? =

* **No credits, no SaaS fees** — Bring your own AI API key (OpenAI, Claude, or Gemini). Pay only for what you use.
* **Privacy first** — Your data stays on your server. AI features only send anonymized sales data when you explicitly run a forecast.
* **Built for WooCommerce** — Not a generic tool adapted for WooCommerce. Every feature is purpose-built for store owners.

== External Services ==

This plugin connects to the following external services for AI-powered features (Pro version only):

**OpenAI API** — Used for AI demand forecasting and inventory intelligence.
When you run a forecast, anonymized product sales data (quantities sold per day, current stock level, product price) is sent to OpenAI's API for analysis. No customer personal data is ever sent.
[Terms of Use](https://openai.com/policies/terms-of-use) | [Privacy Policy](https://openai.com/policies/privacy-policy)

**Anthropic API** — Alternative AI provider for forecasting (user configurable).
Same data as OpenAI when selected as the AI provider.
[Terms of Service](https://www.anthropic.com/legal/consumer-terms) | [Privacy Policy](https://www.anthropic.com/legal/privacy)

**Google Gemini API** — Alternative AI provider for forecasting (user configurable).
Same data as above when selected.
[Terms of Service](https://ai.google.dev/gemini-api/terms) | [Privacy Policy](https://policies.google.com/privacy)

**Freemius** — This plugin uses the Freemius SDK for license management, plugin updates (Pro version), and optional usage diagnostics.
Freemius does not collect any data unless the site administrator explicitly opts in via the consent screen shown on first activation. Opting in is optional and skipping it does not affect any plugin functionality. If opted in, Freemius collects basic WordPress environment data (WordPress version, PHP version, plugin version, site language) and the administrator's email address for update and security notifications.
[Terms of Service](https://freemius.com/terms/) | [Privacy Policy](https://freemius.com/privacy/)

No data is sent to any external service without your explicit configuration and consent. The free version of this plugin does not connect to any AI service.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/waitlytics/` or install directly through the WordPress plugin screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Ensure WooCommerce is installed and activated.
4. Navigate to **WooCommerce → Waitlytics** to configure settings.
5. The "Notify Me" form will automatically appear on out-of-stock product pages.

== Frequently Asked Questions ==

= Do I need an API key to use this plugin? =

No. The back-in-stock notification features (free version) work without any API key. AI forecasting features (Pro) require an OpenAI, Anthropic, or Google Gemini API key.

= Does it work with variable products? =

Yes. Waitlytics detects when a specific product variation is out of stock and shows the notification form for that variation. Subscribers are notified when their specific variation is restocked.

= How are customers notified? =

By email (free), or additionally by SMS and WhatsApp (Pro via Twilio). When a product's stock status changes from "out of stock" to "in stock," all active subscribers for that product are emailed automatically.

= Is it GDPR compliant? =

The free version collects only email addresses with explicit user consent (they must enter their email and click subscribe). Pro adds double opt-in and unsubscribe management. No data is shared with third parties in the free version.

= Does it work with WooCommerce HPOS? =

Yes. Waitlytics is fully compatible with WooCommerce High-Performance Order Storage (HPOS/Custom Order Tables).

= Can I customize the notification email? =

The free version uses a clean default template with your store's branding. Pro allows full customization of the email template, subject line, and content.

== Screenshots ==

1. The "Notify Me" form displayed on an out-of-stock product page.
2. Dashboard overview showing subscriber stats, most-wanted products, and recent activity.
3. Subscriber management table with status and filtering.
4. Settings page with general notification configuration.
5. Email settings for customizing back-in-stock notifications.

== Changelog ==

= 1.0.0 =
* Initial release.
* Back-in-stock email notifications for simple and variable products.
* Guest and logged-in user subscriptions.
* Admin subscriber management.
* Low stock threshold alerts.
* WooCommerce HPOS compatibility.

== Upgrade Notice ==

= 1.0.0 =
Initial release of Waitlytics — smart inventory & back-in-stock notifications for WooCommerce.
