Warning: Undefined array key 2 in D:\Local websites\jan-visscher\app\public\wp-admin\includes\plugin.php on line 2010

I manually backed up from another server the wp-content folder and the database. Zipped it up and dragged it into Local. That all went well. However, when I try to the admin I get the following warning:

Warning: Undefined array key 2 in D:\Local websites\jan-visscher\app\public\wp-admin\includes\plugin.php on line 2010

You do not have permission to view this page.

I CAN view the front-end of the site.

I have overwritten the plugin.php file file with the one from the server to no avail. I have made all the plugins bak files (example worfence.bak) to no avail.

So I am not sure why I can’t view the back-nd of the site.

System Details

Local Version: 9.1.0+6719

Operating System (OS) and OS version: Windows 11 PRO

These errors are almost always dealing with code that is incorrectly calling the relevant function in plugins.php. It is not an error in plugins.php.

You would need an actual stacktrace to start figuring this out, but it almost always comes from a plugin and PHP8.1’s new Deprecation warnings.

1 Like

I have made all the plugins bak files (example worfence.bak) so that would solve that if it were a plugin. I just did the same with the theme and the php error is gone but it still states I have no permission to view the page.

All the permissions look good too upon inspection for the files and folders here?

Are you running Local as an administrator?

Can you try actually just disabling all plugins instead with opening Site Shell and running wp plugin deactivate --all ?