Visitors Traffic Real Time Statistics - Version 3.12

Version Description

Download this release

Release Info

Developer osamaesh
Plugin Icon 128x128 Visitors Traffic Real Time Statistics
Version 3.12
Comparing to
See all releases

Code changes from version 3.11 to 3.12

Visitors-Traffic-Real-Time-Statistics.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Visitor Traffic Real Time Statistics
4
  Description: Hits counter that shows analytical numbers of your WordPress site visitors and hits.
5
  Author: wp-buy
6
  Author URI: https://www.wp-buy.com/
7
- Version: 3.11
8
  Text Domain: visitors-traffic-real-time-statistics
9
  Domain Path: /languages
10
  */
@@ -30,6 +30,7 @@ if ( function_exists('get_plugin_data') ) {
30
  $installed_version = get_option( 'visitors-traffic-real-time-statistics-pro-version' );
31
  if( $installed_version != $woodhl_detail['Version'] ){
32
  add_action( 'plugins_loaded', 'ahcfree_init' );
 
33
  update_option( 'visitors-traffic-real-time-statistics-pro-version', $woodhl_detail['Version'] );
34
  }
35
  }
4
  Description: Hits counter that shows analytical numbers of your WordPress site visitors and hits.
5
  Author: wp-buy
6
  Author URI: https://www.wp-buy.com/
7
+ Version: 3.12
8
  Text Domain: visitors-traffic-real-time-statistics
9
  Domain Path: /languages
10
  */
30
  $installed_version = get_option( 'visitors-traffic-real-time-statistics-pro-version' );
31
  if( $installed_version != $woodhl_detail['Version'] ){
32
  add_action( 'plugins_loaded', 'ahcfree_init' );
33
+
34
  update_option( 'visitors-traffic-real-time-statistics-pro-version', $woodhl_detail['Version'] );
35
  }
36
  }
ahc_settings.php CHANGED
@@ -86,7 +86,7 @@ $ahcfree_save_ips = get_option('ahcfree_save_ips_opn');
86
  $ahcproUserRoles = get_option('ahcproUserRoles');
87
  $ahcproRobots = get_option('ahcproRobots');
88
  ?>
89
- <div class="ahc_main_container" >
90
  <h3><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics Free <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h3><br />
91
  <div class="panel">
92
  <h2 class="box-heading">Settings</h2><hr>
@@ -103,14 +103,17 @@ $ahcproRobots = get_option('ahcproRobots');
103
 
104
  <div class="form-group col-md-2">
105
  <label for="exampleFormControlSelect1">Select Timezone</label>
 
106
  <select class="form-control" id="set_custom_timezone" name="set_custom_timezone">
107
 
108
  <?php
109
- $custom_timezone_offset = get_option('ahcfree_custom_timezone');
 
 
110
  $timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
111
  foreach ($timezones as $key => $value) {
112
  ?>
113
- <option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
114
  <?php
115
  }
116
  ?>
@@ -229,8 +232,22 @@ jQuery(document).ready(function() {
229
  </div>
230
  </div>
231
  </div>
232
- <input type="submit" name="save" value="save settings" style="font-size:15px" />
233
- <input type="button" name="cancel" value="back to dashboard" onclick="javascript:window.location.href = 'admin.php?page=ahc_hits_counter_menu_free'" style="font-size:15px" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  </div>
235
  <?php
236
  echo $msg;
86
  $ahcproUserRoles = get_option('ahcproUserRoles');
87
  $ahcproRobots = get_option('ahcproRobots');
88
  ?>
89
+ <div class="ahc_main_container" style="background-color:white; margin:20px; width:auto; padding:20px; border-radius:20px">
90
  <h3><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics Free <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h3><br />
91
  <div class="panel">
92
  <h2 class="box-heading">Settings</h2><hr>
103
 
104
  <div class="form-group col-md-2">
105
  <label for="exampleFormControlSelect1">Select Timezone</label>
106
+
107
  <select class="form-control" id="set_custom_timezone" name="set_custom_timezone">
108
 
109
  <?php
110
+
111
+ $wp_timezone_string = get_option('timezone_string');
112
+ $custom_timezone_offset = (get_option('ahcfree_custom_timezone') !='') ? get_option('ahcfree_custom_timezone') : $wp_timezone_string;
113
  $timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
114
  foreach ($timezones as $key => $value) {
115
  ?>
116
+ <option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset) ? 'selected' : ''; ?>><?php echo $value; ?></option>
117
  <?php
118
  }
119
  ?>
232
  </div>
233
  </div>
234
  </div>
235
+ <input type="submit" name="save" value="save settings" style=" background-color: #4CAF50; /* Green */
236
+ border: none;
237
+ color: white;
238
+ padding: 15px 32px;
239
+ text-align: center;
240
+ text-decoration: none;
241
+ display: inline-block;
242
+ font-size: 16px;" />
243
+ <input type="button" name="cancel" value="back to dashboard" onclick="javascript:window.location.href = 'admin.php?page=ahc_hits_counter_menu_free'" style=" background-color: #e7e7e7; color: black;
244
+ border: none;
245
+
246
+ padding: 15px 32px;
247
+ text-align: center;
248
+ text-decoration: none;
249
+ display: inline-block;
250
+ font-size: 16px;" />
251
  </div>
252
  <?php
253
  echo $msg;
functions.php CHANGED
@@ -195,7 +195,8 @@ function ahcfree_savesettings() {
195
  $ahcproUserRoles = substr($ahcproUserRoles,0,-1);
196
  update_option('ahcproUserRoles',$ahcproUserRoles);
197
  }
198
-
 
199
 
200
  $sql = $wpdb->prepare("UPDATE `ahc_settings` set `set_hits_days` = %s, `set_ajax_check` = %s, `set_ips` = %s, `set_google_map` = %s ",
201
  $set_hits_days, $set_ajax_check, $set_ips, $set_google_map);
@@ -468,8 +469,6 @@ function ahcfree_set_default_options() {
468
  }
469
  }
