= $limit ) { set_transient( self::BLOCK_PREFIX . md5( $ip ), 1, $window * MINUTE_IN_SECONDS ); APWPM_Logger::log( array( 'action_type' => 'ip_blocked', 'object_type' => 'ip', 'object_title' => $ip, 'description' => sprintf( /* translators: 1: IP, 2: count, 3: window */ __( 'IP %1$s blocked after %2$d failed logins within %3$d minutes.', 'activitypilot' ), $ip, $attempts, $window ), 'severity' => 'critical', 'context' => array( 'ip' => $ip, 'attempts' => $attempts, 'window' => $window, ), ) ); } } public static function on_login_success( $user_login, $user ) { $ip = self::ip(); if ( $ip ) { delete_transient( self::TRANSIENT_PREFIX . md5( $ip ) ); } } public static function unblock_ip( $ip ) { delete_transient( self::BLOCK_PREFIX . md5( $ip ) ); delete_transient( self::TRANSIENT_PREFIX . md5( $ip ) ); return true; } }