=== Valabi NotifyMe ===
Contributors: valabi
Tags: woocommerce, back in stock, sms, notification, kavenegar, ippanel
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 0.5.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

اطلاع‌رسانی پیامکی و ایمیلی موجود شدن کالاهای ناموجود برای ووکامرس — هم محصولات ساده و هم تنوع‌ها.

== Description ==

Valabi NotifyMe lets your customers leave their phone number on out-of-stock WooCommerce products and receive an SMS the moment stock returns. Built for Iranian gateways (Kavenegar, IPPanel), supports product variations, and uses Action Scheduler so large subscriber lists never block your admin requests.

Highlights:

* Simple products + specific variations (button only shows when the selected variation is out of stock)
* SMS via Kavenegar or IPPanel — pattern-based or plain
* Optional email channel
* Action Scheduler-based fan-out — no PHP timeouts on big lists
* Per-product subscriber metabox + CSV export
* Dashboard with most-wanted products, recent sends, failed-with-retry
* Conversion tracking — credits later orders back to the notification, with recovered-revenue + conversion-rate KPIs
* Auto-coupon incentive — a unique, single-use, time-limited coupon in each restock SMS ({coupon} variable)
* Quiet hours — hold notifications overnight and release them in a configurable morning window
* Social proof — "N people are waiting for this item" counter on the product page
* Anti-spam: honeypot + IP rate limit + nonce
* Test mode for dry-running the configuration
* Translation-ready, RTL-friendly
* Self-update via the Valabi update endpoint

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate it from the Plugins screen.
3. Go to *Valabi NotifyMe → Settings* and configure your SMS driver.

== Changelog ==

= 0.5.3 =
* Frontend redesign: cleaner, tighter "Claude-style" button and popup with an accent badge, leading field icons, and far less empty space.
* Icons are now inline SVG (served from your own site) — fixes the button icon that previously didn't render; nothing is loaded from external sources.
* New: customizable accent colour. Pick a preset swatch or any hex code (Display tab) and the button + popup re-theme to match your brand, with automatic readable text colour.
* New: optional email field in the popup, with its own enable/disable toggle (Display tab), independent of whether the email channel sends mail.

= 0.5.2 =
* Fix (important): the per-product subscribers metabox rendered a nested <form> inside the product editor, which hijacked the "Update" button (saving a product bounced to the products list without saving). The metabox is now form-free — the row delete is a nonce-protected link — so product/order editing works normally.
* Settings: each SMS panel (and every settings section) is now a collapsible accordion; the active SMS panel opens by default, keeping the page tidy.

= 0.5.1 =
* IPPanel: switched to the production-proven "Edge" API (edge.ippanel.com, raw Authorization key, /api/send with sending_type webservice|pattern), recipients normalized to E.164 (+98). Replaces the older api2.ippanel.com + AccessKey transport.
* Kavenegar: tokens are now sanitized per slot — token/token2/token3 are strict (links stripped) and token10/token20 are relaxed (accept URLs). The product link now defaults to token10, fixing pattern sends that previously failed when a URL landed in token2.
* Both panels: recipient phone numbers are normalized before sending; updated setup guides accordingly.

= 0.5.0 =
* New: conversion tracking — orders are credited back to the notification that prompted them; dashboard shows recovered revenue and conversion rate.
* New: auto-coupon incentive — a unique, single-use, time-limited, product-restricted coupon per notification, available as {coupon} / {coupon_expiry} in SMS and email.
* New: quiet hours — hold notifications during an overnight window and release them in the morning (Action Scheduler based).
* New: social-proof waitlist counter on the product page ("N people are waiting"), with a minimum-count threshold.
* Fix: stock-write storm — fan-out jobs are now only enqueued when a product actually has pending subscribers, and de-duplicated within a request.
* Fix: email is now sent as HTML (matching the "HTML allowed" hint), with newlines and bare URLs auto-formatted.
* Fix: uninstall now also removes the rate-limiter transients.
* Fix: CSV export hardened against spreadsheet formula injection.
* Settings: new "تبدیل و مشوق‌ها" tab; per-feature inline setup guides.

= 0.4.0 =
* SMS pattern variables are now operator-mappable ("name = value") for both Kavenegar and IPPanel.

= 0.1.0 =
* Initial release.
