Skip to content

release: v1.8.8 — security (macro reject) + consent gate fix#55

Merged
Atroci merged 3 commits into
mainfrom
agent/release-1.8.8-prep
May 28, 2026
Merged

release: v1.8.8 — security (macro reject) + consent gate fix#55
Atroci merged 3 commits into
mainfrom
agent/release-1.8.8-prep

Conversation

@Atroci
Copy link
Copy Markdown
Contributor

@Atroci Atroci commented May 28, 2026

Problem

Two real unshipped fixes were buried in the long-stashed pre-7.0 WIP (the rest of the stash was 42 files of CRLF/LF re-encoding noise — see triage report at `vault/Hugo OS/01-projects/clicktrail/wip-triage-2026-05-28/triage-report.md`):

  1. Security: ad-platform dynamic-parameter macros (`{{campaign.name}}`, `{{adset.name}}`, `{{ad.name}}`, etc.) flow into attribution capture when ads aren't served through the platform — they end up in `wp_clicktrail_*` and downstream destinations as if they were real campaign names.
  2. Bug: consent gate defaulted to ON when Consent Mode was disabled because two paths read a legacy `require_consent` setting (default `true`) that was removed from the admin UI. On any site without Consent Mode + CMP, this silently blocked all attribution.

Plus housekeeping: GTM Starter Kit lead-magnet banner is now distributed via the marketing site, so the in-plugin banner is disabled.

Approach

Cherry-picked the four real SHIP-bucket files from the triage. Did not replay the stash — the CRLF re-encoding would have trashed the worktree.

  • `includes/Core/class-attribution-provider.php`: regex reject in the server-side sanitize loop; consent gate default flipped to `false` unless Consent Mode is on.
  • `includes/class-clicutcl-core.php`: same consent-default fix in `build_consent_bridge_config`; `GTM_Lead_Magnet::init()` call commented out.
  • `assets/js/clicutcl-attribution.js`: mirror the macro-reject regex in `sanitizeValue` so the client capture path also drops them.
  • `.distignore`: added `README.md`, `dist/`, dev logos, GTM reference files, `includes/admin/class-gtm-lead-magnet.php` — drops them from WP.org SVN releases.
  • Release metadata: version bumps to 1.8.8 in `clicutcl.php`, new `= 1.8.8 =` entries in `readme.txt` and `changelog.txt`.

Affected Surfaces

  • REST/API (attribution capture)
  • Frontend runtime (client-side sanitize)
  • Admin UI (banner removed)
  • WP.org release packaging (.distignore)

Compatibility / Migration Notes

Behavior change: sites currently relying on the legacy `require_consent` option to block attribution will now allow attribution by default unless Consent Mode is explicitly enabled. The legacy field has been hidden from the admin UI since 1.6.x, so this aligns runtime behavior with the documented UX.

Sites running Consent Mode are unaffected — the consent decision still routes through `Consent_Mode_Settings::is_consent_required_for_request()`.

Tests / Checks Run

  • Triage agent classified all 56 stash files into SHIP/SUPERSEDED/REVIEW/NOISE buckets.
  • Per-file semantic diffs verified (CRLF noise stripped).
  • 4 SHIP code files applied as fresh edits; no merge-conflict residue.

Docs Updated

`readme.txt` + `changelog.txt` only.

Changelog / Readme Impact

This IS the changelog impact PR. Stable tag stays at 1.8.2 until WP.org SVN push.

Source

Stashed WIP (pre-7.0-audit) — preserved as `stash@{0}`. Drop after merge.

Atroci and others added 3 commits May 28, 2026 17:25
Two real fixes pulled from the long-stashed pre-7.0 WIP (most of which
was CRLF/LF re-encoding noise — see triage report at
vault/Hugo OS/01-projects/clicktrail/wip-triage-2026-05-28/).

SECURITY: reject unsubstituted ad-platform dynamic parameter macros.
  Facebook {{campaign.name}}, {{adset.name}}, {{ad.name}}, etc. appear
  literally in landing-page URLs when ads aren't served through the ad
  platform (manual preview, test traffic, mis-configured campaigns).
  Without filtering, these placeholders flow into attribution storage
  and downstream destinations as if they were real campaign names.

  - includes/Core/class-attribution-provider.php — regex reject in the
    server-side sanitize loop.
  - assets/js/clicutcl-attribution.js — mirror the regex in
    sanitizeValue() so the client-side capture also drops macros.

FIX: consent gate no longer defaults to ON when Consent Mode is disabled.
  Two paths previously read a legacy `require_consent` option from
  Attribution_Settings, defaulting to TRUE when unset. The setting was
  removed from the admin UI several releases ago, so on any site without
  Consent Mode + a CMP, the implicit-true default silently blocked all
  attribution from being persisted.

  - includes/Core/class-attribution-provider.php :: should_populate() —
    drop the option read; the only path that requires consent now is
    when Consent Mode is explicitly enabled.
  - includes/class-clicutcl-core.php :: build_consent_bridge_config —
    same change in the bridge config builder; explicit else-branch
    documents why the default flips to false here.

HOUSEKEEPING: GTM Starter Kit lead magnet runtime path commented out.
  The kit is being distributed via the website rather than the in-plugin
  banner. Class file kept in includes/admin/ for re-activation later;
  init() call disabled in includes/class-clicutcl-core.php and the
  source files added to .distignore so they're not bundled in release
  zips.

OTHER: .distignore expanded to drop README.md, dist/, dev logos, GTM
  reference files (shopify-gtm-container-templates-master, gtm-starter-kit.json,
  build-starter-kit.py) from WP.org SVN trunk.

Co-Authored-By: claude-flow <ruv@ruv.net>
Same {{...}} regex rejection as f838a35 but on the client-side capture
path. Drops unsubstituted ad-platform macros before they're written to
localStorage or sent to the REST batch endpoint.

Co-Authored-By: claude-flow <ruv@ruv.net>
- clicutcl.php Version + CLICUTCL_VERSION: 1.8.7 → 1.8.8
- readme.txt == Changelog ==: new `= 1.8.8 =` block (security + fix + housekeeping)
- changelog.txt: prepend full 1.8.8 entry with file refs and rationale

Stable tag stays at 1.8.2 per RELEASING.md (bumped at SVN push time).

Co-Authored-By: claude-flow <ruv@ruv.net>
@Atroci Atroci merged commit fbfe066 into main May 28, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant