WP ise, temanızın bulunduğu yerdeki header.php dosyasına

    $ip_adresi = $_SERVER['REMOTE_ADDR'];
    if ( !file_exists("ip_bilgileri.txt")) {
        touch("ip_bilgileri.txt");
        $dosya = @fopen("ip_bilgileri.txt", "+r");
        @fclose($dosya);
        header( 'refresh: 1; url=/' );
    }
    else {
        $dosya = @fopen("ip_bilgileri.txt", "a");
        $deger = "#######################". "\r\n" . "Tarih : " . date('dd/mm/YY - H:i') . "\r\n" . "Ziyaretci IP Adresi :" . "\r\n" . $ip_adresi . "\r\n". "#######################" . "\r\n";
        @fwrite($dosya, $deger);
        @fclose($dosya);
    }
kodunu koyup deneyebilir misiniz?

Değerleri okuyacağınız yer https://site.nizin.adre.si/ip_bilgileri.txt

Eğer script hata verirse, header.php dosyasının bulunduğu yere "ip_bilgileri.txt" adında boş bir dosya koyun.