=== Mumble ===
Contributors: mumbleapp
Tags: whatsapp, whatsapp business api, woocommerce notifications, abandoned cart, elementor forms
Requires at least: 6.0
Tested up to: 7.2
Requires PHP: 7.4
Stable tag: 0.3.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WordPress site to WhatsApp via Mumble: instant lead replies, order notifications, abandoned cart recovery, back in stock alerts and more.

== Description ==

Mumble connects your WordPress site to the WhatsApp Business API through your [Mumble](https://mumble.co.il) account. Everything is configured from a friendly settings screen, in Hebrew or English, with ready made message templates and a built in test mode.

**For lead sites (landing pages, service businesses):**

* A visitor submits a form and instantly receives an approved WhatsApp message.
* Works automatically with Elementor Pro, Contact Form 7, WPForms, Gravity Forms, Fluent Forms, Ninja Forms, Formidable, Forminator, MetForm and JetFormBuilder. Any other system can connect with one action hook.
* Optionally attach a Mumble chatbot that continues the conversation when the lead replies.
* Leads are saved as Mumble contacts with a label and their ad attribution (UTM, gclid, fbclid).

**For WooCommerce stores:**

* Order status notifications on WhatsApp (confirmation, shipped, refund).
* Abandoned cart recovery: two reminders with a one click restore link and an optional single use coupon, generated per customer.
* Back in stock alerts with a small signup form on out of stock products.
* Win back messages for dormant customers and review requests after delivery.
* Full order notes trail: every WhatsApp event is recorded on the order screen.

**Extras:**

* A floating WhatsApp chat widget with your branding, plus an "Ask about this product" button on product pages. Messages arrive with the page or product name and link.
* Every WhatsApp click is tracked in Google Analytics 4, Google Tag Manager, the Meta Pixel and as a Google Ads conversion.
* Mumble Tracker integration with automatic events (page views, leads, add to cart, purchases).
* A weekly WhatsApp summary of leads, orders and recovered carts to the store owner.
* Test mode: every message is rerouted to your own number until you are ready.

A Mumble account with an API key is required.

== External services ==

This plugin talks to the Mumble platform (https://app.mumble.co.il), the service that sends the WhatsApp messages. It is required for every feature of the plugin.

* What is sent: the customer phone number, name, email and the message variables you configured (for example order number and total), together with your API key. Each request also identifies the plugin version, WordPress version and your site address, so Mumble support can help with your setup. Data is sent only for the events you enabled in the settings.
* When: on form submissions, order events, cart reminders and the other flows you switch on.
* Provider: Mumble, https://mumble.co.il. Terms and privacy: https://mumble.co.il/terms/

If you enable the Mumble Tracker feature, the tracker script from Mumble is embedded on your public pages and reports browsing events (page views, add to cart, purchase) to your Mumble dashboard.

== Installation ==

1. Install and activate the plugin.
2. Open the Mumble menu in the WordPress admin.
3. Paste your Mumble API key (Mumble dashboard, Settings, Technical profile) and save.
4. Turn on test mode, enable a feature, send yourself a test from that feature page.
5. Turn off test mode and go live.

== Frequently Asked Questions ==

= Do I need a Mumble account? =

Yes. The plugin is the bridge between your site and your Mumble account, which holds your WhatsApp Business number and approved message templates.

= Which forms are supported for leads? =

Elementor Pro, Contact Form 7, WPForms, Gravity Forms, Fluent Forms, Ninja Forms, Formidable, Forminator, MetForm and JetFormBuilder are detected automatically. Anything else can call `do_action( 'mumble_wp_lead', array( 'phone' => ..., 'name' => ... ) )`.

= Does it work with international phone numbers? =

Yes. Numbers typed in international format always pass through as is. Local format numbers are resolved using the customer's billing country at checkout, the visitor's country on lead forms, or the store country as a fallback.

= Why do messages need pre approved templates? =

WhatsApp only allows businesses to start a conversation with a template approved by Meta. The plugin ships with a library of ready made templates in Hebrew and English that you can create into your account with one click.

== Screenshots ==

1. Leads: every form submission gets an instant WhatsApp message from an approved template.
2. WooCommerce: order notifications and cash on delivery confirmations.
3. The floating WhatsApp button, with a live preview.

== Changelog ==

= 0.3.8 =
Reliability release from a full code review. Updating is recommended.

* Test mode with no test phone set now blocks sends instead of messaging real customers.
* Abandoned carts: a shopper who leaves on the payment page now gets the reminder (only a paid, on-hold or cash on delivery order stops it).
* Abandoned carts: returning customers who bought before now get reminders for new carts.
* Abandoned carts: variable products are restored with their chosen options, and the block checkout's shipping fields are captured.
* Failed sends stop retrying after two days, and a cart stuck by a server timeout is picked up again.
* Back in stock: a rejected alert is marked failed instead of retrying every 5 minutes; a Mumble outage pauses sending and resumes later.
* Back in stock form and signup popup now work on page-cached sites. The popup thanks the visitor only when the signup really succeeded.
* Review requests are timed from the order completion date, not the order date.
* Review requests and win-back messages now reach every qualifying order on busy stores (sent in batches of 25 every 5 minutes, instead of a cap of 50 per day).
* Win-back recognizes repeat buyers by account, email, or phone in any format, so they don't get a "we miss you" message.
* The WhatsApp consent checkbox at classic checkout now starts unticked, as consent rules require.
* "Where is my order?" looks through the latest 500 orders instead of 30.
* The [mumble_whatsapp] shortcode and the mumble-whatsapp class work even when the floating button is off; the floating button opens with the keyboard.
* The message log shows why a message was skipped.

= 0.3.7 =
* WhatsApp button on product pages ("Ask about this product"), placed under Add to cart, or anywhere with the [mumble_whatsapp] shortcode.
* Opening messages can include the page and product: {title} {url} {product} {price} {sku}.
* Click tracking: every WhatsApp click sends generate_lead to Google Analytics 4, an event to Google Tag Manager, Contact to the Meta Pixel and an optional Google Ads conversion.
* Any button or menu item with the class mumble-whatsapp (or a link to #mumble-whatsapp) opens the chat.
* API requests identify the plugin version, to help Mumble support.


= 0.3.6 =
Security release. Updating is recommended for all sites.

* The opt-in popup's signup endpoint is disabled when the popup is off, and is rate-limited per visitor and site-wide.
* Abandoned cart capture: new carts are rate-limited, consent is recorded only from the actual checkbox, and names are cleaned so they cannot carry links into messages.
* Abandoned cart coupons are limited to the products in that cart and cannot be combined with other coupons.
* Cart restore links expire after 14 days, or once the cart is purchased.
* Tracker: the thank-you page purchase event now requires the order key, so other customers' orders cannot be viewed by guessing order numbers.
* Back in stock: signups only for real, out of stock products, rate-limited; alerts are sent in the background instead of during the save that restocks the product.
* Order status endpoint is rate-limited, with a new "Generate a new secret" button.
* The dashboard revenue widget is shown to store managers and admins only.
* API requests no longer follow redirects, and deleting the plugin now removes its settings and data.

= 0.3.5 =
* Fix: abandoned cart capture now works on sites with standard (pretty) permalinks. WooCommerce does not load the shopper session for plugin REST requests, so checkouts were not being recorded.
* Fix: no longer requires the PHP mbstring extension (lead detection, cash on delivery detection and the opt-in popup's country flags could fail on hosts without it).
* Tested with WordPress 7.1.5 and WooCommerce 11.3.1.

= 0.3.4 =
* A brand-new Mumble account with no templates yet now connects successfully.

= 0.3.3 =
* Source language is now English with a bundled Hebrew (he_IL) translation; ready for community translations on translate.wordpress.org.
* All styles and scripts load through the WordPress enqueue system.
* Sora font bundled locally (SIL OFL 1.1); no external font requests.
* "Powered by Mumble" credits are now opt-in and off by default.
* "Where is my order?" bot integration is visible on the orders screen.

= 0.3.2 =
* Live preview of the opt-in popup on its settings screen.

= 0.3.1 =
* Opt-in popup redesigned to match the Mumble signup widget: corner position, site icon, country flags, clearer consent text.
* English template presets show English names.
* Third-party admin notices can no longer appear inside the plugin's dialogs.

= 0.3.0 =
* WhatsApp opt-in popup: visitors join your list and become Mumble contacts with the whatsapp-subscriber label, optional welcome message.
* Cash on delivery confirmations: unpaid COD orders ask the customer to confirm on WhatsApp, the reply lands in your inbox.
* Revenue analytics on the overview: 30-day KPI tiles and orders attributed to win-back and review messages.
* Review requests can include your review page link as a message variable.
* Country code fully auto-detected; phone settings normalize to international format on save.
* Ready-made templates audited against Meta's variable-position rule; clearer API errors with Meta's real reason.
* Smoother testing: spaced-out test sends, save-first hint, result banners scroll into view, back-in-stock signups listed in the admin.

= 0.2.9 =
* Powered by Mumble link in the widget now uses the Mumble purple.

= 0.2.8 =
* Plugin renamed to Mumble, text domain aligned.
* Country detection: checkout billing country and visitor country resolve local phone formats.
* Five more form plugins supported for leads.
* Win back and review request deduplication per customer.

= 0.2.0 =
* First public build: leads, WooCommerce notifications, cart recovery, stock alerts, widget, tracker, weekly summary.
