Setting Up Your Demo User (or Users)

The essence of a WordPress plugin demo is that it allows a demo user or users to login to the WordPress back-end, and run the plugin or plugins to be demonstrated.

So, the demo user or users you create must be WordPress users – as stored in the WordPress “users” table – and as created/managed by the demo site’s “admin” (from the “Users” option on the left hand menu of WordPress admin section screens).

Single Demo User

A single demo user – with the “Subscriber” role – should be all that’s required for most plugins.

To create this user; login as the demo site’s “admin”, and (from the “Users” option on the left hand menu of WordPress admin section screens); add a new user like (for example):-

First Name Demo or whatever else you want
Last Name User or whatever else you want
Username demo or whatever else you want
Password demo or whatever else you want
Role Subscriber Or any role that DOESN’T have the “manage_options” capability.  See The Demo User’s “Role” and The “manage_options” CAPABILITY, below…
Email <yours> Presumably you want emails (eg; login details and password changes, etc) to be sent to yourself.

More Complex Scenarios

Hopefully, the single demo user with the “Subscriber” role (described above), will be all that’s needed to get your plugin demo up and running.  And that demo user, once logged-in, will be able to run your plugin without problems.

But if this isn’t the case, we need to dig a little deeper into the WordPress “Roles and Capabilities” system, in order to understand how to fix things.

Fortunately, if the plugin demo doesn’t work properly (for the demo user with “Subscriber” role described above), then it’s probably because your plugin is either:-

  • Targeted at users with the “Contributor”, “Author” or “Editor” roles – or some other Custom role of your own creation – and/or;
  • Your plugin is “roles and capabilities” aware.  In other words, it makes use of WordPress “rolls and capabilities” functions like “current_user_can()” and “get_role()”, etc, etc.

In this case, the information presented below should help you to figure out how best to fix the problem.  And you should be able to fix the problem by simply giving your demo user (or users) the roles and capabilities required by your plugin.

The Demo User’s “Role”

Every WordPress user has a “role” – which describes what the user can and cannot do (in the WordPress back-end).  The standard WordPress roles are:-

Administrator Somebody who has access to all the administration features within a single site.
Editor Somebody who can publish and manage posts including the posts of other users.
Author Somebody who can publish and manage their own posts.
Contributor Somebody who can write and manage their own posts but cannot publish them.
Subscriber Somebody who can only manage their profile.

You can give the demo user any of the above roles, EXCEPT “Administrator” (see The “manage_options” CAPABILITY below, for why).

So a demo user can be either a “Subscriber”, “Contributor”, “Author” or “Editor”.  But from a security point of view, “Subscriber” is probably best (since this provides the most restrictions as to what the user can and cannot do in the WordPress back-end).

But it may be that the plugin you want to demo requires that the user be a “Contributor”, “Author” or “Editor”.  In which case, as far as WP Plugin Demos is concerned, it’s quite OK to upgrade them.

The “manage_options” CAPABILITY

WordPress users not only have “roles”, they also have “capabilities”.  Though more precisely, it’s the “roles” that have the “capabilities” – and the user has the capabilities assigned to it’s role.

And it’s the “manage_options” capability that’s important to understanding how WP Plugin Demos works.  Because when a user logs in, WP Plugin Demos has to choose which back-end screens the user should see.  It does this as follows:-

  1. If the user has the “manage_options” capability – in other words, if the user is an “Administrator” – WP Plugin Demos lets WordPress display the normal back-end screens for the user’s role.
  2. But if the user DOESN’T have the “manage_options” capability – in other words, if the user is a “Subscriber”, “Contributor”, “Author” or “Editor” – then WP Plugin Demos displays the very simple and stripped-down back-end screen reserved for “demo” users.

Questions?   Problems?   Clarification?   Help?

If you have any questions or need any clarification about setting up your demo users, please don’t hesitate to contact us on our Contact Form.

We monitor submissions regularly.  And should respond to most queries well within 24 hours.

Leave a Reply

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