One of the check types included in wp doctor
is Plugin_Status
, or the ability to assert that a given pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party should be active, installed, or uninstalled. Although the check type isn’t use by any of the default diagnostic checks, you can use the Plugin_Status
check type in your custom doctor.yml
configuration file.
As an example, here are two checks using Plugin_Status
, one which ensures Akismet is active on the system and other which ensures Hello Dolly is uninstalled:
plugin-akismet-active:
check: Plugin_Status
options:
name: akismet
status: active
plugin-hello-uninstalled:
check: Plugin_Status
options:
name: hello
status: uninstalled
Run together, you might see:
$ wp doctor check --config=plugin-status.yml --all
+--------------------------+---------+----------------------------------------------------------------+
| name | status | message |
+--------------------------+---------+----------------------------------------------------------------+
| plugin-akismet-active | success | Plugin 'akismet' is 'active' as expected. |
| plugin-hello-uninstalled | error | Plugin 'hello' is 'inactive' but expected to be 'uninstalled'. |
+--------------------------+---------+----------------------------------------------------------------+
The Plugin_Status
check type accepts the following options:
- ‘name’: Name of the plugin as it appears in
wp plugin list
. - ‘status’: Expected plugin status as one of ‘active’, ‘installed’, or ‘uninstalled’.