Last active
October 7, 2025 18:41
-
-
Save ipokkel/d28dc24a9ec8ab459959d2d40414ea43 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| /** | |
| * Set the minimum password score for the PMPro Require Strong Passwords Add On. | |
| * | |
| * 1 is somewhat guessable (guesses < 10^8), provides some protection from unthrottled online attacks | |
| * 2 is safely unguessable (guesses < 10^10), offers moderate protection from offline slow-hash scenario | |
| * 3 is very unguessable (guesses >= 10^10) and provides strong protection from offline slow-hash scenario | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmprosp_minimum_password_score( $min_strength, $password_strength ) { | |
| $custom_strength = 3; // Set the minimum password score here. | |
| if ( $min_strength !== $custom_strength ) { | |
| $min_strength = $custom_strength; | |
| } | |
| return $min_strength; // Set the minimum password score here. | |
| } | |
| add_filter( 'pmprosp_minimum_password_score', 'my_pmprosp_minimum_password_score', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment