• I’ve just started doing some work on a site that was on a very old version of WordPress (Version 4.0.1). Today I took the plunge and backed up the site and updated WordPress and I’m now getting a list of errors (which all seems to be based on the same problem).
    I found this help article https://w3guy.com/fix-notice-called-constructor-method-wp_widget-deprecated/ but I can’t see where I need to go to make the change (i.e. to __construct)
    Please help!

    I tried restoring the back up that I made just before doing the update but this hasn’t sorted out the errors

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The errors should show you what code needs a change, but you can do a text search in the plugins and themes folders to find it.
    For WP_Widget, you would be looking in any plugin or theme that provides a widget. The code looks like class blahblahblah extends WP_Widget and in the old PHP version, it would have a function named the same as the class, which needs to change to be called __construct, just like the page you referenced explains.

    Thread Starter sarahkt2021

    (@sarahkt2021)

    Thanks so much for getting back to me. Sorry I know it’s such a basic thing but I’m not a WordPress developer and I just don’t know. The articles seem to suggest it was a bit of a find and replace job but I just didn’t know where to go to find the necessary code. How does one access ones plugins and themes folders?

    If the site is only on a server, you could use the plugin editor from within WordPress (same for theme editor), but it would be slow going.
    You can use FTP or your host control panel File Manager to copy the plugins and themes to your computer, and then do all the searches there. Make changes and then copy them back to your site.
    You can also find replacement plugins or theme that is already up to date. There are likely other PHP problems in the old code. There is a plugin PHP Compatibility Checker that lists PHP version problems in your plugins and themes.

    Thread Starter sarahkt2021

    (@sarahkt2021)

    Thank you so much – having a go now!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Deprecated since version 4.3.0!’ is closed to new replies.