Title: PHP 8.0 Compat
Last modified: January 11, 2021

---

# PHP 8.0 Compat

 *  Resolved [Will Stocks](https://wordpress.org/support/users/willstockstech/)
 * (@willstockstech)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/)
 * 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](https://wordpress.org/support/users/willstockstech/)
 * (@willstockstech)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13903318)
 * Just FYI – enabling PHP 8.0 results in full site breakage, not just specific 
   areas/posts.
 *  Plugin Contributor [Alexis Pandaan](https://wordpress.org/support/users/alexius08/)
 * (@alexius08)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13905464)
 * Hi [@willstockstech](https://wordpress.org/support/users/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](https://raw.githubusercontent.com/Ultimate-Blocks/Ultimate-Blocks/PHP8-compat/src/init.php).
       Also, [download this file and save it under the filename of class-fs-admin-notice-manager.php](https://raw.githubusercontent.com/Ultimate-Blocks/Ultimate-Blocks/PHP8-compat/includes/freemius/includes/managers/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.
    -  This reply was modified 5 years, 4 months ago by [Alexis Pandaan](https://wordpress.org/support/users/alexius08/).
 *  [kortell](https://wordpress.org/support/users/kortell/)
 * (@kortell)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13911263)
 * 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](https://wordpress.org/support/users/willstockstech/)
 * (@willstockstech)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13938817)
 * Hi [@alexius08](https://wordpress.org/support/users/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.
 * Thanks,
 * Will
 *  Plugin Contributor [Alexis Pandaan](https://wordpress.org/support/users/alexius08/)
 * (@alexius08)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13940876)
 * Hi [@willstockstech](https://wordpress.org/support/users/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.
 *  [Zap Zockt](https://wordpress.org/support/users/zapzockt/)
 * (@zapzockt)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13943885)
 * 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.

 * ![](https://ps.w.org/ultimate-blocks/assets/icon-256x256.png?rev=2966061)
 * [Ultimate Blocks – 25+ Gutenberg Blocks for Block Editor](https://wordpress.org/plugins/ultimate-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-blocks/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [PHP 8.0](https://wordpress.org/support/topic-tag/php-8-0/)
 * [PHP compatibility](https://wordpress.org/support/topic-tag/php-compatibility/)

 * 6 replies
 * 4 participants
 * Last reply from: [Zap Zockt](https://wordpress.org/support/users/zapzockt/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/php-8-0-compat/#post-13943885)
 * Status: resolved