WP Password Strength Meter
-
Hi, trying to incorporate wp password strength meter. It is the one you can see in dashboard/user/your profile. It’s not working (strength meter does nothing), but i’ll show you what i’ve done so far in hope someone can point me in the right direction. Thanks.
/* Found in my static page – taken from wp-admin/user-edit.php*/
<table class="form-table"> <?php wp_enqueue_script( 'password-strength-meter', ABSPATH . 'wp-content/themes/twentyten/js/password-strength-meter.js'); wp_enqueue_script( 'jquery' ); $show_password_fields = apply_filters('show_password_fields', true, $profileuser); if ( $show_password_fields ) : ?> <tr id="password"> <th><label for="pass1"><?php _e('New Password'); ?></label></th> <td><input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("Type your new password."); ?></span> <input type="password" name="pass2" id="pass2" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("Confirm your new password again."); ?></span> <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div> <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p> </td> </tr> </table> <?php endif; ?>
/* In my css file – taken from wp-admin/css/colors.classic.css */
#pass-strength-result{ background-color:#eee;border-color:#ddd!important; } #pass-strength-result.bad{ background-color:#ffb78c; border-color:#ff853c!important; } #pass-strength-result.good{ background-color:#ffec8b; border-color:#fc0!important; } #pass-strength-result.short{ background-color:#ffa0a0; border-color:#f04040!important; } #pass-strength-result.strong{ background-color:#c3ff88;border-color:#8dff1c!important; }
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘WP Password Strength Meter’ is closed to new replies.