Skip to content

[SITE-5390] Add fixes for PHP 8.4.8 compatibility#525

Draft
AnaisPantheor wants to merge 1 commit intomainfrom
php84Compatibility
Draft

[SITE-5390] Add fixes for PHP 8.4.8 compatibility#525
AnaisPantheor wants to merge 1 commit intomainfrom
php84Compatibility

Conversation

@AnaisPantheor
Copy link
Copy Markdown
Contributor

@AnaisPantheor AnaisPantheor commented Nov 28, 2025

AI-generated drafts from Claude Code - will stay in draft until I actually look at them

PHP 8.4.8 Fixes suggested by ClaudeCode

Added proper property declarations in /wp-content/plugins/wp-redis/object-cache.php at line 442-461:
The WP_Object_Cache class was using three properties without declaring them:
$redis - The Redis client instance
$missing_redis_message - Error message string
$global_prefix - Global cache key prefix

The change from $port = -1; to $port = null; is a PHP 8.4 compatibility fix.
PHP 8.4 stricter type handling: PHP 8.4 has stricter type checking, and passing -1 as a port value may trigger deprecation warnings or errors

@AnaisPantheor AnaisPantheor requested a review from a team as a code owner November 28, 2025 18:33
@AnaisPantheor AnaisPantheor marked this pull request as draft December 1, 2025 15:34
Copy link
Copy Markdown
Contributor

@jazzsequence jazzsequence left a comment

Choose a reason for hiding this comment

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

There are a bunch of wporg validation fixes that should be made and also a couple comment changes that would break our own linting rules in 3.0 (not sure what version we're using on this project). Overall, it looks fine once it's cleaned up.

Comment on lines +1359 to +1360
// PhpRedis throws an Exception when it fails a server call.
// To prevent WordPress from fataling, we catch the Exception.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment change will break Pantheon WP Coding Standards in 3.0

Comment on lines +1395 to +1396
// PhpRedis throws an Exception when it fails a server call.
// To prevent WordPress from fataling, we catch the Exception.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔢 same as above

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.

2 participants