=== Automation Web Platform – Notifications, OTP, and Advanced Phone Field ===

Contributors: 101Gen, wawp, ahmedsafaa
Tags: automation, whatsapp, abandoned carts, wawp, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 9.6
Stable tag: 5.6.16
License: GPLv3 or later
License URI: https://opensource.org/licenses/GPL-3.0

Automation Web Platform (Wawp) - Automate notifications, secure your store with OTP, and optimize checkout with an advanced phone field.
 
== Description ==

Tired of manually sending WhatsApp order updates and payment follow-ups?   
Let **Wawp** handle it all—right from your WhatsApp!

and more—all in one powerful plugin.

**More automation, less work—sell smarter with Wawp! ✨**

This plugin relies on the Wawp.net SaaS service. You can find our Terms of Service at https://wawp.net/terms-of-services/ and Privacy Policy at https://wawp.net/privacy-policy/.


== 🤖 Automated Notifications ==

✅ **New Order Notification** – Send WhatsApp message to customers with order details after checkout.  
✅ **Order Status Updates** – Notify customers automatically about changes to their order status.  
✅ **Admin/Staff Alerts** – Receive real-time WhatsApp alerts for new orders and status changes.  
✅ **After Purchase Upsell** – Schedule follow-up messages to re-engage customers and boost sales.  
✅ **Pending Payments** – Send gentle reminders for pending payments, to get paid faster.  
✅ **Product Reviews** – Collect product reviews on auto-pilot with customized WhatsApp messages.

**Notification types:**

Pending payment: Notify customers about unpaid orders.
On hold: Inform about orders waiting for payment confirmation.
Processing: Let customers know their order is being prepared.
Completed: Confirm successful order delivery.
Failed: Notify customers of failed transactions.
Draft: Keep track of unfinished orders.
Canceled: Alert customers when an order is canceled.
Refunded: Inform about successful refunds.
Customer Note: Send custom updates directly to customers.
Custom Status: Set up notifications for any custom status.

== 🔐 User Authentication ==

✅ **Blacklist Numbers** — Block Fake and Spam users to prevent abuse and secure your site.  
✅ **Fully customizable** — Colors, logo, and text – control your login looks, without technical effort.  
✅ **Multiple login options** — Enable login via WhatsApp, Email OTP, or Email & Password.  
✅ **Signup Verification** — Verify new accounts via WhatsApp or Email OTP.
✅ **Role-Based Redirects** — Redirect users to specific pages based on their roles after login.
✅ **Welcome message** — Send personalized welcome messages to introduce your brand to new customers.
✅ **User Login Alerts** — Get instant notifications for user logins and signups to ensure security.
✅ **Google ReCAPTCHA** — Secure Login, Registration, and Lost Password forms with ReCAPTCHA v2/v3.
✅ **Chic Settings UI** — New premium design for Authentication Settings with dynamic status updates.
✅ **Smart Guidance** — Descriptive status bars (Green Bar) to guide you through redirection impacts.
✅ **One-Click View** — Easily view your active Login/Signup pages directly from settings.

= Shortcodes for Easy Integration: =

- Login Form: `[wawp_otp_login]`  
- Signup Form: `[wawp_signup_form]`  
- Both Forms: `[wawp-fast-login]`  

= 100% Compatible with:

✅ Bricks Builder
✅ Elementor
✅ Gutenberg
✅ Native WordPress Forms
✅ Native WooCommerce Forms

== 🛒 WooCommerce Order Verification == 

Prevent fake orders with WhatsApp OTP verification before checkout.

1. Enable OTP for **visitors, members, or everyone**.
1. Enable OTP based on **payment method** (e.g., Cash on Delivery, PayPal, Stripe).
1. Enable OTP based on **shipping method** (e.g., Standard, Express).

== 💬 WhatsApp Chat Widget ==  

