=== Stock Scout – Back in Stock Alerts for WooCommerce ===
Contributors: devkitse
Tags: woocommerce, back in stock, stock alert, waitlist, product notification
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Never miss a restock — Stock Scout emails your customers the moment a WooCommerce product is back in stock.

== Description ==

Stock Scout – Back in Stock Alerts for WooCommerce lets visitors request a one-time email when a simple product or a selected variation becomes available again.

Core features:

* Simple and variable product support.
* Alerts become active immediately; no confirmation click is required.
* Immediate receipt email for each alert with a secure unsubscribe link.
* One-time back-in-stock notification.
* A completed or cancelled alert is deleted rather than retained as customer history.
* WooCommerce email templates and email settings.
* Action Scheduler queueing when available through WooCommerce, with a WP-Cron fallback.
* Stock Alerts screen under the WooCommerce menu showing current alerts only.
* Watcher count per product, and a running total of alerts and products watched.
* Search by email or product name.
* Sort by product, watcher count, email, creation date, or status.
* Per-row deletion protected by capability checks and WordPress nonces.
* WordPress personal-data exporter and eraser integration.
* No telemetry, remote marketplace feed, advertising, or external API calls.

The plugin uses a dedicated WordPress database table. It does not modify WooCommerce order storage.

== Privacy ==

The plugin stores the email address, product or variation identifiers, alert status, an unsubscribe-token hash, and timestamps needed to provide the requested stock alert.

The alert becomes active immediately. The visitor receives a receipt email with a link to cancel the alert. Cancelling the alert deletes that alert record. When the item becomes available and the stock notification is sent successfully, that alert record is also deleted. If the same email address has other active alerts, only those separate active records remain.

For abuse resistance, the plugin can keep a short-lived one-way hash derived from the connecting IP address in a WordPress transient for up to one hour. The raw IP address is not stored by this plugin.

The plugin does not contact external services. Email is sent through the WordPress/WooCommerce mail system configured by the site owner.

The plugin integrates with WordPress Tools > Export Personal Data and Tools > Erase Personal Data.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin folder or ZIP through Plugins > Add New.
3. Activate Stock Scout – Back in Stock Alerts for WooCommerce.
4. Configure the two email types in WooCommerce > Settings > Emails.
5. View current subscriptions under WooCommerce > Stock Alerts.

== Frequently Asked Questions ==

= Does a visitor need to confirm the alert by email? =

No. The alert becomes active immediately. The visitor receives a receipt email containing a secure link that removes that specific alert.

= What happens after the back-in-stock email is sent? =

That alert row is deleted. The plugin does not retain a completed alert history containing the email address.

= What if the same email address has alerts on several products? =

Each product or variation is a separate alert row. Completing or cancelling one alert deletes only that row. The email address remains only in any other active alert rows.

= Does deactivating the plugin delete subscriptions? =

No. Deactivation keeps the table and current subscription records.

= What happens when I delete the plugin? =

Deleting the plugin through WordPress runs uninstall.php, which removes the plugin-owned subscription table, the version option, the rate-limit transients and every job the plugin scheduled. On a multisite network this is done for each site.

= Does the plugin use an external service? =

No.

= Why does the unsubscribe link not use a WordPress nonce? =

The unsubscribe link is used by visitors who may not be logged in. It uses a cryptographically random, single-purpose bearer token whose hash is stored in the database. WordPress nonces are used for authenticated admin actions and the public AJAX form uses a WordPress AJAX nonce as CSRF protection.

== Changelog ==

= 1.0.3 =
* The subject and email heading fields in WooCommerce > Settings > Emails are now pre-filled with the default, editable text instead of showing it only as placeholder hint text.

= 1.0.2 =
* Stock Alerts screen now links directly to WooCommerce > Settings > Emails for changing the subject, email heading and email type.

= 1.0.1 =
* First public release.
