Skip to content

Merge release/2026-08-06 into trunk - #2621

Merged
westonruter merged 4 commits into
trunkfrom
merge/release-2026-08-06-into-trunk
Aug 7, 2026
Merged

Merge release/2026-08-06 into trunk#2621
westonruter merged 4 commits into
trunkfrom
merge/release-2026-08-06-into-trunk

Conversation

@westonruter

Copy link
Copy Markdown
Member

This merges #2619 into trunk.

This was a security release for Optimization Detective which was branched off of release/2026-02-27.

westonruter and others added 4 commits August 6, 2026 00:22
Previously the detect args were read by blindly dereferencing
`document.getElementById()` and parsing whatever `textContent` it
returned, which throws an opaque `TypeError` if the element is absent
or it wasn't a SCRIPT tag.

Instead:

- Query with `document.querySelector( 'script#…' )` rather than
  `getElementById()`. The subsequent `instanceof HTMLScriptElement` guard
  rejects a non-SCRIPT element anyway, so restricting the query to SCRIPT
  elements avoids matching an element that can never be used.
- Hold the selector in a `jsonScriptSelector` variable so it is written
  once and reused in the "Missing" error message.
- Throw an explicit error when the element is missing or is not a
  SCRIPT, and validate that the parsed JSON is a `[ string, object ]`
  tuple before it is destructured into the detect src and args.
- Parse the more tailired `argsScript.text` instead of
  `argsScript.textContent`. `text` is typed as a non-null `string` on
  `HTMLScriptElement`, whereas `textContent` is `string | null` on every
  node, so this is better for static analysis.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Update the `Version` header and the version passed to the pending-plugin
bootstrap in `load.php`, along with the `Stable tag` in `readme.txt`.

Add the changelog entry for the release, covering the validation of
SCRIPT#optimization-detective-detect-args.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@westonruter westonruter added no milestone PRs that do not have a defined milestone for release [Plugin] Optimization Detective Issues for the Optimization Detective plugin labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter added skip changelog PRs that should not be mentioned in changelogs [Type] Bug An existing feature is broken labels Aug 7, 2026
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.35%. Comparing base (bb12749) to head (7adc3ec).

Files with missing lines Patch % Lines
plugins/optimization-detective/load.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2621   +/-   ##
=======================================
  Coverage   70.35%   70.35%           
=======================================
  Files          91       91           
  Lines        7867     7867           
=======================================
  Hits         5535     5535           
  Misses       2332     2332           
Flag Coverage Δ
multisite 70.35% <0.00%> (ø)
single 35.17% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@westonruter
westonruter merged commit 565d0b4 into trunk Aug 7, 2026
29 of 35 checks passed
@westonruter
westonruter deleted the merge/release-2026-08-06-into-trunk branch August 7, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no milestone PRs that do not have a defined milestone for release [Plugin] Optimization Detective Issues for the Optimization Detective plugin skip changelog PRs that should not be mentioned in changelogs [Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant