automattic / jetpack-password-checker
密码检查器。
v0.3.2
2024-08-23 14:28 UTC
Requires
- php: >=7.0
Requires (Dev)
- automattic/jetpack-changelogger: ^4.2.6
- automattic/wordbless: @dev
- yoast/phpunit-polyfills: ^1.1.1
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
- dev-trunk / 0.3.x-dev
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- 0.1.0
- dev-prerelease
- dev-fix/slack-workflow-branch-detection
- dev-fix/release-branch-typo
- dev-update/generate-branch-plugin
This package is auto-updated.
Last update: 2024-09-18 03:17:47 UTC
README
密码检查器包。
使用方法
添加新的测试
$tests = array( 'preg_match' => array( 'no_backslashes' => array( 'pattern' => '/^[^\\\\]*$/u', 'error' => __( 'Passwords may not contain the character "\".', 'jetpack' ), 'required' => true, 'fail_immediately' => true, ), ), 'compare_to_list' => array( 'not_a_common_password' => array( 'list_callback' => 'get_common_passwords', 'compare_callback' => 'negative_in_array', 'error' => __( 'This is a very common password. Choose something that will be harder for others to guess.', 'jetpack' ), 'required' => true, ), ) ); $tests = apply_filters( 'password_checker_tests', $tests );
测试密码
use Automattic\Jetpack\Password_Checker; $user = new WP_User( 1 ); $password_checker = new Password_Checker( $user ); $password_checker->test( '123', true );
在您的WordPress插件中使用此包
如果您计划在WordPress插件中使用此包,我们建议您使用Jetpack Autoloader作为自动加载器。这将允许与其他使用此包的插件实现最大兼容性。
安全
需要报告安全漏洞?请访问https://automattic.com/security/或直接访问我们的安全漏洞赏金网站https://hackerone.com/automattic。
许可协议
jetpack-password-checker遵循GNU通用公共许可证第2版(或更高版本)