Visitors Traffic Real Time Statistics - Version 6.3

Version Description

  1. Convert IPv6 to IPv4
Download this release

Release Info

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

Code changes from version 6.1 to 6.3

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: 6.1
8
  Text Domain: visitors-traffic-real-time-statistics
9
  Domain Path: /languages
10
  */
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: 6.3
8
  Text Domain: visitors-traffic-real-time-statistics
9
  Domain Path: /languages
10
  */
functions.php CHANGED
@@ -3037,6 +3037,25 @@ function ahcfree_advanced_get_link($url, $followRedirects = true)
3037
  *
3038
  * @return string
3039
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3040
  function ahcfree_get_client_ip_address()
3041
  {
3042
  global $_SERVER;
@@ -3059,8 +3078,11 @@ function ahcfree_get_client_ip_address()
3059
  $ipAddress = 'UNKNOWN';
3060
  }
3061
 
3062
-
3063
  $ipAddress = ahc_free_sanitize_text_or_array_field($ipAddress);
 
 
 
3064
  $ipAddress = explode(',', $ipAddress);
3065
 
3066
  return $ipAddress[0];
3037
  *
3038
  * @return string
3039
  */
3040
+
3041
+
3042
+ function ahc_free_get_simple_ip($ip)
3043
+ {
3044
+ $exploded_ip = explode(":", $ip);
3045
+ $size = sizeof($exploded_ip);
3046
+
3047
+ if($size == 1) // ipv4 format
3048
+ return $ip;
3049
+
3050
+ if($size == 4) // ipv4 in ipv6 format
3051
+ {
3052
+ if(empty($exploded_ip[0]) && empty($exploded_ip[1]) && strtoupper($exploded_ip[2]) == "FFFF")
3053
+ return $exploded_ip[3];
3054
+ }
3055
+
3056
+ return $ip; // default ipv6
3057
+ }
3058
+
3059
  function ahcfree_get_client_ip_address()
3060
  {
3061
  global $_SERVER;
3078
  $ipAddress = 'UNKNOWN';
3079
  }
3080
 
3081
+ $ipAddress = ahc_free_get_simple_ip($ipAddress);
3082
  $ipAddress = ahc_free_sanitize_text_or_array_field($ipAddress);
3083
+
3084
+
3085
+
3086
  $ipAddress = explode(',', $ipAddress);
3087
 
3088
  return $ipAddress[0];
