=== refatbd Advanced SMS for WooCommerce ===
Contributors: refatbd
Tags: woocommerce, sms, notifications, order sms, admin sms
Requires at least: 5.6
Tested up to: 7.0
WC requires at least: 3.0
WC tested up to: 8.8
Stable tag: 2.3.0
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Requires Plugins: woocommerce

Enhanced SMS notifications for WooCommerce orders with product rules, history, and a debug log.

== Description ==

This plugin is a significantly enhanced fork of the original 'SMSQ Notifications for WooCommerce' plugin. This new version includes an SMS history, a debug log, product-specific rules, and has been updated for compatibility with modern versions of WooCommerce and WordPress.
Original plugin: https://wordpress.org/plugins/smsq-notifications-for-woocommerce/

**refatbd Advanced SMS for WooCommerce** extends your store by enabling automated SMS notifications to customers and administrators for various order events. It offers a modern interface and advanced features like product-specific SMS rules, an SMS history log, and a persistent debug log.

**Key Features:**

* **Plugin Toggle:** Easily enable or disable all SMS notifications with a single switch.
* **Status-Based SMS:** Send custom SMS messages to customers when their order status changes.
* **Admin Notifications:** Notify store administrators via SMS for new orders.
* **Customer Note SMS:** Alert customers via SMS when a new note is added to their order.
* **Product-Specific Rules:** Send or don't send SMS based on products in the order.
* **Customizable Templates:** Use a wide range of placeholders to personalize SMS messages.
* **On-Hold Reminders:** Automatically send reminder SMS messages for orders on-hold.
* **SMS History:** Keep a log of all sent SMS messages.
* **Debug Log:** A dedicated tab to view detailed debug information.
* **International SMS Support:** Option to enable/disable international prefixes.
* **Multiple Admin Phones:** Configure multiple admin phone numbers to receive notifications.
* **SMSQ API Integration:** Securely connect to your SMSQ account.
* **API Balance Check:** View your SMSQ account balance from plugin settings.
* **WPML Compatible:** Message templates are translatable with WPML.
* **Modern Admin Interface:** Redesigned settings page with tabs for easier navigation.

