Coder Social home page Coder Social logo

automattic / jetpack-password-checker Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 99 KB

[READ ONLY] Password Checker. This repository is a mirror, for issue tracking and development head to: https://github.com/automattic/jetpack

License: Other

PHP 100.00%

jetpack-password-checker's Introduction

Password Checker

Password Checker package.

Usage

Add a new test:

$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 );

Test a password:

use Automattic\Jetpack\Password_Checker;

$user = new WP_User( 1 );
$password_checker = new Password_Checker( $user );
$password_checker->test( '123', true );

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

jetpack-password-checker is licensed under GNU General Public License v2 (or later)

jetpack-password-checker's People

Contributors

adimoldovan avatar anomiex avatar coder-karen avatar dhasilva avatar gogdzl avatar gravityrail avatar ice9js avatar jeherve avatar jwebbdev avatar kbrown9 avatar kraftbj avatar mdbitz avatar nunyvega avatar paulopmt1 avatar psealock avatar samiff avatar sdixon194 avatar simison avatar tbradsha avatar thingalon avatar vedanshujain avatar yansern avatar zaerl avatar zinigor avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.