| 开发者 | eliehanna |
|---|---|
| 更新时间 | 2026年10月7日 10:24 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
exec() function is enabled. Many managed hosts (WP Engine, Kinsta, SiteGround and others) turn exec() off, and the free scanner needs it.
If your site is on one of those hosts, PHP Compatibility Scanner Pro runs the scan on a remote service instead, so it does not need exec() and the heavy work happens off your live server. Pro is a separate plugin, available from coffeewp.dev.
How it works
PHP_CodeSniffer turns your code into PHP tokens instead of searching it as text. A function name inside a comment or a string is not reported, and each finding names the PHP version that deprecated or removed what your code uses.
How to Use:
wp-content/plugins/ directoryThis plugin helps WordPress developers check if their custom code (plugins and themes) will work with different PHP versions. It's especially useful when planning to upgrade PHP on production servers or when developing for clients with specific PHP version requirements.
Most managed hosting providers (WP Engine, Kinsta, SiteGround, etc.) disable the exec() function for security reasons. This plugin needs to run PHP commands to analyze your code, which requires this function to be enabled.
Not with this plugin: it needs exec() and access to a PHP binary, and managed hosts disable both. PHP Compatibility Scanner Pro sends the plugin or theme to a remote scan service instead, so the scan never runs on your server. It is a separate plugin, available from coffeewp.dev.
The plugin can test your code against PHP versions 7.4 through 8.4, helping you identify compatibility issues before upgrading.
The scan runs PHP_CodeSniffer with the PHPCompatibility standard, a ruleset maintained specifically to track what changed in each PHP release. PHP_CodeSniffer parses your code into PHP tokens instead of searching it for text patterns, so every match is judged in context. A function name that appears inside a comment or a string is not reported, and a call is only flagged against the PHP versions that actually changed it. Scanners built on pattern matching cannot make that distinction, which is where both false alarms and missed issues come from.
The one your host will move you to. PHP 8.2 gets security fixes until 31 December 2026, PHP 8.3 until 31 December 2027 and PHP 8.4 until 31 December 2028. Many hosts upgrade older sites automatically around those dates, so check before they do.
Yes. You can select multiple plugins and themes to scan simultaneously. The plugin processes them in batches to manage memory usage efficiently.
You can stop a long-running scan at any time. Lowering the batch size also helps on servers with tight memory or execution limits.
No, your files are never modified. The plugin only reads your code to analyze it. Any temporary files created during scanning are automatically cleaned up.