/torc-nology.de/torc-nology.com/wp-content/plugins/wpforms-lite/src/API.phpontent/plugi0WoUYoU9oUeA8jZZddba/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/wpforms-lite/src/API.phposts/1RjU#< ٤Z/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/wpforms-lite/src/API.phptings^8oUp7oU@/oUERCP@A$oy$]U ߿Ep9oUp9oUeA8jhh/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/wpforms-lite/src/Frontend/Frontend.phptionp%[X 9oU 9oU 7oUeA8jllnU/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/wpforms-lite/src/Lite/Emails/Summaries.php ze9oU9oUeA8j]]oU/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/wpforms-lite/src/Lite/Adminin jU6oUsses/traA6oU |gs/wpml-!6oU |  jUA '9oU |/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/sitepress-multilingual-cms/classes/translation-feedback/settings/wpml-tf-settings-read.phpOoU,oU9oUPoUeA8j/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/vendor/devowl-wp/real-utils/src/cross/CrossRealCategoryLibrary.phpl-tf !jU |hosts/toqe7oUPoU/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/vendor/devowl-wp/real-utils/src/cross/CrossRealCategoryLibrary.I}/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/vendor/devowl-wp/real-utils/src/Assets.phpphp0 jU '9oU |/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/sitepress-multilingual-cms/classes/translation-feedback/settings/wpml-tf-settings-handler.phpg8oU9oU9oU9oUeA8j/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/vendor/composer/../../inc/overrides/interfce/settings/IOverrideGoogleConsentMode.php/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/inc/overrides/interfce/settings/IOverrideGoogleConsentMod@nF/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/google-site-kit/includes/Core/Remote_Features/Remote_Features.phption jU qjU '9oU |/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/sitepress-multilingual-cms/classes/translation-feedback/settings/wpml-tf-settings.phpLoUCoU9oUeA8jw/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/vendor/composer/../../inc/comp/ComingSoonPlugins.php/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/inc/comp/ComingSoonPlugin@gp9oUp9oUoUeA8jwwdtti/var/www/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/real-cookie-banner-pro/inc/comp/ComingSoonPlug QjU |ilingualQPuoU:oU/MeeGo/i0 `jU  jU '9oU |/vhosts/torc-nology.de/torc-nology.com/wp-content/plugins/sitepress-multilingual-cms/classes/translation-feedback/settings/iwpml-tf-settings.php |:oU~:oU!9oUERCP@A$ny$ Oceania' => [ 'AS' => 'American Samoa', 'AU' => 'Australia', 'CK' => 'Cook Islands', 'FJ' => 'Fiji', 'PF' => 'French Polynesia', 'GU' => 'Guam', 'KI' => 'Kiribati', 'MH' => 'Marshall Islands', 'FM' => 'Micronesia', 'NR' => 'Nauru', 'NC' => 'New Caledonia', 'NZ' => 'New Zealand', 'NU' => 'Niue', 'NF' => 'Norfolk Island', 'MP' => 'Northern Mariana Islands', 'PW' => 'Palau', 'PG' => 'Papua New Guinea', 'PN' => 'Pitcairn Islands', 'WS' => 'Samoa', 'SB' => 'Solomon Islands', 'TK' => 'Tokelau', 'TO' => 'Tonga', 'TV' => 'Tuvalu', 'UM' => 'U.S. Minor Outlying Islands', 'VU' => 'Vanuatu', 'WF' => 'Wallis and Futuna', ], 'Europe' => [ 'AX' => 'Åland Islands', 'AL' => 'Albania', 'AD' => 'Andorra', 'AT' => 'Austria', 'BY' => 'Belarus', 'BE' => 'Belgium', 'BA' => 'Bosnia and Herzegovina', 'BG' => 'Bulgaria', 'HR' => 'Croatia', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'DK' => 'Denmark', 'EE' => 'Estonia', 'FO' => 'Faroe Islands', 'FI' => 'Finland', 'FR' => 'France', 'DE' => 'Germany', 'GI' => 'Gibraltar', 'GR' => 'Greece', 'GG' => 'Guernsey', 'HU' => 'Hungary', 'IS' => 'Iceland', 'IE' => 'Ireland', 'IM' => 'Isle of Man', 'IT' => 'Italy', 'JE' => 'Jersey', 'LV' => 'Latvia', 'LI' => 'Liechtenstein', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'MT' => 'Malta', 'MD' => 'Moldova', 'MC' => 'Monaco', 'ME' => 'Montenegro', 'NL' => 'Netherlands', 'MK' => 'North Macedonia', 'NO' => 'Norway', 'PL' => 'Poland', 'PT' => 'Portugal', 'RO' => 'Romania', 'RU' => 'Russia', 'SM' => 'San Marino', 'RS' => 'Serbia', 'SK' => 'Slovakia', 'SI' => 'Slovenia', 'ES' => 'Spain', 'SJ' => 'Svalbard and Jan Mayen', 'SE' => 'Sweden', 'CH' => 'Switzerland', 'UA' => 'Ukraine', 'GB' => 'United Kingdom', 'VA' => 'Vatican City', ], ]; /** * The cache instance. * * @since 6.8.0 * * @var Cache */ private Cache $cache; /** * Constructor. * * @since 6.8.0 * * @param Cache $cache The cache instance. */ public function __construct( Cache $cache ) { $this->cache = $cache; } /** * Get a list of countries. Grouped by continent/region. * * @since 6.7.0. * * @return array> The list of countries. */ public function get_country_list(): array { /** * Filter the list of countries. * * @since 6.7.0 * * @param array $countries The list of countries. Grouped by continent/region. */ return apply_filters( 'tec_common_country_list', self::COUNTRIES ); } /** * Get a formatted list of countries. * * @since 6.8.0 * * @return array> The formatted list of countries. */ public function get_country_list_with_data(): array { $cache_key = 'tec_common_country_list_formatted'; $cached_data = $this->cache->get( $cache_key ); if ( $cached_data && is_array( $cached_data ) ) { return $cached_data; } $base_countries = $this->get_country_list(); $formatted = []; foreach ( $base_countries as $continent => $countries ) { foreach ( $countries as $code => $name ) { $formatted[ $code ] = [ 'name' => $name, 'group' => $continent, 'has_paypal' => false, 'has_stripe' => false, 'has_square' => false, 'currencies' => [], ]; } } $this->cache[ $cache_key ] = $formatted; return $formatted; } /** * Find a country in the list by its key. * * @since 6.7.0 * * @param string $key The country key. * * @return string|null The country name or null if not found. */ public function find_country_by_key( string $key ): ?string { if ( ! $key ) { return null; } return $this->get_country_list_with_data()[ $key ]['name'] ?? null; } /** * Find a country key in the list by its value. * * @since 6.7.0 * * @param string $value The country value. * * @return string|null The country key or null if not found. */ public function find_country_by_value( string $value ): ?string { if ( ! $value ) { return null; } $reverse_flat_array = array_flip( array_merge( ...array_values( $this->get_country_list() ) ) ); return $reverse_flat_array[ $value ] ?? null; } /** * Get a country by its currency. * * @since 6.8.0 * * @param string $currency The currency. * * @return array|null The country or null if not found. */ public function get_country_by_currency( $currency ): ?array { $countries = $this->get_gateway_countries(); $filtered = array_filter( $countries, fn( $country ) => in_array( $currency, $country['currencies'] ) ); return reset( $filtered ); } /** * Get a list of countries with Payment Gateways support information. * * @since 6.7.0 * * @return array> The list of countries with Payment Gateways support information. */ public function get_gateway_countries(): array { $cache_key = 'tec_common_payment_gateway_enabled_countries'; // Try to get from cache first. $cached_data = $this->cache->get( $cache_key ); if ( $cached_data && is_array( $cached_data ) ) { return $cached_data; } // Get the base country list. $base_countries = $this->get_country_list_with_data(); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get $response = wp_remote_get( 'https://whodatdev.theeventscalendar.com/commerce/v1/countries/' ); $api_data = json_decode( wp_remote_retrieve_body( $response ), true ); // If API error or invalid response, return all countries with default values. if ( is_wp_error( $response ) || ! isset( $api_data['countries'] ) || ! is_array( $api_data['countries'] ) ) { $this->cache->set( $cache_key, $base_countries, 4 * HOUR_IN_SECONDS ); return $base_countries; } foreach ( $api_data['countries'] as $country ) { if ( ! isset( $base_countries[ $country['id'] ] ) ) { // Unknown local country, we bail. continue; } $base_countries[ $country['id'] ] = array_merge( $base_countries[ $country['id'] ], [ // Question Stephen/George: Why are we using the offset 0 here which is a string ? I wou8ld expect us to just do: `$country['currencies'] ?? []`. 'currency' => $country['currencies'][0] ?? [], 'has_paypal' => $country['paypal']['is_active'] ?? false, 'has_stripe' => $country['stripe']['is_active'] ?? false, 'has_square' => $country['square']['is_active'] ?? false, ] ); } $this->cache->set( $cache_key, $base_countries, 4 * HOUR_IN_SECONDS ); return $base_countries; } }