Проверка плагина на ошибки

  1. Этот сайт использует файлы cookie. Продолжая пользоваться данным сайтом, Вы соглашаетесь на использование нами Ваших файлов cookie. Узнать больше.
  2. Вы находитесь в сообществе Rubukkit. Мы — администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на различные языки плагины наших коллег из других стран.

    Скрыть объявление

Скрыть объявление

В преддверии глобального обновления, мы проводим исследования, которые помогут нам сделать опыт пользования форумом ещё удобнее. Помогите нам, примите участие!

Помогите Найти сайт где можно проверить правильность написания конфигов плагинов

Тема в разделе «[Архив] Помощь», создана пользователем Droid, 16 сен 2013.

Статус темы:

Закрыта.
Статус темы:

Закрыта.

Поделиться этой страницей


Rubukkit - свой сервер Minecraft






  • Детали
  • Отзывы
  • Разработка

Описание

Этот плагин произведет серию проверок вашей установки WordPress для определения известных проблем и общих ошибок в конфигурации, он также позволяет плагинам и темам внедрять их собственные проверки.

В разделе отладочной информации вы найдете информацию о вашей установке WordPress и настройках сервера, этой информацией можно поделиться с представителями поддержки тем, плагинов или на официальном форуме поддержки WordPress.

Режим решения проблем позволяет запустить чистую сессию WordPress, с отключением плагинов и использованием темы по умолчанию, но только для вас, до отключения режима или выхода из сессии.

Раздел инструментов позволяет выполнить проверку целостности файлов WordPress, функциональности отправки эл.почты, а также совместимости плагинов с возможными обновлениями версии PHP в будущем.

Для подробных примеров эффективного использования плагина Health Check посмотрите Руководство от команды поддержки WordPress по этому плагину.

Отзывы приветствуются на форумах WordPress.org, GitHub странице проекта или Slack на канале #forums, либо #core-site-health.

Скриншоты

Часто задаваемые вопросы

Я не могу получить доступ к сайту после включения режима решения проблем

Если вы застряли в режиме решения проблем, вы можете отключить его очистив куки.

Не знаете как очистить куки? Нет проблем, закройте браузер или перезагрузите компьютер, они теперь автоматом очистятся.

Проверка совместимости утверждает, что плагин работает только с PHP версии X?

Плагин создан как инструмент поддержки для широкого круга пользователей, это означает также и то, что он создан и для старых сайтов.

Инструмент проверки совместимости PHP не различает этот код от реального, поэтому может выдавать ложноположительный результат.

На настоящее время плагин был проверен с каждой версией PHP, от 5.2 до 7.3, и работает с любой из них.

Where can I report security bugs?

The Site Health team and WordPress community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.

To report a security issue, please visit the WordPress HackerOne program.

Отзывы

Mo
16.07.2023

I hate troubleshooting plugin conflicts, but this plugin makes the process less stressful. I can now troubleshoot and fix issues without affecting the live site, which is a massive bonus. I would highly recommend this plugin. 5*

I installed this plugin at the recommendation of a WordPress support forum. I tried to troubleshoot and got this message. «We were unable to copy the plugin file required to enable the Troubleshooting Mode.»

I tried to check plugin compatibility, and all I got was «could not be determined.»

I checked the community forum to see if there were any solutions but most of the questions are still unanswered.

I was able to get info on some parts of the site, but the two reasons I downloaded it don’t function.

I have finished the Korean translation.I just want to say thank you for developing such a good plugin.And I hope it will be translated into more languages so that many WordPress users can use it conveniently.

Health Check & Troubleshooting 한국어 번역을 모두 마쳤습니다.좋은 플러그인을 개발해 주어서 고맙다는 인사를 전하고 싶습니다.그리고 보다 많은 언어로 번역되어 많은 워드프레스 사용자들이 편리하게 사용할 수 있기를 바랍니다.

To solve a problem with a plugin I came across this. It works great and quickly found out where and with which plugin the problem was!

This plugin is problematic; it created a critical issue on my site, and it is impossible to reversed to normal. It is impossible to use this plugin, so I deleted it from the server, but still, my site is in a troubleshooting mood. This plugin broke my site.

this plugin is a real bomb! it kept all my plugins disabled after activating the troubleshoot mode! I couldn’t do anything, it prevented me for enabling any of it, and not just for myself, but everyone!