✅ **Multi-agent Support** — Easily assign different contacts for support, sales, or inquiries.  
✅ **Display Condition** — Set when the chat button appears based on device or pages.  
✅ **Fully customize** — button design (colors, text, icons, positioning).  
✅ **Integrate social media links** — directly into the button.  
✅ **Auto-generate QR codes** — for instant messaging.  
✅ **Track button clicks** — to analyze customer interactions.

== 🌍 Country Code == 

✅ **Number Validation** — Verify phone numbers in real time to reduce errors and boost data quality.  
✅ **Auto-detect Country** — Automatically detect country code by visitor location or preset default.  
✅ **Country Filtering** — Display only the countries that your audience and customers are from.  
✅ **100% Compatible** — Country code compatible with all themes, page builders & plugins.  
✅ **Country Selection** — Allow users to choose their country code when entering their phone number.   
✅ **Country Filtering** — Restrict or display specific countries in the dropdown.   
✅ **Auto-Formatting** — Format phone numbers dynamically as users type for maximum accuracy.  
== 📊 Diagnostics & Privacy ==

This plugin includes an optional feature to share non-sensitive diagnostic data to help improve plugin performance and troubleshoot issues. This data is only shared if explicitly permitted by the site administrator via the Connector settings.

== 📜 Messages History ==

✅ **Track all messages** – Show all details (order number, user details, phone numbers, etc.).
✅ **Advanced Filters** – Use live search & advanced filters find specific messages.
✅ **Identify Failed Messages** – Troubleshoot and fix delivery issues.
✅ **Resend Messages** – Retry failed messages with a single click.

== 🎨 Personalization ==

✅ **Dynamic Content** — Use Variables to insert customer names, order details, and more. 
✅ **Full emoji support** — Add personality and fun to your communication.
✅ **Rich Messages** — Attach multi-media to capture customers attention.
✅ **Direct Messages** — Send message to any WhatsApp number directly from your dashboard.

== 👤 Customer Management ==

✅ Verify whether a member’s number is **active on WhatsApp**.  
✅ View **all phone numbers linked** to a member’s account for login and orders.  

**Note:** You can assign unique WhatsApp numbers for every task like order updates, admin alerts, and login verification.

== 📃 How to Start ==

