diff --git a/simple-analytics.php b/simple-analytics.php index 3c253cd..97813a0 100644 --- a/simple-analytics.php +++ b/simple-analytics.php @@ -29,6 +29,7 @@ * @note Manual loading rather than Composer to avoid potential conflict with plugins/themes that ship older autoloader. */ require __DIR__ . '/src/Support/SvgIcon.php'; +require __DIR__ . '/src/Support/IpAddress.php'; require __DIR__ . '/helpers.php'; require __DIR__ . '/src/Plugin.php'; require __DIR__ . '/src/WordPressHooks.php'; diff --git a/src/Settings/Blocks/Fields/IpList.php b/src/Settings/Blocks/Fields/IpList.php index ceb34e0..97e2c6c 100644 --- a/src/Settings/Blocks/Fields/IpList.php +++ b/src/Settings/Blocks/Fields/IpList.php @@ -3,6 +3,7 @@ namespace SimpleAnalytics\Settings\Blocks\Fields; use SimpleAnalytics\Setting; +use SimpleAnalytics\Support\IpAddress; use SimpleAnalytics\Settings\Concerns\HasDocs; use SimpleAnalytics\Settings\Concerns\HasPlaceholder; use SimpleAnalytics\UI\LabelComponent; @@ -34,7 +35,7 @@ public function getValueType(): string public function render(): void { $value = implode("\n", Setting::array($this->getKey())); - $currentIp = $_SERVER['REMOTE_ADDR']; + $currentIp = IpAddress::current(); ?> +