Changeset 2685418
- Timestamp:
- 02/26/2022 07:13:55 PM (3 years ago)
- Location:
- show-visitor-ip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
show-visitor-ip/tags/5.0/readme.txt
r2432436 r2685418 3 3 Tags: ip address, country code, region, lat, long, city, country name, user, visitor, display, shortcode, vs, rockon 4 4 Requires at least: 3.0 5 Tested up to: 5. 65 Tested up to: 5.9 6 6 Stable tag: 1.0.01 7 7 License: GPLv2 or later -
show-visitor-ip/tags/5.0/show-visitor-ip.php
r2041631 r2685418 9 9 */ 10 10 11 function show _visitor_ip(){12 13 14 15 16 17 18 19 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); 20 20 } 21 add_shortcode('show_ip', 'show _visitor_ip');21 add_shortcode('show_ip', 'showVisitorIp'); 22 22 23 function show _visitor_locationByIp($svip){23 function showVisitorLocationByIp($svip){ 24 24 $client = @$_SERVER['HTTP_CLIENT_IP']; 25 25 $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; … … 54 54 } 55 55 } 56 57 56 return $svip_data; 58 57 } 59 add_shortcode('svip_location', 'show _visitor_locationByIp');58 add_shortcode('svip_location', 'showVisitorLocationByIp'); 60 59 ?> -
show-visitor-ip/trunk/readme.txt
r2432437 r2685418 3 3 Tags: ip address, country code, region, lat, long, city, country name, user, visitor, display, shortcode, vs, rockon 4 4 Requires at least: 3.0 5 Tested up to: 5. 65 Tested up to: 5.9 6 6 Stable tag: 1.0.01 7 7 License: GPLv2 or later -
show-visitor-ip/trunk/show-visitor-ip.php
r2041637 r2685418 9 9 */ 10 10 11 function show _visitor_ip(){12 13 14 15 16 17 18 19 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); 20 20 } 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){ 24 24 $client = @$_SERVER['HTTP_CLIENT_IP']; 25 25 $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; 26 26 $remote = @$_SERVER['REMOTE_ADDR']; 27 27 28 if(filter_var($client, FILTER_VALIDATE_IP)){ 28 29 $ip = $client; … … 38 39 $svip_ltype = $svip['type']; 39 40 40 if($ip_data && $ip_data->geoplugin_countryName != null){ 41 41 if($ip_data && $ip_data->geoplugin_countryName != null){ 42 42 if($svip_ltype == 'countryCode'){ 43 43 $svip_data = $ip_data->geoplugin_countryCode; … … 53 53 $svip_data = $ip_data->geoplugin_countryName; 54 54 } 55 56 55 } 57 58 56 return $svip_data; 59 } 60 add_shortcode('svip_location', 'show _visitor_locationByIp');57 } 58 add_shortcode('svip_location', 'showVisitorLocationByIp'); 61 59 ?>
Note: See TracChangeset
for help on using the changeset viewer.