Last month, I released a major update to WP-Members. It included a lot of behind-the-scenes features that push the plugin forward based on user requests.
Today, version 3.4.1 is being released with some improvements, bug fixes, and overall
Revision to membership hierarchy logic
Membership hierarchy is new in 3.4.x, and shortly after release, it became apparent that the logic it was released with was not as scalable as I had hoped for.
This isn’t a major issue except that if you have setup any “levels”, you will need to make some adjustments to them – namely, reversing the order.
Previously, the order was to make the higher levels children of the existing membership. For example, if you have Bronze, Silver, and Gold memberships, you would have made Silver a child of Bronze, and Gold a child of Silver.
The problem here is that you can’t stack multiple levels into a higher group. For example, maybe you have Bronze 1 and Bronze 2. Your Silver and Gold levels would only be able to access one of those.
Reversing the hierarchy solves this problem. So now, Silver is a child of Gold and Bronze is a child of Silver. Now you can have Bronze 1 and Bronze 2 that are exclusive (i.e. one cannot access the other), but if both are a child of Silver, then Silver can access both; and Gold can access all three.
I added a second feature to allow you to reverse the logic. This is the addition of a setting in the “Membership Attributes” meta box (where you would set the “parent” membership) that is noted as “Access by child membership”. Checking this box means that the logic is reversed. This can be useful if you want to create different expiration periods but only have to restrict content to a single membership.
I’ll be putting together a video this week to demonstrate how these can be set up and how you can use them.
Other changes
Most everything else is primary improvement and cleanup. Here’s a rundown:
- Changes the term “Product” to “Membership” throughout the interface. Originally, when I released memberships in the plugin, I intended them to be flexible “membership products” and referred to them with by the shortened “products”. However, this was not intuitive for users and calling them “memberships” seems to solve that. It’s just a text change – no features are being changed around this.
- Changing “Block” to “Restricted” (and “unblock” to “unrestricted”). The plugin has used the term “block” to refer to blocking post content since its inception (which was back in 2005 if you can believe that). When I added “hide” as an option, that seemed to create some confusion for some users. Users who have used the plugin for a long time (i.e. before “hide” was added) understood it, but for new users, they often wonder, “What’s the difference between ‘block’ and ‘hide'”? A valid question. Changing the terms used a little bit should help. Like the above, this is currently just a text change, but there will be some additional updates in the future for nomenclature of API elements, such as the function wpmem_is_blocked(). More on that as it comes to fruition.
- The email function can now directly handle attachments. This is probably too complicated to explain here, but I’ll be adding information in the documentation on it.
- Added a new API function – wpmem_is_user_current() to check user expiration of a given membership.
The remainder is general bug fixes and such:
- Fixes a bug in the user API for undefined variable when checking the user IP.
- Fixes a bug in 3.4.0 that cases an error in the user export process.
- Fixes a bug in 3.4.0 that causes the captcha validation to be run twice, resulting in failed captcha during registration.
- Fixes a CSS issue that caused a cursor change for instances of WP List Table (i.e. All Posts, All Pages, All Users, etc) that implied drag-and-drop functionality – it should only be shown on the WP-Members Fields table.
- Sanitizes email as email, not text during registration.
- Removes an overlooked use of wpmem_page_pwd_reset() which was deprecated in 3.4.0
- Moved all external libraries to “vendor” directory.