wp-media / adminimize

Adminimize is a WordPress plugin that lets you hide 'unnecessary' items from the WordPress backend.
https://wordpress.org/plugins/adminimize/
GNU General Public License v2.0
100 stars 31 forks source link

Trying to access array offset on value of type bool #162

Open capnolithyl opened 7 months ago

capnolithyl commented 7 months ago

We are currently switching our websites from PHP 7.4 to PHP 8 and encountered an issue in the WP dashboard (/wp-admin/index.php).

Warning: Trying to access array offset on value of type bool in /public_html/wp-content/plugins/adminimize/inc-setup/dashboard.php on line 154

Here is the line in question:

$value['title'] = ($value['title'] == FALSE) ? [] : $value['title'];

I think there needs to be another check if $value is an array. I came across this a couple times since switching to PHP 8.

The warnings show up above the div#wpwrap about 70 times or so and make the dashboard nigh unusable. Sometimes the menu items just disappear. As soon as you're in one of the submenus the warnings disappear and you can use the dashboard normally as long as you don't go back to /wp-admin/index.php.

bueltge commented 4 months ago

You are sure, because the current line from your error message are different? See https://github.com/wp-media/adminimize/blob/master/inc-setup/dashboard.php#L154