* @link https://www.fireplugins.com * @copyright Copyright © 2026 FirePlugins All Rights Reserved * @license GNU GPLv3 or later */ namespace FireBox\Core\Analytics\Transformers; if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } class CountryTransformer implements TransformerInterface { public function shouldApply($type, $options = []) { return $type === 'countries'; } public function transform(&$data, $type, $options = []) { foreach ($data as &$item) { $item->code = $item->label; $item->label = \FPFramework\Helpers\CountriesHelper::getCountryName($item->label) ?? $item->label; } } public function getPriority() { return 50; } }