WordPress Client Login Plugin

3rd November 2011
By

This plugin is NOT working on 3.5!

The Electric Studio Client Plugin is a WordPress plugin for creating a password protected client area on your website. You can add clients to groups, and give them access to their area only.

It’s available from the WordPress plugin repository. To install, please just search for it in your WordPress admin interface and install like any other plugin.

Client Login MenuThis plugin allows you to do the following things:

  • Add users of role ‘Client’
  • Groups Clients together
  • Restricted content to a user or group
  • Add custom fields to Clients.


Jump to section:

After installing the plugin, you should find the following menu in your WordPress panel as shown on right.

Clients Area

To go to the general plugin options, click on ‘Clients Area’ . This will show you any general options available to the plugin. Currently, the only option that can be changed is the redirect location on logging out.

More options will be added to this section in later releases of the plugin

Group Management

Group Management

The group management section allows you to add, edit and remove groups. This is also where you can add or remove users to a group.

Add the bottom of this section all the existing groups are listed. To add or remove users to a group click the edit button.

Editing a group

Edit Group

When adding a user, just type their username and click on the result below to add. To remove, just click the ‘x’ next to the username listed.

N.B. Only users with role of ‘Clients’ can be added to a group.

Client Management

Client Management

Client Management

Here you can view all users with the role of ‘Client’ and see the groups in which they are a member. Click on the username will allow you to edit the user; this is in fact a link to WordPress’ edit user page.

Clicking on delete will take you to a page where you can delete the user.

Client Setup

This is were all custom fields can be added to users. See example below:

Client Setup

Client Setup

Each field that is added, will be added to the edit user page. You can add whatever fields you like

There fields will allow the data to be stored as user-meta and therefore can be retrieved in your WordPress template like any other user-meta.

Shortcodes and Restricting Content

The easiest way to restrict content is when creating/editing a post/page. There is a metabox (shown below) in which will make the post only accessible to users which are members of the selected groups. If no groups are selected, the post is viewable to everyone.

Restrict Groups Meta Box

Restrict Groups Meta Box

You can also use shortcodes to restrict content within a post/page:

  • Exclude content to all users not logged in:
  • [escl_logged_in]content[/escl_logged_in]
  • Show content to only one user:
  • [escl_logged_in user=”joebloggs”]content[/escl_logged_in]
  • Show content to only specific groups (if using multiple groups, they should be separated with a pipe (‘|’)):
  • [escl_logged_in group=”group1|group2″]content[/escl_logged_in]

Login Widget

This plugin comes with a widget that shows a login form if logged out, and shows a navigational menu when logged in (see below).

Logged in menu

Login Widget when logged in

Client Area/My Area

When the plugin is installed, it copies a template file (page-clientarea.php) to the theme directory. This is a file ready to be modified to show a Client’s personal area. The ‘My Area’ link in the widget will take a user to this page. You can also add this page to your site’s navigation using WordPress’ menu editor.

N.B. If you change your theme, you will need to either reinstall this plugin else copy the page-clientarea.php file from the old theme to the new theme.