With WooCommerce 2.5 a new feature has been added to the checkout page: the password strength meter.
If you allow customers to create an account from this page and they also choose their own password, they will see a password strength meter next to the password field.
Why is this useful?
The main reason is security.
If users select a strong password, not only are their accounts more secure, but also your website. Should someone get access to a user’s account with a weak password, they get access to much or all data on the website, compromising your security and users’ security as well.
I’ve heard many people complain about the strength meter. When it was added, we encountered an issue. If the password was not rated Strong, the ability to check out would be disabled. This resulted in less revenue for businesses, as customers would leave the website without purchasing anything. The WooCommerce Development Team applied a fix in version 2.5.1, so now everyone can check out, even with the weakest password. But some still complain.
So what to do?
You can completely remove the strength meter and restore the checkout process as it was before. To do this, add this function in your functions.php file in wp-content/themes/your-theme-name/:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wc_ninja_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} | |
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 ); |
Props to Caleb Burks for the snippet.
As I said, the strength meter is an incentive for users to use strong passwords and have safe accounts. Remove it at your own risk.
Update 16th Feb. 2016: Do you want to change only its labels? Check this post!
Update 16th May 2017: You can adjust the minimum strength of a password by using this snippet:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_min_password_strength', create_function( '', 'return 2;' ) ); |
The default minimum strength is 3, in the example I reduced it to 2.
Leave a Reply