该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

PHP 兼容性检查工具


WP Engine 的 PHP 兼容性检查工具可用于在任何虚拟主机的任何 WordPress 站点上检查 PHP 版本的兼容性。

该插件将对 WordPress 文件系统中的主题和插件代码进行检测,并给出兼容性问题的报告供您修复(兼容性问题被分为错误和警告)且同时列出违规代码的文件和行号,以及该行代码与所选 PHP 版本不兼容的原因。该插件也会建议更新主题和插件,因为新版本可能会提供兼容的代码。



此插件依靠 WP-Cron 在后台扫描文件。如果站点的 WP-Cron 不能正常运行,扫描将被卡住。请参阅常见问题以了解更多信息。

更新至 php 7.3

  • 使用此插件来检查您的站点是否兼容至 PHP 7.3!
  • 截至2019年7月,20.1%的 WordPress 网站运行的PHP版本早于 PHP 5.6。
  • 这些版本的 PHP 已被淘汰和放弃支持超过2年。
  • 只有 54.1%的 WordPress 网站运行 PHP 7,即当前主要版本的 PHP。


虽然该插件的编写是为了尽可能准确地检测出更多问题,但检测无法保证 100% 可靠。在迁移到新的PHP版本之前的最佳做法是进行全面测试。

该插件由 WP Engine 创建,只在帮助 WordPress 社区增加对现代PHP版本的采用率。我们欢迎您对该插件做出贡献。我们也很高兴能看到其他开发者和 WordPress 主机商使用该插件。

要披露此插件的安全问题,请发电子邮件至 WordPress@wpengine.com
PHP兼容性检查工具包括 WP-CLI 命令支持。

wp phpcompat <version> [--scan=<scan>]

    PHP version to test.

  Whether to scan only active plugins and themes or all of them.
  default: active
    - active
    - all

例子:wp phpcompat 7.2 --scan=active


  • 主界面:兼容性检查选项
  • 兼容性结果界面


Note: If you have WordPress 2.7 or above you can simply go to ‘Plugins’ > ‘Add New’ in the WordPress admin and search for “PHP Compatibility Checker” and install it from there.

1. 上传phpcompat/wpengin-wp-content/plugins/目录中。
2. 通过 WordPress 的“插件”菜单启用该插件。

You will find the plugin options in the WP Admin Tools => PHP Compatibility menu. Once you click run it will take a few minutes to conduct the test. Feel free to navigate away from the page and check back later.

可用 WP-CLI 命令,详情请见其他说明部分。


  1. Will this work outside of the WP Engine hosting account?

    Yes, this plugin can be used any ANY WordPress website on ANY host.

  2. 是否有 WP-CLI 命令可用?

    是,该插件扩展了 WP-CLI 并提供了命令。请参阅其他说明部分以了解详细信息。

  3. 我创建的一个插件被列为不兼容,应该怎么办?

    We maintain a whitelist of plugins that cause false positives. If your plugin shows up as incompatible but you think that is wrong, please open a GitHub issue on the project, or email wordpress@wpengine.com with info about your plugin and why you know it is compatible (you have automated tests, the failure is on backwards compatibility code paths, etc).

  4. Can I use this to test non-WordPress PHP Projects?

    Yes! While you cannot use this WordPress plugin to test your non-WordPress projects, you can use the Open Source PHPCompatibility Library that this plugin is built on.

  5. 为什么我的插件/主题被跳过?

    Some servers have timeouts to prevent long running queries, this is commonly 60 seconds. This can prevent the checker from being able to process large themes or plugins. You should check with your host to see if this timeout can be temporarily removed. The best way around this timeout issue is to run this plugin on a local copy of your site, or you can use the WP-CLI command.

    您可以使用过滤器 wpephpcompat_scan_timeout 来自定义扫描超时。请参阅这里的例子。

    将超时设置为 0,可以禁用 cron/超时。

  6. 扫描被卡住了,我该怎么办?

    PHP 兼容性检查工具依靠 WP-Cron来 批量处理插件/主题,这对于避免服务器超时是必须的。如果您站点的 WP-Cron 没有正常运行,扫描就会被卡住。您可以使用WP Crontrol 进行排查。cron 的名称是 wpephpcompat_start_test_cron。如果您的站点使用的是基本身份验证,这也可能是导致此问题的原因。

    您也可以使用 WP-CLI 命令或禁用超时来避免使用 WP-Cron。

  7. 我发现了 Bug 或想反馈意见,我可以做出贡献吗?

    Yes! WP Engine has a public GitHub repo where you can contribute back to this plugin. Please open an issue on the Plugin GitHub. We actively develop this plugin, and are always happy to receive pull requests.

    该插件由 WP Engine 创建,只在帮助 WordPress 社区增加对现代PHP版本的采用率。我们欢迎您对该插件做出贡献。我们也很高兴能看到其他开发者和 WordPress 主机商使用该插件。

