You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+8
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,14 @@ By default, all users must use a medium or greater strength password. This can b
82
82
83
83
**Password strength functionality requires the PHP extension [mbstring](https://www.php.net/manual/en/mbstring.installation.php) to be installed on the web server. Functionality will be bypassed if extension not installed.*
84
84
85
+
Additionally, the plugin checks passwords against the [Have I Been Pwned](https://haveibeenpwned.com/) database to ensure they haven't been compromised in a data breach. This can be disabled by defining the constant `TENUP_EXPERIENCE_DISABLE_HIBP` as `true`.
86
+
87
+
#### Constants
88
+
89
+
-`TENUP_EXPERIENCE_DISABLE_HIBP`
90
+
91
+
Define `TENUP_EXPERIENCE_DISABLE_HIBP` as `true` to disable Have I Been Pwned password checking.
$errors->add( 'password_reset_error', __( '<strong>ERROR:</strong> The password entered may have been included in a data breach and is not considered safe to use. Please choose another.', 'tenup' ) );
319
+
}
320
+
310
321
// Should a strong password be enforced for this user?
311
322
if ( $user_id ) {
312
323
@@ -374,4 +385,66 @@ public function enforce_for_user( $user_id ) {
374
385
375
386
return$enforce;
376
387
}
388
+
389
+
/**
390
+
* Check if password is secure by querying the Have I Been Pwned API.
391
+
*
392
+
* @param string $password Password to validate.
393
+
*
394
+
* @return bool True if password is ok, false if it shows up in a breach.
0 commit comments