'
. ''
. ''
. '';
}
/**
* @param mixed $user
* @return mixed
*/
public function honeypot_check( $user ) {
if ( empty( $_POST[ self::HONEYPOT ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
return $user;
}
$ip = Helper::get_ip_address();
Logger::log( 'login_honeypot', sprintf( 'Login honeypot tripped by %s.', $ip ), Logger::SEVERITY_WARNING, [ 'user_id' => 0, 'ip_address' => $ip ] );
if ( class_exists( '\GemSecurity\Security\BanList' ) ) {
BanList::record_strike( $ip, 'login honeypot' );
}
return new \WP_Error( 'gemsec_honeypot', __( 'Access denied.', 'gemsecurity' ) );
}
}