1. Install and activate the Wawp plugin.
1. Create a free account on [Wawp](https://wawp.net/signup).
1. Connect your WhatsApp number using a QR code.
1. Insert the API keys into the plugin.
1. Customize your selected notification messages.

**Note:** A Wawp account is required to access all plugin features.  
[**Create new account**](https://wawp.net/signup), and send 50 WhatsApp messages per month for Free.   

= Let’s grow, connect, and thrive together! =  

👉 [**Try Wawp for FREE (250 Messages/Month)**](https://wawp.net/signup/)  
📌 [**Facebook Community.**](https://www.facebook.com/groups/wawpcommunity) – Join other users for support, advice, and tips.    
📚 [**Getting started.**](https://help.wawp.net/en_US/how-to-install-activate-wawp-on-wordpress/) – Access step-by-step guides, FAQs, and tutorials.  
⭐ [**Rate Us on WordPress.**](https://wordpress.org/support/plugin/automation-web-platform/reviews/#new-post) – Your feedback helps us grow and improve!  
🌍 [**Help Translate Wawp.**](https://translate.wordpress.org/projects/wp-plugins/automation-web-platform/) – Your feedback helps us grow and improve! 
📽 [**Video Tutorials**](https://www.youtube.com/@wawpapp)
== Installation ==

1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the `wp-content/plugins/` directory of your WordPress installation.
1. Activate the plugin through the **‘Plugins’** menu in WordPress.
1. Create new account on [**Wawp.net**](https://wawp.net/signup)
1. Connect your whatsapp with qr code in [**Wawp dashboard**](https://wawp.net/account/connect)
1. Add instances in Wawp plugin in the `wp-admin/admin.php?page=wawp&wawp_section=instances`
1. Now you can automate your conversations, and unlock WhatsApp superpowers.

For documentation and tutorials visit our [**Knowledge Base.**](https://wawp.net/get-started/welcome-to-wawp/)

[youtube https://www.youtube.com/watch?v=8vHnesN6_q8]

== Frequently Asked Questions ==

**How do I get started with Wawp?**

Simply install our free plugin on your WordPress site, connect your WhatsApp number, and configure your preferred features. Read our [detailed guide](https://wawp.net/get-started/welcome-to-wawp/).

**Is Wawp Free?**

Yes, Wawp offers a free plan that includes 200 free messages each month. You can upgrade to the [Pro plan](https://wawp.net//) to send more messages.

**Do I need to signup for WhatsApp API?**

No, you do not need WhatsApp API at all. Wawp is simple to use and is affordable.

**Are there any additional costs by WhatsApp?**

There is no additional payment taken by WhatsApp to use Wawp.

**Can I use Wawp for multiple WhatsApp numbers?**

Yes, Wawp supports unlimited sites and multiple WhatsApp numbers, making it ideal for businesses with diverse operations.

**Can I disconnect my WhatsApp number?**

Yes, Wawp allows you to disconnect your WhatsApp number with just one click, giving you complete control over your account.

== Screenshots ==

1. connect your Whatsapp
2. Assign Custom Number
3. Advanced Phone Field
4. Auto-Retry Mechanism
5. Block Manager
6. Checkout Verification
7. Country Code Selector
8. Multilanguage Notifications
9. Multi Agent Chat Button
10. Notifications Builder
11. Passwordless Login
12. Receive Orders Instantly
13. Registration form Builder
14. Send Order Notifications
15. Setup Smtp Easily



== Changelog ==

= 5.6.16 - 2026-10-04 =
* Fixed: Resolved critical PHP memory exhaustion (Allowed memory size exhausted / 1 GB limit) on user profile update and OTP signup caused by an infinite recursion loop between WordPress `updated_user_meta` hook and user phone synchronization (`sync_user_phone`).
* Fixed: Fixed multi-instance registration form and OTP verification visibility issue when forms exist in multiple places on the same page (e.g., Header menu/modal popup alongside the main page body) by encapsulating DOM queries and state management per-container instance.
* Security: Hardened authentication challenge & verification pipeline by strictly checking active status (`is_firebase_active()`) before initiating any Firebase SMS challenge.
* Security: Resolved critical authentication bypass where unconfigured or disabled Firebase challenges could fall through to generic local OTP comparisons with empty string values.
* Security: Enforced strict server-side authentication method validation to prevent unauthorized request-level parameter tampering (`force_otp_method` / `otp_method`).
* Security: Added server-side Google reCAPTCHA verification and IP-based rate limiting on public registration and OTP initiation REST endpoints.
* Improved: Unified the "Unique Message IDs" toggle across all authentication and messaging services (Signup, Login, Checkout) to centrally respect the master option configured in Senders -> Messaging Tools (`wawp_include_tracking_ids`).
* Fixed: Resolved registration form settings caching issue where updated `wawp_signup_*` options remained out of sync with `wawp_registration_form_settings`.
* Fixed: Sanitized WhatsApp OTP message and footer templates by automatically stripping WordPress emoji `<img class="emoji">` HTML tags before transmission, ensuring emojis arrive as clean Unicode characters.

= 5.6.15 - 2026-10-03 =
* Security: Removed plaintext password storage from custom user profile database table (`wawp_user_info`), ensuring user passwords are exclusively managed and hashed via WordPress core security standards (`wp_users`).
* Security: Added automatic database migration to clear and purge any legacy plaintext password entries from the `user_info` table.
* Fixed: Decoupled Firebase SMS phone verification from the WhatsApp verification badge — accounts verified via Firebase SMS now accurately display 'Phone Verified (SMS)' badge instead of a misleading 'WhatsApp Verified' badge in wp-admin.
* Fixed: Resolved message parser placeholder issue where `{{shipping_state}}`, `{{shipping_country}}`, `{{shipping_postcode}}`, and `{{shipping_address_2}}` printed 'N/A' in order notification templates.
* Fixed: Resolved missing user first name and last name (`first_name`, `last_name`, `billing_first_name`, `billing_last_name`) synchronization during Firebase SMS signup flow.

= 5.6.14 - 2026-09-30 =
* Fixed: Resolved user registration phone number and verification status sync issue where newly registered users via OTP signup displayed an empty phone number and unverified status under 'Wawp User Information' in wp-admin due to an internal recursion loop between `get_user_info()` and `upsert_user_profile()`.
* Fixed: Enhanced phone number synchronization across WordPress user meta (`_wawp_phone`, `wawp-user-phone`, `billing_phone`, `wawp_user_phone`) and custom DB table (`wawp_user_info`) during user registration, profile updates, and OTP verification.
* Improved: Optimized verification status getters with reliable WordPress user meta fallback and in-memory caching.

= 5.6.13 - 2026-09-30 =
* Fixed: Resolved Magic Link email authentication issue where clicking verification links returned 'Invalid or expired verification link' by ensuring the `is_magic_link` flag is correctly propagated in challenge sessions and adding fallback user lookup by verified email.
* Fixed: Resolved WordPress Cron `could_not_set` error during delayed notification scheduling and rule updates by optimizing cron payload serialization, implementing atomic batch cleanup, and routing scheduled notifications through Action Scheduler.
* Fixed: Resolved 'Cookie check failed' REST API nonce errors on public authentication endpoints (OTP login, registration, checkout verification, phone bar) when aggressive page caching (e.g. LiteSpeed Cache, WP Rocket) is active.
* Fixed: Prevented potential fatal errors during authentication finalization and `wp_login` hook dispatch when 3rd-party security plugins or theme hooks encounter unhandled exceptions.
* Security: Maintained strict authentication isolation ensuring WhatsApp and SMS OTP transient sessions cannot be verified via the magic token endpoint.

= 5.6.12 - 2026-09-28 =
* Added: Redesigned header top bar with a unified user profile dropdown menu featuring quick access to Account & Subscription, System Status, Setup Wizard, Ask AI, Cache Flush, and multilingual Language switcher.
* Improved: Cleaned up sidebar navigation by moving direct account management into the top bar user profile menu.
* Fixed: Resolved Action Scheduler race condition that caused duplicate identical recurring actions for `wawp_as_cron_heartbeat` by implementing concurrency locks, transient checks, and self-healing duplicate cleanup.
* Improved: Consolidated sender diagnostics when WhatsApp is disconnected into a unified standby state to prevent multiple redundant critical error alerts.
* Fixed: Fixed System Info issue count discrepancy across multilingual setups (Arabic / English) where `WP_DEBUG` was counted multiple times due to localized label matching.
* Improved: Updated Cloudflare / CDN Provider proxy diagnostics to always display as verified & supported (green status) in WAWP System Health without flagging false-positive warnings.
* Fixed: Ensured all core scheduled cron tasks (`wawp_cron_refresh_system_info`, `wawp_cron_hourly_self_repair`, `wp_campaigns_cron_send_advanced`, `wawp_cron_process_abandoned_cart_notifications`, `wawp_cron_clear_expired_otps`, `wawp_cron_sync_whatsapp_status`, `wawp_cron_check_instances_status`) are consistently registered and activated upon clean plugin activation cycle.
* Fixed: User registration phone numbers from WooCommerce, custom registration forms, and user profiles are now reliably synced with fallback detection to WordPress user meta (`billing_phone`, `wawp_user_phone`) and displayed in user profile "Wawp User Information" and admin users list.
* Fixed: Resolved WooCommerce Checkout OTP popup triggering issue on multilingual stores (Arabic / localized notices) and multi-step checkouts by adding language-agnostic notice attributes and eliminating blank warning bars.
* Fixed: Enhanced Phone Verification Bar CSS layering and z-index positioning across diverse theme layouts.
* Fixed: Optimized Activity Logs user detail view and URL deep-linking navigation flow.
* Fixed: Resolved bulk campaigns execution stalling on large recipient lists by optimizing batch size budgeting, eliminating PHP execution timeouts, and ensuring reliable background Task Scheduler rescheduling.
* Improved: Updated all documentation and tutorial links across settings and dashboard to standard `help.wawp.net`.
* Improved: Enhanced System Info UI diagnostics to synchronize the top admin bar notification badge with the actual issue count.
* Compliance: Codebase quality, security escaping, and PHP 7.4–8.4+ compatibility refinements adhering strictly to WordPress.org Plugin Check (PCP) standards.

= 5.6.11 - 2026-08-30 =
* Added: Security & Caching risk acknowledgment modal dialogs and 'Allow' buttons for CDN Provider and WP_DEBUG checks in System Status diagnostics.
* Added: New 'Unassign Page' button for Login, Signup, and Fast Login page settings in Authentication Pages — unassigning a page resets selection and restores the 'Instantiate Page' (Create) button immediately.
* Fixed: Resolved Meta WhatsApp Cloud API template placeholder mapping — template parameters now extract `{placeholders}` in sequential order directly from notification message text (`{billing_first_name}`, `{order_id}`, etc.) to bind to Meta positional variables (`{{1}}`, `{{2}}`, `{{3}}`).

= 5.6.10 - 2026-08-20 =
* Security: Fixed CVE-2026-77264 (Unauthenticated Authentication Bypass and `otp_transient` disclosure in REST API response).
* Security: Fixed CVE-2026-14281 (Unauthenticated Privilege Escalation via strict user meta key allowlists in registration handler).
* Security: Enhanced magic link verification lifecycle and single-shot transient token cleanup.
* Fixed: Removed default automatic font enforcement on Login and Signup forms to inherit active theme typography.
* Fixed: Fixed icon alignment and rendering across Login and Signup shortcodes.

= 5.6.9 - 2026-08-12 =
* Fixed: Resolved country code dropdown popup positioning and attachment issues on mobile devices — the dropdown now stays inline attached directly beneath the phone input field.
* Fixed: Fixed country code search bar background transparency issue on mobile, ensuring a solid white background with clear search input styling.
* Fixed: Fixed WordPress admin sidebar menu scrolling on WAWP dashboard pages, allowing smooth natural mouse wheel and touch scrolling without displaying unnecessary scrollbars.
* Improved: Enhanced Meta Cloud API Account Validation Test tool with automatic parameter detection and dynamic component mapping for templates with positional variables.

= 5.6.8 - 2026-08-09 =
* Added: Full custom message template support (`{{otp}}` for verification code, `{{site_link}}` for site URL) across all WhatsApp OTP verification modules (Passwordless Login, Registration Form, WooCommerce Checkout Verification, Phone Verification Bar, and Abandoned Carts).
* Added: New toggle option in WhatsApp OTP Settings (`Include Unique Message ID`) allowing administrators to enable or disable the `_ID: XXXX_` transaction suffix footer.
* Added: Configurable OTP resend cooldown timer (in seconds) in WhatsApp OTP Settings with flexible custom delays.
* Fixed: Resolved React component crash (DOMException: Node.removeChild) in Automated Notifications builder when editing or deleting message template parameters/variables during active browser translation.
* Fixed: Fixed WhatsApp Official Meta Cloud API template selection and delivery issue in Meta API Sender and Automated Notifications.

= 5.6.7 - 2026-07-24 =
* Fixed: Resolved an issue in Meta API Configuration where saving credentials (WABA ID, Permanent Access Token, Phone Number ID, Meta App ID, Meta App Secret, Verify Token) would fail or revert back to previously saved values.
* Improved: Enhanced Meta API connection flow by reorganizing the credentials UI layout to strictly match Meta Developer Console field hierarchy (App ID, App Secret, Permanent Access Token with inline Connect with Facebook button, Phone Number ID, and WABA ID).
* Added: New 'Account Validation Test' section in Meta API Configuration page allowing site administrators to dispatch test template messages directly from their site with country code auto-detection and track results in real-time within Activity Hub.
* Added: Support for automatic Verify Token generation and local site DB template deletion.

= 5.6.6 - 2026-07-09 =
* Fixed: Plugin deactivation and re-activation no longer resets user-configured features and sender toggles. Settings are now fully preserved across deactivation/re-activation cycles within 72 hours.
* Improved: Users who have not connected the plugin are now redirected to the Account page instead of the Setup Wizard.
* Fixed: WooCommerce thank-you (order confirmation) page no longer goes blank when the Phone Verification "Lock Site" feature is enabled — checkout and order-received pages are now excluded from the site lock.
* Fixed: Resolved a PHP notice (`WP_Object_Cache::add` called with empty key) triggered on the Authentication Pages settings screen when users with missing login or ID exist in the database.
* Added: Per-agent "Include Page URL" toggle in the Chat Widget support agents settings — each agent can now independently send or omit the current page URL in the WhatsApp pre-filled message.
* Fixed: PHP 8 deprecation warning (`strpos(): Passing null`) triggered on every page load when no AJAX action was present in the request.
* Fixed: `Cannot modify header information` warning triggered by the Abandoned Cart session tracking cookie being set after output had already started.
* Fixed: Duplicate entry database error (`Duplicate entry for key 'unique_user'`) in `wawp_user_info` caused by a race condition when `upsert_user_profile()` was called multiple times simultaneously during registration — now uses an insert-then-update-on-conflict strategy.
* Fixed: `get_client_country_by_ip()` was performing a blocking HTTP request to `ipapi.co` during `wp_head` and `wp_enqueue_scripts`, causing page load errors. The external API call is now skipped entirely during frontend rendering; timeout reduced to 3 seconds; failed lookups are cached for 1 hour to prevent repeated attempts.

= 5.6.5 - 2026-06-29 =
* Added: New background cron job `wawp_cron_check_instances_status` (every 5 minutes) to automatically check and update WhatsApp instance connection status in the database.
* Added: WhatsApp Web Sender page now triggers an instant instance status check on load and refreshes the UI without a page reload.
* Added: Disconnected instance notice (`WhatsApp is Disconnected`) now appears in real-time without page refresh when an instance goes offline.
* Improved: Instances showing `checking` status for more than 10 seconds are automatically marked as `offline` in the UI.
* Added: Missing cron jobs (`wawp_sync_hourly_stats`, `wawp_cleanup_expired_temp_links`, `wawp_cron_check_instances_status`) are now visible and manageable from the System Info → Cron tab.
* Fixed: Removed leftover debug `console.log` statements from `checkout.js` that were leaking sensitive checkout data to the browser console.
* Fixed: Plugin updates no longer reset user-configured sender toggles (WhatsApp Web, Email, Block Manager) and feature flags (Notifications, Campaigns, Dashboard widgets, etc.) — settings are now preserved across updates and only disabled if the subscription plan explicitly does not allow them.
* Fixed: Google reCAPTCHA scripts were being loaded on the checkout page even when the "Enable on Checkout" option was disabled — scripts are now only enqueued when the setting is explicitly enabled. Visit the settings at `?page=wawp&wawp_section=google_recaptcha`.
* Fixed: Fatal error on plugin activation (`Call to a member function is_email_sender_enabled() on null`) caused by helper functions not being loaded before system checks run during activation.

= 5.5.3 =
(Please see the complete changelog on https://help.wawp.net/en/articles/news-and-updates-for-wawp-wordpress-plugin)