平台开发中,欢迎参与测试。你可以在 QQ群:1046115671 中与我们交流,或是直接在社区发帖

PHP 兼容性检查工具

帮助改进此插件的 简体中文 翻译~ 同时,你可以通过安装 WP-China-Yes 插件,并切换应用市场为“LitePress 应用市场”来接收翻译推送。

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 主机商使用该插件。

To disclose security issues for this plugin please email WordPress@wpengine.com
PHP Compatibility Checker includes WP-CLI command support:

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


<version>
    PHP version to test.

[--scan=<scan>]
  Whether to scan only active plugins and themes or all of them.
  default: active
  options:
    - 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.

To manually install:
1. Upload phpcompat to the /wpengine-wp-content/plugins/ directory
2. Activate the plugin through the ‘Plugins’ menu in 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.5.2

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

1.5.1

  • Added Smart Plugin Manager to whitelisted plugins

1.5.0

  • Added support for PHP 7.3 compatibility checks

1.4.8

  • Update dependencies.

1.4.7

  • Better translation support.

1.4.6

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

1.4.5

  • Use plugin version number to enqueue scripts and styles.

1.4.4

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

1.4.3

  • Fixed Composer issue.

1.4.1

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

1.4.0

  • 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.

1.3.2

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

1.3.1

  • Whitelisted a number of plugins.

1.3.0

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

1.2.4

  • Fixed Composer issue.

1.2.3

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

1.2.2

  • Whitelisted UpdraftPlus and Max Mega Menu.

1.2.1

  • Updated the PHPCompatibility library to latest version

1.2.0

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

1.1.2

  • 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.

1.1.1

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

1.1.0

  • 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.

1.0.3

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

1.0.2

  • 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

1.0.1

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

1.0.0

  • 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

0.1.0

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

评价

目前还没有评价

成为第一个“PHP 兼容性检查工具” 的评价者