Fatal error after updating Pro

Hello,

I have updated a website and I am receiving the following fatal error:

Fatal error: Cannot declare class Cornerstone_Shortcode_Preserver, because the name is already in use in /home/domain/public_html/wp-content/themes/pro/cornerstone/includes/classes/classic/utility/class-shortcode-preserver.php on line 8

I have restored my website for now, but how can I resolve this?

I am already using PHP 7.4 (that was my first guess).

This did not occur on my staging website, which is a carbon copy of the live site and on the same server. It only happened after I pushed those updates live. Any idea why this might be the case?

I’ve seen previously you recommended manually updating Pro via the Theme upload. I don’t really want to do these updates on a live site unless I know this will definitely fix it.

I have about 20 client sites who will need to update to this new version of Pro or X. Should I wait for a more stable release? I can’t afford for this to occur every time.

Any help greatly received. Thanks got you support, which is always great.

Mark

Hi Mark,

Thanks for reaching out!

In Cornerstone 6+ that file should be located here:

cornerstone/includes/classes/classic/elements/class-shortcode-preserver.php

But in your install it claims to be here:

cornerstone/includes/classes/classic/utility/class-shortcode-preserver.php

I suspect what might have happened is the new files were added, but you still have the old files present in which case it would find both and crash like this.

Did you happen to update manually using FTP or a file manager? Often when updating that way it will replace existing files, and add files that don’t exist in the new locations but it doesn’t know to delete files that were relocated.

I would recommend fully deleting the Pro theme and reinstalling it. A good way to do this would be:

  • Go to your file manager/ or use FTP
  • locate this path wp-content/themes and rename the Pro to something else, ( this will allow you to login to your WordPress admin)
  • Go to your theme page and activate any themes except for Pro
  • Then delete the Pro theme
  • Go to your themeco dashboard and download the latest version of Pro
  • Upload and activate it on your website

If it doesn’t help, I suggest that you create a new thread and give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password
  • FTP Access

You can find the Secure Note button at the bottom of your posts.

Hope that helps and let us know how it goes.

Thank you @marc_a

I will do a backup, delete Pro and install a fresh version. I’ll let you know if I get any further problems.

Thanks,

Mark

Hello @marc_a

I have now resolved this, but I have a follow up question for you as I have around 20 more websites using Pro to update in the coming weeks. Let me explain what happened from the start:

My question is: Is there any reason this might have happened given the process that I have outlined above? Why would it work fine on a staging website but not when I push it live?

Any info you can give me would be greatly appreciated. I love using Pro and I use it or 95% of my client websites, I would like to ensure I can make it work without encountering these problems.

Thanks for your help.

Mark

Hi Mark,

I suspect what might have happened is the new files were added, but you still have the old files present in which case it would find both and crash like this.

I would recommend manually update the live website and don’t depend on Softaculous.

Hope that helps and let us know how it goes.

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