470
 
471
-
472
- ahcfree_update_tables();
473
  }
474
 
475
  //--------------------------------------------
@@ -521,6 +520,8 @@ function ahcfree_create_admin_menu_link() {
521
  add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Support', 'More Products', 'read', 'ahc_hits_counter_about', 'ahcfree_create_plugin_about_page');
522
  $ahcfree_custom_timezone = get_option( 'ahcfree_custom_timezone', false );
523
  if( !$ahcfree_custom_timezone ){
 
 
524
  add_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
525
  }
526
  $page = isset($_GET['page']) ? ahc_free_sanitize_text_or_array_field($_GET['page']) : '';
@@ -547,11 +548,16 @@ function ahcfree_NumFormat($num) {
547
  }
548
 
549
 
 
 
550
  function ahcfree_init()
551
  {
552
  //add_action('wp_ajax_ahcfree_countOnlineusers','ahcfree_countOnlineusers');
553
  add_action('wp_ajax_ahcfree_track_visitor','ahcfree_track_visitor');
554
  add_action('wp_ajax_nopriv_ahcfree_track_visitor','ahcfree_track_visitor');
 
 
 
555
  }
556
  add_action('admin_init','ahcfree_init');
557
 
@@ -781,29 +787,7 @@ function ahcfree_update_tables() {
781
  global $wpdb;
782
  $sqlQueries = array();
783
 
784
- $sqlQueries[] = " drop table IF EXISTS `ahc_settings` ";
785
- $sqlQueries[] = "
786
- CREATE TABLE IF NOT EXISTS `ahc_settings` (
787
- `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
788
- `set_hits_days` int(10) unsigned NOT NULL DEFAULT '14',
789
- `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
790
- `set_ips` text DEFAULT NULL,
791
- `set_google_map` varchar(100) NOT NULL DEFAULT 'today_visitors',
792
-
793
- PRIMARY KEY (`set_id`)
794
- ) DEFAULT CHARSET=utf8";
795
-
796
- //$sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
797
- //$sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
798
-
799
- /* code for error handling : "duplicate column name" : Taslim -Prism */
800
- if ( ahcfree_check_table_exists('ahc_recent_visitors') === true && ahcfree_check_table_column_exists('ahc_recent_visitors', 'ahc_city') === false ) {
801
- $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
802
- }
803
-
804
- if ( ahcfree_check_table_exists('ahc_recent_visitors') === true && ahcfree_check_table_column_exists('ahc_recent_visitors', 'ahc_region') === false ) {
805
- $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
806
- }
807
 
808
  if ( !ahcfree_check_column_index_exists('ahc_visitors', 'vst_date')) {
809
 
@@ -811,21 +795,29 @@ function ahcfree_update_tables() {
811
  }
812
 
813
  foreach ($sqlQueries as $sql) {
814
- if ($wpdb->query($sql) === false) {
815
- return false;
816
- }
817
  }
818
 
819
-
820
- return true;
821
  }
822
 
823
-
824
  function ahcfree_add_settings() {
825
 
826
  global $wpdb;
827
- ahcfree_update_tables();
828
-
 
 
 
 
 
 
 
 
 
 
 
 
829
  $sql1 = "truncate table `ahc_settings`";
830
  $wpdb->query($sql1);
831
 
@@ -879,8 +871,7 @@ function ahcfree_create_database_tables() {
879
  ) DEFAULT CHARSET=utf8";
880
 
881
 
882
- $sqlQueries[] = "
883
- CREATE TABLE IF NOT EXISTS `ahc_settings` (
884
  `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
885
  `set_hits_days` int(10) unsigned NOT NULL DEFAULT '14',
886
  `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
@@ -931,6 +922,10 @@ function ahcfree_create_database_tables() {
931
  `ctr_visits` INT(11) NOT NULL DEFAULT 0
932
  ) DEFAULT CHARSET=utf8";
933
 
 
 
 
 
934
  $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_visitors`
935
  (
936
  `vst_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -971,6 +966,9 @@ function ahcfree_create_database_tables() {
971
  `rfr_visits` INT(11) UNSIGNED NULL DEFAULT 0
972
  ) DEFAULT CHARSET=utf8";
973
 
 
 
 
974
  $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_recent_visitors`
975
  (
976
  `vtr_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -981,7 +979,9 @@ function ahcfree_create_database_tables() {
981
  `bsr_id` INT(3) UNSIGNED NOT NULL,
982
  `ctr_id` INT(5) UNSIGNED NULL,
983
  `vtr_date` DATE NOT NULL,
984
- `vtr_time` TIME NOT NULL
 
 
985
  ) DEFAULT CHARSET=utf8";
986
 
987
  $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_keywords`
@@ -1018,11 +1018,6 @@ function ahcfree_create_database_tables() {
1018
  ) DEFAULT CHARSET=utf8";
1019
 
1020
 
1021
- /* $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
1022
-
1023
- $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
1024
- */
1025
-
1026
 
1027
  foreach ($sqlQueries as $sql) {
1028
  if ($wpdb->query($sql) === false) {
@@ -3157,10 +3152,10 @@ function ahcfree_get_visits_by_custom_duration_callback( $start_date,$end_date,$
3157
  }
3158
  function ahcfree_admin_notice_to_set_timezone(){
3159
  $class = 'notice notice-error';
3160
- $name = 'Visitor Traffic Real Time Statistics Free';
3161
- $message = sprintf( __( 'Please set timezone from <a href="%s">here</a>' ), site_url('wp-admin/admin.php?page=ahc_hits_counter_settings') );
3162
 
3163
- printf( '<div class="%1$s"><h3>%2$s</h3><p>%3$s</p></div>', esc_attr( $class ), $name, $message );
3164
 
3165
  }
3166
  /*function ahcfree_get_visitors_by_custom_duration_callback( $start_date,$end_date ){
195
  $ahcproUserRoles = substr($ahcproUserRoles,0,-1);
196
  update_option('ahcproUserRoles',$ahcproUserRoles);
197
  }
198
+
199
+ ahcfree_update_tables();
200
 
201
  $sql = $wpdb->prepare("UPDATE `ahc_settings` set `set_hits_days` = %s, `set_ajax_check` = %s, `set_ips` = %s, `set_google_map` = %s ",
202
  $set_hits_days, $set_ajax_check, $set_ips, $set_google_map);
469
  }
470
  }
471
 
 
 
472
  }
473
 
474
  //--------------------------------------------
520
  add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Support', 'More Products', 'read', 'ahc_hits_counter_about', 'ahcfree_create_plugin_about_page');
521
  $ahcfree_custom_timezone = get_option( 'ahcfree_custom_timezone', false );
522
  if( !$ahcfree_custom_timezone ){
523
+
524
+ update_option('ahcfree_custom_timezone', get_option('timezone_string'));
525
  add_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
526
  }
527
  $page = isset($_GET['page']) ? ahc_free_sanitize_text_or_array_field($_GET['page']) : '';
548
  }
549
 
550
 
551
+
552
+
553
  function ahcfree_init()
554
  {
555
  //add_action('wp_ajax_ahcfree_countOnlineusers','ahcfree_countOnlineusers');
556
  add_action('wp_ajax_ahcfree_track_visitor','ahcfree_track_visitor');
557
  add_action('wp_ajax_nopriv_ahcfree_track_visitor','ahcfree_track_visitor');
558
+
559
+ ahcfree_update_tables();
560
+
561
  }
562
  add_action('admin_init','ahcfree_init');
563
 
787
  global $wpdb;
788
  $sqlQueries = array();
789
 
790
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
791
 
792
  if ( !ahcfree_check_column_index_exists('ahc_visitors', 'vst_date')) {
793
 
795
  }
796
 
797
  foreach ($sqlQueries as $sql) {
798
+ $wpdb->query($sql);
799
+
 
800
  }
801
 
 
 
802
  }
803
 
 
804
  function ahcfree_add_settings() {
805
 
806
  global $wpdb;
807
+
808
+ $sql_ahc_settings = "CREATE TABLE IF NOT EXISTS `ahc_settings` (
809
+ `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
810
+ `set_hits_days` int(10) unsigned NOT NULL DEFAULT '14',
811
+ `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
812
+ `set_ips` text DEFAULT NULL,
813
+ `set_google_map` varchar(100) NOT NULL DEFAULT 'today_visitors',
814
+
815
+ PRIMARY KEY (`set_id`)
816
+ ) DEFAULT CHARSET=utf8";
817
+
818
+ $wpdb->query($sql_ahc_settings);
819
+
820
+
821
  $sql1 = "truncate table `ahc_settings`";
822
  $wpdb->query($sql1);
823
 
871
  ) DEFAULT CHARSET=utf8";
872
 
873
 
874
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_settings` (
 
875
  `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
876
  `set_hits_days` int(10) unsigned NOT NULL DEFAULT '14',
877
  `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
922
  `ctr_visits` INT(11) NOT NULL DEFAULT 0
923
  ) DEFAULT CHARSET=utf8";
924
 
925
+
926
+
927
+
928
+
929
  $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_visitors`
930
  (
931
  `vst_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
966
  `rfr_visits` INT(11) UNSIGNED NULL DEFAULT 0
967
  ) DEFAULT CHARSET=utf8";
968
 
969
+
970
+
971
+
972
  $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_recent_visitors`
973
  (
974
  `vtr_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
979
  `bsr_id` INT(3) UNSIGNED NOT NULL,
980
  `ctr_id` INT(5) UNSIGNED NULL,
981
  `vtr_date` DATE NOT NULL,
982
+ `vtr_time` TIME NOT NULL,
983
+ `ahc_city` varchar(230) NULL,
984
+ `ahc_region` varchar(230) NULL
985
  ) DEFAULT CHARSET=utf8";
986
 
987
  $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_keywords`
1018
  ) DEFAULT CHARSET=utf8";
1019
 
1020
 
 
 
 
 
 
1021
 
1022
  foreach ($sqlQueries as $sql) {
1023
  if ($wpdb->query($sql) === false) {
3152
  }
3153
  function ahcfree_admin_notice_to_set_timezone(){
3154
  $class = 'notice notice-error';
3155
+ $name = 'Visitor Traffic Real Time Statistics Free - Invalid Timezone';
3156
+ $message = sprintf( __( 'Invalid timezone, Please visit the <a href="%s">settings</a> page and select your current timezone.' ), site_url('wp-admin/admin.php?page=ahc_hits_counter_settings') );
3157
 
3158
+ printf( '<br><div class="%1$s" style="padding-top:5px;"><b>%2$s</b><p>%3$s</p></div>', esc_attr( $class ), $name, $message );
3159
 
3160
  }
3161
  /*function ahcfree_get_visitors_by_custom_duration_callback( $start_date,$end_date ){
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wp-buy, osamaesh
3
  Tags: visitor, traffic, statistics, analytics, stats, online, Visit, WordPress analytics ,visitors online, count visitor, google analytics, analytics, GeoIP, Geo locations, analytics dashboard, visits, chart, browser, blog, today, yesterday, week, month, wp Statistics, year, post, page, sidebar, summary, feedburner, hits, pagerank, google, histats, alexa, live visit, counter, diagram, graph
4
  Requires at least: 3.0.1
5
  Tested up to: 5.8
6
- Stable tag: 3.11
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
3
  Tags: visitor, traffic, statistics, analytics, stats, online, Visit, WordPress analytics ,visitors online, count visitor, google analytics, analytics, GeoIP, Geo locations, analytics dashboard, visits, chart, browser, blog, today, yesterday, week, month, wp Statistics, year, post, page, sidebar, summary, feedburner, hits, pagerank, google, histats, alexa, live visit, counter, diagram, graph
4
  Requires at least: 3.0.1
5
  Tested up to: 5.8
6
+ Stable tag: 3.12
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9