Merge release/2026-08-06 into trunk - #2621
Conversation
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>
Prepare 2026-08-06 release
… merge/release-2026-08-06-into-trunk
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This merges #2619 into
trunk.This was a security release for Optimization Detective which was branched off of
release/2026-02-27.