The WP-Members User List is getting a much needed major rebuild. This will result in the 2.0.0 version, bringing it up-to-date with the other 2.0 series extensions. It will be more object oriented and includes some new features.
New Features
Local Avatars
One much needed upgrade is the ability to handle local avatars (profile pictures). WordPress natively supports “gravatar,” which stands for “globally recognized avatar.” This is connected to your email address and if you have a gravatar, WP shows this as the avatar by default. So that has always been supported in the plugin.
But what if the user doesn’t have a gravatar? Or doesn’t want one? Or can’t figure out how to get one?
Previous versions allowed you to override WP’s avatar handling to use a WP-Members image upload field, and there was a customization to incorporate the WP User Avatar plugin. But those options required some customization of your setup.
Now you can support locally managed avatars for user profile images directly via the WP-Members user profile (shortcode [wpmem_profile]) just by enabling a setting in the plugin! When enabled, local avatars will add a link and screen to the [wpmem_profile] shortcode links to “manage profile image”.
If a user doesn’t upload a local image, it will fall back to the gravatar (if the user has one).
Profile Permalinks and Improved Profile Page
The other much desired change is the incorporation of “pretty” permalinks for the detailed user profile page. Previous versions used a query string to pass the user id (i.e. /profile-page/?uid=123). But let’s be honest – that’s just gross.
Text-based permalinks were possible but required some customization efforts. That put it out of reach for non-technical users.
Now you can turn on an option for permalinks and it will be handled automatically!!
There are two options – the user’s display name (WP-Members defaults this to the username, but it is customizable) OR the user’s first name / last name.
Note that if you are upgrading and you select one of these options, if you have a lot of users on the site it may take awhile to register the setting change. This is because it needs to add a meta key for each user’s permalink.
Note that first/last name permalinks are run through a WP function to clean the value for use in a URL. This will lowercase everything, remove non-URL acceptable entities (like umlauts or apostrophes), and will separate the names by hyphen.
All permalinks will go to a URL that looks like https://yoursite.com/your-user-list-page/profile/joe-smith/
The profile page has been improved as well. There is an automatic title filter that will replace page title with the user’s name (either display name or first/last name depending on permalink setting). I think that adds a nice polished touch that was missing in previous versions.
The profile page still uses the [wpmem_ul_profile] shortcode to display the profile detail, but you no longer are required to set the fields as a shortcode attribute! Fields for profile display can now by set by checkbox in the User List tab. This will make setup easier, cleaner, and easier to maintain/update.
For users who use a custom layout utilizing WP-Members’ [wpmem_field] shortcode, if you use a permalink setting, there is a new shortcode in the User List for you. [wpmem_ul_field] will replace [wpmem_field] for this purpose. [wpmem_field] can only get the user’s ID from the query string parameter “uid”. But in a permalink instance, this is not passed. So [wpmem_ul_field] will get the permalink value and convert it to the user’s ID. If this doesn’t make sense to you and/or you just use the [wpmem_ul_profile] to display the profile – don’t worry – this change doesn’t apply to you. But if you use the [wpmem_field] shortcode to create a custom profile for the User List, change the “wpmem_field” tag to “wpmem_ul_profile” and remove the id=”get” attribute.
New Filter(s)
There are some new filter hooks included, and some replace some that are out-dated and scheduled for deletion (more on that below).
One new filter hook is wpmem_ul_search_form_rows. This provides an array based assembly for the search form that can be filtered and customized as needed. It operates essentially the same as the wpmem_login_form_rows filter that allows you to customize the login, password, and forgot username forms in WP-Members.
Changes (some may require changes to your setup)
Certain filter hooks in the plugin will be deprecated in 2.0.0. They will remain as deprecated for now, but will be pending full removal at a later date. So while they will continue to work until full removal, it would be better for you to address it now rather than wait. Here’s a list of what is being removed:
- wpmem_ul_search_args
- wpmem_ul_nav_args
- wpmem_ul_settings_args
- wpmem_ul_list_args
- wpmem_ul_profile_args
The replacement version names are currently pending during the development process. So there will be more information forthcoming about what the replacement filters will be named. But you can begin the process now of determining if you’ll need to make any adjustments. (There will also be information on how to update these filters when the nomenclature of the new filters is decided.)
Another change is a clean-up of boolean values. Booleans are true|false, and there are some places in older versions where these are handled as strings (i.e. text “true” instead of the boolean 1). This is corrected in version 2. However, this may mean that if you use “true” or “false” values in a shortcode attribute you may need to check to see if you are doing it correctly.
There is a major fix to the user query for meta filtered list instances (when using meta_key and meta_value to display a filtered list). When paginating through multi-page search results in a filtered list, pages after 1 would lose the filtering and show full list search results. This is fixed in 2.0
Speaking of meta_key/meta_value filtered lists, pre-2.0, the pair was meta_key/meta_val. I discovered through the years of supporting the plugin that many people intuitively would use “meta_value” even if they read “meta_val” int he directions. So “meta_val” will be deprecated in favor of “meta_value”. If you filter your list via shortcode attributes, you’ll want to note this for when you upgrade. “meta_val” will remain backward compatible initially, but will be phased out at some point.
Another similar change is “show_titles”. This attribute will be changed to “show_labels” and will use the field’s form label to display next to the result. If you use settings via the admin panel you don’t need to do anything to adjust for this change, but if you have a “show_titles” attribute in the shortcode, you will want to update to “show_labels”. “show_titles” will be backward compatible for awhile, but will eventually be fully obsolete.
Options for prev/next or no navigation have been removed. It doesn’t seem to make sense to include those as options. All lists will use paginated navigation by default.
The “Member since” field date default format has been updated to use the date format in your WP settings. So whatever your date format setting is in WP, that’s what will be used. The format is still customizable via filter.
The plugin now uses a single stylesheet. You can load a custom stylesheet as desired, but there will be only one packaged default.
More To Come
This is just a data dump of everything I could think of regarding the 2.0 version. It’s still being worked on, tested, and debugged for release this month (June 2019). If you would like to test the upgrade and have a valid update license for the plugin, let me know and I’ll get you a copy for testing. Note that it is not yet production ready and there are some DB changes, so for the time being, consider your skill level for testing. You’ll need to know how to set up a test site (don’t use yet on live), run WP in debug mode, and be able to send me understandable bug reports. Once we get into the beta release stage, I’ll open it up for everyone.