0

I'm dealing with a previous developer that's being difficult. He's removed the Plugin & Settings menus through the database (I'm assuming) as I can't find it anywhere in the functions.php file and can't access any plugin that might be used.

Can someone point me to a link on how this can be done in the database? Is it the users-meta table?

I'm really not sure what was done, and the developer stated:

"he should easily know how to go into the cpanel with the username/password you already provided him, pull up the phpmyadmin interface and edit user(s) as necessary to provide any permissions."

2
  • Have you disabled all plugins and switched to a default theme (and verified that the problem persists)? I can't see how this is supposed to be due to a value in the database. Sep 29, 2013 at 22:55
  • I'm really not sure what was done, and the developer stated: "he should easily know how to go into the cpanel with the username/password you already provided him, pull up the phpmyadmin interface and edit user(s) as necessary to provide any permissions." It looks like he went in and changed something because now I can see what I need. However I'm still interested in knowing how to do this in the database if it's possible.
    – user38790
    Sep 29, 2013 at 23:33

2 Answers 2

2

I know my way around WordPress' database pretty well and I would never call editing user permissions via PhpMyAdmin an easy thing to do. You are editing serialized strings-- very easy to get wrong, actually. So don't feel bad. There is something very wrong with that statement that "he should easily know how to ... edit user(s) as necessary to provide any permissions."

I can't promise this will work, but my administrator account on a relatively new install has this in the $wpdb->postmeta table...

a:1:{s:13:"administrator";b:1;}

... under the key wp_capabilites.

Find the wp_capabilities key associated with your (desired) admin user and past that into the meta_value column. Very quick and course testing suggests that should give your user all permissions. That is was able to elevate a "subscriber" to an admin that way. Be careful not to break that serializations. It has to be exactly like that to work. Change one character-- for example change one digit of 13 to make it 12-- and it will break and you will be looking at a "you don't have permissions" page.

However, that assumes that he "removed the Plugin & Settings menus" by editing permissions. I have my doubts. Had he done that it should be easy enough to put things back by way of the "User" form.

My guess would be that there is a mu-plugin file doing this (certainly what I'd do). Look in /wp-content/mu-plugins/ and see what you can see.

I'd also guess that if he's twitched the database like you suspect, he's twitched it in other ways as well.

1
  • 1
    oh, yes, mu-plugins is prime suspect. IMO, one has to be a SQL freak to do this kind of stuff directly in the database...
    – brasofilo
    Sep 30, 2013 at 1:01
1

If this was done by setting "permissions" via the database, the likely some capabilities were removed from your and possibly other user roles.

Given that the "Settings" and "Plugins" menus were inaccessible to you, it is a good guess that the capabilities manage_options and activate_plugins were not assigned to your user role.

Hence either you were given a non-admin user or the above caps had been removed from the admin role.

The roles themselves live in the prefix_options table in the option named prefix_user_roles.

The role a user is assigned to is indeed set in the prefix_usermeta table under the meta_key named prefix_capabilities.

Neither should be edited directly in the DB though.

The role a user is assigned to can be edited via the WP-native users admin menu.
WP does not natively provide an admin interface to edit roles and capabilities, but a bunch of decent plugins for just that do exist. Personally, I'd recommend checking out Members.

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.