Title: CF IP Issue
Last modified: March 17, 2021

---

# CF IP Issue

 *  [klaus04](https://wordpress.org/support/users/klaus04/)
 * (@klaus04)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/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..
    -  This topic was modified 5 years, 1 month ago by [klaus04](https://wordpress.org/support/users/klaus04/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [klaus04](https://wordpress.org/support/users/klaus04/)
 * (@klaus04)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cf-ip-issue/#post-14206487)
 * Also, please avoid loading your plugin JS and CSS on non-post pages (home page,
   category, tags, etc.)
 *  Plugin Support [Blaz K.](https://wordpress.org/support/users/blazk/)
 * (@blazk)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cf-ip-issue/#post-14208502)
 * Hi [@klaus04](https://wordpress.org/support/users/klaus04/),
 * Thanks for your useful suggestions. Feel free to make a PR on [GitHub](https://github.com/blaz-blazer/rate-my-post)
   with the proposed changes.
 * As for the latter, JS and CSS are loaded on every page because rating/results
   widgets can also be used on non-post pages. CSS and JS files also include code
   for top rated posts widget, star ratings on archive pages etc. Both files are
   35kb, without gzip compression, so they shouldn’t have a big impact.
 * Regards,
    Blaz

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘CF IP Issue’ is closed to new replies.

 * ![](https://ps.w.org/rate-my-post/assets/icon-128x128.png?rev=2045796)
 * [Rate My Post - Star Rating Plugin by FeedbackWP](https://wordpress.org/plugins/rate-my-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rate-my-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rate-my-post/)
 * [Active Topics](https://wordpress.org/support/plugin/rate-my-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rate-my-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rate-my-post/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Blaz K.](https://wordpress.org/support/users/blazk/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/cf-ip-issue/#post-14208502)
 * Status: not resolved