Skip to content

Version 3.29.3

Choose a tag to compare

@github-actions github-actions released this 17 Oct 03:34
· 13 commits to master since this release

First GitHub release since 3.28.4, and the first release in the WordPress.org directory. It joins two lines that were developed in parallel: the directory review fixes (3.29.0 to 3.29.2 below, never released on GitHub) and the Google tag gateway loader mode (built as a separate 3.29.0 that was never released either). Upgrading from 3.28.x picks up every entry from here down to 3.29.0. The webhook now always requires the site key (3.29.2).

Added

  • Google tag gateway loader mode. Settings > Server-Side GTM gains a "Google tag gateway" checkbox and a script path (for example /k7q2fx/). When the mode is on and the path is healthy, the container loads from that same-origin path instead of googletagmanager.com, and the loader tag carries data-cuft-gtm-source="gateway" and data-cuft-gtm-server. The site's edge must route the path to Google before the mode is switched on. The mode is off by default, and a site that leaves it off gets the same loader and noscript as the other modes (pinned by golden tests for the plain, sGTM custom and sGTM fallback loaders).
  • Hourly gateway health probe. It requests healthy, ?validate_geo=healthy and ?id=<container> on the path, and the container request must return a body that holds both the container id and google_tag_manager (a CMS page that answers 200, or that merely echoes the id, does not pass). The probe and the gateway loader both use the container id in upper case, so an id saved in lower case (the settings screen accepts either) is probed and loaded under the name Google registers instead of staying in fallback. The probe follows no redirects and asks the site origin root, so a subdirectory install checks the same path the loader uses. The stored failure reason is plain text (tags stripped, whitespace collapsed, cut to 60 characters of the response). The mode starts in fallback; two passing probes in a row select the gateway and two failing probes in a row return to the loader the site used before (Google or its tagging server). While in fallback the loader tag carries data-cuft-gtg-state="fallback" and data-cuft-gtg-reason.
  • Browser-side fallback in the gateway loader. If the gateway script errors, or loads without defining the container, the browser loads gtm.js from Google instead, once.
  • Cache purge on every state change. WP Super Cache, WP Rocket, W3 Total Cache, SiteGround Optimizer, LiteSpeed Cache and the object cache are purged when the state changes or the mode is switched off, and the cuft_gtg_state_changed action fires with the new and previous state.

Changed

  • The <noscript> iframe stays on googletagmanager.com while the gateway mode is enabled, because Google does not serve ns.html through the gateway.
  • The gateway switch is read as a boolean everywhere, so wp option update cuft_gtg_enabled false (stored as the string "false") turns the gateway off and returns the site to its previous loader.
  • The gateway loader is built the way 3.29.0 builds every loader: the script URL is assembled in PHP from the validated gateway path (or sGTM host) and the container ID, passed through esc_url() and CUFT_Utils::js_encode(). The browser fallback URL and the container ID it checks for are encoded the same way. The loader no longer passes the container ID or a dl suffix as snippet arguments.
  • The gateway is used only for the container ID the probe checked (CUFT_GTG_Health::gtm_id(), upper case).

Installation

Automatic Update

If you already have the plugin installed, it should automatically detect this update. Go to Plugins in your WordPress admin and click Update Now.

Manual Installation

  1. Download the choice-uft-v3.29.3.zip file from the assets below
  2. In WordPress admin, go to Plugins → Add New → Upload Plugin
  3. Choose the downloaded zip file and click Install Now
  4. Activate the plugin after installation

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher

Support

For issues or questions, please visit: https://github.com/ChoiceOMG/choice-uft/issues