Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
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 '11 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 –  Sledge81 Jul 15 '11 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 '11 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__) ) { –  Sledge81 Jul 15 '11 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! –  Sledge81 Jul 15 '11 at 16:36

2 Answers 2

up vote 3 down vote accepted

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 .

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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