Support » Fixing WordPress » Errors from wp-includes/widgets.php

  • starapple

    (@starapple)


    Greetings. I’m getting the warning messages below when I attempt to preview a WP 5.1.1 site in any theme. This is happening with only one of six sites I have hosted at 1&1. I have disabled all plugins and have seen no change in the behaviour. Here are the lines of messages:

    Warning: array_merge(): Argument #2 is not an array in /xxx/wp-includes/widgets.php on line 1211

    Warning: array_diff(): Argument #2 is not an array in /xxx/wp-includes/widgets.php on line 1212

    Warning: Invalid argument supplied for foreach() in /xxx/wp-includes/widgets.php on line 1214

    Warning: array_merge(): Argument #1 is not an array in /xxx/wp-includes/widgets.php on line 1222

    I’ve seen posts here that suggest it’s linked to the language being used but that doesn’t seem to be the case here because when I change from UK English to US English as all the other functioning sites, the warnings persist.

    Any help will be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    There’s something corrupted in that site’s widgets. The relevant code is trying clean up discrepancies, but it can only foresee so many situations. If the active widgets are displaying on the site correctly, it’s safe to ignore the warnings.

    A hosted site should not be displaying warnings on pages in the first place. They are still logged in any case. To suppress display, verify that WP_DEBUG is defined as false in wp-config.php. If it is, the site’s php.ini file should be corrected. If you cannot access that file, you can try overriding the setting in wp-config.php with @ini_set( 'display_errors', 'Off' ); This does not stop the errors or logging, but it prevents them from being displayed on the page.

    To actually solve the widget corruption, clear all inactive widgets plus any lost or orphaned widgets that may be listed. If that does not help, you may need to delete the currently active widgets, the redefine them anew.

    starapple

    (@starapple)

    Thanks @bcworkz. The thing is, this is an almost virgin site. WP with 2017 theme and the only plugins active are the Classic Editor, JetPack and reCAPTCHA Jetpack. No Widgets being used; at least, the standard sidebar and footer have nothing added.

    Moderator bcworkz

    (@bcworkz)

    Oh really now 🙂

    The widgets used or not is not so significant as what widgets are registered and if any are listed as inactive. As a test, deactivate all plugins, then do a test preview of another twenty* theme. If the errors do not occur, restore the plugins one at a time, test previewing after each. Whichever plugin causes the errors to recur is apparently doing something odd in registering additional widgets.

    By narrowing down the cause, I’m hoping to replicate the error. It’s a lot easier to find the root cause if the error can be replicated on other sites.

    @bcworkz, I had done all of that; even disabling Jetpack, which, to my consternation, caused my contact page to display all its configuration info live on the site. I cleared my local cache including cookies and had to log in to all sites that I normally entered with stored credentials.

    Happily, the warning isn’t displayed on live pages.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Errors from wp-includes/widgets.php’ is closed to new replies.