Plugin Directory

Changeset 2041631


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

tested with latest WP version

Location:
show-visitor-ip/tags/5.0
Files:
2 edited

Legend:

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

    r1721365 r2041631  
    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/tags/5.0/show-visitor-ip.php

    r1721360 r2041631  
    1919  return apply_filters('wpb_get_ip', $ip);
    2020 }
    21  add_shortcode('show_ip', 'show_visitor_ip');
    22  
     21 add_shortcode('show_ip', 'show_visitor_ip');
    2322 
    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'];
    2927
    30 
    31     if(filter_var($client, FILTER_VALIDATE_IP)){
    32        
    33         $ip = $client;
    34 
     28    if(filter_var($client, FILTER_VALIDATE_IP)){       
     29       $ip = $client;
    3530    }elseif(filter_var($forward, FILTER_VALIDATE_IP)){
    36 
    37         $ip = $forward;
    38 
     31       $ip = $forward;
    3932    } else {
    4033        $ip = $remote;
     
    4639      $svip_ltype = $svip['type'];
    4740     
    48     if($ip_data && $ip_data->geoplugin_countryName != null){
    49        
     41    if($ip_data && $ip_data->geoplugin_countryName != null){       
    5042     if($svip_ltype == 'countryCode'){
    5143       $svip_data = $ip_data->geoplugin_countryCode;
     
    6153       $svip_data = $ip_data->geoplugin_countryName;
    6254     }
    63 
    6455    }
    6556
    6657    return $svip_data;
    67  }
    68 
     58 }
    6959 add_shortcode('svip_location', 'show_visitor_locationByIp');       
    7060?>
Note: See TracChangeset for help on using the changeset viewer.