Fixing PHP Fatal error: Uncaught Error: with on line 4

It came to my attention this week that versions of Socrates 5.029 and below, installed prior to May 2018 are causing fatal php errors and breaking sites using the latest version of PHP 8.


I apologize for the issue and have some quick fixes to resolve below, however,  I want to explain how this happened first..

Between 2017 and 2020, I used a 3rd party Theme Updater service to update my themes and plugins. They were very popular and it was a great service. Unfortunately, the owner shut down the service suddenly in early 2020.

This left theme developers like myself with a big problem. If Socrates customers didn’t get my “multiple” emails on the updater situation or never updated their themes between May 2018 and today…  They never got the NEW updater code or any theme updates since 2018 or before.

So this left 100’s, if not 1000’s, of Socrates Theme owners without the latest theme updates. Most likely you are one of those people and now your site is broken and you find yourself here.

Over years code does get deprecated. This particular problem causing an error was fixed in an update from May 2018, so that means you hadn’t updated the theme code in five years… and things do break over time.

I really did try to notify everyone via emails and social media posts.

Okay, how do you fix the problem, as you can’t even login to WordPress.

The easiest fixes are if you know how to access your webhost file manager of FTP.  (Fix 1 & 2)

If not, you’re going to want to ask your webhost for assistance.  (Fix 3)

FIX #1 – Advanced

Login to your Webhosting account’s file manager (or FTP for advanced users) and delete these 3 lines in /wp-content/themes/socrates-v5/functions.php

include get_template_directory() . ‘/inc/widgets/’;
include get_template_directory() . ‘/inc/widgets/widget.instagram.php’;
include get_template_directory() . ‘/inc/widgets/widget.posts.php’;

That will restore your site functionality immediately.

You can then login to WordPress and upload the latest version of Socrates  (5.045.. 5.046 is releasing soon) available in our members area over the current one.  WordPress now lets you replace themes with the same name when you upload.  You’ll be prompted to “replace active with uploaded”.

Note: Most likely your account and latest download is in our old member area here, and not in WPUnite which launched in 2020.

FIX #2 – Intermediate

Login to your Webhosting account and change the version of PHP to Version 7.4 or below.  There’s usually an option to do this in major webhosts.  Just google change php version and your hosting company name like this..

change php version bluehost
change php version hostgator

OR ask your webhosting support if they can rollback the version of PHP temporarily.

That will restore your site functionality and you can then login to WordPress and upload the latest version of Socrates over the current one.  You can then go back and update PHP to 8.0+

FIX #3 – Beginner

If you have a decent webhost they should have online support that can help you fix this problem.  You can ask them to do any of these three things to restore.  They are bound to say yes to one of them.

  1.  Rollback PHP to 7.4 temporarily so you can login and update theme.
  2.  If they will do it.. ask them to remove the lines from functions.php in fix #1.
  3.  Have them delete the Socrates Theme folder in wp-content/themes /socrates-v5.    This will give you access back and you can upload the latest version and it should work fine.

If all else fails, you can email me and I’ll try to help.

Once again I apologize for the problem.

Remember, it’s very important to make sure you keep your themes and plugins updated.  If you have old themes and plugins you’re no longer using definitely delete them.

Previous Post

How to change background on one menu item in navbar

Next Post

Adding Custom Font to Advanced Editor Tools (TinyMCE)

Leave a Reply

Your email address will not be published. Required fields are marked *