WordPress Plugin – Custom Add User
I recently developed a WordPress plugin and published it on wordpress.org. The requirements for this plugin were completely customer-driven. While supporting a large 5000+ multisite installation at New York University, we often got complaints from our site admins (mostly faculties using our service for the course they are teaching) that they were having a difficult time adding users to their sites.
This WordPress plugin provides a completely customized experience for adding users with a single form for adding brand new users (single site or multisite installs) or existing users (in multisite). The users can be added without them requiring account activation (which is useful in private multisite where authentication is handled by third-party systems such as Shibboleth/ LDAP). It also allows you to add
custom instructions for adding users to your site.
In a private multisite installation, you might often face two issues –
- If user authentication is handled by external authentication systems such as
Shibboleth, you don’t want the new user to be ‘
invited‘ to join your site or one of the sites in your network. Instead, you would like to send them a
welcome emailskipping the invitation part which requires them to click the link to activate their account. Since user authentication is not handled by WordPress, it doesn’t really make sense for WordPress to validate user activation.
- When a user (site admin) tries to add another user to a site, an invitation gets sent to the invited user. When that invitation
expires, the invited user cannot be added to a site for a time period as their username is on hold, which creates a lot of frustration for both – the site admin trying to add people to their site and users trying to access the site after the invitation has expired. Also until the invited user has accepted the invitation, no other site admins can add the same user to a different site in the multisite network.
- When a site admin adds a user to a site, the new user is also added to the
network userstable. If any site admin tries to add a user to other sites, they have to know if the user already exists in any of the other sites in the network, for which they might not even have access because only super admins can see the list of all users in the network. If the user already exists in the network and they try to add this user using the
'Add New User'form instead of
'Add Existing User'form, they will get an error saying the user already exists and vice versa. This leads to a lot of confusion among site admins as they have no idea if the user they are trying to add is a brand new or an existing user in the multisite installation.
This plugin addresses all the above issues by –
Skippingthe invitation (activation link) email and automatically adding the user to the site instantly. A welcome email is sent as soon as site admin adds the user. (You can customize the text of
Welcome emailfrom network settings screen.)
Hidingthe ‘Add existing User’ form, so that site admins only see one form for adding users.
Handlingthe ‘brand new user’ vs ‘existing user’ issue in the back-end after site admin submits the form. If the user doesn’t exist, the plugin will create a new user and add it to the site. If the user already exists, it will add the user to the site.
This plugin helped NYU Web Publishing Service allow its individual site admins (mostly faculties) to add users (students) to their course site through a single form