WP-Members 3.2.1 was released primarily as a bug fix for items in 3.2. This is a discussion of what is included in this release with a little background and the change applied.
Duplicate ID in login form.
This addresses an issue reported via wordpress.org when the login form is displayed it resulted in two IDs as wpmem_login (one ID from the form’s div wrapper and one in the form tag itself). This was the result of a generic application of form IDs in 3.2 as an HTML5 improvement, getting rid of the “name” attribute” and replacing it with “id”. All form IDs were created by adding the form tag to the “wpmem_” stem, resulting in wpmem_login for the login form, but this was already being used.
The solution was to add the suffix “_form” to the generated form IDs. Since this change is a new feature, it made more sense to just correct it more directly rather than eliminate the legacy div, which does get used by a lot of users.
Form Validation and Excluded Fields
3.2 adds the username field to the fields array. In instances where the username is not used in the form (such as the dashboard profile update or native WP registration) since WP’s primary form is already handling username data, it was not being removed from consideration when the form data was validated and processed. This resulted in errors for dashboard profile updates as well as native WP registration showing that the username was a required field even though it was already there.
The solution was to update the excluded fields and make sure this was handled accordingly for these particular uses of the form fields.
Post Block Status
This was both a bug fix and an interface improvement.
The bug was a situation where if the post’s block status was opposite the default in the plugin’s settings, the status was set to the default if the post was updated without the block status being changed. You might have to read that twice to grasp it. The video from the bug report actually makes it easier to see.
The logic for handling post status update was reviewed and fixed to correct this.
While addressing this, there were also some reported confusion based on the interface of setting a post status with regards to what the existing post status was. In my opinion, this was primarily due to the addition of the “hide” option. Previously, it was a simple checkbox to set the post status to the opposite of the default plugin setting (i.e. if posts are blocked by default, checkbox to unblock). But now with three possibilities (block, unblock, hide), a dropdown was used.
Several users expressed confusion due to the wording and the present tense of the words used (i.e. “block” this post if the post was already blocked). So I decided to rework the interface to create a more intuitive user experience.
The default post setting was removed as it doesn’t really matter. It now just simply states the status of the post you’re working on. If posts are blocked by default, it will just say – this post is blocked. If you want to change the status from whatever the post is set as (default or otherwise), click the “edit” link and it will display possible settings. Choose the desired option, save, and update the post.
As part of this, I also changed the custom column in the All Posts screen. Previously, before the inclusion of icons, it would display “Yes” if the post was set to opposite the default. I never included “No” because it was easier from a visual standpoint to just see the key posts that were opposite the default setting chosen. The icons, since they use colors, make this more visual, so I changed the column to “Status” and display each post’s status as the appropriate icon for blocked, unblocked, and hidden.
[wpmem_field] Shortcode Clickable Attribute
3.2 added an attribute to the [wpmem_field] shortcode to make URLs and emails clickable links. At introduction in 3.2.0 this was “on” by default and could be turned off by setting clickable=false. I quickly realized this was less than ideal because it changes something for thousands of users – specifically making any use of displaying an email field a clickable link when either (a) that is not desired or (b) when maybe a link is already handled another way because the shortcode didn’t output the data as a link before. Since this is a subtle change, users may not notice it right away (if at all).
I have updated this to default to “off” instead. It’s a new feature, and no one is really using it yet, so switching the default shouldn’t affect anyone and actually makes it better for existing users (so it does not change any of their existing output). It can be turned on for any field by setting clickable=true (i.e. ]). Any field that contains a URL or an email will have that part of the text set as a clickable link.
New Export Filters
The new feature added in 3.2.1 is two filters in the export process – wpmem_user_export_header and wpmem_user_export_row. This change allows for filtering the exported data.
Primarily, this comes from a request to be able to export the URL of a file field rather than the actual data stored in the user meta which is the attachment ID. But it will lead to more expandable and flexible export customization.