Skip to content

2.4.4

Choose a tag to compare

@DougState DougState released this 02 May 12:26
· 16 commits to main since this release

2.4.4
Tooling: Admin-only ?et_force= query-parameter override for variant assignment. Lets logged-in admins (manage_options) deterministically preview any variant for QA — ?et_force=control selects the Control variant of every test on the page, ?et_force=<variant_id> selects a specific variant by ID. The forced assignment is written to the existing elementtest_variant_<test_id> cookie so it sticks across navigation; remove the cookie (or visit the page without the parameter and let it re-roll) to resume normal random assignment. Useful for QA on tests where the existing 50/50 cookie roll keeps producing the same variant on a single tester's browser. Gated server-side via a new isAdmin flag in the localized elementtestFrontend payload — non-admin visitors cannot bias real test data via shared URLs (anonymous traffic falls through to the normal weighted random path). Logs the forced assignment to console.info (or console.warn if the parameter does not match any variant) so DevTools makes the override unambiguous.
2.4.3
Tooling: New WP-CLI subcommand wp elementtest fix-variant-changes for repairing pre-2.4.2 wp_kses_post()-mangled js and css variant source already in the database. The 2.4.2 fix only stopped new saves from being mangled; rows already in wp_elementtest_variants stayed corrupted (>= stored as >=, && as &&, .parent > .child selectors as .parent > .child). The command JOINs wp_elementtest_variants to wp_elementtest_tests, filters to test_type in (css, js), and decodes only the five HTML entities wp_kses_post() produces from JS/CSS tokens (&, <, >, ", ') — leaving named entities like · or   intact. Defaults to dry-run; --apply writes; --backup=path.json snapshots affected rows before any UPDATE; --show-diff prints up to 10 changed line pairs per variant; --type=js|css and --test-id=N narrow the scan.
2.4.2
Fix: JavaScript variant changes source is no longer mangled on save. The plugin previously applied wp_kses_post() uniformly to the changes column for every test type, but changes is polymorphic — it holds CSS rules, HTML, JavaScript source, or an image URL depending on test_type. Running JS source through wp_kses_post() parses it as HTML, rebalances/strips <, >, and & (e.g. operators like >=, string literals containing

...
, or · entities), and produces source that throws SyntaxError at parse time when the variant's <script> is appended. Sanitization is now branched on test_type via a new sanitize_variant_changes() helper: copy continues to use wp_kses_post(), image uses esc_url_raw(), and css/js are stored as raw source. Both call sites (save_test(), import_tests()) are gated by manage_options, the same capability WordPress already requires for arbitrary code via Plugins / Theme Editor, so no trust-surface change.
Note: existing js variants saved on 2.4.1 or earlier are still mangled in the database. Re-save each affected variant after upgrading, or use the new wp elementtest fix-variant-changes command (added in 2.4.3) to repair them in bulk.
2.4.1
Fix: Full-URL wildcard pageview triggers (PR #43). A prefix like https://example.com/shop/* could previously match sibling paths like /shopping because the listener fell back to a loose full-URL indexOf check. The trigger is now resolved to its URL.pathname and matched with the same path-boundary rules as path-only wildcards (/shop/*); the full-URL fallback only applies when the prefix explicitly includes ? or #. Mirrors the same change in detect_pageview_goal_tests().
UX: Cap the test results "Performance Over Time" chart at max-height: 500px so the chart fits on screen on wide displays.