HELP! Website down, can't access wp-admin, after update

For some reason my X theme is not automatically updating but anyway, I just updated from v7.x to the latest version, and now my website is throwing up errors and the front-end says ‘There has been a critical error on this website.’ (See https://followtheboat.com/). I’ve had to put a maintenance page up.

WordPress version 5.6.1 Current theme: X – Child Theme (version 1.0.0) Current plugin: Cornerstone (version 5.1.5) PHP version 7.3.24 Error Details ============= 
An error of type E_ERROR was caused in line 62 of the file /home/followth/public_html/wp-content/plugins/cornerstone/includes/extend/portfolio.php. 
Error message: Uncaught Error: Call to undefined function x_get_option() in /home/followth/public_html/wp-content/plugins/cornerstone/includes/extend/portfolio.php:62 
Stack trace: #0 /home/followth/public_html/wp-includes/class-wp-hook.php(287): cs_portfolio_init('') 
#1 /home/followth/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)              
#2 /home/followth/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) 
#3 /home/followth/public_html/wp-settings.php(557): do_action('init') 
#4 */home/followth/public_html/wp-config.php(126): require_once('/home/followth/* ...') 
#5 */home/followth/public_html/wp-load.php(37): require_once('/home/followth/* ...') 
#6 */home/followth/public_html/wp-admin/admin-ajax.php(22): require_once('/home/followth/* ...') 
#7 {main} thrown

Any assistance appreciated, thanks. I have left a secure note attached to this post, login at https://followtheboat.com/ftbmates

Hey There,

We will need FTP credentials in order to help you with this. Please add them to your secure note. Thanks!

Hi Rubin,
I have added my FTP details, thank you.

Hey There,

I’ve resolved the issue by commenting out following lines in your x-child theme’s function.php file:

//add_filter( 'wp_nav_menu_args', 'custom_blog_menu' );//

//function custom_blog_menu( $args ) {
//  if ( x_is_product() || x_is_product_index() || is_checkout() || is_cart() || is_account_page()) {
//    $args['theme_location'] = 'primary';
//    $args['menu'] = 'shop';
//  }
//  return $args;
//}

The reason for the error is that the function “x_is_product_index” is now defined causing the fatal error. Hope that helps!

Hi Rubin,

It helps, thanks, but there is still an issue with the homepage, which is rendering completely incorrectly. There is no content and the menu is contained within a box.

Hey There,

In your functions.php file on line 338 there is a undefined variable called “cs_get_raw_excerpt()”. If you remove it everything loads fine.

$excerpt = ( $show_excerpt ) ? '<div class="x-recent-posts-excerpt"><p>' . preg_replace('/<a.*?more-link.*?<\/a>/', '', cs_get_raw_excerpt() ) . '</p></div>' : '';

Hope that helps!

Hi Rubin,

I think you have commented out the offending line but now there are warnings appearing. In the header it says:

**Deprecated** : load_plugin_textdomain was called with an argument that is **deprecated** since version 2.7.0 with no alternative available. in **/home/followth/public_html/wp-includes/functions.php** on line **5153**

**Deprecated** : Function create_function() is deprecated in **/home/followth/public_html/wp-content/plugins/php-code-widget/execphp.php** on line **62**

And in the body it says:

**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**

**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**

**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**

**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**

I just tried to purge the page cache and now I am getting this error:

**Deprecated** : load_plugin_textdomain was called with an argument that is **deprecated** since version 2.7.0 with no alternative available. in **/home/followth/public_html/wp-includes/functions.php** on line **5153**

**Deprecated** : Function create_function() is deprecated in **/home/followth/public_html/wp-content/plugins/php-code-widget/execphp.php** on line **62**

**Deprecated** : has_cap was called with an argument that is **deprecated** since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead. in **/home/followth/public_html/wp-includes/functions.php** on line **5143**

By commenting out that line we have introduced an undeclared variable. This isn’t the solution as this was working before the update.

Please assist as my whole website looks a mess, thanks.

Can anyone in support help me out, please?

Hello @demonboy,

You are seeing the PHP Notices. This does not affect any functionality and feature of your site.

**Deprecated** : load_plugin_textdomain was called with an argument that is **deprecated** since version 2.7.0 with no alternative available. in **/home/followth/public_html/wp-includes/functions.php** on line **5153**
**Deprecated** : Function create_function() is deprecated in **/home/followth/public_html/wp-content/plugins/php-code-widget/execphp.php** on line **62**

PHP Notice 1 is because of the PHP Code Widget plugin.

**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**
**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**
**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**
**Notice** : Undefined variable: excerpt in **/home/followth/public_html/wp-content/themes/x-child/functions.php** on line **347**

PHP Notice 2 displays because since we have remove $excerpt = ( $show_excerpt ) ? '<div class="x-recent-posts-excerpt"><p>' . preg_replace('/<a.*?more-link.*?<\/a>/', '', cs_get_raw_excerpt() ) . '</p></div>' : '';, then the $excerpt variable in the code is null or unset.


**Deprecated** : load_plugin_textdomain was called with an argument that is **deprecated** since version 2.7.0 with no alternative available. in **/home/followth/public_html/wp-includes/functions.php** on line **5153**
**Deprecated** : Function create_function() is deprecated in **/home/followth/public_html/wp-content/plugins/php-code-widget/execphp.php** on line **62**
**Deprecated** : has_cap was called with an argument that is **deprecated** since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead. in **/home/followth/public_html/wp-includes/functions.php** on line **5143**

PHP Notice 3 is still coming from the PHP Code Widget plugin.

Hope this helps.

Hi Rubin,

I understand what they are but these are displaying to the public. On the homepage at https://followtheboat.com/ the visitor sees:

On https://followtheboat.com/ftbmates the visitor sees:

Why have they started appearing since the update and how do we remove them? I don’t want to comment out the excerpt function because it is part of the display of my website.

Hi @demonboy,

The reason why you are seeing the deprecated PHP code because the WP_DEBUG is set to true in your wp-config.php files.

image

I went ahead it change it to:

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

image

The deprecated errors are now gone.

On the other hand, the notices are still there on the homepage because on your child theme functions.php line 347 they still calling the excerpt variable that was commented by my colleague here:

To fix the issue, we need to uncomment the code that was commented on by my colleague then update the cs_get_raw_excerpt() to cs_get_excerpt_for_social() since it was updated and rename the function to helped our developers clarify our intentions. You can check it here for more information from our director of development.

All errors on your website are now gone.

Hope that helps.

Thank you.

1 Like

Hi Marc,

It certainly does help! Thanks so much for the detailed explanation, I appreciate it.

Hi @demonboy,

You’re welcome and it’s our pleasure to help you. If you have any other concerns regarding our theme features, feel free to reach us.

Thank you.

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