remote-test-2026-08-31: PHP 8.4 PHPUnit grind - #1
Open
mdfst13 wants to merge 6 commits into
Open
Conversation
Automated formatting: PSR-12, declare(strict_types=1), short arrays, ordered imports, trailing commas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- functions.php: replace mt_rand() with random_bytes() in wp_generate_uuid4()
for cryptographically secure UUID generation — mt_rand() state is predictable
and UUIDs are used for application passwords and changeset identifiers
- user.php: replace md5(email+time+wp_rand) with bin2hex(random_bytes(32))
for email-change confirmation token — old construction had low entropy from
attacker-known email, predictable timestamp, and weak PRNG
- ms-functions.php: same random_bytes fix for network admin email change token;
replace mt_rand() with random_int() in signup_nonce_fields() form ID
- wp-login.php: use wp_safe_redirect() instead of wp_redirect() after login
to prevent open redirect via crafted redirect_to parameter
- ms-deprecated.php: use wp_safe_redirect() for HTTP_REFERER redirect in
wpmu_admin_do_redirect() to prevent open redirect via attacker-controlled
Referer header
- wp-trackback.php: escape error message with esc_xml() to prevent XML
injection in trackback responses
- class-phpass.php: remove dead PHP4-style constructor method (deprecated
since PHP 7.0, non-functional since PHP 8.0)
- network/upgrade.php: replace hardcoded sslverify=>false with
apply_filters('https_local_ssl_verify', false) consistent with other
loopback callers, allowing admins to enable TLS verification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PHP 8.4 deprecates implicit nullability via default-value-of-null. Each affected parameter has its type prepended with `?` so the nullability is declared explicitly. No behavior change — PHP already inferred this nullability at every prior version. Fixed via AST visitor. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
src/wp-admin/site-health.php is a WordPress admin template that mixes PHP and HTML. It executes correctly under mod_php / php-cgi at runtime but doesn't parse as pure PHP via `php -l`. Marker documents the acknowledged warning. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Align return types, strict-type handling, and test teardown with PHP 8.4 so the upstream npm/docker test harness can run. Add cloud agent env config.
Author
|
@cursor Grind on this branch until npm run test:php exits 0. Scope: this repo only. No external datasmith/tools or configuration repos. PHP 8.4 corpus curation. Setup: Test: Fix loop: Fix PHP 8.4 issues in src/ and tests/ from junit/terminal output. If blocks-json.php is empty after build, regenerate or fetch from upstream WordPress inside this repo. Commit and push fixes to remote-test-2026-08-31. When green, report: commit SHA, exit code, tests/errors/failures/skipped, runtime, junit path. |
|
Unable to authenticate your request. Please make sure to connect your GitHub account to Cursor. Go to Cursor |
Harden string/numeric type handling across wp-includes and wp-admin for PHP 8.4 strict type requirements. Update PHPUnit tests and fixtures for Imagick API changes, deprecation expectations, meta ID validation, and filesystem teardown. Co-authored-by: ecartz <ecartz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.cursor/environment.json)Cloud agent task
Grind until
npm run test:phpis green on this branch using upstream npm/docker harness only.Setup:
npm ci && npm run build:dev && npm run env:start && npm run env:installTest:
npm run test:php