Forked from ipokkel/pmpro-require-strong-password-minimum-strength.php
Last active
October 13, 2025 11:21
-
-
Save kimwhite/9d7a26ebe54fed3ea43e52588a7b786d to your computer and use it in GitHub Desktop.
increase the minimum password strength required during membership checkout or signup
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 | |
| /** | |
| * Require a Stronger Password Score for Member Registration | |
| * | |
| * This recipe works with the PMPro Require Strong Passwords Add On to increase | |
| * the minimum password strength required during membership checkout or signup. | |
| * | |
| * | |
| * It also customizes the message shown to members when their password is rejected. | |
| * | |
| * Score Reference: | |
| * 0 = very weak | |
| * 1 = weak | |
| * 2 = medium | |
| * 3 = strong | |
| * | |
| * Add this code to a custom plugin or a snippet manager plugin such as Code Snippets. | |
| * See: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| /** | |
| * Set the minimum acceptable password score to 3 (strong). | |
| */ | |
| function my_pmprosp_minimum_password_score( $min_strength, $password_strength ) { | |
| $min_strength = 3; // Require strong or very strong passwords. | |
| return $min_strength; | |
| } | |
| 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