
Fix CherryFramework PHP Fatal Error for when upgrading PHP Versions.
Welcome back to KickstartCommerce.com! As with much of life, especially when it’s concerning WordPress, errors seem to appear in threes or bunches at a time.
Last week, it was a jQuery conflict error, and this week Bluehost forced the same customer’s hand by auto-upgrading their website from PHP 5.2.
Truth be told, the customer was forewarned a few times about how PHP 5.X was outdated and full of security issues that would no longer be supported in favor of having the customer migrated to a more current version of PHP.
As glitchy as WordPress is when doing simple tasks such as a theme or plugin update, I knew it was nothing but trouble to have upgraded from PHP 5.😳
I loaded the customer’s website in the browser and soon discovered that a Cherry Framework plugin was the culprit. Oftentimes, authors can be a bit lazy on updating legacy themes and plugins to work with the latest WordPress core or PHP updates.
And so, this given customer’s website loaded the dreadful message:
You website has encountered a fatal error.
That’s all the home page stated, and an email was sent to the administrator. But what is the exact fatal error encountered, and where and how do I locate this fatal error? 🤔
Enter error logs. Thank goodness for errors because it held the next clues in helping me troubleshoot this issue. The easier solution would have been to find a web hosting provider offering PHP 5 hosting, but again, that’s the easiest and most INSECURE option. 😳
Nevertheless, I located, downloaded, and viewed the error log to discover where at exactly within the site architecture the PHP Fatal error was occurred:
PHP Fatal error: ‘continue’ not in the ‘loop’ or ‘switch’ context in /your/path/public_html/wp-content/plugins/cherry-plugin/includes/widgets/widgets-manager.php on line 563
But still, what does this mean? 🤔 Good question, I was in the dark until reviewing line 563 in widgets-manager.php. I found the line and the code, and still in the dark.
So, now what? Well, I dug a bit deeper into the toolbox of tricks to search for ‘widgets-manager.php’ using command line scripting (of you could download the entire site codebase and run a local search using Sublime), which returned the following file and path:
/public_html/wp-content/plugins/cherry-plugin/includes/plugin-assets.php
There in the opening lines, lines 5-9, I discovered the following lines of code:
<?PHP // Exclude widget manager for customizer global $wp_customize; if ( !isset( $wp_customize ) ) { include_once (CHERRY_PLUGIN_DIR . 'includes/widgets/widgets-manager.php'); } ?>
And being the experimental genius, rather daredevil I am, I simply commented out those very lines to see what would happen (as shown below).
<?PHP /* // Exclude widget manager for customizer global $wp_customize; if ( !isset( $wp_customize ) ) { include_once (CHERRY_PLUGIN_DIR . 'includes/widgets/widgets-manager.php'); } /**/ ?>
After all, you can’t go much more wrong than the existing PHP Fatal error, right? 😁 To my surprise, commenting out those 4-5 lines of code in the plugin-assets.php file did the trick, and the website has been humming along ever since.
Now, don’t go asking me all the details behind why commenting out a cherry framework plugin for widgets manager would cause a website to crash fatally. My guess is the code isn’t up to snuff. Rather, the code needs to be updated to work with the latest WordPress core codebase and PHP versions.
For now, though, I’m happy that the customer is happy and back online, realizing sales. And I hope this solution does the same for you and your website!
Let me know if you have any questions or need additional assistance to troubleshoot your issue. Thanks, and that’s all for now!
I wish that worked as easily for me, lol. This cherry plugin is a pain….
What error is displayed?
It works for me!!! Thank you so much!!!!!
WOW!!!! Thank you, you saved me hours of work!!
Thanks, Amanda. Glad to know it helped you and saved you time. 🙂
That was a lifesaver! Thank you Alvin!