I don’t know if the problem is PHP 8.1 (not compatible?!), but I had to do so many things to be able to deactivate this stupid plugin! Only after adding PHP 7.4 to my server I was able to deactivate it. this is really dangerous!!!

Посмотреть 151 отзыв

Участники и разработчики

«Health Check & Troubleshooting» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

Журнал изменений

1.7.0 (2023-08-06)

  • General: Improved styling inconsistency between the plugin and WordPress core.
  • General: Fixed an issue with plugin translations where language strings would get mixed when using third party language plugins, or a separate profile language.
  • Troubleshooting Mode: Fixed the URL used when disabling elements and having a subdirectory installation.
  • Troubleshooting Mode: Fixed a deprecation warning when disabling troubleshooting mode on PHP version 8.3 or higher.
  • Troubleshooting Mode: Added reference on how to troubleshoot as different users when testing scenarios.
  • Tools: Fixed integration with WPTide for the PHP Compatibility checker.
  • Tools: Added a viewer that will display debug log output when enabled.
  • Tools: Added a warning to the File Integrity tester if unexpected files are mixed in with WordPress core files.
  • Tools: Added a warning if sending emails is taking longer than expected.
  • Tools: Added beta feature toggle for those who wish to test new functionality that may not be fully ready yet.
  • CLI: Fixed the CLI commands, you can now wp health-check status to your hearts content!
  • Beta feature: Added a new beta feature, making it easier for non-technical users to grab screenshots of issues on their site, and share them.

v1.6.0 (2023-03-31)

  • Improved the visual aspects of the Troubleshooting Mode Widget.
  • Improved security by hardening Troubleshooting Mode actions with security tokens (nonces).
  • Added a new tool to check .htaccess rules (where applicable).
  • Added TwentyTwenty Three to the list of default themes.
  • Added option to install the latest classic (non Site Editor-focused) default theme if no default theme exists.
  • Added a new security confirmation prompt in Troubleshooting Mode, if a security token (nonce) value is either expired, or missing.
  • Added better documentation around reporting security concerns.
  • Fixed a bug where notices from previous Troubleshooting sessions would show up in a new session, which is just confusing.

Comments

@mukeshpanchal27

Is your enhancement related to a problem? Please describe.

QA testing will review the user interfaces for the Plugin Checker plugin. This will involve testing both the WP Admin interface and the CLI command.

Testing will be done against a number of different scenarios to ensure the plugin and checks work correctly under different circumstances. As well as identifying any bugs within the plugin, QA should also make recommendations on any improvements that can be made to accessibility and overall usability.

Scenarios

The following scenarios outline the different environment setups to be tested against. For each of the scenarios below there should be 2 tests, 1) where the Test Plugin contains errors/warnings that the check will pick up, 2) where the Test Plugin contains no errors/warnings.

  1. Minimal Plugins Installed / Test Plugin inactive — This is the most minimal environment to test against. There should only be the Plugin Checker and Test plugin installed. In this scenario only static checks should be run.
  2. Minimal Plugins Installed / Test Plugin active — Same as the Scenario 1, except the Test Plugin is active. In this scenario all checks (both static and runtime) should be run.
  3. Minimal Plugins Installed / Test(Performance Lab) Plugin active — Same as the Scenario 1, except the Test Plugin is active. In this scenario only static checks should be run because PL plugin override object cache so runtime check will be skipped in this case.
  4. Multiple Plugins installed / No plugins active — This scenario includes additional plugins that won’t be checked by the plugin checker. In this scenario, only static checks should run against the Test Plugin and no others.
  5. Multiple Plugins installed / Only test plugin active — Same as Scenario 3, but this time both static and runtime checks should be run.
  6. Multiple Plugins installed / Only test(Performance Lab) plugin active — Same as Scenario 3, but this time static checks should be run because PL plugin override object cache so runtime check will be skipped in this case.
  7. Multiple Plugins installed / All plugins active — Same as Scenario 4, but checks/errors are only run against the Test Plugin.

Note: There is one known issue that we are already tracking for the Elementor plugin. Please refer to #185. If you encounter this issue, please ignore it. Thank you!

Test Plugins

The following plugin was custom developed by us for testing purposes only.

  • Test Plugin Check Valid — Test plugin for Plugin Check that has no errors.
  • Test Plugin Check Errors — Test plugin for Plugin Check errors.

Additional Plugins to test