要披露该插件的安全问题,请发电子邮件至 WordPress@wpengine.com


In the process of Migrating a super old WordPress site on PHP 5.6 to 7.4. This plugin broke the site, and left some composer dependencies around which force me to re-install WordPress from scratch.
I'm amazed that this is the only plugin recommended to be run before the latest Wordpress PHP update. It says that its not compatible with my PHP 7.2 and clearly that's true. It hangs repeatedly, sometimes throwing a error status of 0.


“PHP 兼容性检查工具” 是开源软件。 以下人员对此插件做出了贡献。


“PHP 兼容性检查工具”插件已被翻译至21种本地话语言。 感谢所有译者为本插件所做的贡献。

将“PHP 兼容性检查工具”翻译成您的语言。





  • Removed PHP 5.2 checks
  • Fixed PHP 8 issue where plugin cannot cannot be uninstalled.


  • Added Smart Plugin Manager to whitelisted plugins


  • Added support for PHP 7.3 compatibility checks


  • Update dependencies.


  • Better translation support.


  • Switched to new PHPCompatibilityWP library to help prevent false positives.


  • Use plugin version number to enqueue scripts and styles.


  • PHP 5.2 Support & PHP 7.1 and 7.2 Lints.
  • Updated call to action sidebar depending on platform.


  • Fixed Composer issue.


  • Updated PHP_CodeSniffer to fix a security advisory.
  • Whitelisted a number of plugins.


  • Updated UX for viewing PHP errors to be more intuitive and require less scrolling.
  • Added links for non-technical users who need assistance from developers to fix PHP errors or to test their site in PHP 7 enabled hosting environments.


  • Added a “Clean up” button and uninstall.php.
  • Added phpcompat_phpversions filter.


  • Whitelisted a number of plugins.


  • Updated the PHPCompatibility library to latest version. Should fix many false positives.
  • Changed language and added help text to Admin UI.


  • Fixed Composer issue.


  • Updated the PHPCompatibility library to latest version.
  • Whitelisted TablePress.


  • Whitelisted UpdraftPlus and Max Mega Menu.


  • Updated the PHPCompatibility library to latest version


  • Updated the PHPCompatibility library to latest version
  • Added support for PHP 5.6


  • Fixed issue with WordPress notices breaking the plugin header.
  • Changed the way we send and parse JSON.
  • You can now restart an in progress scan.
  • Updated download.js to v4.2 for better Safari compatibility.


  • Fixed bug with active job display.
  • Updated progress bar calculation.


  • Test results now persist page reloads.
  • Failed tests will show an overview of the results.
  • The scan timeout is now configurable using a filter. See the FAQ for more details.


  • Fixed a bug in the WP-CLI command
  • Added a handful of PHP 7 compatible plugins to the whitelist


  • Added additional role protections
  • Changed the UI colors to better understand output at a glance
  • Exclude checking node_modules and tmp directories
  • Added support for child theme’s parent theme


  • Updated compatibility library with a few bugfixes
  • Added skip logic to prevent checker from hanging


  • Major update to add PHP 7 checking support
  • Improved the UX of the progress bar
  • Fixed bug with the way the plugin menu was registered


  • Initial version
  • PHP 5.5, 5.4, and 5.3 Support
  • Basic WP-CLI Commands