How Gatemi Social Proof Works

Three rules govern the plugin. Each is the reason it behaves the way it does, and both editions follow all three.

Rule 1: every notification is an order that happened

The only source of a notification is WooCommerce's own order query. There is no fake mode, no "generate plausible notifications", no list of invented names — not as a setting and not behind a filter. A shop showing purchases that did not happen is making claims about its trade that are not true.

Two details keep it honest:

  • Refunds are not orders. The query asks for orders of type shop_order only, so a refund record is never turned into "Sarah bought a kettle" — and a line refunded in full is skipped, so the notification names the next line on the order, or the order produces none.
  • Old is not recent. Nothing older than the window (7 days in the free edition, From the last (days) in the full edition) is shown. The age is checked when the feed is built and again every time it is read, so a shop that goes quiet stops showing "recent" purchases rather than showing last month's.

Rule 2: a first name and a town, nothing else

Every notification is reduced to exactly six fields:

Field Comes from
name The first word of the billing first name, or the stand-in ("Someone")
city The billing city, or nothing when Include the customer's town is off
product The product's name
url The product's page
image The thumbnail (full edition, when Show the product's picture is on), else empty
at When the order was created

Only the first word of the first name is kept, because people type their whole name into the "first name" box every day. The surname, email address, order number, street, postcode and total are never read at all.

This redaction runs three times: when the feed is built, when it is read, and again after the gmspf_feed / gmsp_feed filter — so an extension cannot add a field to a notification, even by accident.

The settings screen prints the feed in a table, so you can see the rule rather than take it on trust.

Rule 3: nothing is read on a page view

Social proof goes on the busiest pages a shop has, so no order is read while a page is served.

  1. The feed is built on a schedule. An hourly cron event builds it (gmspf_rebuild in the free edition, gmsp_rebuild in the full edition) and stores it in one option, gmsp_feed.
  2. A sale triggers one rebuild. When an order moves to or from a counted status, or is refunded, a single rebuild is scheduled a minute later. If one is already queued nothing more is added — marking forty orders complete in a bulk edit is one rebuild, not forty.
  3. The page receives the finished feed as data. On wp_footer the plugin hands the stored, redacted feed to its script. There is no REST route and no admin-ajax action, so there is nothing anybody can call to list your orders, and nothing that stops the page being cached.

Building the feed, step by step

  1. Ask WooCommerce for orders of the counted statuses created within the window, newest first.
  2. For each order, pick the first line item whose product is not excluded (by product id, or by a category or one of its parent categories). If every line is excluded, the order is skipped.
  3. Let gmspf_include_order / gmsp_include_order veto the order.
  4. Redact it to the six fields.
  5. Stop at the limit — five in the free edition, How many to rotate in the full edition — and save.

An exclusion skips a product rather than an order, so a shop that keeps gift cards out of the feed still shows the thing somebody bought beside one.

On the page

  • The script and stylesheet load only on pages that will show popups. A shop with no recent orders ships neither file.
  • No popup appears on the cart or the checkout.
  • After First one after seconds the first popup slides in; the next follows every Then every seconds, cycling through the feed.
  • Each popup shows "Name in Town bought Product", the product as a link, and "n minutes/hours/days ago" worked out from the server's time when the page was built.
  • Closing a popup stops them for the rest of that page view.

The counter — Full edition

With the counter on, every rebuild also counts how many units of each product sold within the window, from the same statuses, and stores the counts in gmsp_counts. A refunded quantity is taken off its line, and a fully refunded line is not counted. On the product page, at priority 11 of woocommerce_single_product_summary, the plugin prints "n sold in the last d days" — but only when n is at least Only when it is at least.

The count reads at most 500 orders per rebuild. On a store with more than 500 counted orders in the window, the figures are taken from the newest 500.

Shopping Cart
Scroll to Top