In addition to testing the test plugins against the scenarios above, real WordPress plugins should also be tested against. This is to ensure the plugin checker works as expected with larger and more complex plugins.

The following plugins will only need to be tested with both via the CLI and AJAX. These should be tested against an environment similar to Scenario 5, where all of the following plugins are installed, but only the plugin to test is active.

  • WooCommerce — A large popular plugin
  • Elementor — A page builder
  • Yoast SEO — The WordPress Seo Plugin
  • Jetpack — WP Security, Backup, Speed, & Growth
  • Contact Form 7 — Best contact form plugin
  • Performance Lab — A plugin that override object cache.
  • Ads.txt Manager — A smaller, light weight plugin

Testing Instructions

Local Setup

The basic steps below outline how to setup the repository locally for testing.

  1. Install and configure the following prerequisites:
    1. Node.js
    2. Docker
    3. Git
    4. Composer
  2. Clone the repository — $ git clone git@github.com:10up/plugin-check.git
  3. Install local development dependencies — Install local development dependencies by first running composer install followed by npm install in the project folder.
  4. Start the local development environment — Run npm run wp-env startto start the WordPress environment. The WordPress development site will be available at http://localhost:8888/ and WP admin will be available at http://localhost:8888/wp-admin/. You can log in to the admin using the username admin and password password.

How to start local environment

  1. Open up the terminal
  2. Change directory to the plugin folder — cd ~/Projects/plugin-check (you may need to update the directory path depending on where the folder exists).
  3. Pull the latest code changes — git pull origin trunk
  4. Run the composer and node install commands, this might not be required but will make sure everything is up to date.
    4a. Composer — composer install
    4b. Node — npm install
  5. Start the local environment — npm run wp-env start
  6. Once started, you should be able to access the WordPress site at http://localhost:8888/.
  7. Once you’ve completed QA for the day shutdown the local site with — npm run wp-env stop

Testing the WP Admin

The following steps should be used to test each scenario outlined above.

  • Click the Tools > Plugin Check menu item in the WP Admin
  • See the Plugin Check Screen with the page title, form with the plugin list dropdown and submit button. The dropdown should display all installed plugins except for the Plugin Check plugin.
  • Select the Test Plugin to test and click the submit button.
  • Review the output from the checks.
    • Ensure if no errors/warnings are output if no issues are expected from the test plugin.
    • Ensure errors/warnings are displayed if the expected from the test plugin.
    • Ensure any errors/warnings are only related to the test plugin (file/line numbers) and do not include other plugin files.
  • If there is an unexpected failure on the Plugin Check, note any output or errors from the following places
    • The WP admin screen
    • The Browsers JS Console
    • The Browsers Network tab — inspecting the admin-ajax.php POST requests.

Testing the CLI Command

The following steps should be used to test each scenario outlined above.

  • Run the following command replacing {plugin} with the Test Plugin slug. After each command note the output before running the next.
    • npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php — Basic command run
    • npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php --checks=i18n_usage — Runs a specific Static check
    • npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php --checks=enqueued_script_size — Runs a specific Runtime check
    • npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php --ignore-warnings — Ignores check warnings
    • npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php --ignore-errros — Ignores check errors
    • npm run wp-env run cli -- wp plugin check {plugin} --checks=enqueued_scripts_size — Attempts to run a runtime check without the runtime environment being prepared.

Designs

No response

Describe alternatives you’ve considered

No response

Code of Conduct

  • I agree to follow this project’s Code of Conduct

@mukeshpanchal27



Copy link


Contributor


Author

@eclarke1, @jjgrainger, and @felixarntz, could you please take a look at the instructions and let me know if anything needs to be updated or changed? Thank you!

@jjgrainger

@felixarntz

@mukeshpanchal27 Thank you, the instructions look great to me so far. Only one point of feedback: You mention the «Test Plugin» a few times, but I don’t see anywhere that you clarify what that test plugin is or what those test plugins are. Can you please include that somewhere in the beginning? You list the actual plugins at the end, but what test plugins are you referring to?

@mukeshpanchal27



Copy link


Contributor


Author

@felixarntz I have added the test plugin in description. Please take a look. Thanks!

@felixarntz

@mukeshpanchal27



Copy link


Contributor


Author

Hi @felixarntz @joemcgill @spacedmonkey @eclarke1 I have completed the QA testing for Plugin Checker and here are the findings:

One common issue that I faced for the plugins ( WooCommerce, Yoast SEO, etc..) that when trying to add or install their custom tables in the WordPress database during the runtime check, the tables were not created. This resulted in a «table not found» error, causing the runtime checks to be skipped. I will open an issue #234 to address this problem.

  1. PHP 8.1.21 with WP 6.2.2 and 6.3 RC1
  • Ran through the scenarios with the tester plugins.
  • Ran through the plugin check with the WooCommerce, Elementor, Yoast SEO, Jetpack, Contact Form 7, Performance Lab, Ads.txt Manager plugins.
  • Checked console for any errors. None found.
  • Checked network for any errors. None found.
  • Status: Passed ✅
  1. PHP 8.0.29 with WP 6.2.2 and 6.3 RC1
  • Ran through the scenarios with the tester plugins.
  • Ran through the plugin check with the WooCommerce, Elementor, Yoast SEO, Jetpack, Contact Form 7, Performance Lab, Ads.txt Manager plugins.
  • Checked console for any errors. None found.
  • Checked network for any errors. None found.
  • Status: Passed ✅
  1. PHP 7.4 with WP 6.2.2 and 6.3 RC1
  • Ran through the scenarios with the tester plugins.
  • Ran through the plugin check with the WooCommerce, Elementor, Yoast SEO, Jetpack, Contact Form 7, Performance Lab, Ads.txt Manager plugins.
  • Checked console for any errors. None found.
  • Checked network for any errors. None found.
  • Status: Passed ✅
  1. PHP 7.0.33 with WP 6.2.2 and 6.3 RC1
  • Ran through the scenarios with the tester plugins.
  • Ran through the plugin check with the WooCommerce, Elementor, Yoast SEO, Jetpack, Contact Form 7, Performance Lab, Ads.txt Manager plugins.
  • Checked console for any errors. None found.
  • Checked network for any errors. None found.
  • Status: Passed ✅
  1. PHP 5.6.39 with WP 6.2.2
  • WordPress 6.3 RC1

    • The WordPress 6.3 RC1 removed this php version support so we can’t test’s it.
    • Status: Not Tested ❌
  • Admin screen check

    • Ran through the scenarios with the tester plugins.
    • Ran through the plugin check with the WooCommerce, Elementor, Yoast SEO, Jetpack, Contact Form 7, Performance Lab, Ads.txt Manager plugins.
    • Checked console for any errors. None found.
    • Checked network for any errors. None found.
    • Status: Passed ✅
  • WP CLI check

    • When i ran CLI command with any arguments npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php then it show If add parameter : Error: 'check' is not a registered subcommand of 'plugin'. See 'wp help plugin' for available subcommands. error message.

Screenshot 2023-07-21 at 10 13 24 AM

  • When i ran CLI command without any arguments npm run wp-env run cli -- wp plugin check {plugin} it show one notice CLI: Strict Standards: Static function WordPress\Plugin_Check\Checker\Abstract_Check_Runner::is_plugin_check() should not be abstract in /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Abstract_Check_Runner.php on line 102 and run the checks.

Screenshot 2023-07-21 at 10 13 55 AM

  • Status: Partially Passed ❌

Considering that WordPress 6.3 raises the minimum required PHP version to 7.0, we can ignore the deeper PHP 5.6 CLI issues. If you want me to open issue for this then let me know.

I performed a static check using a plugin, and the output tool displayed several errors and notices for various plugins. Please find the summary below:

  1. WooCommerce:

    • Files: 84
    • Errors Found: 32
    • Warnings Found: 122
  2. Yoast SEO:

    • Files: 58
    • Errors Found: 84
    • Warnings Found: 110
  3. Jetpack:

    • Files: 51
    • Errors Found: 25
    • Warnings Found: 105
  4. Elementor:

    • Files: 84
    • Errors Found: 32
    • Warnings Found: 122
  5. Contact Form 7:

    • Files: 91
    • Errors Found: 173
    • Warnings Found: 171

Already open WordPress/performance#787 issue for Performance Lab plugin.

Overall, the Plugin Checker has successfully passed testing for various PHP versions and WordPress versions.

@felixarntz

@mukeshpanchal27 Thank you for the detailed report, great to see that almost everything is working as expected.

