Fatal error due to Cornerstone, also child theme question

Hello support team,

I’ve received this notable wordpress message:

"Howdy!

Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, Cornerstone." with the following errors attached:

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.0.2
Active theme: X – Child Theme (version 1.0.0)
Current plugin: Cornerstone (version 6.1.4)
PHP version 8.1.11

Error Details
=============
An error of type E_ERROR was caused in line 522 of the file /home/vitalyte/public_html/wp-content/plugins/cornerstone/includes/tco.php. Error message: Uncaught Error: tco_common called before after_setup_theme in /home/vitalyte/public_html/wp-content/plugins/cornerstone/includes/tco.php:522
Stack trace:
#0 /home/vitalyte/public_html/wp-content/plugins/cornerstone/includes/classes/admin/class-updates.php(63): tco_common()
#1 /home/vitalyte/public_html/wp-content/plugins/cornerstone/includes/classes/admin/class-updates.php(94): Cornerstone_Updates->get_plugin_data()
#2 /home/vitalyte/public_html/wp-includes/class-wp-hook.php(307): Cornerstone_Updates->plugins_api()
#3 /home/vitalyte/public_html/wp-includes/plugin.php(191): WP_Hook->apply_filters()
#4 /home/vitalyte/public_html/wp-admin/includes/plugin-install.php(150): apply_filters()
#5 /home/vitalyte/public_html/wp-content/plugins/security-malware-firewall/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php(483): plugins_api()
#6 /home/vitalyte/public_html/wp-content/plugins/security-malware-firewall/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php(162): CleantalkSP\SpbctWP\Scanner\ScannerQueue->get_modules_hashes()
#7 /home/vitalyte/public_html/wp-content/plugins/security-malware-firewall/inc/spbc-scanner.php(45): CleantalkSP\SpbctWP\Scanner\ScannerQueue::controllerBackground()
#8 [internal function]: spbc_scanner__controller()
#9 /home/vitalyte/public_html/wp-content/plugins/security-malware-firewall/lib/CleantalkSP/Common/Cron.php(121): call_user_func_array()
#10 /home/vitalyte/public_html/wp-content/plugins/security-malware-firewall/lib/CleantalkSP/Common/Cron.php(54): CleantalkSP\Common\Cron->runTasks()
#11 /home/vitalyte/public_html/wp-content/plugins/security-malware-firewall/security-malware-firewall.php(292): CleantalkSP\Common\Cron->execute()
#12 /home/vitalyte/public_html/wp-settings.php(428): include_once('/home/vitalyte/...')
#13 /home/vitalyte/public_html/wp-config.php(84): require_once('/home/vitalyte/...')
#14 /home/vitalyte/public_html/wp-load.php(50): require_once('/home/vitalyte/...')
#15 /home/vitalyte/public_html/wp-admin/admin-ajax.php(22): require_once('/home/vitalyte/...')
#16 {main}
  thrown

I’m also contacting Cleantalk, which may or may not have an impact on this error.

That mentioned, I have a childtheme added, simple code which allows buddypress menu to look sorted. Side question: I have been reluctant to upgrade to pro, because I’m not sure whether that would alter the code added in the childtheme:

