Skip to content

Prepare 2026-08-06 release - #2619

Merged
westonruter merged 2 commits into
release/2026-08-06from
publish/2026-08-06
Aug 7, 2026
Merged

westonruter merged 2 commits into
release/2026-08-06from
publish/2026-08-06

Conversation

@westonruter

@westonruter westonruter commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Summary

This includes a security release for Optimization Detective.

Use of AI Tools

Claude Code Opus assisted with authoring and squashing some previous commits, as well as doing the version bumps.

westonruter and others added 2 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 [Type] Bug An existing feature is broken Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs labels Aug 7, 2026

@adamsilverstein adamsilverstein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@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>
Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>

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

@westonruter

Copy link
Copy Markdown
Member Author

We can ignore these two checks:

image

The error is:

Your server is running PHP version 7.2.34 but WordPress 7.0.3 requires at least 7.4.

This is happening because I created the branch off of release/2026-02-27 (the last time Optimization Detective was updated) and so the workflow still has PHP 7.2 and PHP 7.3.

For this check:

image

The issue is the Codecov action in this branch hasn't been updated yet, so Codecov is failing:

image

But the tests are passing otherwise.

@westonruter
westonruter merged commit 4745992 into release/2026-08-06 Aug 7, 2026
30 of 34 checks passed
@westonruter
westonruter deleted the publish/2026-08-06 branch August 7, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release 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.

2 participants