Two follow-up things:

  • When you ran npm run wp-env run cli -- wp plugin check {plugin} (without the --require bit) and got the error, have you verified that the plugin was at that time active on the site? Since the CLI command was not found, I wonder whether that’s the issue. It would explain why it worked when you added the --require, since even without the plugin active it would still load the relevant files.
  • For the PHP warning you got with npm run wp-env run cli -- wp plugin check {plugin} --require=./wp-content/plugins/plugin-check/cli.php, let’s open a quick PR to fix it: Abstract static functions are discouraged in PHP, and since we already have the Check_Runner interface declaring it, having it defined as abstract in Abstract_Check_Runner is unnecessary anyway. So we should remove the method from Abstract_Check_Runner.

@mukeshpanchal27



Copy link


Contributor


Author

@felixarntz I have thoroughly investigated the issue with the --require option in the CLI, and I can confirm the presence of the reported error. However, upon further testing, I noticed that when using a specific check option, such as --checks, the plugin functions work without any errors. This indicates that the issue might be specific to the --require option, and we need to delve deeper into the root cause.

Additionally, I conducted more tests by activating and deactivating the Plugin Checker plugin to gain further insights. Here are the findings from the testing:

PHP 5.6

CLI Command: npm run wp-env run cli -- wp plugin check test-plugin-check-errors/test-plugin-check-errors.php --require=./wp-content/plugins/plugin-check/cli.php

  • Plugin Checker Active — ‘check’ is not a registered subcommand of ‘plugin’.
  • Plugin Checker Deactivate — ‘check’ is not a registered subcommand of ‘plugin’.

CLI Command: npm run wp-env run cli -- wp plugin check test-plugin-check-errors/test-plugin-check-errors.php

  • Plugin Checker Active — Checks working fine
  • Plugin Checker Deactivate — ‘check’ is not a registered subcommand of ‘plugin’.

PHP 8.0.29

CLI Command: npm run wp-env run cli -- wp plugin check test-plugin-check-errors/test-plugin-check-errors.php --require=./wp-content/plugins/plugin-check/cli.php

  • Plugin Checker Active — Checks working fine
  • Plugin Checker Deactivate — Error:
[24-Jul-2023 06:28:34 UTC] PHP Fatal error: Uncaught Error: Undefined constant "WordPress\Plugin_Check\Checker\Checks\WP_PLUGIN_CHECK_PLUGIN_DIR_PATH" in /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php:63
Stack trace:
#0 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks.php(80): WordPress\Plugin_Check\Checker\Checks\Abstract_PHP_CodeSniffer_Check->run(Object(WordPress\Plugin_Check\Checker\Check_Result))
#1 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks.php(45): WordPress\Plugin_Check\Checker\Checks->run_check_with_result(Object(WordPress\Plugin_Check\Checker\Checks\I18n_Usage_Check), Object(WordPress\Plugin_Check\Checker\Check_Result))
#2 [internal function]: WordPress\Plugin_Check\Checker\Checks->WordPress\Plugin_Check\Checker\{closure}(Object(WordPress\Plugin_Check\Checker\Checks\I18n_Usage_Check), 'i18n_usage')
#3 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks.php(46): array_walk(Array, Object(Closure))
#4 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Abstract_Check_Runner.php(278): WordPress\Plugin_Check\Checker\Checks->run_checks(Object(WordPress\Plugin_Check\Checker\Check_Context), Array)
#5 /var/www/html/wp-content/plugins/plugin-check/includes/CLI/Plugin_Check_Command.php(154): WordPress\Plugin_Check\Checker\Abstract_Check_Runner->run()
#6 [internal function]: WordPress\Plugin_Check\CLI\Plugin_Check_Command->check(Array, Array)
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#8 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func(Object(Closure), Array, Array)
#10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(431): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#11 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(454): WP_CLI\Runner->run_command(Array, Array)
#12 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1269): WP_CLI\Runner->run_command_and_exit()
#13 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#16 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('phar:///usr/loc...')
#17 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#18 {main}
 thrown in /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php on line 63