if ( ! function_exists( 'x_buddypress_navbar_menu' ) ) :
  function x_buddypress_navbar_menu( $items, $args ) {

    if ( X_BUDDYPRESS_IS_ACTIVE && x_get_option( 'x_buddypress_header_menu_enable' ) == '1' && did_action( 'x_classic_headers' ) ) {

      if ( bp_is_active( 'activity' ) ) {
        $logged_out_link = bp_get_activity_directory_permalink();
      } else if ( bp_is_active( 'groups' ) ) {
        $logged_out_link = bp_get_groups_directory_permalink();
      } else {
        $logged_out_link = bp_get_members_directory_permalink();
      }

      //$top_level_link = ( is_user_logged_in() ) ? bp_loggedin_user_domain() : $logged_out_link;
      $top_level_link = ( is_user_logged_in() ) ? bp_loggedin_user_domain() : bp_get_signup_page();   
      $submenu_items  = '';

      if ( bp_is_active( 'activity' ) ) {
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_activity_directory_permalink() . '" class="cf"><i class="x-icon-thumbs-up" data-x-icon-s="&#xf164;" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_activity_title' ) . '</span></a></li>';
      }

      if ( bp_is_active( 'groups' ) ) {
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_groups_directory_permalink() . '" class="cf"><i class="x-icon-sitemap" data-x-icon-s="&#xf0e8;" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_groups_title' ) . '</span></a></li>';
      }

      if ( is_multisite() && bp_is_active( 'blogs' ) ) {
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_blogs_directory_permalink() . '" class="cf"><i class="x-icon-file" data-x-icon-s="&#xf15b;" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_blogs_title' ) . '</span></a></li>';
      }

      //$submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_members_directory_permalink() . '" class="cf"><i class="x-icon-male" data-x-icon-s="&#xf183;" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_members_title' ) . '</span></a></li>';

      if ( ! is_user_logged_in() ) {
        if ( bp_get_signup_allowed() ) {
          $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_signup_page() . '" class="cf"><i class="x-icon-pencil" data-x-icon-s="&#xf303;" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_register_title' ) . '</span></a></li>';
          //$submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_activation_page() . '" class="cf"><i class="x-icon-key" data-x-icon-s="&#xf084;" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_activate_title' ) . '</span></a></li>';
        }
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . wp_login_url() . '" class="cf"><i class="x-icon-sign-in" data-x-icon-s="&#xf2f6;" aria-hidden="true"></i> <span>' . __( 'Log in', '__x__' ) . '</span></a></li>';
      } else {
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_loggedin_user_domain() . '" class="cf"><i class="x-icon-cog" data-x-icon-s="&#xf013;" aria-hidden="true"></i> <span>' . __( 'Profile', '__x__' ) . '</span></a></li>';
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . esc_url( home_url( '/store/' ) ) . '" class="cf"><i class="x-icon-download" data-x-icon-s="&#xf019;" aria-hidden="true"></i> <span>' . __( 'Shop', '__x__' ) . '</span></a></li>';
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_loggedin_user_domain() . 'settings/" class="cf"><i class="x-icon-cogs" data-x-icon-s="&#xf085;" aria-hidden="true"></i> <span>' . __( 'Settings', '__x__' ) . '</span></a></li>';
        $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . wp_logout_url( get_permalink() ) . '" class="cf"><i class="x-icon-sign-out-alt" data-x-icon-s="&#xf2f5;" aria-hidden="true"></i> <span>' . __( 'Log out', '__x__' ) . '</span></a></li>';
      }

      if ( $args->theme_location == 'primary' ) {
        $items .= '<li class="menu-item current-menu-parent menu-item-has-children x-menu-item x-menu-item-buddypress">'
                  . '<a href="' . $top_level_link . '" class="x-btn-navbar-buddypress">'
                    . '<span><i class="x-icon-user" data-x-icon-s="&#xf007;" aria-hidden="true"></i><span class="x-hidden-desktop"> ' . __( 'Social', '__x__' ) . '</span></span>'
                  . '</a>'
                  . '<ul class="sub-menu">'
                    . $submenu_items
                  . '</ul>'
                . '</li>';
      }
    }

    return $items;

  }
  add_filter( 'wp_nav_menu_items', 'x_buddypress_navbar_menu', 9997, 2 );
endif;

First, I want to apologize for copy and pasting the code in, because it has been a while, and I really don’t want to edit much more. Nor can I remember what, and how.

website: https://vitalytennant.com

Circling back to questions:

  • What is causing this fatal error prompt from wordpress?

  • With an upgrade to pro, will I have to remove / edit childtheme?

Thank you in advance, and I look forward to it.

Hello Vitaly,

Thanks for writing in!

1.) This is because of your PHP 8.1 version. Please downgrade your PHP to at least PHP 7.4 and test the site again.

2.) When you upgrade to Pro theme or even with the latest X theme, you will have to ensure that any of the features or modifications you have added in the child theme will still work. If all of it works with the X theme, it should work with the Pro theme as well.

Best Regards.

Hi @ruenel,

Thank you for your timely response.

  1. That’s a big downgrade. Is it correct to assume that Cornerstone does not work with the latest PHP 8.1 version? By downgrading, I am hurting my entire site, including additional plugins. How can this be remedied?

  2. Great. Thank you for your information.

Looking forward to having this error situated, since I just received it again. It literally began to happen within the last 5 days, and Wordpress sends out these emails (mentioned earlier) every 24 hours.

Hello Vitaly,

Regretfully the latest version of the X theme, Pro theme and Cornerstone plugin is not yet compatible with PHP 8.1. We do have an upcoming update though which is already in beta stage. Please watch for it as it will be available anytime soon.

Please bear with us.

Hi Rue,

Thank you for the information, I will try the 8.0 version, and then 7.4, although this impacts my current plugins. Anything I say at this point, you already know, although I’d like to somehow gauge the timeframes of the releases, because PHP 8.1 was released in Nov. 2021, and PHP 8.2 is coming up 11/24/22. I’m just trying to make the website fluid, without switching back and forth often, for many reasons. If I can suggest, or recommend a versatile update of some sort, of compatibility with X, Pro, and Cornerstone, that would be awesome with each PHP update.

Thank you once more.

Successfully.

You are most welcome, Vitaly.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.