• Resolved Michael Kupietz

    (@mkupietz)


    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 the DynamicHeartbeat namespace, but WP_CLI is a global class. When PHP tries to find WP_CLI within the DynamicHeartbeat namespace, it’s actually looking for DynamicHeartbeat\WP_CLI, which doesn’t exist. Contact the plugin author with the specific fix. Tell them they need to add use WP_CLI; after their namespace declaration, or reference \WP_CLI (with leading backslash) instead of WP_CLI in 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.

Viewing 1 replies (of 1 total)
  • Plugin Support codeloghin

    (@codeloghin)

    Hello,

    Thank you for reaching out. A new version of the plugin will be released at the beginning of next week, featuring improved compatibility across various hosting environments along with enhancements for multisite support. This update should address the CLI issues you’re currently experiencing. If not, I’ll be happy to troubleshoot further and ensure everything gets resolved.

    Please don’t hesitate to reach out if you have any other questions in the meantime.

    Kind regards,

Viewing 1 replies (of 1 total)

The topic ‘PHP Fatal error: Uncaught Error: Class “DynamicHeartbeat\WP_CLI” not found’ is closed to new replies.