To find out which plugins don’t have their required dependencies installed and activated, load the plugins page in the WordPress admin interface, and look for the plugin that has this message next to it (use ctrl–f):
This plugin is active but may not function correctly because required plugins are missing or inactive.
You can see which plugins it requires by looking at the field named “Requires:”, for example:
Requires: bbPress
More details
WordPress 6.5 introduced plugin dependencies. In the main PHP file of a plugin, you can now use the new header Requires Plugins
, like this:
/**
* Plugin Name: Express Payment Gateway Checkout for Shop
* Requires Plugins: shop, payment-gateway
*/
When WordPress loads the plugins admin page, it calls WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies()
, which displays the general error message if it finds that some required plugins are missing or inactive.
You can find out which ones using this code:
<?php
require_once "/var/www/ct/wp-includes/class-wp-plugin-dependencies.php";
class Foobar extends WP_Plugin_Dependencies {
public static function debug_plugins() {
self::initialize();
$filepaths = self::get_dependency_filepaths();
var_export($filepaths);
}
}
Foobar::debug_plugins();
Put that in a file named debug_plugins.php
, and then run it using the WP CLI like this:
$ wp eval-file debug_plugins.php
array (
'bbpress' => false,
)
It prints out a list of required plugins that are missing or inactive.