: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Check if valid authentication exists.
* @param array $atts array of attributes.
public static function is_valid( array $atts ) : bool
if ( !empty($_COOKIE['passster']) ) {
$input = esc_html( $_COOKIE['passster'] );
if ( self::is_valid_password( $input, $atts ) ) {
if ( isset( $atts['captcha'] ) ) {
if ( 'captcha' == $input ) {
// if nothing was correct.
* @param string $input given password to validate.
* @param array $atts given arguments to check.
public static function is_valid_password( string $input, array $atts ) : bool
if ( !empty($atts['password']) ) {
$hash = hash_hmac( 'sha256', esc_html( $atts['password'] ), get_option( 'passster_secure_key' ) );
if ( hash_equals( $hash, $input ) ) {