The plugin is built around a few rules. Each one exists because chat buttons in this category fail in a way the shop owner does not see.
The link rule: the button is a link, not a widget
Most WhatsApp plugins load a vendor's JavaScript on every page. That is a third-party script watching every shopper, a request you cannot inspect, and something to declare in your privacy notice.
This plugin prints an ordinary link:
<a class="gmwa-button gmwa-button--inline"
href="https://wa.me/447700900123?text=Hi%2C%20I%20have%20a%20question…"
target="_blank" rel="noopener nofollow">Sarah · Sales</a>
wa.me is WhatsApp's own click-to-chat address. It opens the app on a phone and WhatsApp Web on a desktop. Because it is a link:
- It works before any script has run, and with JavaScript off.
- A page cache can serve it — the markup is the same for every visitor.
- Nothing is fetched from WhatsApp or Meta until somebody presses it.
The free edition ships one small stylesheet and no JavaScript at all. The full edition adds one small script whose only job is closing the agent panel when you click away from it or press Escape. Both files load only on a page that actually printed a button.
The number rule
A WhatsApp address needs a country code and digits — no +, no spaces, no brackets. The plugin turns what you typed into those digits, step by step:
- A bracketed trunk zero is removed:
+44 (0)7700 900123→+44 7700 900123. - Everything that is not a digit is removed:
447700900123. - A leading
00is read as+:0044 7700 900123→447700900123. - The result must be 8 to 15 digits (the E.164 limits). Outside that, it is not a number.
A number that fails this check gets no button at all — not a button that opens WhatsApp saying the number is invalid. The settings screen says so under the field. What you typed is kept, so you can correct it.
The one thing the plugin cannot fix is a national number with its leading zero and no country code: 07700 900123 becomes 07700900123, which is long enough to pass but is not your number. Always type the country code.
Working hours, on the shop's clock
Each person has days and a From/To time. They are judged on your shop's timezone (Settings → General), not the visitor's — "we answer until 5" is a fact about your afternoon.
- From 09:00 to 17:00 means on duty from 09:00 up to, not including, 17:00.
- A shift that ends before it starts runs through midnight: From 18:00 To 02:00 is on duty in the evening and until 2am.
- The day is the day the shift starts on the clock now — a midnight shift ticked for Friday covers Friday evening and the early hours after midnight only if Saturday is ticked too.
Outside hours, the free edition still shows the button, with an away line under it. Full edition: you choose to show it with your own note, or to hide it.
Who is offered
A person is offered when they are switched On and have a usable number.
- Free edition: the first such person is the button, everywhere.
- Full edition: under a product and from the shortcode, the first person in your list. The floating button is that person when there is one; with two or more it becomes a "Chat with us" button that opens a panel listing everybody, each with their own away line.
The button's text is the person's name and job. With no name, it is your Button wording, or "Chat with us".
Placeholders in the message
The message is filled in when the page is built:
| Placeholder | On a product page | On another single page or post | On an archive |
|---|---|---|---|
{product} |
product name | empty | empty |
{product_url} |
product address | empty | empty |
{sku} |
product SKU | empty | empty |
{page_url} |
product address | that page's address | empty |
{site_title} |
site title | site title | site title |
So the default message on a category page reads "Hi, I have a question about —". If your floating button appears everywhere, a message built on {page_url} and {site_title} reads well on every page.
Order updates — Full edition
Two ways to write to a customer about an order.
Send on WhatsApp (no setup)
Every order screen — HPOS and the classic one — gets a WhatsApp box. It shows the customer's billing phone as WhatsApp will receive it and a Send on WhatsApp button that opens your own WhatsApp with "Shop: order 1234 is now Processing. view-order link" already typed. An order whose phone cannot be used says so instead.
Automatic updates
When an order reaches one of your Statuses worth a message, the plugin sends a message through your own WhatsApp Business account (Meta's Cloud API at graph.facebook.com), in this order:
- Ready? Automatic sending is on and all four account fields are set.
- Permission. If Ask at the checkout first is on, the order must carry the customer's "yes". The box is never pre-ticked, and the order records the wording they saw and when.
- Claim. The status is written into
_gmwa_senton the order and the order is saved before anything is sent. WooCommerce fires status hooks more than once; the claim means one message per status, ever. - Template only. WhatsApp lets a business start a conversation only with a template it has approved. The plugin sends your named template with three values — shop name, order number, status — and nothing else.
- Result. An order note says it was sent, or quotes Meta's own reason for refusing it, or says the order had no usable number.
The permission box is printed on the classic checkout (woocommerce_review_order_before_submit) and registered with the Checkout block as the order-location checkbox gatemi-chat-button/whatsapp-optin. WooCommerce stores the block's tick as _wc_other/gatemi-chat-button/whatsapp-optin; the plugin reads it when the Store API places the order and records the same three keys the classic checkout writes.
