matcher = $matcher; } public function is_password_change_required( \WP_User $user, array $settings ): bool { return false; } public function evaluate( string $password, $user ) { return $this->get_password_strength( $user, $password ); } public function validate( $evaluation, $user, array $settings, array $args ) { if ( (int) $evaluation === 4 ) { return true; } if ( ! $user = get_userdata( $user->ID ) ) { return true; } $target = $args['target'] ?? User_Groups\Match_Target::for_user( $user ); if ( ! $this->matcher->matches( $target, $settings['group'] ) ) { return true; } return $this->make_error_message(); } public function get_reason_message( $evaluation, array $settings ): string { return $this->make_error_message(); } public function is_always_enabled(): bool { return false; } public function should_evaluate_if_not_enabled(): bool { return true; } public function get_meta_key(): string { return \ITSEC_Strong_Passwords::STRENGTH_KEY; } public function render( \ITSEC_Form $form ) { ?>