WP-Orphanage

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:

  1. 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.
  2. 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.

Download WP-Orphanage Plugin

If you need support, just post a comment below, and I’ll see what I can do.

57 thoughts on “WP-Orphanage

  1. 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

  2. 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

  3. 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?

      • 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….

        • 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?

  4. 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, :P

  5. Pingback: Implementing the WordPress Shared Users Table Trick « xentek

  6. 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

      • 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

  7. Pingback: WordPress Plugin Releases for 11/07 « Weblog Tools Collection

  8. Pingback: Plugins WordPress 07-11-2009 - Guia WordPress

  9. 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.

  10. 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.

  11. 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.

  12. 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.

  13. 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…

  14. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>