Title: [Plugin: FeedStats] Please update feedstats_get_ip()
Last modified: August 20, 2016

---

# [Plugin: FeedStats] Please update feedstats_get_ip()

 *  ResolvedPlugin Author [Ben](https://wordpress.org/support/users/benjaminwittorf/)
 * (@benjaminwittorf)
 * [14 years ago](https://wordpress.org/support/topic/plugin-feedstats-please-update-feedstats_get_ip/)
 * Hey there, thanks for the great plugins!
 * Because of this, I’m glad I can contribute a little. It looks like IP addresses
   aren’t recorded correctly and lead to lots of redundant entries that aren’t updated(
   last_time etc.) if you’re behind a reverse proxy.
 * I updated feedstats_get_ip() to
 *     ```
       function feedstats_get_ip() {
       	global $_SERVER;  
   
       	if (isset($_SERVER['REMOTE_ADDR'])) {
       		return($_SERVER['REMOTE_ADDR']);
       	} else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
       		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
       		$ip = explode(", ", $ip);
       		$ip = $ip[0];
       		return($ip);
       	} else if (isset($_SERVER['HTTP_CLIENT_IP'])) {
       		return($_SERVER['HTTP_CLIENT_IP']);
       	} else {
       		return($_SERVER['REMOTE_HOST']);
       	}
       }
       ```
   
 * Thank you so much!
 * – Ben
 * [http://wordpress.org/extend/plugins/feedstats-de/](http://wordpress.org/extend/plugins/feedstats-de/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-feedstats-please-update-feedstats_get_ip/#post-2762300)
 * included

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: FeedStats] Please update feedstats_get_ip()’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/feedstats-de.svg)
 * [FeedStats](https://wordpress.org/plugins/feedstats-de/)
 * [Support Threads](https://wordpress.org/support/plugin/feedstats-de/)
 * [Active Topics](https://wordpress.org/support/plugin/feedstats-de/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/feedstats-de/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/feedstats-de/reviews/)

## Tags

 * [feedstats](https://wordpress.org/support/topic-tag/feedstats/)
 * [IP](https://wordpress.org/support/topic-tag/ip/)
 * [remote ip](https://wordpress.org/support/topic-tag/remote-ip/)

 * 1 reply
 * 2 participants
 * Last reply from: [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-feedstats-please-update-feedstats_get_ip/#post-2762300)
 * Status: resolved