Changeset 1833881
- Timestamp:
- 03/05/2018 04:24:32 PM (8 years ago)
- Location:
- xt-visitor-counter/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (1 diff)
-
xt-visitor-counter-options-general.php (modified) (4 diffs)
-
xt-visitor-counter-widgets.php (modified) (4 diffs)
-
xt-visitor-counter.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xt-visitor-counter/trunk/readme.txt
r1693031 r1833881 4 4 Tags: Visitor counter, visitor traffic, traffic statistics, traffic counter, blog stats, blog traffic, traffic count 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 86 Tested up to: 4.9.4 7 7 Stable tag: trunk 8 8 License: GPLv2 or later -
xt-visitor-counter/trunk/xt-visitor-counter-options-general.php
r1693031 r1833881 18 18 <input name="mv_cr_section_color" type="text" id="mv_cr_section_color" value="#ffffff" data-default-color="#ffffff"/> 19 19 <script type="text/javascript"> 20 jQuery(document).ready(function($) { 20 jQuery(document).ready(function($) { 21 21 $('#mv_cr_section_color').wpColorPicker(); 22 }); 22 }); 23 23 </script> 24 24 </div> 25 25 </div> 26 26 27 <div class="xtvc_plugins_text"> 27 28 <div class="xtvc_option_wrap"> … … 79 80 foreach ($groups as $style_name => $style) { 80 81 ?> 81 82 82 83 <p><b>Choose one of the <?php echo $style_name; ?> counter styles below:</b></p> 83 84 <table class="form-table"> … … 87 88 <tr> 88 89 <td> 89 <input type="radio" id="img1" name="xt vc_style" value="<?php echo $style_name . '/' . $name; ?>" <?php echo checked($style_name . '/' . $name, get_option ('xtvc_style')) ?> />90 <input type="radio" id="img1" name="xt_visitor_counter_style" value="<?php echo $style_name . '/' . $name; ?>" <?php echo checked($style_name . '/' . $name, get_option ('xt_visitor_counter_style')) ?> /> 90 91 <img src='<?php echo WP_PLUGIN_URL?>/xt-visitor-counter/styles/<?php echo $style_name . '/' . $name . '/'; ?>0.gif'> 91 92 <img src='<?php echo WP_PLUGIN_URL?>/xt-visitor-counter/styles/<?php echo $style_name . '/' . $name . '/'; ?>1.gif'> … … 98 99 } 99 100 ?> 100 101 101 102 </table> 102 103 103 104 <?php 104 105 } 105 ?> 106 ?> 107 <p><?php _e('Show powered by XT Visitor Counter? '); ?> <input type="checkbox" class="checkbox" id="xt_visitor_counter_attribution" name="xt_visitor_counter_attribution" <?php echo checked('on', get_option ('xt_visitor_counter_attribution')); ?>/></p> 106 108 <p style="margin-top:20px;" > 107 109 <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> -
xt-visitor-counter/trunk/xt-visitor-counter-widgets.php
r1612500 r1833881 58 58 $stime = isset($instance['server_time']) ? $instance['server_time'] : false ; // display server time 59 59 $fontcolor= $instance['font_color']; 60 $style = get_option ('xtvc_style'); 60 $style = get_option ('xt_visitor_counter_style'); 61 $xtvc_attribution = get_option ('xt_visitor_counter_attribution'); 61 62 $align = $instance['xtvc_align']; 62 63 $todayview = $instance ['today_view']; … … 115 116 } 116 117 for ($i = 0; $i <= 9; $i++) { 117 $totviewsgbr = str_replace($i, "<img src='". WP_PLUGIN_URL ."/xt-visitor-counter/styles/$style/$i$ext' alt='$i'>", $totviewsgbr);118 $totviewsgbr = str_replace($i, "<img src='". plugins_url ("styles/$style/$i$ext" , __FILE__ ) ."' alt='$i'>", $totviewsgbr); 118 119 } 119 120 //image … … 128 129 //style and widgetne 129 130 130 echo "<link rel='stylesheet' type='text/css' href='". WP_PLUGIN_URL ."/xt-visitor-counter/styles/css/default.css' />";131 echo "<link rel='stylesheet' type='text/css' href='". plugins_url ("styles/css/default.css" , __FILE__ ) ."' />"; 131 132 132 133 if ($align) $align = "text-align: $align;"; … … 174 175 <div id="xtvcdate">Server Time: <?php echo $date ?></div> 175 176 <?php } ?> 176 177 <?php if ($xtvc_attribution) { ?> 178 <div id="xtvcattribution" <?php echo $style ?>><small>Powered By <a href="https://xtrsyz.org/" rel="nofollow">XT Visitor Counter</a></small></div> 179 <?php } ?> 177 180 </div> 178 181 <?php -
xt-visitor-counter/trunk/xt-visitor-counter.php
r1693031 r1833881 4 4 Plugin URI: http://xtrsyz.org/ 5 5 Description: XT Visitor Counter is a widgets which will display the Visitor counter and traffic statistics on WordPress. 6 Version: 1. 26 Version: 1.3 7 7 Author: Satria Adhi 8 8 Author URI: http://xtrsyz.org/ … … 11 11 if ( ! function_exists( 'xt_getRealIpAddr' ) ) { 12 12 function xt_getRealIpAddr() { 13 $ipAddr=$_SERVER['REMOTE_ADDR']; 14 if (!empty($_SERVER['HTTP_X_REAL_IP'])) 15 { 16 $ipAddr=$_SERVER['HTTP_X_REAL_IP']; 17 } 18 elseif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet 19 { 20 $ipAddr=$_SERVER['HTTP_CLIENT_IP']; 21 } 22 //to check ip is pass from proxy 23 elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) 24 { 25 // try to avoid using an internal IP address, its probably a proxy 26 $ranges = array( 27 '10.0.0.0/8' => array(ip2long('10.0.0.0'), ip2long('10.255.255.255')), 28 '127.0.0.0/8' => array(ip2long('127.0.0.0'), ip2long('127.255.255.255')), 29 '169.254.0.0/16' => array(ip2long('169.254.0.0'), ip2long('169.254.255.255')), 30 '172.16.0.0/12' => array(ip2long('172.16.0.0'), ip2long('172.31.255.255')), 31 '192.168.0.0/16' => array(ip2long('192.168.0.0'), ip2long('192.168.255.255')), 32 ); 33 foreach ($matches[0] AS $ip) 34 { 35 $ip_long = ip2long($ip); 36 if ($ip_long === false) 37 { 38 continue; 39 } 40 $private_ip = false; 41 foreach ($ranges AS $range) 42 { 43 if ($ip_long >= $range[0] AND $ip_long <= $range[1]) 44 { 45 $private_ip = true; 46 break; 13 foreach (['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'] as $key){ 14 if(array_key_exists($key, $_SERVER) === true){ 15 foreach (explode(',', $_SERVER[$key]) as $ip){ 16 $ip = trim($ip); // just to be safe 17 if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false){ 18 return $ip; 47 19 } 48 }49 if (!$private_ip)50 {51 $ipAddr = $ip;52 break;53 20 } 54 21 } 55 22 } 56 elseif (!empty($_SERVER['HTTP_FROM']))57 {58 $ipAddr = $_SERVER['HTTP_FROM'];59 }60 else61 {62 $ipAddr=$_SERVER['REMOTE_ADDR'];63 }64 return $ipAddr;65 23 } 66 24 } … … 101 59 102 60 function xt_visitor_counter_admin_menu() { 103 register_setting('xtvc_options_general', 'xtvc_style'); 61 register_setting('xtvc_options_general', 'xt_visitor_counter_style'); 62 register_setting('xtvc_options_general', 'xt_visitor_counter_attribution'); 104 63 add_options_page('Plugin Stats XT', 'XT Visitor Counter', 1, 'xtvc_options_general', 'xt_visitor_counter_option'); 105 64 } … … 120 79 121 80 function xt_visitor_counter_deactivation_hook(){ 122 global $wpdb;123 $sql = "DROP TABLE `". XT_VC_TABLE_NAME . "`;";124 $wpdb->query($sql);81 // global $wpdb; 82 // $sql = "DROP TABLE `". XT_VC_TABLE_NAME . "`;"; 83 // $wpdb->query($sql); 125 84 } 126 85
Note: See TracChangeset
for help on using the changeset viewer.