Error messages after upgrading to 3.4.1 (7 posts)

  1. mishabelle
    Posted 3 years ago #

    My hosting company upgraded their php, so my site was getting all sorts of error messages. So, I make a backup of all my content, deleted the wp-admin, wp-includes and loose files in html, then uploaded 3.4.1 of WordPress.

    I got a bunch of errors at that point, so via e-mail I went into my plugins folder and renamed them. That caused my of the messages to go away.

    Now, I'm left with just two errors.

    On the front page, I get this error, even though the page loads successfully:

    Strict Standards: Redefining already defined constructor for class WP_Widget in /nfs/c05/h04/mnt/73941/domains/feltbeats.com/html/wp-includes/widgets.php on line 93

    When I go to wp-admin however, the page does NOT load and I see only this:

    Strict Standards: Redefining already defined constructor for class WP_Widget in /nfs/c05/h04/mnt/73941/domains/feltbeats.com/html/wp-includes/widgets.php on line 93

    Warning: Cannot modify header information - headers already sent by (output started at /nfs/c05/h04/mnt/73941/domains/feltbeats.com/html/wp-includes/widgets.php:93) in /nfs/c05/h04/mnt/73941/domains/feltbeats.com/html/wp-includes/pluggable.php on line 881

    I was actually just on the phone with my hosting company, and he very kindly looked at this for about an hour. He was focusing on it being a bug in 3.4.1 - but it seems the fact that the admin doesn't load would have been noticed. =)

    So I assume it is something in my set up. But since I deleted most files, I can't see what it would be.

    Any help or just pointing me in the right direction would help. Thank you!


  2. mishabelle
    Posted 3 years ago #

    Has anyone else had a similar problem? I just have trouble believing this is a default WordPress problem?

  3. Tara
    Volunteer Moderator
    Posted 3 years ago #

    have you tried:

    -deactivating ALL plugins (yes, all) temporarily to narrow down the problem. If the problem goes away, re-activate them individually (one-by-one) to find the problematic plugin(s). If you can't get into your admin dashboard, try resetting the plugins folder by FTP or phpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems (because the hooks remain unless plugins completely removed or some plugins stick around in cached files. So by renaming the folder, you break them and force them inactive). If applicible, also remember to deactivate any plugins in the mu-plugins folder. The easiest way is to rename that folder to mu-plugins-old

    -switching to the unedited default theme (Twenty Eleven) for a moment by renaming your current theme's folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue.

  4. djeyewater
    Posted 2 years ago #

    I am having the same issue, I think it is probably a bug in PHP - https://bugs.php.net/bug.php?id=52160

    Unfortunately I get a compile error when I try to rebuild PHP, so I can't check if the latest PHP version gets rid of this error message. But I think it should do.

    If you're getting this error on your live server, you should probably change the php.ini directive display_errors to off. The exact way to do this depends on how your webhost has PHP set up, so check their help docs if you're not sure. Doing this does not fix the error, but does hide it.

  5. djeyewater
    Posted 2 years ago #

    Finally got my PHP upgraded, and still got the same error. I read that PHP bug report a bit more carefully and realised what the problem was. This is a bug in wordpress - the PHP4 constructor is declared before the PHP5 constructor.

    To get rid of this error, you need to edit the wp-includes/widget.php file. Find the class WP_Widget (line 24). Scroll down and find // Functions you'll need to call. (line 71). Just below this is the PHP4 constructor, followed by the PHP5 constructor. Swap these two functions round, so that the PHP5 constructor comes first, i.e. http://pastebin.com/9gMxPGWU

    To be honest, I'm not sure why a PHP4 constructor is even included since wordpress isn't meant to be compatible with PHP4 any more.

  6. spectrus
    Posted 2 years ago #

    Thank you very much djeyewater, helps a lot. I only saw this error once I started using register_shutdown_function to catch any fatal errors WordPress might generate. Wasn't appearing anywhere in the logs before.

  7. Ian Dunn
    Posted 2 years ago #

    See #20801 for details about the WP_Widget notice and a proposed patch.

Topic Closed

This topic has been closed to new replies.

About this Topic