Running client WordPress sites on legacy PHP versions (such as PHP 7.4 or 8.0) is a major liability. Official security support for PHP 7.4 ended in November 2022, as documented on the PHP.net Supported Versions page, and PHP 8.0 reached End-of-Life (EOL) in late 2023. Hosts are now charging “legacy PHP extension fees” or forcefully upgrading PHP versions, often breaking custom client sites overnight.
Here is my agency pre-flight checklist for upgrading WordPress sites to PHP 8.2 and PHP 8.3 safely.
Common Breakages in PHP 8.x Upgrades
PHP 8 introduced strict typing and deprecated legacy dynamic properties, causing errors that were previously soft warnings to become fatal Uncaught TypeError or Fatal error exceptions.
// Fatal error in PHP 8.0+ when passing null to built-in string functions
// PHP 7.4 (Warning): strlen(null) -> 0
// PHP 8.0+ (Fatal Error): TypeError: strlen(): Argument #1 ($str) must be of type string, null given
$len = strlen($uninitialized_var);
Key Culprits to Check:
- Deprecated Function Signatures: Passing
nullto non-nullable parameter functions (strlen,str_replace,explode). Refer to the PHP.net Deprecated Features guide for specific function signature changes. - Outdated Plugins: Unmaintained utility plugins or custom agency code written prior to 2020.
- Legacy Theme Frameworks: Older versions of WPBakery, Avada, or custom
functions.phpfile hooks. - Obsolete MySQLi / PDO code: Direct database queries bypassing
$wpdb. Check against official WordPress Developer Resources.
The PHP Upgrade Checklist for Agencies
1. Run PHP Compatibility Scanner in Staging
Never toggle the PHP version selector in cPanel or Plesk on a live production site without testing first.
- Clone the production environment to a sandbox URL.
- Switch the staging environment’s CLI and FPM handler to PHP 8.3.
- Enable
WP_DEBUGandWP_DEBUG_LOGinwp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
2. Audit Deprecated Code: Fix, Don’t Suppress
Many developers attempt to suppress PHP 8 warnings using @ or error_reporting(E_ALL & ~E_DEPRECATED). This is a temporary band-aid that masks memory leaks and compatibility failures.
- Audit
debug.logfor explicit line numbers. - Update premium plugins (ACF Pro, Gravity Forms, WooCommerce extensions) to their latest release channels.
- Patch custom theme functions with null-coalescing operators:
// Before (Fails in PHP 8.x if $_POST['setting'] is unset)
$value = $_POST['setting'];
// After (PHP 8 safe)
$value = $_POST['setting'] ?? '';
3. Benchmark Optimisations and Verify OpCache
Upgrading to PHP 8.3 brings notable performance benefits, including reduced memory usage and enhanced JIT (Just-In-Time) compilation for computationally heavy queries.
| Benchmark Parameter | PHP 7.4 (EOL) | PHP 8.3 (Supported) | Impact |
|---|---|---|---|
| TTFB (Time to First Byte) | 1,840 ms | 310 ms | 83% faster response |
| PHP Notices / hr | 412 notices | 0 errors | Clean error log |
| Security Status | Vulnerable | Fully Patched | Compliant & secure |
Need Fixed-Price PHP Upgrades for Client Sites?
If you manage a backlog of agency client sites running on legacy PHP 7.4 or 8.0, I provide fixed-price PHP Version Upgrades starting at £395 per site. Every upgrade is tested on staging, verified against error logs, and backed by a 30-day warranty.
Need expert help with your WordPress site?
I specialize in fixed-price WordPress migrations, PHP upgrades, and emergency hacked site recoveries for site owners and web agencies.