Fatal error: Uncaught Error: Undefined constant "WordPress\Plugin_Check\Checker\Checks\WP_PLUGIN_CHECK_PLUGIN_DIR_PATH" in /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php:63
Stack trace:
#0 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks.php(80): WordPress\Plugin_Check\Checker\Checks\Abstract_PHP_CodeSniffer_Check->run(Object(WordPress\Plugin_Check\Checker\Check_Result))
#1 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks.php(45): WordPress\Plugin_Check\Checker\Checks->run_check_with_result(Object(WordPress\Plugin_Check\Checker\Checks\I18n_Usage_Check), Object(WordPress\Plugin_Check\Checker\Check_Result))
#2 [internal function]: WordPress\Plugin_Check\Checker\Checks->WordPress\Plugin_Check\Checker\{closure}(Object(WordPress\Plugin_Check\Checker\Checks\I18n_Usage_Check), 'i18n_usage')
#3 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks.php(46): array_walk(Array, Object(Closure))
#4 /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Abstract_Check_Runner.php(278): WordPress\Plugin_Check\Checker\Checks->run_checks(Object(WordPress\Plugin_Check\Checker\Check_Context), Array)
#5 /var/www/html/wp-content/plugins/plugin-check/includes/CLI/Plugin_Check_Command.php(154): WordPress\Plugin_Check\Checker\Abstract_Check_Runner->run()
#6 [internal function]: WordPress\Plugin_Check\CLI\Plugin_Check_Command->check(Array, Array)
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#8 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func(Object(Closure), Array, Array)
#10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(431): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#11 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(454): WP_CLI\Runner->run_command(Array, Array)
#12 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1269): WP_CLI\Runner->run_command_and_exit()
#13 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#16 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('phar:///usr/loc...')
#17 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#18 {main}
 thrown in /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php on line 63
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

CLI Command: npm run wp-env run cli -- wp plugin check test-plugin-check-errors/test-plugin-check-errors.php

  • Plugin Checker Active — Checks working fine
  • Plugin Checker Deactivate — ‘check’ is not a registered subcommand of ‘plugin’.

We should register the CLI command only when the Plugin Checker plugin is activated; otherwise, it will display the error message.

@felixarntz

Thanks @mukeshpanchal27 for digging further.

We should register the CLI command only when the Plugin Checker plugin is activated; otherwise, it will display the error message.

That makes sense. I think we should check this in our cli.php file and throw an exception if the plugin is not active (CLI users should not require this file if the plugin is not active).

Another thing: You mention for PHP 5.6 the following:

Plugin Checker Active — ‘check’ is not a registered subcommand of ‘plugin’.

Any idea why that happens? It’s odd to me that the plugin command is not found even though the plugin is active. And that only happens on 5.6 but not 8.0? 🤔

@mukeshpanchal27



Copy link


Contributor


Author

Thanks @felixarntz for the feedback.

We should register the CLI command only when the Plugin Checker plugin is activated; otherwise, it will display the error message.

That makes sense. I think we should check this in our cli.php file and throw an exception if the plugin is not active (CLI users should not require this file if the plugin is not active).

I have open PR #236 that address this issue. Please take a look. Thanks!

Another thing: You mention for PHP 5.6 the following:

Plugin Checker Active — ‘check’ is not a registered subcommand of ‘plugin’.

Any idea why that happens? It’s odd to me that the plugin command is not found even though the plugin is active. And that only happens on 5.6 but not 8.0? 🤔

it seems that the issue is related to the way subcommands are registered and loaded in PHP 5.6. I have identified that when using npm run wp-env run cli command with the specific —require option to load the subcommand file explicitly, it works fine and runs the checks. This indicates that there might be an autoloading or registration issue in the PHP 5.6 environment.

In PHP 5.6, the autoloading might behave differently, and it might not load the subcommand file properly when using the WP_CLI::add_command() function. Therefore, manually requiring the subcommand file ensures that the necessary code is loaded, and the subcommand becomes available for use.

The correct command to run the checks in the PHP 5.6 environment, as per your findings, would be:

npm run wp-env run cli -- wp plugin check test-plugin-check-errors/test-plugin-check-errors.php --require=./wp-content/plugins/plugin-check/includes/CLI/Plugin_Check_Command.php

Please review the following and provide your feedback so that I can proceed with closing this issue. We have already opened follow-up issues and PRs. Thank you. cc. @joemcgill

Исправление плагинов

Данный раздел — алгоритм действий при любой поломке какого-либо плагина.

Чтобы понять, с каким плагином какой конфуз произошёл — вам нужно заглянуть в логи консоли сервера.
Для этого:

  1. 1.

    Заходим в встроенный редактор файлов и ищем последний log файл;

  2. 2.

    Открываем его, начинаем активные поиски проблемы;

  3. 3.

    Находим проблему и плагин, который нужно исправить.

