• Resolved hllwrld

    (@hllwrld)


    Hi !

    someone has set up a WordPress instance for me (6.5.2).
    So they did : website works well.
    However, when I connect to admin pages https://mywebsite/wp-admin/profile.php , I have multiple php warnings :

    Warning: Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/includes/menu.php on line 181
    
    Warning: Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/includes/plugin.php on line 2012
    
    Warning: Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/includes/plugin.php on line 2012
    
    Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 155
    
    Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 156
    
    Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 164
    
    Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 171

    This happens only when connecting admin pages with limited privileges (I have tried Author and Editor).
    The warnings don’t appear when connecting with privileges = Administrator : I have tried granting Admin privileges, it fixes the bug but I don’t want all users having Admin privileges, so I reverted and the bug came back…

    Versions/Details :

    • WordPress 6.5.2
    • advanced extensions : 1 = advanced-cache.php
    • Theme : Divi Child (Divi-child-theme) / Parent Divi (Divi)
    • Server : Linux
    • web server : Apache
    • php : 8.2.16
    • DB : MariaDB 10.6

    Note :

    • I have tried to use php 8.1 and 8.0 ; bug is still present
    • I have tried using php 7.4, so bug disappears, but I reverted to 8.2 as I don’t want using an obsolete version of php
    • I have tried emptying cache or disabling it, it doesn’t impact the bug

    To mention : the DB was MySQL 5.6 until recently (bug was already there). I have migrated to MariaDB 10.6 recently but bug is still there 🙁

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator James Huff

    (@macmanx)

    This problem may be a plugin or theme conflict. Please attempt to deactivate all plugins and switch to the default Twenty Twenty-Three theme. If the problem goes away, re-activate them one by one to identify the source of the problem.

    If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to deactivate all plugins and change the theme for you while you’re still logged in without affecting normal visitors to your site.

    Thread Starter hllwrld

    (@hllwrld)

    Hi !

    Thank you for the very good advice. I have deactivated all plugins, and the problem is gone.
    I will investigate for the exact one causing the trouble and check if it is necessary.

    All the best

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘php warning Undefined array key’ is closed to new replies.