WordPress.org

Ready to get started?Download WordPress

Plugin Reviews

User IP

User IP - Simply display visitor IP Address on post or page with a shortcode.

Average Rating
4 stars
4.7 out of 5 stars
4 stars
Nice and Simple
By , for WP 3.8.1

There is a problem looking up IP addresses that are behind a proxy. The following update to the "display_user_ip" ensures that you get the correct IP address even if it is behind a proxy.

// shortcode [user_ip]
function display_user_ip()
{
$user_ip = $_SERVER['REMOTE_ADDR'];
$proxy = $_SERVER["HTTP_X_FORWARDED_FOR"];
if(ereg("^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$",$proxy))
$user_ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
return $user_ip;
}

You must log in to submit a review. You can also log in or register using the form near the top of this page.