Далее, переходим ко всем возможным вариантам решения.

Проверка актуальной версии плагина

Первое, на что стоит обратить внимание — версия плагина.
Существует команда, которой вы можете посмотреть список плагинов, установленных на свой сервер, и их версий.

plugins или o.plugins или oxide.plugins

На примере плагина RemoverTool с

umod.org

:

  1. 1.

    Проверим версию плагина, установленного на сервер:

    pluginsguideremove.png


    На сервер установлена версия «4.3.5».

  2. 2.

    Зайдём на

    umod.org

    и проверим актуальную (последнюю) версию:

    versionremoveplugin.png


    Актуальная версия — 4.3.17, что очень сильно отличается от установленной на сервер версии.

  3. 3.

    Скачиваем плагин с актуальной версией и устанавливаем на сервер. Скорее всего, установка актуальной версии исправит все ошибки.

В некоторых случаях, плагин может перестать работать из-за некорректного конфига (пропущена запятая, в параметре написана лишняя буква)

Для редактирования конфигов советуем пользоваться встроенным в панель управления редактором файлов, так как в нём присутствует подсветка кода и индикация ошибок.

На примере конфига плагина RemoverTool:

configplugincorr.png


Перед нами обыкновенный config-файл RemoverTool, но в нём есть одна ошибка, которую сложно заметить начинающему пользователю — после параметра «Use Friends: true» пропущена запятая.

errorplugremove.png


Об этом свидетельствует появившаяся в консоли ошибка.

Но, благодаря встроенному в панель управления редактору файлов, вы можете заметить ошибку ещё при редактировании файла.

umniyredaktor.png

Исправим конфиг (поставим запятую на место) и всё вновь заработает.

Собственноручный фикс плагина

Если конфиг файла в порядке, установлена актуальная версия, а ошибка всё равно есть — при наличии знаний в этой сфере вы можете сами попробовать исправить плагин (также если он не из панели плагинов).

Если плагин из панели «приватных плагинов», или у вас не хватает знаний в этой сфере, то вы не сможете собственноручно исправить данный плагин.

В данном случае попросите разработчика исправить нужный вам ресурс.

  1. 1.

    Переходим в раздел «плагины сервера», кликаем на нужный нам плагин;

  2. 2.

    Листаем страницу вниз, ищем кнопку «создать обсуждение;

  3. 3.

    Создаём обсуждение с указанной темой, типом и описанием проблемы;

  4. 4.

    Ждём ответ разработчика/фикс плагина.

    fixplsplugins.png

Themeisle content is free. When you purchase through referral links on our site, we earn a commission. Learn More

The huge variety of available plugins is a big part of what makes WordPress so great. But because there are so many plugins from third-party developers, you can occasionally run into compatibility issues. To find those issues, you’ll need to know how to perform a WordPress plugin check.

By choosing your plugins, themes, and other tools carefully, you can prevent most problems before they happen. What’s more, diagnosing and dealing with compatibility errors if they do occur isn’t difficult.

In this post, we’ll discuss what plugin compatibility means for your site. Then we’ll talk about how to handle errors as soon as you notice them, and how to carry out a WordPress plugin check to find incompatible plugin in the first place. Let’s jump right in!

Why plugin compatibility errors happen (and how they can affect your site)

There are many excellent plugins, and most WordPress users will install at least a few. In general, there’s no problem with doing this. However, once in a while you may encounter a plugin compatibility issue. In other words, you might install two plugins on your site and find out they don’t work well together.

There are a number of reasons this might happen. For instance:

  • Both plugins might be trying to change how the same feature works, but in different ways.
  • The plugins could have been developed with different versions of WordPress in mind.
  • One or both of the plugins may simply be poorly-designed or coded.

It’s worth noting that this issue isn’t exclusive to plugins – you can also see compatibility issues arise between a plugin and your active theme or your version of WordPress.

What does a compatibility error look like? This question can be difficult to answer, since the specific problem you’ll see will be based on the plugins involved. However, in general, these errors cause a specific feature on your site to function incorrectly or stop working.

This feature may be inherent to the plugin causing the problem. Alternately, it might belong to another plugin, theme, or WordPress itself. In rare cases, incompatible plugins can even break your site – so this is an issue to take seriously.

How to diagnose a potential plugin compatibility error

