• Resolved jakeparis

    (@jakeparis)


    Upon attempting to activate the plugin on my site, I get the following error:

    Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, array given in /usr/local/htdocs/<mysite.com>/wp-content/plugins/broken-link-checker/app/admin-pages/local-submenu/class-controller.php:71

    I am operating WordPress in multisite mode, and have had BLC running successfully on other sites in the network for quite some time now. But when I try to enable the plugin on any site now, I get this message.

    I am running BLC version 2.2.2.

    Here’s the full error stack:

    Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, array given in /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/app/admin-pages/local-submenu/class-controller.php:71 Stack trace:
    
    #0 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/app/admin-pages/local-submenu/class-controller.php(71): json_decode()
    
    #1 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/controllers/class-admin-page.php(146): WPMUDEV_BLC\App\Admin_Pages\Local_Submenu\Controller->prepare_props()
    
    #2 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/class-loader.php(335): WPMUDEV_BLC\Core\Controllers\Admin_Page->init()
    
    #3 [internal function]: WPMUDEV_BLC\Core\Loader->load_component()
    
    #4 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/class-loader.php(212): array_map()
    
    #5 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/class-loader.php(185): WPMUDEV_BLC\Core\Loader->load_components()
    
    #6 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/class-loader.php(147): WPMUDEV_BLC\Core\Loader->init_app()
    
    #7 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/class-loader.php(113): WPMUDEV_BLC\Core\Loader->init()
    
    #8 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/utils/abstracts/class-singleton.php(52): WPMUDEV_BLC\Core\Loader->__construct()
    
    #9 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/broken-link-checker.php(121): WPMUDEV_BLC\Core\Utils\Abstracts\Singleton::instance()
    
    #10 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/class-activation.php(34): WPMUDEV_BLC\wpmudev_blc_instance()
    
    #11 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/core/utils/abstracts/class-singleton.php(52): WPMUDEV_BLC\Core\Activation->__construct()
    
    #12 /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/broken-link-checker.php(135): WPMUDEV_BLC\Core\Utils\Abstracts\Singleton::instance()
    
    #13 /usr/local/htdocs/mysite.com/wp-includes/class-wp-hook.php(310): WPMUDEV_BLC\{closure}()
    
    #14 /usr/local/htdocs/mysite.com/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    
    #15 /usr/local/htdocs/mysite.com/wp-includes/plugin.php(517): WP_Hook->do_action()
    
    #16 /usr/local/htdocs/mysite.com/wp-admin/plugins.php(194): do_action() #17 {main} thrown in /usr/local/htdocs/mysite.com/wp-content/plugins/broken-link-checker/app/admin-pages/local-submenu/class-controller.php on line 71
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @jakeparis

    Sorry to hear you are having this issue.

    I checked the reported line and it is getting the data from the database:

    $local_settings = json_decode( get_option( 'wsblc_options' ) );

    In this case the data is returning an array but should return the serialized data https://monosnap.com/file/3s5miZ1qr2eEkVApbaVoEkSiMaZUtz

    Can you please access your database, find the _options > wsblc_options similar to my screenshot, copy the data, save it in a txt file and send it to:

    [email protected]

    With this subject:

    ATTN: WPMU DEV support - wp.org

    Attach the txt file and in the email body add the ticket URL as well.

    A faster solution is to delete the wsblc_options row, flush any object caching and then reinstall the plugin, it will force the option creation.

    But before that, please send the email so we can verify why that option got corrupted.

    Best Regards
    Patrick Freitas

    Thread Starter jakeparis

    (@jakeparis)

    Thank you. You are correct that the wsblc_options row in the database was causing the problem. Simply deleting that row so the plugin could re-create its options solved the issue.

    The data was stored in an incorrect format which was probably caused from the plugin being activated a long time ago and then turned off for many years.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal Error on plugin activation’ is closed to new replies.