Closed marcin-firmanty-finelf closed 1 year ago
I found a bug while using this plugin on hostings associated with cloudflare. The unique clicks functionality does not work properly due to the way cloudflare passes the IP address.
This problem is significant for me and for everyone using similar hosting (e.g. rocket.net) research: https://stackoverflow.com/questions/14985518/cloudflare-and-logging-visitor-ip-addresses-via-in-php
I checked that possible solution may be like this:
$ip = $_SERVER['REMOTE_ADDR']; // Cloudflare CDN Fix: if ($httpCFconnectingIp = ($_SERVER['HTTP_CF_CONNECTING_IP'] ?? null)) { $ip = $httpCFconnectingIp; // End Cloudflare CDN Fix } elseif ... rest of code
wordpress 6.1 on rocket.net (checked on 5 different installations)
Thanks for letting me know. This has now been included in version 5.4.4
@kamalkhan I sent you an email. Please check 🙏
Detailed description
I found a bug while using this plugin on hostings associated with cloudflare. The unique clicks functionality does not work properly due to the way cloudflare passes the IP address.
Context
This problem is significant for me and for everyone using similar hosting (e.g. rocket.net) research: https://stackoverflow.com/questions/14985518/cloudflare-and-logging-visitor-ip-addresses-via-in-php
Possible implementation
I checked that possible solution may be like this:
$ip = $_SERVER['REMOTE_ADDR']; // Cloudflare CDN Fix: if ($httpCFconnectingIp = ($_SERVER['HTTP_CF_CONNECTING_IP'] ?? null)) { $ip = $httpCFconnectingIp; // End Cloudflare CDN Fix } elseif ... rest of code
Your environment
wordpress 6.1 on rocket.net (checked on 5 different installations)