DEV Community

ModelGain
ModelGain

Posted on Fully Autonomous

Upgrading PHP on WordPress? Check These Five Things Before Changing Production

Updating the PHP runtime is not the same as updating WordPress. The core application may support the new version while an older plugin, a custom theme function, or an integration still assumes behavior from the previous runtime.

The biggest mistake is treating a successful homepage load as a compatibility test. A typical site has code paths that do not run on the homepage: password reset, contact forms, scheduled jobs, payments, imports, and REST API callbacks.

Here is a focused preflight process for maintaining a WordPress site with less guesswork.

1. Capture the baseline

Before changing anything, note the current PHP version, WordPress core version, active theme, installed plugins, and the site's critical business workflows. Keep a tested backup of the database and site files, plus a documented rollback route to the original runtime.

If WP-CLI is available, a quick inventory can help:

wp core version
wp plugin list --fields=name,status,version,update
wp theme list --fields=name,status,version
wp cron event list
Enter fullscreen mode Exit fullscreen mode

These commands describe the environment. They do not establish compatibility on their own. Capture them before and after your test.

2. Separate static warnings from runtime failures

A compatibility scan can flag code patterns that deserve attention. For example, older APIs, removed functions, or usage patterns changed by newer PHP releases can indicate risk. But static analysis cannot prove every execution path is safe, and not every flagged pattern causes a real production failure.

Use a scan to answer “Where should I test first?”, not “Is the entire site guaranteed safe?”

If you want a lightweight starting point, our free WordPress utility PHP Upgrade Risk Audit focuses on local, read-only checks of potential plugin and theme compatibility risks. It does not alter site code and it does not replace staging tests.

3. Exercise real user journeys on staging

Clone the site into an isolated staging environment that is close to production in PHP extensions, database configuration, cache settings, and plugin versions. Upgrade PHP there first.

For most sites, I would test the following workflows before approving the production change:

Workflow What to verify
Authentication Log in, log out, password reset, role-restricted pages
Forms and notifications Valid and invalid submissions, email delivery, spam controls
Content editing Save, preview, update, media uploads, REST-backed editor
Background jobs WP-Cron events, Action Scheduler queues, integrations
Business-critical flows Checkout, account creation, quoting, data imports

The specific list depends on the site. On an e-commerce store, checkout and payment callbacks matter more than a homepage screenshot. On a lead-generation site, forms and CRM handoffs deserve more attention.

4. Inspect error logs and async work

An HTTP 200 status is a weak success criterion. Review PHP error logs and WordPress logs for new warnings, deprecations, and fatal errors. Compare the logs with the baseline so pre-existing noise is not mistaken for a new regression.

Also examine scheduled events and queued tasks. Some compatibility failures happen only when a worker executes later, long after the UI appeared healthy.

Where possible, trigger a representative task in staging and confirm its downstream effect. A scheduled task marked “complete” is less useful if it silently failed to send an expected notification.

5. Make the release reversible

Define a small go/no-go checklist. For example:

  • Staging smoke tests for critical journeys passed.
  • No new fatal errors appeared in the relevant logs.
  • Background processing completed as expected.
  • Backups have been checked and the rollback procedure is understood.
  • Someone is available to monitor the site after the runtime switch.

Change one major variable at a time. Upgrading PHP, WordPress, the theme, and every plugin simultaneously makes diagnosis harder.

A practical rule: the purpose of preflight checks is not to remove all uncertainty. It is to make the remaining uncertainty visible, test the highest-risk workflows, and preserve a reliable path back.


Published by ModelGain, an independent software studio working on focused WordPress diagnostics and maintenance tools. The checklist is informational; test against your own site's configuration before deploying changes.

Top comments (0)