PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Password Strength Indicator broken

s2Member Plugin. A Membership plugin for WordPress®.

Password Strength Indicator broken

Postby toddz88 » June 15th, 2011, 4:23 pm

On my Edit-Profile page, the new Password Strength Indicator is not working correctly. Here's what i see:

GREY with "password strength indicator"
- on page load

RED with "Very weak"
- tab into Password-1 field, instantly (before typing).
- first 3 characters.

GREY with "Very weak"
- more than 3 chars (of a good password)
- tab into Password-2 field.

BROWN with "Mismatch"
- any chars entered, including the beginning of Password1.
- when chars fully and exactly match Password-1

(I have s2member+Pro v110606 on wp 3.1.3).
Anyone else having trouble with this?
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Password Strength Indicator broken

Postby Cristián Lávaque » June 15th, 2011, 9:03 pm

Is that in the standard WordPress profile page or a custom one?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Password Strength Indicator broken

Postby toddz88 » June 16th, 2011, 12:10 am

It's on a page that just uses the ShortCode [s2Member-Profile /] to display the form. But as usual, you got me thinking about it from another angle, and I figured out the problem.

I am HIDING two fields -- the Username and the DisplayName -- from the form, by using Hooks from s2m's profile-in.inc.php, to insert HTML comments around the rows.
Code: Select all
add_action('ws_plugin__s2member_during_profile_during_fields_before_username','ideal_hide_start',10);
add_action('ws_plugin__s2member_during_profile_during_fields_after_username','ideal_hide_end',10);
add_action('ws_plugin__s2member_during_profile_during_fields_before_display_name','ideal_hide_start',5);
add_action('ws_plugin__s2member_during_profile_during_fields_after_display_name','ideal_hide_end',5);

function ideal_hide_start ( $vars = array() ) {
   echo "<!--  \n";
}
function ideal_hide_end ( $vars = array() ) {
   echo " --> \n";
}

In troubleshooting this just now, I found that the hooks are ok, and even inserting a complete html comment (like <!-- test --> ) is ok, but wrapping the TRs as I'm doing it is what breaks the Password Strength Indicator, for some reason.

No big deal, though, since I can use jQuery to hide the TRs instead.
Code: Select all
// hide fields (the entire <tr>)
jQuery('#ws-plugin--s2member-profile-display-name').parent().parent().parent().hide(); // Display-Name field
jQuery('#ws-plugin--s2member-profile-login').parent().parent().parent().hide(); // Username field
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Password Strength Indicator broken

Postby Cristián Lávaque » June 16th, 2011, 12:21 am

I'm very glad you solved it. And thanks for sharing that. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Password Strength Indicator broken

Postby annabwashere » August 21st, 2011, 5:05 pm

toddz88, where do you put that code?
User avatar
annabwashere
Registered User
Registered User
 
Posts: 1
Joined: August 21, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 0 guests

cron