Visitors Traffic Real Time Statistics - Version 1.21

Version Description

Bug fixing - Notice: Constant IS_DEMO already defined

Download this release

Release Info

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

Code changes from version 1.17 to 1.21

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: 1.17
8
Text Domain: vtrts-free
9
Domain Path: /languages
10
*/
@@ -22,7 +22,7 @@ if( !function_exists('get_plugin_data') ){
22
include_once(ABSPATH . 'wp-includes/pluggable.php');
23
24
}
25
-
26
27
function ahcfree_plugin_action_links( $links ) {
28
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: 1.21
8
Text Domain: vtrts-free
9
Domain Path: /languages
10
*/
22
include_once(ABSPATH . 'wp-includes/pluggable.php');
23
24
}
25
+ include_once("notifications.php");
26
27
function ahcfree_plugin_action_links( $links ) {
28
ahc_settings.php CHANGED
@@ -1,5 +1,5 @@
1
-
2
i{
3
}
4
i{
5
}
6
if (!empty($_POST['save'])) {
7
if (ahcfree_savesettings()) {
8
- }
9
<h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics <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></h1><br />
10
<div class="panel">
11
<h2 style="height:35px !important; font-size:13px !important">Settings</h2>
12
<option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
13
global $wp_roles;
14
if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
15
$available_roles_names = $wp_roles->get_names();//we get all roles names
16
$available_roles_capable = array();
17
foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
18
$role_object = get_role( $role_key );//we get the Role Object
19
$array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
20
if($array_of_capabilities['update_plugins'] == 1 || $array_of_capabilities['manage_links'] == 1 || $array_of_capabilities['manage_sites'] == 1 ){ //we check if the upload_files capability is present, and if its present check if its 0 (FALSE in Php)
21
$available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
22
}
23
}
24
25
select: \'#ahcUserRoles\'
26
<h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics <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></h1><br />
27
<div class="panel">
28
<h2 style="height:35px !important; font-size:13px !important">Settings</h2>
29
<option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
30
global $wp_roles;
31
if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
32
$available_roles_names = $wp_roles->get_names();//we get all roles names
33
$available_roles_capable = array();
34
foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
35
$role_object = get_role( $role_key );//we get the Role Object
36
$array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
37
// if($array_of_capabilities['update_plugins'] == 1 || $array_of_capabilities['manage_links'] == 1 || $array_of_capabilities['manage_sites'] == 1 ){ //we check if the upload_files capability is present, and if its present check if its 0 (FALSE in Php)
38
$available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
39
// }
40
}
41
42
</div>
43
</form>
1
i{
2
}
3
+ <?php
4
i{
5
}
6
if (!empty($_POST['save'])) {
7
if (ahcfree_savesettings()) {
8
<h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics <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></h1><br />
9
<div class="panel">
10
<h2 style="height:35px !important; font-size:13px !important">Settings</h2>
11
<option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
12
global $wp_roles;
13
if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
14
$available_roles_names = $wp_roles->get_names();//we get all roles names
15
$available_roles_capable = array();
16
foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
17
$role_object = get_role( $role_key );//we get the Role Object
18
$array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
19
if($array_of_capabilities['update_plugins'] == 1 || $array_of_capabilities['manage_links'] == 1 || $array_of_capabilities['manage_sites'] == 1 ){ //we check if the upload_files capability is present, and if its present check if its 0 (FALSE in Php)
20
$available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
21
}
22
}
23
24
select: \'#ahcUserRoles\'
25
+ }
26
<h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics <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></h1><br />
27
<div class="panel">
28
<h2 style="height:35px !important; font-size:13px !important">Settings</h2>
29
<option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
30
global $wp_roles;
31
if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
32
$available_roles_names = $wp_roles->get_names();//we get all roles names
33
$available_roles_capable = array();
34
foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
35
$role_object = get_role( $role_key );//we get the Role Object
36
$array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
37
// if($array_of_capabilities['update_plugins'] == 1 || $array_of_capabilities['manage_links'] == 1 || $array_of_capabilities['manage_sites'] == 1 ){ //we check if the upload_files capability is present, and if its present check if its 0 (FALSE in Php)
38
$available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
39
// }
40
}
41
42
</div>
43
</form>
css/style-review.css ADDED
@@ -0,0 +1,279 @@
1
+ .vtrts_free_review-notice{
2
+ padding: 15px 15px 15px 0;
3
+ background-color: #fff;
4
+ border-radius: 3px;
5
+ margin: 20px 20px 0 0;
6
+ border-left: 4px solid rgb(67, 129, 228);
7
+ border-top: 1px solid #ccd0d4;
8
+ border-bottom: 1px solid #ccd0d4;
9
+ border-right: 1px solid #ccd0d4;
10
+ }
11
+ .vtrts_free_review-notice:after{
12
+ content: '';
13
+ display: table;
14
+ clear: both;
15
+ }
16
+ .vtrts_free_review-thumbnail{
17
+ width: 114px;
18
+ float: left;
19
+ line-height: 80px;
20
+ text-align: center;
21
+ border-right: 4px solid transparent;
22
+ }
23
+ .vtrts_free_review-thumbnail img{
24
+ width: 68px;
25
+ vertical-align: middle;
26
+ }
27
+ .vtrts_free_review-text{
28
+ overflow: hidden;
29
+ }
30
+ .vtrts_free_review-text h3{
31
+ font-size: 24px;
32
+ margin: 0 0 5px;
33
+ font-weight: 400;
34
+ line-height: 1.3;
35
+ }
36
+ .vtrts_free_review-text p{
37
+ font-size: 13px;
38
+ margin: 0 0 5px;
39
+ }
40
+ .vtrts_free_review-ul{
41
+ margin: 0;
42
+ padding: 0;
43
+ }
44
+ .vtrts_free_review-ul li{
45
+ display: inline-block;
46
+ margin-right: 15px;
47
+ }
48
+ .vtrts_free_review-ul li a{
49
+ display: inline-block;
50
+ color: #10738B;
51
+ text-decoration: none;
52
+ padding-left: 26px;
53
+ position: relative;
54
+ }
55
+ .vtrts_free_review-ul li a span{
56
+ position: absolute;
57
+ left: 0;
58
+ top: -2px;
59
+ }
60
+ .vtrts_free_dasboard-pro-link{
61
+ color: #0cbb0c;
62
+ }
63
+
64
+ /* LoginPress Add-ons CSS @since 1.1.3 */
65
+
66
+ .vtrts_free_alert-notice{
67
+ background: #fff;
68
+ margin: 20px 20px 0 0;
69
+ position: relative;
70
+ display: flex;
71
+ align-items: center;
72
+ clear: both;
73
+ }
74
+ .vtrts_free_alert-notice>*{
75
+ -webkit-box-sizing: border-box;
76
+ box-sizing: border-box;
77
+ }
78
+ .vtrts_free_alert-notice:after{
79
+ content: '';
80
+ display: table;
81
+ clear: both;
82
+ }
83
+ .vtrts_free_alert-thumbnail{
84
+ width: 300px;
85
+ text-align: center;
86
+ position: relative;
87
+ }
88
+ .vtrts_free_alert-thumbnail img{
89
+ width: 250px;
90
+ vertical-align: middle;
91
+ }
92
+ .vtrts_free_alert-text{
93
+ padding: 16px 80px 16px 80px;
94
+ overflow: hidden;
95
+ background: #1a5fa4;
96
+ position: relative;
97
+ flex: 1;
98
+ }
99
+ .black_friday_notic .vtrts_free_alert-text {
100
+ padding: 16px 10px 16px 80px;
101
+ }
102
+ .black_friday{
103
+ background: #000 !important;
104
+ text-align: center;
105
+ }
106
+ .black_friday:after{
107
+ display: none;
108
+ }
109
+ .black_friday_notic .vtrts_free_alert-text {
110
+ display: flex;
111
+ align-items: center;
112
+ }
113
+ .black_friday_notic .vtrts_free_alert-button-section {
114
+ width: 450px;
115
+ }
116
+ .vtrts_free_addon-notice-link:focus{
117
+ outline: none;
118
+ box-shadow: none;
119
+ }
120
+ .vtrts_free_alert-text:after{
121
+ width: 80px;
122
+ height: 100%;
123
+ background: #fff;
124
+ content: '';
125
+ position: absolute;
126
+ top: 0;
127
+ right: -40px;
128
+ transform: skewX(-20deg);
129
+ z-index: 1;
130
+ }
131
+ .vtrts_free_alert-text:before{
132
+ width: 80px;
133
+ height: 100%;
134
+ background: #fff;
135
+ content: '';
136
+ position: absolute;
137
+ top: 0;
138
+ left: -40px;
139
+ transform: skewX(-20deg);
140
+ z-index: 1;
141
+ }
142
+ .vtrts_free_alert-text h3{
143
+ font-size: 20px;
144
+ line-height: 24px;
145
+ margin: 0 0 10px;
146
+ color: #fff;
147
+ }
148
+ .vtrts_free_alert-text p{
149
+ font-size: 16px;
150
+ margin: 0;
151
+ color: #fff;
152
+ }
153
+ .black_friday_sale_btn .vtrts_free_alert-button {
154
+ display: inline-block;
155
+ padding: 24px 20px;
156
+ font-size: 38px;
157
+ background-color: #24afe9;
158
+ color: #000;
159
+ border-radius: 0px;
160
+ text-decoration: none;
161
+ font-weight: bold;
162
+ }
163
+ .vtrts_free_alert-button-section{
164
+ width: 300px;
165
+ text-align: center;
166
+ position: relative;
167
+ }
168
+ .vtrts_free_alert-button{
169
+ height: auto;
170
+ padding: 0;
171
+ color: #1a5fa4;
172
+ border: 0;
173
+ border-radius: 5px;
174
+ background: none;
175
+ font-size: 16px;
176
+ font-weight: bold;
177
+ text-decoration: underline;
178
+ cursor: pointer;
179
+ }
180
+ .vtrts_free_alert-button:focus{
181
+ outline: none;
182
+ box-shadow: none;
183
+ }
184
+ .wp-core-ui .vtrts_free_alert-notice.notice.is-dismissible{
185
+ padding: 0px;
186
+ border-left: 0px;
187
+ }
188
+ .vtrts_free_alert-notice .notice-dismiss{
189
+ text-decoration: none;
190
+ z-index: 1;
191
+ }
192
+ .vtrts_free_addon-notice-link{
193
+ display: flex;
194
+ align-items: center;
195
+ flex: 1;
196
+ text-decoration: none;
197
+ }
198
+ .vtrts_free_notice-logo{
199
+ width: 72px;
200
+ text-align: center;
201
+ position: relative;
202
+ margin: 10px;
203
+ }
204
+ .vtrts_free_notice-logo img{
205
+ width: 50px;
206
+ vertical-align: middle;
207
+ }
208
+
209
+ .vtrts_free_notice-discription{
210
+ overflow: hidden;
211
+ width: calc(100% - 50px);
212
+ }
213
+ .vtrts_free_notification.vtrts_free_notice-success{
214
+ border:1px solid #6ab074;
215
+ background: #e6f0e8;
216
+ margin: 36px 20px 0 0;
217
+ display: -webkit-box;
218
+ display: -ms-flexbox;
219
+ display: flex;
220
+ -webkit-box-align: center;
221
+ -ms-flex-align: center;
222
+ align-items: center;
223
+ }
224
+ .vtrts_free_notice-success .vtrts_free_notice-discription p{
225
+ color: #21573a;
226
+ }
227
+ .vtrts_free_notification.vtrts_free_notice-success .vtrts_free_notification-close:before{
228
+ color: #21573a;
229
+ }
230
+ @media screen and (max-width: 1300px) {
231
+ .vtrts_free_alert-thumbnail{
232
+ width: 200px;
233
+ }
234
+ .vtrts_free_alert-thumbnail img{
235
+ width: 170px;
236
+ }
237
+ .vtrts_free_alert-button-section{
238
+ width: 200px;
239
+ }
240
+ }
241
+ @media screen and (max-width: 1100px) {
242
+ .vtrts_free_alert-thumbnail{
243
+ display: none;
244
+ }
245
+ .vtrts_free_alert-thumbnail img{
246
+ width: 150px;
247
+ }
248
+ .vtrts_free_alert-text{
249
+ padding-left: 30px;
250
+ }
251
+ .vtrts_free_alert-text:before,.vtrts_free_alert-text:after{
252
+ display: none;
253
+ }
254
+ }
255
+ @media screen and (max-width: 782px) {
256
+ .vtrts_free_alert-text{
257
+ padding-right: 40px;
258
+ padding-bottom: 50px;
259
+ }
260
+ .vtrts_free_alert-button-section{
261
+ width: auto;
262
+ text-align: left;
263
+ }
264
+ .vtrts_free_alert-button-section{
265
+ position: absolute;
266
+ bottom: 20px;
267
+ left: 33px;
268
+ }
269
+ .vtrts_free_alert-button{
270
+ color: #fff;
271
+ }
272
+ .vtrts_free_alert-notice .notice-dismiss:before{
273
+ color: #fff;
274
+ }
275
+ .black_friday_sale_btn .vtrts_free_alert-button{
276
+ width: 310px;
277
+ text-align: center;
278
+ }
279
+ }
functions.php CHANGED
@@ -283,13 +283,17 @@ function ahcfree_create_admin_menu_link() {
283
$roles_arr[] = strtolower($v);
284
}
285
286
- if (! in_array( strtolower($current_user->roles[0]), $roles_arr ) && !(current_user_can('manage_options'))) {
287
288
- return;
289
}
290
291
- add_menu_page('Visitor Traffic Real Time Statistics', 'Visitor Traffic', 'manage_categories', 'ahc_hits_counter_menu_free', 'ahcfree_create_plugin_overview_page', plugins_url('/images/vtrts.png', AHCFREE_PLUGIN_MAIN_FILE));
292
- add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Settings', 'Settings', 'manage_categories', 'ahc_hits_counter_settings', 'ahcfree_create_plugin_settings_page');
293
$ahcfree_custom_timezone = get_option( 'ahcfree_custom_timezone', false );
294
if( !$ahcfree_custom_timezone ){
295
add_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
@@ -2078,9 +2082,7 @@ function ahcfree_include_scripts() {
2078
wp_enqueue_style('ahcfree_bootstrap_css');
2079
}
2080
2081
- wp_enqueue_script( 'ahc_slimselect_js', 'https://cdnjs.cloudflare.com/ajax/libs/slim-select/1.25.0/slimselect.min.js', false, '1.0.0', false);
2082
- wp_register_style('ahc_slimselect_css', 'https://cdnjs.cloudflare.com/ajax/libs/slim-select/1.25.0/slimselect.min.css', false, '1.0.0' );
2083
- wp_enqueue_style('ahc_slimselect_css');
2084
wp_enqueue_script('jquery');
2085
2086
wp_register_script('ahcfree_bootstrap_js', plugins_url('/lib/bootstrap/js/bootstrap.min.js',AHCFREE_PLUGIN_MAIN_FILE));
@@ -2089,7 +2091,7 @@ function ahcfree_include_scripts() {
2089
wp_register_script('ahcfree_lang_js', plugins_url('/lang/js/' . Globalsahcfree::$lang . '_lang.js', AHCFREE_PLUGIN_MAIN_FILE));
2090
wp_enqueue_script('ahcfree_lang_js');
2091
2092
- wp_register_script('ahcfree_main_js', plugins_url('/js/ahc_jqscripts.js', AHCFREE_PLUGIN_MAIN_FILE), false, '1.19');
2093
wp_enqueue_script('ahcfree_main_js');
2094
2095
wp_localize_script('ahcfree_main_js', 'ahcfree_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
@@ -2233,6 +2235,8 @@ class vtrtsfree_widget extends WP_Widget {
2233
$title = __('Site Statistics', 'wpb_widget_domain');
2234
}
2235
// Widget admin form
2236
?>
2237
2238
283
$roles_arr[] = strtolower($v);
284
}
285
286
+ $current_use_roles = strtolower(array_shift($current_user->roles));
287
+ if (! in_array( $current_use_roles, $roles_arr )) {
288
289
+ if(!(current_user_can('manage_options')))
290
+ {
291
+ return;
292
+ }
293
}
294
295
+ add_menu_page('Visitor Traffic Real Time Statistics', 'Visitor Traffic', 'read', 'ahc_hits_counter_menu_free', 'ahcfree_create_plugin_overview_page', plugins_url('/images/vtrts.png', AHCFREE_PLUGIN_MAIN_FILE));
296
+ add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Settings', 'Settings', 'read', 'ahc_hits_counter_settings', 'ahcfree_create_plugin_settings_page');
297
$ahcfree_custom_timezone = get_option( 'ahcfree_custom_timezone', false );
298
if( !$ahcfree_custom_timezone ){
299
add_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
2082
wp_enqueue_style('ahcfree_bootstrap_css');
2083
}
2084
2085
+
2086
wp_enqueue_script('jquery');
2087
2088
wp_register_script('ahcfree_bootstrap_js', plugins_url('/lib/bootstrap/js/bootstrap.min.js',AHCFREE_PLUGIN_MAIN_FILE));
2091
wp_register_script('ahcfree_lang_js', plugins_url('/lang/js/' . Globalsahcfree::$lang . '_lang.js', AHCFREE_PLUGIN_MAIN_FILE));
2092
wp_enqueue_script('ahcfree_lang_js');
2093
2094
+ wp_register_script('ahcfree_main_js', plugins_url('/js/ahc_jqscripts.js', AHCFREE_PLUGIN_MAIN_FILE), false, '1.28');
2095
wp_enqueue_script('ahcfree_main_js');
2096
2097
wp_localize_script('ahcfree_main_js', 'ahcfree_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
2235
$title = __('Site Statistics', 'wpb_widget_domain');
2236
}
2237
// Widget admin form
2238
+ $fontTypeCombo = (isset($fontTypeCombo)) ? $fontTypeCombo : '';
2239
+ $fontSizeCombo = (isset($fontSizeCombo)) ? $fontSizeCombo : '14';
2240
?>
2241
2242
images/icon-128x128.png ADDED
Binary file
init.php CHANGED
@@ -6,7 +6,6 @@ define('AHCFREE_TOP_REFERING_SITES_LIMIT', 20); // used in ahcfree_get_top_refer
6
define('AHCFREE_TOP_COUNTRIES_LIMIT', 20); // used in ahcfree_get_top_countries
7
8
define('AHCFREE_TRAFFIC_BY_TITLE_LIMIT', 20);
9
- define('IS_DEMO', true);
10
define('AHCFREE_DS', DIRECTORY_SEPARATOR);
11
define('AHCFREE_PLUGIN_SUPDIRE_FILE', dirname(__FILE__).'visitors-traffic-real-time-statistics.php');
12
6
define('AHCFREE_TOP_COUNTRIES_LIMIT', 20); // used in ahcfree_get_top_countries
7
8
define('AHCFREE_TRAFFIC_BY_TITLE_LIMIT', 20);
9
define('AHCFREE_DS', DIRECTORY_SEPARATOR);
10
define('AHCFREE_PLUGIN_SUPDIRE_FILE', dirname(__FILE__).'visitors-traffic-real-time-statistics.php');
11
js/ahc_jqscripts.js CHANGED
@@ -19,91 +19,7 @@ function checkTime(i) {
19
}
20
21
22
- jQuery(document).ready(function () {
23
-
24
-
25
- setInterval(function(){
26
-
27
- var now = new Date();
28
- var year = now.getFullYear();
29
- var month = now.getMonth()+1;
30
- var day = now.getDate();
31
- var hour = now.getHours();
32
- var minute = now.getMinutes();
33
- var second = now.getSeconds();
34
- if(month.toString().length == 1) {
35
- month = '0'+month;
36
- }
37
- if(day.toString().length == 1) {
38
- day = '0'+day;
39
- }
40
- if(hour.toString().length == 1) {
41
- hour = '0'+hour;
42
- }
43
- if(minute.toString().length == 1) {
44
- minute = '0'+minute;
45
- }
46
- if(second.toString().length == 1) {
47
- second = '0'+second;
48
- }
49
- var dateTime = year+'/'+month+'/'+day+' '+hour+':'+minute+':'+second;
50
-
51
- jQuery('#ahcfree_currenttime').html(dateTime); }, 500);
52
-
53
-
54
-
55
- jQuery(document).on('click', '.SwalBtn1', function() {
56
- swal.clickConfirm();
57
- });
58
- jQuery(document).on('click', '.SwalBtn2', function() {
59
- window.open(
60
- "https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?popup=1",
61
- '_blank'
62
- );
63
-
64
- swal.clickConfirm();
65
- });
66
- jQuery(document).on('click', '.SwalBtn3', function() {
67
- localStorage.setItem("ahcfreemsg", "1");
68
- swal.clickConfirm();
69
- });
70
-
71
- if(localStorage && (firstparam=="?page=ahc_hits_counter_menu_free"))
72
- {
73
-
74
-
75
- if (!localStorage.getItem("ahcfreemsg")==true)
76
- {
77
-
78
- swal({
79
- title: '',
80
- text: '',
81
- imageUrl: 'https://www.wp-buy.com/wp-content/uploads/2018/10/output_ZD6GUg-1-2.gif',
82
- imageWidth: 'auto',
83
- imageHeight: 'auto',
84
- imageAlt: 'Need more statistics, GEO locations & online counter?',
85
- animation: true,
86
- customClass: 'swal-noscroll',
87
- allowEscapeKey:true,
88
- showCancelButton: false,
89
- showConfirmButton: false,
90
- html: '<center><button type="button" role="button" class="confirm btn btn-lg btn-success SwalBtn2">' + 'Upgrade to pro' + '</button>&nbsp;&nbsp;' +
91
- '<button type="button" role="button" class="cancel btn btn-info SwalBtn1">' + 'Close' + '</button>&nbsp;&nbsp;'+
92
- '<button type="button" role="button" class="confirm btn btn-warning SwalBtn3">' + "Dismiss" + '</button></center>'
93
- });
94
-
95
-
96
-
97
-
98
-
99
- }
100
- }
101
-
102
-
103
-
104
-
105
106
- });
107
108
109
19
}
20
21
22
23
24
25
notifications.php ADDED
@@ -0,0 +1,159 @@
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ // Exit if accessed directly.
4
+ exit;
5
+ }
6
+ // Use your own prefix, i use "vtrts_free_", replace it;
7
+ $vtrts_icon_path = plugins_url( '/images/icon-128x128.png' , __FILE__);
8
+ $vtrts_rating_url = "https://wordpress.org/support/plugin/visitors-traffic-real-time-statistics/reviews/?filter=5&rate=5#new-post";
9
+ $vtrts_activation_time = 604800; // 7 days in seconds
10
+ $vtrts_file_version = 2.1;
11
+ $vtrts_development_mode = false; // Put yes to allow development mode, you will see the rating notice without timers
12
+
13
+ /**
14
+ * @since 1.9
15
+ * @version 1.9
16
+ * @class vtrts_free_Notification
17
+ */
18
+
19
+ if ( ! class_exists( 'vtrts_free_Notification' ) ) :
20
+
21
+ class vtrts_free_Notification {
22
+
23
+ /* * * * * * * * * *
24
+ * Class constructor
25
+ * * * * * * * * * */
26
+ public function __construct() {
27
+
28
+ $this->_hooks();
29
+ }
30
+
31
+ /**
32
+ * Hook into actions and filters
33
+ * @since 1.0.0
34
+ * @version 1.2.1
35
+ */
36
+ private function _hooks() {
37
+ add_action( 'admin_init', array( $this, 'vtrts_free_review_notice' ) );
38
+ }
39
+
40
+ /**
41
+ * Ask users to review our plugin on wordpress.org
42
+ *
43
+ * @since 1.0.11
44
+ * @return boolean false
45
+ * @version 1.1.3
46
+ */
47
+ public function vtrts_free_review_notice() {
48
+
49
+ global $vtrts_file_version, $vtrts_activation_time, $vtrts_development_mode;
50
+
51
+ $this->vtrts_free_review_dismissal();
52
+
53
+ $this->vtrts_free_review_pending();
54
+
55
+ $vtrts_activation_time = get_site_option( 'vtrts_free_active_time' );
56
+
57
+ $review_dismissal = get_site_option( 'vtrts_free_review_dismiss' );
58
+
59
+ if ($review_dismissal == 'yes' && !$vtrts_development_mode) return;
60
+
61
+ if ( !$vtrts_activation_time && !$vtrts_development_mode ) :
62
+
63
+ $vtrts_activation_time = time(); // Reset Time to current time.
64
+ add_site_option( 'vtrts_free_active_time', $vtrts_activation_time );
65
+
66
+ endif;
67
+ if ($vtrts_development_mode) $vtrts_activation_time = 432001; //This variable used to show the message always for testing purposes only
68
+ // 432000 = 5 Days in seconds.
69
+ if ( time() - $vtrts_activation_time > 432000 ) :
70
+
71
+ wp_enqueue_style( 'vtrts_free_review_stlye', plugins_url( '/css/style-review.css', __FILE__ ), array(), $vtrts_file_version );
72
+ add_action( 'admin_notices' , array( $this, 'vtrts_free_review_notice_message' ) );
73
+
74
+ endif;
75
+ }
76
+
77
+ /**
78
+ * Check and Dismiss review message.
79
+ *
80
+ * @since 1.9
81
+ */
82
+ private function vtrts_free_review_dismissal() {
83
+
84
+ if ( ! is_admin() ||
85
+ ! current_user_can( 'manage_options' ) ||
86
+ ! isset( $_GET['_wpnonce'] ) ||
87
+ ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'vtrts_free_review-nonce' ) ||
88
+ ! isset( $_GET['vtrts_free_review_dismiss'] ) ) :
89
+
90
+ return;
91
+ endif;
92
+
93
+ add_site_option( 'vtrts_free_review_dismiss', 'yes' );
94
+ }
95
+
96
+ /**
97
+ * Set time to current so review notice will popup after 14 days
98
+ *
99
+ * @since 1.9
100
+ */
101
+ private function vtrts_free_review_pending() {
102
+
103
+ if ( ! is_admin() ||
104
+ ! current_user_can( 'manage_options' ) ||
105
+ ! isset( $_GET['_wpnonce'] ) ||
106
+ ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'vtrts_free_review-nonce' ) ||
107
+ ! isset( $_GET['vtrts_free_review_later'] ) ) :
108
+
109
+ return;
110
+ endif;
111
+
112
+ // Reset Time to current time.
113
+ update_site_option( 'vtrts_free_active_time', time() );
114
+ }
115
+
116
+ /**
117
+ * Review notice message
118
+ *
119
+ * @since 1.0.11
120
+ */
121
+ public function vtrts_free_review_notice_message() {
122
+
123
+ $scheme = ( wp_parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
124
+ $url = $_SERVER['REQUEST_URI'] . $scheme . 'vtrts_free_review_dismiss=yes';
125
+ $dismiss_url = wp_nonce_url( $url, 'vtrts_free_review-nonce' );
126
+
127
+ $_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'vtrts_free_review_later=yes';
128
+ $later_url = wp_nonce_url( $_later_link, 'vtrts_free_review-nonce' );
129
+
130
+ global $vtrts_icon_path;
131
+
132
+ global $vtrts_rating_url;
133
+ ?>
134
+
135
+ <div class="vtrts_free_review-notice">
136
+ <div class="vtrts_free_review-thumbnail">
137
+ <img src="<?php echo $vtrts_icon_path; ?>" alt="">
138
+ </div>
139
+ <div class="vtrts_free_review-text">
140
+ <h3><?php _e( 'Leave A Review?', 'visitors-traffic-real-time-statistics' ) ?></h3>
141
+ <p><?php _e( 'We hope you\'ve enjoyed using Visitor Traffic Real Time Statistics :) Would you mind taking a few minutes to write a review on WordPress.org?<br>Just writing simple "thank you" will make us happy!', 'visitors-traffic-real-time-statistics' ) ?></p>
142
+ <ul class="vtrts_free_review-ul">
143
+ <li><a href="<?php echo $vtrts_rating_url; ?>" target="_blank"><span class="dashicons dashicons-external"></span><?php _e( 'Sure! I\'d love to!', 'visitors-traffic-real-time-statistics' ) ?></a></li>
144
+ <li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-smiley"></span><?php _e( 'I\'ve already left a review', 'visitors-traffic-real-time-statistics' ) ?></a></li>
145
+ <li><a href="<?php echo $later_url ?>"><span class="dashicons dashicons-calendar-alt"></span><?php _e( 'Will Rate Later', 'visitors-traffic-real-time-statistics' ) ?></a></li>
146
+ <li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-dismiss"></span><?php _e( 'Hide Forever', 'visitors-traffic-real-time-statistics' ) ?></a></li></ul>
147
+ </div>
148
+ </div>
149
+ <?php
150
+ }
151
+ }
152
+
153
+ endif;
154
+ $admincore = '';
155
+ if (isset($_GET['page'])) $admincore = sanitize_text_field($_GET['page']);
156
+ if($admincore != 'vtrtsoptionspro') {
157
+ new vtrts_free_Notification();
158
+ }
159
+ ?>
overview.php CHANGED
@@ -424,7 +424,97 @@
424
jQuery("#vtrts_updt_msg").empty();
425
jQuery("#vtrts_updt_msg").removeAttr("style");
426
}
427
428
- });
429
</script>
430
424
jQuery("#vtrts_updt_msg").empty();
425
jQuery("#vtrts_updt_msg").removeAttr("style");
426
}
427
+
428
+
429
+
430
+
431
+
432
+ setInterval(function(){
433
+
434
+ var now = new Date();
435
+ var year = now.getFullYear();
436
+ var month = now.getMonth()+1;
437
+ var day = now.getDate();
438
+ var hour = now.getHours();
439
+ var minute = now.getMinutes();
440
+ var second = now.getSeconds();
441
+ if(month.toString().length == 1) {
442
+ month = '0'+month;
443
+ }
444
+ if(day.toString().length == 1) {
445
+ day = '0'+day;
446
+ }
447
+ if(hour.toString().length == 1) {
448
+ hour = '0'+hour;
449
+ }
450
+ if(minute.toString().length == 1) {
451
+ minute = '0'+minute;
452
+ }
453
+ if(second.toString().length == 1) {
454
+ second = '0'+second;
455
+ }
456
+ var dateTime = year+'/'+month+'/'+day+' '+hour+':'+minute+':'+second;
457
+
458
+ jQuery('#ahcfree_currenttime').html(dateTime); }, 500);
459
+
460
+
461
+
462
+ jQuery(document).on('click', '.SwalBtn1', function() {
463
+ swal.clickConfirm();
464
+ });
465
+ jQuery(document).on('click', '.SwalBtn2', function() {
466
+ window.open(
467
+ "https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/?popup=1",
468
+ '_blank'
469
+ );
470
+
471
+ swal.clickConfirm();
472
+ });
473
+ jQuery(document).on('click', '.SwalBtn3', function() {
474
+ localStorage.setItem("ahcfreemsg", "1");
475
+ swal.clickConfirm();
476
+ });
477
478
+ if(localStorage && (firstparam=="?page=ahc_hits_counter_menu_free"))
479
+ {
480
+
481
+
482
+ if (!localStorage.getItem("ahcfreemsg")==true)
483
+ {
484
+
485
+
486
+ setTimeout(function(){
487
+
488
+ swal({
489
+ title: '',
490
+ text: '',
491
+ imageUrl: 'https://www.wp-buy.com/wp-content/uploads/2018/10/output_ZD6GUg-1-2.gif',
492
+ imageWidth: 'auto',
493
+ imageHeight: 'auto',
494
+ imageAlt: 'Need more statistics, GEO locations & online counter?',
495
+ animation: true,
496
+ customClass: 'swal-noscroll',
497
+ allowEscapeKey:true,
498
+ showCancelButton: false,
499
+ showConfirmButton: false,
500
+ html: '<center><button type="button" role="button" class="confirm btn btn-lg btn-success SwalBtn2">' + 'Upgrade to pro' + '</button>&nbsp;&nbsp;' +
501
+ '<button type="button" role="button" class="cancel btn btn-info SwalBtn1">' + 'Close' + '</button>&nbsp;&nbsp;'+
502
+ '<button type="button" role="button" class="confirm btn btn-warning SwalBtn3">' + "Dismiss" + '</button></center>'
503
+ });
504
+ }, 30000);
505
+ }
506
+
507
+
508
+
509
+
510
+ }
511
+
512
+
513
+ });
514
+
515
+
516
+
517
+
518
+
519
</script>
520
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
Contributors: wp-buy, osamaesh
3
Tags: visitor, traffic, online, visitors online plugin,visitors online, count visitor, google analytics, analytics, GeoIP, Geo locations, analytics dashboard, visits, statistics, stats, visitors, 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.3.2
6
- Stable tag: 1.17
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -84,6 +84,16 @@ Thanks!
84
85
86
== Changelog ==
87
88
= 1.17 =
89
1. bug fixing in RTL interface
2
Contributors: wp-buy, osamaesh
3
Tags: visitor, traffic, online, visitors online plugin,visitors online, count visitor, google analytics, analytics, GeoIP, Geo locations, analytics dashboard, visits, statistics, stats, visitors, 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.4
6
+ Stable tag: trunk
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
84
85
86
== Changelog ==
87
+ = 1.21 =
88
+ Bug fixing - Notice: Constant IS_DEMO already defined
89
+ = 1.20 =
90
+ 1. Bug fixing in the plugin accessibility
91
+ = 1.19 =
92
+ 1. Fix PHP Notice in settings page
93
+
94
+ = 1.18 =
95
+ 1. adding the ability to give access to statistics page for any user type
96
+ 2. Bug fixing in the IP exclusion
97
98
= 1.17 =
99
1. bug fixing in RTL interface
settings.php ADDED
@@ -0,0 +1 @@
1
+ <?php