Symptoms
-
Unable to change login settings in Domains > example.com > WordPress instance > Setup:
Something went wrong.
r is underfinedor
Something went wrong.
Cannot read property 'login' of undefinedor
Administrator account not found for this WordPress instance. Please create administrator account manually in WordPress
-
Opening
http://example.com/wp-admin.php
redirects tohttp://example.com
or shows the error below:Sorry, you are not allowed to access this page.
-
There is no "Administrator" user for the instance:
# plesk ext wp-toolkit --wp-cli -instance-id 1 -- user list --format=json --quiet --role=administrator
Note: instance-id can be seen in the address bar of a browser by opening the instance in Domains > example.com > WordPress instance:
-
In Domains > example.com > WordPress instance > Database > open in phpMyAdmin > example_usermeta there are no records with meta_key example_capabilities and example_user_level for user_id 1:
Cause
Corrupted WordPress instance database.
Resolution
-
Open Domains > example.com > WordPress instance > Database > necessary database > open in phpMyAdmin > example_usermeta.
-
Type the following:
First query:
user_id - 1
meta_key - example_capabilities
meta_value - a:1:{s:13:"administrator";b:1;}The second query:
user_id - 1
meta_key - example_user_level
meta_value - 10
Note: If the table does not exist, the last backup should be restored or WordPress Support Contacted, to further assistance to reacreate the table.