If you think you may have a plugin compatibility problem on your site, don’t panic. In most cases, it’s easy to diagnose and deal with these errors. You can simply perform a WordPress plugin check, to see whether one of your plugins is actually causing the issue you’re seeing.

The best way to do this is to disable your plugins, one at a time. We highly recommend doing this on a staging site for safety reasons. So you’ll want to start by creating a copy of your live site first (if you don’t already have one). Next, log in and navigate to the Plugins tab in your dashboard:

How to run a WordPress plugin check manually

Here, you’ll see a list of all the plugins installed on your site. Under each one, you’ll see an option labeled Deactivate. The following process will help you carry out a WordPress plugin check for compatibility errors:

  1. Deactivate one of your plugins – preferably the one you most recently installed or updated.
  2. Check out your site on the front end, test whatever feature wasn’t working, and see if it’s fixed.
  3. If the problem has gone away, you’ve found your culprit! If not, reactivate the plugin and deactivate the next one on the list.
  4. Repeat the previous steps until you find the plugin causing the issue, or until you’ve gone through every plugin on your site. If none of your plugins are to blame, you’re likely dealing with a different type of WordPress error.

Once you’ve figured out which plugin is giving you trouble, you have a few options. You can try uninstalling and reinstalling it, and see if that resolves the issue. If it doesn’t, you’ll either need to contact the developer for help fixing the error, or find a replacement plugin that does the same thing (more on this in the next section).

Finally, it is possible for a plugin compatibility error to prevent you from logging in to your site at all. In this scenario, you can still carry out a WordPress plugin check. You’ll just need to use File Transfer Protocol (FTP) to access your site’s files directly. You can find more details on how to do this in our article on the subject.

Automate your WordPress plugin check

While the manual process above is simple, it can still take some time to manually deactivate all of your plugins, especially if you’re using a lot of plugins. To automate the process, you can try the free Plugin Detective plugin:

This plugin, which won WordCamp Orange County’s 2018 Plugin-a-Palooza contest, basically does exactly what we described above…just automatically.

Once you install it, you can use the new Troubleshoot option on the WordPress toolbar.

How to prevent plugin compatibility errors in the first place

While it’s certainly possible to diagnose compatibility issues after-the-fact, it’s better to try and figure out if a plugin will break your site before you actually install it.

While you can never 100% guarantee this, there are ways to significantly decrease the chance of encountering any compatibility issues.

Before installing any new plugin, you’ll want to:

  • Make sure the plugin is compatible with your version of WordPress. This information is listed on each entry in the WordPress Plugin Directory, and on most other sites that sell plugins.
  • Check to see if the plugin has been updated recently. In general, avoid plugins that haven’t been updated within the past six months.
  • Take a look at the plugin’s user reviews and ratings. These will give you a general idea of its quality. Plus, people will often mention any compatibility issues they’ve encountered in their reviews.
  • Consider whether the plugin’s functionality overlaps with anything already installed on your site. Having two plugins that affect the same feature doesn’t guarantee there will be a problem, but it does increase the risk.

If you’ve gone through this list and the plugin you’re looking at satisfies each point, you’re probably safe installing it. Just to be certain, however, it’s still smart to activate it on a staging site first. That way, you can run a WordPress plugin check and catch any issues before you install the plugin on your live site.

Conclusion

By using plugins, you can modify WordPress to add just about any feature you want. While this is great news, it’s also important to be aware of the risks involved. The more plugins you install on your site, the more likely you are to run into a compatibility error at some point.

Fortunately, most compatibility problems are easy to deal with via a simple WordPress plugin check. You can diagnose them by systematically deactivating each plugin on your site until you find the one at fault. Of course, we all know that an ounce of prevention is worth a pound of cure. For this reason, you’ll also want to vet each new plugin carefully before adding it to your site.

Do you have any questions about how to diagnose or prevent plugin compatibility errors on your site? Let us help in the comments section below!

Free guide

4 Essential Steps to Speed Up
Your WordPress Website

Follow the simple steps in our 4-part mini series
and reduce your loading times by 50-80%. 🚀

Free Access

Понравилась статья? Поделить с друзьями:
  • Проверка письма на ошибки и знаки препинания
  • Проверка процессора на ошибки linux
  • Проверка письма на английском на ошибки
  • Проверка процессора интел на ошибки
  • Проверка пежо 405 на ошибки