0

I was trying to clear up some empty tables left behind by other previously used plugins. As such i was trying to delete the GD Star rating plugin and now I cannot access my WP admin. i get the 'You do not have sufficient permissions to access this page'

I turned on the debug to true and saw the errors caused by lots of plugins. So I disabled all of them, but nothing helps:

This was the query I had run (and then just checked the output and clicked 'Drop' which messed it up.

SELECT * 
FROM  `mydomain_main`.`wp_options` 
WHERE (
`option_id` LIKE  '%ratings_%'
OR  `blog_id` LIKE  '%ratings_%'
OR  `option_name` LIKE  '%ratings_%'
OR  `option_value` LIKE  '%ratings_%'
OR  `autoload` LIKE  '%ratings_%'
)

Can someone please please advise

5
  • 1
    open your phpmyadmin or any other database management application you have, and check if you didn't delete the wp_options table.
    – Bainternet
    Jul 15, 2011 at 14:26
  • no, the wp_options table still exists. The front end of the website still works fine. Its just the wp-admin that i'm unable to login to Jul 15, 2011 at 14:27
  • 1
    Maybe you deleted the roles and capabilities from the database check for an option named wp_user_roles and reset it to the default as posted here wordpress.stackexchange.com/questions/17614/…
    – Bainternet
    Jul 15, 2011 at 15:55
  • Tried that. Didn't help. I also disabled all plugins and enabled debug to true. I get the following message Notice: Undefined index: page in public_html/wp-content/themes/weekly/functions/theme-options.php on line 444 Notice: Undefined index: in public_html/wp-admin/includes/menu.php on line 219 You do not have sufficient permissions to access this page. theme-options line 444 has the following code: if ( $_GET['page'] == basename(__FILE__) ) { Jul 15, 2011 at 16:21
  • 1
    Bainternet.. YOU SAVED MY LIFE!! It was indeed the wp_user_roles that was deleted. THANKS A TON, You have no idea about the #$$t you saved me from! Jul 15, 2011 at 16:36

2 Answers 2

3

since i posted as a comment and most people miss the good tips that are in the comments, I'm posting again as an answer

The reason is because GD Star rating plugin creates custom capabilities and your query deleted all references of %rating% it deleted the wp_user_roles option which holds all capabilities roles.

the solution would be to re create that option in options table (usually wp_options) with the default value just like I answered here .

1

You probably don't want to hear this, but I would suggest to reinstall WordPress and put your backups back. In the end that would be the fastest, easiest and most 'secure' = as in making sure you're not forgetting something which might cause issues in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.