Changeset 2178611
- Timestamp:
- 10/23/2019 03:03:24 PM (6 years ago)
- Location:
- wp-visitors-widget
- Files:
-
- 1 added
- 11 edited
-
assets/banner-1544x500.png (modified) (previous)
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
assets/icon-512x512.png (modified) (previous)
-
assets/screenshot-2.png (added)
-
trunk/modules/functions.php (modified) (1 diff)
-
trunk/modules/hooks.php (modified) (1 diff)
-
trunk/modules/js/front.js (modified) (1 diff)
-
trunk/modules/shortcodes.php (modified) (19 diffs)
-
trunk/modules/widgets.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp-visitors-widget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-visitors-widget/trunk/modules/functions.php
r2039598 r2178611 59 59 $slot_3_end = time() - 1*30*60*60; 60 60 $slot_3_amount = $wpdb->get_var("SELECT COUNT(*) FROM $visitors_stat WHERE time BETWEEN $slot_3_begin AND $slot_3_end "); 61 $out_array[] = array( '', (int) slot_3_amount );61 $out_array[] = array( '', (int)$slot_3_amount ); 62 62 63 63 $slot_4_begin = time() - 1*30*60*60; -
wp-visitors-widget/trunk/modules/hooks.php
r2039598 r2178611 3 3 function wvw_init( ) { 4 4 global $wpdb; 5 5 6 6 $visitors_stat = 'visitors_stat'; 7 7 $visitors_stat = $wpdb->prefix.$visitors_stat; 8 9 $wpdb->insert( 10 $visitors_stat, 11 array( 12 'time' => time(), 13 'ip' => $_SERVER['REMOTE_ADDR'] 14 ), 15 array( 16 '%s', 17 '%s' 18 ) 19 ); 8 session_start(); 9 10 if( !$_SESSION['visit_trace_ip'] ){ 11 12 session_start(); 13 $_SESSION['visit_trace_ip'] = $_SERVER['REMOTE_ADDR']; 14 $wpdb->insert( 15 $visitors_stat, 16 array( 17 'time' => time(), 18 'ip' => $_SERVER['REMOTE_ADDR'] 19 ), 20 array( 21 '%s', 22 '%s' 23 ) 24 ); 25 } 20 26 21 27 } -
wp-visitors-widget/trunk/modules/js/front.js
r2039598 r2178611 20 20 var options = { 21 21 title: { position: 'none' }, 22 backgroundColor: { 23 fill:'transparent' 24 }, 22 25 curveType: 'function', 23 26 legend: { position: 'none' }, 24 27 hAxis: { 25 baselineColor: ' #fff',26 gridlineColor: ' #fff',28 baselineColor: 'transparent', 29 gridlineColor: 'transparent', 27 30 textPosition: 'none' 28 31 }, 29 32 vAxis: { 30 baselineColor: ' #fff',31 gridlineColor: ' #fff',33 baselineColor: 'transparent', 34 gridlineColor: 'transparent', 32 35 textPosition: 'none' 33 36 }, -
wp-visitors-widget/trunk/modules/shortcodes.php
r2082653 r2178611 9 9 10 10 $type = $atts['type']; 11 $colors = $atts['colors']; 11 12 $shadow = $atts['shadow']; 13 $initial_value = (int)$atts['initial_value']; 12 14 13 15 $data_1_param = $atts['data_1']; … … 28 30 29 31 // get all vivstors total 30 $all_total_visitors = $wpdb->get_var("SELECT COUNT(*) FROM $visitors_stat ") ;32 $all_total_visitors = $wpdb->get_var("SELECT COUNT(*) FROM $visitors_stat ") + $initial_value; 31 33 32 34 // get last active users … … 99 101 <style>'; 100 102 if( $shadow ){ 101 $out .= ' 102 .widget_type_1.visitor_widget{ 103 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 103 104 switch( $colors ){ 105 case "light": 106 $out .= ' 107 .widget_type_1.visitor_widget{ 108 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 109 } 110 '; 111 break; 112 case "light_transparent": 113 $out .= ' 114 .widget_type_1.visitor_widget{ 115 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 116 } 117 '; 118 break; 119 case "dark_transparent": 120 $out .= ' 121 .widget_type_1.visitor_widget{ 122 box-shadow: 0px 15px 40px 0 rgba(42, 64, 145, 0.35); 123 } 124 '; 125 break; 104 126 } 105 '; 106 } 127 128 129 } 130 131 switch( $colors ){ 132 case "light": 133 $bg_color = '#ffffff'; 134 $fontcolor = '#354052'; 135 $border_color = '#e6eaee'; 136 break; 137 case "light_transparent": 138 $bg_color = 'transparent'; 139 $fontcolor = '#354052'; 140 $border_color = '#e6eaee'; 141 break; 142 case "dark_transparent": 143 $bg_color = 'transparent'; 144 $fontcolor = '#f4f6fc'; 145 $border_color = '#171717'; 146 break; 147 default: 148 $bg_color = '#ffffff'; 149 $fontcolor = '#354052'; 150 $border_color = '#e6eaee'; 151 break; 152 } 153 154 107 155 $out .= ' 108 156 .widget_type_1{ 109 border:1px solid #e6eaee;157 border:1px solid '.$border_color.'; 110 158 border-radius: 4px; 111 159 max-width:176px; 112 background-color: #ffffff;160 background-color: '.$bg_color.'; 113 161 position:relative; 114 162 } … … 122 170 letter-spacing: normal; 123 171 text-align: center; 124 color: #354052;172 color: '.$fontcolor.'; 125 173 margin-top:30px; 126 174 margin-bottom: 5px; … … 159 207 <style>'; 160 208 if( $shadow ){ 161 $out .= ' 162 .widget_type_2.visitor_widget{ 163 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 209 210 switch( $colors ){ 211 case "light": 212 $out .= ' 213 .widget_type_2.visitor_widget{ 214 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 215 } 216 '; 217 break; 218 case "light_transparent": 219 $out .= ' 220 .widget_type_2.visitor_widget{ 221 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 222 } 223 '; 224 break; 225 case "dark_transparent": 226 $out .= ' 227 .widget_type_2.visitor_widget{ 228 box-shadow: 0px 15px 40px 0 rgba(42, 64, 145, 0.35); 229 } 230 '; 231 break; 164 232 } 165 '; 233 234 235 } 236 237 switch( $colors ){ 238 case "light": 239 $bg_color = '#ffffff'; 240 $fontcolor = '#354052'; 241 $border_color = '#e6eaee'; 242 break; 243 case "light_transparent": 244 $bg_color = 'transparent'; 245 $fontcolor = '#354052'; 246 $border_color = '#e6eaee'; 247 break; 248 case "dark_transparent": 249 $bg_color = 'transparent'; 250 $fontcolor = '#f4f6fc'; 251 $border_color = '#171717'; 252 break; 253 default: 254 $bg_color = '#ffffff'; 255 $fontcolor = '#354052'; 256 $border_color = '#e6eaee'; 257 break; 166 258 } 167 259 $out .= ' 168 260 .widget_type_2{ 169 border:1px solid #e6eaee;261 border:1px solid '.$border_color.'; 170 262 border-radius: 4px; 171 263 max-width:176px; 172 background-color: #ffffff;264 background-color: '.$bg_color.'; 173 265 position:relative; 174 266 font-family: "Exo 2", sans-serif; … … 183 275 letter-spacing: normal; 184 276 text-align: center; 185 color: #354052;277 color: '.$fontcolor.'; 186 278 margin-top:20px; 187 279 margin-bottom: 5px; … … 207 299 letter-spacing: normal; 208 300 text-align: center; 209 color: #354052;301 color: '.$fontcolor.'; 210 302 } 211 303 .widget_type_2 .type_2_row_4{ … … 244 336 <style>'; 245 337 if( $shadow ){ 246 $out .= ' 247 .widget_type_3.visitor_widget{ 248 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 338 339 switch( $colors ){ 340 case "light": 341 $out .= ' 342 .widget_type_3.visitor_widget{ 343 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 344 } 345 '; 346 break; 347 case "light_transparent": 348 $out .= ' 349 .widget_type_3.visitor_widget{ 350 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 351 } 352 '; 353 break; 354 case "dark_transparent": 355 $out .= ' 356 .widget_type_3.visitor_widget{ 357 box-shadow: 0px 15px 40px 0 rgba(42, 64, 145, 0.35); 358 } 359 '; 360 break; 249 361 } 250 '; 362 363 364 } 365 366 switch( $colors ){ 367 case "light": 368 $bg_color = '#ffffff'; 369 $fontcolor = '#354052'; 370 $border_color = '#e6eaee'; 371 break; 372 case "light_transparent": 373 $bg_color = 'transparent'; 374 $fontcolor = '#354052'; 375 $border_color = '#e6eaee'; 376 break; 377 case "dark_transparent": 378 $bg_color = 'transparent'; 379 $fontcolor = '#f4f6fc'; 380 $border_color = '#171717'; 381 break; 382 default: 383 $bg_color = '#ffffff'; 384 $fontcolor = '#354052'; 385 $border_color = '#e6eaee'; 386 break; 251 387 } 252 388 $out .= ' 253 389 .widget_type_3{ 254 border:1px solid #e6eaee;390 border:1px solid '.$border_color.'; 255 391 border-radius: 4px; 256 392 max-width:176px; 257 background-color: #ffffff;393 background-color: '.$bg_color.'; 258 394 position:relative; 259 395 } … … 267 403 letter-spacing: normal; 268 404 text-align: center; 269 color: #354052;405 color: '.$fontcolor.'; 270 406 margin-top:10px; 271 407 margin-bottom: 5px; … … 312 448 <style>'; 313 449 if( $shadow ){ 314 $out .= ' 315 .widget_type_4.visitor_widget{ 316 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 450 451 switch( $colors ){ 452 case "light": 453 $out .= ' 454 .widget_type_4.visitor_widget{ 455 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 456 } 457 '; 458 break; 459 case "light_transparent": 460 $out .= ' 461 .widget_type_4.visitor_widget{ 462 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 463 } 464 '; 465 break; 466 case "dark_transparent": 467 $out .= ' 468 .widget_type_4.visitor_widget{ 469 box-shadow: 0px 15px 40px 0 rgba(42, 64, 145, 0.35); 470 } 471 '; 472 break; 317 473 } 318 '; 474 475 476 } 477 478 switch( $colors ){ 479 case "light": 480 $bg_color = '#ffffff'; 481 $fontcolor = '#354052'; 482 $border_color = '#e6eaee'; 483 break; 484 case "light_transparent": 485 $bg_color = 'transparent'; 486 $fontcolor = '#354052'; 487 $border_color = '#e6eaee'; 488 break; 489 case "dark_transparent": 490 $bg_color = 'transparent'; 491 $fontcolor = '#f4f6fc'; 492 $border_color = '#171717'; 493 break; 494 default: 495 $bg_color = '#ffffff'; 496 $fontcolor = '#354052'; 497 $border_color = '#e6eaee'; 498 break; 319 499 } 320 500 $out .= ' 321 501 .widget_type_4{ 322 border:1px solid #e6eaee;502 border:1px solid '.$border_color.'; 323 503 border-radius: 4px; 324 504 max-width:176px; 325 background-color: #ffffff;505 background-color: '.$bg_color.'; 326 506 position:relative; 327 507 font-family: "Exo 2", sans-serif; … … 350 530 letter-spacing: normal; 351 531 text-align: center; 352 color: #354052;532 color: '.$fontcolor.'; 353 533 354 534 margin-bottom: 30px; … … 363 543 letter-spacing: normal; 364 544 text-align: center; 365 color: #354052;545 color: '.$fontcolor.'; 366 546 margin-top:5px; 367 547 margin-bottom: 0px; … … 389 569 letter-spacing: normal; 390 570 text-align: center; 391 color: #354052;571 color: '.$fontcolor.'; 392 572 margin-top:5px; 393 573 margin-bottom: 0px; … … 435 615 <style>'; 436 616 if( $shadow ){ 437 $out .= ' 438 .widget_type_5.visitor_widget{ 439 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 617 618 switch( $colors ){ 619 case "light": 620 $out .= ' 621 .widget_type_5.visitor_widget{ 622 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 623 } 624 '; 625 break; 626 case "light_transparent": 627 $out .= ' 628 .widget_type_5.visitor_widget{ 629 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 630 } 631 '; 632 break; 633 case "dark_transparent": 634 $out .= ' 635 .widget_type_5.visitor_widget{ 636 box-shadow: 0px 15px 40px 0 rgba(42, 64, 145, 0.35); 637 } 638 '; 639 break; 440 640 } 441 '; 641 642 643 } 644 645 switch( $colors ){ 646 case "light": 647 $bg_color = '#ffffff'; 648 $fontcolor = '#354052'; 649 $border_color = '#e6eaee'; 650 break; 651 case "light_transparent": 652 $bg_color = 'transparent'; 653 $fontcolor = '#354052'; 654 $border_color = '#e6eaee'; 655 break; 656 case "dark_transparent": 657 $bg_color = 'transparent'; 658 $fontcolor = '#f4f6fc'; 659 $border_color = '#171717'; 660 break; 661 default: 662 $bg_color = '#ffffff'; 663 $fontcolor = '#354052'; 664 $border_color = '#e6eaee'; 665 break; 442 666 } 443 667 $out .= ' 444 668 .widget_type_5{ 445 border:1px solid #e6eaee;669 border:1px solid '.$border_color.'; 446 670 border-radius: 4px; 447 671 max-width:176px; 448 background-color: #ffffff;672 background-color: '.$bg_color.'; 449 673 position:relative; 450 674 font-family: "Exo 2", sans-serif; … … 473 697 letter-spacing: normal; 474 698 text-align: center; 475 color: #354052;699 color: '.$fontcolor.'; 476 700 477 701 margin-bottom: 10px; … … 486 710 letter-spacing: normal; 487 711 text-align: center; 488 color: #354052;712 color: '.$fontcolor.'; 489 713 margin-top:10px; 490 714 margin-bottom: 10px; … … 519 743 letter-spacing: normal; 520 744 text-align: center; 521 color: #354052;745 color: '.$fontcolor.'; 522 746 margin-top:5px; 523 747 margin-bottom: 0px; … … 583 807 } 584 808 809 $out .= '<style>'; 585 810 586 587 $out .= '588 <style>';589 811 if( $shadow ){ 590 $out .= ' 591 .widget_type_6.visitor_widget{ 592 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 812 813 switch( $colors ){ 814 case "light": 815 $out .= ' 816 .widget_type_6.visitor_widget{ 817 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 818 } 819 '; 820 break; 821 case "light_transparent": 822 $out .= ' 823 .widget_type_6.visitor_widget{ 824 box-shadow: 0px 25px 46px 0 rgba(51, 59, 69, 0.15); 825 } 826 '; 827 break; 828 case "dark_transparent": 829 $out .= ' 830 .widget_type_6.visitor_widget{ 831 box-shadow: 0px 15px 40px 0 rgba(42, 64, 145, 0.35); 832 } 833 '; 834 break; 593 835 } 594 '; 836 837 838 } 839 840 switch( $colors ){ 841 case "light": 842 $bg_color = '#f5f8fa'; 843 $fontcolor = '#354052'; 844 $border_color = '#e6eaee'; 845 break; 846 case "light_transparent": 847 $bg_color = 'transparent'; 848 $fontcolor = '#354052'; 849 $border_color = '#e6eaee'; 850 break; 851 case "dark_transparent": 852 $bg_color = 'transparent'; 853 $fontcolor = '#f4f6fc'; 854 $border_color = '#171717'; 855 break; 856 default: 857 $bg_color = '#f5f8fa'; 858 $fontcolor = '#354052'; 859 $border_color = '#e6eaee'; 860 break; 595 861 } 596 862 $out .= ' 597 863 .widget_type_6{ 598 864 overflow:hidden; 599 border:1px solid #e6eaee;865 border:1px solid '.$border_color.'; 600 866 border-radius: 4px; 601 867 max-width:176px; 602 background-color: #f5f8fa;868 background-color: '.$bg_color.'; 603 869 position:relative; 604 870 font-family: "Exo 2", sans-serif; … … 624 890 letter-spacing: normal; 625 891 text-align: left; 626 color: #354052;892 color: '.$fontcolor.'; 627 893 } 628 894 .widget_type_6 .left_col .count_text{ -
wp-visitors-widget/trunk/modules/widgets.php
r2039598 r2178611 18 18 $title = apply_filters( 'widget_title', $instance['title'] ); 19 19 $select_style = apply_filters( 'widget_title', $instance['select_style'] ); 20 $colors = apply_filters( 'colors', $instance['colors'] ); 20 21 $data_row_1 = apply_filters( 'widget_title', $instance['data_row_1'] ); 21 22 $data_row_2 = apply_filters( 'widget_title', $instance['data_row_2'] ); 22 23 $data_row_3 = apply_filters( 'widget_title', $instance['data_row_3'] ); 23 24 $shadow = apply_filters( 'widget_title', $instance['shadow'] ); 25 $initial_value = apply_filters( 'widget_title', $instance['initial_value'] ); 24 26 25 27 echo $before_widget; … … 27 29 echo $before_title . $title . $after_title; 28 30 29 $out = do_shortcode('[visitors_widget type="'.$select_style.'" shadow="'.$shadow.'" data_1="'.$data_row_1.'" data_2="'.$data_row_2.'" data_3="'.$data_row_3.'" ]');31 $out = do_shortcode('[visitors_widget type="'.$select_style.'" shadow="'.$shadow.'" data_1="'.$data_row_1.'" data_2="'.$data_row_2.'" data_3="'.$data_row_3.'" colors="'.$colors.'" initial_value="'.$initial_value.'"]'); 30 32 31 33 … … 39 41 $instance['title'] = strip_tags( $new_instance['title'] ); 40 42 $instance['select_style'] = strip_tags( $new_instance['select_style'] ); 43 $instance['colors'] = strip_tags( $new_instance['colors'] ); 41 44 $instance['data_row_1'] = strip_tags( $new_instance['data_row_1'] ); 42 45 $instance['data_row_2'] = strip_tags( $new_instance['data_row_2'] ); 43 46 $instance['data_row_3'] = strip_tags( $new_instance['data_row_3'] ); 44 47 $instance['shadow'] = strip_tags( $new_instance['shadow'] ); 48 49 $instance['initial_value'] = strip_tags( $new_instance['initial_value'] ); 45 50 46 51 return $instance; … … 51 56 $title = $instance[ 'title' ]; 52 57 $select_style = $instance[ 'select_style' ]; 58 $colors = $instance[ 'colors' ]; 53 59 54 60 $data_row_1 = $instance[ 'data_row_1' ]; … … 56 62 $data_row_3 = $instance[ 'data_row_3' ]; 57 63 $shadow = $instance[ 'shadow' ]; 64 65 $initial_value = $instance[ 'initial_value' ]; 58 66 59 67 } … … 85 93 <option value="6" data-params="1" <?php if ( $select_style == '6') echo ' selected '; ?> >Mini 86 94 95 </select> 96 </div> 97 </p> 98 99 100 <p> 101 <label for="<?php echo $this->get_field_id( 'colors' ); ?>"><?php _e( 'Colors:' ); ?></label> 102 <div> 103 104 <select class="widefat color_selector" name="<?php echo $this->get_field_name( 'colors' ); ?>" > 105 <option value="light" <?php if ( $colors == 'light') echo ' selected '; ?> ><?php echo __('Light'); ?> 106 <option value="light_transparent" <?php if ( $colors == 'light_transparent') echo ' selected '; ?> ><?php echo __('Light Transparent'); ?> 107 <option value="dark_transparent" <?php if ( $colors == 'dark_transparent') echo ' selected '; ?> ><?php echo __('Dark Transparent'); ?> 87 108 </select> 88 109 </div> … … 125 146 </div> 126 147 </p> 148 149 150 151 127 152 <p> 128 153 <input class="checkbox" type="checkbox" name="<?php echo $this->get_field_name( 'shadow' ); ?>" value="on" <?php if( $shadow == 'on' ) echo ' checked ' ; ?> /> … … 130 155 131 156 </p> 157 158 <p> 159 <label for="<?php echo $this->get_field_id( 'initial_value' ); ?>"><?php _e( 'Initial Value:' ); ?></label> 160 <input class="widefat" id="<?php echo $this->get_field_id( 'initial_value' ); ?>" name="<?php echo $this->get_field_name( 'initial_value' ); ?>" type="text" value="<?php echo (int)esc_attr( $initial_value ); ?>" /> 161 </p> 162 132 163 </div> 133 164 <?php … … 136 167 } // class Foo_Widget 137 168 // register Foo_Widget widget 138 add_action( 'widgets_init', create_function( '', 'register_widget( "visitors_widget" );' ) ); 169 add_action( 'widgets_init', function(){ 170 register_widget( "visitors_widget" ); 171 } ); 139 172 140 173 ?> -
wp-visitors-widget/trunk/readme.txt
r2040566 r2178611 2 2 Contributors: liveplugins 3 3 Donate link: http://visitorplugin.com 4 Tags: visitor, counter, live, simple, easy, plugin, widget 4 Tags: visitor, counter, live, simple, easy, plugin, widget, visitor counter, visitors, countries, reports, marketing, content analysis, wordpress visitor counter, website visitor counter, click counter, Views Counter 5 5 Requires at least: 4.0 6 Tested up to: 5. 16 Tested up to: 5.2.4 7 7 Stable tag: trunk 8 8 Requires PHP: 5.0 … … 30 30 - Total visitors 31 31 32 The design is minimalistic and simple and works with all kind of website styles. 32 - Dark Mode 33 - Unique Visitor Per Session 34 - Transfer your numbers from previous counters 35 - Lighter and faster 36 - Transparent background Style 33 37 38 39 40 The design is minimalistic and simple and works with all kind of website styles. 34 41 35 42 == Installation == … … 39 46 3. You can find the installed plugin under Widgets. 40 47 41 == Frequently Asked Questions ==42 43 44 48 == Screenshots == 45 49 46 50 1. Clean Design styles to choose from 51 2. Our Light style that suits most websites 52 3. A style for those who joined the Dark side. May the force be with you. 47 53 48 54 == Changelog == 55 49 56 First Version 50 57 51 58 == Upgrade Notice == 52 None 59 60 2.0 Updates: 61 62 - Dark Mode 63 - Unique Visitor Per Session 64 - Transfer your numbers from previous counters 65 - Lighter and faster 66 - Transparent background Style -
wp-visitors-widget/trunk/wp-visitors-widget.php
r2040566 r2178611 4 4 Plugin URI: http://visitorplugin.com 5 5 Description: Adds a widget showing the visitor how many live visitors is on the page. 6 Version: 1. 16 Version: 1.2 7 7 Author: Adam Z 8 Stable tag: 1. 18 Stable tag: 1.2 9 9 */ 10 10
Note: See TracChangeset
for help on using the changeset viewer.