Plugin Directory

Changeset 2973344


Ignore:
Timestamp:
09/30/2023 03:16:32 PM (18 months ago)
Author:
devikas301
Message:

Optimized the coding for better performance & fixed the region name issue, not appearing with mobile internet.

Location:
show-visitor-ip
Files:
6 added
2 edited

Legend:

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

    r2955804 r2973344  
    11=== Show Visitor IP ===
    22Contributors: devikas301
    3 Tags: ip address, country code, region, lat, long, city, country name, user, visitor, display, shortcode, vs, rockon
     3Tags: ip address, country code, region, lat, long, city, country name, user IP, visitor IP, display, shortcode, vs, rockon
    44Requires at least: 3.0
    55Tested up to: 6.3
     
    3535<code>[svip_location type="city"]</code>
    3636<code>[svip_location type="countryName"]</code>
     37<code>[svip_location type="timeZone"]</code>
     38<code>[svip_location type="currency"]</code>
    3739
    3840== Screenshots ==
     
    4749* initial release
    4850
     51= 5.1 - 30 September 2023 =
     52* Optimized the coding for better performance.
     53* Fixed the region name issue, not appearing with mobile internet.
     54
    4955== Upgrade Notice ==
    5056 
    51 There is no need to upgrade just yet.
     57This is a major security update of this plugin. Ensure to update for better performance.
  • show-visitor-ip/trunk/show-visitor-ip.php

    r2685418 r2973344  
    55Description: This plgin show the current user ip address & other location info by ip. Short-code [show_ip], [svip_location type="countryCode"] regarding another shortcode please check the plugin readme file or visit on plugin website.
    66Author: Vikas Sharma
    7 Version: 5.0
     7Version: 5.1
    88Author URI: https://profiles.wordpress.org/devikas301
    99*/
     
    3434    }
    3535
    36     $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));   
     36    $ip_data = @json_decode(file_get_contents("http://ip-api.com/json/".$ip.'?fields=status,country,countryCode,region,regionName,city,lat,lon,timezone,currency'));   
    3737         
    38       $svip_data = '';
    39       $svip_ltype = $svip['type'];
     38    $svip_data = '';
     39    $svip_ltype = $svip['type'];
    4040     
    41     if($ip_data && $ip_data->geoplugin_countryName != null){       
     41    if($ip_data && $ip_data->status == 'success'){     
    4242     if($svip_ltype == 'countryCode'){
    43        $svip_data = $ip_data->geoplugin_countryCode;
     43       $svip_data = $ip_data->countryCode;
    4444     } elseif($svip_ltype == 'region'){
    45        $svip_data = $ip_data->geoplugin_regionName;
     45       $svip_data = $ip_data->regionName;
    4646     } elseif($svip_ltype == 'lat'){
    47        $svip_data = $ip_data->geoplugin_latitude;
     47       $svip_data = $ip_data->lat;
    4848     } elseif($svip_ltype == 'long'){
    49        $svip_data = $ip_data->geoplugin_longitude;
     49       $svip_data = $ip_data->lon;
    5050     } elseif($svip_ltype == 'city'){
    51        $svip_data = $ip_data->geoplugin_city;
     51       $svip_data = $ip_data->city;
     52     } elseif($svip_ltype == 'timeZone'){
     53       $svip_data = $ip_data->timezone;
     54     } elseif($svip_ltype == 'currency'){
     55       $svip_data = $ip_data->currency;
    5256     } else {
    53        $svip_data = $ip_data->geoplugin_countryName;
     57       $svip_data = $ip_data->country;
    5458     }
    5559    }
Note: See TracChangeset for help on using the changeset viewer.