CF IP Issue
-
Good plugin, but couple of issues I want to report.
1. Instead of reporting the user’s IP, your plugin is reporting the Hosting server IP for Cloudflare sites. Consider using the following code –
private function get_user_ip() { foreach ( array( 'HTTP_CF_CONNECTING_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' ) as $key ) { if ( array_key_exists( $key, $_SERVER ) === true ) { foreach ( explode( ',', $_SERVER[$key] ) as $ip ) { $ip = trim( $ip ); if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) { return esc_attr( $ip ); } } } } return false; }2. Please consider storing
gethostbyaddr($ip)along with the IP. It’s useful.3. Please make Rate my Post Analytics table column’s width dynamic in nature. The page is distorted for IPv6 address. Also increase the width for post and time column and decrease width for ID and Rated column..
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘CF IP Issue’ is closed to new replies.