overview.php ADDED
@@ -0,0 +1,1047 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
5
+ $custom_timezone_string = ahcfree_get_timezone_string();
6
+
7
+
8
+ $ahcfree_save_ips = get_option('ahcfree_save_ips_opn');
9
+ if ($custom_timezone_string) {
10
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
11
+ }
12
+
13
+ $myend_date = new DateTime();
14
+ $myend_date->setTimezone(new DateTimeZone('UTC'));
15
+ //$myend_date->setTimezone($custom_timezone);
16
+ $myend_date_full = ahcfree_localtime('Y-m-d H:i:s');
17
+ $myend_date = ahcfree_localtime('Y-m-d');
18
+
19
+ $mystart_date = new DateTime($myend_date);
20
+ $mystart_date->modify(' - ' . (AHCFREE_VISITORS_VISITS_LIMIT - 1) . ' days');
21
+ $mystart_date->setTimezone(new DateTimeZone('UTC'));
22
+ //$mystart_date->setTimezone($custom_timezone);
23
+ $mystart_date_full = $mystart_date->format('Y-m-d H:i:s');
24
+ $mystart_date = $mystart_date->format('Y-m-d');
25
+
26
+ //echo date('Y-m-d H:i:s',time());
27
+ ?>
28
+
29
+ <script language="javascript" type="text/javascript">
30
+ function imgFlagError(image) {
31
+ image.onerror = "";
32
+ image.src = "<?php echo plugins_url('/images/flags/noFlag.png', AHCFREE_PLUGIN_MAIN_FILE) ?>";
33
+ return true;
34
+ }
35
+
36
+ setInterval(function() {
37
+
38
+ var now = new Date();
39
+ var year = now.getFullYear();
40
+ var month = now.getMonth() + 1;
41
+ var day = now.getDate();
42
+ var hour = now.getHours();
43
+ var minute = now.getMinutes();
44
+ var second = now.getSeconds();
45
+ if (month.toString().length == 1) {
46
+ month = '0' + month;
47
+ }
48
+ if (day.toString().length == 1) {
49
+ day = '0' + day;
50
+ }
51
+ if (hour.toString().length == 1) {
52
+ hour = '0' + hour;
53
+ }
54
+ if (minute.toString().length == 1) {
55
+ minute = '0' + minute;
56
+ }
57
+ if (second.toString().length == 1) {
58
+ second = '0' + second;
59
+ }
60
+
61
+
62
+
63
+ const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
64
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
65
+ ];
66
+
67
+ const d = new Date();
68
+
69
+
70
+ var dateTime = day + ' ' + monthNames[d.getMonth()] + ' ' + year + ', ' + hour + ':' + minute + ':' + second;
71
+ document.getElementById('ahcfree_currenttime').innerHTML = dateTime;
72
+ }, 500);
73
+ </script>
74
+
75
+ <style>
76
+ body {
77
+ background: #F1F1F1 !important
78
+ }
79
+ </style>
80
+
81
+ <div class="ahc_main_container">
82
+
83
+ <div class="row">
84
+ <div class="col-lg-12">
85
+ <br />
86
+ <div id="vtrts_subscribe" class="alert alert-success is-dismissible alert is-dismissible" role="alert" style="font-size:12px">
87
+
88
+ <input type="text" width="400px" name="ahc_admin_email" id="ahc_admin_email" value="<?php echo get_bloginfo("admin_email"); ?>">
89
+ <button type="button" class="btn btn-primary" onclick="vtrts_open_subscribe_page('<?php echo get_bloginfo("admin_email") ?>')">Subscribe</button><br /><br />Subscribe now to get latest news and updates, plugin recommendations and configuration help, promotional email with<b style="color:red"> discount codes :) </b><br />
90
+ <div style="float:right; font-size:12px; display:inline"><a href="#" style="cursor: pointer; !important;" onclick="vtrts_dismiss_notice()">Dismiss this notice</a></div>
91
+ </div>
92
+
93
+ <script>
94
+ function vtrts_dismiss_notice() {
95
+ localStorage.setItem('vtrts_subscribed', 'vtrts_subs_users');
96
+ document.getElementById("vtrts_subscribe").style.display = "none";
97
+ }
98
+
99
+ function vtrts_open_subscribe_page() {
100
+ if (localStorage.getItem('vtrts_subscribed') != 'vtrts_subs_users') {
101
+ var ahc_admin_email = document.getElementById("ahc_admin_email").value;
102
+ window.open('https://www.wp-buy.com/vtrts-subscribe/?email=' + ahc_admin_email, '_blank');
103
+
104
+ }
105
+ }
106
+
107
+ if (localStorage.getItem('vtrts_subscribed') == 'vtrts_subs_users') {
108
+
109
+ document.getElementById("vtrts_subscribe").style.display = "none";
110
+ }
111
+ </script>
112
+
113
+
114
+ </div>
115
+ </div>
116
+ <div class="row">
117
+ <div class="col-lg-8">
118
+ <h1><img height="55px" src="<?php echo esc_url(plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE)); ?>">&nbsp;Visitor Traffic Real Time Statistics free &nbsp;
119
+ <?php if(current_user_can('manage_options')){?><a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo esc_url(plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE)) ?>" /></a><?php }?></h1>
120
+
121
+ </div>
122
+ <div class="col-lg-4">
123
+ <h2 id="ahcfree_currenttime"></h2>
124
+ </div>
125
+ </div>
126
+
127
+
128
+ <div class="row">
129
+ <div class="col-lg-3">
130
+ <div class="box_widget greenBox">
131
+ <a target="_blank" href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?attribute_license=Single%20License%2029$&box=true"><img src="<?php echo esc_url(plugins_url('/images/upgrade_now.png', AHCFREE_PLUGIN_MAIN_FILE)) ?>"></a>
132
+ <br /><span class="txt"><img src="<?php echo esc_url(plugins_url('/images/live.gif', AHCFREE_PLUGIN_MAIN_FILE)) ?>">&nbsp; Online Users</span>
133
+ </div>
134
+ </div>
135
+ <div class="col-lg-3">
136
+ <div class="box_widget blueBox">
137
+ <span id="today_visitors_box">0</span><br /><span class="txt">Today Visitors</span>
138
+ </div>
139
+ </div>
140
+ <div class="col-lg-3">
141
+ <div class="box_widget redBox">
142
+ <span id="today_visits_box">0</span><br /><span class="txt">Today Visits</span>
143
+ </div>
144
+ </div>
145
+ <div class="col-lg-3">
146
+ <div class="box_widget movBox">
147
+ <span id="today_search_box">0</span><br /><span class="txt">Search Engines</span>
148
+ </div>
149
+ </div>
150
+ </div>
151
+
152
+ <div class="row">
153
+ <div class="col-lg-12">
154
+
155
+ <div class="panel" style="background-color:white ;border-radius: 7px;">
156
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">
157
+ <?php echo "Traffic Report "; ?></h2>
158
+ <div class="hits_duration_select">
159
+
160
+
161
+ <select id="hits-duration" class="hits-duration" style="width: 150px; height: 35px; font-size: 15px;">
162
+ <option value="">Last <?php echo AHCFREE_VISITORS_VISITS_LIMIT; ?> days</option>
163
+ <option value="7">Last 7 days</option>
164
+ <option value="30">Last 30 days</option>
165
+ <option value="current_month">This month</option>
166
+ <option value="last_month">Last month</option>
167
+ <option value="0">All Time</option>
168
+ <option value="range">Custom Period</option>
169
+ </select>
170
+
171
+ <span id="duration_area">
172
+ <?php
173
+ $summary_from_dt = isset($_POST['summary_from_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['summary_from_dt']) : '';
174
+ $summary_to_dt = isset($_POST['summary_to_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['summary_to_dt']) : '';
175
+ ?>
176
+ <input type="text" readonly="readonly" placeholder="From Date" class="ahc_clear" name="summary_from_dt" id="summary_from_dt" autocomplete="off" value="<?php echo esc_attr($summary_from_dt); ?>" />
177
+ <input type="text" readonly="readonly" placeholder="To Date" class="ahc_clear" name="summary_to_dt" id="summary_to_dt" autocomplete="off" value="<?php echo esc_attr($summary_to_dt); ?>" />
178
+ </span>
179
+
180
+
181
+ </div>
182
+ <div class="panelcontent" id="visitors_graph_stats" style="width:100% !important; overflow:hidden">
183
+ <div id="visitscount" style="height:400px; width:99% !important; "></div>
184
+ </div>
185
+ </div>
186
+
187
+ </div>
188
+ </div>
189
+ <div class="row">
190
+ <div class="col-lg-8">
191
+ <div class="panel" style="width:100% !important">
192
+
193
+ <div class="panelcontent" style="width:100% !important">
194
+ <a target="_blank" href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?attribute_license=Single%20License%2029$&box=true">
195
+ <img width="99%" src="<?php echo esc_url(plugins_url('/images/geomap_pro.jpg', AHCFREE_PLUGIN_MAIN_FILE)); ?>">
196
+ </a>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ <?php
201
+ $ahc_sum_stat = ahcfree_get_summary_statistics();
202
+ ?>
203
+ <div class="col-lg-4">
204
+ <div class="panel-group">
205
+ <div class="panel" style="width:100% !important">
206
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important"><?php echo ahc_summary_statistics ?></h2>
207
+ <div class="panelcontent" style="width:100% !important">
208
+ <table width="95%" border="0" cellspacing="0" id="summary_statistics">
209
+ <thead>
210
+ <tr>
211
+ <th width="40%"></th>
212
+ <th width="30%"><b><?php echo ahc_visitors ?></b></th>
213
+ <th width="30%"><?php echo ahc_visits ?></th>
214
+ </tr>
215
+ </thead>
216
+ <tbody>
217
+ <tr>
218
+ <td><b><?php echo ahc_today ?></b></td>
219
+ <td class="values"><span id="today_visitors"><?php echo ahcfree_NumFormat($ahc_sum_stat['today']['visitors']); ?></span></td>
220
+ <td class="values"><span id="today_visits"><?php echo ahcfree_NumFormat($ahc_sum_stat['today']['visits']); ?></span></td>
221
+ </tr>
222
+
223
+ <tr>
224
+ <td><b><?php echo ahc_yesterday ?></b></td>
225
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['yesterday']['visitors']); ?></td>
226
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['yesterday']['visits']); ?></td>
227
+ </tr>
228
+
229
+ <tr>
230
+ <td><b><?php echo ahc_this_week ?></b></td>
231
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['week']['visitors']); ?></td>
232
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['week']['visits']); ?></td>
233
+ </tr>
234
+
235
+ <tr>
236
+ <td><b><?php echo ahc_this_month ?></b></td>
237
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['month']['visitors']); ?></td>
238
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['month']['visits']); ?></td>
239
+ </tr>
240
+
241
+ <tr>
242
+ <td><b><?php echo ahc_this_yesr ?></b></td>
243
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['year']['visitors']); ?></td>
244
+ <td class="values"><?php echo ahcfree_NumFormat($ahc_sum_stat['year']['visits']); ?></td>
245
+ </tr>
246
+
247
+ <tr>
248
+ <td style="color:#090"><strong><b><?php echo ahc_total ?></b></strong></td>
249
+ <td class="values" style="color:#090"><strong><?php echo ahcfree_NumFormat($ahc_sum_stat['total']['visitors']); ?></strong></td>
250
+ <td class="values" style="color:#090"><strong><?php echo ahcfree_NumFormat($ahc_sum_stat['total']['visits']); ?></strong></td>
251
+ </tr>
252
+ </tbody>
253
+ </table>
254
+ <!-- end visitors and visits section -->
255
+
256
+ </div>
257
+ </div>
258
+
259
+ <div class="panel" style="width:100% !important">
260
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important"><?php echo ahc_search_engines_statistics ?></h2>
261
+ <div class="panelcontent" style="width:100% !important">
262
+ <table width="95%" border="0" cellspacing="0" id="search_engine">
263
+ <thead>
264
+ <tr>
265
+ <th width="40%">Engine</th>
266
+ <th width="30%">Total</th>
267
+
268
+ </tr>
269
+ </thead>
270
+ <tbody>
271
+ <?php
272
+
273
+ $alltimeSER = ahcfree_get_hits_search_engines_referers('alltime');
274
+
275
+ $tot_srch = 0;
276
+ if (is_array($alltimeSER)) {
277
+ foreach ($alltimeSER as $ser => $v) {
278
+ $tot_srch += $v;
279
+ $ser = (!empty($ser)) ? $ser : 'Other';
280
+ ?>
281
+ <tr>
282
+ <td>
283
+ <div>
284
+ <span><b><?php echo esc_html($ser); ?></b></span>
285
+ </div>
286
+ </td>
287
+ <td class="values"><?php echo ahcfree_NumFormat(intval($v)); ?></td>
288
+
289
+ </tr>
290
+ <?php
291
+ }
292
+ }
293
+ ?>
294
+ <tr>
295
+ <td><strong>Total </strong></td>
296
+ <td class="values"><strong id="today_search"><?php echo ahcfree_NumFormat(intval($tot_srch)); ?></strong></td>
297
+
298
+ </tr>
299
+
300
+ </tbody>
301
+ </table>
302
+ </div>
303
+ </div>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ <div class="row">
308
+ <div class="col-lg-8">
309
+ <div class="panel" style="width:100% !important">
310
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">Recent visitors by IP<span class="search_data"><a href="#" class="dashicons dashicons-search" title="Search"></a></span></h2>
311
+ <div class="search-panel <?php echo (isset($_POST['section']) && $_POST['section'] == "recent_visitor_by_ip") ? "open" : ''; ?>">
312
+ <form method="post" class="search_frm">
313
+
314
+
315
+ <?php
316
+ $r_from_dt = isset($_POST['r_from_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['r_from_dt']) : '';
317
+ $r_to_dt = isset($_POST['r_to_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['r_to_dt']) : '';
318
+ $ip_addr = isset($_POST['ip_addr']) ? ahc_free_sanitize_text_or_array_field($_POST['ip_addr']) : '';
319
+ ?>
320
+
321
+
322
+ <label>Search: </label>
323
+ <input type="hidden" name="page" value="ahc_hits_counter_menu_free" />
324
+ <input type="hidden" name="section" value="recent_visitor_by_ip" />
325
+ <input type="text" readonly="readonly" placeholder="From Date" class="ahc_clear" name="r_from_dt" id="r_from_dt" autocomplete="off" value="<?php echo esc_attr($r_from_dt); ?>" />
326
+ <input type="text" readonly="readonly" placeholder="To Date" class="ahc_clear" name="r_to_dt" id="r_to_dt" autocomplete="off" value="<?php echo esc_attr($r_to_dt); ?>" />
327
+ <input type="text" name="ip_addr" id="ip_addr" placeholder="IP address" class="ahc_clear" value="<?php echo esc_attr($ip_addr); ?>" />
328
+ <input type="submit" class="button button-primary" />
329
+ <input type="button" class="button button-primary clear_form" value="Clear" />
330
+ </form>
331
+ </div>
332
+ <div class="panelcontent" style="width:100% !important">
333
+
334
+
335
+ <table width="95%" border="0" cellspacing="0" class="recentv" id="recent_visit_by_ip">
336
+ <thead>
337
+ <tr>
338
+
339
+ <th>IP Address</th>
340
+ <th>Location</th>
341
+
342
+
343
+ <th>Time</th>
344
+ </tr>
345
+ </thead>
346
+
347
+
348
+ <tbody>
349
+
350
+ </tbody>
351
+
352
+
353
+ </table>
354
+
355
+
356
+ </div>
357
+ </div>
358
+ </div>
359
+ <?php
360
+
361
+ $countries = array();
362
+ ?>
363
+ <div class="col-lg-4">
364
+ <div class="panel" style="width:100% !important">
365
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">
366
+ <?php
367
+ if (isset($_POST['t_from_dt']) && $_POST['t_from_dt'] != '' && isset($_POST['section']) && $_POST['section'] == "traffic_index_country") {
368
+ echo "Traffic Index by Country";
369
+ } else {
370
+ echo "Today Traffic by Country ";
371
+ }
372
+ ?>
373
+ <span class="search_data"><a href="#" class="dashicons dashicons-search" title="Search"></a></span>
374
+ </h2>
375
+
376
+ <div class="panelcontent" style="width:100% !important">
377
+ <a target="_blank" href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?attribute_license=Single%20License%2029$&box=true">
378
+ <img width="99%" src="<?php echo plugins_url('/images/today_traffic_by_country_pro.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>">
379
+ </a>
380
+ </div>
381
+
382
+ </div>
383
+ </div>
384
+ </div>
385
+
386
+ <div class="row">
387
+ <div class="col-lg-6">
388
+ <!-- browsers chart panel -->
389
+ <div class="panel" style="width:100% !important; overflow:hidden">
390
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important"><?php echo ahc_browsers ?></h2>
391
+ <div class="panelcontent" style="width:100% !important">
392
+ <div class="row">
393
+ <div class="col-lg-12">
394
+ <div id="brsPiechartContainer" style=" height: 400px;"></div>
395
+ </div>
396
+
397
+
398
+
399
+ </div>
400
+ </div>
401
+ </div>
402
+ </div>
403
+ <div class="col-lg-6">
404
+ <!-- search engines chart panel -->
405
+
406
+
407
+ <div class="panel" style="width:100% !important; overflow:hidden">
408
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">Search Engines</h2>
409
+ <div class="panelcontent" style="width:100% !important">
410
+ <div class="row">
411
+ <div class="col-lg-12">
412
+ <div id="srhEngBieChartContainer" style=" height: 400px;"></div>
413
+ </div>
414
+
415
+
416
+
417
+ </div>
418
+ </div>
419
+ </div>
420
+
421
+
422
+
423
+
424
+ </div>
425
+ </div>
426
+
427
+
428
+ <div class="row">
429
+ <?php
430
+ /*$countries_data = ahcfree_get_top_countries("","","","",true);*/
431
+ $countries_data = array();
432
+ if (isset($countries_data['data'])) {
433
+ $countries = $countries_data['data'];
434
+ } else {
435
+ $countries = false;
436
+ }
437
+ ?>
438
+ <div class="col-lg-6">
439
+ <div class="panel" style="width:100% !important">
440
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">Traffic by country (all time)</h2>
441
+ <div class="panelcontent" style="width:100% !important">
442
+ <a target="_blank" href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?attribute_license=Single%20License%2029$&box=true">
443
+ <img width="99%" src="<?php echo esc_url(plugins_url('/images/traffic_by_country_pro.jpg', AHCFREE_PLUGIN_MAIN_FILE)); ?>">
444
+ </a>
445
+ </div>
446
+ </div>
447
+
448
+ </div>
449
+
450
+ <div class="col-lg-6">
451
+ <!-- Countries chart panel -->
452
+ <div class="panel" style="width:100% !important">
453
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">Top Referring Countries (all time)</h2>
454
+
455
+ <div class="panelcontent" style="width:100% !important">
456
+ <a target="_blank" href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?attribute_license=Single%20License%2029$&box=true">
457
+ <img width="99%" src="<?php echo esc_url(plugins_url('/images/top_refferring_countries_pro.jpg', AHCFREE_PLUGIN_MAIN_FILE)); ?>">
458
+ </a>
459
+ </div>
460
+
461
+ </div>
462
+
463
+ </div>
464
+ </div>
465
+ <div class="row">
466
+ <div class="col-lg-6">
467
+
468
+ <div class="panel" style="width:100% !important">
469
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important"><?php echo ahc_refering_sites ?> (Top 20)<span class="export_data"><a href="#" class="dashicons dashicons-external" title="Export Data"></a></span></h2>
470
+ <div class="panelcontent" style="width:100% !important">
471
+ <table width="95%" border="0" cellspacing="0" id="top_refering_sites">
472
+ <thead>
473
+ <tr>
474
+ <th width="70%"><?php echo ahc_site_name ?></th>
475
+ <th width="30%"><?php echo ahc_total_times ?></th>
476
+ </tr>
477
+ </thead>
478
+ <tbody>
479
+ <?php
480
+ $googlehits = 0;
481
+
482
+ $norecord = "";
483
+ $referingSites = ahcfree_get_top_refering_sites();
484
+ if (is_array($referingSites) && count($referingSites) > 0) {
485
+ foreach ($referingSites as $site) {
486
+ /*if (strpos($site['site_name'], 'google')) {
487
+ $googlehits += $site['total_hits'];
488
+ } else {
489
+ */
490
+
491
+ str_replace('https://', '', $site['site_name']);
492
+ ?>
493
+ <tr>
494
+ <td class="values"><?php echo esc_html($site['site_name']); ?>&nbsp;<a href="https://<?php echo str_replace('http://', '', esc_url($site['site_name'])) ?>" target="_blank"><img src="<?php echo esc_url(plugins_url('/images/openW.jpg', AHCFREE_PLUGIN_MAIN_FILE)) ?>" title="<?php echo esc_attr(ahc_view_referer) ?>"></a></td>
495
+ <td class="values"><?php echo intval($site['total_hits']); ?></td>
496
+ </tr>
497
+
498
+ <?php
499
+ //}
500
+ }
501
+ } else {
502
+ $norecord = 1;
503
+ }
504
+ ?>
505
+ </tbody>
506
+ </table>
507
+ <?php
508
+ if ($norecord == "1") {
509
+ ?>
510
+ <div class="no-record">No data available.</div>
511
+ <?php
512
+ }
513
+ ?>
514
+ </div>
515
+ </div>
516
+
517
+ </div>
518
+
519
+
520
+
521
+ <div class="col-lg-6">
522
+ <!-- time visits graph begin -->
523
+ <?php
524
+ //$times = ahcfree_get_time_visits();
525
+ $times = array();
526
+ ?>
527
+ <div class="panel" style="width:100% !important">
528
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important">Today's time graph<span class="search_data"><a href="#" class="dashicons dashicons-search" title="Search"></a></span><span class="export_data"><a href="#" class="dashicons dashicons-external" title="Export Data"></a></span></h2>
529
+ <div class="search-panel <?php echo (isset($_POST['section']) && $_POST['section'] == "visit_time") ? "open" : ''; ?>">
530
+ <form method="post" class="search_frm">
531
+ <?php
532
+ $vfrom_dt = isset($_POST['vfrom_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['vfrom_dt']) : '';
533
+ $vto_dt = isset($_POST['vto_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['vto_dt']) : '';
534
+ ?>
535
+
536
+ <label>Search : </label>
537
+ <input type="hidden" name="page" value="ahc_hits_counter_menu_free" />
538
+ <input type="hidden" name="section" value="visit_time" />
539
+ <input type="text" readonly="readonly" placeholder="From Date" class="ahc_clear" name="vfrom_dt" id="vfrom_dt" autocomplete="off" value="<?php echo esc_attr($vfrom_dt); ?>" />
540
+ <input type="text" readonly="readonly" placeholder="To Date" class="ahc_clear" name="vto_dt" id="vto_dt" autocomplete="off" value="<?php echo esc_attr($vto_dt); ?>" />
541
+ <input type="submit" class="button button-primary" />
542
+ <input type="button" class="button button-primary clear_form" value="Clear" />
543
+ </form>
544
+ </div>
545
+ <div class="panelcontent" style="padding-right: 50px;">
546
+ <table width="100%" border="0" cellspacing="0" id="visit_time_graph_table">
547
+ <thead>
548
+ <tr>
549
+ <th width="25%"><?php echo ahc_time ?></th>
550
+ <th width="55%"><?php echo ahc_visitors_graph ?></th>
551
+ <th width="10%"><?php echo ahc_visitors ?></th>
552
+ <th width="10%">Visits</th>
553
+ </tr>
554
+ </thead>
555
+ <tbody>
556
+ <?php
557
+ if (is_array($times)) {
558
+ foreach ($times as $t) {
559
+ ?>
560
+ <tr>
561
+ <td class="values"><?php echo esc_html($t['vtm_time_from']) . ' - ' . esc_html($t['vtm_time_to']) ?></td>
562
+ <td class="values">
563
+ <div class="visitorsGraphContainer">
564
+ <div class="<?php
565
+ if (ceil($t['percent']) > 25 && ceil($t['percent']) < 50) {
566
+ echo 'visitorsGraph2';
567
+ } else if (ceil($t['percent']) > 50) {
568
+ echo 'visitorsGraph3';
569
+ } else {
570
+ echo 'visitorsGraph';
571
+ }
572
+ ?>" <?php echo (!empty($t['percent']) ? ' ** style="width: ' . ceil($t['percent']) . '%;"' : '') ?>>&nbsp;</div>
573
+ <div class="cleaner"></div>
574
+ </div>
575
+ <div class="visitorsPercent">(<?php echo ceil($t['percent']) ?>)%..</div>
576
+ </td>
577
+ <td class="values"><?php echo intval($t['vtm_visitors']); ?></td>
578
+ <td class="values"><?php echo intval($t['vtm_visits']); ?></td>
579
+ </tr>
580
+ <?php
581
+ }
582
+ }
583
+ ?>
584
+ </tbody>
585
+ </table>
586
+ </div>
587
+ </div>
588
+ </div>
589
+ </div>
590
+ <div class="row">
591
+ <!-- traffic by title -->
592
+ <div class="col-lg-6">
593
+ <?php
594
+ /*$tTitles = ahcfree_get_traffic_by_title();*/
595
+ $tTitles = array();
596
+ ?>
597
+ <div class="panel" style="width:100% !important">
598
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important"><?php echo traffic_by_title ?> (all time)<span class="search_data"><a href="#" class="dashicons dashicons-search" title="Search"></a></span><span class="export_data"><a href="#" class="dashicons dashicons-external" title="Export Data"></a></span></h2>
599
+
600
+ <div class="panelcontent" style="padding-right: 50px;">
601
+ <table width="100%" border="0" cellspacing="0" id="traffic_by_title">
602
+ <thead>
603
+ <tr>
604
+ <th width="5%"><?php echo ahc_rank ?></th>
605
+ <th width="65%"><?php echo ahc_title ?></th>
606
+ <th width="15%"><?php echo ahc_hits ?></th>
607
+ <th width="15%"><?php echo ahc_percent ?></th>
608
+ </tr>
609
+ </thead>
610
+ <tbody>
611
+ <?php
612
+ $norecord = "";
613
+ if (is_array($tTitles) && count($tTitles) > 0) {
614
+ foreach ($tTitles as $t) {
615
+ ?>
616
+ <tr>
617
+ <td class="values"><?php echo intval($t['rank']) ?></td>
618
+ <td class="values"><a href="<?php echo esc_url(get_permalink($t['til_page_id'])); ?>" target="_blank"><?php echo esc_html($t['til_page_title']); ?></a></td>
619
+ <td class="values"><?php echo ahcfree_NumFormat(intval($t['til_hits'])); ?></td>
620
+ <td class="values"><?php echo esc_html($t['percent']) ?></td>
621
+ </tr>
622
+ <?php
623
+ }
624
+ }
625
+
626
+ ?>
627
+ </tbody>
628
+ </table>
629
+
630
+ </div>
631
+ </div>
632
+ </div>
633
+
634
+ <div class="col-lg-6">
635
+ <?php
636
+ /*$lastSearchKeyWordsUsed = ahcfree_get_latest_search_key_words_used();*/
637
+ $lastSearchKeyWordsUsed = array();
638
+ /*if ($lastSearchKeyWordsUsed)
639
+ {*/
640
+ ?>
641
+ <!-- last search key words used -->
642
+ <div class="panel" style="width:100% !important">
643
+ <h2 class="box-heading" style="border-radius: 7px 7px 0 0 !important; padding:12px 15px !important ; border-bottom:0 !important"><?php echo ahc_latest_search_words; ?> (all time)<span class="search_data"><a href="#" class="dashicons dashicons-search" title="Search"></a></span><span class="export_data"><a href="#" class="dashicons dashicons-external" title="Export Data"></a></span></h2>
644
+ <div class="search-panel <?php echo (isset($_POST['section']) && $_POST['section'] == "lastest_search") ? "open" : ''; ?>">
645
+ <form method="post" class="search_frm">
646
+
647
+ <?php
648
+ $from_dt = isset($_POST['from_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['from_dt']) : '';
649
+ $to_dt = isset($_POST['to_dt']) ? ahc_free_sanitize_text_or_array_field($_POST['to_dt']) : '';
650
+
651
+ ?>
652
+ <label>Search in Time Frame: </label>
653
+ <input type="hidden" name="page" value="ahc_hits_counter_menu_free" />
654
+ <input type="hidden" name="section" value="lastest_search" />
655
+ <input type="text" readonly="readonly" placeholder="From Date" class="ahc_clear" name="from_dt" id="from_dt" autocomplete="off" value="<?php echo esc_attr($from_dt); ?>" />
656
+ <input type="text" readonly="readonly" placeholder="To Date" class="ahc_clear" name="to_dt" id="to_dt" autocomplete="off" value="<?php echo esc_attr($to_dt); ?>" />
657
+ <input type="submit" class="button button-primary" />
658
+ <input type="button" class="button button-primary clear_form" value="Clear" />
659
+ </form>
660
+ </div>
661
+ <div class="panelcontent" style="padding-right: 50px;">
662
+ <table width="100%" border="0" cellspacing="0" id="lasest_search_words">
663
+ <thead>
664
+ <tr>
665
+ <th width="20%">Country</th>
666
+ <th width="30%">Info.</th>
667
+ <th width="40%">Keyword</th>
668
+ <th width="10%" class='text-center'>Date</th>
669
+ </tr>
670
+ </thead>
671
+
672
+
673
+ <?php
674
+ if (count($lastSearchKeyWordsUsed) > 0) {
675
+ ?>
676
+ <tbody>
677
+ <?php
678
+ foreach ($lastSearchKeyWordsUsed as $searchWord) {
679
+ $visitDate = new DateTime($searchWord['hit_date']);
680
+ $visitDate->setTimezone($custom_timezone);
681
+ ?>
682
+ <tr>
683
+ <td>
684
+ <span><?php if ($searchWord['ctr_internet_code'] != '') { ?><img src="<?php echo plugins_url('/images/flags/' . strtolower($searchWord['ctr_internet_code']) . '.png', AHCFREE_PLUGIN_MAIN_FILE); ?>" border="0" width="22" height="18" title="<?php echo esc_html($searchWord['ctr_name']) ?>" onerror="imgFlagError(this)" /><?php } ?></span>
685
+ </td>
686
+ <td class="hide"><?php echo esc_html($searchWord['csb']); ?></td>
687
+ <td>
688
+ <span class="searchKeyWords"><a href="<?php echo esc_url($searchWord['hit_referer']); ?>" target="_blank"><?php echo esc_html($searchWord['hit_search_words']) ?></a></span>
689
+ </td>
690
+ <td>
691
+ <span class="visitDateTime">&nbsp;<?php echo esc_html($visitDate->format('d/m/Y')); ?></span>
692
+ </td>
693
+ </tr>
694
+ <?php
695
+ }
696
+ ?>
697
+ </tbody>
698
+ <?php
699
+ }
700
+
701
+ ?>
702
+ </table>
703
+ </div>
704
+ </div>
705
+
706
+ <?php /*}*/ ?>
707
+ </div>
708
+ </div>
709
+ <div class="row">
710
+ <div class="col-12">
711
+ <div class="panel" style="background-color: #fff; border-radius:7px ; padding:20px 10px 10px 10px">
712
+ <center>
713
+ <a target="_blank" href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?attribute_license=Single%20License%2029$&footer=true">
714
+ <p style="color:#00F; font-size:15px;">if you need more statistics you can upgrade to the professional version now, The premium version of Visitor Traffic real-time statistics is completely different from the free version as there are a lot more features included.</p>
715
+
716
+ <p><img height="auto" src="<?php echo esc_url(plugins_url('/images/upgradenow-button.png', AHCFREE_PLUGIN_MAIN_FILE)); ?>" /></p>
717
+ </a>
718
+ </center>
719
+ </div>
720
+
721
+
722
+ </div>
723
+ </div>
724
+ <?php
725
+ $visits_visitors_data = ahcfree_get_visits_by_custom_duration_callback($mystart_date, $myend_date, $stat = '');
726
+ ?>
727
+
728
+
729
+ <?php
730
+ wp_register_script('ahc_gstatic_js', 'https://www.gstatic.com/charts/loader.js', array(), '1.0.0', true);
731
+ wp_enqueue_script('ahc_gstatic_js');
732
+ ?>
733
+ <script language="javascript" type="text/javascript">
734
+ function drawVisitsLineChart(start_date, end_date, interval, visitors, visits, duration) {
735
+
736
+
737
+
738
+ google.charts.load('current', {
739
+ 'packages': ['line']
740
+ });
741
+ google.charts.setOnLoadCallback(drawChart);
742
+
743
+
744
+ var dataRows = [
745
+ ['Date', 'Visitors', 'Page Views']
746
+ ];
747
+ for (var i = 0; i < visitors.length; i++) {
748
+ //alert(visitors[i][1]);
749
+ dataRows.push([visitors[i][0], parseFloat(visitors[i][1]), parseFloat(visits[i][1])]);
750
+ }
751
+
752
+
753
+ function drawChart() {
754
+ var data = google.visualization.arrayToDataTable(dataRows);
755
+
756
+ var options = {
757
+ title: 'Traffic Report',
758
+
759
+ curveType: 'none',
760
+ legend: {
761
+ position: 'top',
762
+ textStyle: {
763
+ color: 'blue',
764
+ fontSize: 16
765
+ }
766
+ }
767
+ };
768
+
769
+ var chart = new google.charts.Line(document.getElementById('visitscount'));
770
+
771
+ chart.draw(data, options);
772
+ }
773
+
774
+
775
+
776
+
777
+ }
778
+
779
+ function drawBrowsersPieChart() {
780
+
781
+
782
+ google.charts.load('current', {
783
+ 'packages': ['corechart']
784
+ });
785
+ google.charts.setOnLoadCallback(drawChart);
786
+
787
+ function drawChart() {
788
+
789
+ var data = new google.visualization.DataTable();
790
+ data.addColumn('string', 'Browser');
791
+ data.addColumn('number', 'Hits');
792
+ data.addRows([
793
+
794
+ <?php echo ahcfree_get_browsers_hits_counts(); ?>
795
+ ]);
796
+
797
+ var options = {
798
+ title: '',
799
+ slices: {
800
+ 4: {
801
+ offset: 0.2
802
+ },
803
+ 12: {
804
+ offset: 0.3
805
+ },
806
+ 14: {
807
+ offset: 0.4
808
+ },
809
+ 15: {
810
+ offset: 0.5
811
+ },
812
+ },
813
+ };
814
+
815
+ var chart = new google.visualization.PieChart(document.getElementById('brsPiechartContainer'));
816
+ chart.draw(data, options);
817
+ }
818
+
819
+
820
+
821
+ }
822
+
823
+ function drawSrhEngVstLineChart() {
824
+
825
+
826
+ google.charts.load('current', {
827
+ 'packages': ['corechart']
828
+ });
829
+ google.charts.setOnLoadCallback(drawChart);
830
+
831
+ function drawChart() {
832
+
833
+ var data = new google.visualization.DataTable();
834
+ data.addColumn('string', 'Browser');
835
+ data.addColumn('number', 'Hits');
836
+ data.addRows([
837
+
838
+ <?php echo ahcfree_get_serch_visits_by_date(); ?>
839
+ ]);
840
+
841
+ var options = {
842
+ title: '',
843
+ slices: {
844
+ 4: {
845
+ offset: 0.2
846
+ },
847
+ 12: {
848
+ offset: 0.3
849
+ },
850
+ 14: {
851
+ offset: 0.4
852
+ },
853
+ 15: {
854
+ offset: 0.5
855
+ },
856
+ },
857
+ };
858
+
859
+ var chart = new google.visualization.PieChart(document.getElementById('srhEngBieChartContainer'));
860
+ chart.draw(data, options);
861
+ }
862
+
863
+
864
+
865
+ }
866
+
867
+ var mystart_date = "<?php echo esc_js($mystart_date); ?>";
868
+ var myend_date = "<?php echo esc_js($myend_date); ?>";
869
+ var mystart_date_full = "<?php echo esc_js($mystart_date_full); ?>";
870
+ var myend_date_full = "<?php echo esc_js($myend_date_full); ?>";
871
+
872
+
873
+ var countriesData = <?php echo json_encode(ahcfree_get_top_countries(10, "", "", "", false)); ?>;
874
+ var visits_data = <?php echo json_encode($visits_visitors_data['visits']); ?>;
875
+ var visitors_data = <?php echo json_encode($visits_visitors_data['visitors']); ?>;
876
+ //console.log(visits_data);
877
+ // console.log(visitors_data);
878
+ jQuery(document).ready(function() {
879
+ jQuery('#duration_area').hide();
880
+
881
+ //------------------------------------------
882
+ //if(visitsData.success && typeof visitsData.data != 'undefined'){
883
+ var duration = jQuery('#hits-duration').val();
884
+ drawVisitsLineChart(mystart_date, myend_date, '1 day', visitors_data, visits_data, duration);
885
+ //}
886
+ //------------------------------------------
887
+
888
+
889
+
890
+ if (typeof drawBrowsersPieChart === "function") {
891
+
892
+ drawBrowsersPieChart();
893
+ }
894
+ //------------------------------------------
895
+ if (typeof drawSrhEngVstLineChart === "function") {
896
+ drawSrhEngVstLineChart();
897
+ }
898
+
899
+
900
+
901
+
902
+
903
+ jQuery(document).on('click', '.SwalBtn1', function() {
904
+ swal.clickConfirm();
905
+ });
906
+ jQuery(document).on('click', '.SwalBtn2', function() {
907
+ window.open(
908
+ "https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?popup=1",
909
+ '_blank'
910
+ );
911
+
912
+ swal.clickConfirm();
913
+ });
914
+ jQuery(document).on('click', '.SwalBtn3', function() {
915
+ localStorage.setItem("ahcfreemsg", "1");
916
+ swal.clickConfirm();
917
+ });
918
+
919
+ var save_method; //for save method string
920
+ var host=window.location.hostname;
921
+ var fullpath=window.location.pathname;
922
+ var fullparam=window.location.search.split('&');
923
+
924
+ var firstparam=fullparam[0];
925
+
926
+ if(localStorage && (firstparam=="?page=ahc_hits_counter_menu_free"))
927
+ {
928
+
929
+ var today_visitors_box = document.getElementById('today_visitors_box').innerHTML;
930
+ if (!localStorage.getItem("ahcfreemsg")==true)
931
+ {
932
+ if(today_visitors_box > 5)
933
+ {
934
+ setTimeout(function(){
935
+
936
+ swal({
937
+ title: '',
938
+ text: '',
939
+ imageUrl: 'https://www.wp-buy.com/wp-content/uploads/2018/10/output_ZD6GUg-1-2.gif',
940
+ imageWidth: 'auto',
941
+ imageHeight: 'auto',
942
+ imageAlt: 'Need more statistics, GEO locations & online counter?',
943
+ animation: true,
944
+ customClass: 'swal-noscroll',
945
+ allowEscapeKey:true,
946
+ showCancelButton: false,
947
+ showConfirmButton: false,
948
+ html: 'Need more statistics, GEO locations & online counter?<br><br><center><button type="button" role="button" class="confirm btn btn-success SwalBtn2">' + 'Upgrade to pro' + '</button>&nbsp;&nbsp;' +
949
+ '<button type="button" role="button" class="cancel btn btn-info SwalBtn1">' + 'Close' + '</button>&nbsp;&nbsp;'+
950
+ '<button type="button" role="button" class="confirm btn btn-warning SwalBtn3">' + "Dismiss" + '</button></center>'
951
+ });
952
+ }, 5000);
953
+ }
954
+
955
+
956
+ }
957
+
958
+
959
+
960
+
961
+ }
962
+
963
+ });
964
+
965
+ jQuery(document).on('change', '#hits-duration', function() {
966
+
967
+
968
+ var self = jQuery(this);
969
+ var duration = self.val();
970
+ if (duration == 'range') {
971
+ jQuery('#duration_area').show();
972
+
973
+ } else {
974
+ jQuery('#duration_area').hide();
975
+
976
+ jQuery('#visitors_graph_stats').addClass('loader');
977
+ jQuery.ajax({
978
+ url: ahc_ajax.ajax_url,
979
+ data: {
980
+ action: 'ahcfree_get_hits_by_custom_duration',
981
+ 'hits_duration': duration
982
+ },
983
+ method: 'post',
984
+ success: function(res) {
985
+ if (res) {
986
+ var data = jQuery.parseJSON(res);
987
+
988
+ var start_date = data.mystart_date;
989
+ var end_date = data.myend_date;
990
+ var full_start_date = data.full_start_date;
991
+ var full_end_date = data.full_end_date;
992
+ var interval = data.interval;
993
+ var visitors = JSON.parse(data.visitors_data);
994
+ var visits = JSON.parse(data.visits_data);
995
+
996
+ drawVisitsLineChart(start_date, end_date, interval, visitors, visits, duration);
997
+ jQuery('#visitors_graph_stats').removeClass('loader');
998
+ return false;
999
+ }
1000
+ }
1001
+ });
1002
+ }
1003
+ });
1004
+
1005
+ jQuery(document).on('change', '#summary_from_dt, #summary_to_dt', function() {
1006
+ var self = jQuery(this);
1007
+ var duration = jQuery('#summary_from_dt').val() + '#' + self.val();
1008
+
1009
+ if (jQuery('#summary_to_dt').val() != '') {
1010
+ jQuery('#visitors_graph_stats').addClass('loader');
1011
+
1012
+ jQuery.ajax({
1013
+ url: ahc_ajax.ajax_url,
1014
+ data: {
1015
+ action: 'ahcfree_get_hits_by_custom_duration',
1016
+ 'hits_duration_from': jQuery('#summary_from_dt').val(),
1017
+ 'hits_duration_to': jQuery('#summary_to_dt').val(),
1018
+ 'hits_duration': 'range'
1019
+ },
1020
+ method: 'post',
1021
+ success: function(res) {
1022
+ if (res) {
1023
+ var data = jQuery.parseJSON(res);
1024
+ //console.log(data);
1025
+ var start_date = data.full_start_date;
1026
+ var end_date = data.full_end_date;
1027
+ var full_start_date = data.full_start_date;
1028
+ var full_end_date = data.full_end_date;
1029
+ var interval = data.interval;
1030
+ var visitors = JSON.parse(data.visitors_data);
1031
+ var visits = JSON.parse(data.visits_data);
1032
+ // console.log(visitors);
1033
+ // console.log(visits);
1034
+ drawVisitsLineChart(start_date, end_date, interval, visitors, visits, 'range');
1035
+ jQuery('#visitors_graph_stats').removeClass('loader');
1036
+ return false;
1037
+ }
1038
+ }
1039
+ });
1040
+ }
1041
+ });
1042
+
1043
+ document.getElementById('today_visitors_box').innerHTML = (document.getElementById('today_visitors').innerHTML);
1044
+ //document.getElementById('today_visitors_detail_cnt').innerHTML = (document.getElementById('today_visitors').innerHTML);
1045
+ document.getElementById('today_visits_box').innerHTML = (document.getElementById('today_visits').innerHTML);
1046
+ document.getElementById('today_search_box').innerHTML = (document.getElementById('today_search').innerHTML);
1047
+ </script>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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: 6.0
6
- Stable tag: 6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -178,10 +178,17 @@ This plugin supports IPv6; however, PHP must be compiled with IPv6 support enabl
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
 
 
 
181
  = 6.1 =
182
  1. Bug fixing in traffic by IP report
183
 
184
-
185
  = 5.9 =
186
  1. Bug fixing (sweetalert conflict)
187
 
2
  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: 6.0.1
6
+ Stable tag: 6.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
178
 
179
  == Changelog ==
180
 
181
+ = 6.3 =
182
+ 1. Convert IPv6 to IPv4
183
+
184
+
185
+ = 6.2 =
186
+ 1. change widgets colors
187
+
188
+
189
  = 6.1 =
190
  1. Bug fixing in traffic by IP report
191
 
 
192
  = 5.9 =
193
  1. Bug fixing (sweetalert conflict)
194