| | |
| | | <?php |
| | | namespace JVBase\integrations; |
| | | |
| | | use JVBase\meta\MetaManager; |
| | | use WP_Error; |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | |
| | | private string $theme = 'light'; |
| | | private string $size = 'normal'; |
| | | |
| | | public function __construct() |
| | | protected static array $instances = []; |
| | | public static function getInstance(?int $userID = null):self |
| | | { |
| | | $key = is_null($userID) ? 'base' : $userID; |
| | | if (!array_key_exists($key, self::$instances)) { |
| | | self::$instances[$key] = new self($userID); |
| | | } |
| | | return self::$instances[$key]; |
| | | } |
| | | |
| | | protected function __construct() |
| | | { |
| | | $this->service_name = 'cloudflare'; |
| | | $this->title = 'Cloudflare Turnstile'; |
| | |
| | | // Cloudflare Turnstile uses POST parameters, not headers |
| | | return []; |
| | | } |
| | | |
| | | protected function getApiUrl(string $endpoint, ?string $baseKey = null): string |
| | | { |
| | | // Only used for direct API calls, not through base class methods |
| | | return 'https://challenges.cloudflare.com/turnstile/v0/siteverify'; |
| | | } |
| | | } |