Cornerstone fatal error after update

Hi,

today after logging in to the admin I was asked to update my plugins (cornerstone and slider revolution). The X Theme has updated as well.
Right after the updates finished I was unable to open the webpage or the admin section and I was getting white page with some fatal error text. I tried to deactivating all the plugins and activating them one by one. Now they are working and the site loads but only the Cornerstone plugin cannot be activated and parts of my website dont load properly. The fatal error Im getting when trying to activate Cornerstone is following:
Parse error: syntax error, unexpected ‘[’ in /nfsmnt/hosting1_1/f/0/f044f693-8dea-4f0e-b753-0d26a1f9fed0/komunikujmespolu.sk/web/wp-content/plugins/cornerstone/includes/classes/admin/class-updates.php on line 222

thanks in advance
Boris

I’m getting the same response on my update.

I am getting the same error as well.

Hi, @komunikujme_spolu, @POMfest2016 and @saponari17,

It seems your sites are running PHP versions older than 5.6. Although we’re gonna adjust to make it as backward compatible as possible, we strongly advise you to upgrade your PHP server.

For further information (PHP supported versions/end of life), take a look at “Best Practices” section on the article https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62.

For a quick fix until the updated is launched, change /wp-content/plugins/cornerstone/includes/classes/admin/class-updates.php on line 222 from:

if ( in_array( $file, [$this->plugin_file], true ) ) {

to

if ( in_array( $file, array($this->plugin_file), true ) ) {

Thanks!

Hi Rafaelgou,

many thanks! Updated to 5.6, works like a charm.

Boris

I tried this only to get another, different error after completing it. The error reads

Parse error: syntax error, unexpected ‘[’ in /home/curtis20/public_html/wp-content/plugins/cornerstone/includes/classes/admin/class-updates.php on line 233

Site is still down. In fact, I can’t even log into WordPress at all without getting this error.

Actually, I just corrected line 233 in similar fashion and the site is back up and running. Seems like “array” was left out and “[ ]” instead of “( )” were used in the upgrade. I’m no coder, but tried to translate it on my own as best as I could and it worked.

THANK YOU! Totally fixed my site as well. Maybe you ARE a coder :wink:

1 Like

Works well, thanks for the fixes!

Hi, there,

@ConjuringMind, your fix is correct - same situation.

This will be addressed in the next update (real soon).

Very important to reinforce: this error is related to a feature not available on PHP 5.4, which end of life was 2 years ago and has no security fixes for more than a year (see http://php.net/eol.php and http://php.net/supported-versions.php).

It’s strongly recommended to upgrade to PHP 5.6 or 7.1. PHP 5.6 is the minimum requirement pointed by Wordpress (see https://wordpress.org/about/requirements/).

Thanks!

1 Like

THANK YOU!!! I just did as you indicated and the problem is fixed. Now to kick my host to the curb and find better hosting that keeps up with the times.

1 Like

Glad to hear that worked for you!

Thanks. Sorry but just saw this reply and updated PHP to 7.1

I´m trying to activate Cornerstone plugin after upgrade to Version 2.1.3, but get this error:

Fatal error: Cannot declare class Cornerstone_Plugin_Base, because the name is already in use in /var/www/virtual/website/htdocs/wp-content/plugins/cornerstone/includes/utility/plugin-base.php on line 6

It can be activated if theme “X” is used but not “Pro”

Hi There @thors

You don’t need Cornerstone plugin when you’re using Pro, because Pro comes with Cornerstone functionality integrated into the theme.

Hope that’s clear.

Hi,

Ok, because it did come with it in X theme, and then I have upgrade to Pro, so I´m okey to delete the plugin,

Regards
Thor

Hi Thor,

Yes, you can safely delete the Cornerstone plugin when you’re using Pro.

Cheers!

Thanks for the info :slight_smile:

@thors … You’re welcome :slight_smile: