Plugin Directory

Changeset 1833881


Ignore:
Timestamp:
03/05/2018 04:24:32 PM (8 years ago)
Author:
xtrsyz
Message:

Wordpress Update

Location:
xt-visitor-counter/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • xt-visitor-counter/trunk/readme.txt

    r1693031 r1833881  
    44Tags: Visitor counter, visitor traffic, traffic statistics, traffic counter, blog stats, blog traffic, traffic count
    55Requires at least: 3.0.1
    6 Tested up to: 4.8
     6Tested up to: 4.9.4
    77Stable tag: trunk
    88License: GPLv2 or later
  • xt-visitor-counter/trunk/xt-visitor-counter-options-general.php

    r1693031 r1833881  
    1818                <input name="mv_cr_section_color" type="text" id="mv_cr_section_color" value="#ffffff" data-default-color="#ffffff"/>
    1919                <script type="text/javascript">
    20                 jQuery(document).ready(function($) {
     20                jQuery(document).ready(function($) {   
    2121                    $('#mv_cr_section_color').wpColorPicker();
    22                 });
     22                });             
    2323                </script>
    2424            </div>
    2525        </div>
     26       
    2627        <div class="xtvc_plugins_text">
    2728            <div class="xtvc_option_wrap">
     
    7980            foreach ($groups as $style_name => $style) {
    8081?>
    81 
     82                   
    8283                    <p><b>Choose one of the <?php echo $style_name; ?> counter styles below:</b></p>
    8384                        <table class="form-table">
     
    8788                        <tr>
    8889                        <td>
    89                         <input type="radio" id="img1" name="xtvc_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')) ?> />
    9091                        <img src='<?php echo WP_PLUGIN_URL?>/xt-visitor-counter/styles/<?php echo $style_name . '/' . $name . '/'; ?>0.gif'>
    9192                        <img src='<?php echo WP_PLUGIN_URL?>/xt-visitor-counter/styles/<?php echo $style_name . '/' . $name . '/'; ?>1.gif'>
     
    9899                }
    99100            ?>
    100 
     101         
    101102          </table>
    102 
     103         
    103104<?php
    104105            }
    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>
    106108        <p style="margin-top:20px;" >
    107109        <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
  • xt-visitor-counter/trunk/xt-visitor-counter-widgets.php

    r1612500 r1833881  
    5858        $stime = isset($instance['server_time']) ? $instance['server_time'] : false ; // display server time
    5959        $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');
    6162        $align = $instance['xtvc_align'];
    6263        $todayview = $instance ['today_view'];
     
    115116    }
    116117    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);
    118119    }
    119120    //image
     
    128129    //style and widgetne
    129130
    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__ ) ."' />";
    131132   
    132133    if ($align) $align = "text-align: $align;";
     
    174175    <div id="xtvcdate">Server Time: <?php echo $date ?></div>
    175176    <?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 } ?>
    177180    </div>
    178181    <?php
  • xt-visitor-counter/trunk/xt-visitor-counter.php

    r1693031 r1833881  
    44Plugin URI: http://xtrsyz.org/
    55Description: XT Visitor Counter is a widgets which will display the Visitor counter and traffic statistics on WordPress.
    6 Version: 1.2
     6Version: 1.3
    77Author: Satria Adhi
    88Author URI: http://xtrsyz.org/
     
    1111if ( ! function_exists( 'xt_getRealIpAddr' ) ) {
    1212    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;
    4719                    }
    48                 }
    49                     if (!$private_ip)
    50                 {
    51                     $ipAddr = $ip;
    52                     break;
    5320                }
    5421            }
    5522        }
    56         elseif (!empty($_SERVER['HTTP_FROM']))
    57         {
    58             $ipAddr = $_SERVER['HTTP_FROM'];
    59         }
    60         else
    61         {
    62             $ipAddr=$_SERVER['REMOTE_ADDR'];
    63         }
    64         return $ipAddr;
    6523    }
    6624}
     
    10159
    10260function 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');
    10463    add_options_page('Plugin Stats XT', 'XT Visitor Counter', 1, 'xtvc_options_general', 'xt_visitor_counter_option');
    10564}
     
    12079
    12180function 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);
    12584}
    12685
Note: See TracChangeset for help on using the changeset viewer.