Users who have not been assigned any Roles or Capabilities are called “orphans”. When using the shared users table trick to link up multiple WordPress installations, users who register on one of your blogs, are not given any privileges on the other blogs in the network. WP-Orphanage is a plugin that automatically adopts your orphan users by promoting them to the Role of your choosing. By default it will use the same default role set in the main WP Options, but the options page introduced in v1.0 of WP-Orphange will allow you to set it to any role you like.
Orphans are adopted in one of two ways:
- Users who try to login to a different blog in the network than the one they signed up on, will be promoted at the time of login. The user won’t even know that it happened.
- When the admin logs into the blog and views the users page, all orphan users – for that blog – are promoted automatically.
By taking a just in time approach, this plugin will not add any noticeable overhead to your WordPress blogs, while providing a seamless experience for the users and administrators.
If you need support, just post a comment below, and I’ll see what I can do.
Very cool idea. The ability to share a User table in WP has been broken for a long time. Maybe this can be a step toward fixing it.
Not very useful to me as-is, but I might be able to adapt it. if I come up with something generally useful I’ll let you know.
What I need is to look to other blogs and find the user there, and assign the user the same rights as he has in the other blog. Thus, not the “all subscribers” approach here, but “whatever they are over there, over here”.
Yeah, it was definitely just a quick hit fix for one of my projects. I’ve thought about expanding it to not only do what you suggest but also to allow you to set the which role that ‘all’ would be applied to.
Let me know if you do anything with the code so I can blog it.
Thanks for stopping by,
- Eric Marden
Eric, I’, trying to get a program up & running that could integrate a WP & K2 blog with a BB like Vbulletin. I need to find a way to synch the sign ons. Is that similar in any way to this issue? Also have you used K2 in an MU environment? Thanks, Ben
The easiest way to integrate a forum is to use bbPress. Not as full featured as vBulletin but much easier to integrate. The problem that WP-Orphanage solves can applied to integrating WP and bbPress (with some modifications). This is documented here: http://bbpress.org/documentation/integration-with-wordpress/
K2 is completely compatible with MU and I have used it just fine with it.
- Eric Marden
Hey Eric,
Is this working with WordPress MU or 2.8.x?
It does. I should update it to reflect the version number.
It doesn’t seem to be working on 2.8.4 MU….
It works on WP 2.8. It can also work on WPMU, if you are using the shared table trick.
just curios, what this plugin does with wpmu? I understand the description above, but that seems to refer to a bunch of wp installations that share a user database.
besides, how would this plugin work in conjunction with the new setting in wpmu where yo ucan define a dashboard blog?
You can use the same shared User table trick with WPMU, and then this plugin would be useful for that.
k, thx. so the plugin is only useful with the shared user table trick…
I am asking because the plugin was mentioned in a foru mthread where people were asking about an option to allow users to register/subscribe as users of a particular subblog, not of the main blog itsself (talking wpmu) as right now a user has to create an accoutn on the main blog, select he doesn’t want a blog, then the admin of a subblog must manually add him….
I’m using the shared user trick with multiple wordpress mu sites. You can see my installations at http://idwellness.org and http://hpcareernet.com
The plugin isn’t working for me because it isn’t allowing me to change any of the users to subscribers.
It changes them to subscribers automatically one of two ways:
* User logs in to a blog he doesn’t have permissions to… and it will make them a subscriber during that process.
* Admin logs in, and it will make all users that don’t have any privileges on that blog a subscriber.
There is no options screen or other UI to this plugin, it just works in the background. Have you viewed the user list and seen users with out a role on any of your blogs?
Yes, all of my users that registered on the first wpmu site have no role on the second. I can’t manually assign them either because I appear to have no role their as well,
Do you get an error when you login to the other site? Are you using the main ‘admin’ account? Are you usertables called wp_users and wp_usermeta?
When i login as the SIte Admin of the WordPress MU Site, there is no error but I am still not listed as admin of blog one. I have no role.
Any other users get the error message of no role. You can test it: http://hpcareernet.com login buddypress password art
Yes usertables are called wp_users and wp_usermeta
Let me set up a test environment and do some further testing on my end.
Eric: You’re welcome to play around on the actual install as we are not running it from the live database. Email me at rohan@rohan-kapoor.com and I’ll send you passwords.
Eric: did you have a chance to test this for us? Any status changes?
Pingback: Implementing the WordPress Shared Users Table Trick « xentek
Thanks for this great plugin !
It worked with my 2.8.5 installation.
However in the option screen, I discovered the drop down list is always empty. It happens on both the main site and the second one. It seems get_option(‘wp_user_roles’) returns an empty or null value.
Any idea ?
BR
I’ll looking to this. Can you check your options table in the db and see if you have a value for “wp_user_roles”?
~/e
Thanks for your reply.
The key ‘wp_user_roles’ does not exit in my option tables, however I have a key ‘www_wp_user_roles’ in my main option table and ‘www_ds_user_roles’ in my secondary option table.
The key are named after my table prefixes (www_wp_ for the main one and www_ds_ for the secondary one).
Vince thank you very much for your help with this bug. I didn’t realize this option_name was created using the table prefix (which makes sense). I’ve updated the plugin to v1.0.1 which dynamically computes this and should work for you now.
Thanks again, you rock!
Hi Eric and thanks for your help.
Actually I wasn’t able to make your v1.0.1 work.
I browsed a bit the code and figured that $wbdb->table_prefix was empty in wp-orphanage.php line 81. I changed this to $wpdb->prefix and managed to make the option screen work.
As I’m not an experienced WP plugin developer, I’m not totally sure this correction would work for every installation. Maybe you could advice here
Best regards
Which version of WP are you running?
I’m using WP v2.8.5-FR
Vince, you’ll be happy to know that I’ve released v1.1 of this plugin that addresses your issue. Thanks for all your help on this.
I thanked you in the release announcement and change log with a link back to your site.
That’s a lot of honor
Thank you for all your work.
Pingback: WordPress Plugin Releases for 11/07 « Weblog Tools Collection
Pingback: Plugins WordPress 07-11-2009 - Guia WordPress
I cannot seem to get this to work. I installed it and it made the first 50 users no longer orphans but the rest of the 2,000+ users still have no roles. Any ideas?
Tell me a little bit more about your set-up:
* WordPress or WP-MU? Which Version?
* How many blogs are sharing the user table?
* Which blog are the users registered on?
* What role did they have on that blog?
* Which role do you want to give them on the other blogs?
You can also use the WordPress tools to fix the orphans if its a one time thing (or just as a workaround) while I try to fix this issue for you in the plugin.
Thanks!
~e
I am using regular WordPress on 2.8.6. Only one blog trying to share the table to our major blog on http://www.berryreview.com. Users are registered on the regular blog and have subscriber permissions there. I want them to have subscriber permission on the new blog too. Problem is that only the first 50 shown subscribers get the subscribers permissions all the rest have no role including our other editors, authors, and contributors. When I try to log in as a subscriber test account it says I do not have permissions to do that.
Any ideas?
Ronen, Thanks for bringing this to my attention. You’ll be happy to know that I did indeed find a way to reproduce this bug and fixed it in v1.2. Upgrade and let me know if you are still having issues.
Eric:
You’ll note that this is the same issue that I had brought up before. I’m glad that you were able to fix this. We’ll look into implementing it soon!
Thanks!
Thanks for reporting the issue to us. I thought I might have missed someone when replying to the comments, and appreciate you speaking up to get counted. With out you guys the bug may still be there.
This is an interesting challenge. I used the shared users trick to try and set up multiple blogs in the same db, distinguished by table prefix, but with common user data. Ran into “You do not have sufficient permissions to access this page” error. Googled it, found this discussion, and installed the plugin at the top of this page (wp orphanage.) After installing and activating wp-orphanage on the latest version of WP (2.9.1) I still get stopped dead by the same error: “You do not have sufficient permissions to access this page.”
Sigh.
Appreciate any help, haven’t any idea. Will continue to hammer away at Google.
Are you the admin of the blog? When you visit the Users list (with WP-Orphanage installed) are there any users left there that aren’t at least have the ‘subscriber’ user role?
A user registers on one site, goes to another site and tries to login. Is given the error while the plugin adds them and when they come back they are added.
The problem is, the user gets scared off by the message and then sometimes never comes back.
What’s the error that they are given? The plugin should promote them transparently and then their login should land them on the wp-dashboard.
The error says: You do not have sufficient permissions to access this page.
Jonathan,
Do you have WP-Orphanage installed and activated on all sites in your network? This is required.
Hi Eric, wonderful job, thanks.
Had the same issue with “no sufficient permissions”. I fixed the problem following the indication of WordPress at the link:
http://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables
Using one single DB is ok, but in the user-capabilities table – tableprefix-usermeta > capabilities – you have to add a new row with i.e. administrator role for the new WP installation (just copy previous capabilities line changing table prefix, see line 10 of table).
That worked for me.
Thx Eric for your support
I’ve got exactly the same issue as Ronen – only the first 50 users get automatically promoted. After that the plugin just seems to stop working. I looked at the code and I see it is very simple and straightforward. But I’m not a PHP-developer and have no idea what’s going wrong.
How many users do you have?
I found the issue, and fixed it v1.2. It will now upgrade all of them at once when you visit the users page in wp-admin, or individually, as each user logs in.
Thanks for reporting the issue!
Actually, what I wound up doing is not using this at all. We decided that we wouldn’t realize more benefits vs. the cost of doing all the configuration to share users between more than one install, and the further a WP install strays away from “stock,” the more problematic it becomes. I appreciate the follow-up though, and the time that goes into developing these plugins. It might be more beneficial if we have many more users to manage.
No worries, Luke. Thanks for giving it a try.
I want to create 2 blog. for the users I think this is my solution. bu I dont understand one think. this plugin should setup at the two blogs or if I but it in one of them is enough. and are there any solution to manage the both of these blogs in one admin area…
thx for the plugin it worked with me great
Hi Eric,
I’m not sure why but the plugin doesn’t seem to work properly with WP 3.2.1
It works fine when logged in as Administrator (adopt_all_orphans), all orphans are upgraded to the role set in wporphanage_role. But the adopt_this_orphan function seems to be broken, an orphan doesn’t upgrade itself on login.
Hope you can help!
Thanks
I’m not really working on this plugin anymore, but would be happy to incorporate any patches, should some kind soul submit one
My simple fix, edit plugin to look like this:
add_action(‘wp_login’,'adopt_all_orphans’);
add_action(‘load-users.php’,'adopt_all_orphans’);
Robert Griffiths, thank you! At least now I can log in. We’ll see what happens down the line.
And Eric, thanks for the leg up!
thanks,
How do i get common login for two separate wp databases with different domain names in same host.
You can take a look at this post for one way to do it: http://xentek.net/articles/528/implementing-the-wordpress-shared-users-table-trick/
But these days, I would do it with WP Multi-Site, which is much nicer IMHO.