WP-Members™ 2.6.4 bug fix release

The WP-Members™ 2.6.4 release is a bug fix release for the following:

  • User activation bug on individual user activation
  • Alignment on the login form between “Remember Me” and “Login”
  • Improper deprecation of the wpmem_generatePassword function

User Activation Bug

This particular bug was the primary reason for this release.  In the 2.6.3 release, some changes were included to the user activation process to better leverage WP functions.  The front end user registration had been updated some time ago to utilize the wp_insert_user, which among other things, hashes the password. When WP-Members™ was first built, WP used an MD5 hash but has since changed phpass. A password that was MD5 encrypted would be automatically updated to phpass when the user logged in, so this was not a critical issue, but it was one of those things that should be updated.

So in 2.6.3, as part of the rebuild of the bulk user management screen, I rebuilt the wpmem_a_activate_user function to use the wp_update_user function.  Like wp_insert_user, wp_update_user automatically hashes the password and overall allows us to update the user data with less lines of code.  This update worked fine for bulk activation of the users.  However, this same function is used by the individual user update page when activating a user, and in that instance the wp_update_user function would hang, resulting in a script timeout.

While I have been unable to determine why this would work for bulk users and not individuals, I was able to correct the problem by rolling back to using $wpdb->update to update the users.  Using wp_hash_password still allows us to take advantage of the phpass encryption, it’s just not done on the fly like wp_update_user.

There is an explanation of this in the wordpress.org support forums.

Login Form Alignment

This was not a bug, per se, but more of an annoyance.  Since the introduction of the new tabless forms, the alignment of the “Remember Me” checkbox and the Login button have had a <br> tag inserted between them.  This breaks the Login button to a new line.

The problem with this is that it was something that was being inserted by WordPress.  WP-Members™ would generate the form, but that was done before WP formatted the content.  For those of you unfamiliar with how WP formats, content, it automatically puts in breaks and paragraph tags for you, giving what should be nicely formatted HTML.

In this case, it was not so nice – and also not so easy to figure out how to circumvent the issue.  What I ended up doing was creating a filter that overrides the wptexturize process and have it leave a specific shortcode unformatted.  It only runs when the login form is generated and prevents WP from inserting the line break.

Improper Deprecation of wpmem_generatePassword

WP-Members™ has moved forward in its ability to protect the comments template without the addition of any code in the comments.php file.  Those of you that have used the plugin for awhile may remember having to put a code snippet into comments.php to manage this.

With the advancement of WP in the template area, this presented some problems is the user didn’t create their theme as a child theme (needing to reintroduce this snippet after upgrading WP) and, no offense, but there are a lot of users the simply do not understand that concept.  Secondly, it created a large number of support questions because non-technical users would run into problems with cutting and pasting a code snippet that they didn’t understand.

So with the introduction of more a more advanced comments.php on WP’s part, I was able to integrate the needed comment protection into the plugin without the need for additional code snippets in comments.php.

The problem is that not everyone updated their comments template when this function was fully deprecated in 2.6.  I understand that not everyone reads update announcements, most just hit the upgrade now link without thinking (or checking).  So there were a lot of users that unknowingly had a site that threw an undefined function error.  Easily fixed on their end, and since it comes in the comments, it just throws off the footer on pages that have comments and the user is not logged in, but bad form none-the-less.

So, to accommodate those users, I slipped the function back in.

Hopefully, that wraps up the needed fixes in the 2.6 series and we can now fully move on to the 2.7 project list.  2.7 will focus on building admin panels for customizing all of the email messaging that the plugin sends out.

Comments

  1. Kelly says

    I upgraded my WP-Members plugin, and I now I don’t have the sidebar widget anymore. Have you come across this? Any idea how I can get it back? It is really important that I have that.

    • says

      You don’t have it on the front end? Have you looked in the widget admin panel for it? It’s possible that it could be bumped to Available or Inactive Widgets during an upgrade, but it’s in the plugin so it shouldn’t not show up at all.

      • Kelly says

        Yeah, it isn’t available anywhere. I thought the same thing, and it isn’t showing up in Inactive or Available.

        • says

          That is quite strange – it is possible that something got hung up during the upgrade process. If you use the “upgrade automatically” option within WordPress, there are occasions where the process hangs and that can cause errors. If that’s the case, my suggestion would be doing a clean re-install of the plugin.

          To do that, you need to deactivate and delete the plugin, (deletion via the WP plugin’s panel will trigger the plugin’s uninstall file to clean out database settings); then you can reload the plugin either from within the admin panel or via FTP. It is a little extreme, but that may be your best bet.

          • Kelly says

            Okay, I just deactivated, deleted and manually uploaded to my server and nada. :( Any other ideas? Is there any way I can add a shortcode or anything to make a text widget work for me in the meantime?

          • Kelly says

            Also – I looked at my source code of my live site, and it shows some coding for the widget, but it isn’t appearing. It does show a display:none, would that have anything to do with it?

          • Kelly says

            hard to paste code here… let me try again and strip it down

            div class=”widget-description”
            div id=’widget-19_wp-members’ class=’widget’ style=”display:none;”

          • says

            hmmm… not sure where that style would be coming from… What version of WP is the site using?

            If you can execute code in a widget (such as a text widget), you can call it directly using

            <?php wpmem_inc_sidebar(); ?>
          • Kelly says

            So what I’ve realized the problem seems to be, when I pull the widget into my sidebar, I don’t have it in my available widgets anymore to pull into another sidebar. Has this been a problem for anyone else?

          • says

            The widget does need to be updated to allow for multiple instances, which it currently does not do. In the meantime, you can call the function directly with

            <?php wpmem_inc_sidebar(); ?>
  2. Ken S. says

    Chad,

    I just installed 2.6.4 for the first time, and it looks like a great plugin. However, a weird bug started cropping up in all my browsers (IE, FireFox, Chrome) that’s a real show-stopper: on WP-Members Settings, when I select Fields or Dialogs tabs, the page content flickers and then disappears! If I reload the page, it returns to the default– displaying the Options tab and content– but selecting the other tabs only shows a blank page.

    I restarted my computer, even deleted the plugin and reinstalled it, all to no avail. Any ideas?

    • says

      Sorry Ken, I have no idea what would cause that. It’s not a known issue in any of the browsers you mentioned and the admin interface has been relatively unchanged in that regard since version 2.4.x.

  3. Chris Ammon says

    Thank you for a great product. I’m having great success with 2.6.4, but have one question. We’ve had about 90 registrants, and only 4 have not been able to register, citing the same error. Each of them gets the “you must enter a valid email address” error, despite claiming they entered a valid address. As a quick check, I was able to register using one of those email addresses, so I can’t help but wonder if we’re looking at user-error, or browser-specific issues. In any case, I’m just wondering if anything occurs to you when I describe that one recurring problem. I know I’m not giving you much to go on. I’m not given access to ping these folks individually to really troubleshoot it one-on-one. We’re just manually adding them as users when we get that issue. Thanks.

    • says

      Hi Chris – thanks for the comments. I might tend to agree that the most likely issue is “user-error.” I don’t think it’s likely to be browser specific as it uses the WP function is_email to validate. I know WP isn’t perfect, but I’m going to err on the side of it being a pretty solid function ;-)

      BTW… the 2.7.1 release has some improvements to the validation process, but they are focused on some specific things going past is_email as opposed to stopping on it.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>