WooCommerce password strength Change to 6 Char

Viewed 6288

Like everyone else the password strength gets alittle ridiculous for the customers to handle. so I used the following which REMOVED all password check ("1" is now a valid password)

function remove_wc_password_meter() {
wp_dequeue_script( 'wc-password-strength-meter' );
}
add_action( 'wp_print_scripts', 'remove_wc_password_meter', 100 );

it is a script based, is there a way not touching the script to make it only require atleast 6 char?

2 Answers

I dont know why you removed

 add_filter( 'woocommerce_get_script_data', 'pwd_strength_meter_settings', 20, 2 );

function pwd_strength_meter_settings( $params, $handle  ) {

if( $handle === 'wc-password-strength-meter' ) {

    $params = array_merge( $params, array(

        'min_password_strength' => 2,
        'i18n_password_error' => 'Do not you want to be protected? Make it stronger!',
        'i18n_password_hint' => ' Please make your password <strong>at least 8 characters</strong> long , For more security use a mix of <strong>UPPER</strong> and <strong>lowercase</strong> letters, <strong>numbers</strong>, and <strong>symbols</strong>'
    ) );


}
return $params;

}
Related