• Resolved jcurtis-lbc

    (@jcurtis-lbc)


    Do you have any idea why this plugin is breaking wp-cli on all of the websites I have it installed on?

    Here is the error I am getting whenever I enter any wp-cli command on the command line:

    Fatal error: Uncaught Error: Call to a member function check_permission() on null in /public_html/[domain.com]/wp-content/plugins/business-profile/includes/class-settings.php:538

    I am running:
    PHP version: 7.2.27
    WP-CLI version: 2.4.0

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi jcurtis,

    Unfortunately, we don’t have experience with wp-cli. That is not an error that we are getting or can recreate otherwise. That being said, after doing some digging, I think it might help if you change line 60 of that file (class-settings.php) to

    add_action( 'init', array( $this, 'load_settings_panel' ), 99 );
    

    Is there a particular operation that you’re doing where that error comes up?

    Thread Starter jcurtis-lbc

    (@jcurtis-lbc)

    Changing that line did not fix it. I am surprised that as WordPress plugin developers you have *no* experience with wp-cli?: https://wp-cli.org/

    Do you use some other comparable command line tool?

    Anyway, it doesn’t matter what command/operation I try, the same error output gets generated. Here is an example with the complete stack trace:

    $ wp option get home
    Fatal error: Uncaught Error: Call to a member function check_permission() on null in /home/cpaneluser/public_html/[domain.com]/wp-content/plugins/business-profile/includes/class-settings.php:538
    Stack trace:
    #0 /home/cpaneluser/public_html/[domain.com]/wp-includes/class-wp-hook.php(288): bpfwpSettings->load_settings_panel(”)
    #1 /home/cpaneluser/public_html/[domain.com]/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)
    #2 /home/cpaneluser/public_html/[domain.com]/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/cpaneluser/public_html/[domain.com]/wp-settings.php(523): do_action(‘init’)
    #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1237): require(‘/home/cpaneluser…’)
    #5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1158): WP_CLI\Runner->load_wordpress()
    #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
    #7 phar:///usr/local/bin/wp/v in /home/cpaneluser/public_html/[domain.com]/wp-content/plugins/business-profile/includes/class-settings.php on line 538
    Error: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website.

    Thread Starter jcurtis-lbc

    (@jcurtis-lbc)

    WP-CLI is breaking on my local machine (running VVV) as well. I get the same error output in addition to this:

    PHP Notice: Trying to get property ‘cpts’ of non-object in /srv/www/website/public_html/wp-content/plugins/business-profile/includes/class-schemas-manager.php on line 58
    Notice: Trying to get property ‘cpts’ of non-object in /srv/www/website/public_html/wp-content/plugins/business-profile/includes/class-schemas-manager.php on line 58
    PHP Notice: Trying to get property ‘schema_cpt_slug’ of non-object in /srv/www/website/public_html/wp-content/plugins/business-profile/includes/class-schemas-manager.php on line 58
    Notice: Trying to get property ‘schema_cpt_slug’ of non-object in /srv/www/website/public_html/wp-content/plugins/business-profile/includes/class-schemas-manager.php on line 58
    PHP Notice: Trying to get property ‘permissions’ of non-object in /srv/www/website/public_html/wp-content/plugins/business-profile/includes/class-settings.php on line 538
    Notice: Trying to get property ‘permissions’ of non-object in /srv/www/website/public_html/wp-content/plugins/business-profile/includes/class-settings.php on line 538

    Maybe that helps?

    Plugin Support jaysupport

    (@jaysupport)

    It looks like, for some reason, in your case, the function that loads the settings panel was being called before the plugin finished it’s normal setup, which means the object that pointed to that didn’t exist. Very strange. Anyway, we added in a check/condition to see if that object exists first. We just released the update. Please install it and check.

    Thread Starter jcurtis-lbc

    (@jcurtis-lbc)

    That fixed it! Thanks for your prompt attention to this. It is greatly appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Latest version 2.0.1 breaks wp-cli’ is closed to new replies.