For the past few months, I have been working diligently on the next release of WP-Members. This release will continue improving and expanding the handling of forms and form fields that is the major focus of 3.1.
Today I am publicly announcing the alpha release of 3.1.7. The version released to GitHub is a stable release and includes some changes I am hoping people will begin using and testing now so they can be tested and ready for moving this version to beta and production release.
UPDATE: 3.1.7 is now out as the production release. There is another post that points out some key information on changes and how/if they affect you. I also added a similar topic to the wordpress.org forum.
There are a number of minor changes in this version, and I will address those at the end of this post with more detail. I want to feature more prominently here at the beginning three improvements that I feel are major changes that will be important to be used and tested in the wild so I can get feedback on their performance.
Two major changes I want to point out are (1) a change that allows plugins that add captchas to the wp-login.php to automatically be added to the front side login as well, and (2) a new filter function for handling form fields that are displayed or not displayed. I will be writing about these in much more detail as both are going to require more testing and user feedback before full implementation.
For now, here is the current list of changes:
* API updates: added wpmem_is_user_activated(). This will allow a direct test to see if a specific user is activated.
* API updates: wpmem_is_reg_page() added default of current page ID. This function checks to see if the page being registered on is the registration page or is some other page. It returns true if it is the identified registration page. This can be used for a number of utilities including redirecting the user if it is specifically the registration page.
* API updates: wpmem_current_url() added check for query string. This update makes the function more complete.
* API updates: Added wpmem_form_fields filter to wpmem_fields(). This is one of the big changes I’m excited about and will need feedback on. It is going to get a full post of its own to discuss it, but this filter will allow form fields to be added/removed on the fly which will allow you to easily change what fields are shown on the registration form vs user profile, what fields are required, etc. without the need to make things not required, unset rows and then have to remove the field labels, make current fields hidden so data wasn’t overwritten, etc. In short, it makes the fields used in forms much more dynamic and very easy to change on the fly as needed.
* All admin dependencies and actions/filters loaded in admin api object. In the past I’ve avoided this because I always wanted to only load functions that were needed when they were needed. But the plugin has grown to a more mature application and has outgrown that as an effective approach. Loading all dependencies at once means they are there when needed and makes custom use of API functions (or other functions directly) cleaner and safer.
* Corrected issue in forms function were RS Captcha had empty div wrapper variable. This is just an HTML improvement. But if you use Really Simple CAPTCHA on the register form AND you use a filter that uses str_replace() on any of the forms HTML, you should double check to make sure this change doesn’t affect your filter.
* Removed deprecated function wpmem_load_admin_js() and wpmem_test_shortcode(). These haven’t been used for quite some time. They are no longer used by the plugin, were not used by any extensions, and were never recommended to be used directly. Thus, they are being removed permanently.
* Added successful registration message on page if nonce validates (for reg redirects). This will allow you to handle register redirect better (I had previously rolled back support of register redirects until they could be improved) by allowing you to know the page has been loaded from a registration (as opposed to being accessed directly). That way you can add display of an appropriate message (such as successful registration) or not depending on how the page is loaded.
* Added User object class, handling login, logout, register. These functions have been moved into the new class and will continue to be improved upon.
* Added filter option in user export to decode html entities in user fields.
* Added a div wrapper for post restricted message. In most cases, this should be be an issue. However, if you use the wpmem_login_form filter with str_replace that includes making changes to the post restricted message, then you should check to see if this breaks your filter function or not. I think in the vast majority of cases this will not be a problem. On the plus side, this gives a good handle that can be used for layout/css to be applied.
* Added initial form support for HTML5 number input as well as min, max, title, and pattern attributes (placeholder attribute support was added in 3.1.6). I’ll be writing more on this later, but this adds the initial groundwork for additional HTML5 support in the plugin’s form fields. The addition of the pattern attribute will allow regular expressions directly in the form.
* Updated wpmem_admin_update() to exit if there is no user ID. This prevents errors in the user update process, especially if the function is called by an outside process that may not include this data point.
* Updated admin notification email to translate field labels.
* Updated login form links and filters to a single process (was one for each). The filters remain the same but the code is now more compact and much improved.
* Updated WP Registration finalize process. This improves the form validation for use of the WP native registration function (which may be used by other plugins, in addition to WordPress).
* Moved form building functions to forms object class.
* Deprecated wpmem_register_fields_arr filter (Use wpmem_fields instead).