To use this plugin, you need an active account with [SMSQ Global](https://smsq.global) and SMS credits.

== External services ==

This plugin connects to the SMSQ Global API to send SMS notifications. This is a core feature of the plugin and is essential for its functionality.

* **Service:** SMSQ Global
* **What it is used for:** Sending SMS messages for order status updates, customer notes, and admin notifications.
* **What data is sent:** When an SMS is sent, the plugin sends the recipient's phone number, the message content, and your API credentials (API Key, Client ID, Sender ID) to the SMSQ Global API.
* **Terms of Service:** [https://smsq.global/terms-and-conditions](https://smsq.global/terms-and-conditions)
* **Privacy Policy:** [https://smsq.global/privacy-policy](https://smsq.global/privacy-policy)

== Installation ==

1.  **Automatic Installation:**
    * In your WordPress dashboard, go to `Plugins > Add New`.
    * Search for "refatbd Advanced SMS for WooCommerce".
    * Click "Install Now" and then "Activate".
2.  **Manual Installation:**
    * Download the plugin ZIP file.
    * In your WordPress dashboard, go to `Plugins > Add New` and click "Upload Plugin".
    * Choose the downloaded ZIP file and click "Install Now", then "Activate".
3.  **Configuration:**
    * Navigate to `WooCommerce > refatbd Advanced SMS`.
    * Enter your SMSQ API Key, Client ID, and Sender ID in the "API Settings" tab.
    * Configure other settings and save changes.

== Screenshots ==

1.  Admin Settings - General Tab
2.  Admin Settings - Customer Messages Tab
3.  Admin Settings - Admin Messages Tab
4.  Admin Settings - API Settings Tab
5.  Admin Settings - Product Rules Tab
6.  Admin Settings - Advanced Tab
7.  Admin Settings - History Tab

== Changelog ==

= 2.0.1 =
* SECURITY: Hardening and security enhancements.
* FIX: All issues from the WordPress plugin review team have been addressed.
* NEW: Added "Requires Plugins" header for WooCommerce dependency.
* NEW: Added contributor "refatbd".
* FIX: Corrected text domain to match the plugin slug.
* FIX: Prefixed all functions, classes, and options with "refaadsm_" to avoid conflicts.
* FIX: Enqueued scripts and styles correctly, removing inline tags.
* NEW: Added documentation for the external SMSQ Global service.

= 2.0.0 =
* MAJOR FORK: Plugin has been forked, renamed, and completely refactored to ensure modern compatibility and avoid conflicts.
* NEW: All functions, options, and constants are now prefixed with `asw_` to prevent conflicts with other plugins.
* NEW: Updated author information and links to new documentation and support pages.
* MAINTENANCE: Codebase cleanup and alignment with modern WordPress coding standards.

= 1.7.0 (Original Plugin Base) =
* Initial features from the original SMSQ Notifications plugin up to version 1.7.0.

== Upgrade Notice ==

= 2.0.0 =
This is a major fork and rewrite of the original "Enhanced SMSQ Notifications for WooCommerce" plugin. It is not a direct upgrade. Please uninstall the old version and install this one as a new plugin. You will need to re-configure your settings.
== Changelog ==

= 2.3.0 =
* NEW: Multi-gateway support - send through SMSQ Global, a configurable Generic HTTP gateway (works with most BD/global providers), or Twilio. Selectable on the API Settings tab and configured on the new Gateways tab.
* NEW: Phone verification (OTP) at checkout - require customers to confirm their number with a one-time code before placing an order.
* NEW: Cash on Delivery confirmation - send a one-tap confirm link (and optional reply-to-confirm) for COD orders, then auto-advance the order status.
* NEW: Shipment tracking - per-order tracking number and courier box, with %tracking_number%, %tracking_url% and %courier% placeholders and auto-SMS on a chosen status. Built-in patterns for Pathao, Steadfast, RedX and Paperfly.
* NEW: Abandoned cart recovery - capture checkout contact details and send a reminder SMS (with an optional unique coupon) when no order follows.
* NEW: Background queue and scheduling - process large broadcasts in throttled background batches using Action Scheduler, with an optional scheduled start time.
* NEW: Delivery reports (DLR) and inbound replies - REST webhooks record delivery status and handle STOP opt-out and COD reply confirmation.
* NEW: Consent and opt-out - optional checkout consent checkbox and a global suppression list honored before every send.
* NEW: Low balance alerts - daily check of your SMSQ credit with email and/or SMS alerts.
* NEW: Birthday and win-back automations - daily messages (with optional coupons) to celebrate birthdays and re-engage lapsed customers.
* NEW: Send Test SMS button on the API Settings tab.
* NEW: Export SMS history to CSV, plus Provider and Delivery columns in the history table.
* All new features are individually toggleable and configurable from the settings screen.

= 2.2.0 =
* NEW: Complete Admin UI Redesign - Modernized the entire plugin settings interface with beautiful animated gradients, glassmorphism, floating cards, and a new modern font (Outfit).
* NEW: Multiple API Credentials - You can now add, edit, and manage multiple SMSQ API credentials simultaneously and seamlessly switch between them using an "Active" toggle.
* NEW: Individual Balance Checks - Added the ability to check the API balance for each individual credential directly from the new credentials manager table.
* NEW: Modern Toast Notifications - Replaced standard browser alerts with beautiful, color-coded toast notifications that slide in and fade out elegantly when checking your balance.
* IMPROVED: Log & History Tables - Added scrollable containers for log messages and SMS history texts to prevent long messages from breaking the table layout.
* IMPROVED: Pagination UI - Upgraded the pagination links in the Logs and History tabs to look like modern, interactive pills with smooth hover and active state animations.
* IMPROVED: Global SMS Recipient Count - The estimated recipient count is now styled as a beautiful modern badge and perfectly vertically aligned with the action buttons.
* IMPROVED: Persistent Active Balance - The global balance display at the top of the API Settings tab now intelligently displays the balance of whichever credential is currently set as "Active".

= 2.1.0 =
* NEW: Global SMS Broadcast feature — send bulk SMS to all users, purchasing customers, high-frequency buyers (5+ orders), buyers of a specific product, or a manually entered phone number.
* NEW: Number type filter for Global SMS — choose to send to Bangladeshi numbers only, International numbers only, or both.
* NEW: Recipient count preview — see how many unique numbers will receive the SMS before sending.
* NEW: Product dropdown with live search (Select2) on the Global SMS Broadcast page.
* NEW: Manual number input for sending a one-off SMS to any single phone number.
* NEW: Character/SMS-part counter on the broadcast message field.
* IMPROVED: Plugin menu moved from under WooCommerce to a dedicated top-level WordPress admin menu ("Advanced SMS") with a sub-menu for Settings and Global SMS Broadcast — easier to find for new users.
* FIXED: Typo in admin JS i18n object (`i1en` → `i18n`).

= 2.0.1 =
* Maintenance release — bug fixes and compatibility improvements.

