=== Textbari WhatsApp Solution ===
Contributors: textbari
Tags: woocommerce, whatsapp, order notifications, whatsapp api, order status
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 2.0.5
WC requires at least: 8.0
WC tested up to: 10.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send automatic, rate-limited WhatsApp notifications for every WooCommerce order status — including custom statuses — from your own QR-linked WhatsApp account.

== Description ==

Textbari WhatsApp Solution connects a WhatsApp account to WooCommerce (via QR scan through a self-hosted gateway) and automatically messages customers as their order moves through each status. It is built entirely on hooks for clean, extensible code, and ships with a serious **ban-protection** engine so your number stays healthy.

= Key features =

* **QR connection** right inside wp-admin — scan once, stay linked (session persists in the gateway).
* **Every order status supported, including custom statuses** — templates are generated automatically for any status registered with WooCommerce.
* **Editable message templates** per status with 20+ placeholders and WhatsApp formatting (*bold*, _italic_).
* **Ban-protection limits**: hourly, daily, weekly and monthly caps; randomised human-like delays; quiet/rest hours; gradual warm-up ramp for new numbers.
* **Durable queue** with automatic retry and a full message log.
* **Admin order alerts** to one or more numbers on chosen statuses.
* **Customer opt-in** checkbox at checkout (consent-based sending).
* **Developer-friendly**: dozens of filters and actions to customise every step.
* **HPOS + Blocks compatible**, translation-ready.

= Requirements =

This plugin talks to a self-hosted WhatsApp gateway (Node.js + Baileys) that owns the actual WhatsApp connection. Point the plugin at your gateway URL under **Connection**.

> WhatsApp does not officially permit automated sending through personal/business apps. Use responsibly, message only opted-in customers, and keep volumes modest. For a fully compliant setup, use the official WhatsApp Business Cloud API.

== Installation ==

1. Upload the `textbari-whatsapp-solution` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Go to **Textbari WhatsApp → Connection**, enter your gateway URL, save, then click **Connect / Show QR** and scan it.
4. Configure limits and templates. Done.

== Changelog ==

= 2.0.5 =
* Maintenance release.

= 2.0.4 =
* Fixed: the "update available" banner no longer lingers on the Plugins page after a successful update — WordPress's plugin-update cache is now cleared automatically when an update completes.

= 2.0.3 =
**Update management**
* Added a "Check for updates" link on the WordPress Plugins page (replaces the "Visit plugin site" link) — forces an immediate check against the server and shows the result as an admin notice.
* Update checks now clear their cache automatically when you open the Plugins or Updates screen, and on force-check, so newly released versions appear promptly instead of waiting for WordPress's 12-hour cycle.
* One-click auto-update from the central panel with correct package folder handling and license-authenticated downloads.

**Connection & diagnostics**
* WhatsApp Account tab now shows a clear Registration status (Registered / Not registered) with a "Test connection" button.
* Failed registrations display the real reason (unreachable server, HTTP 404, SSL error, invalid registration key) instead of a generic "connecting" message.
* Gateway URL is fixed in code; the connection screen is simplified to a single WhatsApp Account section.
* Optional registration secret can be supplied via define('TWS_REGISTER_SECRET', '...') in wp-config.php.

**Message logs**
* The Message Log tab now shows the full server-side log (all sent, received, test and order messages) for this site's WhatsApp account, not just the local order queue.
* Local order-notification queue with retry for failed items is still shown for delivery troubleshooting.

**Fixes & polish**
* Fixed the modal/close behaviour and various UI issues in the admin panel.
* Hardened phone-number normalisation and placeholder rendering.
* General stability and compatibility improvements (WooCommerce HPOS, block checkout, WP 6.8).

= 2.0.2 =
* test update

= 2.0.1 =
* Connection diagnostics on the WhatsApp Account tab (Test connection button + clear error messages).
* Full server-side message log in the Message Log tab.
* Faster plugin update detection.

= 2.0.0 =
* Central admin panel: per-site licensing, connected accounts, global message logs, send-from-any-gateway, plugin auto-update server, WhatsApp broadcasts.
* Hardcoded gateway URL; simplified the connection screen to a single WhatsApp Account section.
* One-click self-update from the panel.

= 1.0.0 =
* Initial release.
