Plugin Directory

Changeset 2041637


Ignore:
Timestamp:
02/28/2019 04:19:49 PM (6 years ago)
Author:
devikas301
Message:

tested with latest WP version

Location:
show-visitor-ip/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • show-visitor-ip/trunk/readme.txt

    r1721366 r2041637  
    33Tags: ip address, country code, region, lat, long, city, country name, user, visitor, display, shortcode, vs, rockon
    44Requires at least: 3.0
    5 Tested up to: 4.8
    6 Stable tag: 1.0.001
     5Tested up to: 5.1
     6Stable tag: 1.0.01
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • show-visitor-ip/trunk/show-visitor-ip.php

    r1721360 r2041637  
    2020 }
    2121 add_shortcode('show_ip', 'show_visitor_ip');
    22  
    23  
     22 
    2423 function show_visitor_locationByIp($svip){
    25 
    2624    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    2725    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    2826    $remote  = @$_SERVER['REMOTE_ADDR'];
    29 
    30 
    31     if(filter_var($client, FILTER_VALIDATE_IP)){
    32        
    33         $ip = $client;
    34 
     27    if(filter_var($client, FILTER_VALIDATE_IP)){       
     28       $ip = $client;
    3529    }elseif(filter_var($forward, FILTER_VALIDATE_IP)){
    36 
    37         $ip = $forward;
    38 
     30       $ip = $forward;
    3931    } else {
    4032        $ip = $remote;
     
    6658    return $svip_data;
    6759 }
    68 
    6960 add_shortcode('svip_location', 'show_visitor_locationByIp');       
    7061?>
Note: See TracChangeset for help on using the changeset viewer.