Justin Tadlock

Developing a user management plugin

If you run a multi-user site with WordPress, I probably don’t have to tell you that managing that site sucks. You’ve probably went through the handful of plugins available and have hacked together bits and pieces of code just to keep your site afloat.

After looking around and playing with some different plugins, I didn’t find anything that suited my goals. Of course, I decided I’d just make the plugin myself.

I posted about the plugin on Twitter a few days ago and was surprised at the responses I received. It seems many of you are looking for the same things. So, I’m going to ask for your help with this project.

The goal of this plugin is to be a complete management system for users, roles, and permissions. I want it to fit in with your administration panel and feel like it has always been there. It needs to work completely within the bounds of WordPress too. I’ve seen some plugins that don’t take advantage of WordPress’s roles and capabilities system.

In this post, I’ll list some of the things I’ve been working on and show you how they’re developing. Then, I’ll let you share your ideas.

The plugin components

Since this will be a massive plugin with loads of different features once it’s finished, I thought it’d be best to build a components system. Basically, what I’m doing is separating each feature into a unique component. Each can be turned on or off by the site administrator.

It’s a sort of use-only-what-you-need system. It’ll also allow me to more easily extend the plugin in the future with additional components. Plus, it’s easier to keep the plugin organized this way.

Plugin components settings
Plugin components settings

Role management

I think a lot of people will be excited about being able to manage user roles with an easy-to-use interface. This component will allow you to give users with specific roles only the capabilities you want them to have.

Plugin components settings
Plugin components settings

In addition to being able to manage roles, you’ll be able to create them. The New Roles page will allow you to create new roles and attach specific capabilities to those roles that can later be managed through the Manage Roles panel.

Create new roles for your WordPress blog
Create new roles for your WordPress blog

User capabilities

This feature will no longer be a part of the plugin. WordPress is changing the the user/role/capability system. Users will only be able to have a single role and no additional capabilities. Thanks to James Collins for his comment on this.

Typically, a user gets a certain role. That user can then only do the things allowed within the scope of that role. What happens when you want an editor of your blog to have more control but not be an administrator?

You grant (or deny) that user additional capabilities from his or her profile screen. This allows the user to work outside of their role’s capabilities if you want them to.

Capabilities management for individual users
Capabilities management for individual users

Other components

The above components are what I’ve spent the most time working on thus far, which is why they’ve been highlighted. I also have a few other features I’d like to add before releasing this plugin in any form:

  • Content Permissions Adds an additional meta box for the post/page editor that allows you to grant permissions for who can read the content based on the the user’s capabilities or role.
  • Login Widget Creates a widget that you can place in any widget area for users to log in from the front of your site by entering their username and password.
  • Shortcodes Provides a set of shortcodes that may be used to restrict or provide access to certain areas of your site from within the post editor (like the shortcodes I posted in Using shortcodes to show members-only content).
  • Template Tags Provides additional template tags for use within your WordPress theme for restricting or providing access to certain content.

What are your ideas?

I’ve given you a bit of what I have in mind for the initial release, but I’m not the only person that’ll be using this plugin. If you run a multi-user site, now’s the time to chime in. Tell me what you hate about the current system. Tell me what you’d like to see.

If you’re confused about anything in the post, feel free to ask me about it. I’ll try my best to explain.

Time frame? I hope to have some sort of beta out within the next week or two (I’ll definitely need some beta testers), but that depends on a lot of different factors. In short, it’ll be ready when it’s ready.