• Resolved Will Stocks


    Hi guys,
    It looks like UB is throwing an error when enabling PHP8.0:

    Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in /wp-content/plugins/ultimate-blocks/src/init.php:33 
    Stack trace: 
    #0 /wp-content/plugins/ultimate-blocks/src/init.php(33): method_exists() 
    #1 /wp-content/plugins/ultimate-blocks/src/init.php(125): ub_check_is_gutenberg_page() 
    #2 /wp-includes/class-wp-hook.php(287): ultimate_blocks_cgb_block_assets() 
    #3 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters() 
    #4 /wp-includes/plugin.php(484): WP_Hook->do_action() 
    #5 /wp-includes/script-loader.php(2188): do_action() 
    #6 /wp-includes/class-wp-hook.php(287): wp_common_block_scripts_and_styles() 
    #7 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters() 
    #8 /wp-includes/plugin.php(484): WP_Hook->do_action() 
    #9 /wp-includes/script-loader.php(2004): do_action() 
    #10 /wp-includes/class-wp-hook.php(287): wp_enqueue_scripts() 
    #11 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters() 
    #12 /wp-includes/plugin.php(484): WP_Hook->do_action() 
    #13 /wp-includes/general-template.php(3005): do_action() 
    #14 /wp-content/themes/linx-child/header.php(7): wp_head() 
    #15 /wp-includes/template.php(730): require_once('...') 
    #16 /wp-includes/template.php(676): load_template() 
    #17 /wp-includes/general-template.php(48): locate_template() 
    #18 /wp-content/themes/linx/index.php(6): get_header() 
    #19 /wp-includes/template-loader.php(106): include('...') 
    #20 /wp-blog-header.php(19): require_once('...') 
    #21 /index.php(17): require('...') 
    #22 {main} thrown in /wp-content/plugins/ultimate-blocks/src/init.php on line 33
    There has been a critical error on this website.

    Rolling back to PHP 7.4 is the only viable solution

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Will Stocks


    Just FYI – enabling PHP 8.0 results in full site breakage, not just specific areas/posts.

    Plugin Contributor Alexis Pandaan


    Hi @willstockstech! Thanks for letting us know. We’re currently trying to recreate the error message you got. However, we’ve made a fix for it. As soon as we could confirm that the fix indeed works, we’ll include it in the next version of the plugin.

    If you’d like to test the fix for us, here’s what you have to do:

    1. Download this file and save it under the filename of init.php. Also, download this file and save it under the filename of class-fs-admin-notice-manager.php.
    2. Navigate to your WordPress plugins folder and get to the folder for Ultimate Blocks.
    3. Go to the src folder.
    4. Inside the folder, look for a file named init.php, and rename it into something else (just to make sure you still have the old file when the new one doesn’t work).
    5. Paste the init.php file you downloaded into the folder.
    6. Repeat steps 3-5, this time going to includes/freemius/includes/managers/ and replacing the existing class-fs-admin-notice-manager.php with the one you just downloaded.

    Please let us know how it goes.



    Same issue for me. Site totally down when upgrading to PHP 8.0.1. Hope for a fix very soon. Keep up the good work! šŸ™‚

    Thread Starter Will Stocks


    Hi @alexius08

    I have applied those file changes and it appears to work perfectly for me now.

    Site is fully operational and I’m running PHP8.0.1 happily.



    Plugin Contributor Alexis Pandaan


    Hi @willstockstech! We’re glad to see that the fix worked for you. We’ll be including it in the next version of the plugin for those who would encounter the same issue with PHP8.

    I came here for the same reason, and the suggested solution above (replace the 2 files) worked fine for me. Page is now running with php8 without problems.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP 8.0 Compat’ is closed to new replies.