PHP code example of automattic / jetpack-password-checker
1. Go to this page and download the library: Download automattic/jetpack-password-checker library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
automattic / jetpack-password-checker example snippets
$tests = array(
'preg_match' => array(
'no_backslashes' => array(
'pattern' => '/^[^\\\\]*$/u',
'error' => __( 'Passwords may not contain the character "\".', 'jetpack' ),
'' => __( 'This is a very common password. Choose something that will be harder for others to guess.', 'jetpack' ),
'
use Automattic\Jetpack\Password_Checker;
$user = new WP_User( 1 );
$password_checker = new Password_Checker( $user );
$password_checker->test( '123', true );