PHP Fatal error: Uncaught Error: Class “DynamicHeartbeat\WP_CLI” not found
-
I did the following command:
user@server:/path/to/site# /usr/local/bin/wp --allow-root post list --post_type=post --format=count
This was the result:PHP Fatal error: Uncaught Error: Class "DynamicHeartbeat\WP_CLI" not found in /path/to/plugins/dynamic-front-end-heartbeat-control/defibrillator/cli-helper.php:118
Stack trace:0 /path/to/plugins/dynamic-front-end-heartbeat-control/defibrillator/unclogger.php(30): require_once()1 /path/to/plugins/dynamic-front-end-heartbeat-control/defibrillator/unclogger.php(203): DynamicHeartbeat\DfehcUnclogger->__construct()2 /path/to/plugins/dynamic-front-end-heartbeat-control/heartbeat-controller.php(24): require_once('…')3 /path/to/site/wp-settings.php(545): include_once('…')4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1363): require('…')5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1282): WP_CLI\Runner->load_wordpress()6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()9 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('…')10 /usr/local/bin/wp(4): include('…')11 {main}thrown in /path/to/plugins/dynamic-front-end-heartbeat-control/defibrillator/cli-helper.php on line 118
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
I tried uninstalling and reinstalling the plugin, same result.
To see if there might be a quick fix on my end, I ran the whole situation through Claude, including giving it the cli-helper.php file, and it said:
“The issue is that you’re in theDynamicHeartbeatnamespace, butWP_CLIis a global class. When PHP tries to findWP_CLIwithin theDynamicHeartbeatnamespace, it’s actually looking forDynamicHeartbeat\WP_CLI, which doesn’t exist. Contact the plugin author with the specific fix. Tell them they need to adduse WP_CLI;after their namespace declaration, or reference\WP_CLI(with leading backslash) instead ofWP_CLIin their code.”
I don’t know if that’s accurate or not, but maybe that helps.
For now I’ve had to uninstall the plugin to run the CLI command, I couldn’t find any other workaround.
The topic ‘PHP Fatal error: Uncaught Error: Class “DynamicHeartbeat\WP_CLI” not found’ is closed to new replies.