• Resolved bendtho

    (@bendtho)


    I’m trying to figure out an extremely odd – and what I’m hoping/assuming is a purely cosmetic – glitch with my WordPress site that’s hosted by Siteground, running on 6.6.2.

    When running the site on any PHP version 8.0 and higher, pages and posts sections on the WP-Admin side don’t seem to load properly. The docked WP-Admin menu on the left doesn’t expand on mouseover when sitting in either the pages or posts landing pages, and does the same thing when trying to edit a specific page/post. In addition, on specific page/post editing, the content editor box (I use classic site editor) no longer expands to fit the contents of the page (always the same size regardless of content), and additional content boxes (like All-In-One SEO) either don’t show at all or just pinwheel.

    This behavior completely disappears whenever I drop the PHP version back down to 7.4.33, and reappears whenever I try a version above 8.0.30, including 8.1.29, 8.2.24, 8.3.12, and 8.4.0. I have tried different combinations of themes, plugins, even Twenty Twenty Four theme with NO plugins and the problem persists. Checking WP debug, server php error logs, and the browser inspector have proven all to be fruitless, just some irrelevant warnings to a few older plugins that I’m still using that I know aren’t associated since they can be deactivated and the problem persists.

    In fact, I’m convinced it’s not a plugin or theme issue at all since I can run the WordPress Playground with various 8.0+ php versions, and the same plugins/themes and not have issues whatsoever. I’ve even removed extra stuff added to functions.php, deleted .htaccess, and even used a fresh copy of wp-config and the problem is still there (all while clearing Siteground’s cache and my own cache in between the various tests).

    I’m at a complete loss here. On the frontend, everything on the site seems to be functioning normally, and the backend works fine and even lets you edit/save posts/pages despite being glitchy. But the problem is I’m not sure if it is JUST a cosmetic issue and that irks me.

    Is this something I should reach out to Siteground for? Anything else I should try? I appreciate all the help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The menu on the left does not open if the HTML code of the page has not been loaded completely. This happens again when a server-side error occurs. This means that the page is not fully loaded. This could also be the reason for the other anomalies.

    Hence my recommendation:

    • Check the error log in the hosting to see if an error is listed there. If so, investigate it.
    • Look under Tools > Site Health to see if you see anything conspicuous there.
    Thread Starter bendtho

    (@bendtho)

    Thank you for your response.

    There unfortunately is no discernable difference in either the hosting error logs, php error logs, or Site Health suggestions whether on PHP 7.4.33 or 8.0+.

    Site Health doesn’t have any API-related suggestions, and the only critical suggestion pertains to autoload options, which I’ve brought below the size threshold and it doesn’t make any difference.

    Thread Starter bendtho

    (@bendtho)

    I checked with my host and they are not aware of any issues running 8.0+ on their service (they said most were). But there was one error log I failed to check in the wp-admin folder that may or may not help.

    On 7.4.33, I get these PHP warnings in the log when loading a post in “edit page” or “edit post”:

    [09-Oct-2024 18:12:13 UTC] PHP Warning: array_filter() expects parameter 1 to be array, null given in /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php on line 485
    [09-Oct-2024 18:12:13 UTC] PHP Warning: array_keys() expects parameter 1 to be array, null given in /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php on line 485
    [09-Oct-2024 18:12:13 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php on line 488

    On 8.0+, it turns into a fatal error:

    [09-Oct-2024 18:12:28 UTC] PHP Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php:485
    Stack trace: 0 /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php(485): array_filter(NULL) 1 /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php(79): WP_User_Query->prepare_query(Array) 2 /home/customer/www/redacted.com/public_html/wp-includes/user.php(794): WP_User_Query->__construct(Array) 3 /home/customer/www/redacted.com/public_html/wp-includes/user.php(1703): get_users(Array) 4 /home/customer/www/redacted.com/public_html/wp-admin/includes/meta-boxes.php(970): wp_dropdown_users(Array) 5 /home/customer/www/redacted.com/public_html/wp-admin/includes/template.php(1456): post_author_meta_box(Object(WP_Post), Array) 6 /home/customer/www/redacted.com/public_html/wp-admin/edit-form-advanced.php(723): do_meta_boxes(Object(WP_Screen), 'normal', Object(WP_Post)) 7 /home/customer/www/redacted.com/public_html/wp-admin/post.php(206): require('/home/customer/…') 8 {main}

    thrown in /home/customer/www/redacted.com/public_html/wp-includes/class-wp-user-query.php on line 485

    Similar errors happen when you just load the Pages and Posts lists where it goes from a warning to a fatal error when changing the PHP version. Again I do run the Classic Editor, but since this issue seems to go beyond that (and the Playground runs Classic Editor on higher PHP versions no problem), I’m not sure what it could be. I can deactivate all plugins and use a different theme and the Pages and Posts sections still throw this same error and behave in the same manner.

    The error indicates an error in a content in the database. The row in question processes roles that WordPress manages. My guess is that some plugin you are using has entered an incorrect value here that can no longer be processed. Unfortunately, this plugin has not cleaned up after itself, which is a bad habit that I as a plugin developer cannot and do not want to endorse.

    To solve this, you would have to reset all roles in your project. In my opinion, the easiest way to do this is (unfortunately) another plugin: User Role Editor. Once you have installed and activated it, you will find an option for this under Settings >User Role Editor >Tools. If you run this, all roles will be reset to what WordPress provides.

    I have 3 recommendations:

    • Make a backup of the database first, just to be safe.
    • Deactivate all plugins beforehand, then run this, then reactivate the plugins.
    • If necessary, you should then make new settings for your WordPress users.
    Thread Starter bendtho

    (@bendtho)

    Oh man, you’re a lifesaver!

    So I already had user role editor installed because I utilize a ton of custom roles. But I went ahead and purchased the full version which allows you to specifically export just the user role content. And once I ran the “reset roles” as you suggested, I was able to re-import them back in and not lose anything.

    Now the backend of my site is functioning glitch-free on PHP 8.2.24. Much appreciated!

    • This reply was modified 4 months, 3 weeks ago by bendtho.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.