Page 1 of 1

Password Strength Indicator broken

PostPosted: June 15th, 2011, 4:23 pm
by toddz88
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?

Re: Password Strength Indicator broken

PostPosted: June 15th, 2011, 9:03 pm
by Cristián Lávaque
Is that in the standard WordPress profile page or a custom one?

Re: Password Strength Indicator broken

PostPosted: June 16th, 2011, 12:10 am
by toddz88
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

Re: Password Strength Indicator broken

PostPosted: June 16th, 2011, 12:21 am
by Cristián Lávaque
I'm very glad you solved it. And thanks for sharing that. :)

Re: Password Strength Indicator broken

PostPosted: August 21st, 2011, 5:05 pm
by annabwashere
toddz88, where do you put that code?