The 3.3.5 version of the plugin is now available in the wordpress.org repository as a beta release. This is primarily a fix and feature release, with some of the new features being “experimental” for full use in 3.4.0.
You can get the beta version from the wordpress.org repository by going to https://wordpress.org/plugins/wp-members/advanced/ and selecting “Development Version” from the dropdown selector in the “Advanced Options” section.
Another simple way to load the beta version is to use WP CLI. Use the command
wp plugin update wp-members --version=trunk. There are no database changes in this version, so if you need to roll back, you can use the command
wp plugin update wp-members --version=18.104.22.168
You can also get it on github. Note that the github version is always the “bleeding edge” update and may include updates (including debugging changes) so at any given time it may differ from the version on wordpress.org as official beta.
Here is an overview of what’s in this version:
New user confirmation link and password reset link
A long time coming, these features had been available as customizations. They are now included as an early adoption of what will become fully featured in version 3.4.0 of the plugin. The early release is so we can get some real-time use of the features and work out any unforeseen problems.
Both of these features current must be enabled from the plugin’s main Options tab.
For both features, the plugin will require some additional setup (at least for now) because it filters the email that goes to the user to insert the links. So you’ll want to change dialogs and email content to reflect what actually occurs on registration and password reset (i.e. don’t assume the default dialog/content makes sense when these are enabled).
For both processes, the plugin generates a validation link (either for account confirmation or password reset), and the link will expire in 6 hours from creation. This is filterable to make it longer or shorter, and we’ll be working to expand this in future versions.
Login error message
Another change that will become more standard in version 3.4.0 is the login error message. Since the plugin’s inception, it has used its own custom error message. The problem with this is that when additional plugins are used for authentication (such as captcha and such), the plugin’s login error does not always make sense for the additional authentication.
For now, like the activation link and password reset link, I’m including the ability to enable the new process. This will replace the plugin’s login error with the WordPress login error. I highly recommend that you begin to apply this as it will become the standard in a future release – tentatively version 3.4.0.\
Updates for Memberships
Fixed period expiration
There is a new property for memberships that allows you to create fixed expiration periods. For example, Sept 1 – Aug 31, or Jan 1 – Dec 31. These can be selected in the membership properties. There is also an optional “grace period” which can allow a time period prior to the beginning of the fixed period that a new user has access. For example, if the fixed period was Sept 1 – Aug 31 and the grace period was set as 1 month, then new users who registered in August would be set for the full period through the Aug 31 of the following year. Users who registered prior to the grace period window would expire in the current year. (This does not affect renewals as any renewing user would simply add 1 additional year to their current membership regardless of when they process it.)
New membership product restriction messages
The default product restricted message is being changed to have a single and multiple message. This will make the messaging make more sense if multiple membership possibilities are assigned to a specific post.
I have added hCaptcha as an option for registration. It is also callable from the Captcha object class so you can implement custom uses for the captcha.
Captcha API functions
Captchas can now be called statically. See the documentation for more information.
New filters, functions, and shortcodes
- [wpmem_loginout] can now accept a “format=button” attribute to make it return a button instead if a link.
- [wpmem_login_button] is an alias for [wpmem_loginout format="button"]
- API function wpmem_get_user_id() returns a user ID based on the user login or email.
- API function wpmem_get_user_obj() returns the user object for a user for either the user’s ID, username, or email.
- API function wpmem_get_users_by_meta() returns an array of user IDs based on a given meta (i.e. all users who have a specific meta key/value). Useful for finding groups of users by criteria.
- API function wpmem_get_pending_users() returns an array of user IDs who are not yet activated (pending).
- API function wpmem_get_activated_users() returns an array of user IDs of activated users.
- API function wpmem_get_deactivated_user() returns an array of user IDs of deactivated users.
- API function wpmem_activate_user() now accepts a “notify” argument so the function can be used to activate a user without sending an email notification to the user (useful for bulk activating users who you do not want to send an email to).
- New filter hook wpmem_is_user_activated in the wpmem_is_user_activated() API function. Useful for setting specific users/roles as always viewed as activated without needing to activate them (i.e. admins or specific user IDs).
- New filter hook wpmem_post_product allows post product requirement to be filtered. Useful for custom filtering groups of posts to require a specific membership without needing to set this requirement individually.
The new version of the plugin will add custom commands to the WP-CLI interface. If you’re unfamiliar with WP-CLI, this is the command line interface for WordPress. It is a very effective tool for managing sites – especially bigger sites and if you manage several.
The introduction of WP-CLI into the plugin is at this point experimental and subject to change. Mostly, changes may be in form of specific command terms and command options. There is a list of initial commands being added in this version available in the documentation.
Additionally, WP-CLI commands will be added to various plugin extensions. The Download Protect, PayPal Subscriptions, and Security extensions have commands that extend this initial command set further.