=== STS Stock Alerts for WooCommerce ===
Contributors: piotrprach
Tags: woocommerce, stock, ecommerce
Requires at least: 6.5
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

One-time stock alerts for simple products and individual variations.

== Description ==

STS Stock Alerts for WooCommerce is an original, focused extension by Simple Trade Solutions. It requires WooCommerce 9.0 or later.

The Free plugin works on its own with no trial period or license requirement.

* One-time stock alerts for simple products and individual variations
* Email double opt-in with two-day confirmation expiry
* Confirmation and unsubscribe links display POST confirmation forms; GET never mutates state
* Fresh session-bound anti-CSRF nonce compatible with cached product pages
* Atomic hashed rate limits and honeypot; no stored raw IP addresses
* Indexed queue with atomic claims and bounded five-minute batches
* Up to three delivery attempts for explicit mail failures
* Interrupted sends marked uncertain rather than automatically duplicated
* Stock-change hooks plus bounded reconciliation
* Configurable retention, indexed cleanup, privacy export and erasure
* Masked-email admin diagnostics and manual recovery

Optional Pro: https://simpletradesolutions.com/sts-stock-alerts-pro-en/

== Installation ==

1. Install and activate WooCommerce.
2. Upload this plugin folder or install its ZIP through Plugins > Add New.
3. Activate the plugin.
4. Configure WooCommerce → Stock alerts; Pro: WooCommerce → Stock demand.
5. Test your product, cart and account templates on a staging copy before use.

== Frequently Asked Questions ==

= Where do I place the feature? =

[sts_stock_alert product_id="123"]

= What is deliberately outside this release? =

* wp_mail acceptance is not proof of inbox delivery; production requires a working mail service.
* WP-Cron requires traffic or a server cron trigger.
* Availability is checked before sending but stock is not reserved.
* If a worker crashes during delivery, manual review is required because delivery status is uncertain.
* Queues reconcile 100 active requests and send at most the configured 1–50 emails per run; large queues drain over multiple runs.
* Guest session cookie lasts one hour and is used only for form security.
* Standard WooCommerce hooks or the supplied shortcode are required.
* No marketing campaigns, SMS or external email verification service.
* Retention settings apply on a new lifecycle state; changing them does not rewrite existing expiry dates.

= Is performance guaranteed? =

No. Assets are scoped to relevant screens and request batches are bounded, but performance depends on the store, theme and other extensions. No competitor benchmark is claimed.

== Privacy and external services ==

Subscribers provide their email, product choice and explicit transactional consent. Email, keyed email hash, confirmation hash, locale, quantity, state and timestamps are stored locally. Unconfirmed requests expire after two days; confirmed requests default to 90 days; completed/failed requests default to 30 days. Anonymous HMAC rate-limit buckets expire and do not retain raw IP addresses. A random HttpOnly SameSite security cookie lasts one hour. Messages go through the configured WordPress mail service; no external marketing or verification service is used. WordPress privacy export/erasure and token-based unsubscribe are available. Pro demand exports exclude email addresses.

== Uninstall ==

Deactivation keeps data. The Free settings screen contains an explicit remove-data-on-uninstall option. When enabled, uninstall removes this plugin’s own settings/metadata/tables; it does not delete WooCommerce products or orders.

== Screenshots ==

1. Free one-time stock alert form with explicit consent; fictional demo address, no real email delivery.

== Changelog ==

= 1.0.0 =
* First original release with the features documented above.
