Plugin Directory

Changeset 2685418


Ignore:
Timestamp:
02/26/2022 07:13:55 PM (3 years ago)
Author:
devikas301
Message:

tested with latest version

Location:
show-visitor-ip
Files:
4 edited

Legend:

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

    r2432436 r2685418  
    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: 5.6
     5Tested up to: 5.9
    66Stable tag: 1.0.01
    77License: GPLv2 or later
  • show-visitor-ip/tags/5.0/show-visitor-ip.php

    r2041631 r2685418  
    99*/
    1010
    11  function show_visitor_ip() {
    12       if(!empty($_SERVER['HTTP_CLIENT_IP'])){
    13        $ip = $_SERVER['HTTP_CLIENT_IP'];
    14       } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
    15        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    16       } else {
    17        $ip = $_SERVER['REMOTE_ADDR'];
    18       }
    19   return apply_filters('wpb_get_ip', $ip);
     11 function showVisitorIp(){
     12    if(!empty($_SERVER['HTTP_CLIENT_IP'])){
     13        $ip = $_SERVER['HTTP_CLIENT_IP'];
     14    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
     15        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
     16    } else {
     17        $ip = $_SERVER['REMOTE_ADDR'];
     18    }
     19    return apply_filters('wpb_get_ip', $ip);
    2020 }
    21  add_shortcode('show_ip', 'show_visitor_ip');
     21 add_shortcode('show_ip', 'showVisitorIp');
    2222 
    23  function show_visitor_locationByIp($svip){
     23 function showVisitorLocationByIp($svip){
    2424    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    2525    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
     
    5454     }
    5555    }
    56 
    5756    return $svip_data;
    5857 }
    59  add_shortcode('svip_location', 'show_visitor_locationByIp');       
     58 add_shortcode('svip_location', 'showVisitorLocationByIp');       
    6059?>
  • show-visitor-ip/trunk/readme.txt

    r2432437 r2685418  
    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: 5.6
     5Tested up to: 5.9
    66Stable tag: 1.0.01
    77License: GPLv2 or later
  • show-visitor-ip/trunk/show-visitor-ip.php

    r2041637 r2685418  
    99*/
    1010
    11  function show_visitor_ip() {
    12       if(!empty($_SERVER['HTTP_CLIENT_IP'])){
    13        $ip = $_SERVER['HTTP_CLIENT_IP'];
    14       } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
    15        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    16       } else {
    17        $ip = $_SERVER['REMOTE_ADDR'];
    18       }
    19   return apply_filters('wpb_get_ip', $ip);
     11 function showVisitorIp(){
     12    if(!empty($_SERVER['HTTP_CLIENT_IP'])){
     13        $ip = $_SERVER['HTTP_CLIENT_IP'];
     14    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
     15        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
     16    } else {
     17        $ip = $_SERVER['REMOTE_ADDR'];
     18    }
     19    return apply_filters('wpb_get_ip', $ip);
    2020 }
    21  add_shortcode('show_ip', 'show_visitor_ip');
    22   
    23  function show_visitor_locationByIp($svip){
     21 add_shortcode('show_ip', 'showVisitorIp');
     22 
     23 function showVisitorLocationByIp($svip){
    2424    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    2525    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    2626    $remote  = @$_SERVER['REMOTE_ADDR'];
     27
    2728    if(filter_var($client, FILTER_VALIDATE_IP)){       
    2829       $ip = $client;
     
    3839      $svip_ltype = $svip['type'];
    3940     
    40     if($ip_data && $ip_data->geoplugin_countryName != null){
    41        
     41    if($ip_data && $ip_data->geoplugin_countryName != null){       
    4242     if($svip_ltype == 'countryCode'){
    4343       $svip_data = $ip_data->geoplugin_countryCode;
     
    5353       $svip_data = $ip_data->geoplugin_countryName;
    5454     }
    55 
    5655    }
    57 
    5856    return $svip_data;
    59  } 
    60  add_shortcode('svip_location', 'show_visitor_locationByIp');       
     57 }
     58 add_shortcode('svip_location', 'showVisitorLocationByIp');       
    6159?>
Note: See TracChangeset for help on using the changeset viewer.