Tidyleaf Upgrade Scanner for PHP

Description

Before you move a site to a newer PHP version, find out what will break. The checker reads the code of your plugins and themes and lists every file and line that fails, or starts logging deprecation notices, on the PHP version you pick: 7.4, 8.0, 8.1, 8.2, 8.3 or 8.4.

Runs on any host. The scan runs inside WordPress itself. It does not call exec() or shell_exec(), so it works on managed and shared hosts that disable them. Nothing is sent anywhere: the plugin makes no external requests.

Checks every plugin and theme. Premium, custom and abandoned code included, because it reads the files on your server rather than looking them up in a database of known plugins.

Up to date for PHP 8.4. Built on PHP_CodeSniffer and the current development line of the PHPCompatibility standard (with the WordPress-specific exclusions of PHPCompatibilityWP), which covers the changes in PHP 8.1, 8.2, 8.3 and 8.4, including implicitly nullable parameters, ${} string interpolation, E_STRICT and the utf8_encode() deprecation.

Does not time out. Large sites are scanned in short background batches. Progress is saved after every file, so a host time limit or memory limit never loses work, and a file that is too big for the server is skipped and reported instead of stopping the scan. You can leave the page while it runs.

Results you can act on. For each plugin and theme you get errors (code that fails on the target version) and warnings (deprecations that still run but log notices), each with file, line, the reason, and a plain-English fix hint. If an update is waiting for that plugin, the report says so, since updating usually fixes most findings.

Free CSV report of every finding, ready to send to a plugin author, a developer or a client.

WP-CLI

wp phpcompat scan --version=8.4

Scans everything installed and prints a summary per plugin and theme. Add plugin or theme slugs to scan only those, --scope=active for active ones only, and --format=csv or --format=json for machine-readable output. The command exits with status 1 when it finds errors, so it can gate a deploy or a CI job.

What a static check can and cannot see

The checker reads code; it does not run it. Code that is only used on old PHP versions (behind a version check or function_exists()) may still be reported, and problems that only appear at run time, such as passing null to a built-in function, cannot be seen. Treat the report as the list to verify on a staging copy before you switch PHP versions.

Bundled libraries

  • PHP_CodeSniffer 4 (BSD-3-Clause), https://github.com/PHPCSStandards/PHP_CodeSniffer
  • PHPCompatibility (LGPL-3.0-or-later), https://github.com/PHPCompatibility/PHPCompatibility
  • PHPCompatibilityWP and PHPCompatibilityParagonie (LGPL-3.0-or-later), https://github.com/PHPCompatibility
  • PHPCSUtils (LGPL-3.0-or-later), https://github.com/PHPCSStandards/PHPCSUtils

Each library keeps its license file in the vendor folder. The versions are pinned in composer.lock.

Screenshots

Installation

  1. Install and activate the plugin.
  2. Go to Tools > PHP Compatibility.
  3. Pick the target PHP version, choose active or all plugins and themes, and click Scan now.

FAQ

Does it send my code anywhere?

No. Everything runs on your own server and the plugin makes no external requests.

My host disables exec(). Will it work?

Yes. That is the point of this plugin: PHP_CodeSniffer runs inside the WordPress request, without any shell command.

Why does a plugin I use every day show errors?

Usually the code in question only runs on old PHP versions, or the plugin bundles a library with compatibility code. Check whether an update is available first, then test the plugin on a staging site running the target PHP version.

What is the difference between an error and a warning?

An error is code that fails on the target version: a removed function, a removed syntax that stops the file from loading, or a change in behaviour. A warning is a deprecation: the code still runs but logs a notice and will break in a later PHP version.

Which PHP versions can it check?

7.4, 8.0, 8.1, 8.2, 8.3 and 8.4. New versions are added as the PHPCompatibility standard covers them.

Is there a Pro version?

Yes, as an optional add-on. Everything described above is free and stays free, with no limits on sites, scans or findings. Tidyleaf Upgrade Scanner Pro adds scheduled scans (daily, weekly or monthly), an email report with the CSV attached and what changed since the last scan, a white-label client report, and more WP-CLI commands. It is sold through Polar (polar.sh) at $24 a year for 5 sites. This plugin links to it from its row on the Plugins screen and once under the scan results; it shows no other notices.

Some files were skipped. Why?

Files larger than 1 MB, or too large for the memory your host allows, are skipped and counted in the report. They are almost always generated files such as Composer class maps.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Tidyleaf Upgrade Scanner for PHP” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1.0

  • Adds a link to the optional Pro add-on (scheduled scans and email reports) on the Plugins screen and under the results.

1.0.0

  • First release: scans plugins and themes for PHP 7.4 to 8.4, background batches, CSV report, WP-CLI command.