Settings::get_secret_key(), 'response' => $token, ]); return is_bool($result) ? $result : false; } public static function process(string $token, WP_Error|null $errors = null): WP_Error { if (is_null($errors)) $errors = new WP_Error(); if (!Settings::is_connected()) return $errors; if (empty($token)) { $errors->add(self::ERROR_EMPTY_TOKEN, Plugin::__('Please complete CAPTCHA verification.')); } else if (!API::verify($token)) { $errors->add(self::ERROR_INVALID_CAPTCHA, Plugin::__('Your answer was incorrect - please try again.')); } return $errors; } }