Version Description
Added
- Post/Page Select in statistics page reporting according to post Type.
- Online Users widget, A cool widget to show current online users!
- A new table
visitor_relationship
for saving visitors logs. -
user_id
,page_id
,type
columns tostatistics_useronline
table. - Visitor count column in Top Country widget.
Improvement
- Improvement MySQL time query in all functions.
- Improvement online users page UI.
- Improvement Top referrals UI.
- Improvement CSV exporter.
- Improvement pagination in admin pages that used the WordPress
paginate_links
. - Improvement time filter in admin pages stats.
- Improvement
admin_url
link in all admin pages. - Improvement text wrap in all meta boxes.
- Fixed reset number online users list in period time.
- Schedule list in statistical reporting.
- Refer Param in Top Referring Sites page.
- Fix method to get IP addresses.
- Fix Page CSS.
- Fix the error of No page title found in the meta box.
- Fix show number refer link from custom URL.
- Fix update option for Piwik blacklist.
Deprecated
- Remove
WP_Statistics_Pagination
class. - Deprecate Top Search Words (30 Days) widget.
Download this release
Release Info
Developer | mostafa.s1990 |
Plugin | WP Statistics |
Version | 12.6 |
Comparing to | |
See all releases |
Code changes from version 12.5.7 to 12.6
- assets/css/admin.css +92 -0
- assets/css/log.css +9 -0
- assets/css/pagination.css +40 -45
- assets/css/rtl.css +15 -0
- assets/images/ajax-loading.gif +0 -0
- assets/images/dashicons-migrate.png +0 -0
- assets/images/dashicons-update.png +0 -0
- assets/images/dashicons-visibility.png +0 -0
- assets/images/flags/CG.png +0 -0
- assets/images/loading.svg +5 -0
- assets/images/title-logo.png +0 -0
- assets/images/welcome/addon-advanced-reporting.png +0 -0
- assets/images/welcome/addon-realltime-stats.png +0 -0
- assets/images/welcome/addon-widgets.png +0 -0
- assets/images/welcome/addons-mini-chart.png +0 -0
- assets/images/welcome/topcountry-widget.png +0 -0
- assets/images/welcome/topreferring-widget.png +0 -0
- assets/images/welcome/usersonline-widget.png +0 -0
- assets/js/admin.js +23 -17
- composer.json +1 -1
- composer.lock +14 -12
- includes/classes/class-wp-statistics-admin-pages.php +156 -172
- includes/classes/class-wp-statistics-admin.php +246 -365
- includes/classes/class-wp-statistics-ajax.php +73 -92
- includes/classes/class-wp-statistics-dashboard.php +226 -255
- includes/classes/class-wp-statistics-editor.php +11 -28
- includes/classes/class-wp-statistics-export.php +343 -0
- includes/classes/class-wp-statistics-frontend.php +119 -37
- includes/classes/class-wp-statistics-hits.php +487 -428
- includes/classes/class-wp-statistics-install.php +58 -56
- includes/classes/class-wp-statistics-network-admin.php +6 -38
- includes/classes/class-wp-statistics-pagination.php +0 -667
- includes/classes/class-wp-statistics-schedule.php +79 -104
- includes/classes/class-wp-statistics-tinymce.php +119 -116
- includes/classes/class-wp-statistics-updates.php +13 -17
- includes/classes/class-wp-statistics-welcome.php +16 -8
- includes/classes/class-wp-statistics.php +206 -302
- includes/functions/export.php +0 -103
- includes/functions/functions.php +1021 -449
- includes/functions/purge.php +15 -76
- includes/github/elidickinson/php-export-data/php-export-data.class.php +0 -235
- includes/log/all-browsers.php +10 -26
- includes/log/authors.php +6 -20
- includes/log/categories.php +5 -21
- includes/log/exclusions.php +6 -22
- includes/log/hit-statistics.php +5 -20
- includes/log/last-search.php +30 -60
- includes/log/last-visitor.php +40 -59
- includes/log/log.php +22 -59
- includes/log/online.php +125 -100
- includes/log/page-statistics.php +26 -27
- includes/log/search-statistics.php +5 -20
- includes/log/searched-phrases.php +0 -194
- includes/log/tags.php +5 -19
- includes/log/top-countries.php +188 -58
- includes/log/top-pages.php +30 -80
- includes/log/top-referring.php +174 -146
- includes/log/top-visitors.php +11 -17
- includes/log/widgets/about.php +9 -5
- includes/log/widgets/browsers.php +5 -1
- includes/log/widgets/countries.php +4 -6
- includes/log/widgets/hits.php +1 -0
- includes/log/widgets/page.php +1 -0
- includes/log/widgets/pages.php +24 -34
- includes/log/widgets/quickstats.php +14 -64
- includes/log/widgets/recent.php +2 -2
- includes/log/widgets/referring.php +48 -33
- includes/log/widgets/search.php +1 -0
- includes/log/widgets/searched.phrases.php +0 -29
- includes/log/widgets/summary.php +14 -68
- includes/log/widgets/users_online.php +41 -0
- includes/log/widgets/words.php +3 -8
- includes/optimization/tabs/wps-optimization-database.php +18 -96
- includes/optimization/tabs/wps-optimization-export.php +8 -6
- includes/optimization/tabs/wps-optimization-historical.php +1 -1
- includes/optimization/tabs/wps-optimization-purging.php +26 -67
- includes/optimization/tabs/wps-optimization-resources.php +26 -218
- includes/optimization/tabs/wps-optimization-updates.php +1 -1
- includes/optimization/wps-optimization.php +4 -9
- includes/settings/tabs/wps-access-level.php +12 -47
- includes/settings/tabs/wps-externals.php +38 -59
- includes/settings/tabs/wps-general.php +37 -49
- includes/settings/tabs/wps-notifications.php +17 -28
- includes/settings/tabs/wps-privacy.php +6 -10
- includes/settings/tabs/wps-removal.php +1 -3
- includes/settings/wps-settings.php +45 -72
- includes/templates/add-ons.php +65 -0
- includes/templates/plugins.php +4 -76
- includes/templates/welcome.php +34 -64
- includes/vendor/composer/ClassLoader.php +1 -1
- includes/vendor/composer/installed.json +12 -12
- includes/vendor/jaybizzle/crawler-detect/raw/Crawlers.json +1 -1
- includes/vendor/jaybizzle/crawler-detect/raw/Crawlers.txt +210 -196
- includes/vendor/jaybizzle/crawler-detect/raw/Exclusions.json +1 -1
- includes/vendor/jaybizzle/crawler-detect/raw/Exclusions.txt +1 -1
- includes/vendor/jaybizzle/crawler-detect/src/CrawlerDetect.php +9 -7
- includes/vendor/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php +1 -0
- includes/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php +210 -196
- includes/vendor/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php +1 -1
- includes/vendor/maxmind-db/reader/CHANGELOG.md +28 -0
- includes/vendor/maxmind-db/reader/README.md +3 -3
- includes/vendor/maxmind-db/reader/autoload.php +8 -7
- includes/vendor/maxmind-db/reader/ext/config.m4 +23 -2
- includes/vendor/maxmind-db/reader/ext/maxminddb.c +68 -9
- includes/vendor/maxmind-db/reader/ext/php_maxminddb.h +1 -1
- includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php +12 -12
- includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php +135 -105
- changelog.txt → older-changelog.txt +0 -0
- readme.txt +38 -3
- wp-statistics.php +1 -2
assets/css/admin.css
CHANGED
@@ -207,6 +207,11 @@
|
|
207 |
background-color: #1aabec;
|
208 |
}
|
209 |
|
|
|
|
|
|
|
|
|
|
|
210 |
.wp-statistics-welcome .tab-content {
|
211 |
display: none;
|
212 |
}
|
@@ -283,6 +288,21 @@
|
|
283 |
display: inline-block;
|
284 |
}
|
285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
/* button Editor tinymce */
|
287 |
i.mce-i-icon-statistic {
|
288 |
font: 400 20px/1 dashicons;
|
@@ -322,4 +342,76 @@ html[dir="rtl"] .wp-statistic-mce-desc {
|
|
322 |
|
323 |
.wps-gutenberg-chart-js {
|
324 |
height: 350px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
}
|
207 |
background-color: #1aabec;
|
208 |
}
|
209 |
|
210 |
+
.wp-statistics-welcome .nav-tab.donate {
|
211 |
+
background-color: #459605;
|
212 |
+
color: #ffffff;
|
213 |
+
}
|
214 |
+
|
215 |
.wp-statistics-welcome .tab-content {
|
216 |
display: none;
|
217 |
}
|
288 |
display: inline-block;
|
289 |
}
|
290 |
|
291 |
+
.wp-statistics-welcome .plugin-icon {
|
292 |
+
width: 128px;
|
293 |
+
height: 128px;
|
294 |
+
}
|
295 |
+
|
296 |
+
.wp-statistics-welcome .plugin-card h3 {
|
297 |
+
margin: 0 0 12px;
|
298 |
+
font-size: 18px;
|
299 |
+
line-height: 1.3;
|
300 |
+
}
|
301 |
+
|
302 |
+
.wp-statistics-welcome .plugin-card {
|
303 |
+
text-align: left;
|
304 |
+
}
|
305 |
+
|
306 |
/* button Editor tinymce */
|
307 |
i.mce-i-icon-statistic {
|
308 |
font: 400 20px/1 dashicons;
|
342 |
|
343 |
.wps-gutenberg-chart-js {
|
344 |
height: 350px;
|
345 |
+
}
|
346 |
+
|
347 |
+
/* Meta Box Loading */
|
348 |
+
.wps_loading_box {
|
349 |
+
width: 100%;
|
350 |
+
text-align: center;
|
351 |
+
min-height: 65px;
|
352 |
+
padding-top: 15px;
|
353 |
+
}
|
354 |
+
|
355 |
+
/* Admin Page Title */
|
356 |
+
.wps_page_title {
|
357 |
+
display: inline-block;
|
358 |
+
vertical-align: -15px;
|
359 |
+
margin-top: 10px;
|
360 |
+
margin-bottom: 10px;
|
361 |
+
margin-right: 5px;
|
362 |
+
}
|
363 |
+
|
364 |
+
.wps_title {
|
365 |
+
display: inline;
|
366 |
+
font-size: 1.6em;
|
367 |
+
}
|
368 |
+
|
369 |
+
/* Refresh button Meta Box */
|
370 |
+
.wps-more span, .wps-refresh span {
|
371 |
+
transition: transform .6s ease-in-out;
|
372 |
+
-webkit-transition: -webkit-transform .6s ease-in-out;
|
373 |
+
}
|
374 |
+
|
375 |
+
.wps-more span:hover, .wps-refresh span:hover {
|
376 |
+
color: #00a0d2;
|
377 |
+
}
|
378 |
+
|
379 |
+
.wps-refresh span:hover {
|
380 |
+
transform: rotate(360deg);
|
381 |
+
-webkit-transform: rotate(360deg);
|
382 |
+
}
|
383 |
+
|
384 |
+
/* Color Style */
|
385 |
+
.wps-text-danger {
|
386 |
+
color: #DC3545;
|
387 |
+
}
|
388 |
+
|
389 |
+
.wps-text-success {
|
390 |
+
color: #459605;
|
391 |
+
}
|
392 |
+
|
393 |
+
.wps-text-warning {
|
394 |
+
color: #dc6b26;
|
395 |
+
}
|
396 |
+
|
397 |
+
.wps-text-muted {
|
398 |
+
color: #797979;
|
399 |
+
}
|
400 |
+
|
401 |
+
/* disable Break Link */
|
402 |
+
a[href*='?page=wps_break_menu'] {
|
403 |
+
pointer-events: none;
|
404 |
+
}
|
405 |
+
|
406 |
+
/* Cursor Default */
|
407 |
+
.wps-cursor-default {
|
408 |
+
cursor: default;
|
409 |
+
}
|
410 |
+
|
411 |
+
/* Text Wrap */
|
412 |
+
.wps-text-wrap {
|
413 |
+
display: inline-block;
|
414 |
+
overflow: hidden;
|
415 |
+
white-space: nowrap;
|
416 |
+
width: 200px;
|
417 |
}
|
assets/css/log.css
CHANGED
@@ -339,6 +339,15 @@
|
|
339 |
.table-stats tr, .table-stats td {
|
340 |
border-bottom: 1px solid #efeeee;
|
341 |
background-color: white;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
}
|
343 |
|
344 |
.table-stats tr:first-child td {
|
339 |
.table-stats tr, .table-stats td {
|
340 |
border-bottom: 1px solid #efeeee;
|
341 |
background-color: white;
|
342 |
+
transition: 1s all;
|
343 |
+
}
|
344 |
+
|
345 |
+
.table-stats tr:last-child td {
|
346 |
+
border-bottom:0px;
|
347 |
+
}
|
348 |
+
|
349 |
+
.table-stats tr:hover:not(:first-child) td {
|
350 |
+
background-color: rgba(241, 241, 241, 0.65) !important;
|
351 |
}
|
352 |
|
353 |
.table-stats tr:first-child td {
|
assets/css/pagination.css
CHANGED
@@ -1,56 +1,51 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
direction:
|
4 |
-
|
5 |
-
text-align: center;
|
6 |
-
}
|
7 |
-
|
8 |
-
.pageOn {
|
9 |
-
background: none repeat scroll 0 0 #4dcdff;
|
10 |
-
border: 1px solid #60a8ff;
|
11 |
-
border-radius: 4px;
|
12 |
-
box-shadow: 0 1px 0 #c8e8ff inset;
|
13 |
-
color: #fff4f4;
|
14 |
-
margin: 2px;
|
15 |
-
padding: 5px 10px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.pageOff {
|
19 |
-
background: none repeat scroll 0 0 #ffffff;
|
20 |
-
border: 1px solid #dadada;
|
21 |
-
border-radius: 4px;
|
22 |
-
color: #aaaaaa;
|
23 |
-
margin: 2px;
|
24 |
-
padding: 5px 9px;
|
25 |
-
text-shadow: 1px 1px #ffffff;
|
26 |
}
|
27 |
|
28 |
-
.
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
-
.
|
32 |
-
|
33 |
-
|
34 |
-
padding: 5px 8px;
|
35 |
}
|
36 |
|
37 |
-
.
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
-
.
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
text-align: left;
|
49 |
-
width: 70%;
|
50 |
}
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
56 |
}
|
1 |
+
#result-log {
|
2 |
+
color: #148e00;
|
3 |
+
direction: rtl;
|
4 |
+
margin-top: 4px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
|
7 |
+
.pagination-wrap {
|
8 |
+
clear: both;
|
9 |
+
display: block;
|
10 |
+
overflow: hidden;
|
11 |
+
text-align: center;
|
12 |
+
margin-top: 25px;
|
13 |
}
|
14 |
|
15 |
+
.pagination-wrap .page-numbers li {
|
16 |
+
margin-bottom: 0;
|
17 |
+
display: inline-block;
|
|
|
18 |
}
|
19 |
|
20 |
+
.pagination-wrap .page-numbers li a, .pagination-wrap .page-numbers li span {
|
21 |
+
display: inline-block;
|
22 |
+
padding: 6px 12px;
|
23 |
+
margin-right: 4px;
|
24 |
+
border-radius: 3px;
|
25 |
+
border: solid 1px #c0c0c0;
|
26 |
+
background: #e9e9e9;
|
27 |
+
box-shadow: inset 0px 1px 0px rgba(255, 255, 255, .8), 0px 1px 3px rgba(0, 0, 0, .1);
|
28 |
+
font-size: .875em;
|
29 |
+
font-weight: bold;
|
30 |
+
text-decoration: none;
|
31 |
+
color: #717171;
|
32 |
+
text-shadow: 0px 1px 0px rgba(255, 255, 255, 1);
|
33 |
}
|
34 |
|
35 |
+
.pagination-wrap .page-numbers > li > a:hover,
|
36 |
+
.pagination-wrap .page-numbers > li > span:hover,
|
37 |
+
.pagination-wrap .page-numbers > li > a:focus,
|
38 |
+
.pagination-wrap .page-numbers > li > span:focus {
|
39 |
+
background: #fefefe;
|
40 |
+
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FEFEFE), to(#f0f0f0));
|
41 |
+
background: -moz-linear-gradient(#FEFEFE, #f0f0f0);
|
|
|
|
|
42 |
}
|
43 |
|
44 |
+
.pagination-wrap .page-numbers li .current {
|
45 |
+
border: none;
|
46 |
+
background: #616161 !important;
|
47 |
+
box-shadow: inset 0px 0px 8px rgba(0, 0, 0, .5), 0px 1px 0px rgba(255, 255, 255, .8) !important;
|
48 |
+
color: #f0f0f0;
|
49 |
+
text-shadow: 0px 0px 3px rgba(0, 0, 0, .5);
|
50 |
+
padding: 7px 14px;
|
51 |
}
|
assets/css/rtl.css
CHANGED
@@ -80,4 +80,19 @@
|
|
80 |
|
81 |
.wp-statistics-travod .header .right {
|
82 |
float: left;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
}
|
80 |
|
81 |
.wp-statistics-travod .header .right {
|
82 |
float: left;
|
83 |
+
}
|
84 |
+
|
85 |
+
.wps-wrap h2,.wps-wrap h3 {
|
86 |
+
direction: rtl;
|
87 |
+
font-family: tahoma, serif;
|
88 |
+
font-weight: 400;
|
89 |
+
}
|
90 |
+
|
91 |
+
.wps_page_title {
|
92 |
+
margin-right: 0;
|
93 |
+
margin-left: 5px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.wps-wrap table.widefat {
|
97 |
+
direction: rtl;
|
98 |
}
|
assets/images/ajax-loading.gif
DELETED
Binary file
|
assets/images/dashicons-migrate.png
DELETED
Binary file
|
assets/images/dashicons-update.png
DELETED
Binary file
|
assets/images/dashicons-visibility.png
DELETED
Binary file
|
assets/images/flags/CG.png
ADDED
Binary file
|
assets/images/loading.svg
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="50px" height="50px" viewBox="0 0 50 50" xml:space="preserve">
|
2 |
+
<path fill="#00a0d2" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z" transform="rotate(32.3376 25 25)">
|
3 |
+
<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform>
|
4 |
+
</path>
|
5 |
+
</svg>
|
assets/images/title-logo.png
ADDED
Binary file
|
assets/images/welcome/addon-advanced-reporting.png
DELETED
Binary file
|
assets/images/welcome/addon-realltime-stats.png
DELETED
Binary file
|
assets/images/welcome/addon-widgets.png
DELETED
Binary file
|
assets/images/welcome/addons-mini-chart.png
DELETED
Binary file
|
assets/images/welcome/topcountry-widget.png
ADDED
Binary file
|
assets/images/welcome/topreferring-widget.png
ADDED
Binary file
|
assets/images/welcome/usersonline-widget.png
ADDED
Binary file
|
assets/js/admin.js
CHANGED
@@ -15,10 +15,15 @@ jQuery(document).ready(function () {
|
|
15 |
// Check about page
|
16 |
if (jQuery('.wp-statistics-welcome').length) {
|
17 |
jQuery('.nav-tab-wrapper a').click(function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
jQuery('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
19 |
jQuery('.tab-content').removeClass('current');
|
20 |
|
21 |
-
var tab_id = jQuery(this).attr('data-tab');
|
22 |
jQuery("[data-tab=" + tab_id + "]").addClass('nav-tab-active');
|
23 |
jQuery("[data-content=" + tab_id + "]").addClass('current');
|
24 |
|
@@ -26,25 +31,26 @@ jQuery(document).ready(function () {
|
|
26 |
});
|
27 |
}
|
28 |
|
29 |
-
// Check
|
30 |
-
|
31 |
-
jQuery(
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
url: ajaxurl,
|
41 |
-
type: 'get',
|
42 |
-
data: data,
|
43 |
-
datatype: 'json',
|
44 |
-
});
|
45 |
});
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
/**
|
49 |
* Get Parameter value
|
50 |
* @param name
|
15 |
// Check about page
|
16 |
if (jQuery('.wp-statistics-welcome').length) {
|
17 |
jQuery('.nav-tab-wrapper a').click(function () {
|
18 |
+
var tab_id = jQuery(this).attr('data-tab');
|
19 |
+
|
20 |
+
if (tab_id == 'link') {
|
21 |
+
return true;
|
22 |
+
}
|
23 |
+
|
24 |
jQuery('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
25 |
jQuery('.tab-content').removeClass('current');
|
26 |
|
|
|
27 |
jQuery("[data-tab=" + tab_id + "]").addClass('nav-tab-active');
|
28 |
jQuery("[data-content=" + tab_id + "]").addClass('current');
|
29 |
|
31 |
});
|
32 |
}
|
33 |
|
34 |
+
// Check the Condition Require Setting Api
|
35 |
+
function wp_statistics_check_condition_view_option(selector, field) {
|
36 |
+
jQuery(document).on("change", selector, function (e) {
|
37 |
+
e.preventDefault();
|
38 |
+
let option_field = jQuery(field);
|
39 |
+
if (this.checked) {
|
40 |
+
option_field.show("slow");
|
41 |
+
} else {
|
42 |
+
option_field.hide("slow");
|
43 |
+
option_field.find("input[type=checkbox]").prop('checked', false);
|
44 |
+
}
|
|
|
|
|
|
|
|
|
|
|
45 |
});
|
46 |
}
|
47 |
|
48 |
+
// Check the visitor log is checked
|
49 |
+
wp_statistics_check_condition_view_option("input[name=wps_visitors]", "#visitors_log_tr");
|
50 |
+
|
51 |
+
// Check the Spam List
|
52 |
+
wp_statistics_check_condition_view_option("input[name=wps_referrerspam]", "tr.referrerspam_field");
|
53 |
+
|
54 |
/**
|
55 |
* Get Parameter value
|
56 |
* @param name
|
composer.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
"geoip2/geoip2": "^2.9.0",
|
5 |
"s1lentium/iptools": "^1.1.0",
|
6 |
"whichbrowser/parser": "2.0.37",
|
7 |
-
"jaybizzle/crawler-detect": "1.2.
|
8 |
"erusev/parsedown": "^1.6"
|
9 |
},
|
10 |
"config": {
|
4 |
"geoip2/geoip2": "^2.9.0",
|
5 |
"s1lentium/iptools": "^1.1.0",
|
6 |
"whichbrowser/parser": "2.0.37",
|
7 |
+
"jaybizzle/crawler-detect": "1.2.78",
|
8 |
"erusev/parsedown": "^1.6"
|
9 |
},
|
10 |
"config": {
|
composer.lock
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"content-hash": "
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "composer/ca-bundle",
|
@@ -162,16 +162,16 @@
|
|
162 |
},
|
163 |
{
|
164 |
"name": "jaybizzle/crawler-detect",
|
165 |
-
"version": "v1.2.
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
|
169 |
-
"reference": "
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
-
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/
|
174 |
-
"reference": "
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
@@ -207,20 +207,20 @@
|
|
207 |
"crawlerdetect",
|
208 |
"php crawler detect"
|
209 |
],
|
210 |
-
"time": "
|
211 |
},
|
212 |
{
|
213 |
"name": "maxmind-db/reader",
|
214 |
-
"version": "v1.
|
215 |
"source": {
|
216 |
"type": "git",
|
217 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
218 |
-
"reference": "
|
219 |
},
|
220 |
"dist": {
|
221 |
"type": "zip",
|
222 |
-
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/
|
223 |
-
"reference": "
|
224 |
"shasum": ""
|
225 |
},
|
226 |
"require": {
|
@@ -263,7 +263,7 @@
|
|
263 |
"geolocation",
|
264 |
"maxmind"
|
265 |
],
|
266 |
-
"time": "
|
267 |
},
|
268 |
{
|
269 |
"name": "maxmind/web-service-common",
|
@@ -474,6 +474,8 @@
|
|
474 |
"stability-flags": [],
|
475 |
"prefer-stable": false,
|
476 |
"prefer-lowest": false,
|
477 |
-
"platform":
|
|
|
|
|
478 |
"platform-dev": []
|
479 |
}
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "6497ec3331bd44e9dbbb7e43066a0708",
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "composer/ca-bundle",
|
162 |
},
|
163 |
{
|
164 |
"name": "jaybizzle/crawler-detect",
|
165 |
+
"version": "v1.2.78",
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
|
169 |
+
"reference": "0f91f34d375ddd5d7034b9eaf6b74acd0b2a0ed6"
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
+
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/0f91f34d375ddd5d7034b9eaf6b74acd0b2a0ed6",
|
174 |
+
"reference": "0f91f34d375ddd5d7034b9eaf6b74acd0b2a0ed6",
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
207 |
"crawlerdetect",
|
208 |
"php crawler detect"
|
209 |
],
|
210 |
+
"time": "2019-01-15T21:21:27+00:00"
|
211 |
},
|
212 |
{
|
213 |
"name": "maxmind-db/reader",
|
214 |
+
"version": "v1.4.1",
|
215 |
"source": {
|
216 |
"type": "git",
|
217 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
218 |
+
"reference": "eb83d0ee1c1f9b8a340206302136bc81ee02ae74"
|
219 |
},
|
220 |
"dist": {
|
221 |
"type": "zip",
|
222 |
+
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/eb83d0ee1c1f9b8a340206302136bc81ee02ae74",
|
223 |
+
"reference": "eb83d0ee1c1f9b8a340206302136bc81ee02ae74",
|
224 |
"shasum": ""
|
225 |
},
|
226 |
"require": {
|
263 |
"geolocation",
|
264 |
"maxmind"
|
265 |
],
|
266 |
+
"time": "2019-01-04T19:55:56+00:00"
|
267 |
},
|
268 |
{
|
269 |
"name": "maxmind/web-service-common",
|
474 |
"stability-flags": [],
|
475 |
"prefer-stable": false,
|
476 |
"prefer-lowest": false,
|
477 |
+
"platform": {
|
478 |
+
"php": ">=5.4"
|
479 |
+
},
|
480 |
"platform-dev": []
|
481 |
}
|
includes/classes/class-wp-statistics-admin-pages.php
CHANGED
@@ -5,11 +5,9 @@
|
|
5 |
*/
|
6 |
class WP_Statistics_Admin_Pages {
|
7 |
|
8 |
-
|
9 |
//Transient For Show Notice Setting
|
10 |
public static $setting_notice = '_show_notice_wp_statistics';
|
11 |
|
12 |
-
|
13 |
/**
|
14 |
* Load Overview Page
|
15 |
*/
|
@@ -48,15 +46,6 @@ class WP_Statistics_Admin_Pages {
|
|
48 |
null,
|
49 |
array( 'widget' => 'search' )
|
50 |
);
|
51 |
-
add_meta_box(
|
52 |
-
'wps_searched_phrases_postbox',
|
53 |
-
__( 'Top Search Words (30 Days)', 'wp-statistics' ),
|
54 |
-
'wp_statistics_generate_overview_postbox_contents',
|
55 |
-
$WP_Statistics->menu_slugs['overview'],
|
56 |
-
'normal',
|
57 |
-
null,
|
58 |
-
array( 'widget' => 'searched.phrases' )
|
59 |
-
);
|
60 |
add_meta_box(
|
61 |
'wps_words_postbox',
|
62 |
__( 'Latest Search Words', 'wp-statistics' ),
|
@@ -144,34 +133,98 @@ class WP_Statistics_Admin_Pages {
|
|
144 |
}
|
145 |
}
|
146 |
|
147 |
-
//
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
|
151 |
-
|
152 |
-
*
|
|
|
|
|
|
|
|
|
|
|
153 |
*/
|
154 |
-
static
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
158 |
}
|
159 |
-
|
|
|
160 |
}
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
/**
|
164 |
* Plugins
|
165 |
*/
|
166 |
static function plugins() {
|
167 |
-
// Load our CSS to be used.
|
168 |
-
wp_enqueue_style(
|
169 |
-
'wpstatistics-admin-css',
|
170 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/admin.css',
|
171 |
-
true,
|
172 |
-
WP_Statistics::$reg['version']
|
173 |
-
);
|
174 |
-
|
175 |
// Activate or deactivate the selected plugin
|
176 |
if ( isset( $_GET['action'] ) ) {
|
177 |
if ( $_GET['action'] == 'activate' ) {
|
@@ -191,10 +244,12 @@ class WP_Statistics_Admin_Pages {
|
|
191 |
}
|
192 |
}
|
193 |
}
|
|
|
194 |
$response = wp_remote_get( 'https://wp-statistics.com/wp-json/plugin/addons' );
|
195 |
$response_code = wp_remote_retrieve_response_code( $response );
|
196 |
$error = null;
|
197 |
$plugins = array();
|
|
|
198 |
// Check response
|
199 |
if ( is_wp_error( $response ) ) {
|
200 |
$error = $response->get_error_message();
|
@@ -205,6 +260,7 @@ class WP_Statistics_Admin_Pages {
|
|
205 |
$error = $response['body'];
|
206 |
}
|
207 |
}
|
|
|
208 |
include WP_Statistics::$reg['plugin-dir'] . 'includes/templates/plugins.php';
|
209 |
}
|
210 |
|
@@ -219,18 +275,10 @@ class WP_Statistics_Admin_Pages {
|
|
219 |
* Loads the optimization page code.
|
220 |
*/
|
221 |
static function optimization() {
|
222 |
-
|
223 |
|
224 |
// Check the current user has the rights to be here.
|
225 |
-
if ( ! current_user_can(
|
226 |
-
wp_statistics_validate_capability(
|
227 |
-
$WP_Statistics->get_option(
|
228 |
-
'manage_capability',
|
229 |
-
'manage_options'
|
230 |
-
)
|
231 |
-
)
|
232 |
-
)
|
233 |
-
) {
|
234 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
235 |
}
|
236 |
|
@@ -238,26 +286,12 @@ class WP_Statistics_Admin_Pages {
|
|
238 |
// during the creation of the class. Instead load them now that the user exists.
|
239 |
$WP_Statistics->load_user_options();
|
240 |
|
241 |
-
// Load our JS to be used.
|
242 |
-
wp_enqueue_script(
|
243 |
-
'wp-statistics-admin-js',
|
244 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/js/admin.js',
|
245 |
-
array( 'jquery' ),
|
246 |
-
WP_Statistics::$reg['version']
|
247 |
-
);
|
248 |
-
|
249 |
-
if ( is_rtl() ) {
|
250 |
-
wp_enqueue_style( 'rtl-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/rtl.css', true, WP_Statistics::$reg['version'] );
|
251 |
-
}
|
252 |
-
|
253 |
// Get the row count for each of the tables, we'll use this later on in the wps_optimization.php file.
|
254 |
-
$
|
255 |
-
$result
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
$result['historical'] = $wpdb->get_var( "SELECT COUNT(ID) FROM `{$wpdb->prefix}statistics_historical`" );
|
260 |
-
$result['search'] = $wpdb->get_var( "SELECT COUNT(ID) FROM `{$wpdb->prefix}statistics_search`" );
|
261 |
|
262 |
include WP_Statistics::$reg['plugin-dir'] . "includes/optimization/wps-optimization.php";
|
263 |
}
|
@@ -269,15 +303,7 @@ class WP_Statistics_Admin_Pages {
|
|
269 |
global $WP_Statistics;
|
270 |
|
271 |
// Check the current user has the rights to be here.
|
272 |
-
if ( ! current_user_can(
|
273 |
-
wp_statistics_validate_capability(
|
274 |
-
$WP_Statistics->get_option(
|
275 |
-
'read_capability',
|
276 |
-
'manage_options'
|
277 |
-
)
|
278 |
-
)
|
279 |
-
)
|
280 |
-
) {
|
281 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
282 |
}
|
283 |
|
@@ -285,36 +311,27 @@ class WP_Statistics_Admin_Pages {
|
|
285 |
// during the creation of the class. Instead load them now that the user exists.
|
286 |
$WP_Statistics->load_user_options();
|
287 |
|
288 |
-
// Load our JS to be used.
|
289 |
-
wp_enqueue_script(
|
290 |
-
'wp-statistics-admin-js',
|
291 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/js/admin.js',
|
292 |
-
array( 'jquery' ),
|
293 |
-
WP_Statistics::$reg['version']
|
294 |
-
);
|
295 |
-
|
296 |
-
if ( is_rtl() ) {
|
297 |
-
wp_enqueue_style( 'rtl-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/rtl.css', true, '1.1' );
|
298 |
-
}
|
299 |
-
|
300 |
// Check admin notices.
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
|
306 |
include WP_Statistics::$reg['plugin-dir'] . "includes/settings/wps-settings.php";
|
307 |
|
308 |
// We could let the download happen at the end of the page, but this way we get to give some
|
309 |
// feedback to the users about the result.
|
310 |
-
if ( $WP_Statistics->get_option( 'geoip' ) and isset($_POST['update_geoip']) and isset($_POST['geoip_name']) ) {
|
311 |
|
312 |
//Check Geo ip Exist in Database
|
313 |
-
if( isset( WP_Statistics_Updates::$geoip[$_POST['geoip_name']] )) {
|
314 |
-
$result =
|
315 |
-
|
316 |
-
if(isset($result['status']) and $result['status'] === false) {
|
317 |
-
add_filter("wp_statistics_redirect_setting", function($redirect) {
|
|
|
|
|
|
|
318 |
} else {
|
319 |
echo $result['notice'];
|
320 |
}
|
@@ -323,16 +340,19 @@ class WP_Statistics_Admin_Pages {
|
|
323 |
}
|
324 |
|
325 |
//Enabled Geo ip Country Or City And download
|
326 |
-
foreach (array("geoip" => "country", "geoip_city" => "city") as $geo_opt => $geo_name) {
|
327 |
-
if( !isset($_POST['update_geoip']) and isset($_POST['wps_'
|
328 |
|
329 |
//Check File Not Exist
|
330 |
$upload_dir = wp_upload_dir();
|
331 |
-
$file
|
332 |
-
if ( !file_exists($file) ) {
|
333 |
-
$result = WP_Statistics_Updates::download_geoip($geo_name);
|
334 |
-
if(isset($result['status']) and $result['status'] === false) {
|
335 |
-
add_filter("wp_statistics_redirect_setting", function($redirect) {
|
|
|
|
|
|
|
336 |
} else {
|
337 |
echo $result['notice'];
|
338 |
}
|
@@ -346,39 +366,56 @@ class WP_Statistics_Admin_Pages {
|
|
346 |
|
347 |
/**
|
348 |
* Set Transient Notice
|
|
|
|
|
|
|
349 |
*/
|
350 |
public static function set_admin_notice( $text, $type = 'error' ) {
|
351 |
$get = get_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
352 |
-
if ( $get !=false) {
|
353 |
$results = $get;
|
354 |
}
|
355 |
delete_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
356 |
-
$results[] = array("text" => $text, "type" => $type);
|
357 |
set_transient( WP_Statistics_Admin_Pages::$setting_notice, $results, 1 * HOUR_IN_SECONDS );
|
358 |
}
|
359 |
|
360 |
-
|
361 |
/**
|
362 |
* Notification Setting
|
363 |
*/
|
364 |
-
public static function wp_statistics_notice_setting(
|
|
|
|
|
|
|
365 |
$get = get_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
366 |
-
if ( $get !=false) {
|
367 |
-
foreach ($get as $item) {
|
368 |
wp_statistics_admin_notice_result( $item['type'], $item['text'] );
|
369 |
}
|
370 |
delete_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
371 |
}
|
372 |
-
}
|
373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
|
375 |
/**
|
376 |
* Redirect Jquery
|
|
|
377 |
*/
|
378 |
public static function wp_statistics_redirect_setting( $redirect = false ) {
|
379 |
$redirect = apply_filters( 'wp_statistics_redirect_setting', $redirect );
|
380 |
-
if($redirect ===true) {
|
381 |
-
echo '<script>window.location.replace("'.(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]".'");</script>';
|
382 |
}
|
383 |
}
|
384 |
|
@@ -428,10 +465,6 @@ class WP_Statistics_Admin_Pages {
|
|
428 |
case WP_Statistics::$page['referrers']:
|
429 |
$log_type = 'top-referring-site';
|
430 |
|
431 |
-
break;
|
432 |
-
case WP_Statistics::$page['searched-phrases']:
|
433 |
-
$log_type = 'searched-phrases';
|
434 |
-
|
435 |
break;
|
436 |
case WP_Statistics::$page['searches']:
|
437 |
$log_type = 'search-statistics';
|
@@ -481,12 +514,9 @@ class WP_Statistics_Admin_Pages {
|
|
481 |
);
|
482 |
|
483 |
if ( $result != 7 ) {
|
484 |
-
$get_bloginfo_url = get_admin_url() .
|
485 |
-
"admin.php?page=" .
|
486 |
-
WP_Statistics::$page['optimization'] .
|
487 |
-
"&tab=database";
|
488 |
|
489 |
-
$
|
|
|
490 |
|
491 |
$result = $wpdb->query(
|
492 |
"SHOW TABLES WHERE `Tables_in_{$wpdb->dbname}` = '{$wpdb->prefix}statistics_visitor'"
|
@@ -545,36 +575,8 @@ class WP_Statistics_Admin_Pages {
|
|
545 |
wp_enqueue_script( 'postbox' );
|
546 |
|
547 |
// Load the css we use for the statistics pages.
|
548 |
-
wp_enqueue_style(
|
549 |
-
|
550 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/log.css',
|
551 |
-
true,
|
552 |
-
WP_Statistics::$reg['version']
|
553 |
-
);
|
554 |
-
wp_enqueue_style(
|
555 |
-
'wpstatistics-pagination-css',
|
556 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/pagination.css',
|
557 |
-
true,
|
558 |
-
WP_Statistics::$reg['version']
|
559 |
-
);
|
560 |
-
|
561 |
-
// Don't forget the right to left support.
|
562 |
-
if ( is_rtl() ) {
|
563 |
-
wp_enqueue_style(
|
564 |
-
'wpstatistics-rtl-css',
|
565 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/rtl.css',
|
566 |
-
true,
|
567 |
-
WP_Statistics::$reg['version']
|
568 |
-
);
|
569 |
-
}
|
570 |
-
|
571 |
-
// Load our JS to be used.
|
572 |
-
wp_enqueue_script(
|
573 |
-
'wp-statistics-admin-js',
|
574 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/js/admin.js',
|
575 |
-
array( 'jquery' ),
|
576 |
-
WP_Statistics::$reg['version']
|
577 |
-
);
|
578 |
|
579 |
// The different pages have different files to load.
|
580 |
switch ( $log_type ) {
|
@@ -601,10 +603,6 @@ class WP_Statistics_Admin_Pages {
|
|
601 |
case 'top-referring-site':
|
602 |
include WP_Statistics::$reg['plugin-dir'] . 'includes/log/top-referring.php';
|
603 |
|
604 |
-
break;
|
605 |
-
case 'searched-phrases':
|
606 |
-
include WP_Statistics::$reg['plugin-dir'] . 'includes/log/searched-phrases.php';
|
607 |
-
|
608 |
break;
|
609 |
case 'top-pages':
|
610 |
// If we've been given a page id or uri to get statistics for, load the page stats, otherwise load the page stats overview page.
|
@@ -616,31 +614,17 @@ class WP_Statistics_Admin_Pages {
|
|
616 |
|
617 |
break;
|
618 |
default:
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
'1.5.1'
|
631 |
-
);
|
632 |
-
wp_enqueue_script(
|
633 |
-
'wpstatistics-jquery-vmap-world',
|
634 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/maps/jquery.vmap.world.js',
|
635 |
-
true,
|
636 |
-
'1.5.1'
|
637 |
-
);
|
638 |
-
|
639 |
-
// Load our custom widgets handling javascript.
|
640 |
-
wp_enqueue_script('wp_statistics_log', WP_Statistics::$reg['plugin-url'] . 'assets/js/log.js');
|
641 |
-
|
642 |
-
include WP_Statistics::$reg['plugin-dir'] . 'includes/log/log.php';
|
643 |
-
}
|
644 |
|
645 |
break;
|
646 |
}
|
5 |
*/
|
6 |
class WP_Statistics_Admin_Pages {
|
7 |
|
|
|
8 |
//Transient For Show Notice Setting
|
9 |
public static $setting_notice = '_show_notice_wp_statistics';
|
10 |
|
|
|
11 |
/**
|
12 |
* Load Overview Page
|
13 |
*/
|
46 |
null,
|
47 |
array( 'widget' => 'search' )
|
48 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
add_meta_box(
|
50 |
'wps_words_postbox',
|
51 |
__( 'Latest Search Words', 'wp-statistics' ),
|
133 |
}
|
134 |
}
|
135 |
|
136 |
+
//Left Show User online table
|
137 |
+
if ( $WP_Statistics->get_option( 'useronline' ) ) {
|
138 |
+
add_meta_box( 'wps_users_online_postbox', __( 'Online Users', 'wp-statistics' ), 'wp_statistics_generate_overview_postbox_contents', $WP_Statistics->menu_slugs['overview'], 'side', null, array( 'widget' => 'users_online' ) );
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Check in admin page
|
145 |
+
*
|
146 |
+
* @param $page | For Get List @see \WP_STATISTICS\WP_Statistics::$page
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
public static function in_page( $page ) {
|
150 |
+
global $pagenow;
|
151 |
+
|
152 |
+
//Check is custom page
|
153 |
+
if ( $pagenow == "admin.php" and isset( $_REQUEST['page'] ) and $_REQUEST['page'] == WP_Statistics::$page[ $page ] ) {
|
154 |
+
return true;
|
155 |
+
}
|
156 |
+
|
157 |
+
return false;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Show Page title
|
162 |
+
* @param string $title
|
163 |
+
*/
|
164 |
+
public static function show_page_title( $title = '' ) {
|
165 |
+
|
166 |
+
//Check if $title not Set
|
167 |
+
if ( empty( $title ) and function_exists( 'get_admin_page_title' ) ) {
|
168 |
+
$title = get_admin_page_title();
|
169 |
+
}
|
170 |
+
|
171 |
+
//show Page title
|
172 |
+
echo '<img src="' . plugins_url( 'wp-statistics/assets/images/' ) . '/title-logo.png" class="wps_page_title"><h2 class="wps_title">' . $title . '</h2>';
|
173 |
+
|
174 |
+
//do_action after wp_statistics
|
175 |
+
do_action( 'wp_statistics_after_title' );
|
176 |
}
|
177 |
|
178 |
+
/**
|
179 |
+
* Get Admin Url
|
180 |
+
*
|
181 |
+
* @param null $page
|
182 |
+
* @param array $arg
|
183 |
+
* @area is_admin
|
184 |
+
* @return string
|
185 |
*/
|
186 |
+
public static function admin_url( $page = null, $arg = array() ) {
|
187 |
+
|
188 |
+
//Check If Pages is in Wp-statistics
|
189 |
+
if ( array_key_exists( $page, WP_Statistics::$page ) ) {
|
190 |
+
$page = WP_Statistics::$page[ $page ];
|
191 |
}
|
192 |
+
|
193 |
+
return add_query_arg( array_merge( array( 'page' => $page ), $arg ), admin_url( 'admin.php' ) );
|
194 |
}
|
195 |
|
196 |
+
/**
|
197 |
+
* Show MetaBox button Refresh/Direct Button Link in Top of Meta Box
|
198 |
+
*
|
199 |
+
* @param string $export
|
200 |
+
* @return string
|
201 |
+
*/
|
202 |
+
public static function meta_box_button( $export = 'all' ) {
|
203 |
+
|
204 |
+
//Prepare button
|
205 |
+
$refresh = '</button><button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' . wp_statistics_icons( 'dashicons-update' ) . '<span class="screen-reader-text">' . __( 'Reload', 'wp-statistics' ) . '</span></button>';
|
206 |
+
$more = '<button class="handlediv button-link wps-more" type="button" id="{{moreid}}">' . wp_statistics_icons( 'dashicons-external' ) . '<span class="screen-reader-text">' . __( 'More Details', 'wp-statistics' ) . '</span></button>';
|
207 |
+
|
208 |
+
//Export
|
209 |
+
if ( $export == 'all' ) {
|
210 |
+
return $refresh . $more;
|
211 |
+
} else {
|
212 |
+
return $$export;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Show Loading Meta Box
|
218 |
+
*/
|
219 |
+
public static function loading_meta_box() {
|
220 |
+
$loading = '<div class="wps_loading_box"><img src=" ' . plugins_url( 'wp-statistics/assets/images/' ) . 'loading.svg" alt="' . __( 'Reloading...', 'wp-statistics' ) . '"></div>';
|
221 |
+
return $loading;
|
222 |
+
}
|
223 |
|
224 |
/**
|
225 |
* Plugins
|
226 |
*/
|
227 |
static function plugins() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
// Activate or deactivate the selected plugin
|
229 |
if ( isset( $_GET['action'] ) ) {
|
230 |
if ( $_GET['action'] == 'activate' ) {
|
244 |
}
|
245 |
}
|
246 |
}
|
247 |
+
|
248 |
$response = wp_remote_get( 'https://wp-statistics.com/wp-json/plugin/addons' );
|
249 |
$response_code = wp_remote_retrieve_response_code( $response );
|
250 |
$error = null;
|
251 |
$plugins = array();
|
252 |
+
|
253 |
// Check response
|
254 |
if ( is_wp_error( $response ) ) {
|
255 |
$error = $response->get_error_message();
|
260 |
$error = $response['body'];
|
261 |
}
|
262 |
}
|
263 |
+
|
264 |
include WP_Statistics::$reg['plugin-dir'] . 'includes/templates/plugins.php';
|
265 |
}
|
266 |
|
275 |
* Loads the optimization page code.
|
276 |
*/
|
277 |
static function optimization() {
|
278 |
+
global $wpdb, $WP_Statistics;
|
279 |
|
280 |
// Check the current user has the rights to be here.
|
281 |
+
if ( ! current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
283 |
}
|
284 |
|
286 |
// during the creation of the class. Instead load them now that the user exists.
|
287 |
$WP_Statistics->load_user_options();
|
288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
// Get the row count for each of the tables, we'll use this later on in the wps_optimization.php file.
|
290 |
+
$list_table = wp_statistics_db_table( 'all' );
|
291 |
+
$result = array();
|
292 |
+
foreach ( $list_table as $tbl_key => $tbl_name ) {
|
293 |
+
$result[ $tbl_name ] = $wpdb->get_var( "SELECT COUNT(*) FROM `$tbl_name`" );
|
294 |
+
}
|
|
|
|
|
295 |
|
296 |
include WP_Statistics::$reg['plugin-dir'] . "includes/optimization/wps-optimization.php";
|
297 |
}
|
303 |
global $WP_Statistics;
|
304 |
|
305 |
// Check the current user has the rights to be here.
|
306 |
+
if ( ! current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_options' ) ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
308 |
}
|
309 |
|
311 |
// during the creation of the class. Instead load them now that the user exists.
|
312 |
$WP_Statistics->load_user_options();
|
313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
// Check admin notices.
|
315 |
+
if ( $WP_Statistics->get_option( 'admin_notices' ) == true ) {
|
316 |
+
$WP_Statistics->update_option( 'disable_donation_nag', false );
|
317 |
+
$WP_Statistics->update_option( 'disable_suggestion_nag', false );
|
318 |
+
}
|
319 |
|
320 |
include WP_Statistics::$reg['plugin-dir'] . "includes/settings/wps-settings.php";
|
321 |
|
322 |
// We could let the download happen at the end of the page, but this way we get to give some
|
323 |
// feedback to the users about the result.
|
324 |
+
if ( $WP_Statistics->get_option( 'geoip' ) and isset( $_POST['update_geoip'] ) and isset( $_POST['geoip_name'] ) ) {
|
325 |
|
326 |
//Check Geo ip Exist in Database
|
327 |
+
if ( isset( WP_Statistics_Updates::$geoip[ $_POST['geoip_name'] ] ) ) {
|
328 |
+
$result = WP_Statistics_Updates::download_geoip( $_POST['geoip_name'], "update" );
|
329 |
+
|
330 |
+
if ( isset( $result['status'] ) and $result['status'] === false ) {
|
331 |
+
add_filter( "wp_statistics_redirect_setting", function ( $redirect ) {
|
332 |
+
$redirect = true;
|
333 |
+
return $redirect;
|
334 |
+
} );
|
335 |
} else {
|
336 |
echo $result['notice'];
|
337 |
}
|
340 |
}
|
341 |
|
342 |
//Enabled Geo ip Country Or City And download
|
343 |
+
foreach ( array( "geoip" => "country", "geoip_city" => "city" ) as $geo_opt => $geo_name ) {
|
344 |
+
if ( ! isset( $_POST['update_geoip'] ) and isset( $_POST[ 'wps_' . $geo_opt ] ) ) {
|
345 |
|
346 |
//Check File Not Exist
|
347 |
$upload_dir = wp_upload_dir();
|
348 |
+
$file = $upload_dir['basedir'] . '/wp-statistics/' . WP_Statistics_Updates::$geoip[ $geo_name ]['file'] . '.mmdb';
|
349 |
+
if ( ! file_exists( $file ) ) {
|
350 |
+
$result = WP_Statistics_Updates::download_geoip( $geo_name );
|
351 |
+
if ( isset( $result['status'] ) and $result['status'] === false ) {
|
352 |
+
add_filter( "wp_statistics_redirect_setting", function ( $redirect ) {
|
353 |
+
$redirect = true;
|
354 |
+
return $redirect;
|
355 |
+
} );
|
356 |
} else {
|
357 |
echo $result['notice'];
|
358 |
}
|
366 |
|
367 |
/**
|
368 |
* Set Transient Notice
|
369 |
+
*
|
370 |
+
* @param $text
|
371 |
+
* @param string $type
|
372 |
*/
|
373 |
public static function set_admin_notice( $text, $type = 'error' ) {
|
374 |
$get = get_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
375 |
+
if ( $get != false ) {
|
376 |
$results = $get;
|
377 |
}
|
378 |
delete_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
379 |
+
$results[] = array( "text" => $text, "type" => $type );
|
380 |
set_transient( WP_Statistics_Admin_Pages::$setting_notice, $results, 1 * HOUR_IN_SECONDS );
|
381 |
}
|
382 |
|
|
|
383 |
/**
|
384 |
* Notification Setting
|
385 |
*/
|
386 |
+
public static function wp_statistics_notice_setting() {
|
387 |
+
global $pagenow, $WP_Statistics;
|
388 |
+
|
389 |
+
//Show Notice By Plugin
|
390 |
$get = get_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
391 |
+
if ( $get != false ) {
|
392 |
+
foreach ( $get as $item ) {
|
393 |
wp_statistics_admin_notice_result( $item['type'], $item['text'] );
|
394 |
}
|
395 |
delete_transient( WP_Statistics_Admin_Pages::$setting_notice );
|
396 |
}
|
|
|
397 |
|
398 |
+
//Check referring Spam Update
|
399 |
+
if ( $pagenow == "admin.php" and isset( $_GET['page'] ) and $_GET['page'] == WP_Statistics::$page['settings'] and isset( $_GET['update-referrerspam'] ) ) {
|
400 |
+
|
401 |
+
// Update referrer spam
|
402 |
+
$update_spam = WP_Statistics_Updates::download_referrerspam();
|
403 |
+
if ( $update_spam === true ) {
|
404 |
+
wp_statistics_admin_notice_result( 'success', __( 'Updated Matomo Referrer Spam.', 'wp-statistics' ) );
|
405 |
+
} else {
|
406 |
+
wp_statistics_admin_notice_result( 'error', __( 'error in get referrer spam list. please try again.', 'wp-statistics' ) );
|
407 |
+
}
|
408 |
+
}
|
409 |
+
}
|
410 |
|
411 |
/**
|
412 |
* Redirect Jquery
|
413 |
+
* @param bool $redirect
|
414 |
*/
|
415 |
public static function wp_statistics_redirect_setting( $redirect = false ) {
|
416 |
$redirect = apply_filters( 'wp_statistics_redirect_setting', $redirect );
|
417 |
+
if ( $redirect === true ) {
|
418 |
+
echo '<script>window.location.replace("' . ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? "https" : "http" ) . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" . '");</script>';
|
419 |
}
|
420 |
}
|
421 |
|
465 |
case WP_Statistics::$page['referrers']:
|
466 |
$log_type = 'top-referring-site';
|
467 |
|
|
|
|
|
|
|
|
|
468 |
break;
|
469 |
case WP_Statistics::$page['searches']:
|
470 |
$log_type = 'search-statistics';
|
514 |
);
|
515 |
|
516 |
if ( $result != 7 ) {
|
|
|
|
|
|
|
|
|
517 |
|
518 |
+
$get_bloginfo_url = WP_Statistics_Admin_Pages::admin_url( 'optimization', array( 'tab' => 'database' ) );
|
519 |
+
$missing_tables = array();
|
520 |
|
521 |
$result = $wpdb->query(
|
522 |
"SHOW TABLES WHERE `Tables_in_{$wpdb->dbname}` = '{$wpdb->prefix}statistics_visitor'"
|
575 |
wp_enqueue_script( 'postbox' );
|
576 |
|
577 |
// Load the css we use for the statistics pages.
|
578 |
+
wp_enqueue_style( 'wpstatistics-log-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/log.css', true, WP_Statistics::$reg['version'] );
|
579 |
+
wp_enqueue_style( 'wpstatistics-pagination-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/pagination.css', true, WP_Statistics::$reg['version'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
// The different pages have different files to load.
|
582 |
switch ( $log_type ) {
|
603 |
case 'top-referring-site':
|
604 |
include WP_Statistics::$reg['plugin-dir'] . 'includes/log/top-referring.php';
|
605 |
|
|
|
|
|
|
|
|
|
606 |
break;
|
607 |
case 'top-pages':
|
608 |
// If we've been given a page id or uri to get statistics for, load the page stats, otherwise load the page stats overview page.
|
614 |
|
615 |
break;
|
616 |
default:
|
617 |
+
if ( get_current_screen()->parent_base == WP_Statistics::$page['overview'] ) {
|
618 |
+
|
619 |
+
wp_enqueue_style( 'wpstatistics-jqvmap-css', WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/jqvmap.css', true, '1.5.1' );
|
620 |
+
wp_enqueue_script( 'wpstatistics-jquery-vmap', WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/jquery.vmap.js', true, '1.5.1' );
|
621 |
+
wp_enqueue_script( 'wpstatistics-jquery-vmap-world', WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/maps/jquery.vmap.world.js', true, '1.5.1' );
|
622 |
+
|
623 |
+
// Load our custom widgets handling javascript.
|
624 |
+
wp_enqueue_script( 'wp_statistics_log', WP_Statistics::$reg['plugin-url'] . 'assets/js/log.js' );
|
625 |
+
|
626 |
+
include WP_Statistics::$reg['plugin-dir'] . 'includes/log/log.php';
|
627 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
|
629 |
break;
|
630 |
}
|
includes/classes/class-wp-statistics-admin.php
CHANGED
@@ -21,49 +21,52 @@ class WP_Statistics_Admin {
|
|
21 |
if ( get_option( 'wp_statistics_removal' ) == 'true' ) {
|
22 |
new WP_Statistics_Uninstall;
|
23 |
}
|
|
|
24 |
// If we've been removed, return without doing anything else.
|
25 |
if ( get_option( 'wp_statistics_removal' ) == 'done' ) {
|
26 |
add_action( 'admin_notices', array( $this, 'removal_admin_notice' ), 10, 2 );
|
27 |
-
|
28 |
return;
|
29 |
}
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
add_action( '
|
35 |
-
|
|
|
|
|
|
|
|
|
36 |
new WP_Statistics_Ajax;
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
// Display the admin notices if we should.
|
39 |
if ( isset( $pagenow ) && array_key_exists( 'page', $_GET ) ) {
|
40 |
if ( $pagenow == "admin.php" && substr( $_GET['page'], 0, 14 ) == 'wp-statistics/' ) {
|
41 |
-
add_action( 'admin_notices', '
|
42 |
}
|
43 |
}
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
10,
|
49 |
-
2
|
50 |
-
);
|
51 |
-
|
52 |
-
add_filter( 'plugin_row_meta', 'WP_Statistics_Admin::add_meta_links', 10, 2 );
|
53 |
-
|
54 |
-
add_action( 'load-edit.php', 'WP_Statistics_Admin::load_edit_init' );
|
55 |
|
|
|
|
|
56 |
if ( $WP_Statistics->get_option( 'pages' ) && ! $WP_Statistics->get_option( 'disable_column' ) ) {
|
57 |
-
add_action( 'post_submitbox_misc_actions', '
|
58 |
}
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
if ( is_multisite() ) {
|
63 |
-
add_action( 'network_admin_menu', 'WP_Statistics_Network_Admin::menu' );
|
64 |
-
}
|
65 |
-
|
66 |
-
add_action( 'admin_enqueue_scripts', 'WP_Statistics_Admin::enqueue_scripts' );
|
67 |
add_action( 'admin_init', 'WP_Statistics_Shortcode::shortcake' );
|
68 |
|
69 |
// WP-Statistics welcome page hooks
|
@@ -75,25 +78,28 @@ class WP_Statistics_Admin {
|
|
75 |
add_action( 'admin_footer', array( $this, 'admin_footer_scripts' ) );
|
76 |
|
77 |
// Load TinyMce Function
|
78 |
-
new WP_Statistics_TinyMCE
|
79 |
|
80 |
// Add Notice Use cache plugin
|
81 |
add_action( 'admin_notices', array( $this, 'notification_use_cache_plugin' ) );
|
82 |
|
83 |
//Admin Notice Setting
|
84 |
add_action( 'admin_notices', 'WP_Statistics_Admin_Pages::wp_statistics_notice_setting' );
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
/**
|
88 |
-
*
|
89 |
*/
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
wp_statistics_export_data();
|
96 |
}
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
@@ -110,10 +116,7 @@ class WP_Statistics_Admin {
|
|
110 |
?>
|
111 |
<div class="error">
|
112 |
<p style="max-width:800px;"><?php
|
113 |
-
|
114 |
-
echo '<p>';
|
115 |
-
echo __( 'WP Statistics has been removed, please disable and delete it.', 'wp-statistics' );
|
116 |
-
echo '</p>';
|
117 |
?></p>
|
118 |
</div>
|
119 |
<?php
|
@@ -123,7 +126,7 @@ class WP_Statistics_Admin {
|
|
123 |
* This function outputs error messages in the admin interface
|
124 |
* if the primary components of WP Statistics are enabled.
|
125 |
*/
|
126 |
-
|
127 |
global $WP_Statistics;
|
128 |
|
129 |
// If the user had told us to be quite, do so.
|
@@ -141,7 +144,8 @@ class WP_Statistics_Admin {
|
|
141 |
return;
|
142 |
}
|
143 |
|
144 |
-
|
|
|
145 |
|
146 |
$itemstoenable = array();
|
147 |
if ( ! $WP_Statistics->get_option( 'useronline' ) ) {
|
@@ -158,23 +162,12 @@ class WP_Statistics_Admin {
|
|
158 |
}
|
159 |
|
160 |
if ( count( $itemstoenable ) > 0 ) {
|
161 |
-
echo '<div class="update-nag">' . sprintf(
|
162 |
-
__(
|
163 |
-
'The following features are disabled, please go to %ssettings page%s and enable them: %s',
|
164 |
-
'wp-statistics'
|
165 |
-
),
|
166 |
-
'<a href="' . $get_bloginfo_url . '">',
|
167 |
-
'</a>',
|
168 |
-
implode( __( ',', 'wp-statistics' ), $itemstoenable )
|
169 |
-
) . '</div>';
|
170 |
}
|
171 |
|
172 |
-
$get_bloginfo_url = get_admin_url() .
|
173 |
-
"admin.php?page=" .
|
174 |
-
WP_Statistics::$page['optimization'] .
|
175 |
-
"&tab=database";
|
176 |
|
177 |
-
$
|
|
|
178 |
|
179 |
if ( ! $WP_Statistics->get_option( 'search_converted' ) ) {
|
180 |
$dbupdatestodo[] = __( 'search table', 'wp-statistics' );
|
@@ -197,15 +190,7 @@ class WP_Statistics_Admin {
|
|
197 |
}
|
198 |
|
199 |
if ( count( $dbupdatestodo ) > 0 ) {
|
200 |
-
echo '<div class="update-nag">' . sprintf(
|
201 |
-
__(
|
202 |
-
'Database updates are required, please go to %soptimization page%s and update the following: %s',
|
203 |
-
'wp-statistics'
|
204 |
-
),
|
205 |
-
'<a href="' . $get_bloginfo_url . '">',
|
206 |
-
'</a>',
|
207 |
-
implode( __( ',', 'wp-statistics' ), $dbupdatestodo )
|
208 |
-
) . '</div>';
|
209 |
}
|
210 |
}
|
211 |
}
|
@@ -274,11 +259,7 @@ class WP_Statistics_Admin {
|
|
274 |
$alert = __( 'WP_CACHE is Enable in Your WordPress', 'wp-statistics' );
|
275 |
}
|
276 |
|
277 |
-
echo $alert . ", " . sprintf(
|
278 |
-
__( 'Please enable %1$sCache Setting%2$s in WP Statistics.', 'wp-statistics' ),
|
279 |
-
'<a href="' . esc_url( admin_url( add_query_arg( 'page', WP_Statistics::$page['settings'], 'admin.php' ) ) ) . '">', '</a>'
|
280 |
-
);
|
281 |
-
|
282 |
echo '</p></div>';
|
283 |
}
|
284 |
}
|
@@ -321,21 +302,12 @@ class WP_Statistics_Admin {
|
|
321 |
*
|
322 |
* @return string Links
|
323 |
*/
|
324 |
-
|
325 |
global $WP_Statistics;
|
326 |
|
327 |
-
$manage_cap = wp_statistics_validate_capability(
|
328 |
-
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
329 |
-
);
|
330 |
-
|
331 |
if ( current_user_can( $manage_cap ) ) {
|
332 |
-
array_unshift(
|
333 |
-
$links,
|
334 |
-
'<a href="' . admin_url( 'admin.php?page=' . WP_Statistics::$page['settings'] ) . '">' . __(
|
335 |
-
'Settings',
|
336 |
-
'wp-statistics'
|
337 |
-
) . '</a>'
|
338 |
-
);
|
339 |
}
|
340 |
|
341 |
return $links;
|
@@ -349,20 +321,13 @@ class WP_Statistics_Admin {
|
|
349 |
*
|
350 |
* @return array Links
|
351 |
*/
|
352 |
-
|
353 |
if ( $file == plugin_basename( WP_Statistics::$reg['main-file'] ) ) {
|
354 |
$plugin_url = 'http://wordpress.org/plugins/wp-statistics/';
|
355 |
|
356 |
-
$links[]
|
357 |
-
'Click here to visit the plugin on WordPress.org',
|
358 |
-
'wp-statistics'
|
359 |
-
) . '">' . __( 'Visit WordPress.org page', 'wp-statistics' ) . '</a>';
|
360 |
-
|
361 |
$rate_url = 'https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post';
|
362 |
-
$links[] = '<a href="' . $rate_url . '" target="_blank" title="' . __(
|
363 |
-
'Click here to rate and review this plugin on WordPress.org',
|
364 |
-
'wp-statistics'
|
365 |
-
) . '">' . __( 'Rate this plugin', 'wp-statistics' ) . '</a>';
|
366 |
}
|
367 |
|
368 |
return $links;
|
@@ -371,27 +336,16 @@ class WP_Statistics_Admin {
|
|
371 |
/**
|
372 |
* Call the add/render functions at the appropriate times.
|
373 |
*/
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
$read_cap = wp_statistics_validate_capability(
|
378 |
-
$WP_Statistics->get_option( 'read_capability', 'manage_options' )
|
379 |
-
);
|
380 |
|
381 |
-
|
382 |
-
'disable_column'
|
383 |
-
)
|
384 |
-
) {
|
385 |
-
$post_types = (array) get_post_types( array( 'show_ui' => true ), 'object' );
|
386 |
|
|
|
|
|
387 |
foreach ( $post_types as $type ) {
|
388 |
-
add_action( 'manage_' . $type
|
389 |
-
add_action(
|
390 |
-
'manage_' . $type->name . '_posts_custom_column',
|
391 |
-
'WP_Statistics_Admin::render_column',
|
392 |
-
10,
|
393 |
-
2
|
394 |
-
);
|
395 |
}
|
396 |
}
|
397 |
}
|
@@ -417,284 +371,224 @@ class WP_Statistics_Admin {
|
|
417 |
*/
|
418 |
static function render_column( $column_name, $post_id ) {
|
419 |
if ( $column_name == 'wp-statistics' ) {
|
420 |
-
echo "<a href='" .
|
421 |
-
get_admin_url() .
|
422 |
-
"admin.php?page=" .
|
423 |
-
WP_Statistics::$page['pages'] .
|
424 |
-
"&page-id={$post_id}'>" .
|
425 |
-
wp_statistics_pages( 'total', "", $post_id ) .
|
426 |
-
"</a>";
|
427 |
}
|
428 |
}
|
429 |
|
430 |
/**
|
431 |
* Add the hit count to the publish widget in the post/pages editor.
|
432 |
*/
|
433 |
-
|
434 |
global $post;
|
435 |
|
436 |
$id = $post->ID;
|
437 |
-
|
438 |
-
echo "<div class='misc-pub-section'>" .
|
439 |
-
__( 'WP Statistics - Hits', 'wp-statistics' ) .
|
440 |
-
": <b><a href='" .
|
441 |
-
get_admin_url() .
|
442 |
-
"admin.php?page=" .
|
443 |
-
WP_Statistics::$page['pages'] .
|
444 |
-
"&page-id={$id}'>" .
|
445 |
-
wp_statistics_pages( 'total', "", $id ) .
|
446 |
-
"</a></b></div>";
|
447 |
}
|
448 |
|
449 |
/**
|
450 |
* This function adds the primary menu to WordPress.
|
451 |
*/
|
452 |
-
|
453 |
-
|
454 |
|
455 |
// Get the read/write capabilities required to view/manage the plugin as set by the user.
|
456 |
-
$read_cap = wp_statistics_validate_capability(
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
);
|
462 |
|
463 |
-
//
|
464 |
-
$
|
465 |
-
__( 'Statistics', 'wp-statistics' ),
|
466 |
-
__( 'Statistics', 'wp-statistics' ),
|
467 |
-
$read_cap,
|
468 |
-
WP_Statistics::$page['overview'],
|
469 |
-
'WP_Statistics_Admin_Pages::log',
|
470 |
-
'dashicons-chart-pie'
|
471 |
-
);
|
472 |
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
'
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
503 |
-
$WP_Statistics->menu_slugs['referrers'] = add_submenu_page(
|
504 |
-
WP_Statistics::$page['overview'],
|
505 |
-
__( 'Referrers', 'wp-statistics' ),
|
506 |
-
__( 'Referrers', 'wp-statistics' ),
|
507 |
-
$read_cap,
|
508 |
-
WP_Statistics::$page['referrers'],
|
509 |
-
'WP_Statistics_Admin_Pages::log'
|
510 |
-
);
|
511 |
-
}
|
512 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
513 |
-
$WP_Statistics->menu_slugs['words'] = add_submenu_page(
|
514 |
-
WP_Statistics::$page['overview'],
|
515 |
-
__( 'Search Words', 'wp-statistics' ),
|
516 |
-
__( 'Search Words', 'wp-statistics' ),
|
517 |
-
$read_cap,
|
518 |
-
WP_Statistics::$page['words'],
|
519 |
-
'WP_Statistics_Admin_Pages::log'
|
520 |
-
);
|
521 |
-
}
|
522 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
523 |
-
$WP_Statistics->menu_slugs['searched.phrases'] = add_submenu_page(
|
524 |
-
WP_Statistics::$page['overview'],
|
525 |
-
__( 'Top Search Words', 'wp-statistics' ),
|
526 |
-
__( 'Top Search Words', 'wp-statistics' ),
|
527 |
-
$read_cap,
|
528 |
-
WP_Statistics::$page['searched-phrases'],
|
529 |
-
'WP_Statistics_Admin_Pages::log'
|
530 |
-
);
|
531 |
-
}
|
532 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
533 |
-
$WP_Statistics->menu_slugs['searches'] = add_submenu_page(
|
534 |
-
WP_Statistics::$page['overview'],
|
535 |
-
__( 'Search Engines', 'wp-statistics' ),
|
536 |
-
__( 'Search Engines', 'wp-statistics' ),
|
537 |
-
$read_cap,
|
538 |
-
WP_Statistics::$page['searches'],
|
539 |
-
'WP_Statistics_Admin_Pages::log'
|
540 |
-
);
|
541 |
-
}
|
542 |
-
if ( $WP_Statistics->get_option( 'pages' ) ) {
|
543 |
-
$WP_Statistics->menu_slugs['pages'] = add_submenu_page(
|
544 |
-
WP_Statistics::$page['overview'],
|
545 |
-
__( 'Pages', 'wp-statistics' ),
|
546 |
-
__( 'Pages', 'wp-statistics' ),
|
547 |
-
$read_cap,
|
548 |
-
WP_Statistics::$page['pages'],
|
549 |
-
'WP_Statistics_Admin_Pages::log'
|
550 |
-
);
|
551 |
-
}
|
552 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
553 |
-
$WP_Statistics->menu_slugs['visitors'] = add_submenu_page(
|
554 |
-
WP_Statistics::$page['overview'],
|
555 |
-
__( 'Visitors', 'wp-statistics' ),
|
556 |
-
__( 'Visitors', 'wp-statistics' ),
|
557 |
-
$read_cap,
|
558 |
-
WP_Statistics::$page['visitors'],
|
559 |
-
'WP_Statistics_Admin_Pages::log'
|
560 |
-
);
|
561 |
-
}
|
562 |
-
if ( $WP_Statistics->get_option( 'geoip' ) && $WP_Statistics->get_option( 'visitors' ) ) {
|
563 |
-
$WP_Statistics->menu_slugs['countries'] = add_submenu_page(
|
564 |
-
WP_Statistics::$page['overview'],
|
565 |
-
__( 'Countries', 'wp-statistics' ),
|
566 |
-
__( 'Countries', 'wp-statistics' ),
|
567 |
-
$read_cap,
|
568 |
-
WP_Statistics::$page['countries'],
|
569 |
-
'WP_Statistics_Admin_Pages::log'
|
570 |
-
);
|
571 |
-
}
|
572 |
-
if ( $WP_Statistics->get_option( 'pages' ) ) {
|
573 |
-
$WP_Statistics->menu_slugs['categories'] = add_submenu_page(
|
574 |
-
WP_Statistics::$page['overview'],
|
575 |
-
__( 'Categories', 'wp-statistics' ),
|
576 |
-
__( 'Categories', 'wp-statistics' ),
|
577 |
-
$read_cap,
|
578 |
-
WP_Statistics::$page['categories'],
|
579 |
-
'WP_Statistics_Admin_Pages::log'
|
580 |
-
);
|
581 |
-
}
|
582 |
-
if ( $WP_Statistics->get_option( 'pages' ) ) {
|
583 |
-
$WP_Statistics->menu_slugs['tags'] = add_submenu_page(
|
584 |
-
WP_Statistics::$page['overview'],
|
585 |
-
__( 'Tags', 'wp-statistics' ),
|
586 |
-
__( 'Tags', 'wp-statistics' ),
|
587 |
-
$read_cap,
|
588 |
-
WP_Statistics::$page['tags'],
|
589 |
-
'WP_Statistics_Admin_Pages::log'
|
590 |
-
);
|
591 |
-
}
|
592 |
-
if ( $WP_Statistics->get_option( 'pages' ) ) {
|
593 |
-
$WP_Statistics->menu_slugs['authors'] = add_submenu_page(
|
594 |
-
WP_Statistics::$page['overview'],
|
595 |
-
__( 'Authors', 'wp-statistics' ),
|
596 |
-
__( 'Authors', 'wp-statistics' ),
|
597 |
-
$read_cap,
|
598 |
-
WP_Statistics::$page['authors'],
|
599 |
-
'WP_Statistics_Admin_Pages::log'
|
600 |
-
);
|
601 |
-
}
|
602 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
603 |
-
$WP_Statistics->menu_slugs['browsers'] = add_submenu_page(
|
604 |
-
WP_Statistics::$page['overview'],
|
605 |
-
__( 'Browsers', 'wp-statistics' ),
|
606 |
-
__( 'Browsers', 'wp-statistics' ),
|
607 |
-
$read_cap,
|
608 |
-
WP_Statistics::$page['browser'],
|
609 |
-
'WP_Statistics_Admin_Pages::log'
|
610 |
-
);
|
611 |
-
}
|
612 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
613 |
-
$WP_Statistics->menu_slugs['top.visotors'] = add_submenu_page(
|
614 |
-
WP_Statistics::$page['overview'],
|
615 |
-
__( 'Top Visitors Today', 'wp-statistics' ),
|
616 |
-
__( 'Top Visitors Today', 'wp-statistics' ),
|
617 |
-
$read_cap,
|
618 |
-
WP_Statistics::$page['top-visitors'],
|
619 |
-
'WP_Statistics_Admin_Pages::log'
|
620 |
-
);
|
621 |
-
}
|
622 |
-
if ( $WP_Statistics->get_option( 'record_exclusions' ) ) {
|
623 |
-
$WP_Statistics->menu_slugs['exclusions'] = add_submenu_page(
|
624 |
-
WP_Statistics::$page['overview'],
|
625 |
-
__( 'Exclusions', 'wp-statistics' ),
|
626 |
-
__( 'Exclusions', 'wp-statistics' ),
|
627 |
-
$read_cap,
|
628 |
-
WP_Statistics::$page['exclusions'],
|
629 |
-
'WP_Statistics_Admin_Pages::log'
|
630 |
-
);
|
631 |
}
|
632 |
-
$WP_Statistics->menu_slugs['break'] = add_submenu_page(
|
633 |
-
WP_Statistics::$page['overview'],
|
634 |
-
'',
|
635 |
-
'',
|
636 |
-
$read_cap,
|
637 |
-
'wps_break_menu',
|
638 |
-
'WP_Statistics_Admin_Pages::log'
|
639 |
-
);
|
640 |
-
$WP_Statistics->menu_slugs['optimize'] = add_submenu_page(
|
641 |
-
WP_Statistics::$page['overview'],
|
642 |
-
__( 'Optimization', 'wp-statistics' ),
|
643 |
-
__( 'Optimization', 'wp-statistics' ),
|
644 |
-
$manage_cap,
|
645 |
-
WP_Statistics::$page['optimization'],
|
646 |
-
'WP_Statistics_Admin_Pages::optimization'
|
647 |
-
);
|
648 |
-
$WP_Statistics->menu_slugs['settings'] = add_submenu_page(
|
649 |
-
WP_Statistics::$page['overview'],
|
650 |
-
__( 'Settings', 'wp-statistics' ),
|
651 |
-
__( 'Settings', 'wp-statistics' ),
|
652 |
-
$manage_cap,
|
653 |
-
WP_Statistics::$page['settings'],
|
654 |
-
'WP_Statistics_Admin_Pages::settings'
|
655 |
-
);
|
656 |
-
$WP_Statistics->menu_slugs['plugins'] = add_submenu_page(
|
657 |
-
WP_Statistics::$page['overview'],
|
658 |
-
__( 'Add-Ons', 'wp-statistics' ),
|
659 |
-
'<span style="color:#dc6b26">' . __( 'Add-Ons', 'wp-statistics' ) . '</span>',
|
660 |
-
$read_cap,
|
661 |
-
WP_Statistics::$page['plugins'],
|
662 |
-
'WP_Statistics_Admin_Pages::plugins'
|
663 |
-
);
|
664 |
-
$WP_Statistics->menu_slugs['donate'] = add_submenu_page(
|
665 |
-
WP_Statistics::$page['overview'],
|
666 |
-
__( 'Donate', 'wp-statistics' ),
|
667 |
-
'<span style="color:#459605">' . __( 'Donate', 'wp-statistics' ) . '</span>',
|
668 |
-
$read_cap,
|
669 |
-
WP_Statistics::$page['donate'],
|
670 |
-
'WP_Statistics_Admin_Pages::donate'
|
671 |
-
);
|
672 |
|
673 |
// Add action to load the meta boxes to the overview page.
|
674 |
add_action( 'load-' . $WP_Statistics->menu_slugs['overview'], 'WP_Statistics_Admin_Pages::overview' );
|
675 |
-
|
676 |
}
|
677 |
|
678 |
/**
|
679 |
-
* Enqueue Scripts
|
680 |
-
*
|
681 |
-
* @param string $hook Not Used
|
682 |
*/
|
683 |
-
|
684 |
global $pagenow, $WP_Statistics;
|
685 |
|
686 |
// Load our CSS to be used.
|
687 |
-
wp_enqueue_style(
|
688 |
-
'wpstatistics-admin-css',
|
689 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/admin.css',
|
690 |
-
true,
|
691 |
-
WP_Statistics::$reg['version']
|
692 |
-
);
|
693 |
-
|
694 |
if ( is_rtl() ) {
|
695 |
wp_enqueue_style( 'rtl-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/rtl.css', true, WP_Statistics::$reg['version'] );
|
696 |
}
|
697 |
|
|
|
|
|
698 |
|
699 |
//Load Chart Js
|
700 |
$load_in_footer = false;
|
@@ -721,13 +615,7 @@ class WP_Statistics_Admin {
|
|
721 |
}
|
722 |
|
723 |
if ( $load_chart === true ) {
|
724 |
-
wp_enqueue_script(
|
725 |
-
'wp-statistics-chart-js',
|
726 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/js/Chart.bundle.min.js',
|
727 |
-
false,
|
728 |
-
'2.7.3',
|
729 |
-
$load_in_footer
|
730 |
-
);
|
731 |
}
|
732 |
|
733 |
}
|
@@ -764,14 +652,7 @@ class WP_Statistics_Admin {
|
|
764 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
765 |
}
|
766 |
|
767 |
-
wp_mail(
|
768 |
-
$WP_Statistics->get_option( 'email_list' ),
|
769 |
-
sprintf( __( 'WP Statistics %s installed on', 'wp-statistics' ), WP_Statistics::$reg['version'] ) .
|
770 |
-
' ' .
|
771 |
-
$blogname,
|
772 |
-
__( 'Installation/upgrade complete!', 'wp-statistics' ),
|
773 |
-
$headers
|
774 |
-
);
|
775 |
}
|
776 |
}
|
777 |
}
|
21 |
if ( get_option( 'wp_statistics_removal' ) == 'true' ) {
|
22 |
new WP_Statistics_Uninstall;
|
23 |
}
|
24 |
+
|
25 |
// If we've been removed, return without doing anything else.
|
26 |
if ( get_option( 'wp_statistics_removal' ) == 'done' ) {
|
27 |
add_action( 'admin_notices', array( $this, 'removal_admin_notice' ), 10, 2 );
|
|
|
28 |
return;
|
29 |
}
|
30 |
|
31 |
+
//Show Admin Menu
|
32 |
+
add_action( 'admin_menu', array( $this, 'menu' ) );
|
33 |
+
if ( is_multisite() ) {
|
34 |
+
add_action( 'network_admin_menu', 'WP_Statistics_Network_Admin::menu' );
|
35 |
+
}
|
36 |
|
37 |
+
//Load Script in Admin Area
|
38 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
39 |
+
|
40 |
+
//init Export Class
|
41 |
+
new WP_Statistics_Export;
|
42 |
+
|
43 |
+
//init Ajax Class
|
44 |
new WP_Statistics_Ajax;
|
45 |
|
46 |
+
//init Dashboard Widget
|
47 |
+
new WP_Statistics_Dashboard;
|
48 |
+
|
49 |
+
//Add Custom MetaBox in Wp-statistics Admin Page
|
50 |
+
add_action( 'add_meta_boxes', 'WP_Statistics_Editor::add_meta_box' );
|
51 |
+
|
52 |
// Display the admin notices if we should.
|
53 |
if ( isset( $pagenow ) && array_key_exists( 'page', $_GET ) ) {
|
54 |
if ( $pagenow == "admin.php" && substr( $_GET['page'], 0, 14 ) == 'wp-statistics/' ) {
|
55 |
+
add_action( 'admin_notices', array( $this, 'not_enable' ) );
|
56 |
}
|
57 |
}
|
58 |
|
59 |
+
//Change Plugin Action link in Plugin.php admin
|
60 |
+
add_filter( 'plugin_action_links_' . plugin_basename( WP_Statistics::$reg['main-file'] ), array( $this, 'settings_links' ), 10, 2 );
|
61 |
+
add_filter( 'plugin_row_meta', array( $this, 'add_meta_links' ), 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
+
//Add Column in Post Type Wp_List Table
|
64 |
+
add_action( 'load-edit.php', array( $this, 'load_edit_init' ) );
|
65 |
if ( $WP_Statistics->get_option( 'pages' ) && ! $WP_Statistics->get_option( 'disable_column' ) ) {
|
66 |
+
add_action( 'post_submitbox_misc_actions', array( $this, 'post_init' ) );
|
67 |
}
|
68 |
|
69 |
+
//init ShortCode
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
add_action( 'admin_init', 'WP_Statistics_Shortcode::shortcake' );
|
71 |
|
72 |
// WP-Statistics welcome page hooks
|
78 |
add_action( 'admin_footer', array( $this, 'admin_footer_scripts' ) );
|
79 |
|
80 |
// Load TinyMce Function
|
81 |
+
new WP_Statistics_TinyMCE;
|
82 |
|
83 |
// Add Notice Use cache plugin
|
84 |
add_action( 'admin_notices', array( $this, 'notification_use_cache_plugin' ) );
|
85 |
|
86 |
//Admin Notice Setting
|
87 |
add_action( 'admin_notices', 'WP_Statistics_Admin_Pages::wp_statistics_notice_setting' );
|
88 |
+
|
89 |
+
//Add Visitors Log Table
|
90 |
+
add_action( 'admin_init', array( $this, 'register_visitors_log_tbl' ) );
|
91 |
}
|
92 |
|
93 |
/**
|
94 |
+
* Create a New Table Visitors Log in mysql
|
95 |
*/
|
96 |
+
public function register_visitors_log_tbl() {
|
97 |
+
|
98 |
+
//Add Visitor RelationShip Table
|
99 |
+
if ( WP_Statistics_Admin_Pages::in_page( 'settings' ) and isset( $_POST['wps_visitors_log'] ) and $_POST['wps_visitors_log'] == 1 ) {
|
100 |
+
WP_Statistics_Install::setup_visitor_relationship_table();
|
|
|
101 |
}
|
102 |
+
|
103 |
}
|
104 |
|
105 |
/**
|
116 |
?>
|
117 |
<div class="error">
|
118 |
<p style="max-width:800px;"><?php
|
119 |
+
echo '<p>' . __( 'WP Statistics has been removed, please disable and delete it.', 'wp-statistics' ) . '</p>';
|
|
|
|
|
|
|
120 |
?></p>
|
121 |
</div>
|
122 |
<?php
|
126 |
* This function outputs error messages in the admin interface
|
127 |
* if the primary components of WP Statistics are enabled.
|
128 |
*/
|
129 |
+
public function not_enable() {
|
130 |
global $WP_Statistics;
|
131 |
|
132 |
// If the user had told us to be quite, do so.
|
144 |
return;
|
145 |
}
|
146 |
|
147 |
+
|
148 |
+
$get_bloginfo_url = WP_Statistics_Admin_Pages::admin_url( 'settings' );
|
149 |
|
150 |
$itemstoenable = array();
|
151 |
if ( ! $WP_Statistics->get_option( 'useronline' ) ) {
|
162 |
}
|
163 |
|
164 |
if ( count( $itemstoenable ) > 0 ) {
|
165 |
+
echo '<div class="update-nag">' . sprintf( __( 'The following features are disabled, please go to %ssettings page%s and enable them: %s', 'wp-statistics' ), '<a href="' . $get_bloginfo_url . '">', '</a>', implode( __( ',', 'wp-statistics' ), $itemstoenable ) ) . '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
}
|
167 |
|
|
|
|
|
|
|
|
|
168 |
|
169 |
+
$get_bloginfo_url = WP_Statistics_Admin_Pages::admin_url( 'optimization', array( 'tab' => 'database' ) );
|
170 |
+
$dbupdatestodo = array();
|
171 |
|
172 |
if ( ! $WP_Statistics->get_option( 'search_converted' ) ) {
|
173 |
$dbupdatestodo[] = __( 'search table', 'wp-statistics' );
|
190 |
}
|
191 |
|
192 |
if ( count( $dbupdatestodo ) > 0 ) {
|
193 |
+
echo '<div class="update-nag">' . sprintf( __( 'Database updates are required, please go to %soptimization page%s and update the following: %s', 'wp-statistics' ), '<a href="' . $get_bloginfo_url . '">', '</a>', implode( __( ',', 'wp-statistics' ), $dbupdatestodo ) ) . '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
}
|
195 |
}
|
196 |
}
|
259 |
$alert = __( 'WP_CACHE is Enable in Your WordPress', 'wp-statistics' );
|
260 |
}
|
261 |
|
262 |
+
echo $alert . ", " . sprintf( __( 'Please enable %1$sCache Setting%2$s in WP Statistics.', 'wp-statistics' ), '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'settings' ) . '">', '</a>' );
|
|
|
|
|
|
|
|
|
263 |
echo '</p></div>';
|
264 |
}
|
265 |
}
|
302 |
*
|
303 |
* @return string Links
|
304 |
*/
|
305 |
+
public function settings_links( $links, $file ) {
|
306 |
global $WP_Statistics;
|
307 |
|
308 |
+
$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) );
|
|
|
|
|
|
|
309 |
if ( current_user_can( $manage_cap ) ) {
|
310 |
+
array_unshift( $links, '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'settings' ) . '">' . __( 'Settings', 'wp-statistics' ) . '</a>' );
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
}
|
312 |
|
313 |
return $links;
|
321 |
*
|
322 |
* @return array Links
|
323 |
*/
|
324 |
+
public function add_meta_links( $links, $file ) {
|
325 |
if ( $file == plugin_basename( WP_Statistics::$reg['main-file'] ) ) {
|
326 |
$plugin_url = 'http://wordpress.org/plugins/wp-statistics/';
|
327 |
|
328 |
+
$links[] = '<a href="' . $plugin_url . '" target="_blank" title="' . __( 'Click here to visit the plugin on WordPress.org', 'wp-statistics' ) . '">' . __( 'Visit WordPress.org page', 'wp-statistics' ) . '</a>';
|
|
|
|
|
|
|
|
|
329 |
$rate_url = 'https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post';
|
330 |
+
$links[] = '<a href="' . $rate_url . '" target="_blank" title="' . __( 'Click here to rate and review this plugin on WordPress.org', 'wp-statistics' ) . '">' . __( 'Rate this plugin', 'wp-statistics' ) . '</a>';
|
|
|
|
|
|
|
331 |
}
|
332 |
|
333 |
return $links;
|
336 |
/**
|
337 |
* Call the add/render functions at the appropriate times.
|
338 |
*/
|
339 |
+
public function load_edit_init() {
|
340 |
+
global $WP_Statistics;
|
|
|
|
|
|
|
|
|
341 |
|
342 |
+
$read_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_options' ) );
|
|
|
|
|
|
|
|
|
343 |
|
344 |
+
if ( current_user_can( $read_cap ) && $WP_Statistics->get_option( 'pages' ) && ! $WP_Statistics->get_option( 'disable_column' ) ) {
|
345 |
+
$post_types = WP_Statistics_Editor::get_list_post_type();
|
346 |
foreach ( $post_types as $type ) {
|
347 |
+
add_action( 'manage_' . $type . '_posts_columns', 'WP_Statistics_Admin::add_column', 10, 2 );
|
348 |
+
add_action( 'manage_' . $type . '_posts_custom_column', 'WP_Statistics_Admin::render_column', 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
349 |
}
|
350 |
}
|
351 |
}
|
371 |
*/
|
372 |
static function render_column( $column_name, $post_id ) {
|
373 |
if ( $column_name == 'wp-statistics' ) {
|
374 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'pages', array( 'page-id' => $post_id ) ) . "'>" . wp_statistics_pages( 'total', "", $post_id ) . "</a>";
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
}
|
376 |
}
|
377 |
|
378 |
/**
|
379 |
* Add the hit count to the publish widget in the post/pages editor.
|
380 |
*/
|
381 |
+
public function post_init() {
|
382 |
global $post;
|
383 |
|
384 |
$id = $post->ID;
|
385 |
+
echo "<div class='misc-pub-section'>" . __( 'WP Statistics - Hits', 'wp-statistics' ) . ": <b><a href='" . WP_Statistics_Admin_Pages::admin_url( 'pages', array( 'page-id' => $id ) ) . "'>" . wp_statistics_pages( 'total', "", $id ) . "</a></b></div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
}
|
387 |
|
388 |
/**
|
389 |
* This function adds the primary menu to WordPress.
|
390 |
*/
|
391 |
+
public function menu() {
|
392 |
+
global $WP_Statistics;
|
393 |
|
394 |
// Get the read/write capabilities required to view/manage the plugin as set by the user.
|
395 |
+
$read_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_options' ) );
|
396 |
+
$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) );
|
397 |
+
|
398 |
+
/**
|
399 |
+
* List of WP-Statistics Admin Menu
|
400 |
+
*
|
401 |
+
* --- Array Arg -----
|
402 |
+
* name : Menu name
|
403 |
+
* title : Page title / if not exist [title == name]
|
404 |
+
* cap : min require capability @default $read_cap
|
405 |
+
* icon : Wordpress DashIcon name
|
406 |
+
* method : method that call in page @default log
|
407 |
+
* sub : if sub menu , add main menu slug
|
408 |
+
* page_url : link of Slug Url Page @see WP_Statistics::$page
|
409 |
+
* break : add new line after sub menu if break key == true
|
410 |
+
* require : the Condition From Wp-statistics Option if == true for show admin menu
|
411 |
+
*
|
412 |
+
*/
|
413 |
+
$list = array(
|
414 |
+
'top' => array(
|
415 |
+
'title' => __( 'Statistics', 'wp-statistics' ),
|
416 |
+
'page_url' => 'overview',
|
417 |
+
'method' => 'log',
|
418 |
+
'icon' => 'dashicons-chart-pie',
|
419 |
+
),
|
420 |
+
'overview' => array(
|
421 |
+
'sub' => 'overview',
|
422 |
+
'title' => __( 'Overview', 'wp-statistics' ),
|
423 |
+
'page_url' => 'overview',
|
424 |
+
),
|
425 |
+
'hits' => array(
|
426 |
+
'require' => array( 'visits' ),
|
427 |
+
'sub' => 'overview',
|
428 |
+
'title' => __( 'Hits', 'wp-statistics' ),
|
429 |
+
'page_url' => 'hits',
|
430 |
+
),
|
431 |
+
'online' => array(
|
432 |
+
'require' => array( 'useronline' ),
|
433 |
+
'sub' => 'overview',
|
434 |
+
'title' => __( 'Online', 'wp-statistics' ),
|
435 |
+
'page_url' => 'online',
|
436 |
+
),
|
437 |
+
'referrers' => array(
|
438 |
+
'require' => array( 'visitors' ),
|
439 |
+
'sub' => 'overview',
|
440 |
+
'title' => __( 'Referrers', 'wp-statistics' ),
|
441 |
+
'page_url' => 'referrers',
|
442 |
+
),
|
443 |
+
'words' => array(
|
444 |
+
'require' => array( 'visitors' ),
|
445 |
+
'sub' => 'overview',
|
446 |
+
'title' => __( 'Search Words', 'wp-statistics' ),
|
447 |
+
'page_url' => 'words',
|
448 |
+
),
|
449 |
+
'searches' => array(
|
450 |
+
'require' => array( 'visitors' ),
|
451 |
+
'sub' => 'overview',
|
452 |
+
'title' => __( 'Search Engines', 'wp-statistics' ),
|
453 |
+
'page_url' => 'searches',
|
454 |
+
),
|
455 |
+
'pages' => array(
|
456 |
+
'require' => array( 'pages' ),
|
457 |
+
'sub' => 'overview',
|
458 |
+
'title' => __( 'Pages', 'wp-statistics' ),
|
459 |
+
'page_url' => 'pages',
|
460 |
+
),
|
461 |
+
'visitors' => array(
|
462 |
+
'require' => array( 'visitors' ),
|
463 |
+
'sub' => 'overview',
|
464 |
+
'title' => __( 'Visitors', 'wp-statistics' ),
|
465 |
+
'page_url' => 'visitors',
|
466 |
+
),
|
467 |
+
'countries' => array(
|
468 |
+
'require' => array( 'geoip', 'visitors' ),
|
469 |
+
'sub' => 'overview',
|
470 |
+
'title' => __( 'Countries', 'wp-statistics' ),
|
471 |
+
'page_url' => 'countries',
|
472 |
+
),
|
473 |
+
'categories' => array(
|
474 |
+
'require' => array( 'pages' ),
|
475 |
+
'sub' => 'overview',
|
476 |
+
'title' => __( 'Categories', 'wp-statistics' ),
|
477 |
+
'page_url' => 'categories',
|
478 |
+
),
|
479 |
+
'tags' => array(
|
480 |
+
'require' => array( 'pages' ),
|
481 |
+
'sub' => 'overview',
|
482 |
+
'title' => __( 'Tags', 'wp-statistics' ),
|
483 |
+
'page_url' => 'tags',
|
484 |
+
),
|
485 |
+
'authors' => array(
|
486 |
+
'require' => array( 'pages' ),
|
487 |
+
'sub' => 'overview',
|
488 |
+
'title' => __( 'Authors', 'wp-statistics' ),
|
489 |
+
'page_url' => 'authors',
|
490 |
+
),
|
491 |
+
'browsers' => array(
|
492 |
+
'require' => array( 'visitors' ),
|
493 |
+
'sub' => 'overview',
|
494 |
+
'title' => __( 'Browsers', 'wp-statistics' ),
|
495 |
+
'page_url' => 'browser',
|
496 |
+
),
|
497 |
+
'top.visotors' => array(
|
498 |
+
'require' => array( 'visitors' ),
|
499 |
+
'sub' => 'overview',
|
500 |
+
'title' => __( 'Top Visitors Today', 'wp-statistics' ),
|
501 |
+
'page_url' => 'top-visitors',
|
502 |
+
),
|
503 |
+
'exclusions' => array(
|
504 |
+
'require' => array( 'record_exclusions' ),
|
505 |
+
'sub' => 'overview',
|
506 |
+
'title' => __( 'Exclusions', 'wp-statistics' ),
|
507 |
+
'page_url' => 'exclusions',
|
508 |
+
'break' => true,
|
509 |
+
),
|
510 |
+
'optimize' => array(
|
511 |
+
'sub' => 'overview',
|
512 |
+
'title' => __( 'Optimization', 'wp-statistics' ),
|
513 |
+
'cap' => $manage_cap,
|
514 |
+
'page_url' => 'optimization',
|
515 |
+
'method' => 'optimization'
|
516 |
+
),
|
517 |
+
'settings' => array(
|
518 |
+
'sub' => 'overview',
|
519 |
+
'title' => __( 'Settings', 'wp-statistics' ),
|
520 |
+
'cap' => $manage_cap,
|
521 |
+
'page_url' => 'settings',
|
522 |
+
'method' => 'settings'
|
523 |
+
),
|
524 |
+
'plugins' => array(
|
525 |
+
'sub' => 'overview',
|
526 |
+
'title' => __( 'Add-Ons', 'wp-statistics' ),
|
527 |
+
'name' => '<span class="wps-text-warning">' . __( 'Add-Ons', 'wp-statistics' ) . '</span>',
|
528 |
+
'page_url' => 'plugins',
|
529 |
+
'method' => 'plugins'
|
530 |
+
),
|
531 |
+
'donate' => array(
|
532 |
+
'sub' => 'overview',
|
533 |
+
'title' => __( 'Donate', 'wp-statistics' ),
|
534 |
+
'name' => '<span class="wps-text-success">' . __( 'Donate', 'wp-statistics' ) . '</span>',
|
535 |
+
'page_url' => 'donate',
|
536 |
+
'method' => 'donate'
|
537 |
+
)
|
538 |
);
|
539 |
|
540 |
+
//Show Admin Menu List
|
541 |
+
foreach ( $list as $key => $menu ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
|
543 |
+
//Check Default variable
|
544 |
+
$capability = $read_cap;
|
545 |
+
$method = 'log';
|
546 |
+
$name = $menu['title'];
|
547 |
+
if ( array_key_exists( 'cap', $menu ) ) {
|
548 |
+
$capability = $menu['cap'];
|
549 |
+
}
|
550 |
+
if ( array_key_exists( 'method', $menu ) ) {
|
551 |
+
$method = $menu['method'];
|
552 |
+
}
|
553 |
+
if ( array_key_exists( 'name', $menu ) ) {
|
554 |
+
$name = $menu['name'];
|
555 |
+
}
|
556 |
+
|
557 |
+
//Check if SubMenu or Main Menu
|
558 |
+
if ( array_key_exists( 'sub', $menu ) ) {
|
559 |
+
|
560 |
+
//Check Conditions For Show Menu
|
561 |
+
if ( wp_statistics_check_option_require( $menu ) === true ) {
|
562 |
+
$WP_Statistics->menu_slugs[ $key ] = add_submenu_page( WP_Statistics::$page[ $menu['sub'] ], $menu['title'], $name, $capability, WP_Statistics::$page[ $menu['page_url'] ], 'WP_Statistics_Admin_Pages::' . $method );
|
563 |
+
}
|
564 |
+
|
565 |
+
//Check if add Break Line
|
566 |
+
if ( array_key_exists( 'break', $menu ) ) {
|
567 |
+
$WP_Statistics->menu_slugs[ 'break_' . $key ] = add_submenu_page( WP_Statistics::$page[ $menu['sub'] ], '', '', $capability, 'wps_break_menu', 'WP_Statistics_Admin_Pages::' . $method );
|
568 |
+
}
|
569 |
+
} else {
|
570 |
+
$WP_Statistics->menu_slugs[ $key ] = add_menu_page( $menu['title'], $name, $capability, WP_Statistics::$page[ $menu['page_url'] ], "WP_Statistics_Admin_Pages::" . $method, $menu['icon'] );
|
571 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
573 |
|
574 |
// Add action to load the meta boxes to the overview page.
|
575 |
add_action( 'load-' . $WP_Statistics->menu_slugs['overview'], 'WP_Statistics_Admin_Pages::overview' );
|
|
|
576 |
}
|
577 |
|
578 |
/**
|
579 |
+
* Enqueue Scripts in Admin Area
|
|
|
|
|
580 |
*/
|
581 |
+
public function enqueue_scripts() {
|
582 |
global $pagenow, $WP_Statistics;
|
583 |
|
584 |
// Load our CSS to be used.
|
585 |
+
wp_enqueue_style( 'wpstatistics-admin-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/admin.css', true, WP_Statistics::$reg['version'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
if ( is_rtl() ) {
|
587 |
wp_enqueue_style( 'rtl-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/rtl.css', true, WP_Statistics::$reg['version'] );
|
588 |
}
|
589 |
|
590 |
+
//Load Admin Js
|
591 |
+
wp_enqueue_script( 'wp-statistics-admin-js', WP_Statistics::$reg['plugin-url'] . 'assets/js/admin.js', array( 'jquery' ), WP_Statistics::$reg['version'] );
|
592 |
|
593 |
//Load Chart Js
|
594 |
$load_in_footer = false;
|
615 |
}
|
616 |
|
617 |
if ( $load_chart === true ) {
|
618 |
+
wp_enqueue_script( 'wp-statistics-chart-js', WP_Statistics::$reg['plugin-url'] . 'assets/js/Chart.bundle.min.js', false, '2.7.3', $load_in_footer );
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
}
|
620 |
|
621 |
}
|
652 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
653 |
}
|
654 |
|
655 |
+
wp_mail( $WP_Statistics->get_option( 'email_list' ), sprintf( __( 'WP Statistics %s installed on', 'wp-statistics' ), WP_Statistics::$reg['version'] ) . ' ' . $blogname, __( 'Installation/upgrade complete!', 'wp-statistics' ), $headers );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
656 |
}
|
657 |
}
|
658 |
}
|
includes/classes/class-wp-statistics-ajax.php
CHANGED
@@ -9,24 +9,30 @@ class WP_Statistics_Ajax {
|
|
9 |
* WP_Statistics_Ajax constructor.
|
10 |
*/
|
11 |
function __construct() {
|
12 |
-
add_action( 'wp_ajax_wp_statistics_close_notice', 'WP_Statistics_Ajax::close_notice_action_callback' );
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
* Setup an AJAX action to close the notice on the overview page.
|
27 |
*/
|
28 |
-
|
29 |
-
|
30 |
|
31 |
$manage_cap = wp_statistics_validate_capability(
|
32 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
@@ -43,17 +49,17 @@ class WP_Statistics_Ajax {
|
|
43 |
break;
|
44 |
}
|
45 |
|
46 |
-
|
47 |
}
|
48 |
|
49 |
-
wp_die();
|
50 |
}
|
51 |
|
52 |
/**
|
53 |
* Setup an AJAX action to delete an agent in the optimization page.
|
54 |
*/
|
55 |
-
|
56 |
-
|
57 |
|
58 |
$manage_cap = wp_statistics_validate_capability(
|
59 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
@@ -84,14 +90,14 @@ class WP_Statistics_Ajax {
|
|
84 |
_e( 'Access denied!', 'wp-statistics' );
|
85 |
}
|
86 |
|
87 |
-
wp_die();
|
88 |
}
|
89 |
|
90 |
/**
|
91 |
* Setup an AJAX action to delete a platform in the optimization page.
|
92 |
*/
|
93 |
-
|
94 |
-
|
95 |
|
96 |
$manage_cap = wp_statistics_validate_capability(
|
97 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
@@ -121,14 +127,14 @@ class WP_Statistics_Ajax {
|
|
121 |
_e( 'Access denied!', 'wp-statistics' );
|
122 |
}
|
123 |
|
124 |
-
wp_die();
|
125 |
}
|
126 |
|
127 |
/**
|
128 |
* Setup an AJAX action to delete a ip in the optimization page.
|
129 |
*/
|
130 |
-
|
131 |
-
|
132 |
|
133 |
$manage_cap = wp_statistics_validate_capability(
|
134 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
@@ -158,82 +164,61 @@ class WP_Statistics_Ajax {
|
|
158 |
_e( 'Access denied!', 'wp-statistics' );
|
159 |
}
|
160 |
|
161 |
-
wp_die();
|
162 |
}
|
163 |
|
164 |
/**
|
165 |
* Setup an AJAX action to empty a table in the optimization page.
|
166 |
*/
|
167 |
-
|
168 |
-
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
echo wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_visit' );
|
185 |
-
break;
|
186 |
-
case 'visitors':
|
187 |
-
echo wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_visitor' );
|
188 |
-
break;
|
189 |
-
case 'exclusions':
|
190 |
-
echo wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_exclusions' );
|
191 |
-
break;
|
192 |
-
case 'pages':
|
193 |
-
echo wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_pages' );
|
194 |
-
break;
|
195 |
-
case 'search':
|
196 |
-
echo wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_search' );
|
197 |
-
break;
|
198 |
-
case 'all':
|
199 |
-
$result_string = wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_useronline' );
|
200 |
-
$result_string .= '<br>' . wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_visit' );
|
201 |
-
$result_string .= '<br>' . wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_visitor' );
|
202 |
-
$result_string .= '<br>' . wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_exclusions' );
|
203 |
-
$result_string .= '<br>' . wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_pages' );
|
204 |
-
$result_string .= '<br>' . wp_statitiscs_empty_table( $wpdb->prefix . 'statistics_search' );
|
205 |
-
|
206 |
-
echo $result_string;
|
207 |
-
|
208 |
-
break;
|
209 |
-
default:
|
210 |
-
_e( 'Please select the desired items.', 'wp-statistics' );
|
211 |
-
}
|
212 |
|
213 |
-
|
214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
} else {
|
216 |
-
|
217 |
}
|
|
|
|
|
218 |
} else {
|
219 |
_e( 'Access denied!', 'wp-statistics' );
|
220 |
}
|
221 |
|
222 |
-
wp_die();
|
223 |
}
|
224 |
|
225 |
/**
|
226 |
* Setup an AJAX action to purge old data in the optimization page.
|
227 |
*/
|
228 |
-
|
229 |
-
|
230 |
|
231 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge.php' );
|
232 |
|
233 |
-
$manage_cap = wp_statistics_validate_capability(
|
234 |
-
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
235 |
-
);
|
236 |
-
|
237 |
if ( current_user_can( $manage_cap ) ) {
|
238 |
$purge_days = 0;
|
239 |
|
@@ -247,14 +232,14 @@ class WP_Statistics_Ajax {
|
|
247 |
_e( 'Access denied!', 'wp-statistics' );
|
248 |
}
|
249 |
|
250 |
-
wp_die();
|
251 |
}
|
252 |
|
253 |
/**
|
254 |
* Setup an AJAX action to purge visitors with more than a defined number of hits.
|
255 |
*/
|
256 |
-
|
257 |
-
|
258 |
|
259 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge-hits.php' );
|
260 |
|
@@ -279,17 +264,18 @@ class WP_Statistics_Ajax {
|
|
279 |
_e( 'Access denied!', 'wp-statistics' );
|
280 |
}
|
281 |
|
282 |
-
wp_die();
|
283 |
}
|
284 |
|
285 |
/**
|
286 |
* Setup an AJAX action to purge visitors with more than a defined number of hits.
|
287 |
*/
|
288 |
-
|
289 |
-
|
290 |
|
291 |
$widgets = array(
|
292 |
'about',
|
|
|
293 |
'browsers',
|
294 |
'map',
|
295 |
'countries',
|
@@ -303,8 +289,7 @@ class WP_Statistics_Ajax {
|
|
303 |
'search',
|
304 |
'summary',
|
305 |
'top.visitors',
|
306 |
-
'words'
|
307 |
-
'searched.phrases',
|
308 |
);
|
309 |
|
310 |
if ( array_key_exists( 'format', $_POST ) and $_POST['format'] == 'dashboard' ) {
|
@@ -334,10 +319,6 @@ class WP_Statistics_Ajax {
|
|
334 |
$widget = 'top.visitors';
|
335 |
}
|
336 |
|
337 |
-
if ( $_POST['widget'] == "searched_phrases" ) {
|
338 |
-
$widget = 'searched.phrases';
|
339 |
-
}
|
340 |
-
|
341 |
if ( 'map' == $widget || 'hitsmap' == $widget ) {
|
342 |
$widget = 'jqv.map';
|
343 |
}
|
@@ -369,10 +350,6 @@ class WP_Statistics_Ajax {
|
|
369 |
case 'referring':
|
370 |
wp_statistics_generate_referring_postbox_content();
|
371 |
|
372 |
-
break;
|
373 |
-
case 'searched.phrases':
|
374 |
-
wp_statistics_generate_searched_phrases_postbox_content();
|
375 |
-
|
376 |
break;
|
377 |
case 'countries':
|
378 |
wp_statistics_generate_countries_postbox_content( $ISOCountryCode );
|
@@ -419,6 +396,10 @@ class WP_Statistics_Ajax {
|
|
419 |
|
420 |
wp_statistics_generate_top_visitors_postbox_content( $ISOCountryCode, 'today', 10, $format );
|
421 |
|
|
|
|
|
|
|
|
|
422 |
break;
|
423 |
case 'about':
|
424 |
wp_statistics_generate_about_postbox_content( $ISOCountryCode );
|
@@ -431,6 +412,6 @@ class WP_Statistics_Ajax {
|
|
431 |
_e( 'Access denied!', 'wp-statistics' );
|
432 |
}
|
433 |
|
434 |
-
wp_die();
|
435 |
}
|
436 |
}
|
9 |
* WP_Statistics_Ajax constructor.
|
10 |
*/
|
11 |
function __construct() {
|
|
|
12 |
|
13 |
+
/**
|
14 |
+
* List Of Setup Ajax request in Wordpress
|
15 |
+
*/
|
16 |
+
$list = array(
|
17 |
+
'close_notice',
|
18 |
+
'delete_agents',
|
19 |
+
'delete_platforms',
|
20 |
+
'delete_ip',
|
21 |
+
'empty_table',
|
22 |
+
'purge_data',
|
23 |
+
'purge_visitor_hits',
|
24 |
+
'get_widget_contents'
|
25 |
+
);
|
26 |
+
foreach ( $list as $method ) {
|
27 |
+
add_action( 'wp_ajax_wp_statistics_' . $method, array( $this, $method . '_action_callback' ) );
|
28 |
+
}
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
* Setup an AJAX action to close the notice on the overview page.
|
33 |
*/
|
34 |
+
public function close_notice_action_callback() {
|
35 |
+
global $WP_Statistics;
|
36 |
|
37 |
$manage_cap = wp_statistics_validate_capability(
|
38 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
49 |
break;
|
50 |
}
|
51 |
|
52 |
+
$WP_Statistics->update_option( 'admin_notices', false );
|
53 |
}
|
54 |
|
55 |
+
wp_die();
|
56 |
}
|
57 |
|
58 |
/**
|
59 |
* Setup an AJAX action to delete an agent in the optimization page.
|
60 |
*/
|
61 |
+
public function delete_agents_action_callback() {
|
62 |
+
global $WP_Statistics, $wpdb;
|
63 |
|
64 |
$manage_cap = wp_statistics_validate_capability(
|
65 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
90 |
_e( 'Access denied!', 'wp-statistics' );
|
91 |
}
|
92 |
|
93 |
+
wp_die();
|
94 |
}
|
95 |
|
96 |
/**
|
97 |
* Setup an AJAX action to delete a platform in the optimization page.
|
98 |
*/
|
99 |
+
public function delete_platforms_action_callback() {
|
100 |
+
global $WP_Statistics, $wpdb;
|
101 |
|
102 |
$manage_cap = wp_statistics_validate_capability(
|
103 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
127 |
_e( 'Access denied!', 'wp-statistics' );
|
128 |
}
|
129 |
|
130 |
+
wp_die();
|
131 |
}
|
132 |
|
133 |
/**
|
134 |
* Setup an AJAX action to delete a ip in the optimization page.
|
135 |
*/
|
136 |
+
public function delete_ip_action_callback() {
|
137 |
+
global $WP_Statistics, $wpdb;
|
138 |
|
139 |
$manage_cap = wp_statistics_validate_capability(
|
140 |
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
164 |
_e( 'Access denied!', 'wp-statistics' );
|
165 |
}
|
166 |
|
167 |
+
wp_die();
|
168 |
}
|
169 |
|
170 |
/**
|
171 |
* Setup an AJAX action to empty a table in the optimization page.
|
172 |
*/
|
173 |
+
public function empty_table_action_callback() {
|
174 |
+
global $WP_Statistics;
|
175 |
|
176 |
+
//Check isset Table-post
|
177 |
+
if ( ! isset( $_POST['table-name'] ) ) {
|
178 |
+
_e( 'Please select the desired items.', 'wp-statistics' );
|
179 |
+
exit;
|
180 |
+
}
|
181 |
|
182 |
+
//Check Valid Table name
|
183 |
+
$table_name = sanitize_text_field( $_POST['table-name'] );
|
184 |
+
$list_db_table = wp_statistics_db_table( 'all', 'historical' );
|
185 |
+
if ( ! array_key_exists( $table_name, $list_db_table ) ) {
|
186 |
+
_e( 'Access denied!', 'wp-statistics' );
|
187 |
+
exit;
|
188 |
+
}
|
189 |
+
|
190 |
+
//Check User Cap
|
191 |
+
$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
+
if ( current_user_can( $manage_cap ) ) {
|
194 |
|
195 |
+
if ( $table_name == "all" ) {
|
196 |
+
$x_tbl = 1;
|
197 |
+
foreach ( $list_db_table as $tbl_key => $tbl_name ) {
|
198 |
+
echo ( $x_tbl > 1 ? '<br>' : '' ) . wp_statitiscs_empty_table( $tbl_name );
|
199 |
+
$x_tbl ++;
|
200 |
+
}
|
201 |
} else {
|
202 |
+
echo wp_statitiscs_empty_table( wp_statistics_db_table( $table_name ) );
|
203 |
}
|
204 |
+
|
205 |
+
$WP_Statistics->Primary_Values();
|
206 |
} else {
|
207 |
_e( 'Access denied!', 'wp-statistics' );
|
208 |
}
|
209 |
|
210 |
+
wp_die();
|
211 |
}
|
212 |
|
213 |
/**
|
214 |
* Setup an AJAX action to purge old data in the optimization page.
|
215 |
*/
|
216 |
+
public function purge_data_action_callback() {
|
217 |
+
global $WP_Statistics;
|
218 |
|
219 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge.php' );
|
220 |
|
221 |
+
$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) );
|
|
|
|
|
|
|
222 |
if ( current_user_can( $manage_cap ) ) {
|
223 |
$purge_days = 0;
|
224 |
|
232 |
_e( 'Access denied!', 'wp-statistics' );
|
233 |
}
|
234 |
|
235 |
+
wp_die();
|
236 |
}
|
237 |
|
238 |
/**
|
239 |
* Setup an AJAX action to purge visitors with more than a defined number of hits.
|
240 |
*/
|
241 |
+
public function purge_visitor_hits_action_callback() {
|
242 |
+
global $WP_Statistics;
|
243 |
|
244 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge-hits.php' );
|
245 |
|
264 |
_e( 'Access denied!', 'wp-statistics' );
|
265 |
}
|
266 |
|
267 |
+
wp_die();
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
* Setup an AJAX action to purge visitors with more than a defined number of hits.
|
272 |
*/
|
273 |
+
public function get_widget_contents_action_callback() {
|
274 |
+
global $WP_Statistics;
|
275 |
|
276 |
$widgets = array(
|
277 |
'about',
|
278 |
+
'users_online',
|
279 |
'browsers',
|
280 |
'map',
|
281 |
'countries',
|
289 |
'search',
|
290 |
'summary',
|
291 |
'top.visitors',
|
292 |
+
'words'
|
|
|
293 |
);
|
294 |
|
295 |
if ( array_key_exists( 'format', $_POST ) and $_POST['format'] == 'dashboard' ) {
|
319 |
$widget = 'top.visitors';
|
320 |
}
|
321 |
|
|
|
|
|
|
|
|
|
322 |
if ( 'map' == $widget || 'hitsmap' == $widget ) {
|
323 |
$widget = 'jqv.map';
|
324 |
}
|
350 |
case 'referring':
|
351 |
wp_statistics_generate_referring_postbox_content();
|
352 |
|
|
|
|
|
|
|
|
|
353 |
break;
|
354 |
case 'countries':
|
355 |
wp_statistics_generate_countries_postbox_content( $ISOCountryCode );
|
396 |
|
397 |
wp_statistics_generate_top_visitors_postbox_content( $ISOCountryCode, 'today', 10, $format );
|
398 |
|
399 |
+
break;
|
400 |
+
case 'users_online':
|
401 |
+
wp_statistics_generate_users_online_postbox_content( $ISOCountryCode );
|
402 |
+
|
403 |
break;
|
404 |
case 'about':
|
405 |
wp_statistics_generate_about_postbox_content( $ISOCountryCode );
|
412 |
_e( 'Access denied!', 'wp-statistics' );
|
413 |
}
|
414 |
|
415 |
+
wp_die();
|
416 |
}
|
417 |
}
|
includes/classes/class-wp-statistics-dashboard.php
CHANGED
@@ -5,236 +5,236 @@
|
|
5 |
*/
|
6 |
class WP_Statistics_Dashboard {
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
-
|
|
|
|
|
|
|
12 |
|
13 |
-
//
|
14 |
-
|
15 |
-
if ( ! $WP_Statistics->get_user_option( 'dashboard_set' ) ) {
|
16 |
-
$WP_Statistics->update_user_option( 'dashboard_set', WP_Statistics::$reg['version'] );
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
$hidden_widgets = array();
|
21 |
-
}
|
22 |
|
23 |
-
|
24 |
-
'wp-statistics-browsers-widget',
|
25 |
-
'wp-statistics-countries-widget',
|
26 |
-
'wp-statistics-hitsmap-widget',
|
27 |
-
'wp-statistics-hits-widget',
|
28 |
-
'wp-statistics-pages-widget',
|
29 |
-
'wp-statistics-recent-widget',
|
30 |
-
'wp-statistics-referring-widget',
|
31 |
-
'wp-statistics-search-widget',
|
32 |
-
'wp-statistics-summary-widget',
|
33 |
-
'wp-statistics-words-widget',
|
34 |
-
'wp-statistics-top-visitors-widget',
|
35 |
-
'wp-statistics-searched-phrases-widget',
|
36 |
-
);
|
37 |
-
|
38 |
-
foreach ( $default_hidden as $widget ) {
|
39 |
-
if ( ! in_array( $widget, $hidden_widgets ) ) {
|
40 |
-
$hidden_widgets[] = $widget;
|
41 |
-
}
|
42 |
-
}
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
|
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
}
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
// If the user does not have at least read access to the status plugin, just return without adding the widgets.
|
69 |
-
if ( ! current_user_can(
|
70 |
-
wp_statistics_validate_capability(
|
71 |
-
$WP_Statistics->get_option(
|
72 |
-
'read_capability',
|
73 |
-
'manage_option'
|
74 |
-
)
|
75 |
-
)
|
76 |
-
)
|
77 |
-
) {
|
78 |
return;
|
79 |
}
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
// If the admin has disabled the widgets, don't display them.
|
82 |
if ( ! $WP_Statistics->get_option( 'disable_dashboard' ) ) {
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
__( 'Today\'s Visitors Map', 'wp-statistics' ),
|
112 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
113 |
-
$control_callback = null,
|
114 |
-
array( 'widget' => 'hitsmap' )
|
115 |
-
);
|
116 |
-
}
|
117 |
-
if ( $WP_Statistics->get_option( 'visits' ) ) {
|
118 |
-
wp_add_dashboard_widget(
|
119 |
-
'wp-statistics-hits-widget',
|
120 |
-
__( 'Hit Statistics', 'wp-statistics' ),
|
121 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
122 |
-
$control_callback = null,
|
123 |
-
array( 'widget' => 'hits' )
|
124 |
-
);
|
125 |
-
}
|
126 |
-
if ( $WP_Statistics->get_option( 'pages' ) ) {
|
127 |
-
wp_add_dashboard_widget(
|
128 |
-
'wp-statistics-pages-widget',
|
129 |
-
__( 'Top 10 Pages', 'wp-statistics' ),
|
130 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
131 |
-
$control_callback = null,
|
132 |
-
array( 'widget' => 'pages' )
|
133 |
-
);
|
134 |
-
}
|
135 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
136 |
-
wp_add_dashboard_widget(
|
137 |
-
'wp-statistics-recent-widget',
|
138 |
-
__( 'Recent Visitors', 'wp-statistics' ),
|
139 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
140 |
-
$control_callback = null,
|
141 |
-
array( 'widget' => 'recent' )
|
142 |
-
);
|
143 |
-
}
|
144 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
145 |
-
wp_add_dashboard_widget(
|
146 |
-
'wp-statistics-referring-widget',
|
147 |
-
__( 'Top Referring Sites', 'wp-statistics' ),
|
148 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
149 |
-
$control_callback = null,
|
150 |
-
array( 'widget' => 'referring' )
|
151 |
-
);
|
152 |
-
}
|
153 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
154 |
-
wp_add_dashboard_widget(
|
155 |
-
'wp-statistics-search-widget',
|
156 |
-
__( 'Search Engine Referrals', 'wp-statistics' ),
|
157 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
158 |
-
$control_callback = null,
|
159 |
-
array( 'widget' => 'search' )
|
160 |
-
);
|
161 |
-
}
|
162 |
-
wp_add_dashboard_widget(
|
163 |
-
'wp-statistics-summary-widget',
|
164 |
-
__( 'Summary', 'wp-statistics' ),
|
165 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
166 |
-
$control_callback = null,
|
167 |
-
array( 'widget' => 'summary' )
|
168 |
-
);
|
169 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
170 |
-
wp_add_dashboard_widget(
|
171 |
-
'wp-statistics-words-widget',
|
172 |
-
__( 'Latest Search Words', 'wp-statistics' ),
|
173 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
174 |
-
$control_callback = null,
|
175 |
-
array( 'widget' => 'words' )
|
176 |
-
);
|
177 |
-
}
|
178 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
179 |
-
wp_add_dashboard_widget(
|
180 |
-
'wp-statistics-top-visitors-widget',
|
181 |
-
__( 'Top 10 Visitors Today', 'wp-statistics' ),
|
182 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
183 |
-
$control_callback = null,
|
184 |
-
array( 'widget' => 'top.visitors' )
|
185 |
-
);
|
186 |
-
}
|
187 |
-
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
188 |
-
wp_add_dashboard_widget(
|
189 |
-
'wp-statistics-searched-phrases-widget',
|
190 |
-
__( 'Top Search Words (30 Days)', 'wp-statistics' ),
|
191 |
-
'WP_Statistics_Dashboard::generate_postbox_contents',
|
192 |
-
$control_callback = null,
|
193 |
-
array( 'widget' => 'searched.phrases' )
|
194 |
-
);
|
195 |
}
|
196 |
}
|
|
|
|
|
197 |
}
|
198 |
|
|
|
|
|
|
|
199 |
static function load_widget_css_and_scripts() {
|
200 |
global $WP_Statistics;
|
201 |
|
202 |
// Load the css we use for the statistics pages.
|
203 |
wp_enqueue_style( 'wpstatistics-log-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/log.css', true, '1.2' );
|
204 |
|
205 |
-
// Don't forget the right to left support.
|
206 |
-
if ( is_rtl() ) {
|
207 |
-
wp_enqueue_style( 'rtl-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/rtl.css', true, '1.1' );
|
208 |
-
}
|
209 |
-
|
210 |
// Load the map code.
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
true,
|
217 |
-
'1.5.1'
|
218 |
-
);
|
219 |
-
wp_enqueue_script(
|
220 |
-
'jquery-vmap-world',
|
221 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/maps/jquery.vmap.world.js',
|
222 |
-
true,
|
223 |
-
'1.5.1'
|
224 |
-
);
|
225 |
-
}
|
226 |
|
227 |
// Load chart library
|
228 |
if ( ! isset( $_GET['post'] ) ) {
|
229 |
-
wp_enqueue_script(
|
230 |
-
'wp-statistics-chart-js',
|
231 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/js/Chart.bundle.min.js',
|
232 |
-
false,
|
233 |
-
'2.7.3',
|
234 |
-
false
|
235 |
-
);
|
236 |
}
|
237 |
|
|
|
238 |
$screen = get_current_screen();
|
239 |
|
240 |
// Load our custom widgets handling javascript.
|
@@ -245,65 +245,39 @@ class WP_Statistics_Dashboard {
|
|
245 |
}
|
246 |
}
|
247 |
|
|
|
|
|
|
|
|
|
248 |
static function inline_javascript() {
|
249 |
-
$screen = get_current_screen();
|
250 |
|
|
|
|
|
251 |
if ( 'dashboard' != $screen->id ) {
|
252 |
return;
|
253 |
}
|
254 |
|
|
|
255 |
WP_Statistics_Dashboard::load_widget_css_and_scripts();
|
256 |
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
'<span class="screen-reader-text">' .
|
271 |
-
__( 'More Details', 'wp-statistics' ) .
|
272 |
-
'</span></button>';
|
273 |
-
$new_button
|
274 |
-
= '</button><button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' .
|
275 |
-
wp_statistics_icons( 'dashicons-update' ) .
|
276 |
-
'<span class="screen-reader-text">' .
|
277 |
-
__( 'Reload', 'wp-statistics' ) .
|
278 |
-
'</span></button>';
|
279 |
-
|
280 |
-
$admin_url = get_admin_url() . "admin.php?page=";
|
281 |
-
|
282 |
-
$page_urls = array();
|
283 |
-
|
284 |
-
$page_urls['wp-statistics-browsers-widget_more_button'] = $admin_url . WP_Statistics::$page['browser'];
|
285 |
-
$page_urls['wp-statistics-countries-widget_more_button'] = $admin_url .
|
286 |
-
WP_Statistics::$page['countries'];
|
287 |
-
$page_urls['wp-statistics-exclusions-widget_more_button'] = $admin_url .
|
288 |
-
WP_Statistics::$page['exclusions'];
|
289 |
-
$page_urls['wp-statistics-hits-widget_more_button'] = $admin_url . WP_Statistics::$page['hits'];
|
290 |
-
$page_urls['wp-statistics-online-widget_more_button'] = $admin_url . WP_Statistics::$page['online'];
|
291 |
-
$page_urls['wp-statistics-pages-widget_more_button'] = $admin_url . WP_Statistics::$page['pages'];
|
292 |
-
$page_urls['wp-statistics-referring-widget_more_button'] = $admin_url .
|
293 |
-
WP_Statistics::$page['referrers'];
|
294 |
-
$page_urls['wp-statistics-searched-phrases-widget_more_button'] = $admin_url .
|
295 |
-
WP_Statistics::$page['searched-phrases'];
|
296 |
-
$page_urls['wp-statistics-search-widget_more_button'] = $admin_url . WP_Statistics::$page['searches'];
|
297 |
-
$page_urls['wp-statistics-words-widget_more_button'] = $admin_url . WP_Statistics::$page['words'];
|
298 |
-
$page_urls['wp-statistics-top-visitors-widget_more_button'] = $admin_url .
|
299 |
-
WP_Statistics::$page['top-visitors'];
|
300 |
-
$page_urls['wp-statistics-recent-widget_more_button'] = $admin_url . WP_Statistics::$page['visitors'];
|
301 |
-
$page_urls['wp-statistics-quickstats-widget_more_button'] = $admin_url . WP_Statistics::$page['overview'];
|
302 |
|
303 |
?>
|
304 |
<script type="text/javascript">
|
305 |
var wp_statistics_destinations = <?php echo json_encode( $page_urls ); ?>;
|
306 |
-
var wp_statistics_loading_image = '<?php echo
|
307 |
|
308 |
function wp_statistics_wait_for_postboxes() {
|
309 |
|
@@ -329,20 +303,16 @@ class WP_Statistics_Dashboard {
|
|
329 |
}
|
330 |
|
331 |
var temp_html = temp.html();
|
332 |
-
|
333 |
-
|
334 |
-
new_text = '<?php echo $new_button;?>';
|
335 |
new_text = new_text.replace('{{refreshid}}', temp_id + '_refresh_button');
|
336 |
-
|
337 |
temp_html = temp_html.replace('</button>', new_text);
|
338 |
} else {
|
339 |
-
new_text = '<?php echo
|
340 |
new_text = new_text.replace('{{refreshid}}', temp_id + '_refresh_button');
|
341 |
new_text = new_text.replace('{{moreid}}', temp_id + '_more_button');
|
342 |
-
|
343 |
temp_html = temp_html.replace('</button>', new_text);
|
344 |
}
|
345 |
-
|
346 |
temp.html(temp_html);
|
347 |
});
|
348 |
|
@@ -354,16 +324,17 @@ class WP_Statistics_Dashboard {
|
|
354 |
<?php
|
355 |
}
|
356 |
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
static function generate_postbox_contents( $post, $args ) {
|
358 |
-
$loading_img = '<div style="width: 100%; text-align: center;"><img src=" ' .
|
359 |
-
plugins_url( 'wp-statistics/assets/images/' ) .
|
360 |
-
'ajax-loading.gif" alt="' .
|
361 |
-
__( 'Loading...', 'wp-statistics' ) .
|
362 |
-
'"></div>';
|
363 |
$widget = $args['args']['widget'];
|
364 |
$container_id = 'wp-statistics-' . str_replace( '.', '-', $widget ) . '-div';
|
365 |
|
366 |
-
echo '<div id="' . $container_id . '">' .
|
367 |
wp_statistics_generate_widget_load_javascript( $widget, $container_id );
|
368 |
}
|
369 |
|
5 |
*/
|
6 |
class WP_Statistics_Dashboard {
|
7 |
|
8 |
+
/**
|
9 |
+
* User Meta Set Dashboard Option name
|
10 |
+
* @var string
|
11 |
+
*/
|
12 |
+
public static $dashboard_set = 'dashboard_set';
|
13 |
|
14 |
+
/**
|
15 |
+
* WP_Statistics_Dashboard constructor.
|
16 |
+
*/
|
17 |
+
public function __construct() {
|
18 |
|
19 |
+
//Register Dashboard Widget
|
20 |
+
add_action( 'wp_dashboard_setup', array( $this, 'load_dashboard_widget' ) );
|
|
|
|
|
21 |
|
22 |
+
//Add Inline Script in Admin Footer
|
23 |
+
add_action( 'admin_footer', array( $this, 'inline_javascript' ) );
|
|
|
|
|
24 |
|
25 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
/**
|
28 |
+
* Widget Setup Key
|
29 |
+
*
|
30 |
+
* @param $key
|
31 |
+
* @return string
|
32 |
+
*/
|
33 |
+
public static function widget_setup_key( $key ) {
|
34 |
+
return 'wp-statistics-' . $key . '-widget';
|
35 |
+
}
|
36 |
|
37 |
+
/**
|
38 |
+
* Get Widget List
|
39 |
+
*
|
40 |
+
* @param bool $widget
|
41 |
+
* @return array|mixed
|
42 |
+
*/
|
43 |
+
public static function widget_list( $widget = false ) {
|
44 |
+
|
45 |
+
/**
|
46 |
+
* List of WP-Statistics Widget
|
47 |
+
*
|
48 |
+
* --- Array Arg -----
|
49 |
+
* page_url : link of Widget Page @see WP_Statistics::$page
|
50 |
+
* name : Name Of Widget Box
|
51 |
+
* require : the Condition From Wp-statistics Option if == true
|
52 |
+
* hidden : if set true , Default Hidden Dashboard in Wordpress Admin
|
53 |
+
*
|
54 |
+
*/
|
55 |
+
$list = array(
|
56 |
+
'quickstats' => array(
|
57 |
+
'page_url' => 'overview',
|
58 |
+
'name' => __( 'Quick Stats', 'wp-statistics' )
|
59 |
+
),
|
60 |
+
'summary' => array(
|
61 |
+
'name' => __( 'Summary', 'wp-statistics' ),
|
62 |
+
'hidden' => true
|
63 |
+
),
|
64 |
+
'browsers' => array(
|
65 |
+
'page_url' => 'browser',
|
66 |
+
'name' => __( 'Top 10 Browsers', 'wp-statistics' ),
|
67 |
+
'require' => array( 'visitors' ),
|
68 |
+
'hidden' => true
|
69 |
+
),
|
70 |
+
'countries' => array(
|
71 |
+
'page_url' => 'countries',
|
72 |
+
'name' => __( 'Top 10 Countries', 'wp-statistics' ),
|
73 |
+
'require' => array( 'geoip', 'visitors' ),
|
74 |
+
'hidden' => true
|
75 |
+
),
|
76 |
+
'hits' => array(
|
77 |
+
'page_url' => 'hits',
|
78 |
+
'name' => __( 'Hit Statistics', 'wp-statistics' ),
|
79 |
+
'require' => array( 'visits' ),
|
80 |
+
'hidden' => true
|
81 |
+
),
|
82 |
+
'pages' => array(
|
83 |
+
'page_url' => 'pages',
|
84 |
+
'name' => __( 'Top 10 Pages', 'wp-statistics' ),
|
85 |
+
'require' => array( 'pages' ),
|
86 |
+
'hidden' => true
|
87 |
+
),
|
88 |
+
'referring' => array(
|
89 |
+
'page_url' => 'referrers',
|
90 |
+
'name' => __( 'Top Referring Sites', 'wp-statistics' ),
|
91 |
+
'require' => array( 'visitors' ),
|
92 |
+
'hidden' => true
|
93 |
+
),
|
94 |
+
'search' => array(
|
95 |
+
'page_url' => 'searches',
|
96 |
+
'name' => __( 'Search Engine Referrals', 'wp-statistics' ),
|
97 |
+
'require' => array( 'visitors' ),
|
98 |
+
'hidden' => true
|
99 |
+
),
|
100 |
+
'words' => array(
|
101 |
+
'page_url' => 'words',
|
102 |
+
'name' => __( 'Latest Search Words', 'wp-statistics' ),
|
103 |
+
'require' => array( 'visitors' ),
|
104 |
+
'hidden' => true
|
105 |
+
),
|
106 |
+
'top-visitors' => array(
|
107 |
+
'page_url' => 'top-visitors',
|
108 |
+
'name' => __( 'Top 10 Visitors Today', 'wp-statistics' ),
|
109 |
+
'require' => array( 'visitors' ),
|
110 |
+
'hidden' => true
|
111 |
+
),
|
112 |
+
'recent' => array(
|
113 |
+
'page_url' => 'visitors',
|
114 |
+
'name' => __( 'Recent Visitors', 'wp-statistics' ),
|
115 |
+
'require' => array( 'visitors' ),
|
116 |
+
'hidden' => true
|
117 |
+
),
|
118 |
+
'hitsmap' => array(
|
119 |
+
'name' => __( 'Today\'s Visitors Map', 'wp-statistics' ),
|
120 |
+
'require' => array( 'visitors' ),
|
121 |
+
'hidden' => true
|
122 |
+
)
|
123 |
+
);
|
124 |
|
125 |
+
//Print List of Dashboard
|
126 |
+
if ( $widget === false ) {
|
127 |
+
return $list;
|
128 |
+
} else {
|
129 |
+
if ( array_key_exists( $widget, $list ) ) {
|
130 |
+
return $list[ $widget ];
|
131 |
+
}
|
132 |
+
}
|
133 |
|
134 |
+
return array();
|
135 |
+
}
|
136 |
|
137 |
+
/**
|
138 |
+
* This function Register Wp-statistics Dashboard to wordpress Admin
|
139 |
+
*/
|
140 |
+
public static function register_dashboard_widget() {
|
|
|
141 |
|
142 |
+
//Check Dashboard Widget
|
143 |
+
if ( ! function_exists( 'wp_add_dashboard_widget' ) ) {
|
144 |
+
return;
|
145 |
+
}
|
146 |
+
|
147 |
+
//Get List Of Wp-statistics Dashboard Widget
|
148 |
+
$list = self::widget_list();
|
149 |
+
foreach ( $list as $widget_key => $dashboard ) {
|
150 |
+
|
151 |
+
//Register Dashboard Widget
|
152 |
+
if ( wp_statistics_check_option_require( $dashboard ) === true ) {
|
153 |
+
wp_add_dashboard_widget( self::widget_setup_key( $widget_key ), $dashboard['name'], 'WP_Statistics_Dashboard::generate_postbox_contents', $control_callback = null, array( 'widget' => $widget_key ) );
|
154 |
}
|
155 |
+
|
156 |
}
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Load Dashboard Widget
|
161 |
+
* This Function add_action to `wp_dashboard_setup`
|
162 |
+
*/
|
163 |
+
static function load_dashboard_widget() {
|
164 |
+
global $WP_Statistics;
|
165 |
+
|
166 |
+
//Load User Options
|
167 |
+
$WP_Statistics->load_user_options();
|
168 |
|
169 |
// If the user does not have at least read access to the status plugin, just return without adding the widgets.
|
170 |
+
if ( ! current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_option' ) ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
return;
|
172 |
}
|
173 |
|
174 |
+
//Check Hidden User Dashboard Option
|
175 |
+
$user_dashboard = $WP_Statistics->get_user_option( self::$dashboard_set );
|
176 |
+
if ( $user_dashboard === false || $user_dashboard != WP_Statistics::$reg['version'] ) {
|
177 |
+
self::set_user_hidden_dashboard_option();
|
178 |
+
}
|
179 |
+
|
180 |
// If the admin has disabled the widgets, don't display them.
|
181 |
if ( ! $WP_Statistics->get_option( 'disable_dashboard' ) ) {
|
182 |
+
self::register_dashboard_widget();
|
183 |
+
}
|
184 |
+
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Set Default Hidden Dashboard User Option
|
189 |
+
*/
|
190 |
+
public static function set_user_hidden_dashboard_option() {
|
191 |
+
global $WP_Statistics;
|
192 |
+
|
193 |
+
//Get List Of Wp-statistics Dashboard Widget
|
194 |
+
$dashboard_list = self::widget_list();
|
195 |
+
$hidden_opt = 'metaboxhidden_dashboard';
|
196 |
+
|
197 |
+
//Create Empty Option and save in User meta
|
198 |
+
$WP_Statistics->update_user_option( self::$dashboard_set, WP_Statistics::$reg['version'] );
|
199 |
+
|
200 |
+
//Get Dashboard Option User Meta
|
201 |
+
$hidden_widgets = get_user_meta( $WP_Statistics->user_id, $hidden_opt, true );
|
202 |
+
if ( ! is_array( $hidden_widgets ) ) {
|
203 |
+
$hidden_widgets = array();
|
204 |
+
}
|
205 |
+
|
206 |
+
//Set Default Hidden Dashboard in Admin Wordpress
|
207 |
+
foreach ( $dashboard_list as $widget => $dashboard ) {
|
208 |
+
if ( array_key_exists( 'hidden', $dashboard ) ) {
|
209 |
+
$hidden_widgets[] = self::widget_setup_key( $widget );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
}
|
211 |
}
|
212 |
+
|
213 |
+
update_user_meta( $WP_Statistics->user_id, $hidden_opt, $hidden_widgets );
|
214 |
}
|
215 |
|
216 |
+
/**
|
217 |
+
* Load Widget Script/style
|
218 |
+
*/
|
219 |
static function load_widget_css_and_scripts() {
|
220 |
global $WP_Statistics;
|
221 |
|
222 |
// Load the css we use for the statistics pages.
|
223 |
wp_enqueue_style( 'wpstatistics-log-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/log.css', true, '1.2' );
|
224 |
|
|
|
|
|
|
|
|
|
|
|
225 |
// Load the map code.
|
226 |
+
if ( ! $WP_Statistics->get_option( 'disable_dashboard' ) ) {
|
227 |
+
wp_enqueue_style( 'jqvmap-css', WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/jqvmap.css', true, '1.5.1' );
|
228 |
+
wp_enqueue_script( 'jquery-vmap', WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/jquery.vmap.js', true, '1.5.1' );
|
229 |
+
wp_enqueue_script( 'jquery-vmap-world', WP_Statistics::$reg['plugin-url'] . 'assets/jqvmap/maps/jquery.vmap.world.js', true, '1.5.1' );
|
230 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
// Load chart library
|
233 |
if ( ! isset( $_GET['post'] ) ) {
|
234 |
+
wp_enqueue_script( 'wp-statistics-chart-js', WP_Statistics::$reg['plugin-url'] . 'assets/js/Chart.bundle.min.js', false, '2.7.3', false );
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
}
|
236 |
|
237 |
+
//Get current screen page
|
238 |
$screen = get_current_screen();
|
239 |
|
240 |
// Load our custom widgets handling javascript.
|
245 |
}
|
246 |
}
|
247 |
|
248 |
+
/**
|
249 |
+
* Add inline Script
|
250 |
+
* For Add button Refresh/Direct Button Link in Top of Meta Box
|
251 |
+
*/
|
252 |
static function inline_javascript() {
|
|
|
253 |
|
254 |
+
//if not Dashboard Page
|
255 |
+
$screen = get_current_screen();
|
256 |
if ( 'dashboard' != $screen->id ) {
|
257 |
return;
|
258 |
}
|
259 |
|
260 |
+
//Load Of Require Jquery Library Function
|
261 |
WP_Statistics_Dashboard::load_widget_css_and_scripts();
|
262 |
|
263 |
+
//Prepare List Of Dashboard
|
264 |
+
$page_urls = array();
|
265 |
+
$dashboards = self::widget_list();
|
266 |
+
foreach ( $dashboards as $widget_key => $dashboard ) {
|
267 |
+
if ( array_key_exists( 'page_url', $dashboard ) ) {
|
268 |
+
$page_urls[ 'wp-statistics-' . $widget_key . '-widget_more_button' ] = WP_Statistics_Admin_Pages::admin_url( $dashboard['page_url'] );
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
//Add Extra Pages For Overview Page
|
273 |
+
foreach ( array( 'exclusions' => 'exclusions', 'users_online' => 'online' ) as $p_key => $p_link ) {
|
274 |
+
$page_urls[ 'wp-statistics-' . $p_key . '-widget_more_button' ] = WP_Statistics_Admin_Pages::admin_url( $p_link );
|
275 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
?>
|
278 |
<script type="text/javascript">
|
279 |
var wp_statistics_destinations = <?php echo json_encode( $page_urls ); ?>;
|
280 |
+
var wp_statistics_loading_image = '<?php echo WP_Statistics_Admin_Pages::loading_meta_box(); ?>';
|
281 |
|
282 |
function wp_statistics_wait_for_postboxes() {
|
283 |
|
303 |
}
|
304 |
|
305 |
var temp_html = temp.html();
|
306 |
+
if (temp_id == '<?php echo self::widget_setup_key( 'summary' ); ?>') {
|
307 |
+
new_text = '<?php echo WP_Statistics_Admin_Pages::meta_box_button( 'refresh' );?>';
|
|
|
308 |
new_text = new_text.replace('{{refreshid}}', temp_id + '_refresh_button');
|
|
|
309 |
temp_html = temp_html.replace('</button>', new_text);
|
310 |
} else {
|
311 |
+
new_text = '<?php echo WP_Statistics_Admin_Pages::meta_box_button();?>';
|
312 |
new_text = new_text.replace('{{refreshid}}', temp_id + '_refresh_button');
|
313 |
new_text = new_text.replace('{{moreid}}', temp_id + '_more_button');
|
|
|
314 |
temp_html = temp_html.replace('</button>', new_text);
|
315 |
}
|
|
|
316 |
temp.html(temp_html);
|
317 |
});
|
318 |
|
324 |
<?php
|
325 |
}
|
326 |
|
327 |
+
/**
|
328 |
+
* Generate widget Post Box
|
329 |
+
*
|
330 |
+
* @param $post
|
331 |
+
* @param $args
|
332 |
+
*/
|
333 |
static function generate_postbox_contents( $post, $args ) {
|
|
|
|
|
|
|
|
|
|
|
334 |
$widget = $args['args']['widget'];
|
335 |
$container_id = 'wp-statistics-' . str_replace( '.', '-', $widget ) . '-div';
|
336 |
|
337 |
+
echo '<div id="' . $container_id . '">' . WP_Statistics_Admin_Pages::loading_meta_box() . '</div>';
|
338 |
wp_statistics_generate_widget_load_javascript( $widget, $container_id );
|
339 |
}
|
340 |
|
includes/classes/class-wp-statistics-editor.php
CHANGED
@@ -11,6 +11,7 @@ class WP_Statistics_Editor {
|
|
11 |
static function add_meta_box() {
|
12 |
global $WP_Statistics;
|
13 |
|
|
|
14 |
$WP_Statistics->load_user_options();
|
15 |
|
16 |
// We need to fudge the display settings for first time users so not all of the widgets are displayed, we only want to do this on
|
@@ -42,10 +43,7 @@ class WP_Statistics_Editor {
|
|
42 |
}
|
43 |
|
44 |
// If the user does not have at least read access to the status plugin, just return without adding the widgets.
|
45 |
-
if ( ! current_user_can(
|
46 |
-
wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_option' ) )
|
47 |
-
)
|
48 |
-
) {
|
49 |
return;
|
50 |
}
|
51 |
|
@@ -59,17 +57,10 @@ class WP_Statistics_Editor {
|
|
59 |
return;
|
60 |
}
|
61 |
|
|
|
62 |
$screens = self::get_list_post_type();
|
63 |
-
|
64 |
foreach ( $screens as $screen ) {
|
65 |
-
|
66 |
-
add_meta_box(
|
67 |
-
'wp_statistics_editor_meta_box',
|
68 |
-
__( 'Hit Statistics', 'wp-statistics' ),
|
69 |
-
'WP_Statistics_Editor::meta_box',
|
70 |
-
$screen,
|
71 |
-
'normal',
|
72 |
-
'high',
|
73 |
array(
|
74 |
'__block_editor_compatible_meta_box' => true,
|
75 |
'__back_compat_meta_box' => false,
|
@@ -83,12 +74,10 @@ class WP_Statistics_Editor {
|
|
83 |
// If the post isn't published yet, don't output the stats as they take too much memory and CPU to compute for no reason.
|
84 |
if ( $post->post_status != 'publish' && $post->post_status != 'private' ) {
|
85 |
_e( 'This post is not yet published.', 'wp-statistics' );
|
86 |
-
|
87 |
return;
|
88 |
}
|
89 |
|
90 |
add_action( 'admin_footer', 'WP_Statistics_Editor::inline_javascript' );
|
91 |
-
|
92 |
WP_Statistics_Editor::generate_postbox_contents( $post->ID, array( 'args' => array( 'widget' => 'page' ) ) );
|
93 |
}
|
94 |
|
@@ -103,10 +92,9 @@ class WP_Statistics_Editor {
|
|
103 |
echo '<style>button#wp_statistics_editor_meta_box_more_button { z-index: 9999;position: absolute;top: 1px;right: 3%;}</style>';
|
104 |
}
|
105 |
} else {
|
106 |
-
$loading_img = '<div style="width: 100%; text-align: center;"><img src=" ' . plugins_url( 'wp-statistics/assets/images/' ) . 'ajax-loading.gif" alt="' . __( 'Loading...', 'wp-statistics' ) . '"></div>';
|
107 |
$widget = $args['args']['widget'];
|
108 |
$container_id = 'wp-statistics-' . str_replace( '.', '-', $widget ) . '-div';
|
109 |
-
echo '<div id="' . $container_id . '">' .
|
110 |
echo '<script type="text/javascript">var wp_statistics_current_id = \'' . $post . '\';</script>';
|
111 |
wp_statistics_generate_widget_load_javascript( $widget, $container_id );
|
112 |
}
|
@@ -121,20 +109,18 @@ class WP_Statistics_Editor {
|
|
121 |
}
|
122 |
|
123 |
WP_Statistics_Dashboard::load_widget_css_and_scripts();
|
124 |
-
|
125 |
-
$loading_img = '<div style="width: 100%; text-align: center;"><img src=" ' . plugins_url( 'wp-statistics/assets/images/' ) . 'ajax-loading.gif" alt="' . __( 'Reloading...', 'wp-statistics' ) . '"></div>';
|
126 |
$new_buttons = '</button>';
|
|
|
127 |
//If Classic Editor
|
128 |
if ( self::is_gutenberg() === false ) {
|
129 |
$new_buttons .= '<button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' . wp_statistics_icons( 'dashicons-update' ) . '<span class="screen-reader-text">' . __( 'Reload', 'wp-statistics' ) . '</span></button>';
|
130 |
}
|
131 |
-
$new_buttons .= '<button class="handlediv button-link wps-more" type="button" id="{{moreid}}">' . wp_statistics_icons( 'dashicons-
|
132 |
-
$new_button = '</button><button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' . wp_statistics_icons( 'dashicons-update' ) . '<span class="screen-reader-text">' . __( 'Reload', 'wp-statistics' ) . '</span></button>';
|
133 |
-
|
134 |
-
$admin_url = get_admin_url() . "/admin.php?page=";
|
135 |
|
136 |
-
$page_urls = array();
|
137 |
|
|
|
|
|
138 |
$page_urls['wp_statistics_editor_meta_box_more_button'] = $admin_url . WP_Statistics::$page['pages'] . '&page-id=';
|
139 |
|
140 |
//Button for Gutenberg
|
@@ -194,10 +180,7 @@ class WP_Statistics_Editor {
|
|
194 |
*/
|
195 |
public static function get_list_post_type() {
|
196 |
$post_types = array( 'post', 'page' );
|
197 |
-
$get_post_types = get_post_types( array(
|
198 |
-
'public' => true,
|
199 |
-
'_builtin' => false
|
200 |
-
), 'names', 'and' );
|
201 |
foreach ( $get_post_types as $name ) {
|
202 |
$post_types[] = $name;
|
203 |
}
|
11 |
static function add_meta_box() {
|
12 |
global $WP_Statistics;
|
13 |
|
14 |
+
//Load All User Options
|
15 |
$WP_Statistics->load_user_options();
|
16 |
|
17 |
// We need to fudge the display settings for first time users so not all of the widgets are displayed, we only want to do this on
|
43 |
}
|
44 |
|
45 |
// If the user does not have at least read access to the status plugin, just return without adding the widgets.
|
46 |
+
if ( ! current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_option' ) ) ) ) {
|
|
|
|
|
|
|
47 |
return;
|
48 |
}
|
49 |
|
57 |
return;
|
58 |
}
|
59 |
|
60 |
+
//Show Hit Column in All Post Type in Wordpress
|
61 |
$screens = self::get_list_post_type();
|
|
|
62 |
foreach ( $screens as $screen ) {
|
63 |
+
add_meta_box( 'wp_statistics_editor_meta_box', __( 'Hit Statistics', 'wp-statistics' ), 'WP_Statistics_Editor::meta_box', $screen, 'normal', 'high',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
array(
|
65 |
'__block_editor_compatible_meta_box' => true,
|
66 |
'__back_compat_meta_box' => false,
|
74 |
// If the post isn't published yet, don't output the stats as they take too much memory and CPU to compute for no reason.
|
75 |
if ( $post->post_status != 'publish' && $post->post_status != 'private' ) {
|
76 |
_e( 'This post is not yet published.', 'wp-statistics' );
|
|
|
77 |
return;
|
78 |
}
|
79 |
|
80 |
add_action( 'admin_footer', 'WP_Statistics_Editor::inline_javascript' );
|
|
|
81 |
WP_Statistics_Editor::generate_postbox_contents( $post->ID, array( 'args' => array( 'widget' => 'page' ) ) );
|
82 |
}
|
83 |
|
92 |
echo '<style>button#wp_statistics_editor_meta_box_more_button { z-index: 9999;position: absolute;top: 1px;right: 3%;}</style>';
|
93 |
}
|
94 |
} else {
|
|
|
95 |
$widget = $args['args']['widget'];
|
96 |
$container_id = 'wp-statistics-' . str_replace( '.', '-', $widget ) . '-div';
|
97 |
+
echo '<div id="' . $container_id . '">' . WP_Statistics_Admin_Pages::loading_meta_box() . '</div>';
|
98 |
echo '<script type="text/javascript">var wp_statistics_current_id = \'' . $post . '\';</script>';
|
99 |
wp_statistics_generate_widget_load_javascript( $widget, $container_id );
|
100 |
}
|
109 |
}
|
110 |
|
111 |
WP_Statistics_Dashboard::load_widget_css_and_scripts();
|
112 |
+
$loading_img = WP_Statistics_Admin_Pages::loading_meta_box();
|
|
|
113 |
$new_buttons = '</button>';
|
114 |
+
|
115 |
//If Classic Editor
|
116 |
if ( self::is_gutenberg() === false ) {
|
117 |
$new_buttons .= '<button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' . wp_statistics_icons( 'dashicons-update' ) . '<span class="screen-reader-text">' . __( 'Reload', 'wp-statistics' ) . '</span></button>';
|
118 |
}
|
119 |
+
$new_buttons .= '<button class="handlediv button-link wps-more" type="button" id="{{moreid}}">' . wp_statistics_icons( 'dashicons-external' ) . '<span class="screen-reader-text">' . __( 'More Details', 'wp-statistics' ) . '</span></button>';
|
|
|
|
|
|
|
120 |
|
|
|
121 |
|
122 |
+
$admin_url = get_admin_url() . "/admin.php?page=";
|
123 |
+
$page_urls = array();
|
124 |
$page_urls['wp_statistics_editor_meta_box_more_button'] = $admin_url . WP_Statistics::$page['pages'] . '&page-id=';
|
125 |
|
126 |
//Button for Gutenberg
|
180 |
*/
|
181 |
public static function get_list_post_type() {
|
182 |
$post_types = array( 'post', 'page' );
|
183 |
+
$get_post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names', 'and' );
|
|
|
|
|
|
|
184 |
foreach ( $get_post_types as $name ) {
|
185 |
$post_types[] = $name;
|
186 |
}
|
includes/classes/class-wp-statistics-export.php
ADDED
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class WP_Statistics_Export
|
5 |
+
*/
|
6 |
+
class WP_Statistics_Export {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Setup an Export Report Class
|
10 |
+
*/
|
11 |
+
public function __construct() {
|
12 |
+
|
13 |
+
//Export Data
|
14 |
+
add_action( 'admin_init', array( $this, 'export_data' ), 9 );
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Set the headers to download the export file and then stop running WordPress.
|
20 |
+
*/
|
21 |
+
public function export_data() {
|
22 |
+
if ( isset( $_POST['wps_export'] ) ) {
|
23 |
+
global $WP_Statistics, $wpdb;
|
24 |
+
|
25 |
+
//Set Time Limit Script Run
|
26 |
+
set_time_limit( 0 );
|
27 |
+
|
28 |
+
//Check Wp Nonce and Require Field
|
29 |
+
if ( ! isset( $_POST['table-to-export'] ) || ! isset( $_POST['export-file-type'] ) || ! isset( $_POST['wps_export_file'] ) || ! wp_verify_nonce( $_POST['wps_export_file'], 'wp_statistics_export_nonce' ) ) {
|
30 |
+
exit;
|
31 |
+
}
|
32 |
+
|
33 |
+
//Check Current User Capability
|
34 |
+
$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) );
|
35 |
+
if ( current_user_can( $manage_cap ) ) {
|
36 |
+
$table = $_POST['table-to-export'];
|
37 |
+
$type = $_POST['export-file-type'];
|
38 |
+
|
39 |
+
// Validate the table name the user passed to us.
|
40 |
+
$allow_tbl = array( "useronline", "visit", "visitor", "exclusions", "pages", "search" );
|
41 |
+
if ( ! in_array( $table, $allow_tbl ) ) {
|
42 |
+
$table = false;
|
43 |
+
}
|
44 |
+
|
45 |
+
// Validate the file type the user passed to us.
|
46 |
+
if ( ! ( $type == "xml" || $type == "csv" || $type == "tsv" ) ) {
|
47 |
+
$table = false;
|
48 |
+
}
|
49 |
+
|
50 |
+
if ( $table && $type ) {
|
51 |
+
$file_name = 'wp-statistics' . '-' . $WP_Statistics->Current_Date( 'Y-m-d-H-i' );
|
52 |
+
|
53 |
+
switch ( $type ) {
|
54 |
+
case 'xml':
|
55 |
+
$exporter = new ExportDataExcel( 'browser', "{$file_name}.xml" );
|
56 |
+
break;
|
57 |
+
case 'csv':
|
58 |
+
$exporter = new ExportDataCSV( 'browser', "{$file_name}.csv" );
|
59 |
+
break;
|
60 |
+
case 'tsv':
|
61 |
+
$exporter = new ExportDataTSV( 'browser', "{$file_name}.tsv" );
|
62 |
+
break;
|
63 |
+
}
|
64 |
+
|
65 |
+
$exporter->initialize();
|
66 |
+
|
67 |
+
// We need to limit the number of results we retrieve to ensure we don't run out of memory
|
68 |
+
$query_base = "SELECT * FROM {$wpdb->prefix}statistics_{$table}";
|
69 |
+
$query = $query_base . ' LIMIT 0,1000';
|
70 |
+
|
71 |
+
$i = 1;
|
72 |
+
$more_results = true;
|
73 |
+
$result = $wpdb->get_results( $query, ARRAY_A );
|
74 |
+
|
75 |
+
// If we didn't get any rows, don't output anything.
|
76 |
+
if ( count( $result ) < 1 ) {
|
77 |
+
echo "No data in table!";
|
78 |
+
exit;
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( isset( $_POST['export-headers'] ) and $_POST['export-headers'] ) {
|
82 |
+
foreach ( $result[0] as $key => $col ) {
|
83 |
+
$columns[] = $key;
|
84 |
+
}
|
85 |
+
$exporter->addRow( $columns );
|
86 |
+
}
|
87 |
+
|
88 |
+
while ( $more_results ) {
|
89 |
+
foreach ( $result as $row ) {
|
90 |
+
$exporter->addRow( $row );
|
91 |
+
|
92 |
+
// Make sure we've flushed the output buffer so we don't run out of memory on large exports.
|
93 |
+
ob_flush();
|
94 |
+
flush();
|
95 |
+
}
|
96 |
+
|
97 |
+
unset( $result );
|
98 |
+
$wpdb->flush();
|
99 |
+
|
100 |
+
$query = $query_base . ' LIMIT ' . ( $i * 1000 ) . ',1000';
|
101 |
+
$result = $wpdb->get_results( $query, ARRAY_A );
|
102 |
+
|
103 |
+
if ( count( $result ) == 0 ) {
|
104 |
+
$more_results = false;
|
105 |
+
}
|
106 |
+
|
107 |
+
$i ++;
|
108 |
+
}
|
109 |
+
|
110 |
+
$exporter->finalize();
|
111 |
+
exit;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* ExportData is the base class for exporters to specific file formats. See other
|
121 |
+
* classes below.
|
122 |
+
*/
|
123 |
+
abstract class ExportData {
|
124 |
+
protected $exportTo; // Set in constructor to one of 'browser', 'file', 'string'
|
125 |
+
protected $stringData; // stringData so far, used if export string mode
|
126 |
+
protected $tempFile; // handle to temp file (for export file mode)
|
127 |
+
protected $tempFilename; // temp file name and path (for export file mode)
|
128 |
+
public $filename; // file mode: the output file name; browser mode: file name for download; string mode: not used
|
129 |
+
|
130 |
+
public function __construct( $exportTo = "browser", $filename = "exportdata" ) {
|
131 |
+
if ( ! in_array( $exportTo, array( 'browser', 'file', 'string' ) ) ) {
|
132 |
+
throw new Exception( "$exportTo is not a valid ExportData export type" );
|
133 |
+
}
|
134 |
+
$this->exportTo = $exportTo;
|
135 |
+
$this->filename = $filename;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function initialize() {
|
139 |
+
|
140 |
+
switch ( $this->exportTo ) {
|
141 |
+
case 'browser':
|
142 |
+
$this->sendHttpHeaders();
|
143 |
+
break;
|
144 |
+
case 'string':
|
145 |
+
$this->stringData = '';
|
146 |
+
break;
|
147 |
+
case 'file':
|
148 |
+
$this->tempFilename = tempnam( sys_get_temp_dir(), 'exportdata' );
|
149 |
+
$this->tempFile = fopen( $this->tempFilename, "w" );
|
150 |
+
break;
|
151 |
+
}
|
152 |
+
|
153 |
+
$this->write( $this->generateHeader() );
|
154 |
+
}
|
155 |
+
|
156 |
+
public function addRow( $row ) {
|
157 |
+
$this->write( $this->generateRow( $row ) );
|
158 |
+
}
|
159 |
+
|
160 |
+
public function finalize() {
|
161 |
+
|
162 |
+
$this->write( $this->generateFooter() );
|
163 |
+
|
164 |
+
switch ( $this->exportTo ) {
|
165 |
+
case 'browser':
|
166 |
+
flush();
|
167 |
+
break;
|
168 |
+
case 'string':
|
169 |
+
// do nothing
|
170 |
+
break;
|
171 |
+
case 'file':
|
172 |
+
// close temp file and move it to correct location
|
173 |
+
fclose( $this->tempFile );
|
174 |
+
rename( $this->tempFilename, $this->filename );
|
175 |
+
break;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
public function getString() {
|
180 |
+
return $this->stringData;
|
181 |
+
}
|
182 |
+
|
183 |
+
abstract public function sendHttpHeaders();
|
184 |
+
|
185 |
+
protected function write( $data ) {
|
186 |
+
switch ( $this->exportTo ) {
|
187 |
+
case 'browser':
|
188 |
+
echo $data;
|
189 |
+
break;
|
190 |
+
case 'string':
|
191 |
+
$this->stringData .= $data;
|
192 |
+
break;
|
193 |
+
case 'file':
|
194 |
+
fwrite( $this->tempFile, $data );
|
195 |
+
break;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
protected function generateHeader() {
|
200 |
+
// can be overridden by subclass to return any data that goes at the top of the exported file
|
201 |
+
}
|
202 |
+
|
203 |
+
protected function generateFooter() {
|
204 |
+
// can be overridden by subclass to return any data that goes at the bottom of the exported file
|
205 |
+
}
|
206 |
+
|
207 |
+
// In subclasses generateRow will take $row array and return string of it formatted for export type
|
208 |
+
abstract protected function generateRow( $row );
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* ExportDataTSV - Exports to TSV (tab separated value) format.
|
214 |
+
*/
|
215 |
+
class ExportDataTSV extends ExportData {
|
216 |
+
|
217 |
+
function generateRow( $row ) {
|
218 |
+
foreach ( $row as $key => $value ) {
|
219 |
+
// Escape inner quotes and wrap all contents in new quotes.
|
220 |
+
// Note that we are using \" to escape double quote not ""
|
221 |
+
$row[ $key ] = '"' . str_replace( '"', '\"', $value ) . '"';
|
222 |
+
}
|
223 |
+
return implode( "\t", $row ) . "\n";
|
224 |
+
}
|
225 |
+
|
226 |
+
function sendHttpHeaders() {
|
227 |
+
header( "Content-type: text/tab-separated-values" );
|
228 |
+
header( "Content-Disposition: attachment; filename=" . basename( $this->filename ) );
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* ExportDataCSV - Exports to CSV (comma separated value) format.
|
234 |
+
*/
|
235 |
+
class ExportDataCSV extends ExportData {
|
236 |
+
|
237 |
+
function generateRow( $row ) {
|
238 |
+
foreach ( $row as $key => $value ) {
|
239 |
+
// Escape inner quotes and wrap all contents in new quotes.
|
240 |
+
// Note that we are using \" to escape double quote not ""
|
241 |
+
$row[ $key ] = '"' . str_replace( '"', '\"', $value ) . '"';
|
242 |
+
}
|
243 |
+
return implode( ",", $row ) . "\n";
|
244 |
+
}
|
245 |
+
|
246 |
+
function sendHttpHeaders() {
|
247 |
+
header( "Content-type: text/csv" );
|
248 |
+
header( "Content-Disposition: attachment; filename=" . basename( $this->filename ) );
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Class ExportDataExcel
|
254 |
+
*/
|
255 |
+
class ExportDataExcel extends ExportData {
|
256 |
+
|
257 |
+
const XmlHeader = "<?xml version=\"1.0\" encoding=\"%s\"?\>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">";
|
258 |
+
const XmlFooter = "</Workbook>";
|
259 |
+
|
260 |
+
public $encoding = 'UTF-8'; // encoding type to specify in file.
|
261 |
+
// Note that you're on your own for making sure your data is actually encoded to this encoding
|
262 |
+
|
263 |
+
public $title = 'Sheet1'; // title for Worksheet
|
264 |
+
|
265 |
+
function generateHeader() {
|
266 |
+
|
267 |
+
// workbook header
|
268 |
+
$output = stripslashes( sprintf( self::XmlHeader, $this->encoding ) ) . "\n";
|
269 |
+
|
270 |
+
// Set up styles
|
271 |
+
$output .= "<Styles>\n";
|
272 |
+
$output .= "<Style ss:ID=\"sDT\"><NumberFormat ss:Format=\"Short Date\"/></Style>\n";
|
273 |
+
$output .= "</Styles>\n";
|
274 |
+
|
275 |
+
// worksheet header
|
276 |
+
$output .= sprintf( "<Worksheet ss:Name=\"%s\">\n <Table>\n", htmlentities( $this->title ) );
|
277 |
+
|
278 |
+
return $output;
|
279 |
+
}
|
280 |
+
|
281 |
+
function generateFooter() {
|
282 |
+
$output = '';
|
283 |
+
|
284 |
+
// worksheet footer
|
285 |
+
$output .= " </Table>\n</Worksheet>\n";
|
286 |
+
|
287 |
+
// workbook footer
|
288 |
+
$output .= self::XmlFooter;
|
289 |
+
|
290 |
+
return $output;
|
291 |
+
}
|
292 |
+
|
293 |
+
function generateRow( $row ) {
|
294 |
+
$output = '';
|
295 |
+
$output .= " <Row>\n";
|
296 |
+
foreach ( $row as $k => $v ) {
|
297 |
+
$output .= $this->generateCell( $v );
|
298 |
+
}
|
299 |
+
$output .= " </Row>\n";
|
300 |
+
return $output;
|
301 |
+
}
|
302 |
+
|
303 |
+
private function generateCell( $item ) {
|
304 |
+
$output = '';
|
305 |
+
$style = '';
|
306 |
+
|
307 |
+
// Tell Excel to treat as a number. Note that Excel only stores roughly 15 digits, so keep
|
308 |
+
// as text if number is longer than that.
|
309 |
+
if ( preg_match( "/^-?\d+(?:[.,]\d+)?$/", $item ) && ( strlen( $item ) < 15 ) ) {
|
310 |
+
$type = 'Number';
|
311 |
+
}
|
312 |
+
// Sniff for valid dates; should look something like 2010-07-14 or 7/14/2010 etc. Can
|
313 |
+
// also have an optional time after the date.
|
314 |
+
//
|
315 |
+
// Note we want to be very strict in what we consider a date. There is the possibility
|
316 |
+
// of really screwing up the data if we try to reformat a string that was not actually
|
317 |
+
// intended to represent a date.
|
318 |
+
elseif ( preg_match( "/^(\d{1,2}|\d{4})[\/\-]\d{1,2}[\/\-](\d{1,2}|\d{4})([^\d].+)?$/", $item ) &&
|
319 |
+
( $timestamp = strtotime( $item ) ) &&
|
320 |
+
( $timestamp > 0 ) &&
|
321 |
+
( $timestamp < strtotime( '+500 years' ) ) ) {
|
322 |
+
$type = 'DateTime';
|
323 |
+
$item = strftime( "%Y-%m-%dT%H:%M:%S", $timestamp );
|
324 |
+
$style = 'sDT'; // defined in header; tells excel to format date for display
|
325 |
+
} else {
|
326 |
+
$type = 'String';
|
327 |
+
}
|
328 |
+
|
329 |
+
$item = str_replace( ''', ''', htmlspecialchars( $item, ENT_QUOTES ) );
|
330 |
+
$output .= " ";
|
331 |
+
$output .= $style ? "<Cell ss:StyleID=\"$style\">" : "<Cell>";
|
332 |
+
$output .= sprintf( "<Data ss:Type=\"%s\">%s</Data>", $type, $item );
|
333 |
+
$output .= "</Cell>\n";
|
334 |
+
|
335 |
+
return $output;
|
336 |
+
}
|
337 |
+
|
338 |
+
function sendHttpHeaders() {
|
339 |
+
header( "Content-Type: application/vnd.ms-excel; charset=" . $this->encoding );
|
340 |
+
header( "Content-Disposition: inline; filename=\"" . basename( $this->filename ) . "\"" );
|
341 |
+
}
|
342 |
+
}
|
343 |
+
|
includes/classes/class-wp-statistics-frontend.php
CHANGED
@@ -8,42 +8,43 @@ class WP_Statistics_Frontend {
|
|
8 |
public function __construct() {
|
9 |
global $WP_Statistics;
|
10 |
|
|
|
11 |
add_filter( 'widget_text', 'do_shortcode' );
|
12 |
|
13 |
-
new WP_Statistics_Schedule;
|
14 |
-
|
15 |
// Add the honey trap code in the footer.
|
16 |
-
add_action( 'wp_footer', '
|
17 |
|
18 |
// Enqueue scripts & styles
|
19 |
-
add_action( 'wp_enqueue_scripts', '
|
20 |
|
21 |
-
//
|
22 |
-
|
23 |
-
add_action( 'wp', 'WP_Statistics_Frontend::init' );
|
24 |
|
25 |
//Add inline Rest Request
|
26 |
-
add_action( 'wp_head', '
|
27 |
|
28 |
//Add Html Comment in head
|
29 |
-
if ( $WP_Statistics->use_cache ) {
|
30 |
-
add_action( 'wp_head', '
|
31 |
}
|
32 |
-
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
/*
|
36 |
* Create Comment support Wappalyzer
|
37 |
*/
|
38 |
-
|
39 |
echo '<!-- Analytics by WP-Statistics v' . WP_Statistics::$reg['version'] . ' - ' . WP_Statistics::$reg['plugin-data']['PluginURI'] . ' -->' . "\n";
|
40 |
}
|
41 |
|
42 |
-
|
43 |
/**
|
44 |
* Footer Action
|
45 |
*/
|
46 |
-
|
47 |
global $WP_Statistics;
|
48 |
if ( $WP_Statistics->get_option( 'use_honeypot' ) && $WP_Statistics->get_option( 'honeypot_postid' ) > 0 ) {
|
49 |
$post_url = get_permalink( $WP_Statistics->get_option( 'honeypot_postid' ) );
|
@@ -53,10 +54,8 @@ class WP_Statistics_Frontend {
|
|
53 |
|
54 |
/**
|
55 |
* Enqueue Scripts
|
56 |
-
*
|
57 |
-
* @param string $hook Not Used
|
58 |
*/
|
59 |
-
|
60 |
|
61 |
// Load our CSS to be used.
|
62 |
if ( is_admin_bar_showing() ) {
|
@@ -67,12 +66,12 @@ class WP_Statistics_Frontend {
|
|
67 |
/*
|
68 |
* Inline Js
|
69 |
*/
|
70 |
-
|
71 |
global $WP_Statistics;
|
72 |
|
73 |
if ( $WP_Statistics->use_cache ) {
|
74 |
-
|
75 |
-
echo '<script>var WP_Statistics_http = new XMLHttpRequest();WP_Statistics_http.open(\'POST\', \'' . add_query_arg( array( '_' => time() ), path_join( get_rest_url(), WP_Statistics_Rest::route . '/' . WP_Statistics_Rest::func ) ) . '\', true);WP_Statistics_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");WP_Statistics_http.send("'.WP_Statistics_Rest::_POST.'=" + JSON.stringify('.self::set_default_params().'));</script>' . "\n";
|
76 |
}
|
77 |
}
|
78 |
|
@@ -80,7 +79,7 @@ class WP_Statistics_Frontend {
|
|
80 |
* Set Default Params Rest Api
|
81 |
*/
|
82 |
static public function set_default_params() {
|
83 |
-
global $
|
84 |
|
85 |
/*
|
86 |
* Load Rest Api JavaScript
|
@@ -121,7 +120,7 @@ class WP_Statistics_Frontend {
|
|
121 |
|
122 |
//track all page
|
123 |
$params['track_all'] = 0;
|
124 |
-
if ( WP_Statistics_Hits::
|
125 |
$params['track_all'] = 1;
|
126 |
}
|
127 |
|
@@ -129,15 +128,25 @@ class WP_Statistics_Frontend {
|
|
129 |
$params['timestamp'] = $WP_Statistics->current_date( 'U' );
|
130 |
|
131 |
//Wp_query
|
132 |
-
$
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
136 |
}
|
137 |
|
138 |
//page url
|
139 |
$params['page_uri'] = wp_statistics_get_uri();
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
foreach ( (array) $params as $key => $value ) {
|
142 |
if ( ! is_scalar( $value ) ) {
|
143 |
continue;
|
@@ -145,15 +154,13 @@ class WP_Statistics_Frontend {
|
|
145 |
$params[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
|
146 |
}
|
147 |
|
148 |
-
|
149 |
-
return json_encode($params, JSON_UNESCAPED_SLASHES);
|
150 |
}
|
151 |
|
152 |
-
|
153 |
/**
|
154 |
* Shutdown Action
|
155 |
*/
|
156 |
-
|
157 |
global $WP_Statistics;
|
158 |
|
159 |
// If something has gone horribly wrong and $WP_Statistics isn't an object, bail out.
|
@@ -163,7 +170,7 @@ class WP_Statistics_Frontend {
|
|
163 |
}
|
164 |
|
165 |
//Disable if User Active cache Plugin
|
166 |
-
if ( ! $WP_Statistics->use_cache
|
167 |
|
168 |
$h = new WP_Statistics_GEO_IP_Hits;
|
169 |
|
@@ -187,11 +194,6 @@ class WP_Statistics_Frontend {
|
|
187 |
$h->Pages();
|
188 |
}
|
189 |
}
|
190 |
-
|
191 |
-
// Check to show hits in posts/pages
|
192 |
-
if ( $WP_Statistics->get_option( 'show_hits' ) ) {
|
193 |
-
add_filter( 'the_content', 'WP_Statistics_Frontend::show_hits' );
|
194 |
-
}
|
195 |
}
|
196 |
|
197 |
/**
|
@@ -199,7 +201,7 @@ class WP_Statistics_Frontend {
|
|
199 |
*
|
200 |
* @return string
|
201 |
*/
|
202 |
-
public
|
203 |
global $WP_Statistics;
|
204 |
|
205 |
// Get post ID
|
@@ -224,4 +226,84 @@ class WP_Statistics_Frontend {
|
|
224 |
}
|
225 |
}
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
}
|
8 |
public function __construct() {
|
9 |
global $WP_Statistics;
|
10 |
|
11 |
+
//Enable Shortcode in Widget
|
12 |
add_filter( 'widget_text', 'do_shortcode' );
|
13 |
|
|
|
|
|
14 |
// Add the honey trap code in the footer.
|
15 |
+
add_action( 'wp_footer', array( $this, 'add_honeypot' ) );
|
16 |
|
17 |
// Enqueue scripts & styles
|
18 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
19 |
|
20 |
+
//Get Visitor information and Save To Database
|
21 |
+
add_action( 'wp', array( $this, 'init' ) );
|
|
|
22 |
|
23 |
//Add inline Rest Request
|
24 |
+
add_action( 'wp_head', array( $this, 'add_inline_rest_js' ) );
|
25 |
|
26 |
//Add Html Comment in head
|
27 |
+
if ( ! $WP_Statistics->use_cache ) {
|
28 |
+
add_action( 'wp_head', array( $this, 'html_comment' ) );
|
29 |
}
|
|
|
30 |
|
31 |
+
// Check to show hits in posts/pages
|
32 |
+
if ( $WP_Statistics->get_option( 'show_hits' ) ) {
|
33 |
+
add_filter( 'the_content', array( $this, 'show_hits' ) );
|
34 |
+
}
|
35 |
+
}
|
36 |
|
37 |
/*
|
38 |
* Create Comment support Wappalyzer
|
39 |
*/
|
40 |
+
public function html_comment() {
|
41 |
echo '<!-- Analytics by WP-Statistics v' . WP_Statistics::$reg['version'] . ' - ' . WP_Statistics::$reg['plugin-data']['PluginURI'] . ' -->' . "\n";
|
42 |
}
|
43 |
|
|
|
44 |
/**
|
45 |
* Footer Action
|
46 |
*/
|
47 |
+
public function add_honeypot() {
|
48 |
global $WP_Statistics;
|
49 |
if ( $WP_Statistics->get_option( 'use_honeypot' ) && $WP_Statistics->get_option( 'honeypot_postid' ) > 0 ) {
|
50 |
$post_url = get_permalink( $WP_Statistics->get_option( 'honeypot_postid' ) );
|
54 |
|
55 |
/**
|
56 |
* Enqueue Scripts
|
|
|
|
|
57 |
*/
|
58 |
+
public function enqueue_scripts() {
|
59 |
|
60 |
// Load our CSS to be used.
|
61 |
if ( is_admin_bar_showing() ) {
|
66 |
/*
|
67 |
* Inline Js
|
68 |
*/
|
69 |
+
public function add_inline_rest_js() {
|
70 |
global $WP_Statistics;
|
71 |
|
72 |
if ( $WP_Statistics->use_cache ) {
|
73 |
+
$this->html_comment();
|
74 |
+
echo '<script>var WP_Statistics_http = new XMLHttpRequest();WP_Statistics_http.open(\'POST\', \'' . add_query_arg( array( '_' => time() ), path_join( get_rest_url(), WP_Statistics_Rest::route . '/' . WP_Statistics_Rest::func ) ) . '\', true);WP_Statistics_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");WP_Statistics_http.send("' . WP_Statistics_Rest::_POST . '=" + JSON.stringify(' . self::set_default_params() . '));</script>' . "\n";
|
75 |
}
|
76 |
}
|
77 |
|
79 |
* Set Default Params Rest Api
|
80 |
*/
|
81 |
static public function set_default_params() {
|
82 |
+
global $WP_Statistics;
|
83 |
|
84 |
/*
|
85 |
* Load Rest Api JavaScript
|
120 |
|
121 |
//track all page
|
122 |
$params['track_all'] = 0;
|
123 |
+
if ( WP_Statistics_Hits::is_track_page() === true ) {
|
124 |
$params['track_all'] = 1;
|
125 |
}
|
126 |
|
128 |
$params['timestamp'] = $WP_Statistics->current_date( 'U' );
|
129 |
|
130 |
//Wp_query
|
131 |
+
$get_page_type = WP_Statistics_Frontend::get_page_type();
|
132 |
+
$params['search_query'] = '';
|
133 |
+
$params['current_page_type'] = $get_page_type['type'];
|
134 |
+
$params['current_page_id'] = $get_page_type['id'];
|
135 |
+
|
136 |
+
if ( array_key_exists( "search_query", $get_page_type ) ) {
|
137 |
+
$params['search_query'] = $get_page_type['search_query'];
|
138 |
}
|
139 |
|
140 |
//page url
|
141 |
$params['page_uri'] = wp_statistics_get_uri();
|
142 |
|
143 |
+
//Get User id
|
144 |
+
$params['user_id'] = 0;
|
145 |
+
if ( is_user_logged_in() ) {
|
146 |
+
$params['user_id'] = get_current_user_id();
|
147 |
+
}
|
148 |
+
|
149 |
+
//Fixed entity decode Html
|
150 |
foreach ( (array) $params as $key => $value ) {
|
151 |
if ( ! is_scalar( $value ) ) {
|
152 |
continue;
|
154 |
$params[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
|
155 |
}
|
156 |
|
157 |
+
return json_encode( $params, JSON_UNESCAPED_SLASHES );
|
|
|
158 |
}
|
159 |
|
|
|
160 |
/**
|
161 |
* Shutdown Action
|
162 |
*/
|
163 |
+
public function init() {
|
164 |
global $WP_Statistics;
|
165 |
|
166 |
// If something has gone horribly wrong and $WP_Statistics isn't an object, bail out.
|
170 |
}
|
171 |
|
172 |
//Disable if User Active cache Plugin
|
173 |
+
if ( ! $WP_Statistics->use_cache ) {
|
174 |
|
175 |
$h = new WP_Statistics_GEO_IP_Hits;
|
176 |
|
194 |
$h->Pages();
|
195 |
}
|
196 |
}
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
|
199 |
/**
|
201 |
*
|
202 |
* @return string
|
203 |
*/
|
204 |
+
public function show_hits( $content ) {
|
205 |
global $WP_Statistics;
|
206 |
|
207 |
// Get post ID
|
226 |
}
|
227 |
}
|
228 |
|
229 |
+
/**
|
230 |
+
* Get Page Type
|
231 |
+
*/
|
232 |
+
public static function get_page_type() {
|
233 |
+
|
234 |
+
//Set Default Option
|
235 |
+
$result = array( "type" => "unknown", "id" => 0 );
|
236 |
+
|
237 |
+
//Check Query object
|
238 |
+
$id = get_queried_object_id();
|
239 |
+
if ( is_numeric( $id ) and $id > 0 ) {
|
240 |
+
$result['id'] = $id;
|
241 |
+
}
|
242 |
+
|
243 |
+
//WooCommerce Product
|
244 |
+
if ( class_exists( 'WooCommerce' ) ) {
|
245 |
+
if ( is_product() ) {
|
246 |
+
return wp_parse_args( array( "type" => "product" ), $result );
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
//Home Page or Front Page
|
251 |
+
if ( is_front_page() || is_home() ) {
|
252 |
+
return wp_parse_args( array( "type" => "home" ), $result );
|
253 |
+
}
|
254 |
+
|
255 |
+
//attachment View
|
256 |
+
if ( is_attachment() ) {
|
257 |
+
$result['type'] = "attachment";
|
258 |
+
}
|
259 |
+
|
260 |
+
//Single Post Fro All Post Type
|
261 |
+
if ( is_singular() ) {
|
262 |
+
$result['type'] = "post";
|
263 |
+
}
|
264 |
+
|
265 |
+
//Single Page
|
266 |
+
if ( is_page() ) {
|
267 |
+
$result['type'] = "page";
|
268 |
+
}
|
269 |
+
|
270 |
+
//Category Page
|
271 |
+
if ( is_category() ) {
|
272 |
+
$result['type'] = "category";
|
273 |
+
}
|
274 |
+
|
275 |
+
//Tag Page
|
276 |
+
if ( is_tag() ) {
|
277 |
+
$result['type'] = "post_tag";
|
278 |
+
}
|
279 |
+
|
280 |
+
//is Custom Term From Taxonomy
|
281 |
+
if ( is_tax() ) {
|
282 |
+
$result['type'] = "tax";
|
283 |
+
}
|
284 |
+
|
285 |
+
//is Author Page
|
286 |
+
if ( is_author() ) {
|
287 |
+
$result['type'] = "author";
|
288 |
+
}
|
289 |
+
|
290 |
+
//is search page
|
291 |
+
$search_query = get_search_query();
|
292 |
+
if ( trim( $search_query ) != "" ) {
|
293 |
+
return array( "type" => "search", "id" => 0, "search_query" => $search_query );
|
294 |
+
}
|
295 |
+
|
296 |
+
//is Archive Page
|
297 |
+
if ( is_archive() ) {
|
298 |
+
$result['type'] = "archive";
|
299 |
+
}
|
300 |
+
|
301 |
+
//is 404 Page
|
302 |
+
if ( is_404() ) {
|
303 |
+
$result['type'] = "404";
|
304 |
+
}
|
305 |
+
|
306 |
+
return $result;
|
307 |
+
}
|
308 |
+
|
309 |
}
|
includes/classes/class-wp-statistics-hits.php
CHANGED
@@ -20,336 +20,332 @@ class WP_Statistics_Hits {
|
|
20 |
|
21 |
public $exclusion_record = false;
|
22 |
private $timestamp;
|
23 |
-
private $second;
|
24 |
private $current_page_id;
|
|
|
|
|
25 |
|
26 |
// Construction function.
|
27 |
-
public function __construct()
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
return;
|
349 |
-
}
|
350 |
-
}
|
351 |
-
}
|
352 |
-
}
|
353 |
}
|
354 |
|
355 |
// This function records visits to the site.
|
@@ -394,23 +390,31 @@ class WP_Statistics_Hits {
|
|
394 |
}
|
395 |
}
|
396 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
// This function records unique visitors to the site.
|
398 |
public function Visitors() {
|
399 |
-
global $wpdb, $
|
400 |
-
|
401 |
-
//Check If Rest Request
|
402 |
-
if( WP_Statistics_Rest::is_rest() ) {
|
403 |
-
// Get the pages or posts ID if it exists.
|
404 |
-
if ( WP_Statistics_Rest::params('is_object_wp_query') =="true" ) {
|
405 |
-
$this->current_page_id = WP_Statistics_Rest::params('current_page_id');
|
406 |
-
}
|
407 |
-
} else {
|
408 |
-
// Get the pages or posts ID if it exists.
|
409 |
-
if ( is_object( $wp_query ) ) {
|
410 |
-
$this->current_page_id = $wp_query->get_queried_object_id();
|
411 |
-
}
|
412 |
-
}
|
413 |
|
|
|
|
|
|
|
|
|
414 |
if ( $WP_Statistics->get_option( 'use_honeypot' ) &&
|
415 |
$WP_Statistics->get_option( 'honeypot_postid' ) > 0 &&
|
416 |
$WP_Statistics->get_option( 'honeypot_postid' ) == $this->current_page_id &&
|
@@ -447,45 +451,46 @@ class WP_Statistics_Hits {
|
|
447 |
|
448 |
// If we've been told to store the entire user agent, do so.
|
449 |
if ( $WP_Statistics->get_option( 'store_ua' ) == true ) {
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
} else {
|
456 |
$ua = '';
|
457 |
}
|
458 |
|
459 |
// Store the result.
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
|
|
475 |
);
|
476 |
-
|
477 |
-
|
478 |
|
479 |
// Now parse the referrer and store the results in the search table if the database has been converted.
|
480 |
// Also make sure we actually inserted a row on the INSERT IGNORE above or we'll create duplicate entries.
|
481 |
if ( $WP_Statistics->get_option( 'search_converted' ) && $wpdb->insert_id ) {
|
482 |
|
483 |
$search_engines = wp_statistics_searchengine_list();
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
|
490 |
// Parse the URL in to it's component parts.
|
491 |
if ( wp_http_validate_url( $referred ) ) {
|
@@ -524,6 +529,8 @@ class WP_Statistics_Hits {
|
|
524 |
$this->exclusion_match = true;
|
525 |
$this->exclusion_reason = 'honeypot';
|
526 |
} else {
|
|
|
|
|
527 |
|
528 |
$sqlstring = $wpdb->prepare(
|
529 |
'UPDATE ' .
|
@@ -551,10 +558,7 @@ class WP_Statistics_Hits {
|
|
551 |
return;
|
552 |
}
|
553 |
|
554 |
-
$this->result = $wpdb->query(
|
555 |
-
"UPDATE {$wpdb->prefix}statistics_exclusions SET `count` = `count` + 1 WHERE `date` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}' AND `reason` = '{$this->exclusion_reason}'"
|
556 |
-
);
|
557 |
-
|
558 |
if ( ! $this->result ) {
|
559 |
$wpdb->insert(
|
560 |
$wpdb->prefix . 'statistics_exclusions',
|
@@ -568,59 +572,69 @@ class WP_Statistics_Hits {
|
|
568 |
}
|
569 |
|
570 |
// Check is Track All Page
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
|
|
577 |
|
578 |
-
|
579 |
-
|
580 |
|
581 |
// This function records page hits.
|
582 |
public function Pages() {
|
583 |
-
global $wpdb, $
|
584 |
|
585 |
// If we're a web crawler or referral from ourselves or an excluded address don't record the page hit.
|
586 |
if ( ! $this->exclusion_match ) {
|
587 |
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
|
|
|
|
597 |
|
598 |
-
if ( $is_track_all ===true ) {
|
599 |
|
600 |
// Get the pages or posts ID if it exists and we haven't set it in the visitors code.
|
601 |
-
|
602 |
-
if ( ! $this->current_page_id ) {
|
603 |
-
$this->current_page_id = WP_Statistics_Rest::params('current_page_id');
|
604 |
-
}
|
605 |
-
} else {
|
606 |
-
if ( ! $this->current_page_id && is_object( $wp_query ) ) {
|
607 |
-
$this->current_page_id = $wp_query->get_queried_object_id();
|
608 |
-
}
|
609 |
-
}
|
610 |
|
611 |
// If we didn't find a page id, we don't have anything else to do.
|
612 |
-
if (
|
613 |
return;
|
614 |
}
|
615 |
|
616 |
// Get the current page URI.
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
|
623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
$temp = explode( '?', $page_uri );
|
625 |
if ( $temp !== false ) {
|
626 |
$page_uri = $temp[0];
|
@@ -631,17 +645,14 @@ class WP_Statistics_Hits {
|
|
631 |
$page_uri = substr( $page_uri, 0, 255 );
|
632 |
|
633 |
// If we have already been to this page today (a likely scenario), just update the count on the record.
|
634 |
-
$
|
635 |
-
|
636 |
-
$page_uri
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
// If the update failed (aka the record doesn't exist), insert a new one. Note this may drop a page hit if a race condition
|
641 |
-
// exists where two people load the same page a the roughly the same time. In that case two inserts would be attempted but
|
642 |
-
// there is a unique index requirement on the database and one of them would fail.
|
643 |
-
if ( ! $this->result ) {
|
644 |
|
|
|
|
|
645 |
$wpdb->insert(
|
646 |
$wpdb->prefix . 'statistics_pages',
|
647 |
array(
|
@@ -649,13 +660,36 @@ class WP_Statistics_Hits {
|
|
649 |
'date' => $WP_Statistics->Current_date( 'Y-m-d' ),
|
650 |
'count' => 1,
|
651 |
'id' => $this->current_page_id,
|
|
|
652 |
)
|
653 |
);
|
|
|
|
|
654 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
}
|
656 |
}
|
657 |
}
|
658 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
659 |
// This function checks to see if the current user (as defined by their IP address) has an entry in the database.
|
660 |
// Note we set the $this->result variable so we don't have to re-execute the query when we do the user update.
|
661 |
public function Is_user() {
|
@@ -691,8 +725,6 @@ class WP_Statistics_Hits {
|
|
691 |
}
|
692 |
}
|
693 |
|
694 |
-
// Remove users that have gone offline since the last check.
|
695 |
-
$this->Delete_user();
|
696 |
}
|
697 |
|
698 |
// This function adds a user to the database.
|
@@ -700,6 +732,9 @@ class WP_Statistics_Hits {
|
|
700 |
global $wpdb, $WP_Statistics;
|
701 |
if ( ! $this->Is_user() ) {
|
702 |
|
|
|
|
|
|
|
703 |
// Insert the user in to the database.
|
704 |
$wpdb->insert(
|
705 |
$wpdb->prefix . 'statistics_useronline',
|
@@ -713,18 +748,48 @@ class WP_Statistics_Hits {
|
|
713 |
'platform' => $WP_Statistics->agent['platform'],
|
714 |
'version' => $WP_Statistics->agent['version'],
|
715 |
'location' => $this->location,
|
|
|
|
|
|
|
716 |
)
|
717 |
);
|
|
|
|
|
718 |
}
|
719 |
|
720 |
}
|
721 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
// This function updates a user in the database.
|
723 |
public function Update_user() {
|
724 |
global $wpdb, $WP_Statistics;
|
725 |
// Make sure we found the user earlier when we called Is_user().
|
726 |
if ( $this->result ) {
|
727 |
|
|
|
|
|
|
|
728 |
// Update the database with the new information.
|
729 |
$wpdb->update(
|
730 |
$wpdb->prefix . 'statistics_useronline',
|
@@ -732,6 +797,9 @@ class WP_Statistics_Hits {
|
|
732 |
'timestamp' => $this->timestamp,
|
733 |
'date' => $WP_Statistics->Current_Date(),
|
734 |
'referred' => $WP_Statistics->get_Referred(),
|
|
|
|
|
|
|
735 |
),
|
736 |
array(
|
737 |
'ip' => $WP_Statistics->ip_hash ? $WP_Statistics->ip_hash : $WP_Statistics->ip,
|
@@ -744,13 +812,4 @@ class WP_Statistics_Hits {
|
|
744 |
}
|
745 |
}
|
746 |
|
747 |
-
// This function removes expired users.
|
748 |
-
public function Delete_user() {
|
749 |
-
global $wpdb;
|
750 |
-
// We want to delete users that are over the number of seconds set by the admin.
|
751 |
-
$timediff = $this->timestamp - $this->second;
|
752 |
-
|
753 |
-
// Call the deletion query.
|
754 |
-
$wpdb->query( "DELETE FROM {$wpdb->prefix}statistics_useronline WHERE timestamp < '{$timediff}'" );
|
755 |
-
}
|
756 |
}
|
20 |
|
21 |
public $exclusion_record = false;
|
22 |
private $timestamp;
|
|
|
23 |
private $current_page_id;
|
24 |
+
private $current_page_type;
|
25 |
+
public $current_visitor_id = 0;
|
26 |
|
27 |
// Construction function.
|
28 |
+
public function __construct() {
|
29 |
+
global $wp_version, $WP_Statistics;
|
30 |
+
|
31 |
+
// Set the timestamp value.
|
32 |
+
$this->timestamp = $WP_Statistics->current_date( 'U' );
|
33 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
34 |
+
$this->timestamp = WP_Statistics_Rest::params( 'timestamp' );
|
35 |
+
}
|
36 |
+
|
37 |
+
// Check to see if the user wants us to record why we're excluding hits.
|
38 |
+
if ( $WP_Statistics->get_option( 'record_exclusions' ) ) {
|
39 |
+
$this->exclusion_record = true;
|
40 |
+
}
|
41 |
+
|
42 |
+
// Create a IP Tools instance from the current IP address for use later.
|
43 |
+
// Fall back to the localhost if it can't be parsed.
|
44 |
+
try {
|
45 |
+
$ip = new IP( $WP_Statistics->ip );
|
46 |
+
} catch ( Exception $e ) {
|
47 |
+
$ip = new IP( '127.0.0.1' );
|
48 |
+
}
|
49 |
+
|
50 |
+
// Let's check to see if our subnet matches a private IP address range, if so go ahead and set the location information now.
|
51 |
+
if ( $WP_Statistics->get_option( 'private_country_code' ) != '000' &&
|
52 |
+
$WP_Statistics->get_option( 'private_country_code' ) != ''
|
53 |
+
) {
|
54 |
+
$private_subnets = array( '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', '127.0.0.1/24', 'fc00::/7' );
|
55 |
+
|
56 |
+
foreach ( $private_subnets as $psub ) {
|
57 |
+
$contains_ip = false;
|
58 |
+
|
59 |
+
try {
|
60 |
+
$contains_ip = Range::parse( $psub )->contains( $ip );
|
61 |
+
} catch ( Exception $e ) {
|
62 |
+
$contains_ip = false;
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( $contains_ip ) {
|
66 |
+
$this->location = $WP_Statistics->get_option( 'private_country_code' );
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
/*
|
73 |
+
* The follow exclusion checks are done during the class construction so we don't have to execute them twice if we're tracking visits and visitors.
|
74 |
+
*
|
75 |
+
* Order of exclusion checks is:
|
76 |
+
* 1 - AJAX calls
|
77 |
+
* 2 - CronJob
|
78 |
+
* 3 - Robots
|
79 |
+
* 4 - IP/Subnets
|
80 |
+
* 5 - Self Referrals, Referrer Spam & login page
|
81 |
+
* 6 - User roles
|
82 |
+
* 7 - Host name list
|
83 |
+
*
|
84 |
+
* The GoeIP exclusions will be processed in the GeoIP hits class constructor.
|
85 |
+
*
|
86 |
+
* Note that we stop processing as soon as a match is made by executing a `return` from the function constructor.
|
87 |
+
*
|
88 |
+
*/
|
89 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
90 |
+
$this->exclusion_match = ( WP_Statistics_Rest::params( 'exclude' ) == 1 ? true : false );
|
91 |
+
$this->exclusion_reason = WP_Statistics_Rest::params( 'exclude_reason' );
|
92 |
+
|
93 |
+
if ( $this->exclusion_match === true ) {
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
} else {
|
97 |
+
|
98 |
+
// Detect if we're running an ajax request.
|
99 |
+
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
100 |
+
$this->exclusion_match = true;
|
101 |
+
$this->exclusion_reason = 'ajax';
|
102 |
+
|
103 |
+
return;
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( ( defined( 'DOING_CRON' ) && DOING_CRON === true ) || ( function_exists( 'wp_doing_cron' ) && wp_doing_cron() === true ) ) {
|
107 |
+
$this->exclusion_match = true;
|
108 |
+
$this->exclusion_reason = 'cronjob';
|
109 |
+
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
|
113 |
+
$crawler = false;
|
114 |
+
$ua_string = '';
|
115 |
+
|
116 |
+
if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) ) {
|
117 |
+
$ua_string = $_SERVER['HTTP_USER_AGENT'];
|
118 |
+
}
|
119 |
+
|
120 |
+
/*
|
121 |
+
* Check Is robot
|
122 |
+
*/
|
123 |
+
$CrawlerDetect = new CrawlerDetect;
|
124 |
+
if ( $CrawlerDetect->isCrawler() ) {
|
125 |
+
$crawler = true;
|
126 |
+
}
|
127 |
+
|
128 |
+
// If we're a crawler as per whichbrowser, exclude us, otherwise double check based on the WP Statistics robot list.
|
129 |
+
if ( $crawler == true ) {
|
130 |
+
$this->exclusion_match = true;
|
131 |
+
$this->exclusion_reason = 'CrawlerDetect';
|
132 |
+
|
133 |
+
return;
|
134 |
+
} else {
|
135 |
+
// Pull the robots from the database.
|
136 |
+
$robots = explode( "\n", $WP_Statistics->get_option( 'robotlist' ) );
|
137 |
+
|
138 |
+
// Check to see if we match any of the robots.
|
139 |
+
foreach ( $robots as $robot ) {
|
140 |
+
$robot = trim( $robot );
|
141 |
+
|
142 |
+
// If the match case is less than 4 characters long, it might match too much so don't execute it.
|
143 |
+
if ( strlen( $robot ) > 3 ) {
|
144 |
+
if ( stripos( $ua_string, $robot ) !== false ) {
|
145 |
+
$this->exclusion_match = true;
|
146 |
+
$this->exclusion_reason = 'robot';
|
147 |
+
|
148 |
+
return;
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
// Finally check to see if we have corrupt header information.
|
154 |
+
if ( ! $this->exclusion_match && $WP_Statistics->get_option( 'corrupt_browser_info' ) ) {
|
155 |
+
if ( $ua_string == '' || $WP_Statistics->ip == '' ) {
|
156 |
+
$this->exclusion_match = true;
|
157 |
+
$this->exclusion_reason = 'robot';
|
158 |
+
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
// If we didn't match a robot, check ip subnets.
|
165 |
+
|
166 |
+
// Pull the subnets from the database.
|
167 |
+
$subnets = explode( "\n", $WP_Statistics->get_option( 'exclude_ip' ) );
|
168 |
+
|
169 |
+
// Check to see if we match any of the excluded addresses.
|
170 |
+
foreach ( $subnets as $subnet ) {
|
171 |
+
$subnet = trim( $subnet );
|
172 |
+
|
173 |
+
// The shortest ip address is 1.1.1.1, anything less must be a malformed entry.
|
174 |
+
if ( strlen( $subnet ) > 6 ) {
|
175 |
+
$range_prased = false;
|
176 |
+
|
177 |
+
try {
|
178 |
+
$range_prased = Range::parse( $subnet )->contains( $ip );
|
179 |
+
} catch ( Exception $e ) {
|
180 |
+
$range_parased = false;
|
181 |
+
}
|
182 |
+
|
183 |
+
if ( $range_prased ) {
|
184 |
+
$this->exclusion_match = true;
|
185 |
+
$this->exclusion_reason = 'ip match';
|
186 |
+
|
187 |
+
return;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
// Check to see if we are being referred to ourselves.
|
193 |
+
if ( $ua_string == 'WordPress/' . $wp_version . '; ' . get_home_url( null, '/' ) ||
|
194 |
+
$ua_string == 'WordPress/' . $wp_version . '; ' . get_home_url()
|
195 |
+
) {
|
196 |
+
$this->exclusion_match = true;
|
197 |
+
$this->exclusion_reason = 'self referral';
|
198 |
+
|
199 |
+
return;
|
200 |
+
}
|
201 |
+
|
202 |
+
// Check to see if we're excluding the login page.
|
203 |
+
if ( $WP_Statistics->get_option( 'exclude_loginpage' ) ) {
|
204 |
+
$protocol = strpos( strtolower( $_SERVER['SERVER_PROTOCOL'] ), 'https' ) === false ? 'http' : 'https';
|
205 |
+
$host = $_SERVER['HTTP_HOST'];
|
206 |
+
$script = $_SERVER['SCRIPT_NAME'];
|
207 |
+
|
208 |
+
$currentURL = $protocol . '://' . $host . $script;
|
209 |
+
$loginURL = wp_login_url();
|
210 |
+
|
211 |
+
if ( $currentURL == $loginURL ) {
|
212 |
+
$this->exclusion_match = true;
|
213 |
+
$this->exclusion_reason = 'login page';
|
214 |
+
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
// Check to see if we're excluding the Admin page.
|
220 |
+
if ( $WP_Statistics->get_option( 'exclude_adminpage' ) ) {
|
221 |
+
if ( stristr( $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], "wp-admin" ) ) {
|
222 |
+
$this->exclusion_match = true;
|
223 |
+
$this->exclusion_reason = 'admin page';
|
224 |
+
|
225 |
+
return;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
// Check to see if we're excluding referrer spam.
|
230 |
+
if ( $WP_Statistics->get_option( 'referrerspam' ) ) {
|
231 |
+
$referrer = $WP_Statistics->get_Referred();
|
232 |
+
|
233 |
+
// Pull the referrer spam list from the database.
|
234 |
+
$referrerspamlist = explode( "\n", $WP_Statistics->get_option( 'referrerspamlist' ) );
|
235 |
+
|
236 |
+
// Check to see if we match any of the robots.
|
237 |
+
foreach ( $referrerspamlist as $item ) {
|
238 |
+
$item = trim( $item );
|
239 |
+
|
240 |
+
// If the match case is less than 4 characters long, it might match too much so don't execute it.
|
241 |
+
if ( strlen( $item ) > 3 ) {
|
242 |
+
if ( stripos( $referrer, $item ) !== false ) {
|
243 |
+
$this->exclusion_match = true;
|
244 |
+
$this->exclusion_reason = 'referrer_spam';
|
245 |
+
|
246 |
+
return;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
// Check to see if we're excluding RSS feeds.
|
253 |
+
if ( $WP_Statistics->get_option( 'exclude_feeds' ) ) {
|
254 |
+
if ( is_feed() ) {
|
255 |
+
$this->exclusion_match = true;
|
256 |
+
$this->exclusion_reason = 'feed';
|
257 |
+
|
258 |
+
return;
|
259 |
+
}
|
260 |
+
}
|
261 |
+
|
262 |
+
// Check to see if we're excluding 404 pages.
|
263 |
+
if ( $WP_Statistics->get_option( 'exclude_404s' ) ) {
|
264 |
+
if ( is_404() ) {
|
265 |
+
$this->exclusion_match = true;
|
266 |
+
$this->exclusion_reason = '404';
|
267 |
+
|
268 |
+
return;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
// Check to see if we're excluding the current page url.
|
273 |
+
if ( $WP_Statistics->get_option( 'excluded_urls' ) ) {
|
274 |
+
$script = $_SERVER['REQUEST_URI'];
|
275 |
+
$delimiter = strpos( $script, '?' );
|
276 |
+
if ( $delimiter > 0 ) {
|
277 |
+
$script = substr( $script, 0, $delimiter );
|
278 |
+
}
|
279 |
+
|
280 |
+
$excluded_urls = explode( "\n", $WP_Statistics->get_option( 'excluded_urls' ) );
|
281 |
+
|
282 |
+
foreach ( $excluded_urls as $url ) {
|
283 |
+
$this_url = trim( $url );
|
284 |
+
|
285 |
+
if ( strlen( $this_url ) > 2 ) {
|
286 |
+
if ( stripos( $script, $this_url ) === 0 ) {
|
287 |
+
$this->exclusion_match = true;
|
288 |
+
$this->exclusion_reason = 'excluded url';
|
289 |
+
|
290 |
+
return;
|
291 |
+
}
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
// Check to see if we are excluding based on the user role.
|
297 |
+
if ( is_user_logged_in() ) {
|
298 |
+
$current_user = wp_get_current_user();
|
299 |
+
|
300 |
+
foreach ( $current_user->roles as $role ) {
|
301 |
+
$option_name = 'exclude_' . str_replace( ' ', '_', strtolower( $role ) );
|
302 |
+
if ( $WP_Statistics->get_option( $option_name ) == true ) {
|
303 |
+
$this->exclusion_match = true;
|
304 |
+
$this->exclusion_reason = 'user role';
|
305 |
+
|
306 |
+
return;
|
307 |
+
}
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
// Check to see if we are excluded by the host name.
|
312 |
+
if ( ! $this->exclusion_match ) {
|
313 |
+
$excluded_host = explode( "\n", $WP_Statistics->get_option( 'excluded_hosts' ) );
|
314 |
+
|
315 |
+
// If there's nothing in the excluded host list, don't do anything.
|
316 |
+
if ( count( $excluded_host ) > 0 ) {
|
317 |
+
$transient_name = 'wps_excluded_hostname_to_ip_cache';
|
318 |
+
|
319 |
+
// Get the transient with the hostname cache.
|
320 |
+
$hostname_cache = get_transient( $transient_name );
|
321 |
+
|
322 |
+
// If the transient has expired (or has never been set), create one now.
|
323 |
+
if ( $hostname_cache === false ) {
|
324 |
+
// Flush the failed cache variable.
|
325 |
+
$hostname_cache = array();
|
326 |
+
|
327 |
+
// Loop through the list of hosts and look them up.
|
328 |
+
foreach ( $excluded_host as $host ) {
|
329 |
+
if ( strpos( $host, '.' ) > 0 ) {
|
330 |
+
// We add the extra period to the end of the host name to make sure we don't append the local dns suffix to the resolution cycle.
|
331 |
+
$hostname_cache[ $host ] = gethostbyname( $host . '.' );
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
// Set the transient and store it for 1 hour.
|
336 |
+
set_transient( $transient_name, $hostname_cache, 360 );
|
337 |
+
}
|
338 |
+
|
339 |
+
// Check if the current IP address matches one of the ones in the excluded hosts list.
|
340 |
+
if ( in_array( $WP_Statistics->ip, $hostname_cache ) ) {
|
341 |
+
$this->exclusion_match = true;
|
342 |
+
$this->exclusion_reason = 'hostname';
|
343 |
+
|
344 |
+
return;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
|
|
|
|
|
|
|
|
|
|
349 |
}
|
350 |
|
351 |
// This function records visits to the site.
|
390 |
}
|
391 |
}
|
392 |
|
393 |
+
//Get current Page detail
|
394 |
+
public function get_page_detail() {
|
395 |
+
|
396 |
+
//if is Cache enable
|
397 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
398 |
+
$this->current_page_id = WP_Statistics_Rest::params( 'current_page_id' );
|
399 |
+
$this->current_page_type = WP_Statistics_Rest::params( 'current_page_type' );
|
400 |
+
} else {
|
401 |
+
//Get Page Type
|
402 |
+
$get_page_type = WP_Statistics_Frontend::get_page_type();
|
403 |
+
$this->current_page_id = $get_page_type['id'];
|
404 |
+
$this->current_page_type = $get_page_type['type'];
|
405 |
+
}
|
406 |
+
|
407 |
+
}
|
408 |
+
|
409 |
+
|
410 |
// This function records unique visitors to the site.
|
411 |
public function Visitors() {
|
412 |
+
global $wpdb, $WP_Statistics;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
|
414 |
+
//Get Current Page detail
|
415 |
+
$this->get_page_detail();
|
416 |
+
|
417 |
+
//Check honeypot Page
|
418 |
if ( $WP_Statistics->get_option( 'use_honeypot' ) &&
|
419 |
$WP_Statistics->get_option( 'honeypot_postid' ) > 0 &&
|
420 |
$WP_Statistics->get_option( 'honeypot_postid' ) == $this->current_page_id &&
|
451 |
|
452 |
// If we've been told to store the entire user agent, do so.
|
453 |
if ( $WP_Statistics->get_option( 'store_ua' ) == true ) {
|
454 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
455 |
+
$ua = WP_Statistics_Rest::params( 'ua' );
|
456 |
+
} else {
|
457 |
+
$ua = $_SERVER['HTTP_USER_AGENT'];
|
458 |
+
}
|
459 |
} else {
|
460 |
$ua = '';
|
461 |
}
|
462 |
|
463 |
// Store the result.
|
464 |
+
add_filter( 'query', 'wp_statistics_ignore_insert', 10 );
|
465 |
+
$wpdb->insert(
|
466 |
+
$wpdb->prefix . 'statistics_visitor',
|
467 |
+
array(
|
468 |
+
'last_counter' => $WP_Statistics->Current_date( 'Y-m-d' ),
|
469 |
+
'referred' => $WP_Statistics->get_Referred(),
|
470 |
+
'agent' => $WP_Statistics->agent['browser'],
|
471 |
+
'platform' => $WP_Statistics->agent['platform'],
|
472 |
+
'version' => $WP_Statistics->agent['version'],
|
473 |
+
'ip' => $WP_Statistics->ip_hash ? $WP_Statistics->ip_hash : $WP_Statistics->ip,
|
474 |
+
'location' => $this->location,
|
475 |
+
'UAString' => $ua,
|
476 |
+
'hits' => 1,
|
477 |
+
'honeypot' => $honeypot,
|
478 |
+
),
|
479 |
+
array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s' )
|
480 |
);
|
481 |
+
$this->current_visitor_id = $wpdb->insert_id;
|
482 |
+
remove_filter( 'query', 'wp_statistics_ignore_insert', 10 );
|
483 |
|
484 |
// Now parse the referrer and store the results in the search table if the database has been converted.
|
485 |
// Also make sure we actually inserted a row on the INSERT IGNORE above or we'll create duplicate entries.
|
486 |
if ( $WP_Statistics->get_option( 'search_converted' ) && $wpdb->insert_id ) {
|
487 |
|
488 |
$search_engines = wp_statistics_searchengine_list();
|
489 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
490 |
+
$referred = WP_Statistics_Rest::params( 'referred' );
|
491 |
+
} else {
|
492 |
+
$referred = $WP_Statistics->get_Referred();
|
493 |
+
}
|
494 |
|
495 |
// Parse the URL in to it's component parts.
|
496 |
if ( wp_http_validate_url( $referred ) ) {
|
529 |
$this->exclusion_match = true;
|
530 |
$this->exclusion_reason = 'honeypot';
|
531 |
} else {
|
532 |
+
//Get Current Visitors ID
|
533 |
+
$this->current_visitor_id = $this->result->ID;
|
534 |
|
535 |
$sqlstring = $wpdb->prepare(
|
536 |
'UPDATE ' .
|
558 |
return;
|
559 |
}
|
560 |
|
561 |
+
$this->result = $wpdb->query( "UPDATE {$wpdb->prefix}statistics_exclusions SET `count` = `count` + 1 WHERE `date` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}' AND `reason` = '{$this->exclusion_reason}'" );
|
|
|
|
|
|
|
562 |
if ( ! $this->result ) {
|
563 |
$wpdb->insert(
|
564 |
$wpdb->prefix . 'statistics_exclusions',
|
572 |
}
|
573 |
|
574 |
// Check is Track All Page
|
575 |
+
static public function is_track_page() {
|
576 |
+
global $WP_Statistics;
|
577 |
+
|
578 |
+
//Check if Track All
|
579 |
+
if ( $WP_Statistics->get_option( 'track_all_pages' ) || is_single() || is_page() || is_front_page() ) {
|
580 |
+
return true;
|
581 |
+
}
|
582 |
|
583 |
+
return false;
|
584 |
+
}
|
585 |
|
586 |
// This function records page hits.
|
587 |
public function Pages() {
|
588 |
+
global $wpdb, $WP_Statistics;
|
589 |
|
590 |
// If we're a web crawler or referral from ourselves or an excluded address don't record the page hit.
|
591 |
if ( ! $this->exclusion_match ) {
|
592 |
|
593 |
+
// Don't track anything but actual pages and posts, unless we've been told to.
|
594 |
+
$is_track_all = false;
|
595 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
596 |
+
if ( WP_Statistics_Rest::params( 'track_all' ) == 1 ) {
|
597 |
+
$is_track_all = true;
|
598 |
+
}
|
599 |
+
} else {
|
600 |
+
if ( self::is_track_page() ) {
|
601 |
+
$is_track_all = true;
|
602 |
+
}
|
603 |
+
}
|
604 |
|
605 |
+
if ( $is_track_all === true ) {
|
606 |
|
607 |
// Get the pages or posts ID if it exists and we haven't set it in the visitors code.
|
608 |
+
$this->get_page_detail();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
|
610 |
// If we didn't find a page id, we don't have anything else to do.
|
611 |
+
if ( $this->current_page_type == "unknown" ) {
|
612 |
return;
|
613 |
}
|
614 |
|
615 |
// Get the current page URI.
|
616 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
617 |
+
$page_uri = WP_Statistics_Rest::params( 'page_uri' );
|
618 |
+
} else {
|
619 |
+
$page_uri = wp_statistics_get_uri();
|
620 |
+
}
|
621 |
|
622 |
+
//Get String Search Wordpress
|
623 |
+
$is_search = false;
|
624 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
625 |
+
if ( WP_Statistics_Rest::params( 'search_query' ) != "" ) {
|
626 |
+
$page_uri = "?s=" . WP_Statistics_Rest::params( 'search_query' );
|
627 |
+
$is_search = true;
|
628 |
+
}
|
629 |
+
} else {
|
630 |
+
$get_page_type = WP_Statistics_Frontend::get_page_type();
|
631 |
+
if ( array_key_exists( "search_query", $get_page_type ) ) {
|
632 |
+
$page_uri = "?s=" . $get_page_type['search_query'];
|
633 |
+
$is_search = true;
|
634 |
+
}
|
635 |
+
}
|
636 |
+
|
637 |
+
if ( $WP_Statistics->get_option( 'strip_uri_parameters' ) and $is_search === false ) {
|
638 |
$temp = explode( '?', $page_uri );
|
639 |
if ( $temp !== false ) {
|
640 |
$page_uri = $temp[0];
|
645 |
$page_uri = substr( $page_uri, 0, 255 );
|
646 |
|
647 |
// If we have already been to this page today (a likely scenario), just update the count on the record.
|
648 |
+
$exist = $wpdb->get_row( "SELECT `page_id` FROM {$wpdb->prefix}statistics_pages WHERE `date` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}' " . ( $is_search === true ? "AND `uri` = '" . $page_uri . "'" : "" ) . "AND `type` = '{$this->current_page_type}' AND `id` = {$this->current_page_id}", ARRAY_A );
|
649 |
+
if ( null !== $exist ) {
|
650 |
+
$sql = $wpdb->prepare( "UPDATE {$wpdb->prefix}statistics_pages SET `count` = `count` + 1 WHERE `date` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}' " . ( $is_search === true ? "AND `uri` = '" . $page_uri . "'" : "" ) . "AND `type` = '{$this->current_page_type}' AND `id` = %d", $this->current_page_id );
|
651 |
+
$this->result = $wpdb->query( $sql );
|
652 |
+
$page_id = $exist['page_id'];
|
|
|
|
|
|
|
|
|
|
|
653 |
|
654 |
+
} else {
|
655 |
+
add_filter( 'query', 'wp_statistics_ignore_insert', 10 );
|
656 |
$wpdb->insert(
|
657 |
$wpdb->prefix . 'statistics_pages',
|
658 |
array(
|
660 |
'date' => $WP_Statistics->Current_date( 'Y-m-d' ),
|
661 |
'count' => 1,
|
662 |
'id' => $this->current_page_id,
|
663 |
+
'type' => $this->current_page_type
|
664 |
)
|
665 |
);
|
666 |
+
$page_id = $wpdb->insert_id;
|
667 |
+
remove_filter( 'query', 'wp_statistics_ignore_insert', 10 );
|
668 |
}
|
669 |
+
|
670 |
+
//Set Visitor Relationships
|
671 |
+
if ( $WP_Statistics->get_option( 'visitors' ) == true and $WP_Statistics->get_option( 'visitors_log' ) == true and $this->current_visitor_id > 0 ) {
|
672 |
+
$this->visitors_relationships( $page_id, $this->current_visitor_id );
|
673 |
+
}
|
674 |
+
|
675 |
}
|
676 |
}
|
677 |
}
|
678 |
|
679 |
+
//Set Visitor Relationships
|
680 |
+
public function visitors_relationships( $page_id, $visitor_id ) {
|
681 |
+
global $wpdb;
|
682 |
+
$wpdb->insert(
|
683 |
+
$wpdb->prefix . 'statistics_visitor_relationships',
|
684 |
+
array(
|
685 |
+
'visitor_id' => $visitor_id,
|
686 |
+
'page_id' => $page_id,
|
687 |
+
'date' => current_time( 'mysql' )
|
688 |
+
),
|
689 |
+
array( '%d', '%d', '%s' )
|
690 |
+
);
|
691 |
+
}
|
692 |
+
|
693 |
// This function checks to see if the current user (as defined by their IP address) has an entry in the database.
|
694 |
// Note we set the $this->result variable so we don't have to re-execute the query when we do the user update.
|
695 |
public function Is_user() {
|
725 |
}
|
726 |
}
|
727 |
|
|
|
|
|
728 |
}
|
729 |
|
730 |
// This function adds a user to the database.
|
732 |
global $wpdb, $WP_Statistics;
|
733 |
if ( ! $this->Is_user() ) {
|
734 |
|
735 |
+
// Get the pages or posts ID if it exists and we haven't set it in the visitors code.
|
736 |
+
$this->get_page_detail();
|
737 |
+
|
738 |
// Insert the user in to the database.
|
739 |
$wpdb->insert(
|
740 |
$wpdb->prefix . 'statistics_useronline',
|
748 |
'platform' => $WP_Statistics->agent['platform'],
|
749 |
'version' => $WP_Statistics->agent['version'],
|
750 |
'location' => $this->location,
|
751 |
+
'user_id' => self::get_user_id(),
|
752 |
+
'page_id' => $this->current_page_id,
|
753 |
+
'type' => $this->current_page_type
|
754 |
)
|
755 |
);
|
756 |
+
|
757 |
+
|
758 |
}
|
759 |
|
760 |
}
|
761 |
|
762 |
+
/**
|
763 |
+
* Get User ID
|
764 |
+
*/
|
765 |
+
public static function get_user_id() {
|
766 |
+
|
767 |
+
//create Empty
|
768 |
+
$user_id = 0;
|
769 |
+
|
770 |
+
//if Rest Request
|
771 |
+
if ( WP_Statistics_Rest::is_rest() ) {
|
772 |
+
if ( WP_Statistics_Rest::params( 'user_id' ) != "" ) {
|
773 |
+
$user_id = WP_Statistics_Rest::params( 'user_id' );
|
774 |
+
}
|
775 |
+
} else {
|
776 |
+
if ( is_user_logged_in() ) {
|
777 |
+
return get_current_user_id();
|
778 |
+
}
|
779 |
+
}
|
780 |
+
|
781 |
+
return $user_id;
|
782 |
+
}
|
783 |
+
|
784 |
// This function updates a user in the database.
|
785 |
public function Update_user() {
|
786 |
global $wpdb, $WP_Statistics;
|
787 |
// Make sure we found the user earlier when we called Is_user().
|
788 |
if ( $this->result ) {
|
789 |
|
790 |
+
// Get the pages or posts ID if it exists and we haven't set it in the visitors code.
|
791 |
+
$this->get_page_detail();
|
792 |
+
|
793 |
// Update the database with the new information.
|
794 |
$wpdb->update(
|
795 |
$wpdb->prefix . 'statistics_useronline',
|
797 |
'timestamp' => $this->timestamp,
|
798 |
'date' => $WP_Statistics->Current_Date(),
|
799 |
'referred' => $WP_Statistics->get_Referred(),
|
800 |
+
'user_id' => self::get_user_id(),
|
801 |
+
'page_id' => $this->current_page_id,
|
802 |
+
'type' => $this->current_page_type
|
803 |
),
|
804 |
array(
|
805 |
'ip' => $WP_Statistics->ip_hash ? $WP_Statistics->ip_hash : $WP_Statistics->ip,
|
812 |
}
|
813 |
}
|
814 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
815 |
}
|
includes/classes/class-wp-statistics-install.php
CHANGED
@@ -5,6 +5,12 @@
|
|
5 |
*/
|
6 |
class WP_Statistics_Install {
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
/**
|
9 |
* WP_Statistics_Install constructor.
|
10 |
*
|
@@ -96,6 +102,7 @@ class WP_Statistics_Install {
|
|
96 |
$create_pages_table = ( "
|
97 |
CREATE TABLE {$wpdb->prefix}statistics_pages (
|
98 |
uri varchar(255) NOT NULL,
|
|
|
99 |
date date NOT NULL,
|
100 |
count int(11) NOT NULL,
|
101 |
id int(11) NOT NULL,
|
@@ -134,22 +141,16 @@ class WP_Statistics_Install {
|
|
134 |
) CHARSET=utf8" );
|
135 |
|
136 |
// Check to see if the historical table exists yet, aka if this is a upgrade instead of a first install.
|
137 |
-
$result = $wpdb->query(
|
138 |
-
"SHOW TABLES WHERE `Tables_in_{$wpdb->dbname}` = '{$wpdb->prefix}statistics_historical'"
|
139 |
-
);
|
140 |
|
141 |
if ( $result == 1 ) {
|
142 |
// Before we update the historical table, check to see if it exists with the old keys
|
143 |
$result = $wpdb->query( "SHOW COLUMNS FROM {$wpdb->prefix}statistics_historical LIKE 'key'" );
|
144 |
|
145 |
if ( $result > 0 ) {
|
146 |
-
$wpdb->query(
|
147 |
-
"ALTER TABLE `{$wpdb->prefix}statistics_historical` CHANGE `id` `page_id` bigint(20)"
|
148 |
-
);
|
149 |
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_historical` CHANGE `key` `ID` bigint(20)" );
|
150 |
-
$wpdb->query(
|
151 |
-
"ALTER TABLE `{$wpdb->prefix}statistics_historical` CHANGE `type` `category` varchar(25)"
|
152 |
-
);
|
153 |
}
|
154 |
}
|
155 |
|
@@ -170,9 +171,7 @@ class WP_Statistics_Install {
|
|
170 |
// Some old versions (in the 5.0.x line) of MySQL have issue with the compound index on the visitor table
|
171 |
// so let's make sure it was created, if not, use the older format to create the table manually instead of
|
172 |
// using the dbDelta() call.
|
173 |
-
$result = $wpdb->query(
|
174 |
-
"SHOW TABLES WHERE `Tables_in_{$wpdb->dbname}` = '{$wpdb->prefix}statistics_visitor'"
|
175 |
-
);
|
176 |
|
177 |
if ( $result != 1 ) {
|
178 |
$wpdb->query( $create_visitor_table_old );
|
@@ -193,6 +192,19 @@ class WP_Statistics_Install {
|
|
193 |
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_visitor` DROP `AString`" );
|
194 |
}
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
// Store the new version information.
|
197 |
update_option( 'wp_statistics_plugin_version', WP_Statistics::$reg['version'] );
|
198 |
update_option( 'wp_statistics_db_version', WP_Statistics::$reg['version'] );
|
@@ -201,9 +213,7 @@ class WP_Statistics_Install {
|
|
201 |
$dbupdates = array( 'date_ip_agent' => false, 'unique_date' => false );
|
202 |
|
203 |
// Check the number of index's on the visitors table, if it's only 5 we need to check for duplicate entries and remove them
|
204 |
-
$result = $wpdb->query(
|
205 |
-
"SHOW INDEX FROM {$wpdb->prefix}statistics_visitor WHERE Key_name = 'date_ip_agent'"
|
206 |
-
);
|
207 |
|
208 |
// Note, the result will be the number of fields contained in the index, so in our case 5.
|
209 |
if ( $result != 5 ) {
|
@@ -211,9 +221,7 @@ class WP_Statistics_Install {
|
|
211 |
}
|
212 |
|
213 |
// Check the number of index's on the visits table, if it's only 5 we need to check for duplicate entries and remove them
|
214 |
-
$result = $wpdb->query(
|
215 |
-
"SHOW INDEX FROM {$wpdb->prefix}statistics_visit WHERE Key_name = 'unique_date'"
|
216 |
-
);
|
217 |
|
218 |
// Note, the result will be the number of fields contained in the index, so in our case 1.
|
219 |
if ( $result != 1 ) {
|
@@ -227,7 +235,6 @@ class WP_Statistics_Install {
|
|
227 |
if ( WP_Statistics::$installed_version == false ) {
|
228 |
|
229 |
// If this is a first time install, we just need to setup the primary values in the tables.
|
230 |
-
|
231 |
$WP_Statistics->Primary_Values();
|
232 |
|
233 |
// By default, on new installs, use the new search table.
|
@@ -236,7 +243,6 @@ class WP_Statistics_Install {
|
|
236 |
} else {
|
237 |
|
238 |
// If this is an upgrade, we need to check to see if we need to convert anything from old to new formats.
|
239 |
-
|
240 |
// Check to see if the "new" settings code is in place or not, if not, upgrade the old settings to the new system.
|
241 |
if ( get_option( 'wp_statistics' ) === false ) {
|
242 |
$core_options = array(
|
@@ -254,6 +260,7 @@ class WP_Statistics_Install {
|
|
254 |
'wps_check_online',
|
255 |
'wps_visits',
|
256 |
'wps_visitors',
|
|
|
257 |
'wps_store_ua',
|
258 |
'wps_coefficient',
|
259 |
'wps_pages',
|
@@ -308,9 +315,7 @@ class WP_Statistics_Install {
|
|
308 |
// Handle the core options, we're going to strip off the 'wps_' header as we store them in the new settings array.
|
309 |
foreach ( $core_options as $option ) {
|
310 |
$new_name = substr( $option, 4 );
|
311 |
-
|
312 |
$WP_Statistics->store_option( $new_name, get_option( $option ) );
|
313 |
-
|
314 |
delete_option( $option );
|
315 |
}
|
316 |
|
@@ -327,15 +332,11 @@ class WP_Statistics_Install {
|
|
327 |
|
328 |
foreach ( $var_options as $option ) {
|
329 |
// Handle the special variables options.
|
330 |
-
$result = $wpdb->get_results(
|
331 |
-
"SELECT * FROM {$wpdb->prefix}options WHERE option_name LIKE '{$option}'"
|
332 |
-
);
|
333 |
|
334 |
foreach ( $result as $opt ) {
|
335 |
$new_name = substr( $opt->option_name, 4 );
|
336 |
-
|
337 |
$WP_Statistics->store_option( $new_name, $opt->option_value );
|
338 |
-
|
339 |
delete_option( $opt->option_name );
|
340 |
}
|
341 |
}
|
@@ -392,35 +393,6 @@ class WP_Statistics_Install {
|
|
392 |
$WP_Statistics->store_option( 'force_robot_update', true );
|
393 |
}
|
394 |
|
395 |
-
// For version 8.0, we're removing the old %option% types from the reports, so let's upgrade anyone who still has them to short codes.
|
396 |
-
$report_content = $WP_Statistics->get_option( 'content_report' );
|
397 |
-
|
398 |
-
// Check to make sure we have a report to process.
|
399 |
-
if ( trim( $report_content ) == '' ) {
|
400 |
-
// These are the variables we can replace in the template and the short codes we're going to replace them with.
|
401 |
-
$template_vars = array(
|
402 |
-
'user_online' => '[wpstatistics stat=usersonline]',
|
403 |
-
'today_visitor' => '[wpstatistics stat=visitors time=today]',
|
404 |
-
'today_visit' => '[wpstatistics stat=visits time=today]',
|
405 |
-
'yesterday_visitor' => '[wpstatistics stat=visitors time=yesterday]',
|
406 |
-
'yesterday_visit' => '[wpstatistics stat=visits time=yesterday]',
|
407 |
-
'total_visitor' => '[wpstatistics stat=visitors time=total]',
|
408 |
-
'total_visit' => '[wpstatistics stat=visits time=total]',
|
409 |
-
);
|
410 |
-
|
411 |
-
// Replace the items in the template.
|
412 |
-
$final_report = preg_replace_callback(
|
413 |
-
'/%(.*?)%/im',
|
414 |
-
function ( $m ) {
|
415 |
-
return $template_vars[ $m[1] ];
|
416 |
-
},
|
417 |
-
$report_content
|
418 |
-
);
|
419 |
-
|
420 |
-
// Store the updated report content.
|
421 |
-
$WP_Statistics->store_option( 'content_report', $final_report );
|
422 |
-
}
|
423 |
-
|
424 |
// Save the settings now that we've set them.
|
425 |
$WP_Statistics->save_options();
|
426 |
|
@@ -450,4 +422,34 @@ class WP_Statistics_Install {
|
|
450 |
}
|
451 |
}
|
452 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
}
|
5 |
*/
|
6 |
class WP_Statistics_Install {
|
7 |
|
8 |
+
/**
|
9 |
+
* List Of wp-statistics Mysql Table
|
10 |
+
* @var array
|
11 |
+
*/
|
12 |
+
public static $db_table = array( 'useronline', 'visit', 'visitor', 'exclusions', 'pages', 'search', 'historical', 'visitor_relationships' );
|
13 |
+
|
14 |
/**
|
15 |
* WP_Statistics_Install constructor.
|
16 |
*
|
102 |
$create_pages_table = ( "
|
103 |
CREATE TABLE {$wpdb->prefix}statistics_pages (
|
104 |
uri varchar(255) NOT NULL,
|
105 |
+
type varchar(255) NOT NULL,
|
106 |
date date NOT NULL,
|
107 |
count int(11) NOT NULL,
|
108 |
id int(11) NOT NULL,
|
141 |
) CHARSET=utf8" );
|
142 |
|
143 |
// Check to see if the historical table exists yet, aka if this is a upgrade instead of a first install.
|
144 |
+
$result = $wpdb->query( "SHOW TABLES WHERE `Tables_in_{$wpdb->dbname}` = '{$wpdb->prefix}statistics_historical'" );
|
|
|
|
|
145 |
|
146 |
if ( $result == 1 ) {
|
147 |
// Before we update the historical table, check to see if it exists with the old keys
|
148 |
$result = $wpdb->query( "SHOW COLUMNS FROM {$wpdb->prefix}statistics_historical LIKE 'key'" );
|
149 |
|
150 |
if ( $result > 0 ) {
|
151 |
+
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_historical` CHANGE `id` `page_id` bigint(20)" );
|
|
|
|
|
152 |
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_historical` CHANGE `key` `ID` bigint(20)" );
|
153 |
+
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_historical` CHANGE `type` `category` varchar(25)" );
|
|
|
|
|
154 |
}
|
155 |
}
|
156 |
|
171 |
// Some old versions (in the 5.0.x line) of MySQL have issue with the compound index on the visitor table
|
172 |
// so let's make sure it was created, if not, use the older format to create the table manually instead of
|
173 |
// using the dbDelta() call.
|
174 |
+
$result = $wpdb->query( "SHOW TABLES WHERE `Tables_in_{$wpdb->dbname}` = '{$wpdb->prefix}statistics_visitor'" );
|
|
|
|
|
175 |
|
176 |
if ( $result != 1 ) {
|
177 |
$wpdb->query( $create_visitor_table_old );
|
192 |
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_visitor` DROP `AString`" );
|
193 |
}
|
194 |
|
195 |
+
//Added page_id column in statistics_pages if not exist
|
196 |
+
$result = $wpdb->query( "SHOW COLUMNS FROM {$wpdb->prefix}statistics_pages LIKE 'page_id'" );
|
197 |
+
if ( $result == 0 ) {
|
198 |
+
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_pages` ADD `page_id` BIGINT(20) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`page_id`);" );
|
199 |
+
}
|
200 |
+
|
201 |
+
//Added User_id and Page_id in user online table
|
202 |
+
$result = $wpdb->query( "SHOW COLUMNS FROM {$wpdb->prefix}statistics_useronline LIKE 'user_id'" );
|
203 |
+
if ( $result == 0 ) {
|
204 |
+
$wpdb->query( "ALTER TABLE `{$wpdb->prefix}statistics_useronline` ADD `user_id` BIGINT(48) NOT NULL AFTER `location`, ADD `page_id` BIGINT(48) NOT NULL AFTER `user_id`, ADD `type` VARCHAR(100) NOT NULL AFTER `page_id`;" );
|
205 |
+
$wpdb->query( "DELETE FROM `{$wpdb->prefix}usermeta` WHERE `meta_key` = 'meta-box-order_toplevel_page_wps_overview_page';" );
|
206 |
+
}
|
207 |
+
|
208 |
// Store the new version information.
|
209 |
update_option( 'wp_statistics_plugin_version', WP_Statistics::$reg['version'] );
|
210 |
update_option( 'wp_statistics_db_version', WP_Statistics::$reg['version'] );
|
213 |
$dbupdates = array( 'date_ip_agent' => false, 'unique_date' => false );
|
214 |
|
215 |
// Check the number of index's on the visitors table, if it's only 5 we need to check for duplicate entries and remove them
|
216 |
+
$result = $wpdb->query( "SHOW INDEX FROM {$wpdb->prefix}statistics_visitor WHERE Key_name = 'date_ip_agent'" );
|
|
|
|
|
217 |
|
218 |
// Note, the result will be the number of fields contained in the index, so in our case 5.
|
219 |
if ( $result != 5 ) {
|
221 |
}
|
222 |
|
223 |
// Check the number of index's on the visits table, if it's only 5 we need to check for duplicate entries and remove them
|
224 |
+
$result = $wpdb->query( "SHOW INDEX FROM {$wpdb->prefix}statistics_visit WHERE Key_name = 'unique_date'" );
|
|
|
|
|
225 |
|
226 |
// Note, the result will be the number of fields contained in the index, so in our case 1.
|
227 |
if ( $result != 1 ) {
|
235 |
if ( WP_Statistics::$installed_version == false ) {
|
236 |
|
237 |
// If this is a first time install, we just need to setup the primary values in the tables.
|
|
|
238 |
$WP_Statistics->Primary_Values();
|
239 |
|
240 |
// By default, on new installs, use the new search table.
|
243 |
} else {
|
244 |
|
245 |
// If this is an upgrade, we need to check to see if we need to convert anything from old to new formats.
|
|
|
246 |
// Check to see if the "new" settings code is in place or not, if not, upgrade the old settings to the new system.
|
247 |
if ( get_option( 'wp_statistics' ) === false ) {
|
248 |
$core_options = array(
|
260 |
'wps_check_online',
|
261 |
'wps_visits',
|
262 |
'wps_visitors',
|
263 |
+
'wps_visitors_log',
|
264 |
'wps_store_ua',
|
265 |
'wps_coefficient',
|
266 |
'wps_pages',
|
315 |
// Handle the core options, we're going to strip off the 'wps_' header as we store them in the new settings array.
|
316 |
foreach ( $core_options as $option ) {
|
317 |
$new_name = substr( $option, 4 );
|
|
|
318 |
$WP_Statistics->store_option( $new_name, get_option( $option ) );
|
|
|
319 |
delete_option( $option );
|
320 |
}
|
321 |
|
332 |
|
333 |
foreach ( $var_options as $option ) {
|
334 |
// Handle the special variables options.
|
335 |
+
$result = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_name LIKE '{$option}'" );
|
|
|
|
|
336 |
|
337 |
foreach ( $result as $opt ) {
|
338 |
$new_name = substr( $opt->option_name, 4 );
|
|
|
339 |
$WP_Statistics->store_option( $new_name, $opt->option_value );
|
|
|
340 |
delete_option( $opt->option_name );
|
341 |
}
|
342 |
}
|
393 |
$WP_Statistics->store_option( 'force_robot_update', true );
|
394 |
}
|
395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
// Save the settings now that we've set them.
|
397 |
$WP_Statistics->save_options();
|
398 |
|
422 |
}
|
423 |
}
|
424 |
}
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Setup Visitor RelationShip Table
|
428 |
+
*/
|
429 |
+
public static function setup_visitor_relationship_table() {
|
430 |
+
global $wpdb;
|
431 |
+
|
432 |
+
$table_name = $wpdb->prefix . 'statistics_visitor_relationships';
|
433 |
+
if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) != $table_name ) {
|
434 |
+
|
435 |
+
// This includes the dbDelta function from WordPress.
|
436 |
+
if ( ! function_exists( 'dbDelta' ) ) {
|
437 |
+
require( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
438 |
+
}
|
439 |
+
|
440 |
+
$create_visitor_relationships_table =
|
441 |
+
"CREATE TABLE IF NOT EXISTS $table_name (
|
442 |
+
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
|
443 |
+
`visitor_id` bigint(20) NOT NULL,
|
444 |
+
`page_id` bigint(20) NOT NULL,
|
445 |
+
`date` datetime NOT NULL,
|
446 |
+
PRIMARY KEY (ID),
|
447 |
+
KEY visitor_id (visitor_id),
|
448 |
+
KEY page_id (page_id)
|
449 |
+
) ENGINE=MyISAM DEFAULT CHARSET=utf8";
|
450 |
+
|
451 |
+
dbDelta( $create_visitor_relationships_table );
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
}
|
includes/classes/class-wp-statistics-network-admin.php
CHANGED
@@ -12,46 +12,21 @@ class WP_Statistics_Network_Admin {
|
|
12 |
global $WP_Statistics;
|
13 |
|
14 |
// Get the read/write capabilities required to view/manage the plugin as set by the user.
|
15 |
-
$read_cap = wp_statistics_validate_capability(
|
16 |
-
|
17 |
-
);
|
18 |
-
$manage_cap = wp_statistics_validate_capability(
|
19 |
-
$WP_Statistics->get_option( 'manage_capability', 'manage_options' )
|
20 |
-
);
|
21 |
|
22 |
// Add the top level menu.
|
23 |
-
add_menu_page(
|
24 |
-
__( 'Statistics', 'wp-statistics' ),
|
25 |
-
__( 'Statistics', 'wp-statistics' ),
|
26 |
-
$read_cap,
|
27 |
-
WP_Statistics::$reg['main-file'],
|
28 |
-
'WP_Statistics_Network_Admin::overview',
|
29 |
-
'dashicons-chart-pie'
|
30 |
-
);
|
31 |
|
32 |
// Add the sub items.
|
33 |
-
add_submenu_page(
|
34 |
-
WP_Statistics::$reg['main-file'],
|
35 |
-
__( 'Overview', 'wp-statistics' ),
|
36 |
-
__( 'Overview', 'wp-statistics' ),
|
37 |
-
$read_cap,
|
38 |
-
WP_Statistics::$reg['main-file'],
|
39 |
-
'WP_Statistics_Network_Admin::overview'
|
40 |
-
);
|
41 |
|
42 |
$count = 0;
|
43 |
$sites = $WP_Statistics->get_wp_sites_list();
|
44 |
|
45 |
foreach ( $sites as $blog_id ) {
|
46 |
$details = get_blog_details( $blog_id );
|
47 |
-
add_submenu_page(
|
48 |
-
WP_Statistics::$reg['main-file'],
|
49 |
-
$details->blogname,
|
50 |
-
$details->blogname,
|
51 |
-
$manage_cap,
|
52 |
-
'wp_statistics_blogid_' . $blog_id,
|
53 |
-
'WP_Statistics_Network_Admin::goto_blog'
|
54 |
-
);
|
55 |
|
56 |
$count ++;
|
57 |
if ( $count > 15 ) {
|
@@ -66,9 +41,8 @@ class WP_Statistics_Network_Admin {
|
|
66 |
static function overview() {
|
67 |
global $WP_Statistics;
|
68 |
?>
|
69 |
-
<div id="wrap">
|
70 |
<br/>
|
71 |
-
|
72 |
<table class="widefat wp-list-table" style="width: auto;">
|
73 |
<thead>
|
74 |
<tr>
|
@@ -76,7 +50,6 @@ class WP_Statistics_Network_Admin {
|
|
76 |
<th style='text-align: left'><?php _e( 'Options', 'wp-statistics' ); ?></th>
|
77 |
</tr>
|
78 |
</thead>
|
79 |
-
|
80 |
<tbody>
|
81 |
<?php
|
82 |
$i = 0;
|
@@ -87,7 +60,6 @@ class WP_Statistics_Network_Admin {
|
|
87 |
__( 'Online', 'wp-statistics' ) => WP_Statistics::$page['online'],
|
88 |
__( 'Referrers', 'wp-statistics' ) => WP_Statistics::$page['referrers'],
|
89 |
__( 'Search Words', 'wp-statistics' ) => WP_Statistics::$page['words'],
|
90 |
-
__( 'Top Search Words', 'wp-statistics' ) => WP_Statistics::$page['searched-phrases'],
|
91 |
__( 'Searches', 'wp-statistics' ) => WP_Statistics::$page['searches'],
|
92 |
__( 'Pages', 'wp-statistics' ) => WP_Statistics::$page['pages'],
|
93 |
__( 'Visitors', 'wp-statistics' ) => WP_Statistics::$page['visitors'],
|
@@ -147,12 +119,8 @@ class WP_Statistics_Network_Admin {
|
|
147 |
global $plugin_page;
|
148 |
|
149 |
$blog_id = str_replace( 'wp_statistics_blogid_', '', $plugin_page );
|
150 |
-
|
151 |
-
$details = get_blog_details( $blog_id );
|
152 |
-
|
153 |
// Get the admin url for the current site.
|
154 |
$url = get_admin_url( $blog_id ) . '/admin.php?page=' . WP_Statistics::$page['overview'];
|
155 |
-
|
156 |
echo "<script>window.location.href = '$url';</script>";
|
157 |
}
|
158 |
|
12 |
global $WP_Statistics;
|
13 |
|
14 |
// Get the read/write capabilities required to view/manage the plugin as set by the user.
|
15 |
+
$read_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_options' ) );
|
16 |
+
$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) );
|
|
|
|
|
|
|
|
|
17 |
|
18 |
// Add the top level menu.
|
19 |
+
add_menu_page( __( 'Statistics', 'wp-statistics' ), __( 'Statistics', 'wp-statistics' ), $read_cap, WP_Statistics::$reg['main-file'], 'WP_Statistics_Network_Admin::overview', 'dashicons-chart-pie' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
// Add the sub items.
|
22 |
+
add_submenu_page( WP_Statistics::$reg['main-file'], __( 'Overview', 'wp-statistics' ), __( 'Overview', 'wp-statistics' ), $read_cap, WP_Statistics::$reg['main-file'], 'WP_Statistics_Network_Admin::overview' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
$count = 0;
|
25 |
$sites = $WP_Statistics->get_wp_sites_list();
|
26 |
|
27 |
foreach ( $sites as $blog_id ) {
|
28 |
$details = get_blog_details( $blog_id );
|
29 |
+
add_submenu_page( WP_Statistics::$reg['main-file'], $details->blogname, $details->blogname, $manage_cap, 'wp_statistics_blogid_' . $blog_id, 'WP_Statistics_Network_Admin::goto_blog' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
$count ++;
|
32 |
if ( $count > 15 ) {
|
41 |
static function overview() {
|
42 |
global $WP_Statistics;
|
43 |
?>
|
44 |
+
<div id="wrap wps-wrap">
|
45 |
<br/>
|
|
|
46 |
<table class="widefat wp-list-table" style="width: auto;">
|
47 |
<thead>
|
48 |
<tr>
|
50 |
<th style='text-align: left'><?php _e( 'Options', 'wp-statistics' ); ?></th>
|
51 |
</tr>
|
52 |
</thead>
|
|
|
53 |
<tbody>
|
54 |
<?php
|
55 |
$i = 0;
|
60 |
__( 'Online', 'wp-statistics' ) => WP_Statistics::$page['online'],
|
61 |
__( 'Referrers', 'wp-statistics' ) => WP_Statistics::$page['referrers'],
|
62 |
__( 'Search Words', 'wp-statistics' ) => WP_Statistics::$page['words'],
|
|
|
63 |
__( 'Searches', 'wp-statistics' ) => WP_Statistics::$page['searches'],
|
64 |
__( 'Pages', 'wp-statistics' ) => WP_Statistics::$page['pages'],
|
65 |
__( 'Visitors', 'wp-statistics' ) => WP_Statistics::$page['visitors'],
|
119 |
global $plugin_page;
|
120 |
|
121 |
$blog_id = str_replace( 'wp_statistics_blogid_', '', $plugin_page );
|
|
|
|
|
|
|
122 |
// Get the admin url for the current site.
|
123 |
$url = get_admin_url( $blog_id ) . '/admin.php?page=' . WP_Statistics::$page['overview'];
|
|
|
124 |
echo "<script>window.location.href = '$url';</script>";
|
125 |
}
|
126 |
|
includes/classes/class-wp-statistics-pagination.php
DELETED
@@ -1,667 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Pagination Class
|
4 |
-
*
|
5 |
-
* This class displays a pagination navigation bar complete with links to first, last,
|
6 |
-
* previous, next, and all pages. This class handles cookie setting, page bounds checking/
|
7 |
-
* redirection, appropriate error reporting, CSS styling, and POST/GET retrieval all
|
8 |
-
* internally.
|
9 |
-
*
|
10 |
-
* PHP version 5
|
11 |
-
*
|
12 |
-
* @author Dane Gardow <dane.g87@gmail.com>
|
13 |
-
* @copyright 2013 Dane Gardow
|
14 |
-
* @date 01 January 2013
|
15 |
-
* @version 1.0
|
16 |
-
* @license Free
|
17 |
-
*
|
18 |
-
******************************************************************************************/
|
19 |
-
|
20 |
-
if ( ! class_exists( "WP_Statistics_Pagination" ) ): // Prevent multiple class definitions
|
21 |
-
|
22 |
-
class WP_Statistics_Pagination {
|
23 |
-
/*******************************************************
|
24 |
-
* PROPERTIES / DATA MEMBERS
|
25 |
-
*******************************************************/
|
26 |
-
|
27 |
-
// Edit these as you desire
|
28 |
-
const DEFAULT_ENTRIES_DISPLAY = 10; // Default number of entries to display per page
|
29 |
-
const PAGE_GETVAR_NAME = "page"; // Name of GET variable name for page values (i.e., example.php?page=1)
|
30 |
-
|
31 |
-
private $_paginationID = "pagination"; // ID Name of pagination object "pagination" is default
|
32 |
-
// used also for form name for select options
|
33 |
-
|
34 |
-
// Do not edit these values; they are simply null initializations
|
35 |
-
private $_totalEntries = null; // Total number of entries (usually supplied by MySQL query)
|
36 |
-
private $_pagesPerSection = null; // Total number of pages displayed per section (supplied by admin)
|
37 |
-
private $_entriesPerPage = null; // Total number of entries displayed per page (supplied by user)
|
38 |
-
private $_currentPage = null; // Current page viewed by user
|
39 |
-
private $_displayOptions = array(); // Array of options for viewing how many entries per page (supplied by user)
|
40 |
-
private $_errors = array(); // Array of encountered error messages
|
41 |
-
private $_styles = array(); // Array of CSS styles for pagination navigation display
|
42 |
-
|
43 |
-
|
44 |
-
/*******************************************************
|
45 |
-
* CONSTRUCTOR
|
46 |
-
*******************************************************/
|
47 |
-
|
48 |
-
function __construct(
|
49 |
-
$totalEntries,
|
50 |
-
$pagesPerSection,
|
51 |
-
$options = "",
|
52 |
-
$paginationID = "",
|
53 |
-
$stylePageOff = "",
|
54 |
-
$stylePageOn = "",
|
55 |
-
$styleErrors = "",
|
56 |
-
$styleSelect = ""
|
57 |
-
) {
|
58 |
-
$this->setPaginationID( $paginationID ); // Set ID name of pagination object
|
59 |
-
$this->setTotalEntries( $totalEntries ); // Set total entries
|
60 |
-
$this->setPagesPerSection( $pagesPerSection ); // Set pages per section
|
61 |
-
$this->setDisplayOptions( $options ); // Set viewing display options
|
62 |
-
$this->setEntriesPerPage(); // Set entries per page (input from POST or cookies)
|
63 |
-
$this->setCurrentPage(); // Set current page (input from GET)
|
64 |
-
// ! This function must follow after setEntriesPerPage()
|
65 |
-
$this->setStyles(
|
66 |
-
$stylePageOff,
|
67 |
-
$stylePageOn,
|
68 |
-
$styleSelect,
|
69 |
-
$styleErrors
|
70 |
-
); // Set CSS styles for pagination navigation display
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
/*******************************************************
|
75 |
-
* UTILITY FUNCTIONS
|
76 |
-
*******************************************************/
|
77 |
-
|
78 |
-
public function deleteCookie() // deletes the cookie if it exists
|
79 |
-
{
|
80 |
-
$cookieVar = $this->_getPOSTVarName();
|
81 |
-
|
82 |
-
if ( isset( $_COOKIE[ $cookieVar ] ) ) // If cookie is set
|
83 |
-
{
|
84 |
-
$_COOKIE[ $cookieVar ] = ""; // Clear cookie
|
85 |
-
setcookie( $cookieVar, "", time() - 3600, "/" ); // Delete cookie
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
private function _getURL( $input = 1
|
90 |
-
) // returns appropriate URL with all GET variables intact
|
91 |
-
{ // updates only the particular GET variable in question
|
92 |
-
$getVars = $_GET; // Get all GET variables
|
93 |
-
|
94 |
-
/* Uncomment this if you need to exclude any GET variables (due to HTACCESS issues, for example) from being
|
95 |
-
* processed in the ensuing URL. Simply enter in the GET variable name in the unset(...) function below.
|
96 |
-
unset($getVars["foo"], $getVars["bar"], ... ); // Remove any so they do not appear in URL
|
97 |
-
*/
|
98 |
-
|
99 |
-
$output = '?' . http_build_query( array_merge( $getVars, array( $this->_getIDGETVarName() => $input ) ) );
|
100 |
-
$output .= '#' . $this->getPaginationID(); // Add #xxx at the end of URL for auto-scrolling
|
101 |
-
|
102 |
-
return $output;
|
103 |
-
}
|
104 |
-
|
105 |
-
private function _isError() // determines if an error exists and registers any errors
|
106 |
-
{
|
107 |
-
if ( $this->_errors ) // If error already exists, return
|
108 |
-
{
|
109 |
-
return true;
|
110 |
-
}
|
111 |
-
|
112 |
-
if ( ! $this->_totalEntries ) // If total entries not set
|
113 |
-
{
|
114 |
-
$this->_errors[] = "The value for <strong>total entries</strong> has not been specified.";
|
115 |
-
}
|
116 |
-
|
117 |
-
if ( ! $this->_displayOptions ) // If display options not set
|
118 |
-
{
|
119 |
-
$this->_errors[] = "The values for <strong>display options</strong> have not been specified.";
|
120 |
-
}
|
121 |
-
|
122 |
-
if ( ! $this->_entriesPerPage ) // If entries per page not set
|
123 |
-
{
|
124 |
-
$this->_errors[] = "The value for <strong>entries per page</strong> has not been specified.";
|
125 |
-
}
|
126 |
-
|
127 |
-
if ( ! $this->_currentPage ) // If current page not set
|
128 |
-
{
|
129 |
-
$this->_errors[] = "The value for <strong>current page</strong> has not been specified.";
|
130 |
-
}
|
131 |
-
|
132 |
-
return ( $this->_errors ) ? true : false;
|
133 |
-
}
|
134 |
-
|
135 |
-
private function _validEntry( $input ) // determines if input is valid
|
136 |
-
{
|
137 |
-
if ( is_array( $input ) ) // If array
|
138 |
-
{
|
139 |
-
foreach ( $input as $element ) { // Recursion: evaluate each array element
|
140 |
-
if ( ! $this->_validEntry( $element ) ) // If invalid
|
141 |
-
{
|
142 |
-
return false;
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
return true; // If function makes it to this point, it is valid
|
147 |
-
} else // If not array
|
148 |
-
{
|
149 |
-
if ( ( preg_match( "/^\d+$/", $input ) && $input > 0 ) ||
|
150 |
-
strtolower( $input ) == "all"
|
151 |
-
) // If positive digit or "all"
|
152 |
-
{
|
153 |
-
return true;
|
154 |
-
} else {
|
155 |
-
return false;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
|
160 |
-
private function _navBox(
|
161 |
-
$text,
|
162 |
-
$destinationPage,
|
163 |
-
$end = 0
|
164 |
-
) // returns span-encased link for pagination bar
|
165 |
-
{
|
166 |
-
switch ( $end ) {
|
167 |
-
case 1:
|
168 |
-
$title = "First page";
|
169 |
-
break;
|
170 |
-
case 2:
|
171 |
-
$title = "Previous page";
|
172 |
-
break;
|
173 |
-
case 3:
|
174 |
-
$title = "Next page";
|
175 |
-
break;
|
176 |
-
case 4:
|
177 |
-
$title = "Last page (" . $this->getTotalPages() . ")";
|
178 |
-
break;
|
179 |
-
default:
|
180 |
-
$title = "";
|
181 |
-
break;
|
182 |
-
}
|
183 |
-
|
184 |
-
$title = ( $end > 0 && $title != "" ) ? 'title="' . $title . '"' : '';
|
185 |
-
|
186 |
-
$style = $this->_styles["pageOff"];
|
187 |
-
|
188 |
-
// Determine Style
|
189 |
-
$style = ( $this->_currentPage == $destinationPage && ! $end ) ? $this->_styles["pageOn"]
|
190 |
-
: $this->_styles["pageOff"];
|
191 |
-
|
192 |
-
// Determine Link URL/Text
|
193 |
-
$url = "";
|
194 |
-
|
195 |
-
if ( $this->_currentPage != $destinationPage // If current page is not same as destination page
|
196 |
-
&& $destinationPage <= $this->getTotalPages() // and destination page does not exceed last page
|
197 |
-
&& $destinationPage >= 1
|
198 |
-
) // and destination page is not less than first page
|
199 |
-
{
|
200 |
-
$text = '<a href="' .
|
201 |
-
$this->_getURL( $destinationPage ) .
|
202 |
-
'">' .
|
203 |
-
$text .
|
204 |
-
'</a>'; // then make $text a link
|
205 |
-
}
|
206 |
-
|
207 |
-
if ( $style ) {
|
208 |
-
$style = 'class="' . $style . '"';
|
209 |
-
}
|
210 |
-
|
211 |
-
$onClick = ( $url ) ? "onclick=\"location.href='" . $url . "'\""
|
212 |
-
: ""; // Determine if span element is clickable
|
213 |
-
|
214 |
-
return '<span ' . $style . $title . ' ' . $onClick . '>' . $text . '</span>';
|
215 |
-
}
|
216 |
-
|
217 |
-
|
218 |
-
/*******************************************************
|
219 |
-
* DISPLAY FUNCTIONS
|
220 |
-
*******************************************************/
|
221 |
-
|
222 |
-
public function display() // displays the pagination bar
|
223 |
-
{
|
224 |
-
if ( $this->_isError() ) // If error encountered, do not display, but display errors
|
225 |
-
{
|
226 |
-
return $this->displayErrors();
|
227 |
-
}
|
228 |
-
|
229 |
-
$firstPage = 1;
|
230 |
-
$previousPage = $this->_currentPage - 1;
|
231 |
-
$nextPage = $this->_currentPage + 1;
|
232 |
-
$lastPage = $this->getTotalPages();
|
233 |
-
|
234 |
-
$totalpages = $this->getTotalPages();
|
235 |
-
|
236 |
-
$pagesPerSection = $this->getPagesPerSection();
|
237 |
-
|
238 |
-
$sectionStart = $this->_currentPage -
|
239 |
-
floor(
|
240 |
-
$pagesPerSection / 2
|
241 |
-
); // Section start is current page # minus half the # of pages per section
|
242 |
-
|
243 |
-
if ( $sectionStart <=
|
244 |
-
0
|
245 |
-
) // Adjust section start to 1 (first page) if # pages between 1st page
|
246 |
-
{
|
247 |
-
$sectionStart = 1;
|
248 |
-
} // and current page is less than half the # of pages per section
|
249 |
-
|
250 |
-
$sectionEnd = $sectionStart +
|
251 |
-
$pagesPerSection -
|
252 |
-
1; // Section end is # pages per section after section start,
|
253 |
-
// minus 1 (otherwise # of pages per section will exceed given amount by 1)
|
254 |
-
|
255 |
-
if ( $sectionEnd >
|
256 |
-
$lastPage
|
257 |
-
) // Adjust section end to last page if section end exceeds last page
|
258 |
-
{
|
259 |
-
$sectionEnd = $lastPage;
|
260 |
-
}
|
261 |
-
|
262 |
-
$sectionStart = $sectionEnd -
|
263 |
-
$pagesPerSection +
|
264 |
-
1; // Adjust section start to # of pages behind section end
|
265 |
-
|
266 |
-
$output = $this->_navBox( "<<", $firstPage, 1 ); // First page
|
267 |
-
$output .= $this->_navBox( "<", $previousPage, 2 ); // Previous page
|
268 |
-
|
269 |
-
for ( $i = $sectionStart; $i <= $sectionEnd; ++ $i ) {
|
270 |
-
$output .= $this->_navBox( $i, $i );
|
271 |
-
} // Pagination
|
272 |
-
|
273 |
-
$output .= $this->_navBox( ">", $nextPage, 3 ); // Next Page
|
274 |
-
$output .= $this->_navBox( ">>", $lastPage, 4 ); // Last Page
|
275 |
-
|
276 |
-
return $output;
|
277 |
-
}
|
278 |
-
|
279 |
-
public function displayErrors() // displays the errors encountered
|
280 |
-
{
|
281 |
-
if ( ! $this->_errors ) {
|
282 |
-
return "No errors were encountered.";
|
283 |
-
}
|
284 |
-
|
285 |
-
$words = ( count( $this->_errors ) > 1 ) ? "errors were" : "error was";
|
286 |
-
|
287 |
-
// Determine CSS styling for error reporting
|
288 |
-
if ( $this->_styles["errors"] ) {
|
289 |
-
$css = 'class="' . $this->_styles["errors"] . '"';
|
290 |
-
} else {
|
291 |
-
$css = '';
|
292 |
-
}
|
293 |
-
|
294 |
-
$output
|
295 |
-
= '
|
296 |
-
<div ' . $css . '>
|
297 |
-
The following ' . $words . ' encountered while using the ' . get_class( $this ) . ' class:<br/><br/>
|
298 |
-
<ul>';
|
299 |
-
|
300 |
-
foreach ( $this->_errors as $error ) {
|
301 |
-
$output .= '<li>' . $error . '</li>';
|
302 |
-
}
|
303 |
-
|
304 |
-
$output
|
305 |
-
.= '
|
306 |
-
</ul>
|
307 |
-
</div>';
|
308 |
-
|
309 |
-
return $output;
|
310 |
-
}
|
311 |
-
|
312 |
-
public function displaySelectInterface() // displays the <select> interface for choosing display amount
|
313 |
-
{
|
314 |
-
if ( count( $this->_displayOptions ) < 2 ) // If only 1 or fewer options, do not display
|
315 |
-
{
|
316 |
-
return;
|
317 |
-
}
|
318 |
-
|
319 |
-
if ( $this->_isError() ) // If error encountered, do not display
|
320 |
-
{
|
321 |
-
return;
|
322 |
-
}
|
323 |
-
|
324 |
-
static $count = 0; // This counts how many times function is run.
|
325 |
-
// This variable value is tacked on the end of the form name which
|
326 |
-
// will enable multiple instances of the display interface form
|
327 |
-
|
328 |
-
$paginationID = $this->getPaginationID();
|
329 |
-
|
330 |
-
$formName = $paginationID . '_select_form';
|
331 |
-
|
332 |
-
// Determine CSS styling for <select>
|
333 |
-
if ( $this->_styles["select"] ) {
|
334 |
-
$css = 'class="' . $this->_styles["select"] . '"';
|
335 |
-
} else {
|
336 |
-
$css = "";
|
337 |
-
}
|
338 |
-
|
339 |
-
$formNumber = ( $count ) ? $count : "";
|
340 |
-
|
341 |
-
$output
|
342 |
-
= '
|
343 |
-
<form name="' .
|
344 |
-
$formName .
|
345 |
-
$formNumber .
|
346 |
-
'" method="post" style="display:inline-block;" action="' .
|
347 |
-
$this->_getURL( $this->_currentPage ) .
|
348 |
-
'">
|
349 |
-
Show:
|
350 |
-
<select ' .
|
351 |
-
$css .
|
352 |
-
' name="' .
|
353 |
-
$this->_getPOSTVarName() .
|
354 |
-
'" OnChange ="' .
|
355 |
-
$formName .
|
356 |
-
$formNumber .
|
357 |
-
'.submit()">';
|
358 |
-
|
359 |
-
foreach ( $this->_displayOptions as $line ) {
|
360 |
-
if ( $this->_entriesPerPage == $line ||
|
361 |
-
$this->_entriesPerPage == $this->_totalEntries
|
362 |
-
) // If option equals entries per page
|
363 |
-
{
|
364 |
-
$selected = "selected";
|
365 |
-
} // or entries per page equals total entries
|
366 |
-
else // then select option, otherwise
|
367 |
-
{
|
368 |
-
$selected = "";
|
369 |
-
} // leave unselected
|
370 |
-
|
371 |
-
$output .= '<option value="' . $line . '" ' . $selected . '>' . $line . '</option>';
|
372 |
-
}
|
373 |
-
|
374 |
-
$output
|
375 |
-
.= '
|
376 |
-
</select>
|
377 |
-
<noscript><input type="submit" name="paginationDisplaySubmit" value="Display"/></noscript>
|
378 |
-
</form>';
|
379 |
-
|
380 |
-
++ $count; // Increase # of times this function has run
|
381 |
-
|
382 |
-
return $output;
|
383 |
-
}
|
384 |
-
|
385 |
-
|
386 |
-
/*******************************************************
|
387 |
-
* SET FUNCTIONS
|
388 |
-
*******************************************************/
|
389 |
-
|
390 |
-
public function setCurrentPage() // sets the currently accessed page from GET value
|
391 |
-
{
|
392 |
-
$idVar = $this->_getIDGETVarName();
|
393 |
-
|
394 |
-
if ( isset( $_GET[ $idVar ] ) ) // If GET set
|
395 |
-
{
|
396 |
-
$page = $_GET[ $idVar ];
|
397 |
-
} // Retrieve page from GET
|
398 |
-
else {
|
399 |
-
$page = 1;
|
400 |
-
} // Otherwise use first page
|
401 |
-
|
402 |
-
if ( $page < 1 ||
|
403 |
-
! preg_match( "/^\d+$/", $page )
|
404 |
-
) // If page is less than 1 or page value not a digit
|
405 |
-
{
|
406 |
-
header( "Location: " . $this->_getURL() ); // No argument for _getURL() sets it to 1 (first page)
|
407 |
-
exit;
|
408 |
-
}
|
409 |
-
|
410 |
-
if ( $page > $this->getTotalPages() && $this->getTotalPages() != 0 ) // If page exceeds last page
|
411 |
-
{ // 2nd condition prevents infinite loop should it equal 0
|
412 |
-
header( "Location: " . $this->_getURL( $this->getTotalPages() ) );
|
413 |
-
exit;
|
414 |
-
}
|
415 |
-
|
416 |
-
$this->_currentPage = $page;
|
417 |
-
}
|
418 |
-
|
419 |
-
public function setDisplayOptions( $input ) // sets the user-specified display amount
|
420 |
-
{
|
421 |
-
if ( ! $this->_validEntry(
|
422 |
-
$input
|
423 |
-
)
|
424 |
-
) // If invalid entry encountered, register error and exit function
|
425 |
-
{
|
426 |
-
if ( is_array( $input ) ) // If array
|
427 |
-
{
|
428 |
-
$argument = "";
|
429 |
-
|
430 |
-
foreach ( $input as $key => $element ) {
|
431 |
-
if ( $key > 0 ) {
|
432 |
-
$argument .= ", ";
|
433 |
-
}
|
434 |
-
|
435 |
-
$argument .= $element; // Save all elements in string
|
436 |
-
}
|
437 |
-
} else // If not array
|
438 |
-
{
|
439 |
-
$argument = $input;
|
440 |
-
}
|
441 |
-
|
442 |
-
$this->_errors[] = "The value(s) set for <strong>display options</strong> is/are invalid: " . $argument;
|
443 |
-
|
444 |
-
return;
|
445 |
-
}
|
446 |
-
|
447 |
-
if ( ! is_array( $input ) && strtolower( $input ) == "all" ) // If Not Array and "All" selected
|
448 |
-
{
|
449 |
-
$input = $this->_totalEntries;
|
450 |
-
} // Set total entries value
|
451 |
-
|
452 |
-
$this->_displayOptions = $input;
|
453 |
-
}
|
454 |
-
|
455 |
-
public function setEntriesPerPage() // sets entries per page amount from POST or COOKIE values
|
456 |
-
{
|
457 |
-
if ( $this->_errors ) // If an error, quit
|
458 |
-
{
|
459 |
-
return;
|
460 |
-
}
|
461 |
-
|
462 |
-
$varName = $this->_getPOSTVarName();
|
463 |
-
|
464 |
-
if ( is_array( $this->_displayOptions ) and count( $this->_displayOptions ) > 1 ) // If more than 1 display option
|
465 |
-
{
|
466 |
-
$value = $this->_displayOptions[0]; // Default is first selection
|
467 |
-
|
468 |
-
if ( isset( $_POST[ $varName ] ) ) // If POST is set
|
469 |
-
{
|
470 |
-
if ( in_array( $_POST[ $varName ], $this->_displayOptions ) ) // Check for valid post value
|
471 |
-
{
|
472 |
-
$value = $_POST[ $varName ];
|
473 |
-
setcookie( $varName, $value, 604800 + time(), "/" ); // Set cookie
|
474 |
-
$_COOKIE[ $varName ] = $value;
|
475 |
-
} else // If invalid post value
|
476 |
-
{
|
477 |
-
$value
|
478 |
-
= self::DEFAULT_ENTRIES_DISPLAY; // Set to default if invalid
|
479 |
-
}
|
480 |
-
} elseif ( isset( $_COOKIE[ $varName ] ) ) // If POST not set, but COOKIE set
|
481 |
-
{
|
482 |
-
// Check for valid cookie value
|
483 |
-
if ( in_array( $_COOKIE[ $varName ], $this->_displayOptions ) ) // Check for valid cookie value
|
484 |
-
{
|
485 |
-
$value = $_COOKIE[ $varName ]; // Set to value if valid
|
486 |
-
} else {
|
487 |
-
$value
|
488 |
-
= self::DEFAULT_ENTRIES_DISPLAY; // Set to default if invalid
|
489 |
-
$this->deleteCookie(); // Delete invalid cookie
|
490 |
-
}
|
491 |
-
}
|
492 |
-
} else // If only one option, set either to default or displayOptions value
|
493 |
-
{
|
494 |
-
$value = ( $this->_displayOptions ) ? $this->_displayOptions : self::DEFAULT_ENTRIES_DISPLAY;
|
495 |
-
}
|
496 |
-
|
497 |
-
if ( strtolower( $value ) == "all" ) // If set to "All", use total entries
|
498 |
-
{
|
499 |
-
$value = $this->_totalEntries;
|
500 |
-
}
|
501 |
-
|
502 |
-
$this->_entriesPerPage = $value;
|
503 |
-
}
|
504 |
-
|
505 |
-
public function setPagesPerSection( $input ) // sets # of pages per section
|
506 |
-
{
|
507 |
-
if ( ! $this->_validEntry( $input ) ) {
|
508 |
-
$this->_errors[] = "The value set for <strong>pages per section</strong> is invalid: " . $input;
|
509 |
-
|
510 |
-
return;
|
511 |
-
}
|
512 |
-
|
513 |
-
$this->_pagesPerSection = $input;
|
514 |
-
}
|
515 |
-
|
516 |
-
public function setPaginationID( $input ) {
|
517 |
-
if ( $input ) {
|
518 |
-
if ( preg_match( "/^\d+$/", $input[0] ) ) // Check if first character is a digit
|
519 |
-
{
|
520 |
-
$this->_errors[]
|
521 |
-
= "The first character of the <strong>pagination ID</strong> cannot be a number: " . $input;
|
522 |
-
|
523 |
-
return; // cannot be a digit because variable names cannot start with digits,
|
524 |
-
} // and this value will be used as a variable name
|
525 |
-
|
526 |
-
$this->_paginationID = $input;
|
527 |
-
}
|
528 |
-
}
|
529 |
-
|
530 |
-
public function setStyles(
|
531 |
-
$pageOff = "",
|
532 |
-
$pageOn = "",
|
533 |
-
$select = "",
|
534 |
-
$errors = ""
|
535 |
-
) // sets CSS style class names
|
536 |
-
{
|
537 |
-
$this->_styles = array(
|
538 |
-
"pageOff" => $pageOff,
|
539 |
-
"pageOn" => $pageOn,
|
540 |
-
"select" => $select,
|
541 |
-
"errors" => $errors,
|
542 |
-
);
|
543 |
-
}
|
544 |
-
|
545 |
-
public function setTotalEntries( $input ) // sets total number of entries
|
546 |
-
{
|
547 |
-
if ( ! $this->_validEntry( $input ) ) {
|
548 |
-
$this->_errors[] = "The value set for <strong>total entries</strong> is invalid: " . $input;
|
549 |
-
|
550 |
-
return;
|
551 |
-
}
|
552 |
-
|
553 |
-
$this->_totalEntries = $input;
|
554 |
-
}
|
555 |
-
|
556 |
-
|
557 |
-
/*******************************************************
|
558 |
-
* GET FUNCTIONS
|
559 |
-
*******************************************************/
|
560 |
-
|
561 |
-
private function _getIDGETVarName() // returns GET variable name for pagination pages
|
562 |
-
{
|
563 |
-
return $this->getPaginationID() . '-' . self::PAGE_GETVAR_NAME;
|
564 |
-
}
|
565 |
-
|
566 |
-
private function _getPOSTVarName() // returns POST variable name for select/cookie entities
|
567 |
-
{
|
568 |
-
return $this->getPaginationID() . 'Display';
|
569 |
-
}
|
570 |
-
|
571 |
-
public function getCurrentPage() // returns the currently accessed page number
|
572 |
-
{
|
573 |
-
if ( ! $this->_currentPage ) // If not set, return first page
|
574 |
-
{
|
575 |
-
return 1;
|
576 |
-
} else {
|
577 |
-
return $this->_currentPage;
|
578 |
-
}
|
579 |
-
}
|
580 |
-
|
581 |
-
public function getPagesPerSection() // returns the # of pages per section
|
582 |
-
{
|
583 |
-
if ( ! $this->_pagesPerSection ) // If not set, set error and return 0
|
584 |
-
{
|
585 |
-
$this->_errors[] = "The value for <strong>pages per section</strong> has not been set.";
|
586 |
-
|
587 |
-
return 0;
|
588 |
-
}
|
589 |
-
|
590 |
-
if ( $this->_pagesPerSection >
|
591 |
-
$this->getTotalPages()
|
592 |
-
) // If per section is greater than total pages
|
593 |
-
{
|
594 |
-
return $this->getTotalPages();
|
595 |
-
} // Return total pages
|
596 |
-
else {
|
597 |
-
return $this->_pagesPerSection;
|
598 |
-
} // Otherwise return per section
|
599 |
-
}
|
600 |
-
|
601 |
-
public function getPaginationID() // returns ID name for pagination object
|
602 |
-
{
|
603 |
-
return $this->_paginationID;
|
604 |
-
}
|
605 |
-
|
606 |
-
public function getTotalPages() // returns total pages
|
607 |
-
{
|
608 |
-
if ( $this->_errors ) // If there is an error, return 0
|
609 |
-
{
|
610 |
-
return 0;
|
611 |
-
}
|
612 |
-
|
613 |
-
if ( $this->_entriesPerPage == 0 ) // Prevent division by zero
|
614 |
-
{
|
615 |
-
return 0;
|
616 |
-
}
|
617 |
-
|
618 |
-
return ceil(
|
619 |
-
$this->_totalEntries / $this->_entriesPerPage
|
620 |
-
); // Total pages: total # of entries divided by total entries per page
|
621 |
-
}
|
622 |
-
|
623 |
-
public function getEntryStart() // returns the start entry for the page
|
624 |
-
{
|
625 |
-
if ( $this->_isError() ) // If error encountered
|
626 |
-
{
|
627 |
-
return 0;
|
628 |
-
}
|
629 |
-
|
630 |
-
return ( $this->_currentPage - 1 ) *
|
631 |
-
$this->_entriesPerPage; // Entry start: 1 less than current page multiplied by total entries per page
|
632 |
-
}
|
633 |
-
|
634 |
-
public function getEntryEnd() // returns the last entry for the page
|
635 |
-
{
|
636 |
-
if ( $this->_isError() ) // If error encountered
|
637 |
-
{
|
638 |
-
return 0;
|
639 |
-
}
|
640 |
-
|
641 |
-
if ( $this->_currentPage == $this->getTotalPages() ) // If current page is last page
|
642 |
-
{
|
643 |
-
return $this->_totalEntries - $this->getEntryStart();
|
644 |
-
} // then entry end is total entries minus start entry
|
645 |
-
else {
|
646 |
-
return $this->_entriesPerPage;
|
647 |
-
} // otherwise entry end is # of entries per page
|
648 |
-
}
|
649 |
-
|
650 |
-
public function getEntryEndFF() // Flat-file version of the above getEntryEnd() function
|
651 |
-
{
|
652 |
-
if ( $this->_isError() ) // If error encountered
|
653 |
-
{
|
654 |
-
return 0;
|
655 |
-
}
|
656 |
-
|
657 |
-
if ( $this->_currentPage == $this->getTotalPages() ) // If current page is last page
|
658 |
-
{
|
659 |
-
return $this->_totalEntries;
|
660 |
-
} // then entry end is total entries minus start entry
|
661 |
-
else {
|
662 |
-
return $this->getEntryStart() + $this->_entriesPerPage;
|
663 |
-
} // otherwise entry end is # of entries per page after start
|
664 |
-
}
|
665 |
-
}
|
666 |
-
|
667 |
-
endif; // Prevent multiple class definitions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/classes/class-wp-statistics-schedule.php
CHANGED
@@ -16,109 +16,89 @@ class WP_Statistics_Schedule {
|
|
16 |
// before construct
|
17 |
add_filter( 'cron_schedules', 'WP_Statistics_Schedule::addcron' );
|
18 |
|
19 |
-
//
|
20 |
-
if (
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
// Remove the report schedule if it does exist and is disabled.
|
26 |
-
if ( wp_next_scheduled( 'report_hook' ) && ! $WP_Statistics->get_option( 'stats_report' ) ) {
|
27 |
-
|
28 |
-
wp_unschedule_event( wp_next_scheduled( 'report_hook' ), 'report_hook' );
|
29 |
-
}
|
30 |
-
|
31 |
-
// Add the GeoIP update schedule if it doesn't exist and it should be.
|
32 |
-
if ( ! wp_next_scheduled( 'wp_statistics_geoip_hook' ) &&
|
33 |
-
$WP_Statistics->get_option( 'schedule_geoip' ) &&
|
34 |
-
$WP_Statistics->get_option( 'geoip' )
|
35 |
-
) {
|
36 |
-
|
37 |
-
wp_schedule_event( time(), 'daily', 'wp_statistics_geoip_hook' );
|
38 |
-
}
|
39 |
-
|
40 |
-
// Remove the GeoIP update schedule if it does exist and it should shouldn't.
|
41 |
-
if ( wp_next_scheduled( 'wp_statistics_geoip_hook' ) &&
|
42 |
-
( ! $WP_Statistics->get_option( 'schedule_geoip' ) || ! $WP_Statistics->get_option( 'geoip' ) )
|
43 |
-
) {
|
44 |
-
|
45 |
-
wp_unschedule_event( wp_next_scheduled( 'wp_statistics_geoip_hook' ), 'wp_statistics_geoip_hook' );
|
46 |
-
}
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
wp_schedule_event( time(), 'weekly', 'wp_statistics_referrerspam_hook' );
|
54 |
-
}
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
);
|
65 |
-
}
|
66 |
|
67 |
-
|
68 |
-
if ( ! wp_next_scheduled( 'wp_statistics_dbmaint_hook' ) && $WP_Statistics->get_option( 'schedule_dbmaint' ) ) {
|
69 |
|
70 |
-
|
71 |
-
|
|
|
|
|
72 |
|
73 |
-
|
74 |
-
|
|
|
|
|
75 |
|
76 |
-
|
77 |
-
|
|
|
|
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
|
|
|
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
'wp_statistics_dbmaint_visitor_hook'
|
95 |
-
|
96 |
-
}
|
97 |
|
98 |
-
|
99 |
-
|
|
|
|
|
100 |
|
101 |
-
|
102 |
-
|
|
|
|
|
103 |
|
104 |
-
|
105 |
-
|
|
|
|
|
106 |
|
107 |
-
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
-
//after construct
|
111 |
-
add_action( 'wp_statistics_add_visit_hook', 'WP_Statistics_Schedule::add_visit_event' );
|
112 |
-
add_action( 'wp_statistics_geoip_hook', 'WP_Statistics_Schedule::geoip_event' );
|
113 |
-
add_action( 'wp_statistics_dbmaint_hook', 'WP_Statistics_Schedule::dbmaint_event' );
|
114 |
-
add_action( 'wp_statistics_dbmaint_visitor_hook', 'WP_Statistics_Schedule::dbmaint_visitor_event' );
|
115 |
-
add_action( 'report_hook', 'WP_Statistics_Schedule::send_report' );
|
116 |
-
|
117 |
}
|
118 |
|
119 |
/**
|
120 |
* @param array $schedules
|
121 |
-
*
|
122 |
* @return mixed
|
123 |
*/
|
124 |
static function addcron( $schedules ) {
|
@@ -152,25 +132,25 @@ class WP_Statistics_Schedule {
|
|
152 |
* adds a record for tomorrow to the visit table to avoid a race condition.
|
153 |
*
|
154 |
*/
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
$
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
|
|
|
|
163 |
);
|
164 |
-
|
165 |
-
$wpdb->query( $sqlstring );
|
166 |
}
|
167 |
|
168 |
/**
|
169 |
* Updates the GeoIP database from MaxMind.
|
170 |
*/
|
171 |
-
|
172 |
-
|
173 |
-
GLOBAL $WP_Statistics;
|
174 |
|
175 |
// Maxmind updates the geoip database on the first Tuesday of the month, to make sure we don't update before they post
|
176 |
// the update, download it two days later.
|
@@ -193,7 +173,7 @@ class WP_Statistics_Schedule {
|
|
193 |
}
|
194 |
|
195 |
|
196 |
-
if ( $is_require_update ===true ) {
|
197 |
|
198 |
// We can't fire the download function directly here as we rely on some functions that haven't been loaded yet
|
199 |
// in WordPress, so instead just set the flag in the options table and the shutdown hook will take care of the
|
@@ -205,7 +185,7 @@ class WP_Statistics_Schedule {
|
|
205 |
/**
|
206 |
* Purges old records on a schedule based on age.
|
207 |
*/
|
208 |
-
|
209 |
global $WP_Statistics;
|
210 |
if ( ! function_exists( 'wp_statistics_purge_data' ) ) {
|
211 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge.php' );
|
@@ -217,7 +197,7 @@ class WP_Statistics_Schedule {
|
|
217 |
/**
|
218 |
* Purges visitors with more than a defined number of hits in a day.
|
219 |
*/
|
220 |
-
|
221 |
global $WP_Statistics;
|
222 |
if ( ! function_exists( 'wp_statistics_purge_visitor_hits' ) ) {
|
223 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge-hits.php' );
|
@@ -229,7 +209,7 @@ class WP_Statistics_Schedule {
|
|
229 |
/**
|
230 |
* Sends the statistics report to the selected users.
|
231 |
*/
|
232 |
-
|
233 |
global $WP_Statistics, $sms;
|
234 |
|
235 |
// Retrieve the template from the options.
|
@@ -253,12 +233,7 @@ class WP_Statistics_Schedule {
|
|
253 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
254 |
}
|
255 |
|
256 |
-
wp_mail(
|
257 |
-
$WP_Statistics->get_option( 'email_list' ),
|
258 |
-
__( 'Statistical reporting', 'wp-statistics' ),
|
259 |
-
$final_text_report,
|
260 |
-
$headers
|
261 |
-
);
|
262 |
|
263 |
} else if ( $WP_Statistics->get_option( 'send_report' ) == 'sms' ) {
|
264 |
|
16 |
// before construct
|
17 |
add_filter( 'cron_schedules', 'WP_Statistics_Schedule::addcron' );
|
18 |
|
19 |
+
//Run This Method Only Admin Area
|
20 |
+
if ( is_admin() ) {
|
21 |
|
22 |
+
//Disable Run to Ajax
|
23 |
+
if ( ! wp_doing_ajax() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
// Add the GeoIP update schedule if it doesn't exist and it should be.
|
26 |
+
if ( ! wp_next_scheduled( 'wp_statistics_geoip_hook' ) && $WP_Statistics->get_option( 'schedule_geoip' ) && $WP_Statistics->get_option( 'geoip' ) ) {
|
27 |
+
wp_schedule_event( time(), 'daily', 'wp_statistics_geoip_hook' );
|
28 |
+
}
|
|
|
|
|
|
|
29 |
|
30 |
+
// Remove the GeoIP update schedule if it does exist and it should shouldn't.
|
31 |
+
if ( wp_next_scheduled( 'wp_statistics_geoip_hook' ) && ( ! $WP_Statistics->get_option( 'schedule_geoip' ) || ! $WP_Statistics->get_option( 'geoip' ) ) ) {
|
32 |
+
wp_unschedule_event( wp_next_scheduled( 'wp_statistics_geoip_hook' ), 'wp_statistics_geoip_hook' );
|
33 |
+
}
|
34 |
|
35 |
+
//Construct Event
|
36 |
+
add_action( 'wp_statistics_geoip_hook', array( $this, 'geoip_event' ) );
|
37 |
+
}
|
|
|
|
|
38 |
|
39 |
+
} else {
|
|
|
40 |
|
41 |
+
// Add the report schedule if it doesn't exist and is enabled.
|
42 |
+
if ( ! wp_next_scheduled( 'report_hook' ) && $WP_Statistics->get_option( 'stats_report' ) ) {
|
43 |
+
wp_schedule_event( time(), $WP_Statistics->get_option( 'time_report' ), 'report_hook' );
|
44 |
+
}
|
45 |
|
46 |
+
// Remove the report schedule if it does exist and is disabled.
|
47 |
+
if ( wp_next_scheduled( 'report_hook' ) && ! $WP_Statistics->get_option( 'stats_report' ) ) {
|
48 |
+
wp_unschedule_event( wp_next_scheduled( 'report_hook' ), 'report_hook' );
|
49 |
+
}
|
50 |
|
51 |
+
// Add the referrerspam update schedule if it doesn't exist and it should be.
|
52 |
+
if ( ! wp_next_scheduled( 'wp_statistics_referrerspam_hook' ) && $WP_Statistics->get_option( 'schedule_referrerspam' ) ) {
|
53 |
+
wp_schedule_event( time(), 'weekly', 'wp_statistics_referrerspam_hook' );
|
54 |
+
}
|
55 |
|
56 |
+
// Remove the referrerspam update schedule if it does exist and it should shouldn't.
|
57 |
+
if ( wp_next_scheduled( 'wp_statistics_referrerspam_hook' ) && ! $WP_Statistics->get_option( 'schedule_referrerspam' ) ) {
|
58 |
+
wp_unschedule_event( wp_next_scheduled( 'wp_statistics_referrerspam_hook' ), 'wp_statistics_referrerspam_hook' );
|
59 |
+
}
|
60 |
|
61 |
+
// Add the database maintenance schedule if it doesn't exist and it should be.
|
62 |
+
if ( ! wp_next_scheduled( 'wp_statistics_dbmaint_hook' ) && $WP_Statistics->get_option( 'schedule_dbmaint' ) ) {
|
63 |
+
wp_schedule_event( time(), 'daily', 'wp_statistics_dbmaint_hook' );
|
64 |
+
}
|
65 |
|
66 |
+
// Remove the database maintenance schedule if it does exist and it shouldn't.
|
67 |
+
if ( wp_next_scheduled( 'wp_statistics_dbmaint_hook' ) && ( ! $WP_Statistics->get_option( 'schedule_dbmaint' ) ) ) {
|
68 |
+
wp_unschedule_event( wp_next_scheduled( 'wp_statistics_dbmaint_hook' ), 'wp_statistics_dbmaint_hook' );
|
69 |
+
}
|
70 |
|
71 |
+
// Add the visitor database maintenance schedule if it doesn't exist and it should be.
|
72 |
+
if ( ! wp_next_scheduled( 'wp_statistics_dbmaint_visitor_hook' ) && $WP_Statistics->get_option( 'schedule_dbmaint_visitor' ) ) {
|
73 |
+
wp_schedule_event( time(), 'daily', 'wp_statistics_dbmaint_visitor_hook' );
|
74 |
+
}
|
|
|
75 |
|
76 |
+
// Remove the visitor database maintenance schedule if it does exist and it shouldn't.
|
77 |
+
if ( wp_next_scheduled( 'wp_statistics_dbmaint_visitor_hook' ) && ( ! $WP_Statistics->get_option( 'schedule_dbmaint_visitor' ) ) ) {
|
78 |
+
wp_unschedule_event( wp_next_scheduled( 'wp_statistics_dbmaint_visitor_hook' ), 'wp_statistics_dbmaint_visitor_hook' );
|
79 |
+
}
|
80 |
|
81 |
+
// Remove the add visit row schedule if it does exist and it shouldn't.
|
82 |
+
if ( wp_next_scheduled( 'wp_statistics_add_visit_hook' ) && ( ! $WP_Statistics->get_option( 'visits' ) ) ) {
|
83 |
+
wp_unschedule_event( wp_next_scheduled( 'wp_statistics_add_visit_hook' ), 'wp_statistics_add_visit_hook' );
|
84 |
+
}
|
85 |
|
86 |
+
// Add the add visit table row schedule if it does exist and it should.
|
87 |
+
if ( ! wp_next_scheduled( 'wp_statistics_add_visit_hook' ) && $WP_Statistics->get_option( 'visits' ) ) {
|
88 |
+
wp_schedule_event( time(), 'daily', 'wp_statistics_add_visit_hook' );
|
89 |
+
}
|
90 |
|
91 |
+
//after construct
|
92 |
+
add_action( 'wp_statistics_add_visit_hook', array( $this, 'add_visit_event' ) );
|
93 |
+
add_action( 'wp_statistics_dbmaint_hook', array( $this, 'dbmaint_event' ) );
|
94 |
+
add_action( 'wp_statistics_dbmaint_visitor_hook', array( $this, 'dbmaint_visitor_event' ) );
|
95 |
+
add_action( 'report_hook', array( $this, 'send_report' ) );
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
* @param array $schedules
|
|
|
102 |
* @return mixed
|
103 |
*/
|
104 |
static function addcron( $schedules ) {
|
132 |
* adds a record for tomorrow to the visit table to avoid a race condition.
|
133 |
*
|
134 |
*/
|
135 |
+
public function add_visit_event() {
|
136 |
+
global $wpdb, $WP_Statistics;
|
137 |
+
|
138 |
+
$wpdb->insert(
|
139 |
+
$wpdb->prefix . 'statistics_visit',
|
140 |
+
array(
|
141 |
+
'last_visit' => $WP_Statistics->Current_Date( null, '+1' ),
|
142 |
+
'last_counter' => $WP_Statistics->Current_date( 'Y-m-d', '+1' ),
|
143 |
+
'visit' => 0,
|
144 |
+
),
|
145 |
+
array( '%s', '%s', '%d' )
|
146 |
);
|
|
|
|
|
147 |
}
|
148 |
|
149 |
/**
|
150 |
* Updates the GeoIP database from MaxMind.
|
151 |
*/
|
152 |
+
public function geoip_event() {
|
153 |
+
global $WP_Statistics;
|
|
|
154 |
|
155 |
// Maxmind updates the geoip database on the first Tuesday of the month, to make sure we don't update before they post
|
156 |
// the update, download it two days later.
|
173 |
}
|
174 |
|
175 |
|
176 |
+
if ( $is_require_update === true ) {
|
177 |
|
178 |
// We can't fire the download function directly here as we rely on some functions that haven't been loaded yet
|
179 |
// in WordPress, so instead just set the flag in the options table and the shutdown hook will take care of the
|
185 |
/**
|
186 |
* Purges old records on a schedule based on age.
|
187 |
*/
|
188 |
+
public function dbmaint_event() {
|
189 |
global $WP_Statistics;
|
190 |
if ( ! function_exists( 'wp_statistics_purge_data' ) ) {
|
191 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge.php' );
|
197 |
/**
|
198 |
* Purges visitors with more than a defined number of hits in a day.
|
199 |
*/
|
200 |
+
public function dbmaint_visitor_event() {
|
201 |
global $WP_Statistics;
|
202 |
if ( ! function_exists( 'wp_statistics_purge_visitor_hits' ) ) {
|
203 |
require( WP_Statistics::$reg['plugin-dir'] . 'includes/functions/purge-hits.php' );
|
209 |
/**
|
210 |
* Sends the statistics report to the selected users.
|
211 |
*/
|
212 |
+
public function send_report() {
|
213 |
global $WP_Statistics, $sms;
|
214 |
|
215 |
// Retrieve the template from the options.
|
233 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
234 |
}
|
235 |
|
236 |
+
wp_mail( $WP_Statistics->get_option( 'email_list' ), __( 'Statistical reporting', 'wp-statistics' ), $final_text_report, $headers );
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
} else if ( $WP_Statistics->get_option( 'send_report' ) == 'sms' ) {
|
239 |
|
includes/classes/class-wp-statistics-tinymce.php
CHANGED
@@ -9,139 +9,142 @@ class WP_Statistics_TinyMCE {
|
|
9 |
* Setup an TinyMCE action to close the notice on the overview page.
|
10 |
*/
|
11 |
public function __construct() {
|
12 |
-
|
13 |
-
|
14 |
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
}
|
21 |
|
22 |
/*
|
23 |
* Language List Text Domain
|
24 |
*/
|
25 |
-
static public function lang()
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
}
|
71 |
|
72 |
/*
|
73 |
* Add Filter TinyMCE
|
74 |
*/
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
135 |
<script type="text/javascript">
|
136 |
jQuery( document ).on( \'tinymce-editor-setup\', function( event, editor ) {
|
137 |
editor.settings.toolbar1 += \',wp_statistic_tc_button\';
|
138 |
});
|
139 |
';
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
tinyMCEPreInit.load_ext("'.rtrim( WP_Statistics::$reg['plugin-url'], "/").'", "'
|
144 |
</script>
|
145 |
';
|
146 |
-
|
147 |
}
|
9 |
* Setup an TinyMCE action to close the notice on the overview page.
|
10 |
*/
|
11 |
public function __construct() {
|
12 |
+
// Add Filter TinyMce Editor
|
13 |
+
add_action( 'admin_head', array( $this, 'wp_statistic_add_my_tc_button' ) );
|
14 |
|
15 |
+
//Load Text Widget Button
|
16 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'load_tinymcejs_widget_wp_admin_style' ) );
|
17 |
|
18 |
+
// Add TextLang
|
19 |
+
add_action( 'admin_footer-widgets.php', array( $this, 'my_post_edit_page_footer' ), 999 );
|
20 |
}
|
21 |
|
22 |
/*
|
23 |
* Language List Text Domain
|
24 |
*/
|
25 |
+
static public function lang() {
|
26 |
+
if ( ! class_exists( '_WP_Editors' ) ) {
|
27 |
+
require( ABSPATH . WPINC . '/class-wp-editor.php' );
|
28 |
+
}
|
29 |
+
|
30 |
+
$strings = array(
|
31 |
+
'insert' => __( 'WP Statistics Shortcodes', 'wp-statistics' ),
|
32 |
+
'stat' => __( 'Stat', 'wp-statistics' ),
|
33 |
+
'usersonline' => __( 'Online Users', 'wp-statistics' ),
|
34 |
+
'visits' => __( 'Visits', 'wp-statistics' ),
|
35 |
+
'visitors' => __( 'Visitors', 'wp-statistics' ),
|
36 |
+
'pagevisits' => __( 'Page Visits', 'wp-statistics' ),
|
37 |
+
'searches' => __( 'Searches', 'wp-statistics' ),
|
38 |
+
'postcount' => __( 'Post Count', 'wp-statistics' ),
|
39 |
+
'pagecount' => __( 'Page Count', 'wp-statistics' ),
|
40 |
+
'commentcount' => __( 'Comment Count', 'wp-statistics' ),
|
41 |
+
'spamcount' => __( 'Spam Count', 'wp-statistics' ),
|
42 |
+
'usercount' => __( 'User Count', 'wp-statistics' ),
|
43 |
+
'postaverage' => __( 'Post Average', 'wp-statistics' ),
|
44 |
+
'commentaverage' => __( 'Comment Average', 'wp-statistics' ),
|
45 |
+
'useraverage' => __( 'User Average', 'wp-statistics' ),
|
46 |
+
'lpd' => __( 'Last Post Date', 'wp-statistics' ),
|
47 |
+
'referrer' => __( 'Referrer', 'wp-statistics' ),
|
48 |
+
'help_stat' => __( 'The statistics you want, see the next table for available options.', 'wp-statistics' ),
|
49 |
+
'time' => __( 'Time', 'wp-statistics' ),
|
50 |
+
'se' => __( 'Select item ...', 'wp-statistics' ),
|
51 |
+
'today' => __( 'Today', 'wp-statistics' ),
|
52 |
+
'yesterday' => __( 'Yesterday', 'wp-statistics' ),
|
53 |
+
'week' => __( 'Week', 'wp-statistics' ),
|
54 |
+
'month' => __( 'Month', 'wp-statistics' ),
|
55 |
+
'year' => __( 'Year', 'wp-statistics' ),
|
56 |
+
'total' => __( 'Total', 'wp-statistics' ),
|
57 |
+
'help_time' => __( 'Is the time frame (time periods) for the statistic', 'wp-statistics' ),
|
58 |
+
'provider' => __( 'Provider', 'wp-statistics' ),
|
59 |
+
'help_provider' => __( 'The search provider to get statistics on.', 'wp-statistics' ),
|
60 |
+
'format' => __( 'Format', 'wp-statistics' ),
|
61 |
+
'help_format' => __( 'The format to display numbers in: i18n, english, none.', 'wp-statistics' ),
|
62 |
+
'id' => __( 'ID', 'wp-statistics' ),
|
63 |
+
'help_id' => __( 'The post/page ID to get page statistics on.', 'wp-statistics' ),
|
64 |
+
);
|
65 |
+
|
66 |
+
$locale = _WP_Editors::$mce_locale;
|
67 |
+
$translated = 'tinyMCE.addI18n("' . $locale . '.wp_statistic_tinymce_plugin", ' . json_encode( $strings ) . ");\n";
|
68 |
+
|
69 |
+
return array( 'locale' => $locale, 'translate' => $translated );
|
70 |
}
|
71 |
|
72 |
/*
|
73 |
* Add Filter TinyMCE
|
74 |
*/
|
75 |
+
public function wp_statistic_add_my_tc_button() {
|
76 |
+
global $typenow;
|
77 |
+
|
78 |
+
// check user permissions
|
79 |
+
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
|
80 |
+
return;
|
81 |
+
}
|
82 |
+
|
83 |
+
// verify the post type
|
84 |
+
if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
|
85 |
+
return;
|
86 |
+
}
|
87 |
+
|
88 |
+
// check if WYSIWYG is enabled
|
89 |
+
if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
90 |
+
add_filter( "mce_external_plugins", array( $this, 'wp_statistic_add_tinymce_plugin' ) );
|
91 |
+
add_filter( 'mce_buttons', array( $this, 'wp_statistic_register_my_tc_button' ) );
|
92 |
+
add_filter( 'mce_external_languages', array( $this, 'wp_statistic_tinymce_plugin_add_locale' ) );
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/*
|
97 |
+
* Add Js Bottun to Editor
|
98 |
+
*/
|
99 |
+
public function wp_statistic_add_tinymce_plugin( $plugin_array ) {
|
100 |
+
$plugin_array['wp_statistic_tc_button'] = WP_Statistics::$reg['plugin-url'] . 'assets/js/tinymce.js';
|
101 |
+
|
102 |
+
return $plugin_array;
|
103 |
+
}
|
104 |
+
|
105 |
+
/*
|
106 |
+
* Push Button to TinyMCE Advance
|
107 |
+
*/
|
108 |
+
public function wp_statistic_register_my_tc_button( $buttons ) {
|
109 |
+
array_push( $buttons, "wp_statistic_tc_button" );
|
110 |
+
|
111 |
+
return $buttons;
|
112 |
+
}
|
113 |
+
|
114 |
+
/*
|
115 |
+
* Add Lang Text Domain
|
116 |
+
*/
|
117 |
+
public function wp_statistic_tinymce_plugin_add_locale( $locales ) {
|
118 |
+
$locales ['wp-statistic-tinymce-plugin'] = WP_Statistics::$reg['plugin-dir'] . 'includes/functions/tinymce.php';
|
119 |
+
|
120 |
+
return $locales;
|
121 |
+
}
|
122 |
+
|
123 |
+
/*
|
124 |
+
* Add Button For Text Widget
|
125 |
+
*/
|
126 |
+
public function load_tinymcejs_widget_wp_admin_style() {
|
127 |
+
global $pagenow;
|
128 |
+
if ( $pagenow == "widgets.php" ) {
|
129 |
+
wp_enqueue_script( 'add_wp_statistic_button_for_widget_text', WP_Statistics::$reg['plugin-url'] . 'assets/js/tinymce.js' );
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
/*
|
134 |
+
* Add Lang for Text Widget
|
135 |
+
*/
|
136 |
+
public function my_post_edit_page_footer() {
|
137 |
+
echo '
|
138 |
<script type="text/javascript">
|
139 |
jQuery( document ).on( \'tinymce-editor-setup\', function( event, editor ) {
|
140 |
editor.settings.toolbar1 += \',wp_statistic_tc_button\';
|
141 |
});
|
142 |
';
|
143 |
+
$lang = WP_Statistics_TinyMCE::lang();
|
144 |
+
echo $lang['translate'];
|
145 |
+
echo '
|
146 |
+
tinyMCEPreInit.load_ext("' . rtrim( WP_Statistics::$reg['plugin-url'], "/" ) . '", "' . $lang['locale'] . '");
|
147 |
</script>
|
148 |
';
|
149 |
+
}
|
150 |
}
|
includes/classes/class-wp-statistics-updates.php
CHANGED
@@ -203,12 +203,7 @@ class WP_Statistics_Updates {
|
|
203 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
204 |
}
|
205 |
|
206 |
-
wp_mail(
|
207 |
-
$WP_Statistics->get_option( 'email_list' ),
|
208 |
-
__( 'GeoIP update on', 'wp-statistics' ) . ' ' . $blogname,
|
209 |
-
$result['notice'],
|
210 |
-
$headers
|
211 |
-
);
|
212 |
}
|
213 |
|
214 |
// All of the messages displayed above are stored in a string, now it's time to actually output the messages.
|
@@ -216,12 +211,11 @@ class WP_Statistics_Updates {
|
|
216 |
}
|
217 |
|
218 |
/**
|
219 |
-
* Downloads the referrer spam database from https://github.com/
|
220 |
-
*
|
221 |
* @return string
|
222 |
*/
|
223 |
static function download_referrerspam() {
|
224 |
-
|
225 |
|
226 |
// If referrer spam is disabled, bail out.
|
227 |
if ( $WP_Statistics->get_option( 'referrerspam' ) == false ) {
|
@@ -229,21 +223,23 @@ class WP_Statistics_Updates {
|
|
229 |
}
|
230 |
|
231 |
// This is the location of the file to download.
|
232 |
-
$download_url = 'https://raw.githubusercontent.com/
|
233 |
|
234 |
// Download the file from MaxMind, this places it in a temporary location.
|
235 |
-
$
|
236 |
-
if ( $
|
237 |
-
|
|
|
|
|
|
|
|
|
238 |
}
|
239 |
|
240 |
if ( $referrerspamlist != '' || $WP_Statistics->get_option( 'referrerspamlist' ) != '' ) {
|
241 |
$WP_Statistics->update_option( 'referrerspamlist', $referrerspamlist );
|
242 |
}
|
243 |
|
244 |
-
|
245 |
-
|
246 |
-
return;
|
247 |
}
|
248 |
|
249 |
/**
|
@@ -266,7 +262,7 @@ class WP_Statistics_Updates {
|
|
266 |
$reader = $WP_Statistics::geoip_loader( 'country' );
|
267 |
}
|
268 |
|
269 |
-
if($reader ===false) {
|
270 |
$text_error = __( 'Unable to load the GeoIP database, make sure you have downloaded it in the settings page.', 'wp-statistics' );
|
271 |
WP_Statistics_Admin_Pages::set_admin_notice( $text_error, $type = 'error' );
|
272 |
}
|
203 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
204 |
}
|
205 |
|
206 |
+
wp_mail( $WP_Statistics->get_option( 'email_list' ), __( 'GeoIP update on', 'wp-statistics' ) . ' ' . $blogname, $result['notice'], $headers );
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
|
209 |
// All of the messages displayed above are stored in a string, now it's time to actually output the messages.
|
211 |
}
|
212 |
|
213 |
/**
|
214 |
+
* Downloads the referrer spam database from https://github.com/matomo-org/referrer-spam-blacklist.
|
|
|
215 |
* @return string
|
216 |
*/
|
217 |
static function download_referrerspam() {
|
218 |
+
global $WP_Statistics;
|
219 |
|
220 |
// If referrer spam is disabled, bail out.
|
221 |
if ( $WP_Statistics->get_option( 'referrerspam' ) == false ) {
|
223 |
}
|
224 |
|
225 |
// This is the location of the file to download.
|
226 |
+
$download_url = 'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt';
|
227 |
|
228 |
// Download the file from MaxMind, this places it in a temporary location.
|
229 |
+
$response = wp_remote_get( $download_url, array( 'timeout' => 30 ) );
|
230 |
+
if ( is_wp_error( $response ) ) {
|
231 |
+
return false;
|
232 |
+
}
|
233 |
+
$referrerspamlist = wp_remote_retrieve_body( $response );
|
234 |
+
if ( is_wp_error( $referrerspamlist ) ) {
|
235 |
+
return false;
|
236 |
}
|
237 |
|
238 |
if ( $referrerspamlist != '' || $WP_Statistics->get_option( 'referrerspamlist' ) != '' ) {
|
239 |
$WP_Statistics->update_option( 'referrerspamlist', $referrerspamlist );
|
240 |
}
|
241 |
|
242 |
+
return true;
|
|
|
|
|
243 |
}
|
244 |
|
245 |
/**
|
262 |
$reader = $WP_Statistics::geoip_loader( 'country' );
|
263 |
}
|
264 |
|
265 |
+
if ( $reader === false ) {
|
266 |
$text_error = __( 'Unable to load the GeoIP database, make sure you have downloaded it in the settings page.', 'wp-statistics' );
|
267 |
WP_Statistics_Admin_Pages::set_admin_notice( $text_error, $type = 'error' );
|
268 |
}
|
includes/classes/class-wp-statistics-welcome.php
CHANGED
@@ -15,7 +15,7 @@ class WP_Statistics_Welcome {
|
|
15 |
$WP_Statistics->update_option( 'show_welcome_page', false );
|
16 |
|
17 |
// Redirect to welcome page
|
18 |
-
wp_redirect( admin_url( '
|
19 |
}
|
20 |
|
21 |
if ( ! $WP_Statistics->get_option( 'first_show_welcome_page', false ) ) {
|
@@ -34,13 +34,21 @@ class WP_Statistics_Welcome {
|
|
34 |
* Welcome page
|
35 |
*/
|
36 |
public static function page_callback() {
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
include( WP_Statistics::$reg['plugin-dir'] . "includes/templates/welcome.php" );
|
46 |
}
|
15 |
$WP_Statistics->update_option( 'show_welcome_page', false );
|
16 |
|
17 |
// Redirect to welcome page
|
18 |
+
wp_redirect( WP_Statistics_Admin_Pages::admin_url( 'wps_welcome' ) );
|
19 |
}
|
20 |
|
21 |
if ( ! $WP_Statistics->get_option( 'first_show_welcome_page', false ) ) {
|
34 |
* Welcome page
|
35 |
*/
|
36 |
public static function page_callback() {
|
37 |
+
$response = wp_remote_get( 'https://wp-statistics.com/wp-json/plugin/addons' );
|
38 |
+
$response_code = wp_remote_retrieve_response_code( $response );
|
39 |
+
$error = null;
|
40 |
+
$plugins = array();
|
41 |
+
|
42 |
+
// Check response
|
43 |
+
if ( is_wp_error( $response ) ) {
|
44 |
+
$error = $response->get_error_message();
|
45 |
+
} else {
|
46 |
+
if ( $response_code == '200' ) {
|
47 |
+
$plugins = json_decode( $response['body'] );
|
48 |
+
} else {
|
49 |
+
$error = $response['body'];
|
50 |
+
}
|
51 |
+
}
|
52 |
|
53 |
include( WP_Statistics::$reg['plugin-dir'] . "includes/templates/welcome.php" );
|
54 |
}
|
includes/classes/class-wp-statistics.php
CHANGED
@@ -9,7 +9,6 @@
|
|
9 |
*/
|
10 |
class WP_Statistics {
|
11 |
|
12 |
-
// Setup our protected, private and public variables.
|
13 |
/**
|
14 |
* IP address of visitor
|
15 |
*
|
@@ -139,29 +138,22 @@ class WP_Statistics {
|
|
139 |
*/
|
140 |
public function __construct() {
|
141 |
if ( ! isset( WP_Statistics::$reg['plugin-url'] ) ) {
|
142 |
-
|
143 |
-
|
144 |
-
*/
|
145 |
-
WP_Statistics::$reg['plugin-url'] = plugin_dir_url( WP_STATISTICS_MAIN_FILE );
|
146 |
-
//define('WP_STATISTICS_PLUGIN_URL', plugin_dir_url(WP_STATISTICS_MAIN_FILE));
|
147 |
-
/**
|
148 |
-
* Plugin DIR
|
149 |
-
*/
|
150 |
-
WP_Statistics::$reg['plugin-dir'] = plugin_dir_path( WP_STATISTICS_MAIN_FILE );
|
151 |
-
//define('WP_STATISTICS_PLUGIN_DIR', plugin_dir_path(WP_STATISTICS_MAIN_FILE));
|
152 |
-
/**
|
153 |
-
* Plugin Main File
|
154 |
-
*/
|
155 |
-
WP_Statistics::$reg['main-file'] = WP_STATISTICS_MAIN_FILE;
|
156 |
-
/**
|
157 |
-
* WP Statistics Version
|
158 |
-
*/
|
159 |
if ( ! function_exists( 'get_plugin_data' ) ) {
|
160 |
require( ABSPATH . 'wp-admin/includes/plugin.php' );
|
161 |
}
|
162 |
-
|
163 |
-
|
164 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
}
|
167 |
|
@@ -171,12 +163,6 @@ class WP_Statistics {
|
|
171 |
public function run() {
|
172 |
global $WP_Statistics;
|
173 |
|
174 |
-
/**
|
175 |
-
* Required PHP Version
|
176 |
-
*/
|
177 |
-
WP_Statistics::$reg['required-php-version'] = '5.4.0';
|
178 |
-
//define('WP_STATISTICS_REQUIRED_PHP_VERSION', '5.4.0');
|
179 |
-
|
180 |
// Check the PHP version,
|
181 |
// if we don't meet the minimum version to run WP Statistics return so we don't cause a critical error.
|
182 |
if ( ! version_compare( phpversion(), WP_Statistics::$reg['required-php-version'], ">=" ) ) {
|
@@ -216,11 +202,8 @@ class WP_Statistics {
|
|
216 |
//Set Pages
|
217 |
$this->set_pages();
|
218 |
|
219 |
-
//
|
220 |
-
|
221 |
-
// so we can export data before and set the headers without
|
222 |
-
// worrying about bugs in other plugins that output text and don't allow us to set the headers.
|
223 |
-
add_action( 'init', array( $this, 'init' ), 9 );
|
224 |
|
225 |
// Load the rest of the required files for our global functions,
|
226 |
// online user tracking and hit tracking.
|
@@ -228,9 +211,16 @@ class WP_Statistics {
|
|
228 |
include WP_Statistics::$reg['plugin-dir'] . 'includes/functions/functions.php';
|
229 |
}
|
230 |
|
|
|
|
|
|
|
|
|
231 |
$this->agent = $this->get_UserAgent();
|
232 |
$WP_Statistics = $this;
|
233 |
|
|
|
|
|
|
|
234 |
if ( is_admin() ) {
|
235 |
// JUST ADMIN AREA
|
236 |
new WP_Statistics_Admin;
|
@@ -239,11 +229,15 @@ class WP_Statistics {
|
|
239 |
new WP_Statistics_Frontend;
|
240 |
}
|
241 |
|
|
|
242 |
if ( $WP_Statistics->get_option( 'menu_bar' ) ) {
|
243 |
-
add_action( 'admin_bar_menu', '
|
244 |
}
|
245 |
|
246 |
-
|
|
|
|
|
|
|
247 |
add_shortcode( 'wpstatistics', 'WP_Statistics_Shortcode::shortcodes' );
|
248 |
}
|
249 |
|
@@ -253,14 +247,10 @@ class WP_Statistics {
|
|
253 |
* @param string $class Class name
|
254 |
*/
|
255 |
public function autoload( $class ) {
|
256 |
-
|
257 |
-
|
258 |
-
) {
|
259 |
$lower_class_name = str_replace( '_', '-', strtolower( $class ) );
|
260 |
-
$class_full_path = WP_Statistics::$reg['plugin-dir'] .
|
261 |
-
'includes/classes/class-' .
|
262 |
-
$lower_class_name .
|
263 |
-
'.php';
|
264 |
if ( file_exists( $class_full_path ) ) {
|
265 |
require $class_full_path;
|
266 |
}
|
@@ -268,9 +258,9 @@ class WP_Statistics {
|
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
-
* Loads the
|
272 |
*/
|
273 |
-
public function
|
274 |
load_plugin_textdomain( 'wp-statistics', false, WP_Statistics::$reg['plugin-dir'] . 'languages' );
|
275 |
}
|
276 |
|
@@ -300,106 +290,38 @@ class WP_Statistics {
|
|
300 |
*/
|
301 |
public function set_pages() {
|
302 |
if ( ! isset( WP_Statistics::$page['overview'] ) ) {
|
|
|
303 |
/**
|
304 |
-
*
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
* Browsers Page
|
310 |
-
*/
|
311 |
-
WP_Statistics::$page['browser'] = 'wps_browsers_page';
|
312 |
-
//define('WP_STATISTICS_BROWSERS_PAGE', 'wps_browsers_page');
|
313 |
-
/**
|
314 |
-
* Countries Page
|
315 |
-
*/
|
316 |
-
WP_Statistics::$page['countries'] = 'wps_countries_page';
|
317 |
-
//define('WP_STATISTICS_COUNTRIES_PAGE', 'wps_countries_page');
|
318 |
-
/**
|
319 |
-
* Exclusions Page
|
320 |
-
*/
|
321 |
-
WP_Statistics::$page['exclusions'] = 'wps_exclusions_page';
|
322 |
-
//define('WP_STATISTICS_EXCLUSIONS_PAGE', 'wps_exclusions_page');
|
323 |
-
/**
|
324 |
-
* Hits Page
|
325 |
-
*/
|
326 |
-
WP_Statistics::$page['hits'] = 'wps_hits_page';
|
327 |
-
//define('WP_STATISTICS_HITS_PAGE', 'wps_hits_page');
|
328 |
-
/**
|
329 |
-
* Online Page
|
330 |
-
*/
|
331 |
-
WP_Statistics::$page['online'] = 'wps_online_page';
|
332 |
-
//define('WP_STATISTICS_ONLINE_PAGE', 'wps_online_page');
|
333 |
-
/**
|
334 |
-
* Pages Page
|
335 |
-
*/
|
336 |
-
WP_Statistics::$page['pages'] = 'wps_pages_page';
|
337 |
-
//define('WP_STATISTICS_PAGES_PAGE', 'wps_pages_page');
|
338 |
-
/**
|
339 |
-
* Categories Page
|
340 |
-
*/
|
341 |
-
WP_Statistics::$page['categories'] = 'wps_categories_page';
|
342 |
-
//define('WP_STATISTICS_CATEGORIES_PAGE', 'wps_categories_page');
|
343 |
-
/**
|
344 |
-
* Authors Page
|
345 |
-
*/
|
346 |
-
WP_Statistics::$page['authors'] = 'wps_authors_page';
|
347 |
-
//define('WP_STATISTICS_AUTHORS_PAGE', 'wps_authors_page');
|
348 |
-
/**
|
349 |
-
* Tags Page
|
350 |
-
*/
|
351 |
-
WP_Statistics::$page['tags'] = 'wps_tags_page';
|
352 |
-
//define('WP_STATISTICS_TAGS_PAGE', 'wps_tags_page');
|
353 |
-
/**
|
354 |
-
* Referer Page
|
355 |
-
*/
|
356 |
-
WP_Statistics::$page['referrers'] = 'wps_referrers_page';
|
357 |
-
//define('WP_STATISTICS_REFERRERS_PAGE', 'wps_referrers_page');
|
358 |
-
/**
|
359 |
-
* Searched Words Page
|
360 |
-
*/
|
361 |
-
WP_Statistics::$page['searched-phrases'] = 'wps_searched_phrases_page';
|
362 |
-
//define('WP_STATISTICS_SEARCHED_PHRASES_PAGE', 'wps_searched_phrases_page');
|
363 |
-
/**
|
364 |
-
* Searches Page
|
365 |
-
*/
|
366 |
-
WP_Statistics::$page['searches'] = 'wps_searches_page';
|
367 |
-
//define('WP_STATISTICS_SEARCHES_PAGE', 'wps_searches_page');
|
368 |
-
/**
|
369 |
-
* Words Page
|
370 |
-
*/
|
371 |
-
WP_Statistics::$page['words'] = 'wps_words_page';
|
372 |
-
//define('WP_STATISTICS_WORDS_PAGE', 'wps_words_page');
|
373 |
-
/**
|
374 |
-
* Top Visitors Page
|
375 |
-
*/
|
376 |
-
WP_Statistics::$page['top-visitors'] = 'wps_top_visitors_page';
|
377 |
-
//define('WP_STATISTICS_TOP_VISITORS_PAGE', 'wps_top_visitors_page');
|
378 |
-
/**
|
379 |
-
* Visitors Page
|
380 |
-
*/
|
381 |
-
WP_Statistics::$page['visitors'] = 'wps_visitors_page';
|
382 |
-
//define('WP_STATISTICS_VISITORS_PAGE', 'wps_visitors_page');
|
383 |
-
/**
|
384 |
-
* Optimization Page
|
385 |
-
*/
|
386 |
-
WP_Statistics::$page['optimization'] = 'wps_optimization_page';
|
387 |
-
//define('WP_STATISTICS_OPTIMIZATION_PAGE', 'wps_optimization_page');
|
388 |
-
/**
|
389 |
-
* Settings Page
|
390 |
-
*/
|
391 |
-
WP_Statistics::$page['settings'] = 'wps_settings_page';
|
392 |
-
//define('WP_STATISTICS_SETTINGS_PAGE', 'wps_settings_page');
|
393 |
-
/**
|
394 |
-
* Plugins Page
|
395 |
-
*/
|
396 |
-
WP_Statistics::$page['plugins'] = 'wps_plugins_page';
|
397 |
-
//define('WP_STATISTICS_PLUGINS_PAGE', 'wps_plugins_page');
|
398 |
-
/**
|
399 |
-
* Donate Page
|
400 |
*/
|
401 |
-
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
}
|
404 |
}
|
405 |
|
@@ -448,13 +370,13 @@ class WP_Statistics {
|
|
448 |
/**
|
449 |
* Registers Widget
|
450 |
*/
|
451 |
-
|
452 |
register_widget( 'WP_Statistics_Widget' );
|
453 |
}
|
454 |
|
455 |
/**
|
456 |
* geo ip Loader
|
457 |
-
|
458 |
* @param $pack
|
459 |
* @return bool|\GeoIp2\Database\Reader
|
460 |
*/
|
@@ -766,7 +688,7 @@ class WP_Statistics {
|
|
766 |
$options['visits'] = true;
|
767 |
$options['visitors'] = true;
|
768 |
$options['pages'] = true;
|
769 |
-
$options['check_online'] = '
|
770 |
$options['menu_bar'] = false;
|
771 |
$options['coefficient'] = '1';
|
772 |
$options['stats_report'] = false;
|
@@ -848,7 +770,7 @@ class WP_Statistics {
|
|
848 |
*/
|
849 |
public function get_IP() {
|
850 |
|
851 |
-
//Check If Rest Request
|
852 |
if ( $this->restapi->is_rest() ) {
|
853 |
$this->ip = $this->restapi->params( 'ip' );
|
854 |
|
@@ -860,17 +782,6 @@ class WP_Statistics {
|
|
860 |
return $this->ip;
|
861 |
}
|
862 |
|
863 |
-
$temp_ip = false;
|
864 |
-
|
865 |
-
// By default we use the remote address the server has.
|
866 |
-
if ( array_key_exists( 'REMOTE_ADDR', $_SERVER ) ) {
|
867 |
-
$temp_ip = $this->get_ip_value( $_SERVER['REMOTE_ADDR'] );
|
868 |
-
}
|
869 |
-
|
870 |
-
if ( false !== $temp_ip ) {
|
871 |
-
$this->ip = $temp_ip;
|
872 |
-
}
|
873 |
-
|
874 |
/* Check to see if any of the HTTP headers are set to identify the remote user.
|
875 |
* These often give better results as they can identify the remote user even through firewalls etc,
|
876 |
* but are sometimes used in SQL injection attacks.
|
@@ -880,6 +791,7 @@ class WP_Statistics {
|
|
880 |
*
|
881 |
*/
|
882 |
$envs = array(
|
|
|
883 |
'HTTP_CLIENT_IP',
|
884 |
'HTTP_X_FORWARDED_FOR',
|
885 |
'HTTP_X_FORWARDED',
|
@@ -887,14 +799,13 @@ class WP_Statistics {
|
|
887 |
'HTTP_FORWARDED',
|
888 |
'HTTP_X_REAL_IP',
|
889 |
);
|
890 |
-
|
891 |
foreach ( $envs as $env ) {
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
}
|
899 |
}
|
900 |
|
@@ -944,8 +855,10 @@ class WP_Statistics {
|
|
944 |
// Check function exist.
|
945 |
if ( function_exists( 'getallheaders' ) ) {
|
946 |
$user_agent = getallheaders();
|
947 |
-
}
|
948 |
$user_agent = $_SERVER['HTTP_USER_AGENT'];
|
|
|
|
|
949 |
}
|
950 |
|
951 |
$result = new WhichBrowser\Parser( $user_agent );
|
@@ -1288,16 +1201,12 @@ class WP_Statistics {
|
|
1288 |
global $wpdb;
|
1289 |
|
1290 |
$count = 0;
|
1291 |
-
|
1292 |
switch ( $type ) {
|
1293 |
case 'visitors':
|
1294 |
if ( array_key_exists( 'visitors', $this->historical ) ) {
|
1295 |
return $this->historical['visitors'];
|
1296 |
} else {
|
1297 |
-
$result
|
1298 |
-
= $wpdb->get_var(
|
1299 |
-
"SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'visitors'"
|
1300 |
-
);
|
1301 |
if ( $result > $count ) {
|
1302 |
$count = $result;
|
1303 |
}
|
@@ -1309,10 +1218,7 @@ class WP_Statistics {
|
|
1309 |
if ( array_key_exists( 'visits', $this->historical ) ) {
|
1310 |
return $this->historical['visits'];
|
1311 |
} else {
|
1312 |
-
$result
|
1313 |
-
= $wpdb->get_var(
|
1314 |
-
"SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'visits'"
|
1315 |
-
);
|
1316 |
if ( $result > $count ) {
|
1317 |
$count = $result;
|
1318 |
}
|
@@ -1324,13 +1230,7 @@ class WP_Statistics {
|
|
1324 |
if ( array_key_exists( $id, $this->historical ) ) {
|
1325 |
return $this->historical[ $id ];
|
1326 |
} else {
|
1327 |
-
$result
|
1328 |
-
= $wpdb->get_var(
|
1329 |
-
$wpdb->prepare(
|
1330 |
-
"SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'uri' AND uri = %s",
|
1331 |
-
$id
|
1332 |
-
)
|
1333 |
-
);
|
1334 |
if ( $result > $count ) {
|
1335 |
$count = $result;
|
1336 |
}
|
@@ -1342,13 +1242,7 @@ class WP_Statistics {
|
|
1342 |
if ( array_key_exists( $id, $this->historical ) ) {
|
1343 |
return $this->historical[ $id ];
|
1344 |
} else {
|
1345 |
-
$result
|
1346 |
-
= $wpdb->get_var(
|
1347 |
-
$wpdb->prepare(
|
1348 |
-
"SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'uri' AND page_id = %d",
|
1349 |
-
$id
|
1350 |
-
)
|
1351 |
-
);
|
1352 |
if ( $result > $count ) {
|
1353 |
$count = $result;
|
1354 |
}
|
@@ -1382,20 +1276,17 @@ class WP_Statistics {
|
|
1382 |
* @return array
|
1383 |
*/
|
1384 |
public function get_wp_sites_list() {
|
1385 |
-
|
1386 |
-
|
1387 |
$site_list = array();
|
1388 |
|
1389 |
// wp_get_sites() is deprecated in 4.6 or above and replaced with get_sites().
|
1390 |
if ( version_compare( $wp_version, '4.6', '>=' ) ) {
|
1391 |
$sites = get_sites();
|
1392 |
-
|
1393 |
foreach ( $sites as $site ) {
|
1394 |
$site_list[] = $site->blog_id;
|
1395 |
}
|
1396 |
} else {
|
1397 |
$sites = wp_get_sites();
|
1398 |
-
|
1399 |
foreach ( $sites as $site ) {
|
1400 |
$site_list[] = $site['blog_id'];
|
1401 |
}
|
@@ -1433,12 +1324,12 @@ class WP_Statistics {
|
|
1433 |
/**
|
1434 |
* Get referrer link
|
1435 |
*
|
1436 |
-
* @param
|
1437 |
-
* @param
|
1438 |
-
*
|
1439 |
* @return string
|
1440 |
*/
|
1441 |
-
public function get_referrer_link( $referrer ) {
|
1442 |
$html_referrer = $this->html_sanitize_referrer( $referrer );
|
1443 |
|
1444 |
if ( substr( $html_referrer, 0, 7 ) !== 'http://' and substr( $html_referrer, 0, 8 ) !== 'https://' ) {
|
@@ -1449,8 +1340,8 @@ class WP_Statistics {
|
|
1449 |
}
|
1450 |
|
1451 |
$base_url = parse_url( $html_nr_referrer );
|
1452 |
-
|
1453 |
-
return "<a href='{$html_nr_referrer}' title='{$
|
1454 |
}
|
1455 |
|
1456 |
|
@@ -1460,37 +1351,19 @@ class WP_Statistics {
|
|
1460 |
static function unsupported_version_admin_notice() {
|
1461 |
|
1462 |
$screen = get_current_screen();
|
1463 |
-
|
1464 |
if ( 'plugins' !== $screen->id ) {
|
1465 |
return;
|
1466 |
}
|
1467 |
?>
|
1468 |
<div class="error">
|
1469 |
<p style="max-width:800px;">
|
1470 |
-
<b><?php _e(
|
1471 |
-
'WP Statistics Disabled',
|
1472 |
-
'wp-statistics'
|
1473 |
-
); ?></b> <?php _e(
|
1474 |
-
'— You are running an unsupported version of PHP.',
|
1475 |
-
'wp-statistics'
|
1476 |
-
); ?>
|
1477 |
</p>
|
1478 |
|
1479 |
<p style="max-width:800px;"><?php
|
1480 |
-
|
1481 |
-
echo sprintf(
|
1482 |
-
__(
|
1483 |
-
'WP Statistics has detected PHP version %s which is unsupported, WP Statistics requires PHP Version %s or higher!',
|
1484 |
-
'wp-statistics'
|
1485 |
-
),
|
1486 |
-
phpversion(),
|
1487 |
-
WP_Statistics::$reg['required-php-version']
|
1488 |
-
);
|
1489 |
echo '</p><p>';
|
1490 |
-
echo __(
|
1491 |
-
'Please contact your hosting provider to upgrade to a supported version or disable WP Statistics to remove this message.',
|
1492 |
-
'wp-statistics'
|
1493 |
-
);
|
1494 |
?></p>
|
1495 |
</div>
|
1496 |
|
@@ -1500,104 +1373,135 @@ class WP_Statistics {
|
|
1500 |
/**
|
1501 |
* Adds the admin bar menu if the user has selected it.
|
1502 |
*/
|
1503 |
-
|
1504 |
-
|
1505 |
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1520 |
)
|
1521 |
-
)
|
1522 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1523 |
|
1524 |
-
|
|
|
1525 |
|
1526 |
-
|
|
|
1527 |
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
)
|
1535 |
-
);
|
1536 |
-
} else {
|
1537 |
-
$wp_admin_bar->add_menu(
|
1538 |
-
array(
|
1539 |
-
'id' => 'wp-statistic-menu',
|
1540 |
-
'title' => '<img src="' . WP_Statistics::$reg['plugin-url'] . 'assets/images/icon.png"/>',
|
1541 |
-
'href' => $AdminURL . 'admin.php?page=' . WP_Statistics::$page['overview'],
|
1542 |
-
)
|
1543 |
-
);
|
1544 |
}
|
1545 |
|
1546 |
-
|
1547 |
-
|
1548 |
-
'id' => 'wp-statistics-menu-useronline',
|
1549 |
-
'parent' => 'wp-statistic-menu',
|
1550 |
-
'title' => __(
|
1551 |
-
'Online User',
|
1552 |
-
'wp-statistics'
|
1553 |
-
) . ": " . wp_statistics_useronline(),
|
1554 |
-
'href' => $AdminURL . 'admin.php?page=' . WP_Statistics::$page['online'],
|
1555 |
-
)
|
1556 |
-
);
|
1557 |
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
|
1566 |
-
|
1567 |
-
|
1568 |
-
'id' => 'wp-statistics-menu-todayvisit',
|
1569 |
-
'parent' => 'wp-statistic-menu',
|
1570 |
-
'title' => __( 'Today\'s Visits', 'wp-statistics' ) . ": " . wp_statistics_visit( 'today' ),
|
1571 |
-
)
|
1572 |
-
);
|
1573 |
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
'title' => __( 'Yesterday\'s Visitors', 'wp-statistics' ) . ": " . wp_statistics_visitor(
|
1579 |
-
'yesterday'
|
1580 |
-
),
|
1581 |
-
)
|
1582 |
-
);
|
1583 |
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
);
|
1591 |
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1599 |
);
|
1600 |
}
|
|
|
|
|
1601 |
}
|
1602 |
|
1603 |
}
|
9 |
*/
|
10 |
class WP_Statistics {
|
11 |
|
|
|
12 |
/**
|
13 |
* IP address of visitor
|
14 |
*
|
138 |
*/
|
139 |
public function __construct() {
|
140 |
if ( ! isset( WP_Statistics::$reg['plugin-url'] ) ) {
|
141 |
+
|
142 |
+
//Get Plugin Data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
if ( ! function_exists( 'get_plugin_data' ) ) {
|
144 |
require( ABSPATH . 'wp-admin/includes/plugin.php' );
|
145 |
}
|
146 |
+
$plugin_data = get_plugin_data( WP_STATISTICS_MAIN_FILE );
|
147 |
+
|
148 |
+
//Prepare Plugin config
|
149 |
+
WP_Statistics::$reg = array(
|
150 |
+
'plugin-data' => $plugin_data,
|
151 |
+
'plugin-url' => plugin_dir_url( WP_STATISTICS_MAIN_FILE ),
|
152 |
+
'plugin-dir' => plugin_dir_path( WP_STATISTICS_MAIN_FILE ),
|
153 |
+
'main-file' => WP_STATISTICS_MAIN_FILE,
|
154 |
+
'version' => $plugin_data['Version'],
|
155 |
+
'required-php-version' => '5.4.0',
|
156 |
+
);
|
157 |
}
|
158 |
}
|
159 |
|
163 |
public function run() {
|
164 |
global $WP_Statistics;
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
// Check the PHP version,
|
167 |
// if we don't meet the minimum version to run WP Statistics return so we don't cause a critical error.
|
168 |
if ( ! version_compare( phpversion(), WP_Statistics::$reg['required-php-version'], ">=" ) ) {
|
202 |
//Set Pages
|
203 |
$this->set_pages();
|
204 |
|
205 |
+
// Load Plugin Text Domain
|
206 |
+
add_action( 'init', array( $this, 'load_textdomain' ) );
|
|
|
|
|
|
|
207 |
|
208 |
// Load the rest of the required files for our global functions,
|
209 |
// online user tracking and hit tracking.
|
211 |
include WP_Statistics::$reg['plugin-dir'] . 'includes/functions/functions.php';
|
212 |
}
|
213 |
|
214 |
+
//Reset User Online Count
|
215 |
+
add_action( 'wp_loaded', array( $this, 'reset_user_online' ) );
|
216 |
+
|
217 |
+
//Get Current User Agent
|
218 |
$this->agent = $this->get_UserAgent();
|
219 |
$WP_Statistics = $this;
|
220 |
|
221 |
+
//Load WP_Statistics_Schedule
|
222 |
+
new WP_Statistics_Schedule;
|
223 |
+
|
224 |
if ( is_admin() ) {
|
225 |
// JUST ADMIN AREA
|
226 |
new WP_Statistics_Admin;
|
229 |
new WP_Statistics_Frontend;
|
230 |
}
|
231 |
|
232 |
+
//Show Wordpress Admin Bar
|
233 |
if ( $WP_Statistics->get_option( 'menu_bar' ) ) {
|
234 |
+
add_action( 'admin_bar_menu', array( $this, 'menubar' ), 20 );
|
235 |
}
|
236 |
|
237 |
+
//Add Wp-statistics Widget
|
238 |
+
add_action( 'widgets_init', array( $this, 'widget' ) );
|
239 |
+
|
240 |
+
//Add Short Code `wpstatistics`
|
241 |
add_shortcode( 'wpstatistics', 'WP_Statistics_Shortcode::shortcodes' );
|
242 |
}
|
243 |
|
247 |
* @param string $class Class name
|
248 |
*/
|
249 |
public function autoload( $class ) {
|
250 |
+
// This check is for performance of loading plugin classes
|
251 |
+
if ( ! class_exists( $class ) && substr( $class, 0, 14 ) === 'WP_Statistics_' ) {
|
|
|
252 |
$lower_class_name = str_replace( '_', '-', strtolower( $class ) );
|
253 |
+
$class_full_path = WP_Statistics::$reg['plugin-dir'] . 'includes/classes/class-' . $lower_class_name . '.php';
|
|
|
|
|
|
|
254 |
if ( file_exists( $class_full_path ) ) {
|
255 |
require $class_full_path;
|
256 |
}
|
258 |
}
|
259 |
|
260 |
/**
|
261 |
+
* Loads the load_plugin_textdomain code.
|
262 |
*/
|
263 |
+
public function load_textdomain() {
|
264 |
load_plugin_textdomain( 'wp-statistics', false, WP_Statistics::$reg['plugin-dir'] . 'languages' );
|
265 |
}
|
266 |
|
290 |
*/
|
291 |
public function set_pages() {
|
292 |
if ( ! isset( WP_Statistics::$page['overview'] ) ) {
|
293 |
+
|
294 |
/**
|
295 |
+
* List Of Admin Page Slug WP-statistics
|
296 |
+
*
|
297 |
+
* -- Array Arg ---
|
298 |
+
* key : page key for using another methods
|
299 |
+
* value : Admin Page Slug
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
*/
|
301 |
+
$list = array(
|
302 |
+
'overview' => 'overview',
|
303 |
+
'browser' => 'browsers',
|
304 |
+
'countries' => 'countries',
|
305 |
+
'exclusions' => 'exclusions',
|
306 |
+
'hits' => 'hits',
|
307 |
+
'online' => 'online',
|
308 |
+
'pages' => 'pages',
|
309 |
+
'categories' => 'categories',
|
310 |
+
'authors' => 'authors',
|
311 |
+
'tags' => 'tags',
|
312 |
+
'referrers' => 'referrers',
|
313 |
+
'searches' => 'searches',
|
314 |
+
'words' => 'words',
|
315 |
+
'top-visitors' => 'top_visitors',
|
316 |
+
'visitors' => 'visitors',
|
317 |
+
'optimization' => 'optimization',
|
318 |
+
'settings' => 'settings',
|
319 |
+
'plugins' => 'plugins',
|
320 |
+
'donate' => 'donate',
|
321 |
+
);
|
322 |
+
foreach ( $list as $page_key => $page_slug ) {
|
323 |
+
WP_Statistics::$page[ $page_key ] = 'wps_' . $page_slug . '_page';
|
324 |
+
}
|
325 |
}
|
326 |
}
|
327 |
|
370 |
/**
|
371 |
* Registers Widget
|
372 |
*/
|
373 |
+
public function widget() {
|
374 |
register_widget( 'WP_Statistics_Widget' );
|
375 |
}
|
376 |
|
377 |
/**
|
378 |
* geo ip Loader
|
379 |
+
*
|
380 |
* @param $pack
|
381 |
* @return bool|\GeoIp2\Database\Reader
|
382 |
*/
|
688 |
$options['visits'] = true;
|
689 |
$options['visitors'] = true;
|
690 |
$options['pages'] = true;
|
691 |
+
$options['check_online'] = '120';
|
692 |
$options['menu_bar'] = false;
|
693 |
$options['coefficient'] = '1';
|
694 |
$options['stats_report'] = false;
|
770 |
*/
|
771 |
public function get_IP() {
|
772 |
|
773 |
+
//Check If Rest Api Request
|
774 |
if ( $this->restapi->is_rest() ) {
|
775 |
$this->ip = $this->restapi->params( 'ip' );
|
776 |
|
782 |
return $this->ip;
|
783 |
}
|
784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
785 |
/* Check to see if any of the HTTP headers are set to identify the remote user.
|
786 |
* These often give better results as they can identify the remote user even through firewalls etc,
|
787 |
* but are sometimes used in SQL injection attacks.
|
791 |
*
|
792 |
*/
|
793 |
$envs = array(
|
794 |
+
'REMOTE_ADDR',
|
795 |
'HTTP_CLIENT_IP',
|
796 |
'HTTP_X_FORWARDED_FOR',
|
797 |
'HTTP_X_FORWARDED',
|
799 |
'HTTP_FORWARDED',
|
800 |
'HTTP_X_REAL_IP',
|
801 |
);
|
|
|
802 |
foreach ( $envs as $env ) {
|
803 |
+
if ( array_key_exists( $env, $_SERVER ) ) {
|
804 |
+
$check_ip = $this->get_ip_value( getenv( $env ) );
|
805 |
+
if ( $check_ip != false ) {
|
806 |
+
$this->ip = $check_ip;
|
807 |
+
break;
|
808 |
+
}
|
809 |
}
|
810 |
}
|
811 |
|
855 |
// Check function exist.
|
856 |
if ( function_exists( 'getallheaders' ) ) {
|
857 |
$user_agent = getallheaders();
|
858 |
+
} elseif ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
|
859 |
$user_agent = $_SERVER['HTTP_USER_AGENT'];
|
860 |
+
} else {
|
861 |
+
$user_agent = '';
|
862 |
}
|
863 |
|
864 |
$result = new WhichBrowser\Parser( $user_agent );
|
1201 |
global $wpdb;
|
1202 |
|
1203 |
$count = 0;
|
|
|
1204 |
switch ( $type ) {
|
1205 |
case 'visitors':
|
1206 |
if ( array_key_exists( 'visitors', $this->historical ) ) {
|
1207 |
return $this->historical['visitors'];
|
1208 |
} else {
|
1209 |
+
$result = $wpdb->get_var( "SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'visitors'" );
|
|
|
|
|
|
|
1210 |
if ( $result > $count ) {
|
1211 |
$count = $result;
|
1212 |
}
|
1218 |
if ( array_key_exists( 'visits', $this->historical ) ) {
|
1219 |
return $this->historical['visits'];
|
1220 |
} else {
|
1221 |
+
$result = $wpdb->get_var( "SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'visits'" );
|
|
|
|
|
|
|
1222 |
if ( $result > $count ) {
|
1223 |
$count = $result;
|
1224 |
}
|
1230 |
if ( array_key_exists( $id, $this->historical ) ) {
|
1231 |
return $this->historical[ $id ];
|
1232 |
} else {
|
1233 |
+
$result = $wpdb->get_var( $wpdb->prepare( "SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'uri' AND uri = %s", $id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
1234 |
if ( $result > $count ) {
|
1235 |
$count = $result;
|
1236 |
}
|
1242 |
if ( array_key_exists( $id, $this->historical ) ) {
|
1243 |
return $this->historical[ $id ];
|
1244 |
} else {
|
1245 |
+
$result = $wpdb->get_var( $wpdb->prepare( "SELECT value FROM {$wpdb->prefix}statistics_historical WHERE category = 'uri' AND page_id = %d", $id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
1246 |
if ( $result > $count ) {
|
1247 |
$count = $result;
|
1248 |
}
|
1276 |
* @return array
|
1277 |
*/
|
1278 |
public function get_wp_sites_list() {
|
1279 |
+
global $wp_version;
|
|
|
1280 |
$site_list = array();
|
1281 |
|
1282 |
// wp_get_sites() is deprecated in 4.6 or above and replaced with get_sites().
|
1283 |
if ( version_compare( $wp_version, '4.6', '>=' ) ) {
|
1284 |
$sites = get_sites();
|
|
|
1285 |
foreach ( $sites as $site ) {
|
1286 |
$site_list[] = $site->blog_id;
|
1287 |
}
|
1288 |
} else {
|
1289 |
$sites = wp_get_sites();
|
|
|
1290 |
foreach ( $sites as $site ) {
|
1291 |
$site_list[] = $site['blog_id'];
|
1292 |
}
|
1324 |
/**
|
1325 |
* Get referrer link
|
1326 |
*
|
1327 |
+
* @param string $referrer
|
1328 |
+
* @param string $title
|
1329 |
+
* @param bool $is_blank
|
1330 |
* @return string
|
1331 |
*/
|
1332 |
+
public function get_referrer_link( $referrer, $title = '', $is_blank = false ) {
|
1333 |
$html_referrer = $this->html_sanitize_referrer( $referrer );
|
1334 |
|
1335 |
if ( substr( $html_referrer, 0, 7 ) !== 'http://' and substr( $html_referrer, 0, 8 ) !== 'https://' ) {
|
1340 |
}
|
1341 |
|
1342 |
$base_url = parse_url( $html_nr_referrer );
|
1343 |
+
$title = ( trim( $title ) == "" ? $html_nr_referrer : $title );
|
1344 |
+
return "<a href='{$html_nr_referrer}' title='{$title}'" . ( $is_blank === true ? ' target="_blank"' : '' ) . ">{$base_url['host']}</a>";
|
1345 |
}
|
1346 |
|
1347 |
|
1351 |
static function unsupported_version_admin_notice() {
|
1352 |
|
1353 |
$screen = get_current_screen();
|
|
|
1354 |
if ( 'plugins' !== $screen->id ) {
|
1355 |
return;
|
1356 |
}
|
1357 |
?>
|
1358 |
<div class="error">
|
1359 |
<p style="max-width:800px;">
|
1360 |
+
<b><?php _e( 'WP Statistics Disabled', 'wp-statistics' ); ?></b> <?php _e( '— You are running an unsupported version of PHP.', 'wp-statistics' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
1361 |
</p>
|
1362 |
|
1363 |
<p style="max-width:800px;"><?php
|
1364 |
+
echo sprintf( __( 'WP Statistics has detected PHP version %s which is unsupported, WP Statistics requires PHP Version %s or higher!', 'wp-statistics' ), phpversion(), WP_Statistics::$reg['required-php-version'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
echo '</p><p>';
|
1366 |
+
echo __( 'Please contact your hosting provider to upgrade to a supported version or disable WP Statistics to remove this message.', 'wp-statistics' );
|
|
|
|
|
|
|
1367 |
?></p>
|
1368 |
</div>
|
1369 |
|
1373 |
/**
|
1374 |
* Adds the admin bar menu if the user has selected it.
|
1375 |
*/
|
1376 |
+
public function menubar() {
|
1377 |
+
global $wp_admin_bar;
|
1378 |
|
1379 |
+
if ( is_admin_bar_showing() && ( wp_statistics_check_access_user() ) ) {
|
1380 |
+
|
1381 |
+
/**
|
1382 |
+
* List Of Admin Bar Wordpress
|
1383 |
+
*
|
1384 |
+
* --- Array Arg ---
|
1385 |
+
* Key : ID of Admin bar
|
1386 |
+
*/
|
1387 |
+
$admin_bar_list = array(
|
1388 |
+
'wp-statistic-menu' => array(
|
1389 |
+
'title' => '<span class="ab-icon"></span>',
|
1390 |
+
'href' => WP_Statistics_Admin_Pages::admin_url( 'overview' )
|
1391 |
+
),
|
1392 |
+
'wp-statistics-menu-useronline' => array(
|
1393 |
+
'parent' => 'wp-statistic-menu',
|
1394 |
+
'title' => __( 'Online User', 'wp-statistics' ) . ": " . wp_statistics_useronline(),
|
1395 |
+
'href' => WP_Statistics_Admin_Pages::admin_url( 'online' )
|
1396 |
+
),
|
1397 |
+
'wp-statistics-menu-todayvisitor' => array(
|
1398 |
+
'parent' => 'wp-statistic-menu',
|
1399 |
+
'title' => __( 'Today\'s Visitors', 'wp-statistics' ) . ": " . wp_statistics_visitor( 'today' ),
|
1400 |
+
),
|
1401 |
+
'wp-statistics-menu-todayvisit' => array(
|
1402 |
+
'parent' => 'wp-statistic-menu',
|
1403 |
+
'title' => __( 'Today\'s Visits', 'wp-statistics' ) . ": " . wp_statistics_visit( 'today' )
|
1404 |
+
),
|
1405 |
+
'wp-statistics-menu-yesterdayvisitor' => array(
|
1406 |
+
'parent' => 'wp-statistic-menu',
|
1407 |
+
'title' => __( 'Yesterday\'s Visitors', 'wp-statistics' ) . ": " . wp_statistics_visitor( 'yesterday' ),
|
1408 |
+
),
|
1409 |
+
'wp-statistics-menu-yesterdayvisit' => array(
|
1410 |
+
'parent' => 'wp-statistic-menu',
|
1411 |
+
'title' => __( 'Yesterday\'s Visits', 'wp-statistics' ) . ": " . wp_statistics_visit( 'yesterday' )
|
1412 |
+
),
|
1413 |
+
'wp-statistics-menu-viewstats' => array(
|
1414 |
+
'parent' => 'wp-statistic-menu',
|
1415 |
+
'title' => __( 'View Stats', 'wp-statistics' ),
|
1416 |
+
'href' => WP_Statistics_Admin_Pages::admin_url( 'overview' )
|
1417 |
)
|
1418 |
+
);
|
1419 |
+
foreach ( $admin_bar_list as $id => $v_admin_bar ) {
|
1420 |
+
$wp_admin_bar->add_menu( array_merge( array( 'id' => $id ), $v_admin_bar ) );
|
1421 |
+
}
|
1422 |
+
}
|
1423 |
+
}
|
1424 |
+
|
1425 |
+
/**
|
1426 |
+
* Reset Online User Process By Option time
|
1427 |
+
*
|
1428 |
+
* @return string
|
1429 |
+
*/
|
1430 |
+
public function reset_user_online() {
|
1431 |
+
global $WP_Statistics, $wpdb;
|
1432 |
|
1433 |
+
//Check User Online is Active in this Wordpress
|
1434 |
+
if ( $WP_Statistics->get_option( 'useronline' ) ) {
|
1435 |
|
1436 |
+
//Get Not timestamp
|
1437 |
+
$now = $WP_Statistics->current_date( 'U' );
|
1438 |
|
1439 |
+
// Set the default seconds a user needs to visit the site before they are considered offline.
|
1440 |
+
$reset_time = 120;
|
1441 |
+
|
1442 |
+
// Get the user set value for seconds to check for users online.
|
1443 |
+
if ( $WP_Statistics->get_option( 'check_online' ) ) {
|
1444 |
+
$reset_time = $WP_Statistics->get_option( 'check_online' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1445 |
}
|
1446 |
|
1447 |
+
// We want to delete users that are over the number of seconds set by the admin.
|
1448 |
+
$time_diff = $now - $reset_time;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1449 |
|
1450 |
+
//Last check Time
|
1451 |
+
$wps_run = get_option( "wp_statistics_check_useronline" );
|
1452 |
+
if ( isset( $wps_run ) and is_numeric( $wps_run ) ) {
|
1453 |
+
if ( ( $wps_run + $reset_time ) > $now ) {
|
1454 |
+
return;
|
1455 |
+
}
|
1456 |
+
}
|
1457 |
|
1458 |
+
// Call the deletion query.
|
1459 |
+
$wpdb->query( "DELETE FROM `" . wp_statistics_db_table( 'useronline' ) . "` WHERE timestamp < {$time_diff}" );
|
|
|
|
|
|
|
|
|
|
|
1460 |
|
1461 |
+
//Update Last run this Action
|
1462 |
+
update_option( "wp_statistics_check_useronline", $now );
|
1463 |
+
}
|
1464 |
+
}
|
|
|
|
|
|
|
|
|
|
|
1465 |
|
1466 |
+
/**
|
1467 |
+
* Get Number Days From install this plugin
|
1468 |
+
* this method used for `ALL` Option in Time Range Pages
|
1469 |
+
*/
|
1470 |
+
public static function get_number_days_install_plugin() {
|
1471 |
+
global $wpdb, $WP_Statistics;
|
|
|
1472 |
|
1473 |
+
//Create Empty default Option
|
1474 |
+
$first_day = '';
|
1475 |
+
|
1476 |
+
//First Check Visitor Table , if not exist Web check Pages Table
|
1477 |
+
$list_tbl = array(
|
1478 |
+
'visitor' => array( 'order_by' => 'ID', 'column' => 'last_counter' ),
|
1479 |
+
'pages' => array( 'order_by' => 'page_id', 'column' => 'date' ),
|
1480 |
+
);
|
1481 |
+
foreach ( $list_tbl as $tbl => $val ) {
|
1482 |
+
$first_day = $wpdb->get_var( "SELECT `" . $val['column'] . "` FROM `" . wp_statistics_db_table( $tbl ) . "` ORDER BY `" . $val['order_by'] . "` ASC LIMIT 1" );
|
1483 |
+
if ( ! empty( $first_day ) ) {
|
1484 |
+
break;
|
1485 |
+
}
|
1486 |
+
}
|
1487 |
+
|
1488 |
+
//Calculate hit day if range is exist
|
1489 |
+
if ( empty( $first_day ) ) {
|
1490 |
+
$result = array(
|
1491 |
+
'days' => 1,
|
1492 |
+
'date' => current_time( 'timestamp' )
|
1493 |
+
);
|
1494 |
+
} else {
|
1495 |
+
$earlier = new \DateTime( $first_day );
|
1496 |
+
$later = new \DateTime( $WP_Statistics->Current_date( 'Y-m-d' ) );
|
1497 |
+
$result = array(
|
1498 |
+
'days' => $later->diff( $earlier )->format( "%a" ),
|
1499 |
+
'timestamp' => strtotime( $first_day ),
|
1500 |
+
'first_day' => $first_day,
|
1501 |
);
|
1502 |
}
|
1503 |
+
|
1504 |
+
return $result;
|
1505 |
}
|
1506 |
|
1507 |
}
|
includes/functions/export.php
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
function wp_statistics_export_data() {
|
3 |
-
global $WP_Statistics, $wpdb;
|
4 |
-
|
5 |
-
if ( ! isset( $_POST['table-to-export'] ) or ! isset( $_POST['export-file-type'] ) ) {
|
6 |
-
return;
|
7 |
-
}
|
8 |
-
|
9 |
-
$manage_cap = wp_statistics_validate_capability(
|
10 |
-
$WP_Statistics->get_option(
|
11 |
-
'manage_capability',
|
12 |
-
'manage_options'
|
13 |
-
)
|
14 |
-
);
|
15 |
-
|
16 |
-
if ( current_user_can( $manage_cap ) ) {
|
17 |
-
$table = $_POST['table-to-export'];
|
18 |
-
$type = $_POST['export-file-type'];
|
19 |
-
|
20 |
-
// Validate the table name the user passed to us.
|
21 |
-
if ( ! ( $table == "useronline" ||
|
22 |
-
$table == "visit" ||
|
23 |
-
$table == "visitor" ||
|
24 |
-
$table == "exclusions" ||
|
25 |
-
$table == "pages" ||
|
26 |
-
$table == "search" )
|
27 |
-
) {
|
28 |
-
$table = false;
|
29 |
-
}
|
30 |
-
|
31 |
-
// Validate the file type the user passed to us.
|
32 |
-
if ( ! ( $type == "xml" || $type == "csv" || $type == "tsv" ) ) {
|
33 |
-
$table = false;
|
34 |
-
}
|
35 |
-
|
36 |
-
if ( $table && $type ) {
|
37 |
-
require( WP_Statistics::$reg['plugin-dir'] . 'includes/github/elidickinson/php-export-data/php-export-data.class.php' );
|
38 |
-
|
39 |
-
$file_name = 'wp-statistics' . '-' . $WP_Statistics->Current_Date( 'Y-m-d-H-i' );
|
40 |
-
|
41 |
-
switch ( $type ) {
|
42 |
-
case 'xml':
|
43 |
-
$exporter = new ExportDataExcel( 'browser', "{$file_name}.xml" );
|
44 |
-
break;
|
45 |
-
case 'csv':
|
46 |
-
$exporter = new ExportDataCSV( 'browser', "{$file_name}.csv" );
|
47 |
-
break;
|
48 |
-
case 'tsv':
|
49 |
-
$exporter = new ExportDataTSV( 'browser', "{$file_name}.tsv" );
|
50 |
-
break;
|
51 |
-
}
|
52 |
-
|
53 |
-
$exporter->initialize();
|
54 |
-
|
55 |
-
// We need to limit the number of results we retrieve to ensure we don't run out of memory
|
56 |
-
$query_base = "SELECT * FROM {$wpdb->prefix}statistics_{$table}";
|
57 |
-
$query = $query_base . ' LIMIT 0,1000';
|
58 |
-
|
59 |
-
$i = 1;
|
60 |
-
$more_results = true;
|
61 |
-
$result = $wpdb->get_results( $query, ARRAY_A );
|
62 |
-
|
63 |
-
// If we didn't get any rows, don't output anything.
|
64 |
-
if ( count( $result ) < 1 ) {
|
65 |
-
echo "No data in table!";
|
66 |
-
exit;
|
67 |
-
}
|
68 |
-
|
69 |
-
if ( isset( $_POST['export-headers'] ) and $_POST['export-headers'] ) {
|
70 |
-
foreach ( $result[0] as $key => $col ) {
|
71 |
-
$columns[] = $key;
|
72 |
-
}
|
73 |
-
$exporter->addRow( $columns );
|
74 |
-
}
|
75 |
-
|
76 |
-
while ( $more_results ) {
|
77 |
-
foreach ( $result as $row ) {
|
78 |
-
$exporter->addRow( $row );
|
79 |
-
|
80 |
-
// Make sure we've flushed the output buffer so we don't run out of memory on large exports.
|
81 |
-
ob_flush();
|
82 |
-
flush();
|
83 |
-
}
|
84 |
-
|
85 |
-
unset( $result );
|
86 |
-
$wpdb->flush();
|
87 |
-
|
88 |
-
$query = $query_base . ' LIMIT ' . ( $i * 1000 ) . ',1000';
|
89 |
-
$result = $wpdb->get_results( $query, ARRAY_A );
|
90 |
-
|
91 |
-
if ( count( $result ) == 0 ) {
|
92 |
-
$more_results = false;
|
93 |
-
}
|
94 |
-
|
95 |
-
$i ++;
|
96 |
-
}
|
97 |
-
|
98 |
-
$exporter->finalize();
|
99 |
-
|
100 |
-
exit;
|
101 |
-
}
|
102 |
-
}
|
103 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/functions/functions.php
CHANGED
@@ -6,254 +6,464 @@
|
|
6 |
the number of rows returned, but you can also use it an a foreach loop to to get the details of the rows.
|
7 |
*/
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
//
|
18 |
-
|
19 |
|
20 |
-
//
|
21 |
-
|
22 |
|
23 |
-
//
|
24 |
-
if ( $
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
}
|
|
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
switch ( $time ) {
|
44 |
-
case 'today':
|
45 |
-
$result = $wpdb->get_var(
|
46 |
-
"SELECT SUM(visit) FROM {$wpdb->prefix}statistics_visit WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}'"
|
47 |
-
);
|
48 |
-
break;
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
break;
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
break;
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
);
|
66 |
-
break;
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
$result += $WP_Statistics->Get_Historical_Data( 'visits' );
|
77 |
-
break;
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
}
|
85 |
-
}
|
86 |
|
87 |
-
//
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
-
return $
|
93 |
}
|
94 |
|
95 |
-
|
96 |
-
function
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
99 |
global $wpdb, $WP_Statistics;
|
100 |
|
101 |
-
|
102 |
-
$
|
103 |
-
$
|
104 |
|
105 |
-
//
|
106 |
-
|
107 |
-
|
|
|
108 |
}
|
109 |
|
110 |
-
//
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
117 |
|
118 |
-
|
|
|
|
|
|
|
119 |
|
120 |
} else {
|
121 |
|
122 |
-
//
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
= "SELECT {$select} FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}'";
|
128 |
-
break;
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
= "SELECT {$select} FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -1 )}'";
|
133 |
-
break;
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
= "SELECT {$select} FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN '{$WP_Statistics->Current_Date( 'Y-m-d', -30 )}' AND '{$WP_Statistics->Current_Date( 'Y-m-d' )}'";
|
143 |
-
break;
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
= "SELECT {$select} FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN '{$WP_Statistics->Current_Date( 'Y-m-d', -365 )}' AND '{$WP_Statistics->Current_Date( 'Y-m-d' )}'";
|
148 |
-
break;
|
149 |
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
161 |
|
162 |
-
//
|
163 |
-
if ( $
|
164 |
-
$
|
165 |
-
$result += $history;
|
166 |
} else {
|
167 |
-
$
|
168 |
}
|
169 |
|
170 |
-
|
171 |
-
|
172 |
|
173 |
-
//
|
174 |
-
|
|
|
|
|
175 |
|
176 |
-
//
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
-
|
180 |
-
|
|
|
|
|
181 |
|
182 |
-
//
|
183 |
-
if ( $
|
184 |
-
$
|
185 |
}
|
186 |
|
187 |
-
|
|
|
188 |
|
189 |
-
|
190 |
-
|
191 |
-
if ( $id != - 1 ) {
|
192 |
-
$page_sql = '`id` = ' . absint( $id );
|
193 |
-
$history_key = 'page';
|
194 |
-
$history_id = absint( $id );
|
195 |
} else {
|
196 |
-
|
197 |
-
|
198 |
-
$
|
|
|
|
|
|
|
199 |
}
|
200 |
|
201 |
-
//
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
$sqlstatement
|
206 |
-
= "SELECT SUM(count) FROM {$wpdb->prefix}statistics_pages WHERE `date` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}' AND {$page_sql}";
|
207 |
-
break;
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
|
|
|
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
= "SELECT SUM(count) FROM {$wpdb->prefix}statistics_pages WHERE `date` BETWEEN '{$WP_Statistics->Current_Date( 'Y-m-d', -30 )}' AND '{$WP_Statistics->Current_Date( 'Y-m-d' )}' AND {$page_sql}";
|
222 |
-
break;
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
case 'range':
|
234 |
-
$sqlstatement = "SELECT SUM(count) FROM {$wpdb->prefix}statistics_pages WHERE `date` BETWEEN '" .
|
235 |
-
$WP_Statistics->Current_Date( 'Y-m-d', '-0', strtotime( $rangestartdate ) ) .
|
236 |
-
"' AND '" .
|
237 |
-
$WP_Statistics->Current_Date( 'Y-m-d', '-0', strtotime( $rangeenddate ) ) .
|
238 |
-
"' AND {$page_sql}";
|
239 |
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
}
|
246 |
|
247 |
-
//
|
248 |
-
$
|
249 |
-
$
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
-
//
|
252 |
-
|
253 |
-
|
|
|
254 |
}
|
255 |
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
}
|
258 |
|
259 |
// This function converts a page URI to a page/post ID. It does this by looking up in the pages database
|
@@ -262,10 +472,7 @@ function wp_statistics_uri_to_id( $uri ) {
|
|
262 |
global $wpdb;
|
263 |
|
264 |
// Create the SQL query to use.
|
265 |
-
$sqlstatement = $wpdb->prepare(
|
266 |
-
"SELECT id FROM {$wpdb->prefix}statistics_pages WHERE `URI` = %s AND id > 0 ORDER BY date DESC",
|
267 |
-
$uri
|
268 |
-
);
|
269 |
|
270 |
// Execute the query.
|
271 |
$result = $wpdb->get_var( $sqlstatement );
|
@@ -289,16 +496,9 @@ function wp_statistics_get_top_pages( $rangestartdate = null, $rangeenddate = nu
|
|
289 |
|
290 |
// Get every unique URI from the pages database.
|
291 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
292 |
-
$result = $wpdb->get_results(
|
293 |
-
$wpdb->prepare(
|
294 |
-
"SELECT DISTINCT uri FROM {$wpdb->prefix}statistics_pages WHERE `date` BETWEEN %s AND %s",
|
295 |
-
$rangestartdate,
|
296 |
-
$rangeenddate
|
297 |
-
),
|
298 |
-
ARRAY_N
|
299 |
-
);
|
300 |
} else {
|
301 |
-
$result = $wpdb->get_results( "SELECT DISTINCT uri FROM {$wpdb->prefix}statistics_pages", ARRAY_N );
|
302 |
}
|
303 |
|
304 |
$total = 0;
|
@@ -309,19 +509,27 @@ function wp_statistics_get_top_pages( $rangestartdate = null, $rangeenddate = nu
|
|
309 |
// Increment the total number of results.
|
310 |
$total ++;
|
311 |
|
312 |
-
//
|
313 |
-
$
|
314 |
-
|
315 |
-
//
|
316 |
-
$
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
|
|
|
|
|
|
|
|
323 |
} else {
|
324 |
-
$
|
|
|
|
|
|
|
|
|
325 |
}
|
326 |
}
|
327 |
|
@@ -330,11 +538,12 @@ function wp_statistics_get_top_pages( $rangestartdate = null, $rangeenddate = nu
|
|
330 |
$uris[] = array(
|
331 |
$out[0],
|
332 |
wp_statistics_pages( 'range', $out[0], - 1, $rangestartdate, $rangeenddate ),
|
333 |
-
$
|
334 |
$title,
|
|
|
335 |
);
|
336 |
} else {
|
337 |
-
$uris[] = array( $out[0], wp_statistics_pages( 'total', $out[0] ), $
|
338 |
}
|
339 |
}
|
340 |
|
@@ -401,22 +610,9 @@ function wp_statistics_ua_list( $rangestartdate = null, $rangeenddate = null ) {
|
|
401 |
|
402 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
403 |
if ( $rangeenddate == 'CURDATE()' ) {
|
404 |
-
$result = $wpdb->get_results(
|
405 |
-
$wpdb->prepare(
|
406 |
-
"SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN %s AND CURDATE()",
|
407 |
-
$rangestartdate
|
408 |
-
),
|
409 |
-
ARRAY_N
|
410 |
-
);
|
411 |
} else {
|
412 |
-
$result = $wpdb->get_results(
|
413 |
-
$wpdb->prepare(
|
414 |
-
"SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN %s AND %s",
|
415 |
-
$rangestartdate,
|
416 |
-
$rangeenddate
|
417 |
-
),
|
418 |
-
ARRAY_N
|
419 |
-
);
|
420 |
}
|
421 |
|
422 |
} else {
|
@@ -436,9 +632,15 @@ function wp_statistics_ua_list( $rangestartdate = null, $rangeenddate = null ) {
|
|
436 |
return $Browsers;
|
437 |
}
|
438 |
|
439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
function wp_statistics_useragent( $agent, $rangestartdate = null, $rangeenddate = null ) {
|
441 |
-
|
442 |
global $wpdb;
|
443 |
|
444 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
@@ -451,9 +653,7 @@ function wp_statistics_useragent( $agent, $rangestartdate = null, $rangeenddate
|
|
451 |
)
|
452 |
);
|
453 |
} else {
|
454 |
-
$result = $wpdb->get_var(
|
455 |
-
$wpdb->prepare( "SELECT COUNT(agent) FROM {$wpdb->prefix}statistics_visitor WHERE `agent` = %s", $agent )
|
456 |
-
);
|
457 |
}
|
458 |
|
459 |
return $result;
|
@@ -488,7 +688,6 @@ function wp_statistics_platform_list( $rangestartdate = null, $rangeenddate = nu
|
|
488 |
|
489 |
// This function returns the count of a given platform in the database.
|
490 |
function wp_statistics_platform( $platform, $rangestartdate = null, $rangeenddate = null ) {
|
491 |
-
|
492 |
global $wpdb;
|
493 |
|
494 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
@@ -514,7 +713,6 @@ function wp_statistics_platform( $platform, $rangestartdate = null, $rangeenddat
|
|
514 |
|
515 |
// This function returns all unique versions for a given agent from the database.
|
516 |
function wp_statistics_agent_version_list( $agent, $rangestartdate = null, $rangeenddate = null ) {
|
517 |
-
|
518 |
global $wpdb;
|
519 |
|
520 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
@@ -545,7 +743,6 @@ function wp_statistics_agent_version_list( $agent, $rangestartdate = null, $rang
|
|
545 |
|
546 |
// This function returns the statistics for a given agent/version pair from the database.
|
547 |
function wp_statistics_agent_version( $agent, $version, $rangestartdate = null, $rangeenddate = null ) {
|
548 |
-
|
549 |
global $wpdb;
|
550 |
|
551 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
@@ -585,7 +782,7 @@ function wp_statistics_agent_version( $agent, $version, $rangestartdate = null,
|
|
585 |
// image = the name of the image file to associate with this search engine (just the filename, no path info)
|
586 |
//
|
587 |
function wp_statistics_searchengine_list( $all = false ) {
|
588 |
-
|
589 |
|
590 |
$default = $engines = array(
|
591 |
'ask' => array(
|
@@ -798,9 +995,7 @@ function wp_statistics_searchengine_query( $search_engine = 'all' ) {
|
|
798 |
// Trim off the last ' OR ' for the loop above.
|
799 |
$search_query = substr( $search_query, 0, strlen( $search_query ) - 4 );
|
800 |
} else {
|
801 |
-
$searchengine_list[ $search_engine ]['sqlpattern'] = esc_sql(
|
802 |
-
$searchengine_list[ $search_engine ]['sqlpattern']
|
803 |
-
);
|
804 |
$search_query .= "`referred` LIKE '{$searchengine_list[$search_engine]['sqlpattern']}'";
|
805 |
}
|
806 |
}
|
@@ -849,77 +1044,60 @@ function wp_statistics_searchengine_regex( $search_engine = 'all' ) {
|
|
849 |
return "({$search_query})";
|
850 |
}
|
851 |
|
852 |
-
|
853 |
-
|
854 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
855 |
global $wpdb, $WP_Statistics;
|
856 |
|
857 |
-
//
|
858 |
-
$
|
859 |
-
|
860 |
if ( $WP_Statistics->get_option( 'search_converted' ) ) {
|
861 |
-
$
|
862 |
} else {
|
863 |
-
$
|
864 |
}
|
865 |
|
866 |
-
//
|
867 |
-
$
|
868 |
-
|
869 |
-
// This function accepts several options for time parameter, each one has a unique SQL query string.
|
870 |
-
// They're pretty self explanatory.
|
871 |
-
switch ( $time ) {
|
872 |
-
case 'today':
|
873 |
-
$result = $wpdb->query(
|
874 |
-
"SELECT * FROM `{$tablename}` WHERE (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}') AND ({$search_query})"
|
875 |
-
);
|
876 |
-
|
877 |
-
break;
|
878 |
-
|
879 |
-
case 'yesterday':
|
880 |
-
$result = $wpdb->query(
|
881 |
-
"SELECT * FROM `{$tablename}` WHERE (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -1 )}') AND ({$search_query})"
|
882 |
-
);
|
883 |
-
|
884 |
-
break;
|
885 |
-
|
886 |
-
case 'week':
|
887 |
-
$result = $wpdb->query(
|
888 |
-
"SELECT * FROM `{$tablename}` WHERE (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -7 )}') AND ({$search_query})"
|
889 |
-
);
|
890 |
-
|
891 |
-
break;
|
892 |
-
|
893 |
-
case 'month':
|
894 |
-
$result = $wpdb->query(
|
895 |
-
"SELECT * FROM `{$tablename}` WHERE (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -30 )}') AND ({$search_query})"
|
896 |
-
);
|
897 |
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
break;
|
906 |
-
|
907 |
-
case 'total':
|
908 |
-
$result = $wpdb->query( "SELECT * FROM `{$tablename}` WHERE {$search_query}" );
|
909 |
-
|
910 |
-
break;
|
911 |
|
912 |
-
|
913 |
-
|
914 |
-
"SELECT * FROM `{$tablename}` WHERE (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', $time)}') AND ({$search_query})"
|
915 |
-
);
|
916 |
|
917 |
-
|
|
|
|
|
|
|
918 |
}
|
919 |
|
|
|
|
|
920 |
return $result;
|
921 |
}
|
922 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
923 |
//This Function will return the referrer list
|
924 |
function wp_statistics_referrer( $time = null ) {
|
925 |
global $wpdb, $WP_Statistics;
|
@@ -956,111 +1134,44 @@ function wp_statistics_referrer( $time = null ) {
|
|
956 |
return count( $get_urls );
|
957 |
}
|
958 |
|
959 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
960 |
function wp_statistics_searchword( $search_engine = 'all', $time = 'total' ) {
|
961 |
-
|
962 |
-
global $wpdb, $WP_Statistics;
|
963 |
-
|
964 |
-
// Determine if we're using the old or new method of storing search engine info and build the appropriate table name.
|
965 |
-
$tablename = $wpdb->prefix . 'statistics_';
|
966 |
-
|
967 |
-
if ( $WP_Statistics->get_option( 'search_converted' ) ) {
|
968 |
-
$tablename .= 'search';
|
969 |
-
} else {
|
970 |
-
$tablename .= 'visitor';
|
971 |
-
}
|
972 |
-
|
973 |
-
// Get a complete list of search engines
|
974 |
-
$search_query = wp_statistics_searchword_query( $search_engine );
|
975 |
-
|
976 |
-
// This function accepts several options for time parameter, each one has a unique SQL query string.
|
977 |
-
// They're pretty self explanatory.
|
978 |
-
switch ( $time ) {
|
979 |
-
case 'today':
|
980 |
-
$result = $wpdb->query(
|
981 |
-
"SELECT * FROM `{$tablename}` WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d' )}' AND {$search_query}"
|
982 |
-
);
|
983 |
-
break;
|
984 |
-
|
985 |
-
case 'yesterday':
|
986 |
-
$result = $wpdb->query(
|
987 |
-
"SELECT * FROM `{$tablename}` WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -1 )}' AND {$search_query}"
|
988 |
-
);
|
989 |
-
|
990 |
-
break;
|
991 |
-
|
992 |
-
case 'week':
|
993 |
-
$result = $wpdb->query(
|
994 |
-
"SELECT * FROM `{$tablename}` WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -7 )}' AND {$search_query}"
|
995 |
-
);
|
996 |
-
|
997 |
-
break;
|
998 |
-
|
999 |
-
case 'month':
|
1000 |
-
$result = $wpdb->query(
|
1001 |
-
"SELECT * FROM `{$tablename}` WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -30 )}' AND {$search_query}"
|
1002 |
-
);
|
1003 |
-
|
1004 |
-
break;
|
1005 |
-
|
1006 |
-
case 'year':
|
1007 |
-
$result = $wpdb->query(
|
1008 |
-
"SELECT * FROM `{$tablename}` WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', -365 )}' AND {$search_query}"
|
1009 |
-
);
|
1010 |
-
|
1011 |
-
break;
|
1012 |
-
|
1013 |
-
case 'total':
|
1014 |
-
$result = $wpdb->query( "SELECT * FROM `{$tablename}` WHERE {$search_query}" );
|
1015 |
-
|
1016 |
-
break;
|
1017 |
-
|
1018 |
-
default:
|
1019 |
-
$result = $wpdb->query(
|
1020 |
-
"SELECT * FROM `{$tablename}` WHERE `last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', $time )}' AND {$search_query}"
|
1021 |
-
);
|
1022 |
-
|
1023 |
-
break;
|
1024 |
-
}
|
1025 |
-
|
1026 |
-
return $result;
|
1027 |
}
|
1028 |
|
1029 |
// This function will return the total number of posts in WordPress.
|
1030 |
function wp_statistics_countposts() {
|
1031 |
-
|
1032 |
$count_posts = wp_count_posts( 'post' );
|
1033 |
|
1034 |
$ret = 0;
|
1035 |
-
|
1036 |
if ( is_object( $count_posts ) ) {
|
1037 |
$ret = $count_posts->publish;
|
1038 |
}
|
1039 |
-
|
1040 |
return $ret;
|
1041 |
}
|
1042 |
|
1043 |
// This function will return the total number of pages in WordPress.
|
1044 |
function wp_statistics_countpages() {
|
1045 |
-
|
1046 |
$count_pages = wp_count_posts( 'page' );
|
1047 |
|
1048 |
$ret = 0;
|
1049 |
-
|
1050 |
if ( is_object( $count_pages ) ) {
|
1051 |
$ret = $count_pages->publish;
|
1052 |
}
|
1053 |
-
|
1054 |
return $ret;
|
1055 |
}
|
1056 |
|
1057 |
// This function will return the total number of comments in WordPress.
|
1058 |
function wp_statistics_countcomment() {
|
1059 |
-
|
1060 |
global $wpdb;
|
1061 |
|
1062 |
$countcomms = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_approved = '1'" );
|
1063 |
-
|
1064 |
return $countcomms;
|
1065 |
}
|
1066 |
|
@@ -1182,19 +1293,11 @@ function wp_statistics_average_registeruser( $days = false ) {
|
|
1182 |
|
1183 |
// This function handle's the Dashicons in the overview page.
|
1184 |
function wp_statistics_icons( $dashicons, $icon_name = null ) {
|
1185 |
-
|
1186 |
-
global $wp_version;
|
1187 |
-
|
1188 |
if ( null == $icon_name ) {
|
1189 |
$icon_name = $dashicons;
|
1190 |
}
|
1191 |
|
1192 |
-
|
1193 |
-
if ( version_compare( $wp_version, '3.8-RC', '>=' ) || version_compare( $wp_version, '3.8', '>=' ) ) {
|
1194 |
-
return '<span class="dashicons ' . $dashicons . '"></span>';
|
1195 |
-
} else {
|
1196 |
-
return '<img src="' . plugins_url( 'wp-statistics/assets/images/' ) . $icon_name . '.png"/>';
|
1197 |
-
}
|
1198 |
}
|
1199 |
|
1200 |
// This function checks to see if all the PHP modules we need for GeoIP exists.
|
@@ -1222,16 +1325,23 @@ function wp_statistics_geoip_supported() {
|
|
1222 |
function wp_statistics_date_range_selector( $page, $current, $range = array(), $desc = array(), $extrafields = '', $pre_extra = '', $post_extra = '' ) {
|
1223 |
GLOBAL $WP_Statistics;
|
1224 |
|
|
|
1225 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
1226 |
-
wp_register_style(
|
1227 |
-
'jquery-ui-smoothness-css',
|
1228 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/jquery-ui-smoothness.min.css'
|
1229 |
-
);
|
1230 |
wp_enqueue_style( 'jquery-ui-smoothness-css' );
|
1231 |
|
|
|
1232 |
if ( $range == null or count( $range ) == 0 ) {
|
|
|
|
|
1233 |
$range = array( 10, 20, 30, 60, 90, 180, 270, 365 );
|
1234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1235 |
__( '10 Days', 'wp-statistics' ),
|
1236 |
__( '20 Days', 'wp-statistics' ),
|
1237 |
__( '30 Days', 'wp-statistics' ),
|
@@ -1240,24 +1350,22 @@ function wp_statistics_date_range_selector( $page, $current, $range = array(), $
|
|
1240 |
__( '6 Months', 'wp-statistics' ),
|
1241 |
__( '9 Months', 'wp-statistics' ),
|
1242 |
__( '1 Year', 'wp-statistics' ),
|
|
|
1243 |
);
|
1244 |
}
|
1245 |
-
|
1246 |
if ( count( $desc ) == 0 ) {
|
1247 |
$desc = $range;
|
1248 |
}
|
1249 |
-
|
1250 |
$rcount = count( $range );
|
1251 |
-
|
1252 |
-
$bold = true;
|
1253 |
|
1254 |
// Check to see if there's a range in the URL, if so set it, otherwise use the default.
|
1255 |
-
if (
|
1256 |
$rangestart = $_GET['rangestart'];
|
1257 |
} else {
|
1258 |
$rangestart = $WP_Statistics->Current_Date( 'm/d/Y', '-' . $current );
|
1259 |
}
|
1260 |
-
if (
|
1261 |
$rangeend = $_GET['rangeend'];
|
1262 |
} else {
|
1263 |
$rangeend = $WP_Statistics->Current_Date( 'm/d/Y' );
|
@@ -1281,51 +1389,35 @@ function wp_statistics_date_range_selector( $page, $current, $range = array(), $
|
|
1281 |
$rangestart = $WP_Statistics->Local_Date( get_option( "date_format" ), $rangestart_utime );
|
1282 |
$rangeend = $WP_Statistics->Local_Date( get_option( "date_format" ), $rangeend_utime );
|
1283 |
|
1284 |
-
//
|
1285 |
-
if ( $rangeend
|
1286 |
-
$
|
1287 |
-
|
1288 |
-
|
1289 |
-
$rangestart = $WP_Statistics->Current_Date( get_option( "date_format" ), '-' . $current );
|
1290 |
-
$rangeend = $WP_Statistics->Current_Date( get_option( "date_format" ) );
|
1291 |
}
|
1292 |
|
1293 |
echo '<form method="get"><ul class="subsubsub wp-statistics-sub-fullwidth">' . "\r\n";
|
1294 |
-
|
1295 |
// Output any extra HTML we've been passed after the form element but before the date selector.
|
1296 |
echo $pre_extra;
|
1297 |
|
1298 |
for ( $i = 0; $i < $rcount; $i ++ ) {
|
1299 |
-
echo '
|
1300 |
-
|
1301 |
if ( $current == $range[ $i ] ) {
|
1302 |
echo 'class="current" ';
|
1303 |
$bold = false;
|
1304 |
}
|
1305 |
|
1306 |
// Don't bother adding he date range to the standard links as they're not needed any may confuse the custom range selector.
|
1307 |
-
echo 'href="?page=' .
|
1308 |
-
$page .
|
1309 |
-
'&hitdays=' .
|
1310 |
-
$range[ $i ] .
|
1311 |
-
esc_html( $extrafields ) .
|
1312 |
-
'">' .
|
1313 |
-
$desc[ $i ] .
|
1314 |
-
'</a></li>';
|
1315 |
-
|
1316 |
if ( $i < $rcount - 1 ) {
|
1317 |
echo ' | ';
|
1318 |
}
|
1319 |
-
|
1320 |
echo "\r\n";
|
1321 |
}
|
1322 |
-
|
1323 |
echo ' | ';
|
1324 |
-
|
1325 |
-
echo '<input type="hidden" name="hitdays" value="-1"><input type="hidden" name="page" value="' . $page . '">';
|
1326 |
|
1327 |
parse_str( $extrafields, $parse );
|
1328 |
-
|
1329 |
foreach ( $parse as $key => $value ) {
|
1330 |
echo '<input type="hidden" name="' . $key . '" value="' . esc_sql( $value ) . '">';
|
1331 |
}
|
@@ -1336,32 +1428,68 @@ function wp_statistics_date_range_selector( $page, $current, $range = array(), $
|
|
1336 |
echo ' ' . __( 'Time Frame', 'wp-statistics' ) . ': ';
|
1337 |
}
|
1338 |
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
' <input type="text" size="10" name="rangeend" id="dateendpicker" value="' .
|
1346 |
-
$rangeend .
|
1347 |
-
'" placeholder="' .
|
1348 |
-
__( wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ), 'wp-statistics' ) .
|
1349 |
-
'"> <input type="submit" value="' .
|
1350 |
-
__( 'Go', 'wp-statistics' ) .
|
1351 |
-
'" class="button-primary">' .
|
1352 |
-
"\r\n";
|
1353 |
|
1354 |
// Output any extra HTML we've been passed after the date selector but before the submit button.
|
1355 |
echo $post_extra;
|
1356 |
|
1357 |
echo '</form>' . "\r\n";
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
|
|
|
|
|
|
1361 |
}
|
1362 |
|
1363 |
/*
|
1364 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
*/
|
1366 |
function wp_statistics_dateformat_php_to_jqueryui( $php_format ) {
|
1367 |
$SYMBOLS_MATCHING = array(
|
@@ -1453,7 +1581,13 @@ function wp_statistics_date_range_calculator( $days, $start, $end ) {
|
|
1453 |
return array( $daysToDisplay, $rangestart_utime, $rangeend_utime );
|
1454 |
}
|
1455 |
|
1456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1457 |
function wp_statitiscs_empty_table( $table_name = false ) {
|
1458 |
global $wpdb;
|
1459 |
|
@@ -1461,17 +1595,20 @@ function wp_statitiscs_empty_table( $table_name = false ) {
|
|
1461 |
$result = $wpdb->query( 'DELETE FROM ' . $table_name );
|
1462 |
|
1463 |
if ( $result ) {
|
1464 |
-
return sprintf(
|
1465 |
-
__( '%s table data deleted successfully.', 'wp-statistics' ),
|
1466 |
-
'<code>' . $table_name . '</code>'
|
1467 |
-
);
|
1468 |
}
|
1469 |
}
|
1470 |
|
1471 |
return sprintf( __( 'Error, %s not emptied!', 'wp-statistics' ), $table_name );
|
1472 |
}
|
1473 |
|
1474 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1475 |
function wp_statistics_generate_widget_load_javascript( $widget, $container_id = null ) {
|
1476 |
if ( null == $container_id ) {
|
1477 |
$container_id = str_replace( '.', '_', $widget . '_postbox' );
|
@@ -1510,21 +1647,16 @@ function wp_statistics_generate_rgba_color( $num, $opacity = '1' ) {
|
|
1510 |
* if not it will default to returning the 'manage_options' capability.
|
1511 |
*
|
1512 |
* @param string $capability Capability
|
1513 |
-
*
|
1514 |
* @return string 'manage_options'
|
1515 |
*/
|
1516 |
function wp_statistics_validate_capability( $capability ) {
|
1517 |
-
|
1518 |
global $wp_roles;
|
1519 |
|
1520 |
-
$role_list = $wp_roles->get_names();
|
1521 |
-
|
1522 |
if ( ! is_object( $wp_roles ) || ! is_array( $wp_roles->roles ) ) {
|
1523 |
return 'manage_options';
|
1524 |
}
|
1525 |
|
1526 |
foreach ( $wp_roles->roles as $role ) {
|
1527 |
-
|
1528 |
$cap_list = $role['capabilities'];
|
1529 |
|
1530 |
foreach ( $cap_list as $key => $cap ) {
|
@@ -1537,11 +1669,57 @@ function wp_statistics_validate_capability( $capability ) {
|
|
1537 |
return 'manage_options';
|
1538 |
}
|
1539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1540 |
/**
|
1541 |
* Notices displayed near the top of admin pages.
|
1542 |
*
|
1543 |
* @param $type
|
1544 |
* @param $message
|
|
|
1545 |
*/
|
1546 |
function wp_statistics_admin_notice_result( $type, $message ) {
|
1547 |
|
@@ -1566,16 +1744,17 @@ function wp_statistics_admin_notice_result( $type, $message ) {
|
|
1566 |
* Get All Browser List For Detecting
|
1567 |
*
|
1568 |
* @param bool $all
|
|
|
1569 |
* @return array|mixed
|
1570 |
*/
|
1571 |
function wp_statistics_get_browser_list( $all = true ) {
|
1572 |
|
1573 |
//List Of Detect Browser in WP Statistics
|
1574 |
$list = array(
|
1575 |
-
"chrome" => __( "
|
1576 |
-
"firefox" => __( "
|
1577 |
-
"msie" => __( "
|
1578 |
-
"edge" => __( "
|
1579 |
"opera" => __( "Opera", 'wp-statistics' ),
|
1580 |
"safari" => __( "Safari", 'wp-statistics' )
|
1581 |
);
|
@@ -1595,4 +1774,397 @@ function wp_statistics_get_browser_list( $all = true ) {
|
|
1595 |
return __( "Unknown", 'wp-statistics' );
|
1596 |
}
|
1597 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1598 |
}
|
6 |
the number of rows returned, but you can also use it an a foreach loop to to get the details of the rows.
|
7 |
*/
|
8 |
|
9 |
+
/**
|
10 |
+
* Get Current Users online
|
11 |
+
*
|
12 |
+
* @param array $options
|
13 |
+
* @return mixed
|
14 |
+
*/
|
15 |
+
function wp_statistics_useronline( $options = array() ) {
|
16 |
+
global $wpdb, $WP_Statistics;
|
17 |
|
18 |
+
//Check Parameter
|
19 |
+
$defaults = array(
|
20 |
+
/**
|
21 |
+
* Type Of Page in Wordpress
|
22 |
+
* @See WP_Statistics_Frontend\get_page_type
|
23 |
+
*
|
24 |
+
* -- Acceptable values --
|
25 |
+
*
|
26 |
+
* post -> WordPress Post single page From All of public post Type
|
27 |
+
* page -> Wordpress page single page
|
28 |
+
* product -> WooCommerce product single page
|
29 |
+
* home -> Home Page website
|
30 |
+
* category -> Wordpress Category Page
|
31 |
+
* post_tag -> Wordpress Post Tags Page
|
32 |
+
* tax -> Wordpress Term Page for all Taxonomies
|
33 |
+
* author -> Wordpress Users page
|
34 |
+
* 404 -> 404 Not Found Page
|
35 |
+
* archive -> Wordpress Archive Page
|
36 |
+
* all -> All Site Page
|
37 |
+
*
|
38 |
+
*/
|
39 |
+
'type' => 'all',
|
40 |
+
/**
|
41 |
+
* Wordpress Query object ID
|
42 |
+
* @example array('type' => 'product', 'ID' => 5)
|
43 |
+
*/
|
44 |
+
'ID' => 0,
|
45 |
+
/**
|
46 |
+
* Get number of logged users or all users
|
47 |
+
*
|
48 |
+
* -- Acceptable values --
|
49 |
+
* false -> Get Number of all users
|
50 |
+
* true -> Get Number of all logged users in wordpress
|
51 |
+
*/
|
52 |
+
'logged_users' => false,
|
53 |
+
/**
|
54 |
+
* Get number User From Custom Country
|
55 |
+
*
|
56 |
+
* -- Acceptable values --
|
57 |
+
* ISO Country Code -> For Get List @See \wp-statistics\includes\functions\country-code.php
|
58 |
+
*
|
59 |
+
*/
|
60 |
+
'location' => 'all',
|
61 |
+
/**
|
62 |
+
* Search Filter by User agent name
|
63 |
+
* e.g : Firefox , Chrome , Safari , Unknown ..
|
64 |
+
* @see wp_statistics_get_browser_list()
|
65 |
+
*
|
66 |
+
*/
|
67 |
+
'agent' => 'all',
|
68 |
+
/**
|
69 |
+
* Search filter by User Platform name
|
70 |
+
* e.g : Windows, iPad, Macintosh, Unknown, ..
|
71 |
+
*
|
72 |
+
*/
|
73 |
+
'platform' => 'all'
|
74 |
+
);
|
75 |
|
76 |
+
// Parse incoming $args into an array and merge it with $defaults
|
77 |
+
$arg = wp_parse_args( $options, $defaults );
|
78 |
|
79 |
+
//Basic SQL
|
80 |
+
$sql = "SELECT COUNT(*) FROM " . wp_statistics_db_table( 'useronline' );
|
81 |
|
82 |
+
//Check Where Condition
|
83 |
+
$where = false;
|
84 |
|
85 |
+
//Check Type of Page
|
86 |
+
if ( $arg['type'] != "all" ) {
|
87 |
+
$where[] = "`type`='" . $arg['type'] . "' AND `page_id` = " . $arg['ID'];
|
88 |
+
}
|
89 |
|
90 |
+
//Check Custom user
|
91 |
+
if ( $arg['logged_users'] === true ) {
|
92 |
+
$where[] = "`user_id` > 0";
|
93 |
+
}
|
94 |
|
95 |
+
//Check Location
|
96 |
+
if ( $arg['location'] != "all" ) {
|
97 |
+
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
98 |
+
if ( array_key_exists( $arg['location'], $ISOCountryCode ) ) {
|
99 |
+
$where[] = "`location` = '" . $arg['location'] . "'";
|
100 |
}
|
101 |
+
}
|
102 |
|
103 |
+
//Check User Agent
|
104 |
+
if ( $arg['agent'] != "all" ) {
|
105 |
+
$where[] = "`agent` = '" . $arg['agent'] . "'";
|
106 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
+
//Check User Platform
|
109 |
+
if ( $arg['platform'] != "all" ) {
|
110 |
+
$where[] = "`platform` = '" . $arg['platform'] . "'";
|
111 |
+
}
|
|
|
112 |
|
113 |
+
//Push Conditions to SQL
|
114 |
+
if ( ! empty( $where ) ) {
|
115 |
+
$sql .= ' WHERE ' . implode( ' AND ', $where );
|
116 |
+
}
|
|
|
117 |
|
118 |
+
//Return Number od user Online
|
119 |
+
return $wpdb->get_var( $sql );
|
120 |
+
}
|
|
|
|
|
121 |
|
122 |
+
/**
|
123 |
+
* Create Condition Where Time in MySql
|
124 |
+
*
|
125 |
+
* @param string $field : date column name in database table
|
126 |
+
* @param string $time : Time return
|
127 |
+
* @param array $range : an array contain two Date e.g : array('start' => 'xx-xx-xx', 'end' => 'xx-xx-xx', 'is_day' => true, 'current_date' => true)
|
128 |
+
*
|
129 |
+
* ---- Time Range -----
|
130 |
+
* today
|
131 |
+
* yesterday
|
132 |
+
* week
|
133 |
+
* month
|
134 |
+
* year
|
135 |
+
* total
|
136 |
+
* “-x” (i.e., “-10” for the past 10 days)
|
137 |
+
* ----------------------
|
138 |
+
*
|
139 |
+
* @return string|bool
|
140 |
+
*/
|
141 |
+
function wp_statistics_mysql_time_conditions( $field = 'date', $time = 'total', $range = array() ) {
|
142 |
+
global $WP_Statistics;
|
143 |
|
144 |
+
//Get Current Date From WP
|
145 |
+
$current_date = $WP_Statistics->Current_Date( 'Y-m-d' );
|
|
|
|
|
146 |
|
147 |
+
//Create Field Sql
|
148 |
+
$field_sql = function ( $time ) use ( $current_date, $field, $WP_Statistics, $range ) {
|
149 |
+
$is_current = array_key_exists( 'current_date', $range );
|
150 |
+
return "`$field` " . ( $is_current === true ? '=' : 'BETWEEN' ) . " '{$WP_Statistics->Current_Date( 'Y-m-d', (int) $time )}'" . ( $is_current === false ? " AND '{$current_date}'" : "" );
|
151 |
+
};
|
|
|
|
|
152 |
|
153 |
+
//Check Time
|
154 |
+
switch ( $time ) {
|
155 |
+
case 'today':
|
156 |
+
$where = "`$field` = '{$current_date}'";
|
157 |
+
break;
|
158 |
+
case 'yesterday':
|
159 |
+
$where = "`$field` = '{$WP_Statistics->Current_Date( 'Y-m-d', -1 )}'";
|
160 |
+
break;
|
161 |
+
case 'week':
|
162 |
+
$where = $field_sql( - 7 );
|
163 |
+
break;
|
164 |
+
case 'month':
|
165 |
+
$where = $field_sql( - 30 );
|
166 |
+
break;
|
167 |
+
case 'year':
|
168 |
+
$where = $field_sql( - 365 );
|
169 |
+
break;
|
170 |
+
case 'total':
|
171 |
+
$where = "";
|
172 |
+
break;
|
173 |
+
default:
|
174 |
+
if ( array_key_exists( 'is_day', $range ) ) {
|
175 |
+
//Check a day
|
176 |
+
$where = "`$field` = '{$WP_Statistics->Current_Date( 'Y-m-d', $time )}'";
|
177 |
+
} elseif ( array_key_exists( 'start', $range ) and array_key_exists( 'end', $range ) ) {
|
178 |
+
//Check Between Two Time
|
179 |
+
$where = "`$field` BETWEEN '{$WP_Statistics->Current_Date( 'Y-m-d', '-0', strtotime( $range['start'] ) )}' AND '{$WP_Statistics->Current_Date( 'Y-m-d', '-0', strtotime( $range['end'] ) )}'";
|
180 |
+
} else {
|
181 |
+
//Check From a Date To Now
|
182 |
+
$where = $field_sql( $time );
|
183 |
+
}
|
184 |
}
|
185 |
|
186 |
+
return $where;
|
187 |
}
|
188 |
|
189 |
+
/**
|
190 |
+
* This function get the visit statistics for a given time frame
|
191 |
+
*
|
192 |
+
* @param $time
|
193 |
+
* @param null $daily
|
194 |
+
* @return int
|
195 |
+
*/
|
196 |
+
function wp_statistics_visit( $time, $daily = null ) {
|
197 |
global $wpdb, $WP_Statistics;
|
198 |
|
199 |
+
//Date Column Name in visits table
|
200 |
+
$table_name = wp_statistics_db_table( 'visit' );
|
201 |
+
$date_column = 'last_counter';
|
202 |
|
203 |
+
//Prepare Selector Sql
|
204 |
+
$selector = 'SUM(visit)';
|
205 |
+
if ( $daily == true ) {
|
206 |
+
$selector = '*';
|
207 |
}
|
208 |
|
209 |
+
//Generate Base Sql
|
210 |
+
$sql = "SELECT {$selector} FROM {$table_name}";
|
211 |
|
212 |
+
//Create Sum Visits variable
|
213 |
+
$sum = 0;
|
214 |
+
|
215 |
+
//Check if daily Report
|
216 |
+
if ( $daily == true ) {
|
217 |
|
218 |
+
$result = $wpdb->get_row( $sql . " WHERE `$date_column` = '{$WP_Statistics->Current_Date( 'Y-m-d', $time )}'" );
|
219 |
+
if ( null !== $result ) {
|
220 |
+
$sum = $result->visit;
|
221 |
+
}
|
222 |
|
223 |
} else {
|
224 |
|
225 |
+
//Generate MySql Time Conditions
|
226 |
+
$mysql_time_sql = wp_statistics_mysql_time_conditions( $date_column, $time );
|
227 |
+
if ( ! empty( $mysql_time_sql ) ) {
|
228 |
+
$sql = $sql . ' WHERE ' . $mysql_time_sql;
|
229 |
+
}
|
|
|
|
|
230 |
|
231 |
+
//Request To database
|
232 |
+
$result = $wpdb->get_var( $sql );
|
|
|
|
|
233 |
|
234 |
+
//Custom Action
|
235 |
+
if ( $time == "total" ) {
|
236 |
+
$result += $WP_Statistics->Get_Historical_Data( 'visits' );
|
237 |
+
}
|
238 |
|
239 |
+
$sum = $result;
|
240 |
+
}
|
|
|
|
|
241 |
|
242 |
+
return $sum;
|
243 |
+
}
|
|
|
|
|
244 |
|
245 |
+
/**
|
246 |
+
* This function gets the visitor statistics for a given time frame.
|
247 |
+
*
|
248 |
+
* @param $time
|
249 |
+
* @param null $daily
|
250 |
+
* @param bool $count_only
|
251 |
+
* @param array $options
|
252 |
+
* @return int|null|string
|
253 |
+
*/
|
254 |
+
function wp_statistics_visitor( $time, $daily = null, $count_only = false, $options = array() ) {
|
255 |
+
global $wpdb, $WP_Statistics;
|
256 |
|
257 |
+
//Check Parameter
|
258 |
+
$defaults = array(
|
259 |
+
/**
|
260 |
+
* Type Of Page in Wordpress
|
261 |
+
* @See WP_Statistics_Frontend\get_page_type
|
262 |
+
*
|
263 |
+
* -- Acceptable values --
|
264 |
+
*
|
265 |
+
* post -> WordPress Post single page From All of public post Type
|
266 |
+
* page -> Wordpress page single page
|
267 |
+
* product -> WooCommerce product single page
|
268 |
+
* home -> Home Page website
|
269 |
+
* category -> Wordpress Category Page
|
270 |
+
* post_tag -> Wordpress Post Tags Page
|
271 |
+
* tax -> Wordpress Term Page for all Taxonomies
|
272 |
+
* author -> Wordpress Users page
|
273 |
+
* 404 -> 404 Not Found Page
|
274 |
+
* archive -> Wordpress Archive Page
|
275 |
+
* all -> All Site Page
|
276 |
+
*
|
277 |
+
*/
|
278 |
+
'type' => 'all',
|
279 |
+
/**
|
280 |
+
* Wordpress Query object ID
|
281 |
+
* @example array('type' => 'product', 'ID' => 5)
|
282 |
+
*/
|
283 |
+
'ID' => 0,
|
284 |
+
/**
|
285 |
+
* Get number User From Custom Country
|
286 |
+
*
|
287 |
+
* -- Acceptable values --
|
288 |
+
* ISO Country Code -> For Get List @See \wp-statistics\includes\functions\country-code.php
|
289 |
+
*
|
290 |
+
*/
|
291 |
+
'location' => 'all',
|
292 |
+
/**
|
293 |
+
* Search Filter by User agent name
|
294 |
+
* e.g : Firefox , Chrome , Safari , Unknown ..
|
295 |
+
* @see wp_statistics_get_browser_list()
|
296 |
+
*
|
297 |
+
*/
|
298 |
+
'agent' => 'all',
|
299 |
+
/**
|
300 |
+
* Search filter by User Platform name
|
301 |
+
* e.g : Windows, iPad, Macintosh, Unknown, ..
|
302 |
+
*
|
303 |
+
*/
|
304 |
+
'platform' => 'all'
|
305 |
+
);
|
306 |
+
|
307 |
+
// Parse incoming $args into an array and merge it with $defaults
|
308 |
+
$arg = wp_parse_args( $options, $defaults );
|
309 |
+
|
310 |
+
//Create History Visitors variable
|
311 |
+
$history = 0;
|
312 |
+
|
313 |
+
//Prepare Selector Sql
|
314 |
+
$date_column = 'last_counter';
|
315 |
+
$selector = '*';
|
316 |
+
if ( $count_only == true ) {
|
317 |
+
$selector = 'count(last_counter)';
|
318 |
}
|
319 |
|
320 |
+
//Generate Base Sql
|
321 |
+
if ( $arg['type'] != "all" and $WP_Statistics->get_option( 'visitors_log' ) == true ) {
|
322 |
+
$sql = "SELECT {$selector} FROM `" . wp_statistics_db_table( 'visitor' ) . "` INNER JOIN `" . wp_statistics_db_table( "visitor_relationships" ) . "` ON `" . wp_statistics_db_table( "visitor_relationships" ) . "`.`visitor_id` = `" . wp_statistics_db_table( 'visitor' ) . "`.`ID` INNER JOIN `" . wp_statistics_db_table( 'pages' ) . "` ON `" . wp_statistics_db_table( 'pages' ) . "`.`page_id` = `" . wp_statistics_db_table( "visitor_relationships" ) . "` . `page_id`";
|
|
|
323 |
} else {
|
324 |
+
$sql = "SELECT {$selector} FROM `" . wp_statistics_db_table( 'visitor' ) . "`";
|
325 |
}
|
326 |
|
327 |
+
//Check Where Condition
|
328 |
+
$where = false;
|
329 |
|
330 |
+
//Check Type of Page
|
331 |
+
if ( $arg['type'] != "all" ) {
|
332 |
+
$where[] = "`" . wp_statistics_db_table( 'pages' ) . "`.`type`='" . $arg['type'] . "' AND `" . wp_statistics_db_table( 'pages' ) . "`.`page_id` = " . $arg['ID'];
|
333 |
+
}
|
334 |
|
335 |
+
//Check Location
|
336 |
+
if ( $arg['location'] != "all" ) {
|
337 |
+
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
338 |
+
if ( array_key_exists( $arg['location'], $ISOCountryCode ) ) {
|
339 |
+
$where[] = "`" . wp_statistics_db_table( 'visitor' ) . "`.`location` = '" . $arg['location'] . "'";
|
340 |
+
}
|
341 |
+
}
|
342 |
|
343 |
+
//Check User Agent
|
344 |
+
if ( $arg['agent'] != "all" ) {
|
345 |
+
$where[] = "`" . wp_statistics_db_table( 'visitor' ) . "`.`agent` = '" . $arg['agent'] . "'";
|
346 |
+
}
|
347 |
|
348 |
+
//Check User Platform
|
349 |
+
if ( $arg['platform'] != "all" ) {
|
350 |
+
$where[] = "`" . wp_statistics_db_table( 'visitor' ) . "`.`platform` = '" . $arg['platform'] . "'";
|
351 |
}
|
352 |
|
353 |
+
//Check Date Time report
|
354 |
+
if ( $daily == true ) {
|
355 |
|
356 |
+
//Get Only Current Day Visitors
|
357 |
+
$where[] = "`" . wp_statistics_db_table( 'visitor' ) . "`.`last_counter` = '" . $WP_Statistics->Current_Date( 'Y-m-d', $time ) . "'";
|
|
|
|
|
|
|
|
|
358 |
} else {
|
359 |
+
|
360 |
+
//Generate MySql Time Conditions
|
361 |
+
$mysql_time_sql = wp_statistics_mysql_time_conditions( $date_column, $time );
|
362 |
+
if ( ! empty( $mysql_time_sql ) ) {
|
363 |
+
$where[] = $mysql_time_sql;
|
364 |
+
}
|
365 |
}
|
366 |
|
367 |
+
//Push Conditions to SQL
|
368 |
+
if ( ! empty( $where ) ) {
|
369 |
+
$sql .= ' WHERE ' . implode( ' AND ', $where );
|
370 |
+
}
|
|
|
|
|
|
|
371 |
|
372 |
+
//Custom Action
|
373 |
+
if ( $time == "total" and $arg['type'] == "all" ) {
|
374 |
+
$history = $WP_Statistics->Get_Historical_Data( 'visitors' );
|
375 |
+
}
|
376 |
|
377 |
+
// Execute the SQL call, if we're only counting we can use get_var(), otherwise we use query().
|
378 |
+
if ( $count_only == true ) {
|
379 |
+
$sum = $wpdb->get_var( $sql );
|
380 |
+
$sum += $history;
|
381 |
+
} else {
|
382 |
+
$sum = $wpdb->query( $sql );
|
383 |
+
}
|
384 |
|
385 |
+
return $sum;
|
386 |
+
}
|
|
|
|
|
387 |
|
388 |
+
/**
|
389 |
+
* This function returns the statistics for a given page.
|
390 |
+
*
|
391 |
+
* @param $time
|
392 |
+
* @param string $page_uri
|
393 |
+
* @param int $id
|
394 |
+
* @param null $rangestartdate
|
395 |
+
* @param null $rangeenddate
|
396 |
+
* @param bool $type
|
397 |
+
* @return int|null|string
|
398 |
+
*/
|
399 |
+
function wp_statistics_pages( $time, $page_uri = '', $id = - 1, $rangestartdate = null, $rangeenddate = null, $type = false ) {
|
400 |
+
global $wpdb, $WP_Statistics;
|
401 |
|
402 |
+
//Date Column Name in visits table
|
403 |
+
$table_name = wp_statistics_db_table( 'pages' );
|
404 |
+
$date_column = 'date';
|
405 |
+
$history = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
|
407 |
+
//Check Where Condition
|
408 |
+
$where = false;
|
409 |
+
|
410 |
+
//Check Query By Page ID or Page Url
|
411 |
+
if ( $type != false and $id != - 1 ) {
|
412 |
+
$where[] = "`type`='" . $type . "' AND `page_id` = " . $id;
|
413 |
+
} else {
|
414 |
+
|
415 |
+
// If no page URI has been passed in, get the current page URI.
|
416 |
+
if ( $page_uri == '' ) {
|
417 |
+
$page_uri = wp_statistics_get_uri();
|
418 |
+
}
|
419 |
+
$page_uri_sql = esc_sql( $page_uri );
|
420 |
+
|
421 |
+
// If a page/post ID has been passed, use it to select the rows, otherwise use the URI.
|
422 |
+
if ( $id != - 1 ) {
|
423 |
+
$where[] = "`id`= " . absint( $id );
|
424 |
+
$history_key = 'page';
|
425 |
+
$history_id = absint( $id );
|
426 |
+
} else {
|
427 |
+
$where[] = "`URI` = '{$page_uri_sql}'";
|
428 |
+
$history_key = 'uri';
|
429 |
+
$history_id = $page_uri;
|
430 |
+
}
|
431 |
+
|
432 |
+
//Custom Action
|
433 |
+
if ( $time == "total" ) {
|
434 |
+
$history = $WP_Statistics->Get_Historical_Data( $history_key, $history_id );
|
435 |
+
}
|
436 |
}
|
437 |
|
438 |
+
//Prepare Time
|
439 |
+
$time_array = array();
|
440 |
+
if ( is_numeric( $time ) ) {
|
441 |
+
$time_array['is_day'] = true;
|
442 |
+
}
|
443 |
+
if ( ! is_null( $rangestartdate ) and ! is_null( $rangeenddate ) ) {
|
444 |
+
$time_array = array( 'start' => $rangestartdate, 'end' => $rangeenddate );
|
445 |
+
}
|
446 |
|
447 |
+
//Check MySql Time Conditions
|
448 |
+
$mysql_time_sql = wp_statistics_mysql_time_conditions( $date_column, $time, $time_array );
|
449 |
+
if ( ! empty( $mysql_time_sql ) ) {
|
450 |
+
$where[] = $mysql_time_sql;
|
451 |
}
|
452 |
|
453 |
+
//Generate Base Sql
|
454 |
+
$sql = "SELECT SUM(count) FROM {$table_name}";
|
455 |
+
|
456 |
+
//Push Conditions to SQL
|
457 |
+
if ( ! empty( $where ) ) {
|
458 |
+
$sql .= ' WHERE ' . implode( ' AND ', $where );
|
459 |
+
}
|
460 |
+
|
461 |
+
//Request Get data
|
462 |
+
$sum = $wpdb->get_var( $sql );
|
463 |
+
$sum += $history;
|
464 |
+
|
465 |
+
//Return Number Statistic
|
466 |
+
return ( $sum == '' ? 0 : $sum );
|
467 |
}
|
468 |
|
469 |
// This function converts a page URI to a page/post ID. It does this by looking up in the pages database
|
472 |
global $wpdb;
|
473 |
|
474 |
// Create the SQL query to use.
|
475 |
+
$sqlstatement = $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}statistics_pages WHERE `URI` = %s AND id > 0 ORDER BY date DESC", $uri );
|
|
|
|
|
|
|
476 |
|
477 |
// Execute the query.
|
478 |
$result = $wpdb->get_var( $sqlstatement );
|
496 |
|
497 |
// Get every unique URI from the pages database.
|
498 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
499 |
+
$result = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT `uri`,`id`,`type` FROM {$wpdb->prefix}statistics_pages WHERE `date` BETWEEN %s AND %s", $rangestartdate, $rangeenddate ), ARRAY_N );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
} else {
|
501 |
+
$result = $wpdb->get_results( "SELECT DISTINCT `uri`,`id`,`type` FROM {$wpdb->prefix}statistics_pages", ARRAY_N );
|
502 |
}
|
503 |
|
504 |
$total = 0;
|
509 |
// Increment the total number of results.
|
510 |
$total ++;
|
511 |
|
512 |
+
//Prepare item
|
513 |
+
list( $url, $page_id, $page_type ) = $out;
|
514 |
+
|
515 |
+
//Get Page Title
|
516 |
+
$page_info = wp_statistics_get_page_info( $page_id, $page_type );
|
517 |
+
$title = mb_substr( $page_info['title'], 0, 200, "utf-8" );
|
518 |
+
$page_url = $page_info['link'];
|
519 |
+
|
520 |
+
// Check age Title if page id or type not exist
|
521 |
+
if ( $page_info['link'] == "" ) {
|
522 |
+
$page_url = htmlentities( path_join( get_site_url(), $url ), ENT_QUOTES );
|
523 |
+
$id = wp_statistics_uri_to_id( $out[0] );
|
524 |
+
$post = get_post( $id );
|
525 |
+
if ( is_object( $post ) ) {
|
526 |
+
$title = $post->post_title;
|
527 |
} else {
|
528 |
+
if ( $out[0] == '/' ) {
|
529 |
+
$title = get_bloginfo();
|
530 |
+
} else {
|
531 |
+
$title = '';
|
532 |
+
}
|
533 |
}
|
534 |
}
|
535 |
|
538 |
$uris[] = array(
|
539 |
$out[0],
|
540 |
wp_statistics_pages( 'range', $out[0], - 1, $rangestartdate, $rangeenddate ),
|
541 |
+
$page_id,
|
542 |
$title,
|
543 |
+
$page_url,
|
544 |
);
|
545 |
} else {
|
546 |
+
$uris[] = array( $out[0], wp_statistics_pages( 'total', $out[0] ), $page_id, $title, $page_url );
|
547 |
}
|
548 |
}
|
549 |
|
610 |
|
611 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
612 |
if ( $rangeenddate == 'CURDATE()' ) {
|
613 |
+
$result = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN %s AND CURDATE()", $rangestartdate ), ARRAY_N );
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
} else {
|
615 |
+
$result = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN %s AND %s", $rangestartdate, $rangeenddate ), ARRAY_N );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
}
|
617 |
|
618 |
} else {
|
632 |
return $Browsers;
|
633 |
}
|
634 |
|
635 |
+
/**
|
636 |
+
* Count User By User Agent
|
637 |
+
*
|
638 |
+
* @param $agent
|
639 |
+
* @param null $rangestartdate
|
640 |
+
* @param null $rangeenddate
|
641 |
+
* @return mixed
|
642 |
+
*/
|
643 |
function wp_statistics_useragent( $agent, $rangestartdate = null, $rangeenddate = null ) {
|
|
|
644 |
global $wpdb;
|
645 |
|
646 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
653 |
)
|
654 |
);
|
655 |
} else {
|
656 |
+
$result = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(agent) FROM {$wpdb->prefix}statistics_visitor WHERE `agent` = %s", $agent ) );
|
|
|
|
|
657 |
}
|
658 |
|
659 |
return $result;
|
688 |
|
689 |
// This function returns the count of a given platform in the database.
|
690 |
function wp_statistics_platform( $platform, $rangestartdate = null, $rangeenddate = null ) {
|
|
|
691 |
global $wpdb;
|
692 |
|
693 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
713 |
|
714 |
// This function returns all unique versions for a given agent from the database.
|
715 |
function wp_statistics_agent_version_list( $agent, $rangestartdate = null, $rangeenddate = null ) {
|
|
|
716 |
global $wpdb;
|
717 |
|
718 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
743 |
|
744 |
// This function returns the statistics for a given agent/version pair from the database.
|
745 |
function wp_statistics_agent_version( $agent, $version, $rangestartdate = null, $rangeenddate = null ) {
|
|
|
746 |
global $wpdb;
|
747 |
|
748 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
782 |
// image = the name of the image file to associate with this search engine (just the filename, no path info)
|
783 |
//
|
784 |
function wp_statistics_searchengine_list( $all = false ) {
|
785 |
+
global $WP_Statistics;
|
786 |
|
787 |
$default = $engines = array(
|
788 |
'ask' => array(
|
995 |
// Trim off the last ' OR ' for the loop above.
|
996 |
$search_query = substr( $search_query, 0, strlen( $search_query ) - 4 );
|
997 |
} else {
|
998 |
+
$searchengine_list[ $search_engine ]['sqlpattern'] = esc_sql( $searchengine_list[ $search_engine ]['sqlpattern'] );
|
|
|
|
|
999 |
$search_query .= "`referred` LIKE '{$searchengine_list[$search_engine]['sqlpattern']}'";
|
1000 |
}
|
1001 |
}
|
1044 |
return "({$search_query})";
|
1045 |
}
|
1046 |
|
1047 |
+
/**
|
1048 |
+
* Get Search engine Statistics
|
1049 |
+
*
|
1050 |
+
* @param string $search_engine
|
1051 |
+
* @param string $time
|
1052 |
+
* @param string $search_by [query / name]
|
1053 |
+
* @return mixed
|
1054 |
+
*/
|
1055 |
+
function wp_statistics_get_search_engine_query( $search_engine = 'all', $time = 'total', $search_by = 'query' ) {
|
1056 |
global $wpdb, $WP_Statistics;
|
1057 |
|
1058 |
+
//Prepare Table Name
|
1059 |
+
$table_name = $wpdb->prefix . 'statistics_';
|
|
|
1060 |
if ( $WP_Statistics->get_option( 'search_converted' ) ) {
|
1061 |
+
$table_name .= 'search';
|
1062 |
} else {
|
1063 |
+
$table_name .= 'visitor';
|
1064 |
}
|
1065 |
|
1066 |
+
//Date Column table
|
1067 |
+
$date_column = 'last_counter';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1068 |
|
1069 |
+
// Get a complete list of search engines
|
1070 |
+
if ( $search_by == "query" ) {
|
1071 |
+
$search_query = wp_statistics_searchengine_query( $search_engine );
|
1072 |
+
} else {
|
1073 |
+
$search_query = wp_statistics_searchword_query( $search_engine );
|
1074 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1075 |
|
1076 |
+
//Generate Base Sql
|
1077 |
+
$sql = "SELECT * FROM {$table_name} WHERE ({$search_query})";
|
|
|
|
|
1078 |
|
1079 |
+
//Generate MySql Time Conditions
|
1080 |
+
$mysql_time_sql = wp_statistics_mysql_time_conditions( $date_column, $time, array( 'current_date' => true ) );
|
1081 |
+
if ( ! empty( $mysql_time_sql ) ) {
|
1082 |
+
$sql = $sql . ' AND (' . $mysql_time_sql . ')';
|
1083 |
}
|
1084 |
|
1085 |
+
//Request Data
|
1086 |
+
$result = $wpdb->query( $sql );
|
1087 |
return $result;
|
1088 |
}
|
1089 |
|
1090 |
+
/**
|
1091 |
+
* This function will return the statistics for a given search engine.
|
1092 |
+
*
|
1093 |
+
* @param string $search_engine
|
1094 |
+
* @param string $time
|
1095 |
+
* @return mixed
|
1096 |
+
*/
|
1097 |
+
function wp_statistics_searchengine( $search_engine = 'all', $time = 'total' ) {
|
1098 |
+
return wp_statistics_get_search_engine_query( $search_engine, $time, $search_by = 'query' );
|
1099 |
+
}
|
1100 |
+
|
1101 |
//This Function will return the referrer list
|
1102 |
function wp_statistics_referrer( $time = null ) {
|
1103 |
global $wpdb, $WP_Statistics;
|
1134 |
return count( $get_urls );
|
1135 |
}
|
1136 |
|
1137 |
+
/**
|
1138 |
+
* This function will return the statistics for a given search engine for a given time frame.
|
1139 |
+
*
|
1140 |
+
* @param string $search_engine
|
1141 |
+
* @param string $time
|
1142 |
+
* @return mixed
|
1143 |
+
*/
|
1144 |
function wp_statistics_searchword( $search_engine = 'all', $time = 'total' ) {
|
1145 |
+
return wp_statistics_get_search_engine_query( $search_engine, $time, $search_by = 'word' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1146 |
}
|
1147 |
|
1148 |
// This function will return the total number of posts in WordPress.
|
1149 |
function wp_statistics_countposts() {
|
|
|
1150 |
$count_posts = wp_count_posts( 'post' );
|
1151 |
|
1152 |
$ret = 0;
|
|
|
1153 |
if ( is_object( $count_posts ) ) {
|
1154 |
$ret = $count_posts->publish;
|
1155 |
}
|
|
|
1156 |
return $ret;
|
1157 |
}
|
1158 |
|
1159 |
// This function will return the total number of pages in WordPress.
|
1160 |
function wp_statistics_countpages() {
|
|
|
1161 |
$count_pages = wp_count_posts( 'page' );
|
1162 |
|
1163 |
$ret = 0;
|
|
|
1164 |
if ( is_object( $count_pages ) ) {
|
1165 |
$ret = $count_pages->publish;
|
1166 |
}
|
|
|
1167 |
return $ret;
|
1168 |
}
|
1169 |
|
1170 |
// This function will return the total number of comments in WordPress.
|
1171 |
function wp_statistics_countcomment() {
|
|
|
1172 |
global $wpdb;
|
1173 |
|
1174 |
$countcomms = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_approved = '1'" );
|
|
|
1175 |
return $countcomms;
|
1176 |
}
|
1177 |
|
1293 |
|
1294 |
// This function handle's the Dashicons in the overview page.
|
1295 |
function wp_statistics_icons( $dashicons, $icon_name = null ) {
|
|
|
|
|
|
|
1296 |
if ( null == $icon_name ) {
|
1297 |
$icon_name = $dashicons;
|
1298 |
}
|
1299 |
|
1300 |
+
return '<span class="dashicons ' . $dashicons . '"></span>';
|
|
|
|
|
|
|
|
|
|
|
1301 |
}
|
1302 |
|
1303 |
// This function checks to see if all the PHP modules we need for GeoIP exists.
|
1325 |
function wp_statistics_date_range_selector( $page, $current, $range = array(), $desc = array(), $extrafields = '', $pre_extra = '', $post_extra = '' ) {
|
1326 |
GLOBAL $WP_Statistics;
|
1327 |
|
1328 |
+
//import DataPicker Jquery Ui Jquery Plugin
|
1329 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
1330 |
+
wp_register_style( 'jquery-ui-smoothness-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/jquery-ui-smoothness.min.css' );
|
|
|
|
|
|
|
1331 |
wp_enqueue_style( 'jquery-ui-smoothness-css' );
|
1332 |
|
1333 |
+
//Create Object List Of Default Hit Day to Display
|
1334 |
if ( $range == null or count( $range ) == 0 ) {
|
1335 |
+
|
1336 |
+
//Get Number Of Time Range
|
1337 |
$range = array( 10, 20, 30, 60, 90, 180, 270, 365 );
|
1338 |
+
|
1339 |
+
//Added All time From installed plugin to now
|
1340 |
+
$installed_date = WP_Statistics::get_number_days_install_plugin();
|
1341 |
+
array_push( $range, $installed_date['days'] );
|
1342 |
+
|
1343 |
+
//Get List Of Text Lang time Range
|
1344 |
+
$desc = array(
|
1345 |
__( '10 Days', 'wp-statistics' ),
|
1346 |
__( '20 Days', 'wp-statistics' ),
|
1347 |
__( '30 Days', 'wp-statistics' ),
|
1350 |
__( '6 Months', 'wp-statistics' ),
|
1351 |
__( '9 Months', 'wp-statistics' ),
|
1352 |
__( '1 Year', 'wp-statistics' ),
|
1353 |
+
__( 'All', 'wp-statistics' ),
|
1354 |
);
|
1355 |
}
|
|
|
1356 |
if ( count( $desc ) == 0 ) {
|
1357 |
$desc = $range;
|
1358 |
}
|
|
|
1359 |
$rcount = count( $range );
|
1360 |
+
$bold = true;
|
|
|
1361 |
|
1362 |
// Check to see if there's a range in the URL, if so set it, otherwise use the default.
|
1363 |
+
if ( isset( $_GET['rangestart'] ) and strtotime( $_GET['rangestart'] ) != false ) {
|
1364 |
$rangestart = $_GET['rangestart'];
|
1365 |
} else {
|
1366 |
$rangestart = $WP_Statistics->Current_Date( 'm/d/Y', '-' . $current );
|
1367 |
}
|
1368 |
+
if ( isset( $_GET['rangeend'] ) and strtotime( $_GET['rangeend'] ) != false ) {
|
1369 |
$rangeend = $_GET['rangeend'];
|
1370 |
} else {
|
1371 |
$rangeend = $WP_Statistics->Current_Date( 'm/d/Y' );
|
1389 |
$rangestart = $WP_Statistics->Local_Date( get_option( "date_format" ), $rangestart_utime );
|
1390 |
$rangeend = $WP_Statistics->Local_Date( get_option( "date_format" ), $rangeend_utime );
|
1391 |
|
1392 |
+
//Calculate hit day if range is exist
|
1393 |
+
if ( isset( $_GET['rangeend'] ) and isset( $_GET['rangestart'] ) and strtotime( $_GET['rangestart'] ) != false and strtotime( $_GET['rangeend'] ) != false ) {
|
1394 |
+
$earlier = new DateTime( $_GET['rangestart'] );
|
1395 |
+
$later = new DateTime( $_GET['rangeend'] );
|
1396 |
+
$current = $daysToDisplay = $later->diff( $earlier )->format( "%a" );
|
|
|
|
|
1397 |
}
|
1398 |
|
1399 |
echo '<form method="get"><ul class="subsubsub wp-statistics-sub-fullwidth">' . "\r\n";
|
|
|
1400 |
// Output any extra HTML we've been passed after the form element but before the date selector.
|
1401 |
echo $pre_extra;
|
1402 |
|
1403 |
for ( $i = 0; $i < $rcount; $i ++ ) {
|
1404 |
+
echo '<li class="all"><a ';
|
|
|
1405 |
if ( $current == $range[ $i ] ) {
|
1406 |
echo 'class="current" ';
|
1407 |
$bold = false;
|
1408 |
}
|
1409 |
|
1410 |
// Don't bother adding he date range to the standard links as they're not needed any may confuse the custom range selector.
|
1411 |
+
echo 'href="?page=' . $page . '&hitdays=' . $range[ $i ] . esc_html( $extrafields ) . '">' . $desc[ $i ] . '</a></li>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1412 |
if ( $i < $rcount - 1 ) {
|
1413 |
echo ' | ';
|
1414 |
}
|
|
|
1415 |
echo "\r\n";
|
1416 |
}
|
|
|
1417 |
echo ' | ';
|
1418 |
+
echo '<input type="hidden" name="page" value="' . $page . '">';
|
|
|
1419 |
|
1420 |
parse_str( $extrafields, $parse );
|
|
|
1421 |
foreach ( $parse as $key => $value ) {
|
1422 |
echo '<input type="hidden" name="' . $key . '" value="' . esc_sql( $value ) . '">';
|
1423 |
}
|
1428 |
echo ' ' . __( 'Time Frame', 'wp-statistics' ) . ': ';
|
1429 |
}
|
1430 |
|
1431 |
+
//Print Time Range Select Ui
|
1432 |
+
echo '<input type="text" size="18" name="rangestart" id="datestartpicker" value="' . $rangestart . '" placeholder="' . __( wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ), 'wp-statistics' ) . '" autocomplete="off"> ' . __( 'to', 'wp-statistics' ) . ' <input type="text" size="18" name="rangeend" id="dateendpicker" value="' . $rangeend . '" placeholder="' . __( wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ), 'wp-statistics' ) . '" autocomplete="off"> <input type="submit" value="' . __( 'Go', 'wp-statistics' ) . '" class="button-primary">' . "\r\n";
|
1433 |
+
|
1434 |
+
//Sanitize Time Request
|
1435 |
+
echo '<input type="hidden" name="rangestart" id="rangestart" value="' . $WP_Statistics->Local_Date( "Y-m-d", $rangestart_utime ) . '">';
|
1436 |
+
echo '<input type="hidden" name="rangeend" id="rangeend" value="' . $WP_Statistics->Local_Date( "Y-m-d", $rangeend_utime ) . '">';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1437 |
|
1438 |
// Output any extra HTML we've been passed after the date selector but before the submit button.
|
1439 |
echo $post_extra;
|
1440 |
|
1441 |
echo '</form>' . "\r\n";
|
1442 |
+
echo '<script>
|
1443 |
+
jQuery(function() {
|
1444 |
+
jQuery( "#datestartpicker" ).datepicker({dateFormat: \'' . wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ) . '\', onSelect: function(selectedDate) {var v = jQuery(this).val(), d = new Date(v);if (v.length > 0) {jQuery("#rangestart").val(d.toISOString().split(\'T\')[0]);}}});
|
1445 |
+
jQuery( "#dateendpicker" ).datepicker({dateFormat: \'' . wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ) . '\', onSelect: function(selectedDate) {var v = jQuery(this).val(), d = new Date(v);if (v.length > 0) {jQuery("#rangeend").val(d.toISOString().split(\'T\')[0]);}}});
|
1446 |
+
});
|
1447 |
+
</script>' . "\r\n";
|
1448 |
}
|
1449 |
|
1450 |
/*
|
1451 |
+
* Prepare Range Time For Time picker
|
1452 |
+
*/
|
1453 |
+
function wp_statistics_prepare_range_time_picker() {
|
1454 |
+
|
1455 |
+
//Get Default Number To display in All
|
1456 |
+
$installed_date = WP_Statistics::get_number_days_install_plugin();
|
1457 |
+
$daysToDisplay = $installed_date['days'];
|
1458 |
+
|
1459 |
+
//List Of Pages For show 20 Days as First Parameter
|
1460 |
+
$list_of_pages = array( 'hits', 'searches', 'pages', 'countries', 'categories', 'tags', 'authors', 'browser', 'exclusions' );
|
1461 |
+
foreach ( $list_of_pages as $page ) {
|
1462 |
+
if ( isset( $_GET['page'] ) and $_GET['page'] == WP_Statistics::$page[ $page ] ) {
|
1463 |
+
$daysToDisplay = 30;
|
1464 |
+
}
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
//Set Default Object Time Range
|
1468 |
+
$rangestart = '';
|
1469 |
+
$rangeend = '';
|
1470 |
+
|
1471 |
+
//Check Hit Day
|
1472 |
+
if ( isset( $_GET['hitdays'] ) and $_GET['hitdays'] > 0 ) {
|
1473 |
+
$daysToDisplay = intval( $_GET['hitdays'] );
|
1474 |
+
}
|
1475 |
+
if ( isset( $_GET['rangeend'] ) and isset( $_GET['rangestart'] ) and strtotime( $_GET['rangestart'] ) != false and strtotime( $_GET['rangeend'] ) != false ) {
|
1476 |
+
$rangestart = $_GET['rangestart'];
|
1477 |
+
$rangeend = $_GET['rangeend'];
|
1478 |
+
|
1479 |
+
//Calculate hit day if range is exist
|
1480 |
+
$earlier = new DateTime( $_GET['rangestart'] );
|
1481 |
+
$later = new DateTime( $_GET['rangeend'] );
|
1482 |
+
$daysToDisplay = $later->diff( $earlier )->format( "%a" );
|
1483 |
+
}
|
1484 |
+
|
1485 |
+
return array( $daysToDisplay, $rangestart, $rangeend );
|
1486 |
+
}
|
1487 |
+
|
1488 |
+
/**
|
1489 |
+
* Convert php date format to Jquery Ui
|
1490 |
+
*
|
1491 |
+
* @param $php_format
|
1492 |
+
* @return string
|
1493 |
*/
|
1494 |
function wp_statistics_dateformat_php_to_jqueryui( $php_format ) {
|
1495 |
$SYMBOLS_MATCHING = array(
|
1581 |
return array( $daysToDisplay, $rangestart_utime, $rangeend_utime );
|
1582 |
}
|
1583 |
|
1584 |
+
|
1585 |
+
/**
|
1586 |
+
* Delete All record From Table
|
1587 |
+
*
|
1588 |
+
* @param bool $table_name
|
1589 |
+
* @return string
|
1590 |
+
*/
|
1591 |
function wp_statitiscs_empty_table( $table_name = false ) {
|
1592 |
global $wpdb;
|
1593 |
|
1595 |
$result = $wpdb->query( 'DELETE FROM ' . $table_name );
|
1596 |
|
1597 |
if ( $result ) {
|
1598 |
+
return sprintf( __( '%s table data deleted successfully.', 'wp-statistics' ), '<code>' . $table_name . '</code>' );
|
|
|
|
|
|
|
1599 |
}
|
1600 |
}
|
1601 |
|
1602 |
return sprintf( __( 'Error, %s not emptied!', 'wp-statistics' ), $table_name );
|
1603 |
}
|
1604 |
|
1605 |
+
|
1606 |
+
/**
|
1607 |
+
* This function creates a small JavaScript that will load the contents of a overview or dashboard widget.
|
1608 |
+
*
|
1609 |
+
* @param $widget
|
1610 |
+
* @param null $container_id
|
1611 |
+
*/
|
1612 |
function wp_statistics_generate_widget_load_javascript( $widget, $container_id = null ) {
|
1613 |
if ( null == $container_id ) {
|
1614 |
$container_id = str_replace( '.', '_', $widget . '_postbox' );
|
1647 |
* if not it will default to returning the 'manage_options' capability.
|
1648 |
*
|
1649 |
* @param string $capability Capability
|
|
|
1650 |
* @return string 'manage_options'
|
1651 |
*/
|
1652 |
function wp_statistics_validate_capability( $capability ) {
|
|
|
1653 |
global $wp_roles;
|
1654 |
|
|
|
|
|
1655 |
if ( ! is_object( $wp_roles ) || ! is_array( $wp_roles->roles ) ) {
|
1656 |
return 'manage_options';
|
1657 |
}
|
1658 |
|
1659 |
foreach ( $wp_roles->roles as $role ) {
|
|
|
1660 |
$cap_list = $role['capabilities'];
|
1661 |
|
1662 |
foreach ( $cap_list as $key => $cap ) {
|
1669 |
return 'manage_options';
|
1670 |
}
|
1671 |
|
1672 |
+
/**
|
1673 |
+
* Check User Access To WP-Statistics Admin
|
1674 |
+
*
|
1675 |
+
* @param string $type [manage | read ]
|
1676 |
+
* @param string|boolean $export
|
1677 |
+
* @return bool
|
1678 |
+
*/
|
1679 |
+
function wp_statistics_check_access_user( $type = 'both', $export = false ) {
|
1680 |
+
global $WP_Statistics;
|
1681 |
+
|
1682 |
+
//List Of Default Cap
|
1683 |
+
$list = array(
|
1684 |
+
'manage' => array( 'manage_capability', 'manage_options' ),
|
1685 |
+
'read' => array( 'read_capability', 'manage_options' )
|
1686 |
+
);
|
1687 |
+
|
1688 |
+
//User User Cap
|
1689 |
+
$cap = 'both';
|
1690 |
+
if ( ! empty( $type ) and array_key_exists( $type, $list ) ) {
|
1691 |
+
$cap = $type;
|
1692 |
+
}
|
1693 |
+
|
1694 |
+
//Check Export Cap name or Validation current_can_user
|
1695 |
+
if ( $export == "cap" ) {
|
1696 |
+
return wp_statistics_validate_capability( $WP_Statistics->get_option( $list[ $cap ][0], $list[ $cap ][1] ) );
|
1697 |
+
}
|
1698 |
+
|
1699 |
+
//Check Access
|
1700 |
+
switch ( $type ) {
|
1701 |
+
case "manage":
|
1702 |
+
case "read":
|
1703 |
+
return current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( $list[ $cap ][0], $list[ $cap ][1] ) ) );
|
1704 |
+
break;
|
1705 |
+
case "both":
|
1706 |
+
foreach ( array( 'manage', 'read' ) as $c ) {
|
1707 |
+
if ( wp_statistics_check_access_user( $c ) === true ) {
|
1708 |
+
return true;
|
1709 |
+
}
|
1710 |
+
}
|
1711 |
+
break;
|
1712 |
+
}
|
1713 |
+
|
1714 |
+
return false;
|
1715 |
+
}
|
1716 |
+
|
1717 |
/**
|
1718 |
* Notices displayed near the top of admin pages.
|
1719 |
*
|
1720 |
* @param $type
|
1721 |
* @param $message
|
1722 |
+
* @area admin
|
1723 |
*/
|
1724 |
function wp_statistics_admin_notice_result( $type, $message ) {
|
1725 |
|
1744 |
* Get All Browser List For Detecting
|
1745 |
*
|
1746 |
* @param bool $all
|
1747 |
+
* @area utility
|
1748 |
* @return array|mixed
|
1749 |
*/
|
1750 |
function wp_statistics_get_browser_list( $all = true ) {
|
1751 |
|
1752 |
//List Of Detect Browser in WP Statistics
|
1753 |
$list = array(
|
1754 |
+
"chrome" => __( "Chrome", 'wp-statistics' ),
|
1755 |
+
"firefox" => __( "Firefox", 'wp-statistics' ),
|
1756 |
+
"msie" => __( "Internet Explorer", 'wp-statistics' ),
|
1757 |
+
"edge" => __( "Edge", 'wp-statistics' ),
|
1758 |
"opera" => __( "Opera", 'wp-statistics' ),
|
1759 |
"safari" => __( "Safari", 'wp-statistics' )
|
1760 |
);
|
1774 |
return __( "Unknown", 'wp-statistics' );
|
1775 |
}
|
1776 |
}
|
1777 |
+
}
|
1778 |
+
|
1779 |
+
/**
|
1780 |
+
* Pagination Link
|
1781 |
+
*
|
1782 |
+
* @param array $args
|
1783 |
+
* @area admin
|
1784 |
+
* @return string
|
1785 |
+
*/
|
1786 |
+
function wp_statistics_paginate_links( $args = array() ) {
|
1787 |
+
|
1788 |
+
//Prepare Arg
|
1789 |
+
$defaults = array(
|
1790 |
+
'item_per_page' => 10,
|
1791 |
+
'container' => 'pagination-wrap',
|
1792 |
+
'query_var' => 'pagination-page',
|
1793 |
+
'total' => 0,
|
1794 |
+
'current' => 0,
|
1795 |
+
'show_now_page' => true
|
1796 |
+
);
|
1797 |
+
$args = wp_parse_args( $args, $defaults );
|
1798 |
+
$total_page = ceil( $args['total'] / $args['item_per_page'] );
|
1799 |
+
|
1800 |
+
//Show Pagination Ui
|
1801 |
+
if ( $total_page > 1 ) {
|
1802 |
+
echo '<div class="' . $args['container'] . '">';
|
1803 |
+
echo paginate_links( array(
|
1804 |
+
'base' => add_query_arg( $args['query_var'], '%#%' ),
|
1805 |
+
'format' => '',
|
1806 |
+
'type' => 'list',
|
1807 |
+
'mid_size' => 3,
|
1808 |
+
'prev_text' => __( '«' ),
|
1809 |
+
'next_text' => __( '»' ),
|
1810 |
+
'total' => $total_page,
|
1811 |
+
'current' => $args['current']
|
1812 |
+
) );
|
1813 |
+
|
1814 |
+
if ( $args['show_now_page'] ) {
|
1815 |
+
echo '<p id="result-log">' . sprintf( __( 'Page %1$s of %2$s', 'wp-statistics' ), $args['current'], $total_page ) . '</p>';
|
1816 |
+
}
|
1817 |
+
|
1818 |
+
echo '</div>';
|
1819 |
+
}
|
1820 |
+
}
|
1821 |
+
|
1822 |
+
/**
|
1823 |
+
* Get Post List From custom Post Type
|
1824 |
+
*
|
1825 |
+
* @param array $args
|
1826 |
+
* @area utility
|
1827 |
+
* @return mixed
|
1828 |
+
*/
|
1829 |
+
function wp_statistics_get_post_list( $args = array() ) {
|
1830 |
+
|
1831 |
+
//Prepare Arg
|
1832 |
+
$defaults = array(
|
1833 |
+
'post_type' => 'page',
|
1834 |
+
'post_status' => 'publish',
|
1835 |
+
'posts_per_page' => '-1',
|
1836 |
+
'order' => 'ASC',
|
1837 |
+
'fields' => 'ids'
|
1838 |
+
);
|
1839 |
+
$args = wp_parse_args( $args, $defaults );
|
1840 |
+
|
1841 |
+
//Get Post List
|
1842 |
+
$query = new WP_Query( $args );
|
1843 |
+
$list = array();
|
1844 |
+
foreach ( $query->posts as $ID ) {
|
1845 |
+
$list[ $ID ] = get_the_title( $ID );
|
1846 |
+
}
|
1847 |
+
|
1848 |
+
return $list;
|
1849 |
+
}
|
1850 |
+
|
1851 |
+
/**
|
1852 |
+
* Get Page information
|
1853 |
+
*
|
1854 |
+
* @param $page_id
|
1855 |
+
* @param string $type
|
1856 |
+
* @return array
|
1857 |
+
*/
|
1858 |
+
function wp_statistics_get_page_info( $page_id, $type = 'post' ) {
|
1859 |
+
|
1860 |
+
//Create Empty Object
|
1861 |
+
$arg = array();
|
1862 |
+
$defaults = array(
|
1863 |
+
'link' => '',
|
1864 |
+
'edit_link' => '',
|
1865 |
+
'object_id' => $page_id,
|
1866 |
+
'title' => '-',
|
1867 |
+
'meta' => array()
|
1868 |
+
);
|
1869 |
+
|
1870 |
+
if ( $page_id > 0 and ! empty( $type ) ) {
|
1871 |
+
switch ( $type ) {
|
1872 |
+
case "product":
|
1873 |
+
case "attachment":
|
1874 |
+
case "post":
|
1875 |
+
case "page":
|
1876 |
+
$arg = array(
|
1877 |
+
'title' => get_the_title( $page_id ),
|
1878 |
+
'link' => get_the_permalink( $page_id ),
|
1879 |
+
'edit_link' => get_edit_post_link( $page_id ),
|
1880 |
+
'meta' => array(
|
1881 |
+
'post_type' => get_post_type( $page_id )
|
1882 |
+
)
|
1883 |
+
);
|
1884 |
+
break;
|
1885 |
+
case "category":
|
1886 |
+
case "post_tag":
|
1887 |
+
case "tax":
|
1888 |
+
$term = get_term( $page_id );
|
1889 |
+
$arg = array(
|
1890 |
+
'title' => $term->name,
|
1891 |
+
'link' => ( is_wp_error( get_term_link( $page_id ) ) === true ? '' : get_term_link( $page_id ) ),
|
1892 |
+
'edit_link' => get_edit_term_link( $page_id ),
|
1893 |
+
'meta' => array(
|
1894 |
+
'taxonomy' => $term->taxonomy,
|
1895 |
+
'term_taxonomy_id' => $term->term_taxonomy_id,
|
1896 |
+
'count' => $term->count,
|
1897 |
+
)
|
1898 |
+
);
|
1899 |
+
break;
|
1900 |
+
case "home":
|
1901 |
+
$arg = array(
|
1902 |
+
'title' => __( 'Home Page', 'wp-statistics' ),
|
1903 |
+
'link' => get_site_url()
|
1904 |
+
);
|
1905 |
+
break;
|
1906 |
+
case "author":
|
1907 |
+
$user_info = get_userdata( $page_id );
|
1908 |
+
$arg = array(
|
1909 |
+
'title' => ( $user_info->display_name != "" ? $user_info->display_name : $user_info->first_name . ' ' . $user_info->last_name ),
|
1910 |
+
'link' => get_author_posts_url( $page_id ),
|
1911 |
+
'edit_link' => get_edit_user_link( $page_id ),
|
1912 |
+
);
|
1913 |
+
break;
|
1914 |
+
case "search":
|
1915 |
+
$result['title'] = __( 'Search Page', 'wp-statistics' );
|
1916 |
+
break;
|
1917 |
+
case "404":
|
1918 |
+
$result['title'] = __( '404 not found', 'wp-statistics' );
|
1919 |
+
break;
|
1920 |
+
case "archive":
|
1921 |
+
$result['title'] = __( 'Post Archive', 'wp-statistics' );
|
1922 |
+
break;
|
1923 |
+
}
|
1924 |
+
}
|
1925 |
+
|
1926 |
+
return wp_parse_args( $arg, $defaults );
|
1927 |
+
}
|
1928 |
+
|
1929 |
+
/**
|
1930 |
+
* Table List Wp-statistics
|
1931 |
+
*
|
1932 |
+
* @param string $export
|
1933 |
+
* @param array $except
|
1934 |
+
* @return array|null
|
1935 |
+
*/
|
1936 |
+
function wp_statistics_db_table( $export = 'all', $except = array() ) {
|
1937 |
+
global $wpdb;
|
1938 |
+
|
1939 |
+
//Create Empty Object
|
1940 |
+
$list = array();
|
1941 |
+
|
1942 |
+
//List Of Table
|
1943 |
+
if ( is_string( $except ) ) {
|
1944 |
+
$except = array( $except );
|
1945 |
+
}
|
1946 |
+
$mysql_list_table = array_diff( WP_Statistics_Install::$db_table, $except );
|
1947 |
+
foreach ( $mysql_list_table as $tbl ) {
|
1948 |
+
$table_name = $wpdb->prefix . 'statistics_' . $tbl;
|
1949 |
+
if ( $export == "all" ) {
|
1950 |
+
if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) == $table_name ) {
|
1951 |
+
$list[ $tbl ] = $table_name;
|
1952 |
+
}
|
1953 |
+
} else {
|
1954 |
+
$list[ $tbl ] = $table_name;
|
1955 |
+
}
|
1956 |
+
}
|
1957 |
+
|
1958 |
+
//Export Data
|
1959 |
+
if ( $export == 'all' ) {
|
1960 |
+
return $list;
|
1961 |
+
} else {
|
1962 |
+
if ( array_key_exists( $export, $list ) ) {
|
1963 |
+
return $list[ $export ];
|
1964 |
+
}
|
1965 |
+
}
|
1966 |
+
|
1967 |
+
return null;
|
1968 |
+
}
|
1969 |
+
|
1970 |
+
/**
|
1971 |
+
* Check WP-statistics Option Require
|
1972 |
+
*
|
1973 |
+
* @param array $item
|
1974 |
+
* @param string $condition_key
|
1975 |
+
* @return array|bool
|
1976 |
+
*/
|
1977 |
+
function wp_statistics_check_option_require( $item = array(), $condition_key = 'require' ) {
|
1978 |
+
global $WP_Statistics;
|
1979 |
+
|
1980 |
+
$condition = true;
|
1981 |
+
if ( array_key_exists( 'require', $item ) ) {
|
1982 |
+
foreach ( $item[ $condition_key ] as $if ) {
|
1983 |
+
if ( ! $WP_Statistics->get_option( $if ) ) {
|
1984 |
+
$condition = false;
|
1985 |
+
break;
|
1986 |
+
}
|
1987 |
+
}
|
1988 |
+
}
|
1989 |
+
|
1990 |
+
return $condition;
|
1991 |
+
}
|
1992 |
+
|
1993 |
+
/**
|
1994 |
+
* Modify For IGNORE insert Query
|
1995 |
+
*
|
1996 |
+
* @hook add_action('query', function_name, 10);
|
1997 |
+
* @param $query
|
1998 |
+
* @return string
|
1999 |
+
*/
|
2000 |
+
function wp_statistics_ignore_insert( $query ) {
|
2001 |
+
$count = 0;
|
2002 |
+
$query = preg_replace( '/^(INSERT INTO)/i', 'INSERT IGNORE INTO', $query, 1, $count );
|
2003 |
+
return $query;
|
2004 |
+
}
|
2005 |
+
|
2006 |
+
/**
|
2007 |
+
* Get Html Body Page By Url
|
2008 |
+
*
|
2009 |
+
* @param $url string e.g : wp-statistics.com
|
2010 |
+
* @return bool
|
2011 |
+
*/
|
2012 |
+
function wp_statistics_get_html_page( $url ) {
|
2013 |
+
|
2014 |
+
//sanitize Url
|
2015 |
+
$parse_url = wp_parse_url( $url );
|
2016 |
+
$urls[] = esc_url_raw( $url );
|
2017 |
+
|
2018 |
+
//Check Protocol Url
|
2019 |
+
if ( ! array_key_exists( 'scheme', $parse_url ) ) {
|
2020 |
+
$urls = array();
|
2021 |
+
$url_parse = wp_parse_url( $url );
|
2022 |
+
foreach ( array( 'http://', 'https://' ) as $scheme ) {
|
2023 |
+
$urls[] = preg_replace( '/([^:])(\/{2,})/', '$1/', $scheme . path_join( ( isset( $url_parse['host'] ) ? $url_parse['host'] : '' ), ( isset( $url_parse['path'] ) ? $url_parse['path'] : '' ) ) );
|
2024 |
+
}
|
2025 |
+
}
|
2026 |
+
|
2027 |
+
//Send Request for Get Page Html
|
2028 |
+
foreach ( $urls as $page ) {
|
2029 |
+
$response = wp_remote_get( $page, array(
|
2030 |
+
'timeout' => 30,
|
2031 |
+
'user-agent' => "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36"
|
2032 |
+
) );
|
2033 |
+
if ( is_wp_error( $response ) ) {
|
2034 |
+
continue;
|
2035 |
+
}
|
2036 |
+
$data = wp_remote_retrieve_body( $response );
|
2037 |
+
if ( is_wp_error( $data ) ) {
|
2038 |
+
continue;
|
2039 |
+
}
|
2040 |
+
return ( wp_strip_all_tags( $data ) == "" ? false : $data );
|
2041 |
+
}
|
2042 |
+
|
2043 |
+
return false;
|
2044 |
+
}
|
2045 |
+
|
2046 |
+
/**
|
2047 |
+
* Get Site title By Url
|
2048 |
+
*
|
2049 |
+
* @param $url string e.g : wp-statistics.com
|
2050 |
+
* @return bool|string
|
2051 |
+
*/
|
2052 |
+
function wp_statistics_get_site_title( $url ) {
|
2053 |
+
|
2054 |
+
//Get ody Page
|
2055 |
+
$html = wp_statistics_get_html_page( $url );
|
2056 |
+
if ( $html === false ) {
|
2057 |
+
return false;
|
2058 |
+
}
|
2059 |
+
|
2060 |
+
//Get Page Title
|
2061 |
+
if ( class_exists( 'DOMDocument' ) ) {
|
2062 |
+
$dom = new DOMDocument;
|
2063 |
+
@$dom->loadHTML( $html );
|
2064 |
+
$title = '';
|
2065 |
+
if ( isset( $dom ) and $dom->getElementsByTagName( 'title' )->length > 0 ) {
|
2066 |
+
$title = $dom->getElementsByTagName( 'title' )->item( '0' )->nodeValue;
|
2067 |
+
}
|
2068 |
+
return ( wp_strip_all_tags( $title ) == "" ? false : $title );
|
2069 |
+
}
|
2070 |
+
|
2071 |
+
return false;
|
2072 |
+
}
|
2073 |
+
|
2074 |
+
|
2075 |
+
/**
|
2076 |
+
* Get WebSite IP Server And Country Name
|
2077 |
+
*
|
2078 |
+
* @param $url string domain name e.g : wp-statistics.com
|
2079 |
+
* @return array
|
2080 |
+
*/
|
2081 |
+
function wp_statistics_get_domain_server( $url ) {
|
2082 |
+
global $WP_Statistics;
|
2083 |
+
|
2084 |
+
//Create Empty Object
|
2085 |
+
$result = array(
|
2086 |
+
'ip' => '',
|
2087 |
+
'country' => ''
|
2088 |
+
);
|
2089 |
+
|
2090 |
+
//Get Ip by Domain
|
2091 |
+
if ( function_exists( 'gethostbyname' ) ) {
|
2092 |
+
$ip = gethostbyname( $url );
|
2093 |
+
if ( filter_var( $ip, FILTER_VALIDATE_IP ) ) {
|
2094 |
+
$result['ip'] = $ip;
|
2095 |
+
//Get country Code
|
2096 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
2097 |
+
$geoip_reader = $WP_Statistics::geoip_loader( 'country' );
|
2098 |
+
if ( $geoip_reader != false ) {
|
2099 |
+
try {
|
2100 |
+
$record = $geoip_reader->country( $ip );
|
2101 |
+
$result['country'] = $record->country->isoCode;
|
2102 |
+
} catch ( Exception $e ) {
|
2103 |
+
}
|
2104 |
+
}
|
2105 |
+
}
|
2106 |
+
}
|
2107 |
+
}
|
2108 |
+
|
2109 |
+
return $result;
|
2110 |
+
}
|
2111 |
+
|
2112 |
+
/**
|
2113 |
+
* Show Site Icon by Url
|
2114 |
+
*
|
2115 |
+
* @param $url
|
2116 |
+
* @param int $size
|
2117 |
+
* @param string $style
|
2118 |
+
* @return bool|string
|
2119 |
+
*/
|
2120 |
+
function wp_statistics_show_site_icon( $url, $size = 16, $style = '' ) {
|
2121 |
+
$url = preg_replace( '/^https?:\/\//', '', $url );
|
2122 |
+
if ( $url != "" ) {
|
2123 |
+
$imgurl = "https://www.google.com/s2/favicons?domain=" . $url;
|
2124 |
+
return '<img src="' . $imgurl . '" width="' . $size . '" height="' . $size . '" style="' . ( $style == "" ? 'vertical-align: -3px;' : '' ) . '" />';
|
2125 |
+
}
|
2126 |
+
|
2127 |
+
return false;
|
2128 |
+
}
|
2129 |
+
|
2130 |
+
/**
|
2131 |
+
* Get Number Referer Domain
|
2132 |
+
*
|
2133 |
+
* @param $url
|
2134 |
+
* @param array $time_rang
|
2135 |
+
* @return integer
|
2136 |
+
*/
|
2137 |
+
function wp_statistics_get_number_referer_from_domain( $url, $time_rang = array() ) {
|
2138 |
+
global $wpdb;
|
2139 |
+
|
2140 |
+
//Get Domain Name
|
2141 |
+
$search_url = wp_statistics_get_domain_name( esc_url_raw( $url ) );
|
2142 |
+
|
2143 |
+
//Prepare SQL
|
2144 |
+
$time_sql = '';
|
2145 |
+
if ( count( $time_rang ) > 0 and ! empty( $time_rang ) ) {
|
2146 |
+
$time_sql = sprintf( "AND `last_counter` BETWEEN '%s' AND '%s'", $time_rang[0], $time_rang[1] );
|
2147 |
+
}
|
2148 |
+
$sql = $wpdb->prepare( "SELECT COUNT(*) FROM `{$wpdb->prefix}statistics_visitor` WHERE `referred` REGEXP \"^(https?://|www\\.)[\.A-Za-z0-9\-]+\\.[a-zA-Z]{2,4}\" AND referred <> '' AND LENGTH(referred) >=12 AND (`referred` LIKE %s OR `referred` LIKE %s OR `referred` LIKE %s OR `referred` LIKE %s) " . $time_sql . " ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC", 'https://www.' . $wpdb->esc_like( $search_url ) . '%', 'https://' . $wpdb->esc_like( $search_url ) . '%', 'http://www.' . $wpdb->esc_like( $search_url ) . '%', 'http://' . $wpdb->esc_like( $search_url ) . '%' );
|
2149 |
+
|
2150 |
+
//Get Count
|
2151 |
+
return $wpdb->get_var( $sql );
|
2152 |
+
}
|
2153 |
+
|
2154 |
+
/**
|
2155 |
+
* Get Domain name from url
|
2156 |
+
* e.g : https://wp-statistics.com/add-ons/ -> wp-statistics.com
|
2157 |
+
*
|
2158 |
+
* @param $url
|
2159 |
+
* @return mixed
|
2160 |
+
*/
|
2161 |
+
function wp_statistics_get_domain_name( $url ) {
|
2162 |
+
//Remove protocol
|
2163 |
+
$url = preg_replace( "(^https?://)", "", trim( $url ) );
|
2164 |
+
//remove w(3)
|
2165 |
+
$url = preg_replace( '#^(http(s)?://)?w{3}\.#', '$1', $url );
|
2166 |
+
//remove all Query
|
2167 |
+
$url = explode( "/", $url );
|
2168 |
+
|
2169 |
+
return $url[0];
|
2170 |
}
|
includes/functions/purge.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
function wp_statistics_purge_data( $purge_days ) {
|
3 |
-
|
4 |
|
5 |
// If it's less than 30 days, don't do anything.
|
6 |
if ( $purge_days > 30 ) {
|
@@ -12,13 +12,7 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
12 |
|
13 |
if ( $result ) {
|
14 |
// Update the historical count with what we purged.
|
15 |
-
$historical_result = $wpdb->query(
|
16 |
-
$wpdb->prepare(
|
17 |
-
"UPDATE {$wpdb->prefix}statistics_historical SET value = value + %d WHERE `category` = 'visits'",
|
18 |
-
$result
|
19 |
-
)
|
20 |
-
);
|
21 |
-
|
22 |
if ( $historical_result == 0 ) {
|
23 |
$wpdb->insert(
|
24 |
$wpdb->prefix . "statistics_historical",
|
@@ -31,16 +25,9 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
31 |
);
|
32 |
}
|
33 |
|
34 |
-
$result_string = sprintf(
|
35 |
-
__( '%s data older than %s days purged successfully.', 'wp-statistics' ),
|
36 |
-
'<code>' . $table_name . '</code>',
|
37 |
-
'<code>' . $purge_days . '</code>'
|
38 |
-
);
|
39 |
} else {
|
40 |
-
$result_string = sprintf(
|
41 |
-
__( 'No records found to purge from %s!', 'wp-statistics' ),
|
42 |
-
'<code>' . $table_name . '</code>'
|
43 |
-
);
|
44 |
}
|
45 |
|
46 |
// Purge the visitors data.
|
@@ -50,13 +37,7 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
50 |
|
51 |
if ( $result ) {
|
52 |
// Update the historical count with what we purged.
|
53 |
-
$historical_result = $wpdb->query(
|
54 |
-
$wpdb->prepare(
|
55 |
-
"UPDATE {$wpdb->prefix}statistics_historical SET value = value + %d WHERE `category` = 'visitors'",
|
56 |
-
$result
|
57 |
-
)
|
58 |
-
);
|
59 |
-
|
60 |
if ( $historical_result == 0 ) {
|
61 |
$wpdb->insert(
|
62 |
$wpdb->prefix . "statistics_historical",
|
@@ -69,18 +50,9 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
69 |
);
|
70 |
}
|
71 |
|
72 |
-
$result_string .= '<br>' .
|
73 |
-
sprintf(
|
74 |
-
__( '%s data older than %s days purged successfully.', 'wp-statistics' ),
|
75 |
-
'<code>' . $table_name . '</code>',
|
76 |
-
'<code>' . $purge_days . '</code>'
|
77 |
-
);
|
78 |
} else {
|
79 |
-
$result_string .= '<br>' .
|
80 |
-
sprintf(
|
81 |
-
__( 'No records found to purge from %s!', 'wp-statistics' ),
|
82 |
-
'<code>' . $table_name . '</code>'
|
83 |
-
);
|
84 |
}
|
85 |
|
86 |
// Purge the exclusions data.
|
@@ -89,38 +61,19 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
89 |
$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$table_name} WHERE `date` < %s", $date_string ) );
|
90 |
|
91 |
if ( $result ) {
|
92 |
-
$result_string .= '<br>' .
|
93 |
-
sprintf(
|
94 |
-
__( '%s data older than %s days purged successfully.', 'wp-statistics' ),
|
95 |
-
'<code>' . $table_name . '</code>',
|
96 |
-
'<code>' . $purge_days . '</code>'
|
97 |
-
);
|
98 |
} else {
|
99 |
-
$result_string .= '<br>' .
|
100 |
-
sprintf(
|
101 |
-
__( 'No records found to purge from %s!', 'wp-statistics' ),
|
102 |
-
'<code>' . $table_name . '</code>'
|
103 |
-
);
|
104 |
}
|
105 |
|
106 |
// Purge the search data.
|
107 |
$table_name = $wpdb->prefix . 'statistics_search';
|
108 |
-
|
109 |
-
$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$table_name} WHERE `last_counter` < %s", $date_string ) );
|
110 |
|
111 |
if ( $result ) {
|
112 |
-
$result_string .= '<br>' .
|
113 |
-
sprintf(
|
114 |
-
__( '%s data older than %s days purged successfully.', 'wp-statistics' ),
|
115 |
-
'<code>' . $table_name . '</code>',
|
116 |
-
'<code>' . $purge_days . '</code>'
|
117 |
-
);
|
118 |
} else {
|
119 |
-
$result_string .= '<br>' .
|
120 |
-
sprintf(
|
121 |
-
__( 'No records found to purge from %s!', 'wp-statistics' ),
|
122 |
-
'<code>' . $table_name . '</code>'
|
123 |
-
);
|
124 |
}
|
125 |
|
126 |
// Purge the pages data, this is more complex as we want to save the historical data per page.
|
@@ -174,18 +127,9 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
174 |
$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$table_name} WHERE `date` < %s", $date_string ) );
|
175 |
|
176 |
if ( $result ) {
|
177 |
-
$result_string .= '<br>' .
|
178 |
-
sprintf(
|
179 |
-
__( '%s data older than %s days purged successfully.', 'wp-statistics' ),
|
180 |
-
'<code>' . $table_name . '</code>',
|
181 |
-
'<code>' . $purge_days . '</code>'
|
182 |
-
);
|
183 |
} else {
|
184 |
-
$result_string .= '<br>' .
|
185 |
-
sprintf(
|
186 |
-
__( 'No records found to purge from %s!', 'wp-statistics' ),
|
187 |
-
'<code>' . $table_name . '</code>'
|
188 |
-
);
|
189 |
}
|
190 |
|
191 |
if ( $WP_Statistics->get_option( 'prune_report' ) == true ) {
|
@@ -200,12 +144,7 @@ function wp_statistics_purge_data( $purge_days ) {
|
|
200 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
201 |
}
|
202 |
|
203 |
-
wp_mail(
|
204 |
-
$WP_Statistics->get_option( 'email_list' ),
|
205 |
-
__( 'Database pruned on', 'wp-statistics' ) . ' ' . $blogname,
|
206 |
-
$result_string,
|
207 |
-
$headers
|
208 |
-
);
|
209 |
}
|
210 |
|
211 |
return $result_string;
|
1 |
<?php
|
2 |
function wp_statistics_purge_data( $purge_days ) {
|
3 |
+
global $wpdb, $WP_Statistics;
|
4 |
|
5 |
// If it's less than 30 days, don't do anything.
|
6 |
if ( $purge_days > 30 ) {
|
12 |
|
13 |
if ( $result ) {
|
14 |
// Update the historical count with what we purged.
|
15 |
+
$historical_result = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}statistics_historical SET value = value + %d WHERE `category` = 'visits'", $result ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
if ( $historical_result == 0 ) {
|
17 |
$wpdb->insert(
|
18 |
$wpdb->prefix . "statistics_historical",
|
25 |
);
|
26 |
}
|
27 |
|
28 |
+
$result_string = sprintf( __( '%s data older than %s days purged successfully.', 'wp-statistics' ), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>' );
|
|
|
|
|
|
|
|
|
29 |
} else {
|
30 |
+
$result_string = sprintf( __( 'No records found to purge from %s!', 'wp-statistics' ), '<code>' . $table_name . '</code>' );
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
// Purge the visitors data.
|
37 |
|
38 |
if ( $result ) {
|
39 |
// Update the historical count with what we purged.
|
40 |
+
$historical_result = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}statistics_historical SET value = value + %d WHERE `category` = 'visitors'", $result ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
if ( $historical_result == 0 ) {
|
42 |
$wpdb->insert(
|
43 |
$wpdb->prefix . "statistics_historical",
|
50 |
);
|
51 |
}
|
52 |
|
53 |
+
$result_string .= '<br>' . sprintf( __( '%s data older than %s days purged successfully.', 'wp-statistics' ), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>' );
|
|
|
|
|
|
|
|
|
|
|
54 |
} else {
|
55 |
+
$result_string .= '<br>' . sprintf( __( 'No records found to purge from %s!', 'wp-statistics' ), '<code>' . $table_name . '</code>' );
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
// Purge the exclusions data.
|
61 |
$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$table_name} WHERE `date` < %s", $date_string ) );
|
62 |
|
63 |
if ( $result ) {
|
64 |
+
$result_string .= '<br>' . sprintf( __( '%s data older than %s days purged successfully.', 'wp-statistics' ), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>' );
|
|
|
|
|
|
|
|
|
|
|
65 |
} else {
|
66 |
+
$result_string .= '<br>' . sprintf( __( 'No records found to purge from %s!', 'wp-statistics' ), '<code>' . $table_name . '</code>' );
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
// Purge the search data.
|
70 |
$table_name = $wpdb->prefix . 'statistics_search';
|
71 |
+
$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$table_name} WHERE `last_counter` < %s", $date_string ) );
|
|
|
72 |
|
73 |
if ( $result ) {
|
74 |
+
$result_string .= '<br>' . sprintf( __( '%s data older than %s days purged successfully.', 'wp-statistics' ), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>' );
|
|
|
|
|
|
|
|
|
|
|
75 |
} else {
|
76 |
+
$result_string .= '<br>' . sprintf( __( 'No records found to purge from %s!', 'wp-statistics' ), '<code>' . $table_name . '</code>' );
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
// Purge the pages data, this is more complex as we want to save the historical data per page.
|
127 |
$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$table_name} WHERE `date` < %s", $date_string ) );
|
128 |
|
129 |
if ( $result ) {
|
130 |
+
$result_string .= '<br>' . sprintf( __( '%s data older than %s days purged successfully.', 'wp-statistics' ), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>' );
|
|
|
|
|
|
|
|
|
|
|
131 |
} else {
|
132 |
+
$result_string .= '<br>' . sprintf( __( 'No records found to purge from %s!', 'wp-statistics' ), '<code>' . $table_name . '</code>' );
|
|
|
|
|
|
|
|
|
133 |
}
|
134 |
|
135 |
if ( $WP_Statistics->get_option( 'prune_report' ) == true ) {
|
144 |
$WP_Statistics->update_option( 'email_list', $blogemail );
|
145 |
}
|
146 |
|
147 |
+
wp_mail( $WP_Statistics->get_option( 'email_list' ), __( 'Database pruned on', 'wp-statistics' ) . ' ' . $blogname, $result_string, $headers );
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
return $result_string;
|
includes/github/elidickinson/php-export-data/php-export-data.class.php
DELETED
@@ -1,235 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// php-export-data by Eli Dickinson, http://github.com/elidickinson/php-export-data
|
3 |
-
/**
|
4 |
-
* ExportData is the base class for exporters to specific file formats. See other
|
5 |
-
* classes below.
|
6 |
-
*/
|
7 |
-
abstract class ExportData {
|
8 |
-
protected $exportTo; // Set in constructor to one of 'browser', 'file', 'string'
|
9 |
-
protected $stringData; // stringData so far, used if export string mode
|
10 |
-
protected $tempFile; // handle to temp file (for export file mode)
|
11 |
-
protected $tempFilename; // temp file name and path (for export file mode)
|
12 |
-
public $filename; // file mode: the output file name; browser mode: file name for download; string mode: not used
|
13 |
-
public function __construct($exportTo = "browser", $filename = "exportdata") {
|
14 |
-
if(!in_array($exportTo, array('browser','file','string') )) {
|
15 |
-
throw new Exception("$exportTo is not a valid ExportData export type");
|
16 |
-
}
|
17 |
-
$this->exportTo = $exportTo;
|
18 |
-
$this->filename = $filename;
|
19 |
-
}
|
20 |
-
|
21 |
-
public function initialize() {
|
22 |
-
|
23 |
-
switch($this->exportTo) {
|
24 |
-
case 'browser':
|
25 |
-
$this->sendHttpHeaders();
|
26 |
-
break;
|
27 |
-
case 'string':
|
28 |
-
$this->stringData = '';
|
29 |
-
break;
|
30 |
-
case 'file':
|
31 |
-
$this->tempFilename = tempnam(sys_get_temp_dir(), 'exportdata');
|
32 |
-
$this->tempFile = fopen($this->tempFilename, "w");
|
33 |
-
break;
|
34 |
-
}
|
35 |
-
|
36 |
-
$this->write($this->generateHeader());
|
37 |
-
}
|
38 |
-
|
39 |
-
public function addRow($row) {
|
40 |
-
$this->write($this->generateRow($row));
|
41 |
-
}
|
42 |
-
|
43 |
-
public function finalize() {
|
44 |
-
|
45 |
-
$this->write($this->generateFooter());
|
46 |
-
|
47 |
-
switch($this->exportTo) {
|
48 |
-
case 'browser':
|
49 |
-
flush();
|
50 |
-
break;
|
51 |
-
case 'string':
|
52 |
-
// do nothing
|
53 |
-
break;
|
54 |
-
case 'file':
|
55 |
-
// close temp file and move it to correct location
|
56 |
-
fclose($this->tempFile);
|
57 |
-
rename($this->tempFilename, $this->filename);
|
58 |
-
break;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
public function getString() {
|
63 |
-
return $this->stringData;
|
64 |
-
}
|
65 |
-
|
66 |
-
abstract public function sendHttpHeaders();
|
67 |
-
|
68 |
-
protected function write($data) {
|
69 |
-
switch($this->exportTo) {
|
70 |
-
case 'browser':
|
71 |
-
echo $data;
|
72 |
-
break;
|
73 |
-
case 'string':
|
74 |
-
$this->stringData .= $data;
|
75 |
-
break;
|
76 |
-
case 'file':
|
77 |
-
fwrite($this->tempFile, $data);
|
78 |
-
break;
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
protected function generateHeader() {
|
83 |
-
// can be overridden by subclass to return any data that goes at the top of the exported file
|
84 |
-
}
|
85 |
-
|
86 |
-
protected function generateFooter() {
|
87 |
-
// can be overridden by subclass to return any data that goes at the bottom of the exported file
|
88 |
-
}
|
89 |
-
|
90 |
-
// In subclasses generateRow will take $row array and return string of it formatted for export type
|
91 |
-
abstract protected function generateRow($row);
|
92 |
-
|
93 |
-
}
|
94 |
-
/**
|
95 |
-
* ExportDataTSV - Exports to TSV (tab separated value) format.
|
96 |
-
*/
|
97 |
-
class ExportDataTSV extends ExportData {
|
98 |
-
|
99 |
-
function generateRow($row) {
|
100 |
-
foreach ($row as $key => $value) {
|
101 |
-
// Escape inner quotes and wrap all contents in new quotes.
|
102 |
-
// Note that we are using \" to escape double quote not ""
|
103 |
-
$row[$key] = '"'. str_replace('"', '\"', $value) .'"';
|
104 |
-
}
|
105 |
-
return implode("\t", $row) . "\n";
|
106 |
-
}
|
107 |
-
|
108 |
-
function sendHttpHeaders() {
|
109 |
-
header("Content-type: text/tab-separated-values");
|
110 |
-
header("Content-Disposition: attachment; filename=".basename($this->filename));
|
111 |
-
}
|
112 |
-
}
|
113 |
-
/**
|
114 |
-
* ExportDataCSV - Exports to CSV (comma separated value) format.
|
115 |
-
*/
|
116 |
-
class ExportDataCSV extends ExportData {
|
117 |
-
|
118 |
-
function generateRow($row) {
|
119 |
-
foreach ($row as $key => $value) {
|
120 |
-
// Escape inner quotes and wrap all contents in new quotes.
|
121 |
-
// Note that we are using \" to escape double quote not ""
|
122 |
-
$row[$key] = '"'. str_replace('"', '\"', $value) .'"';
|
123 |
-
}
|
124 |
-
return implode(",", $row) . "\n";
|
125 |
-
}
|
126 |
-
|
127 |
-
function sendHttpHeaders() {
|
128 |
-
header("Content-type: text/csv");
|
129 |
-
header("Content-Disposition: attachment; filename=".basename($this->filename));
|
130 |
-
}
|
131 |
-
}
|
132 |
-
/**
|
133 |
-
* ExportDataExcel exports data into an XML format (spreadsheetML) that can be
|
134 |
-
* read by MS Excel 2003 and newer as well as OpenOffice
|
135 |
-
*
|
136 |
-
* Creates a workbook with a single worksheet (title specified by
|
137 |
-
* $title).
|
138 |
-
*
|
139 |
-
* Note that using .XML is the "correct" file extension for these files, but it
|
140 |
-
* generally isn't associated with Excel. Using .XLS is tempting, but Excel 2007 will
|
141 |
-
* throw a scary warning that the extension doesn't match the file type.
|
142 |
-
*
|
143 |
-
* Based on Excel XML code from Excel_XML (http://github.com/oliverschwarz/php-excel)
|
144 |
-
* by Oliver Schwarz
|
145 |
-
*/
|
146 |
-
class ExportDataExcel extends ExportData {
|
147 |
-
|
148 |
-
const XmlHeader = "<?xml version=\"1.0\" encoding=\"%s\"?\>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">";
|
149 |
-
const XmlFooter = "</Workbook>";
|
150 |
-
|
151 |
-
public $encoding = 'UTF-8'; // encoding type to specify in file.
|
152 |
-
// Note that you're on your own for making sure your data is actually encoded to this encoding
|
153 |
-
|
154 |
-
public $title = 'Sheet1'; // title for Worksheet
|
155 |
-
|
156 |
-
function generateHeader() {
|
157 |
-
|
158 |
-
// workbook header
|
159 |
-
$output = stripslashes(sprintf(self::XmlHeader, $this->encoding)) . "\n";
|
160 |
-
|
161 |
-
// Set up styles
|
162 |
-
$output .= "<Styles>\n";
|
163 |
-
$output .= "<Style ss:ID=\"sDT\"><NumberFormat ss:Format=\"Short Date\"/></Style>\n";
|
164 |
-
$output .= "</Styles>\n";
|
165 |
-
|
166 |
-
// worksheet header
|
167 |
-
$output .= sprintf("<Worksheet ss:Name=\"%s\">\n <Table>\n", htmlentities($this->title));
|
168 |
-
|
169 |
-
return $output;
|
170 |
-
}
|
171 |
-
|
172 |
-
function generateFooter() {
|
173 |
-
$output = '';
|
174 |
-
|
175 |
-
// worksheet footer
|
176 |
-
$output .= " </Table>\n</Worksheet>\n";
|
177 |
-
|
178 |
-
// workbook footer
|
179 |
-
$output .= self::XmlFooter;
|
180 |
-
|
181 |
-
return $output;
|
182 |
-
}
|
183 |
-
|
184 |
-
function generateRow($row) {
|
185 |
-
$output = '';
|
186 |
-
$output .= " <Row>\n";
|
187 |
-
foreach ($row as $k => $v) {
|
188 |
-
$output .= $this->generateCell($v);
|
189 |
-
}
|
190 |
-
$output .= " </Row>\n";
|
191 |
-
return $output;
|
192 |
-
}
|
193 |
-
|
194 |
-
private function generateCell($item) {
|
195 |
-
$output = '';
|
196 |
-
$style = '';
|
197 |
-
|
198 |
-
// Tell Excel to treat as a number. Note that Excel only stores roughly 15 digits, so keep
|
199 |
-
// as text if number is longer than that.
|
200 |
-
if(preg_match("/^-?\d+(?:[.,]\d+)?$/",$item) && (strlen($item) < 15)) {
|
201 |
-
$type = 'Number';
|
202 |
-
}
|
203 |
-
// Sniff for valid dates; should look something like 2010-07-14 or 7/14/2010 etc. Can
|
204 |
-
// also have an optional time after the date.
|
205 |
-
//
|
206 |
-
// Note we want to be very strict in what we consider a date. There is the possibility
|
207 |
-
// of really screwing up the data if we try to reformat a string that was not actually
|
208 |
-
// intended to represent a date.
|
209 |
-
elseif(preg_match("/^(\d{1,2}|\d{4})[\/\-]\d{1,2}[\/\-](\d{1,2}|\d{4})([^\d].+)?$/",$item) &&
|
210 |
-
($timestamp = strtotime($item)) &&
|
211 |
-
($timestamp > 0) &&
|
212 |
-
($timestamp < strtotime('+500 years'))) {
|
213 |
-
$type = 'DateTime';
|
214 |
-
$item = strftime("%Y-%m-%dT%H:%M:%S",$timestamp);
|
215 |
-
$style = 'sDT'; // defined in header; tells excel to format date for display
|
216 |
-
}
|
217 |
-
else {
|
218 |
-
$type = 'String';
|
219 |
-
}
|
220 |
-
|
221 |
-
$item = str_replace(''', ''', htmlspecialchars($item, ENT_QUOTES));
|
222 |
-
$output .= " ";
|
223 |
-
$output .= $style ? "<Cell ss:StyleID=\"$style\">" : "<Cell>";
|
224 |
-
$output .= sprintf("<Data ss:Type=\"%s\">%s</Data>", $type, $item);
|
225 |
-
$output .= "</Cell>\n";
|
226 |
-
|
227 |
-
return $output;
|
228 |
-
}
|
229 |
-
|
230 |
-
function sendHttpHeaders() {
|
231 |
-
header("Content-Type: application/vnd.ms-excel; charset=" . $this->encoding);
|
232 |
-
header("Content-Disposition: inline; filename=\"" . basename($this->filename) . "\"");
|
233 |
-
}
|
234 |
-
|
235 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/log/all-browsers.php
CHANGED
@@ -4,22 +4,8 @@
|
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
-
|
8 |
-
|
9 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
10 |
-
}
|
11 |
-
|
12 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
13 |
-
$rangestart = $_GET['rangestart'];
|
14 |
-
} else {
|
15 |
-
$rangestart = '';
|
16 |
-
}
|
17 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
18 |
-
$rangeend = $_GET['rangeend'];
|
19 |
-
} else {
|
20 |
-
$rangeend = '';
|
21 |
-
}
|
22 |
-
|
23 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
24 |
$daysToDisplay,
|
25 |
$rangestart,
|
@@ -56,7 +42,7 @@ $browser_color = array();
|
|
56 |
foreach ( $BrowserVisits as $key => $value ) {
|
57 |
if ( $value > 0 ) {
|
58 |
$i ++;
|
59 |
-
$browser_name[] = "'" . $key . "'";
|
60 |
$browser_value[] = $value;
|
61 |
$browser_color[] = wp_statistics_generate_rgba_color( $i, '0.4' );
|
62 |
}
|
@@ -89,10 +75,8 @@ foreach ( $PlatformVisits as $key => $value ) {
|
|
89 |
$platform_color[] = wp_statistics_generate_rgba_color( $i, '0.4' );
|
90 |
}
|
91 |
?>
|
92 |
-
<div class="wrap">
|
93 |
-
|
94 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
95 |
-
|
96 |
<div><?php wp_statistics_date_range_selector( WP_Statistics::$page['browser'], $daysToDisplay ); ?></div>
|
97 |
<div class="postbox-container" style="width: 48%; float: left; margin-right:20px">
|
98 |
<div class="metabox-holder">
|
@@ -100,10 +84,7 @@ foreach ( $PlatformVisits as $key => $value ) {
|
|
100 |
<div class="postbox">
|
101 |
<?php $paneltitle = __( 'Browsers', 'wp-statistics' ); ?>
|
102 |
<button class="handlediv" type="button" aria-expanded="true">
|
103 |
-
<span class="screen-reader-text"><?php printf(
|
104 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
105 |
-
$paneltitle
|
106 |
-
); ?></span>
|
107 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
108 |
</button>
|
109 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
@@ -111,6 +92,7 @@ foreach ( $PlatformVisits as $key => $value ) {
|
|
111 |
<canvas id="browsers-log" height="200"></canvas>
|
112 |
<script>
|
113 |
var ctx = document.getElementById("browsers-log").getContext('2d');
|
|
|
114 |
var ChartJs = new Chart(ctx, {
|
115 |
type: 'pie',
|
116 |
data: {
|
@@ -166,6 +148,7 @@ foreach ( $PlatformVisits as $key => $value ) {
|
|
166 |
<canvas id="platforms-log" height="200"></canvas>
|
167 |
<script>
|
168 |
var ctx = document.getElementById("platforms-log").getContext('2d');
|
|
|
169 |
var ChartJs = new Chart(ctx, {
|
170 |
type: 'pie',
|
171 |
data: {
|
@@ -279,7 +262,7 @@ function wp_statistics_browser_version_stats( $Browser, $rangestartdate, $rangee
|
|
279 |
}
|
280 |
?>
|
281 |
<div class="postbox">
|
282 |
-
<?php $paneltitle = sprintf( __( '%s Version', 'wp-statistics' ), $Browser ); ?>
|
283 |
<button class="handlediv" type="button" aria-expanded="true">
|
284 |
<span class="screen-reader-text"><?php printf(
|
285 |
__( 'Toggle panel: %s', 'wp-statistics' ),
|
@@ -293,6 +276,7 @@ function wp_statistics_browser_version_stats( $Browser, $rangestartdate, $rangee
|
|
293 |
<canvas id="<?php echo $id; ?>" height="250"></canvas>
|
294 |
<script>
|
295 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
|
|
296 |
var ChartJs = new Chart(ctx, {
|
297 |
type: 'doughnut',
|
298 |
data: {
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
+
//Set Default Time Picker Option
|
8 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
10 |
$daysToDisplay,
|
11 |
$rangestart,
|
42 |
foreach ( $BrowserVisits as $key => $value ) {
|
43 |
if ( $value > 0 ) {
|
44 |
$i ++;
|
45 |
+
$browser_name[] = "'" . wp_statistics_get_browser_list( strtolower( $key ) ) . "'";
|
46 |
$browser_value[] = $value;
|
47 |
$browser_color[] = wp_statistics_generate_rgba_color( $i, '0.4' );
|
48 |
}
|
75 |
$platform_color[] = wp_statistics_generate_rgba_color( $i, '0.4' );
|
76 |
}
|
77 |
?>
|
78 |
+
<div class="wrap wps-wrap">
|
79 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Browser Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
80 |
<div><?php wp_statistics_date_range_selector( WP_Statistics::$page['browser'], $daysToDisplay ); ?></div>
|
81 |
<div class="postbox-container" style="width: 48%; float: left; margin-right:20px">
|
82 |
<div class="metabox-holder">
|
84 |
<div class="postbox">
|
85 |
<?php $paneltitle = __( 'Browsers', 'wp-statistics' ); ?>
|
86 |
<button class="handlediv" type="button" aria-expanded="true">
|
87 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
88 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
89 |
</button>
|
90 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
92 |
<canvas id="browsers-log" height="200"></canvas>
|
93 |
<script>
|
94 |
var ctx = document.getElementById("browsers-log").getContext('2d');
|
95 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
96 |
var ChartJs = new Chart(ctx, {
|
97 |
type: 'pie',
|
98 |
data: {
|
148 |
<canvas id="platforms-log" height="200"></canvas>
|
149 |
<script>
|
150 |
var ctx = document.getElementById("platforms-log").getContext('2d');
|
151 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
152 |
var ChartJs = new Chart(ctx, {
|
153 |
type: 'pie',
|
154 |
data: {
|
262 |
}
|
263 |
?>
|
264 |
<div class="postbox">
|
265 |
+
<?php $paneltitle = sprintf( __( '%s Version', 'wp-statistics' ), wp_statistics_get_browser_list( strtolower( $Browser ) ) ); ?>
|
266 |
<button class="handlediv" type="button" aria-expanded="true">
|
267 |
<span class="screen-reader-text"><?php printf(
|
268 |
__( 'Toggle panel: %s', 'wp-statistics' ),
|
276 |
<canvas id="<?php echo $id; ?>" height="250"></canvas>
|
277 |
<script>
|
278 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
279 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
280 |
var ChartJs = new Chart(ctx, {
|
281 |
type: 'doughnut',
|
282 |
data: {
|
includes/log/authors.php
CHANGED
@@ -4,26 +4,11 @@
|
|
4 |
});
|
5 |
</script>
|
6 |
|
7 |
-
<div class="wrap">
|
8 |
-
|
9 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
10 |
-
|
11 |
<?php
|
12 |
-
|
13 |
-
|
14 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
15 |
-
}
|
16 |
-
|
17 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
18 |
-
$rangestart = $_GET['rangestart'];
|
19 |
-
} else {
|
20 |
-
$rangestart = '';
|
21 |
-
}
|
22 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
23 |
-
$rangeend = $_GET['rangeend'];
|
24 |
-
} else {
|
25 |
-
$rangeend = '';
|
26 |
-
}
|
27 |
if ( array_key_exists( 'author', $_GET ) ) {
|
28 |
$author = intval( $_GET['author'] );
|
29 |
} else {
|
@@ -48,7 +33,7 @@
|
|
48 |
$selected = '';
|
49 |
}
|
50 |
|
51 |
-
$html .= '<option value="' . $author_obj->ID . "\"{$selected}>" . ($author_obj->display_name !="" ? $author_obj->display_name : $author_obj->user_login) . '</option>';
|
52 |
}
|
53 |
}
|
54 |
|
@@ -120,6 +105,7 @@
|
|
120 |
<canvas id="hit-stats" height="80"></canvas>
|
121 |
<script>
|
122 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
|
|
123 |
var ChartJs = new Chart(ctx, {
|
124 |
type: 'line',
|
125 |
data: {
|
4 |
});
|
5 |
</script>
|
6 |
|
7 |
+
<div class="wrap wps-wrap">
|
8 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Author Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
9 |
<?php
|
10 |
+
//Set Default Time Picker Option
|
11 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
if ( array_key_exists( 'author', $_GET ) ) {
|
13 |
$author = intval( $_GET['author'] );
|
14 |
} else {
|
33 |
$selected = '';
|
34 |
}
|
35 |
|
36 |
+
$html .= '<option value="' . $author_obj->ID . "\"{$selected}>" . ( $author_obj->display_name != "" ? $author_obj->display_name : $author_obj->user_login ) . '</option>';
|
37 |
}
|
38 |
}
|
39 |
|
105 |
<canvas id="hit-stats" height="80"></canvas>
|
106 |
<script>
|
107 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
108 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
109 |
var ChartJs = new Chart(ctx, {
|
110 |
type: 'line',
|
111 |
data: {
|
includes/log/categories.php
CHANGED
@@ -3,28 +3,11 @@
|
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
-
<div class="wrap">
|
7 |
-
|
8 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
9 |
-
|
10 |
<?php
|
11 |
-
|
12 |
-
|
13 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
14 |
-
}
|
15 |
-
|
16 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
17 |
-
$rangestart = $_GET['rangestart'];
|
18 |
-
} else {
|
19 |
-
$rangestart = '';
|
20 |
-
}
|
21 |
-
|
22 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
23 |
-
$rangeend = $_GET['rangeend'];
|
24 |
-
} else {
|
25 |
-
$rangeend = '';
|
26 |
-
}
|
27 |
-
|
28 |
if ( array_key_exists( 'cat', $_GET ) ) {
|
29 |
$category = intval( $_GET['cat'] );
|
30 |
} else {
|
@@ -109,6 +92,7 @@
|
|
109 |
<canvas id="hit-stats" height="80"></canvas>
|
110 |
<script>
|
111 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
|
|
112 |
var ChartJs = new Chart(ctx, {
|
113 |
type: 'line',
|
114 |
data: {
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
+
<div class="wrap wps-wrap">
|
7 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Category Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
8 |
<?php
|
9 |
+
//Set Default Time Picker Option
|
10 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
if ( array_key_exists( 'cat', $_GET ) ) {
|
12 |
$category = intval( $_GET['cat'] );
|
13 |
} else {
|
92 |
<canvas id="hit-stats" height="80"></canvas>
|
93 |
<script>
|
94 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
95 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
96 |
var ChartJs = new Chart(ctx, {
|
97 |
type: 'line',
|
98 |
data: {
|
includes/log/exclusions.php
CHANGED
@@ -13,22 +13,8 @@ if ( $WP_Statistics->get_option( 'record_exclusions' ) != 1 ) {
|
|
13 |
"</strong></p></div>";
|
14 |
}
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
19 |
-
}
|
20 |
-
|
21 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
22 |
-
$rangestart = $_GET['rangestart'];
|
23 |
-
} else {
|
24 |
-
$rangestart = '';
|
25 |
-
}
|
26 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
27 |
-
$rangeend = $_GET['rangeend'];
|
28 |
-
} else {
|
29 |
-
$rangeend = '';
|
30 |
-
}
|
31 |
-
|
32 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
33 |
$daysToDisplay,
|
34 |
$rangestart,
|
@@ -168,10 +154,8 @@ foreach ( $excluded_reasons as $reason ) {
|
|
168 |
}
|
169 |
}
|
170 |
?>
|
171 |
-
<div class="wrap">
|
172 |
-
|
173 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
174 |
-
|
175 |
<?php wp_statistics_date_range_selector( WP_Statistics::$page['exclusions'], $daysToDisplay ); ?>
|
176 |
<div class="postbox-container" id="last-log">
|
177 |
<div class="metabox-holder">
|
@@ -190,10 +174,10 @@ foreach ( $excluded_reasons as $reason ) {
|
|
190 |
<div class="inside">
|
191 |
<div class="inside">
|
192 |
<canvas id="hit-stats" height="80"></canvas>
|
193 |
-
<script type='text/javascript'
|
194 |
-
src='<?php echo WP_Statistics::$reg['plugin-url']; ?>assets/js/Chart.bundle.min.js'></script>
|
195 |
<script>
|
196 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
|
|
197 |
var ChartJs = new Chart(ctx, {
|
198 |
type: 'line',
|
199 |
data: {
|
13 |
"</strong></p></div>";
|
14 |
}
|
15 |
|
16 |
+
//Set Default Time Picker Option
|
17 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
19 |
$daysToDisplay,
|
20 |
$rangestart,
|
154 |
}
|
155 |
}
|
156 |
?>
|
157 |
+
<div class="wrap wps-wrap">
|
158 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Exclusions Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
159 |
<?php wp_statistics_date_range_selector( WP_Statistics::$page['exclusions'], $daysToDisplay ); ?>
|
160 |
<div class="postbox-container" id="last-log">
|
161 |
<div class="metabox-holder">
|
174 |
<div class="inside">
|
175 |
<div class="inside">
|
176 |
<canvas id="hit-stats" height="80"></canvas>
|
177 |
+
<script type='text/javascript' src='<?php echo WP_Statistics::$reg['plugin-url']; ?>assets/js/Chart.bundle.min.js'></script>
|
|
|
178 |
<script>
|
179 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
180 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
181 |
var ChartJs = new Chart(ctx, {
|
182 |
type: 'line',
|
183 |
data: {
|
includes/log/hit-statistics.php
CHANGED
@@ -3,27 +3,11 @@
|
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
-
<div class="wrap">
|
7 |
-
|
8 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
9 |
-
|
10 |
<?php
|
11 |
-
|
12 |
-
|
13 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
14 |
-
}
|
15 |
-
|
16 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
17 |
-
$rangestart = $_GET['rangestart'];
|
18 |
-
} else {
|
19 |
-
$rangestart = '';
|
20 |
-
}
|
21 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
22 |
-
$rangeend = $_GET['rangeend'];
|
23 |
-
} else {
|
24 |
-
$rangeend = '';
|
25 |
-
}
|
26 |
-
|
27 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
28 |
$daysToDisplay,
|
29 |
$rangestart,
|
@@ -72,6 +56,7 @@
|
|
72 |
<canvas id="hit-stats" height="80"></canvas>
|
73 |
<script>
|
74 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
|
|
75 |
var ChartJs = new Chart(ctx, {
|
76 |
type: 'line',
|
77 |
data: {
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
+
<div class="wrap wps-wrap">
|
7 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Hit Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
8 |
<?php
|
9 |
+
//Set Default Time Picker Option
|
10 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
12 |
$daysToDisplay,
|
13 |
$rangestart,
|
56 |
<canvas id="hit-stats" height="80"></canvas>
|
57 |
<script>
|
58 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
59 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
60 |
var ChartJs = new Chart(ctx, {
|
61 |
type: 'line',
|
62 |
data: {
|
includes/log/last-search.php
CHANGED
@@ -24,10 +24,9 @@ if ( array_key_exists( 'referred', $_GET ) ) {
|
|
24 |
|
25 |
$total = $search_result[ $referred ];
|
26 |
?>
|
27 |
-
<div class="wrap">
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
<ul class="subsubsub">
|
32 |
<?php
|
33 |
$search_result_count = count( $search_result );
|
@@ -51,11 +50,13 @@ $total = $search_result[ $referred ];
|
|
51 |
$translate = $search_engines[ $key ]['translated'];
|
52 |
}
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
59 |
}
|
60 |
?>
|
61 |
</ul>
|
@@ -65,10 +66,7 @@ $total = $search_result[ $referred ];
|
|
65 |
<div class="postbox">
|
66 |
<?php $paneltitle = __( 'Latest Search Word Statistics', 'wp-statistics' ); ?>
|
67 |
<button class="handlediv" type="button" aria-expanded="true">
|
68 |
-
|
69 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
70 |
-
$paneltitle
|
71 |
-
); ?></span>
|
72 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
73 |
</button>
|
74 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
@@ -78,26 +76,11 @@ $total = $search_result[ $referred ];
|
|
78 |
<?php
|
79 |
if ( $total > 0 ) {
|
80 |
// Instantiate pagination object with appropriate arguments
|
81 |
-
$
|
82 |
-
$
|
83 |
-
$
|
84 |
-
$
|
85 |
-
$
|
86 |
-
$styleSelect = "paginationSelect";
|
87 |
-
|
88 |
-
$Pagination = new WP_Statistics_Pagination(
|
89 |
-
$total,
|
90 |
-
$pagesPerSection,
|
91 |
-
$options,
|
92 |
-
false,
|
93 |
-
$stylePageOff,
|
94 |
-
$stylePageOn,
|
95 |
-
$styleErrors,
|
96 |
-
$styleSelect
|
97 |
-
);
|
98 |
-
|
99 |
-
$start = $Pagination->getEntryStart();
|
100 |
-
$end = $Pagination->getEntryEnd();
|
101 |
|
102 |
// Retrieve MySQL data
|
103 |
if ( $referred && $referred != '' ) {
|
@@ -126,8 +109,7 @@ $total = $search_result[ $referred ];
|
|
126 |
|
127 |
$dash_icon = wp_statistics_icons( 'dashicons-location-alt', 'map' );
|
128 |
|
129 |
-
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
130 |
-
<tr>";
|
131 |
echo "<td>" . __( 'Word', 'wp-statistics' ) . "</td>";
|
132 |
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
133 |
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
@@ -168,16 +150,11 @@ $total = $search_result[ $referred ];
|
|
168 |
echo "<td style=\"text-align: left\">";
|
169 |
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false
|
170 |
) {
|
171 |
-
$agent = "<img src='" .
|
172 |
-
plugins_url( 'wp-statistics/assets/images/' ) .
|
173 |
-
$items->agent .
|
174 |
-
".png' class='log-tools' title='{$items->agent}'/>";
|
175 |
} else {
|
176 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
177 |
}
|
178 |
-
echo "<a href='
|
179 |
-
WP_Statistics::$page['overview'] .
|
180 |
-
"&type=last-all-visitor&agent={$items->agent}'>{$agent}</a>";
|
181 |
echo "</td>";
|
182 |
$city = '';
|
183 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
@@ -197,9 +174,7 @@ $total = $search_result[ $referred ];
|
|
197 |
|
198 |
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
199 |
echo "<td style=\"text-align: left\">";
|
200 |
-
echo "<img src='" .
|
201 |
-
plugins_url( 'wp-statistics/assets/images/flags/' . $items->location . '.png' ) .
|
202 |
-
"' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
|
203 |
echo "</td>";
|
204 |
}
|
205 |
|
@@ -217,15 +192,13 @@ $total = $search_result[ $referred ];
|
|
217 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
218 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
219 |
} else {
|
220 |
-
$ip_string = "<a href='
|
221 |
-
WP_Statistics::$page['visitors'] .
|
222 |
-
"&type=last-all-visitor&ip={$items->ip}'>{$items->ip}</a>";
|
223 |
}
|
224 |
echo $ip_string;
|
225 |
echo "</td>";
|
226 |
|
227 |
echo "<td style=\"text-align: left\">";
|
228 |
-
echo
|
229 |
echo "</td>";
|
230 |
|
231 |
echo "</tr>";
|
@@ -236,18 +209,15 @@ $total = $search_result[ $referred ];
|
|
236 |
?>
|
237 |
</div>
|
238 |
</div>
|
239 |
-
|
240 |
-
<div class="pagination-log">
|
241 |
-
<?php if ( $total > 0 ) {
|
242 |
-
echo $Pagination->display(); ?>
|
243 |
-
<p id="result-log"><?php printf(
|
244 |
-
__( 'Page %1$s of %2$s', 'wp-statistics' ),
|
245 |
-
$Pagination->getCurrentPage(),
|
246 |
-
$Pagination->getTotalPages()
|
247 |
-
); ?></p>
|
248 |
-
<?php } ?>
|
249 |
-
</div>
|
250 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
</div>
|
252 |
</div>
|
253 |
</div>
|
24 |
|
25 |
$total = $search_result[ $referred ];
|
26 |
?>
|
27 |
+
<div class="wrap wps-wrap">
|
28 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Latest Search Words', 'wp-statistics' ) ); ?>
|
29 |
+
<br/>
|
|
|
30 |
<ul class="subsubsub">
|
31 |
<?php
|
32 |
$search_result_count = count( $search_result );
|
50 |
$translate = $search_engines[ $key ]['translated'];
|
51 |
}
|
52 |
|
53 |
+
//Check current class
|
54 |
+
$current = "";
|
55 |
+
if ( ( ! isset( $_GET['referred'] ) and $name == 'All' ) || ( isset( $_GET['referred'] ) and $tag == trim( $_GET['referred'] ) ) ) {
|
56 |
+
$current = 'class="current" ';
|
57 |
+
}
|
58 |
+
|
59 |
+
echo "<li><a {$current} href='" . ( $name == 'All' ? WP_Statistics_Admin_Pages::admin_url( 'words' ) : WP_Statistics_Admin_Pages::admin_url( 'words', array( 'referred' => $tag ) ) ) . "'>" . $translate . " <span class='count'>(" . number_format_i18n( $value ) . ")</span></a></li>{$separator}";
|
60 |
}
|
61 |
?>
|
62 |
</ul>
|
66 |
<div class="postbox">
|
67 |
<?php $paneltitle = __( 'Latest Search Word Statistics', 'wp-statistics' ); ?>
|
68 |
<button class="handlediv" type="button" aria-expanded="true">
|
69 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
70 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
71 |
</button>
|
72 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
76 |
<?php
|
77 |
if ( $total > 0 ) {
|
78 |
// Instantiate pagination object with appropriate arguments
|
79 |
+
$items_per_page = 10;
|
80 |
+
$page = isset( $_GET['pagination-page'] ) ? abs( (int) $_GET['pagination-page'] ) : 1;
|
81 |
+
$offset = ( $page * $items_per_page ) - $items_per_page;
|
82 |
+
$start = $offset;
|
83 |
+
$end = $offset + $items_per_page;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
// Retrieve MySQL data
|
86 |
if ( $referred && $referred != '' ) {
|
109 |
|
110 |
$dash_icon = wp_statistics_icons( 'dashicons-location-alt', 'map' );
|
111 |
|
112 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\"><tr>";
|
|
|
113 |
echo "<td>" . __( 'Word', 'wp-statistics' ) . "</td>";
|
114 |
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
115 |
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
150 |
echo "<td style=\"text-align: left\">";
|
151 |
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false
|
152 |
) {
|
153 |
+
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
|
|
|
|
|
|
154 |
} else {
|
155 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
156 |
}
|
157 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
|
|
|
|
158 |
echo "</td>";
|
159 |
$city = '';
|
160 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
174 |
|
175 |
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
176 |
echo "<td style=\"text-align: left\">";
|
177 |
+
echo "<img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $items->location . '.png' ) . "' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
|
|
|
|
|
178 |
echo "</td>";
|
179 |
}
|
180 |
|
192 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
193 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
194 |
} else {
|
195 |
+
$ip_string = "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>{$items->ip}</a>";
|
|
|
|
|
196 |
}
|
197 |
echo $ip_string;
|
198 |
echo "</td>";
|
199 |
|
200 |
echo "<td style=\"text-align: left\">";
|
201 |
+
echo $WP_Statistics->get_referrer_link( $items->referred );
|
202 |
echo "</td>";
|
203 |
|
204 |
echo "</tr>";
|
209 |
?>
|
210 |
</div>
|
211 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
</div>
|
213 |
+
<?php
|
214 |
+
if ( $total > 0 ) {
|
215 |
+
wp_statistics_paginate_links( array(
|
216 |
+
'item_per_page' => $items_per_page,
|
217 |
+
'total' => $total,
|
218 |
+
'current' => $page,
|
219 |
+
) );
|
220 |
+
} ?>
|
221 |
</div>
|
222 |
</div>
|
223 |
</div>
|
includes/log/last-visitor.php
CHANGED
@@ -34,24 +34,24 @@ if ( $_get != '%' ) {
|
|
34 |
}
|
35 |
|
36 |
?>
|
37 |
-
<div class="wrap">
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
<ul class="subsubsub">
|
42 |
<li class="all"><a <?php if ( $_get == '%' ) {
|
43 |
echo 'class="current"';
|
44 |
-
} ?>href="
|
45 |
-
<span class="count">(<?php echo $total_visitor; ?>)</span></a></li>
|
46 |
<?php
|
47 |
if ( isset( $_var ) ) {
|
48 |
$spacer = " | ";
|
49 |
|
50 |
if ( $_var == 'agent' ) {
|
51 |
-
$Browsers
|
52 |
-
$
|
53 |
-
$
|
54 |
-
|
|
|
55 |
foreach ( $Browsers as $Browser ) {
|
56 |
if ( $Browser == null ) {
|
57 |
continue;
|
@@ -66,7 +66,11 @@ if ( $_get != '%' ) {
|
|
66 |
if ( $i == $Total ) {
|
67 |
$spacer = "";
|
68 |
}
|
69 |
-
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
} else {
|
72 |
if ( $_get != '%' ) {
|
@@ -95,44 +99,24 @@ if ( $_get != '%' ) {
|
|
95 |
|
96 |
<div class="inside">
|
97 |
<?php
|
98 |
-
// Instantiate pagination object with appropriate arguments
|
99 |
-
$pagesPerSection = 10;
|
100 |
-
$options = array( 25, "All" );
|
101 |
-
$stylePageOff = "pageOff";
|
102 |
-
$stylePageOn = "pageOn";
|
103 |
-
$styleErrors = "paginationErrors";
|
104 |
-
$styleSelect = "paginationSelect";
|
105 |
-
|
106 |
-
$Pagination = new WP_Statistics_Pagination(
|
107 |
-
$total,
|
108 |
-
$pagesPerSection,
|
109 |
-
$options,
|
110 |
-
false,
|
111 |
-
$stylePageOff,
|
112 |
-
$stylePageOn,
|
113 |
-
$styleErrors,
|
114 |
-
$styleSelect
|
115 |
-
);
|
116 |
-
|
117 |
-
$start = $Pagination->getEntryStart();
|
118 |
-
$end = $Pagination->getEntryEnd();
|
119 |
-
|
120 |
// Retrieve MySQL data
|
121 |
if ( $_get != '%' ) {
|
122 |
-
$
|
123 |
-
$wpdb->prepare(
|
124 |
-
"SELECT * FROM `{$wpdb->prefix}statistics_visitor` WHERE `{$_var}` LIKE %s ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC LIMIT {$start}, {$end}",
|
125 |
-
$_get
|
126 |
-
)
|
127 |
-
);
|
128 |
} else {
|
129 |
-
$
|
130 |
-
"SELECT * FROM `{$wpdb->prefix}statistics_visitor` ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC LIMIT {$start}, {$end}"
|
131 |
-
);
|
132 |
}
|
133 |
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
137 |
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
138 |
echo "<td>" . __( 'Country', 'wp-statistics' ) . "</td>";
|
@@ -154,13 +138,12 @@ if ( $_get != '%' ) {
|
|
154 |
foreach ( $result as $items ) {
|
155 |
echo "<tr>";
|
156 |
echo "<td style=\"text-align: left\">";
|
157 |
-
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false
|
158 |
-
) {
|
159 |
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
160 |
} else {
|
161 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
162 |
}
|
163 |
-
echo "<a href='
|
164 |
echo "</td>";
|
165 |
$city = '';
|
166 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
@@ -198,30 +181,28 @@ if ( $_get != '%' ) {
|
|
198 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
199 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
200 |
} else {
|
201 |
-
$ip_string = "<a href='
|
202 |
}
|
203 |
echo $ip_string;
|
204 |
echo "</td>";
|
205 |
|
206 |
echo "<td style=\"text-align: left\">";
|
207 |
-
echo
|
208 |
echo "</td>";
|
209 |
|
210 |
echo "</tr>";
|
211 |
}
|
212 |
-
|
213 |
echo "</table>";
|
214 |
?>
|
215 |
-
|
216 |
-
<div class="pagination-log">
|
217 |
-
<?php echo $Pagination->display(); ?>
|
218 |
-
<p id="result-log"><?php printf(
|
219 |
-
__( 'Page %1$s of %2$s', 'wp-statistics' ),
|
220 |
-
$Pagination->getCurrentPage(),
|
221 |
-
$Pagination->getTotalPages()
|
222 |
-
); ?></p>
|
223 |
-
</div>
|
224 |
</div>
|
225 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
</div>
|
227 |
</div>
|
34 |
}
|
35 |
|
36 |
?>
|
37 |
+
<div class="wrap wps-wrap">
|
38 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Recent Visitors', 'wp-statistics' ) ); ?>
|
39 |
+
<br/>
|
|
|
40 |
<ul class="subsubsub">
|
41 |
<li class="all"><a <?php if ( $_get == '%' ) {
|
42 |
echo 'class="current"';
|
43 |
+
} ?>href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'visitors' ); ?>"><?php _e( 'All', 'wp-statistics' ); ?>
|
44 |
+
<span class="count">(<?php echo number_format_i18n( $total_visitor ); ?>)</span></a></li>
|
45 |
<?php
|
46 |
if ( isset( $_var ) ) {
|
47 |
$spacer = " | ";
|
48 |
|
49 |
if ( $_var == 'agent' ) {
|
50 |
+
$Browsers = wp_statistics_ua_list();
|
51 |
+
$browser_names = wp_statistics_get_browser_list();
|
52 |
+
$i = 0;
|
53 |
+
$Total = count( $Browsers );
|
54 |
+
echo $spacer;
|
55 |
foreach ( $Browsers as $Browser ) {
|
56 |
if ( $Browser == null ) {
|
57 |
continue;
|
66 |
if ( $i == $Total ) {
|
67 |
$spacer = "";
|
68 |
}
|
69 |
+
|
70 |
+
//Get Browser name
|
71 |
+
$browser_name = wp_statistics_get_browser_list( strtolower( $Browser ) );
|
72 |
+
echo "<li><a " . $current . "href='" . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'agent' => $Browser ) ) . "'> " . $browser_name . " <span class='count'>(" . number_format_i18n( wp_statistics_useragent( $Browser ) ) . ")</span></a></li>";
|
73 |
+
echo $spacer;
|
74 |
}
|
75 |
} else {
|
76 |
if ( $_get != '%' ) {
|
99 |
|
100 |
<div class="inside">
|
101 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
// Retrieve MySQL data
|
103 |
if ( $_get != '%' ) {
|
104 |
+
$sql = $wpdb->prepare( "SELECT count(*) FROM `{$wpdb->prefix}statistics_visitor` WHERE `{$_var}` LIKE %s", $_get );
|
|
|
|
|
|
|
|
|
|
|
105 |
} else {
|
106 |
+
$sql = "SELECT count(*) FROM `{$wpdb->prefix}statistics_visitor`";
|
|
|
|
|
107 |
}
|
108 |
|
109 |
+
// Instantiate pagination object with appropriate arguments
|
110 |
+
$total = $wpdb->get_var( $sql );
|
111 |
+
$items_per_page = 15;
|
112 |
+
$page = isset( $_GET['pagination-page'] ) ? abs( (int) $_GET['pagination-page'] ) : 1;
|
113 |
+
$offset = ( $page * $items_per_page ) - $items_per_page;
|
114 |
+
|
115 |
+
//Get Query Result
|
116 |
+
$query = str_replace( "SELECT count(*) FROM", "SELECT * FROM", $sql ) . " ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC LIMIT {$offset}, {$items_per_page}";
|
117 |
+
$result = $wpdb->get_results( $query );
|
118 |
+
|
119 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\"><tr>";
|
120 |
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
121 |
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
122 |
echo "<td>" . __( 'Country', 'wp-statistics' ) . "</td>";
|
138 |
foreach ( $result as $items ) {
|
139 |
echo "<tr>";
|
140 |
echo "<td style=\"text-align: left\">";
|
141 |
+
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false ) {
|
|
|
142 |
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
143 |
} else {
|
144 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
145 |
}
|
146 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
147 |
echo "</td>";
|
148 |
$city = '';
|
149 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
181 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
182 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
183 |
} else {
|
184 |
+
$ip_string = "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>{$items->ip}</a>";
|
185 |
}
|
186 |
echo $ip_string;
|
187 |
echo "</td>";
|
188 |
|
189 |
echo "<td style=\"text-align: left\">";
|
190 |
+
echo $WP_Statistics->get_referrer_link( $items->referred );
|
191 |
echo "</td>";
|
192 |
|
193 |
echo "</tr>";
|
194 |
}
|
|
|
195 |
echo "</table>";
|
196 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
</div>
|
198 |
</div>
|
199 |
+
<?php
|
200 |
+
//Show Pagination
|
201 |
+
wp_statistics_paginate_links( array(
|
202 |
+
'item_per_page' => $items_per_page,
|
203 |
+
'total' => $total,
|
204 |
+
'current' => $page,
|
205 |
+
) );
|
206 |
+
?>
|
207 |
</div>
|
208 |
</div>
|
includes/log/log.php
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
<?php
|
2 |
-
$loading_img = '<div style="width: 100%; text-align: center;"><img src=" ' . plugins_url( 'wp-statistics/assets/images/' ) . 'ajax-loading.gif" alt="' . __( 'Reloading...', 'wp-statistics' ) . '"></div>';
|
3 |
-
|
4 |
$nag_html = '';
|
5 |
|
6 |
if ( ! $WP_Statistics->get_option( 'geoip' ) ) {
|
7 |
-
$nag_html .= '<div class="notice notice-warning"><p>' . sprintf( __( 'GeoIP collection is not enabled. Please go to <a href="%s">setting page</a> to enable GeoIP for getting more information and location (country) from the visitor.', 'wp-statistics' ), admin_url( '
|
8 |
}
|
9 |
|
10 |
if ( ! $WP_Statistics->get_option( 'disable_donation_nag', false ) ) {
|
@@ -19,35 +17,20 @@ if ( is_array( $widget_order ) && count( $widget_order ) > 2 ) {
|
|
19 |
}
|
20 |
|
21 |
// Add the about box here as metaboxes added on the actual page load cannot be closed.
|
22 |
-
add_meta_box(
|
23 |
-
'wps_about_postbox',
|
24 |
-
sprintf( __( 'WP Statistics - Version %s', 'wp-statistics' ), WP_Statistics::$reg['version'] ),
|
25 |
-
'wp_statistics_generate_overview_postbox_contents',
|
26 |
-
$WP_Statistics->menu_slugs['overview'],
|
27 |
-
'side',
|
28 |
-
null,
|
29 |
-
array( 'widget' => 'about' )
|
30 |
-
);
|
31 |
|
32 |
function wp_statistics_generate_overview_postbox_contents( $post, $args ) {
|
33 |
-
$loading_img = '<div style="width: 100%; text-align: center;"><img src=" ' .
|
34 |
-
plugins_url( 'wp-statistics/assets/images/' ) .
|
35 |
-
'ajax-loading.gif" alt="' .
|
36 |
-
__( 'Loading...', 'wp-statistics' ) .
|
37 |
-
'"></div>';
|
38 |
$widget = $args['args']['widget'];
|
39 |
$container_id = str_replace( '.', '_', $widget . '_postbox' );
|
40 |
|
41 |
-
echo '<div id="' . $container_id . '">' .
|
42 |
wp_statistics_generate_widget_load_javascript( $widget, $container_id );
|
43 |
}
|
44 |
|
45 |
?>
|
46 |
-
<div class="wrap">
|
47 |
<?php echo $nag_html; ?>
|
48 |
-
|
49 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
50 |
-
|
51 |
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
|
52 |
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
53 |
|
@@ -62,42 +45,25 @@ function wp_statistics_generate_overview_postbox_contents( $post, $args ) {
|
|
62 |
</div>
|
63 |
</div>
|
64 |
<?php
|
65 |
-
$new_buttons = '</button><button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' .
|
66 |
-
wp_statistics_icons( 'dashicons-update' ) .
|
67 |
-
'<span class="screen-reader-text">' .
|
68 |
-
__( 'Reload', 'wp-statistics' ) .
|
69 |
-
'</span></button><button class="handlediv button-link wps-more" type="button" id="{{moreid}}">' .
|
70 |
-
wp_statistics_icons( 'dashicons-migrate' ) .
|
71 |
-
'<span class="screen-reader-text">' .
|
72 |
-
__( 'More Details', 'wp-statistics' ) .
|
73 |
-
'</span></button>';
|
74 |
-
$new_button = '</button><button class="handlediv button-link wps-refresh" type="button" id="{{refreshid}}">' .
|
75 |
-
wp_statistics_icons( 'dashicons-update' ) .
|
76 |
-
'<span class="screen-reader-text">' .
|
77 |
-
__( 'Reload', 'wp-statistics' ) .
|
78 |
-
'</span></button>';
|
79 |
-
|
80 |
-
$admin_url = get_admin_url() . "admin.php?page=";
|
81 |
-
|
82 |
-
$page_urls = array();
|
83 |
-
|
84 |
-
$page_urls['wps_browsers_more_button'] = $admin_url . WP_Statistics::$page['browser'];
|
85 |
-
$page_urls['wps_countries_more_button'] = $admin_url . WP_Statistics::$page['countries'];
|
86 |
-
$page_urls['wps_exclusions_more_button'] = $admin_url . WP_Statistics::$page['exclusions'];
|
87 |
-
$page_urls['wps_hits_more_button'] = $admin_url . WP_Statistics::$page['hits'];
|
88 |
-
$page_urls['wps_online_more_button'] = $admin_url . WP_Statistics::$page['online'];
|
89 |
-
$page_urls['wps_pages_more_button'] = $admin_url . WP_Statistics::$page['pages'];
|
90 |
-
$page_urls['wps_referring_more_button'] = $admin_url . WP_Statistics::$page['referrers'];
|
91 |
-
$page_urls['wps_searched_phrases_more_button'] = $admin_url . WP_Statistics::$page['searched-phrases'];
|
92 |
-
$page_urls['wps_search_more_button'] = $admin_url . WP_Statistics::$page['searches'];
|
93 |
-
$page_urls['wps_words_more_button'] = $admin_url . WP_Statistics::$page['words'];
|
94 |
-
$page_urls['wps_top_visitors_more_button'] = $admin_url . WP_Statistics::$page['top-visitors'];
|
95 |
-
$page_urls['wps_recent_more_button'] = $admin_url . WP_Statistics::$page['visitors'];
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
?>
|
98 |
<script type="text/javascript">
|
99 |
var wp_statistics_destinations = <?php echo json_encode( $page_urls ); ?>;
|
100 |
-
var wp_statistics_loading_image = '<?php echo
|
101 |
|
102 |
jQuery(document).ready(function () {
|
103 |
|
@@ -108,13 +74,13 @@ $page_urls['wps_recent_more_button'] = $admin_url . WP_Statistics::$pa
|
|
108 |
var temp_html = temp.html();
|
109 |
if (temp_id == 'wps_summary_postbox' || temp_id == 'wps_map_postbox' || temp_id == 'wps_about_postbox') {
|
110 |
if (temp_id != 'wps_about_postbox') {
|
111 |
-
new_text = '<?php echo
|
112 |
new_text = new_text.replace('{{refreshid}}', temp_id.replace('_postbox', '_refresh_button'));
|
113 |
|
114 |
temp_html = temp_html.replace('</button>', new_text);
|
115 |
}
|
116 |
} else {
|
117 |
-
new_text = '<?php echo
|
118 |
new_text = new_text.replace('{{refreshid}}', temp_id.replace('_postbox', '_refresh_button'));
|
119 |
new_text = new_text.replace('{{moreid}}', temp_id.replace('_postbox', '_more_button'));
|
120 |
|
@@ -132,9 +98,7 @@ $page_urls['wps_recent_more_button'] = $admin_url . WP_Statistics::$pa
|
|
132 |
|
133 |
jQuery('.wps-refresh').unbind('click').on('click', wp_statistics_refresh_widget);
|
134 |
jQuery('.wps-more').unbind('click').on('click', wp_statistics_goto_more);
|
135 |
-
|
136 |
jQuery('.hide-postbox-tog').on('click', wp_statistics_refresh_on_toggle_widget);
|
137 |
-
|
138 |
jQuery('.wps-donate-notice').on('click', '.notice-dismiss', function () {
|
139 |
var data = {
|
140 |
'action': 'wp_statistics_close_notice',
|
@@ -148,6 +112,5 @@ $page_urls['wps_recent_more_button'] = $admin_url . WP_Statistics::$pa
|
|
148 |
datatype: 'json',
|
149 |
});
|
150 |
});
|
151 |
-
|
152 |
});
|
153 |
</script>
|
1 |
<?php
|
|
|
|
|
2 |
$nag_html = '';
|
3 |
|
4 |
if ( ! $WP_Statistics->get_option( 'geoip' ) ) {
|
5 |
+
$nag_html .= '<div class="notice notice-warning"><p>' . sprintf( __( 'GeoIP collection is not enabled. Please go to <a href="%s">setting page</a> to enable GeoIP for getting more information and location (country) from the visitor.', 'wp-statistics' ), WP_Statistics_Admin_Pages::admin_url( 'settings', array( 'tab' => 'externals-settings' ) ) ) . '</p></div>';
|
6 |
}
|
7 |
|
8 |
if ( ! $WP_Statistics->get_option( 'disable_donation_nag', false ) ) {
|
17 |
}
|
18 |
|
19 |
// Add the about box here as metaboxes added on the actual page load cannot be closed.
|
20 |
+
add_meta_box( 'wps_about_postbox', sprintf( __( 'WP Statistics - Version %s', 'wp-statistics' ), WP_Statistics::$reg['version'] ), 'wp_statistics_generate_overview_postbox_contents', $WP_Statistics->menu_slugs['overview'], 'side', null, array( 'widget' => 'about' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
function wp_statistics_generate_overview_postbox_contents( $post, $args ) {
|
|
|
|
|
|
|
|
|
|
|
23 |
$widget = $args['args']['widget'];
|
24 |
$container_id = str_replace( '.', '_', $widget . '_postbox' );
|
25 |
|
26 |
+
echo '<div id="' . $container_id . '">' . WP_Statistics_Admin_Pages::loading_meta_box() . '</div>';
|
27 |
wp_statistics_generate_widget_load_javascript( $widget, $container_id );
|
28 |
}
|
29 |
|
30 |
?>
|
31 |
+
<div class="wrap wps-wrap">
|
32 |
<?php echo $nag_html; ?>
|
33 |
+
<?php WP_Statistics_Admin_Pages::show_page_title(); ?>
|
|
|
|
|
34 |
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
|
35 |
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
36 |
|
45 |
</div>
|
46 |
</div>
|
47 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
//Prepare List Of Page Url
|
50 |
+
$page_urls = array();
|
51 |
+
$widget_list = array( 'browsers', 'countries', 'hits', 'pages', 'referring', 'search', 'words', 'top-visitors', 'recent' );
|
52 |
+
$all_widget = WP_Statistics_Dashboard::widget_list();
|
53 |
+
foreach ( $widget_list as $widget ) {
|
54 |
+
if ( array_key_exists( $widget, $all_widget ) ) {
|
55 |
+
$page_urls[ 'wps_' . str_replace( "-", "_", $widget ) . '_more_button' ] = WP_Statistics_Admin_Pages::admin_url( $all_widget[ $widget ]['page_url'] );
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
//Add Extra Pages For Overview Page
|
60 |
+
foreach ( array( 'exclusions' => 'exclusions', 'users_online' => 'online' ) as $p_key => $p_link ) {
|
61 |
+
$page_urls[ 'wps_' . $p_key . '_more_button' ] = WP_Statistics_Admin_Pages::admin_url( $p_link );
|
62 |
+
}
|
63 |
?>
|
64 |
<script type="text/javascript">
|
65 |
var wp_statistics_destinations = <?php echo json_encode( $page_urls ); ?>;
|
66 |
+
var wp_statistics_loading_image = '<?php echo WP_Statistics_Admin_Pages::loading_meta_box(); ?>'
|
67 |
|
68 |
jQuery(document).ready(function () {
|
69 |
|
74 |
var temp_html = temp.html();
|
75 |
if (temp_id == 'wps_summary_postbox' || temp_id == 'wps_map_postbox' || temp_id == 'wps_about_postbox') {
|
76 |
if (temp_id != 'wps_about_postbox') {
|
77 |
+
new_text = '<?php echo WP_Statistics_Admin_Pages::meta_box_button( 'refresh' );?>';
|
78 |
new_text = new_text.replace('{{refreshid}}', temp_id.replace('_postbox', '_refresh_button'));
|
79 |
|
80 |
temp_html = temp_html.replace('</button>', new_text);
|
81 |
}
|
82 |
} else {
|
83 |
+
new_text = '<?php echo WP_Statistics_Admin_Pages::meta_box_button();?>';
|
84 |
new_text = new_text.replace('{{refreshid}}', temp_id.replace('_postbox', '_refresh_button'));
|
85 |
new_text = new_text.replace('{{moreid}}', temp_id.replace('_postbox', '_more_button'));
|
86 |
|
98 |
|
99 |
jQuery('.wps-refresh').unbind('click').on('click', wp_statistics_refresh_widget);
|
100 |
jQuery('.wps-more').unbind('click').on('click', wp_statistics_goto_more);
|
|
|
101 |
jQuery('.hide-postbox-tog').on('click', wp_statistics_refresh_on_toggle_widget);
|
|
|
102 |
jQuery('.wps-donate-notice').on('click', '.notice-dismiss', function () {
|
103 |
var data = {
|
104 |
'action': 'wp_statistics_close_notice',
|
112 |
datatype: 'json',
|
113 |
});
|
114 |
});
|
|
|
115 |
});
|
116 |
</script>
|
includes/log/online.php
CHANGED
@@ -3,141 +3,166 @@
|
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
-
|
7 |
-
|
8 |
-
?>
|
9 |
-
<div class="wrap">
|
10 |
-
<h2><?php _e( 'Online Users', 'wp-statistics' ); ?></h2>
|
11 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
12 |
-
|
13 |
<div class="postbox-container" id="last-log">
|
14 |
<div class="metabox-holder">
|
15 |
<div class="meta-box-sortables">
|
16 |
-
|
17 |
<div class="postbox">
|
18 |
<?php $paneltitle = __( 'Online Users', 'wp-statistics' ); ?>
|
19 |
<button class="handlediv" type="button" aria-expanded="true">
|
20 |
-
|
21 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
22 |
-
$paneltitle
|
23 |
-
); ?></span>
|
24 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
25 |
</button>
|
26 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
27 |
-
|
28 |
<div class="inside">
|
29 |
<?php
|
|
|
30 |
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
31 |
|
32 |
-
|
33 |
-
$
|
|
|
34 |
|
35 |
if ( $total > 0 ) {
|
36 |
-
// Instantiate pagination object with appropriate arguments
|
37 |
-
$pagesPerSection = 10;
|
38 |
-
$options = 10;
|
39 |
-
$stylePageOff = "pageOff";
|
40 |
-
$stylePageOn = "pageOn";
|
41 |
-
$styleErrors = "paginationErrors";
|
42 |
-
$styleSelect = "paginationSelect";
|
43 |
-
|
44 |
-
$Pagination = new WP_Statistics_Pagination(
|
45 |
-
$total,
|
46 |
-
$pagesPerSection,
|
47 |
-
$options,
|
48 |
-
false,
|
49 |
-
$stylePageOff,
|
50 |
-
$stylePageOn,
|
51 |
-
$styleErrors,
|
52 |
-
$styleSelect
|
53 |
-
);
|
54 |
-
|
55 |
-
$start = $Pagination->getEntryStart();
|
56 |
-
$end = $Pagination->getEntryEnd();
|
57 |
-
|
58 |
-
echo "<div class='log-latest'>";
|
59 |
-
$count = 0;
|
60 |
-
|
61 |
-
$dash_icon = wp_statistics_icons( 'dashicons-visibility', 'visibility' );
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
$ip_string = __( '#hash#', 'wp-statistics' );
|
69 |
-
$map_string = "";
|
70 |
-
} else {
|
71 |
-
$ip_string = "<a href='?page=" .
|
72 |
-
WP_Statistics::$page['overview'] .
|
73 |
-
"&type=last-all-visitor&ip={$items->ip}'>{$dash_icon}{$items->ip}</a>";
|
74 |
-
$map_string
|
75 |
-
= "<a class='show-map' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='" .
|
76 |
-
__( 'Map', 'wp-statistics' ) .
|
77 |
-
"'>" .
|
78 |
-
wp_statistics_icons( 'dashicons-location-alt', 'map' ) .
|
79 |
-
"</a>";
|
80 |
-
}
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
94 |
-
}
|
95 |
|
96 |
-
|
97 |
-
echo "<br>";
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
|
102 |
-
$onlinefor = date( "H:i:s", ( $items->timestamp - $items->created ) );
|
103 |
-
} else if ( $timediff > 60 ) {
|
104 |
-
$onlinefor = "00:" . date( "i:s", ( $items->timestamp - $items->created ) );
|
105 |
-
} else {
|
106 |
-
$onlinefor = "00:00:" . date( "s", ( $items->timestamp - $items->created ) );
|
107 |
-
}
|
108 |
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
|
115 |
-
if ( $
|
116 |
-
|
|
|
|
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
|
121 |
-
echo "</
|
122 |
} else {
|
123 |
-
echo "<div class='wps-center'>" .
|
124 |
-
__( 'Currently there are no users online in the site.', 'wp-statistics' ) .
|
125 |
-
"</div>";
|
126 |
}
|
127 |
?>
|
128 |
</div>
|
129 |
</div>
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
); ?></p>
|
139 |
-
</div>
|
140 |
-
<?php } ?>
|
141 |
</div>
|
142 |
</div>
|
143 |
</div>
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
+
<div class="wrap wps-wrap">
|
7 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Online Users', 'wp-statistics' ) ); ?>
|
|
|
|
|
|
|
|
|
|
|
8 |
<div class="postbox-container" id="last-log">
|
9 |
<div class="metabox-holder">
|
10 |
<div class="meta-box-sortables">
|
|
|
11 |
<div class="postbox">
|
12 |
<?php $paneltitle = __( 'Online Users', 'wp-statistics' ); ?>
|
13 |
<button class="handlediv" type="button" aria-expanded="true">
|
14 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
15 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
16 |
</button>
|
17 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
|
|
18 |
<div class="inside">
|
19 |
<?php
|
20 |
+
//Get List ISO country
|
21 |
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
22 |
|
23 |
+
//Get Total User Online
|
24 |
+
$sql = "SELECT COUNT(*) FROM {$wpdb->prefix}statistics_useronline";
|
25 |
+
$total = $wpdb->get_var( $sql );
|
26 |
|
27 |
if ( $total > 0 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
// Load city name
|
30 |
+
$geoip_reader = false;
|
31 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
32 |
+
$geoip_reader = $WP_Statistics::geoip_loader( 'city' );
|
33 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
//Show Table
|
36 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"online-users\"><tr>";
|
37 |
+
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
38 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
39 |
+
echo "<td>" . __( 'Country', 'wp-statistics' ) . "</td>";
|
40 |
+
}
|
41 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
42 |
+
echo "<td>" . __( 'City', 'wp-statistics' ) . "</td>";
|
43 |
+
}
|
44 |
+
echo "<td>" . __( 'IP', 'wp-statistics' ) . "</td>";
|
45 |
+
echo "<td>" . __( 'Online For', 'wp-statistics' ) . "</td>";
|
46 |
+
echo "<td>" . __( 'Page', 'wp-statistics' ) . "</td>";
|
47 |
+
echo "<td>" . __( 'Referrer', 'wp-statistics' ) . "</td>";
|
48 |
+
echo "<td></td>";
|
49 |
+
echo "</tr>";
|
50 |
|
51 |
+
// Instantiate pagination object with appropriate arguments
|
52 |
+
$items_per_page = 10;
|
53 |
+
$page = isset( $_GET['pagination-page'] ) ? abs( (int) $_GET['pagination-page'] ) : 1;
|
54 |
+
$offset = ( $page * $items_per_page ) - $items_per_page;
|
55 |
+
$start = $offset;
|
56 |
+
$end = $offset + $items_per_page;
|
57 |
|
58 |
+
//Get Query Result
|
59 |
+
$query = str_replace( "SELECT COUNT(*) FROM", "SELECT * FROM", $sql ) . " ORDER BY `{$wpdb->prefix}statistics_useronline`.`ID` DESC LIMIT {$offset}, {$items_per_page}";
|
60 |
+
$result = $wpdb->get_results( $query );
|
|
|
|
|
61 |
|
62 |
+
foreach ( $result as $items ) {
|
|
|
63 |
|
64 |
+
//Sanitize Online Table
|
65 |
+
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
66 |
+
$ip_string = __( '#hash#', 'wp-statistics' );
|
67 |
+
$map_string = "";
|
68 |
+
} else {
|
69 |
+
$ip_string = "{$items->ip}";
|
70 |
+
$map_string = "<a class='wps-text-muted' href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>" . wp_statistics_icons( 'dashicons-visibility', 'visibility' ) . "</a><a class='show-map wps-text-muted' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='" . __( 'Map', 'wp-statistics' ) . "'>" . wp_statistics_icons( 'dashicons-location-alt', 'map' ) . "</a>";
|
71 |
+
}
|
72 |
|
73 |
+
echo "<tr>";
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
+
//Show Browser
|
76 |
+
echo "<td style=\"text-align: left\">";
|
77 |
+
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false ) {
|
78 |
+
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
79 |
+
} else {
|
80 |
+
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
81 |
+
}
|
82 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
83 |
+
echo "</td>";
|
84 |
+
|
85 |
+
//Show Country
|
86 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
87 |
+
echo "<td style=\"text-align: left\">";
|
88 |
+
echo "<img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $items->location . '.png' ) . "' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
|
89 |
+
echo "</td>";
|
90 |
+
}
|
91 |
|
92 |
+
//Show City
|
93 |
+
$city = '';
|
94 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
95 |
+
if ( $geoip_reader != false ) {
|
96 |
+
try {
|
97 |
+
$reader = $geoip_reader->city( $items->ip );
|
98 |
+
$city = $reader->city->name;
|
99 |
+
} catch ( Exception $e ) {
|
100 |
+
$city = __( 'Unknown', 'wp-statistics' );
|
101 |
+
}
|
102 |
+
if ( ! $city ) {
|
103 |
+
$city = __( 'Unknown', 'wp-statistics' );
|
104 |
+
}
|
105 |
+
}
|
106 |
}
|
107 |
|
108 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
109 |
+
echo "<td style=\"text-align: left\">";
|
110 |
+
echo $city;
|
111 |
+
echo "</td>";
|
112 |
}
|
113 |
|
114 |
+
//Show IP
|
115 |
+
echo "<td style=\"text-align: left\">";
|
116 |
+
echo $ip_string;
|
117 |
+
echo "</td>";
|
118 |
+
|
119 |
+
//Show Online For
|
120 |
+
echo "<td style=\"text-align: left\">";
|
121 |
+
$timediff = ( $items->timestamp - $items->created );
|
122 |
+
if ( $timediff > 3600 ) {
|
123 |
+
$onlinefor = date( "H:i:s", ( $items->timestamp - $items->created ) );
|
124 |
+
} else if ( $timediff > 60 ) {
|
125 |
+
$onlinefor = "00:" . date( "i:s", ( $items->timestamp - $items->created ) );
|
126 |
+
} else {
|
127 |
+
$onlinefor = "00:00:" . date( "s", ( $items->timestamp - $items->created ) );
|
128 |
+
}
|
129 |
+
echo "<span>" . $onlinefor . "</span>";
|
130 |
+
echo "</td>";
|
131 |
+
|
132 |
+
//Show Page
|
133 |
+
$page_info = wp_statistics_get_page_info( $items->page_id, $items->type );
|
134 |
+
echo "<td style=\"text-align: left\">";
|
135 |
+
echo ( $page_info['link'] != '' ? '<a href="' . $page_info['link'] . '" target="_blank" class="wps-text-danger">' : '' ) . mb_substr( $page_info['title'], 0, 200, "utf-8" ) . ( $page_info['link'] != '' ? '</a>' : '' );
|
136 |
+
echo "</td>";
|
137 |
+
|
138 |
+
//Show Referrer
|
139 |
+
echo "<td style=\"text-align: left\">";
|
140 |
+
echo $WP_Statistics->get_referrer_link( $items->referred );
|
141 |
+
echo "</td>";
|
142 |
+
|
143 |
+
//Show Link View IP
|
144 |
+
echo "<td style=\"text-align: center\">";
|
145 |
+
echo $map_string;
|
146 |
+
echo "</td>";
|
147 |
+
|
148 |
+
echo '</tr>';
|
149 |
}
|
150 |
|
151 |
+
echo "</table>";
|
152 |
} else {
|
153 |
+
echo "<div class='wps-center'>" . __( 'Currently there are no online users in the site.', 'wp-statistics' ) . "</div>";
|
|
|
|
|
154 |
}
|
155 |
?>
|
156 |
</div>
|
157 |
</div>
|
158 |
+
<?php
|
159 |
+
if ( $total > 0 ) {
|
160 |
+
wp_statistics_paginate_links( array(
|
161 |
+
'item_per_page' => $items_per_page,
|
162 |
+
'total' => $total,
|
163 |
+
'current' => $page,
|
164 |
+
) );
|
165 |
+
} ?>
|
|
|
|
|
|
|
166 |
</div>
|
167 |
</div>
|
168 |
</div>
|
includes/log/page-statistics.php
CHANGED
@@ -28,22 +28,10 @@ if ( is_object( $post ) ) {
|
|
28 |
$title = "";
|
29 |
}
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
34 |
-
}
|
35 |
-
|
36 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
37 |
-
$rangestart = $_GET['rangestart'];
|
38 |
-
} else {
|
39 |
-
$rangestart = '';
|
40 |
-
}
|
41 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
42 |
-
$rangeend = $_GET['rangeend'];
|
43 |
-
} else {
|
44 |
-
$rangeend = '';
|
45 |
-
}
|
46 |
|
|
|
47 |
if ( array_key_exists( 'page-id', $_GET ) ) {
|
48 |
$page = intval( $_GET['page-id'] );
|
49 |
} else {
|
@@ -54,25 +42,36 @@ if ( array_key_exists( 'page-id', $_GET ) ) {
|
|
54 |
}
|
55 |
}
|
56 |
|
57 |
-
|
58 |
-
$
|
59 |
-
$
|
60 |
-
$
|
61 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
?>
|
63 |
-
<div class="wrap">
|
64 |
-
|
65 |
-
<?php wp_statistics_date_range_selector( WP_Statistics::$page['pages'], $daysToDisplay, null, null, $
|
66 |
<div class="postbox-container" id="last-log">
|
67 |
<div class="metabox-holder">
|
68 |
<div class="meta-box-sortables">
|
69 |
<div class="postbox">
|
70 |
<?php $paneltitle = __( 'Page Trend', 'wp-statistics' ); ?>
|
71 |
<button class="handlediv" type="button" aria-expanded="true">
|
72 |
-
|
73 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
74 |
-
$paneltitle
|
75 |
-
); ?></span>
|
76 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
77 |
</button>
|
78 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
28 |
$title = "";
|
29 |
}
|
30 |
|
31 |
+
//Set Default Time Picker Option
|
32 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
//Check Page
|
35 |
if ( array_key_exists( 'page-id', $_GET ) ) {
|
36 |
$page = intval( $_GET['page-id'] );
|
37 |
} else {
|
42 |
}
|
43 |
}
|
44 |
|
45 |
+
//Check Page Type
|
46 |
+
$arg = array();
|
47 |
+
$post_type = get_post_type( $page );
|
48 |
+
if ( $page > 0 and $post_type != "page" ) {
|
49 |
+
$arg = array( "post_type" => get_post_type( $page ), "posts_per_page" => 50, "order" => "DESC" );
|
50 |
+
}
|
51 |
+
|
52 |
+
//Add arg to This Url
|
53 |
+
$url_fields = '&prepage=' . $pageid;
|
54 |
+
|
55 |
+
//Show Select Box Ui
|
56 |
+
$html = __( 'Select Page', 'wp-statistics' ) . ': ';
|
57 |
+
$html .= '<select name="page-id">';
|
58 |
+
foreach ( wp_statistics_get_post_list( $arg ) as $post_id => $post_title ) {
|
59 |
+
$html .= '<option value="' . $post_id . '"' . selected( $post_id, $page, false ) . '>' . $post_title . '</option>';
|
60 |
+
}
|
61 |
+
$html .= '</select>';
|
62 |
+
$html .= ' <input type="submit" value="' . __( 'Select', 'wp-statistics' ) . '" class="button-primary">';
|
63 |
+
$html .= '<br>';
|
64 |
?>
|
65 |
+
<div class="wrap wps-wrap">
|
66 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( sprintf( __( 'Page Trend for Post ID %s', 'wp-statistics' ), $pageid ) . ' - ' . $title ); ?>
|
67 |
+
<?php wp_statistics_date_range_selector( WP_Statistics::$page['pages'], $daysToDisplay, null, null, $url_fields, $html ); ?>
|
68 |
<div class="postbox-container" id="last-log">
|
69 |
<div class="metabox-holder">
|
70 |
<div class="meta-box-sortables">
|
71 |
<div class="postbox">
|
72 |
<?php $paneltitle = __( 'Page Trend', 'wp-statistics' ); ?>
|
73 |
<button class="handlediv" type="button" aria-expanded="true">
|
74 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
75 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
76 |
</button>
|
77 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></span></h2>
|
includes/log/search-statistics.php
CHANGED
@@ -6,22 +6,8 @@
|
|
6 |
<?php
|
7 |
$search_engines = wp_statistics_searchengine_list();
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
12 |
-
}
|
13 |
-
|
14 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
15 |
-
$rangestart = $_GET['rangestart'];
|
16 |
-
} else {
|
17 |
-
$rangestart = '';
|
18 |
-
}
|
19 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
20 |
-
$rangeend = $_GET['rangeend'];
|
21 |
-
} else {
|
22 |
-
$rangeend = '';
|
23 |
-
}
|
24 |
-
|
25 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
26 |
$daysToDisplay,
|
27 |
$rangestart,
|
@@ -50,10 +36,8 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
50 |
$date[] = "'" . $WP_Statistics->Real_Current_Date( 'M j', '-' . $i, $rangeend_utime ) . "'";
|
51 |
}
|
52 |
?>
|
53 |
-
<div class="wrap">
|
54 |
-
|
55 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
56 |
-
|
57 |
<?php wp_statistics_date_range_selector( WP_Statistics::$page['searches'], $daysToDisplay ); ?>
|
58 |
<div class="postbox-container" id="last-log">
|
59 |
<div class="metabox-holder">
|
@@ -84,6 +68,7 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
84 |
colors['qwant'] = ['rgba(53, 60, 82, 0.2)', 'rgba(53, 60, 82, 1)'];
|
85 |
|
86 |
var ctx = document.getElementById("search-stats").getContext('2d');
|
|
|
87 |
var ChartJs = new Chart(ctx, {
|
88 |
type: 'line',
|
89 |
data: {
|
6 |
<?php
|
7 |
$search_engines = wp_statistics_searchengine_list();
|
8 |
|
9 |
+
//Set Default Time Picker Option
|
10 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
12 |
$daysToDisplay,
|
13 |
$rangestart,
|
36 |
$date[] = "'" . $WP_Statistics->Real_Current_Date( 'M j', '-' . $i, $rangeend_utime ) . "'";
|
37 |
}
|
38 |
?>
|
39 |
+
<div class="wrap wps-wrap">
|
40 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Search Engine Referral Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
41 |
<?php wp_statistics_date_range_selector( WP_Statistics::$page['searches'], $daysToDisplay ); ?>
|
42 |
<div class="postbox-container" id="last-log">
|
43 |
<div class="metabox-holder">
|
68 |
colors['qwant'] = ['rgba(53, 60, 82, 0.2)', 'rgba(53, 60, 82, 1)'];
|
69 |
|
70 |
var ctx = document.getElementById("search-stats").getContext('2d');
|
71 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
72 |
var ChartJs = new Chart(ctx, {
|
73 |
type: 'line',
|
74 |
data: {
|
includes/log/searched-phrases.php
DELETED
@@ -1,194 +0,0 @@
|
|
1 |
-
<script type="text/javascript">
|
2 |
-
jQuery(document).ready(function () {
|
3 |
-
jQuery('.show-map').click(function () {
|
4 |
-
alert('<?php _e( 'To be added soon', 'wp-statistics' ); ?>');
|
5 |
-
});
|
6 |
-
|
7 |
-
postboxes.add_postbox_toggles(pagenow);
|
8 |
-
});
|
9 |
-
</script>
|
10 |
-
<?php
|
11 |
-
$date_args = '';
|
12 |
-
$daysToDisplay = 20;
|
13 |
-
if ( array_key_exists( 'hitdays', $_GET ) ) {
|
14 |
-
$daysToDisplay = intval( esc_attr( $_GET['hitdays'] ) );
|
15 |
-
$date_args .= '&hitdays=' . $daysToDisplay;
|
16 |
-
}
|
17 |
-
|
18 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
19 |
-
$rangestart = esc_attr( $_GET['rangestart'] );
|
20 |
-
$date_args .= '&rangestart=' . $rangestart;
|
21 |
-
} else {
|
22 |
-
$rangestart = '';
|
23 |
-
}
|
24 |
-
|
25 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
26 |
-
$rangeend = esc_attr( $_GET['rangeend'] );
|
27 |
-
$date_args .= '&rangeend=' . $rangeend;
|
28 |
-
} else {
|
29 |
-
$rangeend = '';
|
30 |
-
}
|
31 |
-
|
32 |
-
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
33 |
-
$daysToDisplay,
|
34 |
-
$rangestart,
|
35 |
-
$rangeend
|
36 |
-
);
|
37 |
-
|
38 |
-
$rangestartdate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangestart_utime );
|
39 |
-
$rangeenddate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangeend_utime );
|
40 |
-
|
41 |
-
if ( array_key_exists( 'phrase', $_GET ) ) {
|
42 |
-
$phrase = $_GET['phrase'];
|
43 |
-
$title = $_GET['phrase'];
|
44 |
-
$referr_field = '&phrase=' . $phrase;
|
45 |
-
} else {
|
46 |
-
$phrase = '';
|
47 |
-
$phrase_field = null;
|
48 |
-
}
|
49 |
-
|
50 |
-
$get_urls = array();
|
51 |
-
$total = 0;
|
52 |
-
|
53 |
-
if ( $phrase ) {
|
54 |
-
$q_string = $wpdb->prepare(
|
55 |
-
"SELECT `words` , count(`words`) as `count` FROM `{$wpdb->prefix}statistics_search` WHERE `words` LIKE %s AND `words` <> '' AND `last_counter` BETWEEN %s AND %s GROUP BY `words` order by `count` DESC",
|
56 |
-
'%' . $phrase . '%',
|
57 |
-
$rangestartdate,
|
58 |
-
$rangeenddate
|
59 |
-
);
|
60 |
-
$result = $wpdb->get_results( $q_string );
|
61 |
-
$total = count( $result );
|
62 |
-
} else {
|
63 |
-
$q_string = $wpdb->prepare(
|
64 |
-
"SELECT `words` , count(`words`) as `count` FROM `{$wpdb->prefix}statistics_search` WHERE `words` <> '' AND `last_counter` BETWEEN %s AND %s GROUP BY `words` order by `count` DESC",
|
65 |
-
$rangestartdate,
|
66 |
-
$rangeenddate
|
67 |
-
);
|
68 |
-
$result = $wpdb->get_results( $q_string );
|
69 |
-
$total = count( $result );
|
70 |
-
}
|
71 |
-
|
72 |
-
?>
|
73 |
-
<div class="wrap">
|
74 |
-
<h2><?php _e( 'Top Search Words', 'wp-statistics' ); ?></h2>
|
75 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
76 |
-
|
77 |
-
<div><?php wp_statistics_date_range_selector(
|
78 |
-
WP_Statistics::$page['searched-phrases'],
|
79 |
-
$daysToDisplay,
|
80 |
-
null,
|
81 |
-
null,
|
82 |
-
$phrase_field
|
83 |
-
); ?></div>
|
84 |
-
|
85 |
-
<div class="clear"/>
|
86 |
-
|
87 |
-
<ul class="subsubsub">
|
88 |
-
<?php if ( $phrase ) { ?>
|
89 |
-
<li class="all"><a <?php if ( ! $phrase ) {
|
90 |
-
echo 'class="current"';
|
91 |
-
} ?>href="?page=<?php echo WP_Statistics::$page['searched-phrases'] . $date_args; ?>"><?php _e(
|
92 |
-
'All',
|
93 |
-
'wp-statistics'
|
94 |
-
); ?></a>
|
95 |
-
</li>
|
96 |
-
|
|
97 |
-
<li>
|
98 |
-
<a class="current"
|
99 |
-
href="?page=<?php echo WP_Statistics::$page['searched-phrases']; ?>&referr=<?php echo esc_html( $phrase ) .
|
100 |
-
$date_args; ?>"> <?php echo htmlentities(
|
101 |
-
$title,
|
102 |
-
ENT_QUOTES
|
103 |
-
); ?>
|
104 |
-
<span class="count">(<?php echo $total; ?>)</span></a></li>
|
105 |
-
<?php } else { ?>
|
106 |
-
<li class="all"><a <?php if ( ! $phrase ) {
|
107 |
-
echo 'class="current"';
|
108 |
-
} ?>href="?page=<?php echo WP_Statistics::$page['searched-phrases'] . $date_args; ?>"><?php _e(
|
109 |
-
'All',
|
110 |
-
'wp-statistics'
|
111 |
-
); ?>
|
112 |
-
<span class="count">(<?php echo $total; ?>)</span></a></li>
|
113 |
-
<?php } ?>
|
114 |
-
</ul>
|
115 |
-
<div class="postbox-container" id="last-log">
|
116 |
-
<div class="metabox-holder">
|
117 |
-
<div class="meta-box-sortables">
|
118 |
-
<div class="postbox">
|
119 |
-
<?php if ( $phrase ) {
|
120 |
-
$paneltitle = sprintf( __( 'Searched Phrase: %s', 'wp-statistics' ), esc_html( $phrase ) );
|
121 |
-
} else {
|
122 |
-
$paneltitle = __( 'Top Search Words', 'wp-statistics' );
|
123 |
-
}; ?>
|
124 |
-
<button class="handlediv" type="button" aria-expanded="true">
|
125 |
-
<span class="screen-reader-text"><?php printf(
|
126 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
127 |
-
$paneltitle
|
128 |
-
); ?></span>
|
129 |
-
<span class="toggle-indicator" aria-hidden="true"></span>
|
130 |
-
</button>
|
131 |
-
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
132 |
-
|
133 |
-
<div class="inside">
|
134 |
-
<?php
|
135 |
-
|
136 |
-
if ( $total > 0 ) {
|
137 |
-
// Initiate pagination object with appropriate arguments
|
138 |
-
$pagesPerSection = 10;
|
139 |
-
$options = array( 25, "All" );
|
140 |
-
$stylePageOff = "pageOff";
|
141 |
-
$stylePageOn = "pageOn";
|
142 |
-
$styleErrors = "paginationErrors";
|
143 |
-
$styleSelect = "paginationSelect";
|
144 |
-
|
145 |
-
$Pagination = new WP_Statistics_Pagination(
|
146 |
-
$total,
|
147 |
-
$pagesPerSection,
|
148 |
-
$options,
|
149 |
-
false,
|
150 |
-
$stylePageOff,
|
151 |
-
$stylePageOn,
|
152 |
-
$styleErrors,
|
153 |
-
$styleSelect
|
154 |
-
);
|
155 |
-
|
156 |
-
$start = $Pagination->getEntryStart();
|
157 |
-
$end = $Pagination->getEntryEnd();
|
158 |
-
|
159 |
-
if ( $result ) {
|
160 |
-
$result = array_slice( $result, $start, $end );
|
161 |
-
$i = $start; ?>
|
162 |
-
<table width="100%" class="widefat table-stats" id="searched-phrases">
|
163 |
-
<tr>
|
164 |
-
<td width="90%"><?php _e( 'Phrase', 'wp-statistics' ); ?></td>
|
165 |
-
<td width="10%"><?php _e( 'Count', 'wp-statistics' ); ?></td>
|
166 |
-
</tr>
|
167 |
-
<?php foreach ( $result as $item ) {
|
168 |
-
$i ++;
|
169 |
-
echo "<tr>";
|
170 |
-
echo "<td>{$item->words}</td>";
|
171 |
-
echo "<td>{$item->count}</td>";
|
172 |
-
echo "</tr>";
|
173 |
-
}
|
174 |
-
}
|
175 |
-
}
|
176 |
-
?>
|
177 |
-
</table>
|
178 |
-
</div>
|
179 |
-
</div>
|
180 |
-
|
181 |
-
<div class="pagination-log">
|
182 |
-
<?php if ( $total > 0 ) {
|
183 |
-
echo $Pagination->display(); ?>
|
184 |
-
<p id="result-log"><?php printf(
|
185 |
-
__( 'Page %1$s of %2$s', 'wp-statistics' ),
|
186 |
-
$Pagination->getCurrentPage(),
|
187 |
-
$Pagination->getTotalPages()
|
188 |
-
); ?></p>
|
189 |
-
<?php } ?>
|
190 |
-
</div>
|
191 |
-
</div>
|
192 |
-
</div>
|
193 |
-
</div>
|
194 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/log/tags.php
CHANGED
@@ -3,26 +3,11 @@
|
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
-
<div class="wrap">
|
7 |
-
|
8 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
9 |
-
|
10 |
<?php
|
11 |
-
|
12 |
-
|
13 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
14 |
-
}
|
15 |
-
|
16 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
17 |
-
$rangestart = $_GET['rangestart'];
|
18 |
-
} else {
|
19 |
-
$rangestart = '';
|
20 |
-
}
|
21 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
22 |
-
$rangeend = $_GET['rangeend'];
|
23 |
-
} else {
|
24 |
-
$rangeend = '';
|
25 |
-
}
|
26 |
if ( array_key_exists( 'tag', $_GET ) ) {
|
27 |
$tag = $_GET['tag'];
|
28 |
} else {
|
@@ -121,6 +106,7 @@
|
|
121 |
<canvas id="hit-stats" height="80"></canvas>
|
122 |
<script>
|
123 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
|
|
124 |
var ChartJs = new Chart(ctx, {
|
125 |
type: 'line',
|
126 |
data: {
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
+
<div class="wrap wps-wrap">
|
7 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Tag Statistics', 'wp-statistics' ) ); ?>
|
|
|
|
|
8 |
<?php
|
9 |
+
//Set Default Time Picker Option
|
10 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
if ( array_key_exists( 'tag', $_GET ) ) {
|
12 |
$tag = $_GET['tag'];
|
13 |
} else {
|
106 |
<canvas id="hit-stats" height="80"></canvas>
|
107 |
<script>
|
108 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
109 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
110 |
var ChartJs = new Chart(ctx, {
|
111 |
type: 'line',
|
112 |
data: {
|
includes/log/top-countries.php
CHANGED
@@ -4,88 +4,218 @@
|
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
-
|
8 |
-
|
9 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
10 |
-
}
|
11 |
-
|
12 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
13 |
-
$rangestart = $_GET['rangestart'];
|
14 |
-
} else {
|
15 |
-
$rangestart = '';
|
16 |
-
}
|
17 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
18 |
-
$rangeend = $_GET['rangeend'];
|
19 |
-
} else {
|
20 |
-
$rangeend = '';
|
21 |
-
}
|
22 |
-
|
23 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
24 |
$daysToDisplay,
|
25 |
$rangestart,
|
26 |
$rangeend
|
27 |
);
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
<div class="postbox-container" id="last-log">
|
36 |
<div class="metabox-holder">
|
37 |
<div class="meta-box-sortables">
|
38 |
<div class="postbox">
|
39 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<button class="handlediv" type="button" aria-expanded="true">
|
41 |
-
|
42 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
43 |
-
$paneltitle
|
44 |
-
); ?></span>
|
45 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
46 |
</button>
|
47 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
48 |
|
49 |
<div class="inside">
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
<
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
$i
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
echo "<tr>";
|
76 |
-
echo "<td
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
echo "</tr>";
|
83 |
}
|
84 |
-
|
85 |
-
|
86 |
</div>
|
87 |
</div>
|
88 |
</div>
|
89 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
</div>
|
91 |
</div>
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
+
//Set Default Time Picker Option
|
8 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
10 |
$daysToDisplay,
|
11 |
$rangestart,
|
12 |
$rangeend
|
13 |
);
|
14 |
|
15 |
+
//Load ISO
|
16 |
+
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
17 |
+
|
18 |
+
//Get Custom Country
|
19 |
+
$country_name = '';
|
20 |
+
$total_visitor = 0;
|
21 |
+
if ( isset( $_REQUEST['country'] ) ) {
|
22 |
+
if ( array_key_exists( $_REQUEST['country'], $ISOCountryCode ) ) {
|
23 |
+
$country_name = $ISOCountryCode[ $_REQUEST['country'] ];
|
24 |
+
$total = $wpdb->get_var( "SELECT COUNT(`location`) AS `count` FROM `{$wpdb->prefix}statistics_visitor` WHERE `location` = '" . $_REQUEST['country'] . "'" );
|
25 |
+
} else {
|
26 |
+
echo '<script>window.location.href = "' . WP_Statistics_Admin_Pages::admin_url( 'countries' ) . '";</script>';
|
27 |
+
}
|
28 |
+
}
|
29 |
|
30 |
+
?>
|
31 |
+
<div class="wrap wps-wrap">
|
32 |
+
<?php
|
33 |
+
//Show Time Range only in all list
|
34 |
+
if ( ! isset( $_REQUEST['country'] ) ) {
|
35 |
+
WP_Statistics_Admin_Pages::show_page_title( __( 'Top Countries', 'wp-statistics' ) );
|
36 |
+
wp_statistics_date_range_selector( WP_Statistics::$page['countries'], $daysToDisplay );
|
37 |
+
} else {
|
38 |
+
WP_Statistics_Admin_Pages::show_page_title( $country_name . ' ' . __( 'Visitors', 'wp-statistics' ) );
|
39 |
+
?>
|
40 |
+
<br/>
|
41 |
+
<ul class="subsubsub">
|
42 |
+
<li class="all">
|
43 |
+
<a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'countries' ); ?>"><?php _e( 'All', 'wp-statistics' ); ?></a>
|
44 |
+
</li>
|
45 |
+
|
|
46 |
+
<li>
|
47 |
+
<a class="current" href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'countries', array( 'country' => $_REQUEST['country'] ) ) ?>">
|
48 |
+
<?php echo $country_name; ?>
|
49 |
+
<span class="count">(<?php echo number_format_i18n( $total ); ?>)</span></a>
|
50 |
+
</li>
|
51 |
+
</ul>
|
52 |
+
<?php
|
53 |
+
}
|
54 |
+
?>
|
55 |
<div class="postbox-container" id="last-log">
|
56 |
<div class="metabox-holder">
|
57 |
<div class="meta-box-sortables">
|
58 |
<div class="postbox">
|
59 |
+
<?php
|
60 |
+
if ( ! isset( $_REQUEST['country'] ) ) {
|
61 |
+
$paneltitle = __( 'Top Countries', 'wp-statistics' );
|
62 |
+
} else {
|
63 |
+
$paneltitle = $country_name;
|
64 |
+
}
|
65 |
+
?>
|
66 |
<button class="handlediv" type="button" aria-expanded="true">
|
67 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
68 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
69 |
</button>
|
70 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
71 |
|
72 |
<div class="inside">
|
73 |
+
<?php
|
74 |
+
if ( ! isset( $_REQUEST['country'] ) ) {
|
75 |
+
?>
|
76 |
+
|
77 |
+
<table class="widefat table-stats" id="last-referrer" style="width: 100%;">
|
78 |
+
<tr>
|
79 |
+
<td width="10%"><?php _e( 'Rank', 'wp-statistics' ); ?></td>
|
80 |
+
<td width="30%" style="text-align: center;"><?php _e( 'Flag', 'wp-statistics' ); ?></td>
|
81 |
+
<td width="30%" style="text-align: center;"><?php _e( 'Country', 'wp-statistics' ); ?></td>
|
82 |
+
<td width="30%" style="text-align: center;"><?php _e( 'Visitor Count', 'wp-statistics' ); ?></td>
|
83 |
+
</tr>
|
84 |
+
|
85 |
+
<?php
|
86 |
+
$rangestartdate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangestart_utime );
|
87 |
+
$rangeenddate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangeend_utime );
|
88 |
+
|
89 |
+
$result = $wpdb->get_results(
|
90 |
+
sprintf( "SELECT `location`, COUNT(`location`) AS `count` FROM `{$wpdb->prefix}statistics_visitor` WHERE `last_counter` BETWEEN '%s' AND '%s' GROUP BY `location` ORDER BY `count` DESC",
|
91 |
+
$rangestartdate,
|
92 |
+
$rangeenddate
|
93 |
+
)
|
94 |
+
);
|
95 |
+
$i = 0;
|
96 |
+
|
97 |
+
foreach ( $result as $item ) {
|
98 |
+
$i ++;
|
99 |
+
$item->location = strtoupper( $item->location );
|
100 |
+
|
101 |
+
echo "<tr>";
|
102 |
+
echo "<td>$i</td>";
|
103 |
+
echo "<td style=\"text-align: center;\"><img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $item->location . '.png' ) . "' title='{$ISOCountryCode[$item->location]}'/></td>";
|
104 |
+
echo "<td style='text-align: left; padding-" . ( is_rtl() === true ? 'right' : 'left' ) . ": 12.8%;'>{$ISOCountryCode[$item->location]}</td>";
|
105 |
+
echo "<td style=\"text-align: center;\"><a href='" . WP_Statistics_Admin_Pages::admin_url( 'countries', array( 'country' => $item->location ) ) . "'>" . number_format_i18n( $item->count ) . "</a></td>";
|
106 |
+
echo "</tr>";
|
107 |
+
}
|
108 |
+
?>
|
109 |
+
</table>
|
110 |
+
<?php } else {
|
111 |
+
/*
|
112 |
+
* Show Custom Country
|
113 |
+
*/
|
114 |
+
|
115 |
+
// Retrieve MySQL data
|
116 |
+
$sql = "SELECT count(*) FROM `{$wpdb->prefix}statistics_visitor` WHERE `location` = '" . $_REQUEST['country'] . "'";
|
117 |
|
118 |
+
// Instantiate pagination object with appropriate arguments
|
119 |
+
$total = $wpdb->get_var( $sql );
|
120 |
+
$items_per_page = 15;
|
121 |
+
$page = isset( $_GET['pagination-page'] ) ? abs( (int) $_GET['pagination-page'] ) : 1;
|
122 |
+
$offset = ( $page * $items_per_page ) - $items_per_page;
|
123 |
+
|
124 |
+
//Get Query Result
|
125 |
+
$query = str_replace( "SELECT count(*) FROM", "SELECT * FROM", $sql ) . " ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC LIMIT {$offset}, {$items_per_page}";
|
126 |
+
$result = $wpdb->get_results( $query );
|
127 |
+
|
128 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\"><tr>";
|
129 |
+
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
130 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
131 |
+
echo "<td>" . __( 'Country', 'wp-statistics' ) . "</td>";
|
132 |
+
}
|
133 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
134 |
+
echo "<td>" . __( 'City', 'wp-statistics' ) . "</td>";
|
135 |
+
}
|
136 |
+
echo "<td>" . __( 'Date', 'wp-statistics' ) . "</td>";
|
137 |
+
echo "<td>" . __( 'IP', 'wp-statistics' ) . "</td>";
|
138 |
+
echo "<td>" . __( 'Referrer', 'wp-statistics' ) . "</td>";
|
139 |
+
echo "</tr>";
|
140 |
+
|
141 |
+
// Load city name
|
142 |
+
$geoip_reader = false;
|
143 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
144 |
+
$geoip_reader = $WP_Statistics::geoip_loader( 'city' );
|
145 |
+
}
|
146 |
+
|
147 |
+
foreach ( $result as $items ) {
|
148 |
echo "<tr>";
|
149 |
+
echo "<td style=\"text-align: left\">";
|
150 |
+
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false ) {
|
151 |
+
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
152 |
+
} else {
|
153 |
+
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
154 |
+
}
|
155 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
156 |
+
echo "</td>";
|
157 |
+
$city = '';
|
158 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
159 |
+
if ( $geoip_reader != false ) {
|
160 |
+
try {
|
161 |
+
$reader = $geoip_reader->city( $items->ip );
|
162 |
+
$city = $reader->city->name;
|
163 |
+
} catch ( Exception $e ) {
|
164 |
+
$city = __( 'Unknown', 'wp-statistics' );
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( ! $city ) {
|
168 |
+
$city = __( 'Unknown', 'wp-statistics' );
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
174 |
+
echo "<td style=\"text-align: left\">";
|
175 |
+
echo "<img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $items->location . '.png' ) . "' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
|
176 |
+
echo "</td>";
|
177 |
+
}
|
178 |
+
|
179 |
+
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
180 |
+
echo "<td style=\"text-align: left\">";
|
181 |
+
echo $city;
|
182 |
+
echo "</td>";
|
183 |
+
}
|
184 |
+
|
185 |
+
echo "<td style=\"text-align: left\">";
|
186 |
+
echo date_i18n( get_option( 'date_format' ), strtotime( $items->last_counter ) );
|
187 |
+
echo "</td>";
|
188 |
+
|
189 |
+
echo "<td style=\"text-align: left\">";
|
190 |
+
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
191 |
+
$ip_string = __( '#hash#', 'wp-statistics' );
|
192 |
+
} else {
|
193 |
+
$ip_string = "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>{$items->ip}</a>";
|
194 |
+
}
|
195 |
+
echo $ip_string;
|
196 |
+
echo "</td>";
|
197 |
+
|
198 |
+
echo "<td style=\"text-align: left\">";
|
199 |
+
echo $WP_Statistics->get_referrer_link( $items->referred );
|
200 |
+
echo "</td>";
|
201 |
+
|
202 |
echo "</tr>";
|
203 |
}
|
204 |
+
echo "</table>";
|
205 |
+
} ?>
|
206 |
</div>
|
207 |
</div>
|
208 |
</div>
|
209 |
</div>
|
210 |
+
<?php
|
211 |
+
if ( isset( $_REQUEST['country'] ) ) {
|
212 |
+
//Show Pagination
|
213 |
+
wp_statistics_paginate_links( array(
|
214 |
+
'item_per_page' => $items_per_page,
|
215 |
+
'total' => $total,
|
216 |
+
'current' => $page,
|
217 |
+
) );
|
218 |
+
}
|
219 |
+
?>
|
220 |
</div>
|
221 |
</div>
|
includes/log/top-pages.php
CHANGED
@@ -4,22 +4,8 @@
|
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
-
|
8 |
-
|
9 |
-
$daysToDisplay = intval( $_GET['hitdays'] );
|
10 |
-
}
|
11 |
-
|
12 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
13 |
-
$rangestart = $_GET['rangestart'];
|
14 |
-
} else {
|
15 |
-
$rangestart = '';
|
16 |
-
}
|
17 |
-
if ( array_key_exists( 'rangeend', $_GET ) ) {
|
18 |
-
$rangeend = $_GET['rangeend'];
|
19 |
-
} else {
|
20 |
-
$rangeend = '';
|
21 |
-
}
|
22 |
-
|
23 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
24 |
$daysToDisplay,
|
25 |
$rangestart,
|
@@ -49,10 +35,8 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
49 |
$date[] = "'" . $WP_Statistics->Real_Current_Date( 'M j', '-' . $i, $rangeend_utime ) . "'";
|
50 |
}
|
51 |
?>
|
52 |
-
<div class="wrap">
|
53 |
-
|
54 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
55 |
-
|
56 |
<?php wp_statistics_date_range_selector( WP_Statistics::$page['pages'], $daysToDisplay ); ?>
|
57 |
<div class="postbox-container" id="last-log">
|
58 |
<div class="metabox-holder">
|
@@ -60,10 +44,7 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
60 |
<div class="postbox">
|
61 |
<?php $paneltitle = __( 'Top 5 Pages Trends', 'wp-statistics' ); ?>
|
62 |
<button class="handlediv" type="button" aria-expanded="true">
|
63 |
-
<span class="screen-reader-text"><?php printf(
|
64 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
65 |
-
$paneltitle
|
66 |
-
); ?></span>
|
67 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
68 |
</button>
|
69 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
@@ -79,6 +60,7 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
79 |
colors[4] = ['rgba(54, 162, 235, 0.2)', 'rgba(54, 162, 235, 1)'];
|
80 |
|
81 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
|
|
82 |
var ChartJs = new Chart(ctx, {
|
83 |
type: 'line',
|
84 |
data: {
|
@@ -137,33 +119,15 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
137 |
<?php
|
138 |
if ( $total > 0 ) {
|
139 |
// Instantiate pagination object with appropriate arguments
|
140 |
-
$
|
141 |
-
$
|
142 |
-
$
|
143 |
-
$
|
144 |
-
$
|
145 |
-
$
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
$pagesPerSection,
|
150 |
-
$options,
|
151 |
-
false,
|
152 |
-
$stylePageOff,
|
153 |
-
$stylePageOn,
|
154 |
-
$styleErrors,
|
155 |
-
$styleSelect
|
156 |
-
);
|
157 |
-
|
158 |
-
$start = $Pagination->getEntryStart();
|
159 |
-
$end = $Pagination->getEntryEnd();
|
160 |
-
|
161 |
-
$site_url = site_url();
|
162 |
-
|
163 |
-
$count = 0;
|
164 |
-
|
165 |
-
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
166 |
-
<tr>";
|
167 |
echo "<td width='10%'>" . __( 'ID', 'wp-statistics' ) . "</td>";
|
168 |
echo "<td width='40%'>" . __( 'Title', 'wp-statistics' ) . "</td>";
|
169 |
echo "<td width='40%'>" . __( 'Link', 'wp-statistics' ) . "</td>";
|
@@ -172,30 +136,20 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
172 |
|
173 |
foreach ( $uris as $uri ) {
|
174 |
$count ++;
|
175 |
-
|
176 |
if ( $count >= $start ) {
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
182 |
}
|
|
|
183 |
echo "<tr>";
|
184 |
echo "<td style=\"text-align: left\">" . $count . "</td>";
|
185 |
echo "<td style=\"text-align: left\">" . $uri[3] . "</td>";
|
186 |
-
|
187 |
-
echo "<td style=\"text-align: left\"><a
|
188 |
-
htmlentities( $site_url . $uri[0], ENT_QUOTES ) .
|
189 |
-
"'>" .
|
190 |
-
htmlentities( urldecode( $uri[0] ), ENT_QUOTES ) .
|
191 |
-
"</a></td>";
|
192 |
-
echo "<td style=\"text-align: left\"><a href='?page=" .
|
193 |
-
WP_Statistics::$page['pages'] .
|
194 |
-
'&page-uri=' .
|
195 |
-
htmlentities( $uri[0], ENT_QUOTES ) .
|
196 |
-
"'>" .
|
197 |
-
number_format_i18n( $uri[1] ) .
|
198 |
-
"</a></td>";
|
199 |
}
|
200 |
|
201 |
if ( $count == $start + 10 ) {
|
@@ -209,17 +163,13 @@ for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
|
|
209 |
?>
|
210 |
</div>
|
211 |
</div>
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
$Pagination->getTotalPages()
|
220 |
-
); ?></p>
|
221 |
-
</div>
|
222 |
-
<?php } ?>
|
223 |
</div>
|
224 |
</div>
|
225 |
</div>
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
+
//Set Default Time Picker Option
|
8 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
10 |
$daysToDisplay,
|
11 |
$rangestart,
|
35 |
$date[] = "'" . $WP_Statistics->Real_Current_Date( 'M j', '-' . $i, $rangeend_utime ) . "'";
|
36 |
}
|
37 |
?>
|
38 |
+
<div class="wrap wps-wrap">
|
39 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Top Pages', 'wp-statistics' ) ); ?>
|
|
|
|
|
40 |
<?php wp_statistics_date_range_selector( WP_Statistics::$page['pages'], $daysToDisplay ); ?>
|
41 |
<div class="postbox-container" id="last-log">
|
42 |
<div class="metabox-holder">
|
44 |
<div class="postbox">
|
45 |
<?php $paneltitle = __( 'Top 5 Pages Trends', 'wp-statistics' ); ?>
|
46 |
<button class="handlediv" type="button" aria-expanded="true">
|
47 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
48 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
49 |
</button>
|
50 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
60 |
colors[4] = ['rgba(54, 162, 235, 0.2)', 'rgba(54, 162, 235, 1)'];
|
61 |
|
62 |
var ctx = document.getElementById("hit-stats").getContext('2d');
|
63 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
64 |
var ChartJs = new Chart(ctx, {
|
65 |
type: 'line',
|
66 |
data: {
|
119 |
<?php
|
120 |
if ( $total > 0 ) {
|
121 |
// Instantiate pagination object with appropriate arguments
|
122 |
+
$items_per_page = 10;
|
123 |
+
$page = isset( $_GET['pagination-page'] ) ? abs( (int) $_GET['pagination-page'] ) : 1;
|
124 |
+
$offset = ( $page * $items_per_page ) - $items_per_page;
|
125 |
+
$start = $offset;
|
126 |
+
$end = $offset + $items_per_page;
|
127 |
+
$site_url = site_url();
|
128 |
+
$count = 0;
|
129 |
+
|
130 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\"><tr>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
echo "<td width='10%'>" . __( 'ID', 'wp-statistics' ) . "</td>";
|
132 |
echo "<td width='40%'>" . __( 'Title', 'wp-statistics' ) . "</td>";
|
133 |
echo "<td width='40%'>" . __( 'Link', 'wp-statistics' ) . "</td>";
|
136 |
|
137 |
foreach ( $uris as $uri ) {
|
138 |
$count ++;
|
|
|
139 |
if ( $count >= $start ) {
|
140 |
|
141 |
+
//Check Pages Id exist
|
142 |
+
if ( $uri[2] > 0 ) {
|
143 |
+
$arg = array( 'page-id' => $uri[2] );
|
144 |
+
} else {
|
145 |
+
$arg = array( 'page-uri' => $uri[0] );
|
146 |
}
|
147 |
+
|
148 |
echo "<tr>";
|
149 |
echo "<td style=\"text-align: left\">" . $count . "</td>";
|
150 |
echo "<td style=\"text-align: left\">" . $uri[3] . "</td>";
|
151 |
+
echo "<td style=\"text-align: left\"><a dir='ltr' href='" . $uri[4] . "' target='_blank'>" . htmlentities( urldecode( $uri[0] ), ENT_QUOTES ) . "</a></td>";
|
152 |
+
echo "<td style=\"text-align: left\"><a href='" . WP_Statistics_Admin_Pages::admin_url( 'pages', $arg ) . "'>" . number_format_i18n( $uri[1] ) . "</a></td>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
|
155 |
if ( $count == $start + 10 ) {
|
163 |
?>
|
164 |
</div>
|
165 |
</div>
|
166 |
+
<?php if ( $total > 0 ) {
|
167 |
+
wp_statistics_paginate_links( array(
|
168 |
+
'item_per_page' => $items_per_page,
|
169 |
+
'total' => $total,
|
170 |
+
'current' => $page,
|
171 |
+
) );
|
172 |
+
} ?>
|
|
|
|
|
|
|
|
|
173 |
</div>
|
174 |
</div>
|
175 |
</div>
|
includes/log/top-referring.php
CHANGED
@@ -1,32 +1,17 @@
|
|
1 |
<script type="text/javascript">
|
2 |
jQuery(document).ready(function () {
|
3 |
-
jQuery('.show-map').click(function () {
|
4 |
-
alert('<?php _e( 'To be added soon', 'wp-statistics' ); ?>');
|
5 |
-
});
|
6 |
-
|
7 |
postboxes.add_postbox_toggles(pagenow);
|
8 |
});
|
9 |
</script>
|
10 |
<?php
|
11 |
-
$date_args
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
$date_args
|
16 |
-
}
|
17 |
-
|
18 |
-
if ( array_key_exists( 'rangestart', $_GET ) ) {
|
19 |
-
$rangestart = esc_attr( $_GET['rangestart'] );
|
20 |
-
$date_args .= '&rangestart=' . $rangestart;
|
21 |
-
} else {
|
22 |
-
$rangestart = '';
|
23 |
}
|
24 |
-
|
25 |
-
|
26 |
-
$rangeend = esc_attr( $_GET['rangeend'] );
|
27 |
-
$date_args .= '&rangeend=' . $rangeend;
|
28 |
-
} else {
|
29 |
-
$rangeend = '';
|
30 |
}
|
31 |
|
32 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
@@ -39,8 +24,7 @@ $rangestartdate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangestart_
|
|
39 |
$rangeenddate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangeend_utime );
|
40 |
|
41 |
if ( array_key_exists( 'referr', $_GET ) ) {
|
42 |
-
$referr = $_GET['referr'];
|
43 |
-
$title = $_GET['referr'];
|
44 |
$referr_field = '&referr=' . $referr;
|
45 |
} else {
|
46 |
$referr = '';
|
@@ -51,10 +35,13 @@ $get_urls = array();
|
|
51 |
$total = 0;
|
52 |
|
53 |
if ( $referr ) {
|
54 |
-
|
|
|
|
|
|
|
55 |
$wpdb->prepare(
|
56 |
-
"SELECT * FROM `{$wpdb->prefix}statistics_visitor` WHERE `referred`
|
57 |
-
'%' . $
|
58 |
$rangestartdate,
|
59 |
$rangeenddate
|
60 |
)
|
@@ -62,39 +49,32 @@ if ( $referr ) {
|
|
62 |
|
63 |
$total = count( $result );
|
64 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
$result = $wpdb->get_results(
|
66 |
$wpdb->prepare(
|
67 |
-
"SELECT referred FROM {$wpdb->prefix}statistics_visitor WHERE referred <> '' AND `last_counter` BETWEEN %s AND %s",
|
68 |
$rangestartdate,
|
69 |
$rangeenddate
|
70 |
)
|
71 |
);
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
$url = parse_url( $item->referred );
|
77 |
-
|
78 |
-
if ( empty( $url['host'] ) || stristr( get_bloginfo( 'url' ), $url['host'] ) ) {
|
79 |
-
continue;
|
80 |
-
}
|
81 |
-
|
82 |
-
$urls[] = $url['scheme'] . '://' . $url['host'];
|
83 |
-
}
|
84 |
-
|
85 |
-
$get_urls = array_count_values( $urls );
|
86 |
-
|
87 |
-
$total = count( $get_urls );
|
88 |
}
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
<h2><?php _e( 'Top Referring Sites', 'wp-statistics' ); ?></h2>
|
93 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
94 |
|
|
|
|
|
|
|
95 |
<div><?php wp_statistics_date_range_selector( WP_Statistics::$page['referrers'], $daysToDisplay, null, null, $referr_field ); ?></div>
|
96 |
-
|
97 |
-
<div class="clear"/>
|
98 |
|
99 |
<ul class="subsubsub">
|
100 |
<?php if ( $referr ) { ?>
|
@@ -106,10 +86,8 @@ if ( $referr ) {
|
|
106 |
); ?></a>
|
107 |
</li>|
|
108 |
<li>
|
109 |
-
<a class="current" href="?page=<?php echo WP_Statistics::$page['referrers']; ?>&referr=<?php echo $WP_Statistics->html_sanitize_referrer(
|
110 |
-
|
111 |
-
) . $date_args; ?>"> <?php echo htmlentities( $title, ENT_QUOTES ); ?>
|
112 |
-
<span class="count">(<?php echo $total; ?>)</span></a></li>
|
113 |
<?php } else { ?>
|
114 |
<li class="all"><a <?php if ( ! $referr ) {
|
115 |
echo 'class="current"';
|
@@ -117,7 +95,7 @@ if ( $referr ) {
|
|
117 |
'All',
|
118 |
'wp-statistics'
|
119 |
); ?>
|
120 |
-
<span class="count">(<?php echo $total; ?>)</span></a></li>
|
121 |
<?php } ?>
|
122 |
</ul>
|
123 |
<div class="postbox-container" id="last-log">
|
@@ -133,10 +111,7 @@ if ( $referr ) {
|
|
133 |
$paneltitle = __( 'Top Referring Sites', 'wp-statistics' );
|
134 |
}; ?>
|
135 |
<button class="handlediv" type="button" aria-expanded="true">
|
136 |
-
|
137 |
-
__( 'Toggle panel: %s', 'wp-statistics' ),
|
138 |
-
$paneltitle
|
139 |
-
); ?></span>
|
140 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
141 |
</button>
|
142 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
@@ -147,93 +122,148 @@ if ( $referr ) {
|
|
147 |
|
148 |
if ( $total > 0 ) {
|
149 |
// Initiate pagination object with appropriate arguments
|
150 |
-
$
|
151 |
-
$
|
152 |
-
$
|
153 |
-
$
|
154 |
-
$
|
155 |
-
$styleSelect = "paginationSelect";
|
156 |
-
|
157 |
-
$Pagination = new WP_Statistics_Pagination(
|
158 |
-
$total,
|
159 |
-
$pagesPerSection,
|
160 |
-
$options,
|
161 |
-
false,
|
162 |
-
$stylePageOff,
|
163 |
-
$stylePageOn,
|
164 |
-
$styleErrors,
|
165 |
-
$styleSelect
|
166 |
-
);
|
167 |
-
|
168 |
-
$start = $Pagination->getEntryStart();
|
169 |
-
$end = $Pagination->getEntryEnd();
|
170 |
|
171 |
if ( $referr ) {
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
$end
|
181 |
-
)
|
182 |
-
);
|
183 |
}
|
|
|
|
|
|
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
203 |
|
204 |
-
|
205 |
-
|
206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
|
|
|
|
208 |
} else {
|
209 |
-
arsort( $get_urls );
|
210 |
-
$get_urls = array_slice( $get_urls, $start, $end );
|
211 |
|
212 |
-
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
$i ++;
|
215 |
-
$referrer_html = $WP_Statistics->html_sanitize_referrer( $items );
|
216 |
-
$referrer_html = parse_url( $referrer_html )['host'];
|
217 |
-
echo "<div class='log-item'>";
|
218 |
-
echo "<div class='log-referred'>{$i} - <a href='?page=" .
|
219 |
-
WP_Statistics::$page['referrers'] .
|
220 |
-
"&referr=" .
|
221 |
-
$referrer_html .
|
222 |
-
$date_args .
|
223 |
-
"'>" .
|
224 |
-
$referrer_html .
|
225 |
-
"</a></div>";
|
226 |
-
echo "<div class='log-ip'>" .
|
227 |
-
__( 'References', 'wp-statistics' ) .
|
228 |
-
': ' .
|
229 |
-
number_format_i18n( $value ) .
|
230 |
-
'</div>';
|
231 |
-
echo "<div class='clear'></div>";
|
232 |
-
echo "<div class='log-url'>" .
|
233 |
-
$WP_Statistics->get_referrer_link( $items, 100 ) .
|
234 |
-
'</div>';
|
235 |
-
echo "</div>";
|
236 |
}
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
}
|
239 |
|
@@ -241,17 +271,15 @@ if ( $referr ) {
|
|
241 |
?>
|
242 |
</div>
|
243 |
</div>
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
<?php } ?>
|
254 |
-
</div>
|
255 |
</div>
|
256 |
</div>
|
257 |
</div>
|
1 |
<script type="text/javascript">
|
2 |
jQuery(document).ready(function () {
|
|
|
|
|
|
|
|
|
3 |
postboxes.add_postbox_toggles(pagenow);
|
4 |
});
|
5 |
</script>
|
6 |
<?php
|
7 |
+
$date_args = '';
|
8 |
+
//Set Default Time Picker Option
|
9 |
+
list( $daysToDisplay, $rangestart, $rangeend ) = wp_statistics_prepare_range_time_picker();
|
10 |
+
if ( isset( $_GET['hitdays'] ) and $_GET['hitdays'] > 0 ) {
|
11 |
+
$date_args .= '&hitdays=' . $daysToDisplay;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
+
if ( isset( $_GET['rangeend'] ) and isset( $_GET['rangestart'] ) and strtotime( $_GET['rangestart'] ) != false and strtotime( $_GET['rangeend'] ) != false ) {
|
14 |
+
$date_args .= '&rangestart=' . $rangestart . '&rangeend=' . $rangeend;
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
|
24 |
$rangeenddate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangeend_utime );
|
25 |
|
26 |
if ( array_key_exists( 'referr', $_GET ) ) {
|
27 |
+
$referr = $title = $_GET['referr'];
|
|
|
28 |
$referr_field = '&referr=' . $referr;
|
29 |
} else {
|
30 |
$referr = '';
|
35 |
$total = 0;
|
36 |
|
37 |
if ( $referr ) {
|
38 |
+
|
39 |
+
//Get domain Name
|
40 |
+
$search_url = wp_statistics_get_domain_name( trim( $_GET['referr'] ) );
|
41 |
+
$result = $wpdb->get_results(
|
42 |
$wpdb->prepare(
|
43 |
+
"SELECT * FROM `{$wpdb->prefix}statistics_visitor` WHERE `referred` REGEXP \"^(https?://|www\\.)[\.A-Za-z0-9\-]+\\.[a-zA-Z]{2,4}\" AND referred <> '' AND LENGTH(referred) >=12 AND (`referred` LIKE %s OR `referred` LIKE %s OR `referred` LIKE %s OR `referred` LIKE %s) AND `last_counter` BETWEEN %s AND %s ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC",
|
44 |
+
'https://www.' . $wpdb->esc_like( $search_url ) . '%', 'https://' . $wpdb->esc_like( $search_url ) . '%', 'http://www.' . $wpdb->esc_like( $search_url ) . '%', 'http://' . $wpdb->esc_like( $search_url ) . '%',
|
45 |
$rangestartdate,
|
46 |
$rangeenddate
|
47 |
)
|
49 |
|
50 |
$total = count( $result );
|
51 |
} else {
|
52 |
+
|
53 |
+
//Get Wordpress Domain
|
54 |
+
$site_url = wp_parse_url( get_site_url() );
|
55 |
+
$site_url = $site_url['scheme'] . "://" . $site_url['host'];
|
56 |
+
|
57 |
+
//Get List referred
|
58 |
$result = $wpdb->get_results(
|
59 |
$wpdb->prepare(
|
60 |
+
"SELECT SUBSTRING_INDEX(REPLACE( REPLACE( referred, 'http://', '') , 'https://' , '') , '/', 1 ) as `domain`, count(referred) as `number` FROM {$wpdb->prefix}statistics_visitor WHERE `referred` REGEXP \"^(https?://|www\\.)[\.A-Za-z0-9\-]+\\.[a-zA-Z]{2,4}\" AND referred <> '' AND LENGTH(referred) >=12 AND `referred` NOT LIKE '{$site_url}%' AND `last_counter` BETWEEN %s AND %s GROUP BY domain ORDER BY `number` DESC",
|
61 |
$rangestartdate,
|
62 |
$rangeenddate
|
63 |
)
|
64 |
);
|
65 |
|
66 |
+
//Number Total Row
|
67 |
+
$total = count( $result );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
+
//Load country Code
|
71 |
+
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
|
|
|
|
72 |
|
73 |
+
?>
|
74 |
+
<div class="wrap wps-wrap">
|
75 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Top Referring Sites', 'wp-statistics' ) ); ?>
|
76 |
<div><?php wp_statistics_date_range_selector( WP_Statistics::$page['referrers'], $daysToDisplay, null, null, $referr_field ); ?></div>
|
77 |
+
<br class="clear"/>
|
|
|
78 |
|
79 |
<ul class="subsubsub">
|
80 |
<?php if ( $referr ) { ?>
|
86 |
); ?></a>
|
87 |
</li>|
|
88 |
<li>
|
89 |
+
<a class="current" href="?page=<?php echo WP_Statistics::$page['referrers']; ?>&referr=<?php echo $WP_Statistics->html_sanitize_referrer( $referr ) . $date_args; ?>"> <?php echo htmlentities( $title, ENT_QUOTES ); ?>
|
90 |
+
<span class="count">(<?php echo number_format_i18n( $total ); ?>)</span></a></li>
|
|
|
|
|
91 |
<?php } else { ?>
|
92 |
<li class="all"><a <?php if ( ! $referr ) {
|
93 |
echo 'class="current"';
|
95 |
'All',
|
96 |
'wp-statistics'
|
97 |
); ?>
|
98 |
+
<span class="count">(<?php echo number_format_i18n( $total ); ?>)</span></a></li>
|
99 |
<?php } ?>
|
100 |
</ul>
|
101 |
<div class="postbox-container" id="last-log">
|
111 |
$paneltitle = __( 'Top Referring Sites', 'wp-statistics' );
|
112 |
}; ?>
|
113 |
<button class="handlediv" type="button" aria-expanded="true">
|
114 |
+
<span class="screen-reader-text"><?php printf( __( 'Toggle panel: %s', 'wp-statistics' ), $paneltitle ); ?></span>
|
|
|
|
|
|
|
115 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
116 |
</button>
|
117 |
<h2 class="hndle"><span><?php echo $paneltitle; ?></h2>
|
122 |
|
123 |
if ( $total > 0 ) {
|
124 |
// Initiate pagination object with appropriate arguments
|
125 |
+
$items_per_page = 10;
|
126 |
+
$page = isset( $_GET['pagination-page'] ) ? abs( (int) $_GET['pagination-page'] ) : 1;
|
127 |
+
$offset = ( $page * $items_per_page ) - $items_per_page;
|
128 |
+
$start = $offset;
|
129 |
+
$end = $offset + $items_per_page;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
if ( $referr ) {
|
132 |
+
|
133 |
+
//Show Table
|
134 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"top-referring\"><tr>";
|
135 |
+
echo "<td>" . __( 'Link', 'wp-statistics' ) . "</td>";
|
136 |
+
echo "<td>" . __( 'IP', 'wp-statistics' ) . "</td>";
|
137 |
+
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
138 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
139 |
+
echo "<td>" . __( 'Country', 'wp-statistics' ) . "</td>";
|
|
|
|
|
|
|
140 |
}
|
141 |
+
echo "<td>" . __( 'Date', 'wp-statistics' ) . "</td>";
|
142 |
+
echo "<td></td>";
|
143 |
+
echo "</tr>";
|
144 |
|
145 |
+
$i = 1;
|
146 |
+
foreach ( $result as $items ) {
|
147 |
+
if ( $i > $start and $i <= $end ) {
|
148 |
+
|
149 |
+
//Sanitize IP
|
150 |
+
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
151 |
+
$ip_string = __( '#hash#', 'wp-statistics' );
|
152 |
+
$map_string = "";
|
153 |
+
} else {
|
154 |
+
$ip_string = "{$items->ip}";
|
155 |
+
$map_string = "<a class='wps-text-muted' href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>" . wp_statistics_icons( 'dashicons-visibility', 'visibility' ) . "</a><a class='show-map wps-text-muted' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='" . __( 'Map', 'wp-statistics' ) . "'>" . wp_statistics_icons( 'dashicons-location-alt', 'map' ) . "</a>";
|
156 |
+
}
|
157 |
+
|
158 |
+
echo "<tr>";
|
159 |
+
|
160 |
+
//show Referrer Link
|
161 |
+
echo "<td style=\"text-align: left\">";
|
162 |
+
echo '<a href="' . $items->referred . '" target="_blank" title="' . $items->referred . '">' . preg_replace( "(^https?://)", "", trim( $items->referred ) ) . '</a>';
|
163 |
+
echo "</td>";
|
164 |
|
165 |
+
//Show IP
|
166 |
+
echo "<td style=\"text-align: left\">";
|
167 |
+
echo $ip_string;
|
168 |
+
echo "</td>";
|
169 |
+
|
170 |
+
//Show Browser
|
171 |
+
echo "<td style=\"text-align: left\">";
|
172 |
+
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false ) {
|
173 |
+
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
174 |
+
} else {
|
175 |
+
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
176 |
+
}
|
177 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
178 |
+
echo "</td>";
|
179 |
+
|
180 |
+
//Show Country
|
181 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
182 |
+
echo "<td style=\"text-align: left\">";
|
183 |
+
echo "<img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $items->location . '.png' ) . "' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
|
184 |
+
echo "</td>";
|
185 |
+
}
|
186 |
+
|
187 |
+
//Show Date
|
188 |
+
echo "<td style=\"text-align: left\">";
|
189 |
+
echo date_i18n( get_option( 'date_format' ), strtotime( $items->last_counter ) );
|
190 |
+
echo "</td>";
|
191 |
+
|
192 |
+
//Show Link View IP
|
193 |
+
echo "<td style=\"text-align: center\">";
|
194 |
+
echo $map_string;
|
195 |
+
echo "</td>";
|
196 |
+
|
197 |
+
echo '</tr>';
|
198 |
+
|
199 |
+
}
|
200 |
+
$i ++;
|
201 |
}
|
202 |
+
|
203 |
+
echo '</table>';
|
204 |
} else {
|
|
|
|
|
205 |
|
206 |
+
//Show Table
|
207 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"top-referring\"><tr>";
|
208 |
+
echo "<td>" . __( 'Rating', 'wp-statistics' ) . "</td>";
|
209 |
+
echo "<td>" . __( 'Site Url', 'wp-statistics' ) . "</td>";
|
210 |
+
echo "<td>" . __( 'Site Title', 'wp-statistics' ) . "</td>";
|
211 |
+
echo "<td>" . __( 'Server IP', 'wp-statistics' ) . "</td>";
|
212 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
213 |
+
echo "<td>" . __( 'Country', 'wp-statistics' ) . "</td>";
|
214 |
+
}
|
215 |
+
echo "<td>" . __( 'References', 'wp-statistics' ) . "</td>";
|
216 |
+
echo "<td></td>";
|
217 |
+
echo "</tr>";
|
218 |
+
|
219 |
+
|
220 |
+
//Get Refer Site Detail
|
221 |
+
$refer_opt = get_option( 'wp_statistics_referrals_detail' );
|
222 |
+
$referrer_list = ( empty( $refer_opt ) ? array() : $refer_opt );
|
223 |
+
|
224 |
+
//Default unknown Column Value
|
225 |
+
$unknown = '<span aria-hidden="true">—</span><span class="screen-reader-text">' . __( "Unknown", 'wp-statistics' ) . '</span>';
|
226 |
+
|
227 |
+
$i = 1;
|
228 |
+
foreach ( $result as $items ) {
|
229 |
+
if ( $i > $start and $i <= $end ) {
|
230 |
+
|
231 |
+
//Prepare Data
|
232 |
+
$domain = $items->domain;
|
233 |
+
$number = wp_statistics_get_number_referer_from_domain( $items->domain, array( $rangestartdate, $rangeenddate ) );
|
234 |
+
|
235 |
+
//Get Site Link
|
236 |
+
$referrer_html = $WP_Statistics->html_sanitize_referrer( $domain );
|
237 |
+
|
238 |
+
//Get Site information if Not Exist
|
239 |
+
if ( ! array_key_exists( $domain, $referrer_list ) ) {
|
240 |
+
$get_site_inf = wp_statistics_get_domain_server( $domain );
|
241 |
+
$get_site_title = wp_statistics_get_site_title( $domain );
|
242 |
+
$referrer_list[ $domain ] = array(
|
243 |
+
'ip' => $get_site_inf['ip'],
|
244 |
+
'country' => $get_site_inf['country'],
|
245 |
+
'title' => ( $get_site_title === false ? '' : $get_site_title ),
|
246 |
+
);
|
247 |
+
}
|
248 |
+
|
249 |
+
echo "<tr>";
|
250 |
+
echo "<td>" . number_format_i18n( $i ) . "</td>";
|
251 |
+
echo "<td>" . wp_statistics_show_site_icon( $domain ) . " " . $WP_Statistics->get_referrer_link( $domain, $referrer_list[ $domain ]['title'] ) . "</td>";
|
252 |
+
echo "<td>" . ( trim( $referrer_list[ $domain ]['title'] ) == "" ? $unknown : $referrer_list[ $domain ]['title'] ) . "</td>";
|
253 |
+
echo "<td>" . ( trim( $referrer_list[ $domain ]['ip'] ) == "" ? $unknown : $referrer_list[ $domain ]['ip'] ) . "</td>";
|
254 |
+
if ( $WP_Statistics->get_option( 'geoip' ) ) {
|
255 |
+
echo "<td>" . ( trim( $referrer_list[ $domain ]['country'] ) == "" ? $unknown : "<img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $referrer_list[ $domain ]['country'] . '.png' ) . "' title='{$ISOCountryCode[$referrer_list[ $domain ]['country']]}' class='log-tools'/>" ) . "</td>";
|
256 |
+
}
|
257 |
+
echo "<td><a class='wps-text-success' href='?page=" . WP_Statistics::$page['referrers'] . "&referr=" . $referrer_html . $date_args . "'>" . number_format_i18n( $number ) . "</a></td>";
|
258 |
+
echo "</tr>";
|
259 |
+
}
|
260 |
$i ++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
+
|
263 |
+
echo "</table>";
|
264 |
+
|
265 |
+
//Save Referrer List Update
|
266 |
+
update_option( 'wp_statistics_referrals_detail', $referrer_list, 'no' );
|
267 |
}
|
268 |
}
|
269 |
|
271 |
?>
|
272 |
</div>
|
273 |
</div>
|
274 |
+
<?php
|
275 |
+
if ( $total > 0 ) {
|
276 |
+
wp_statistics_paginate_links( array(
|
277 |
+
'item_per_page' => $items_per_page,
|
278 |
+
'total' => $total,
|
279 |
+
'current' => $page,
|
280 |
+
) );
|
281 |
+
}
|
282 |
+
?>
|
|
|
|
|
283 |
</div>
|
284 |
</div>
|
285 |
</div>
|
includes/log/top-visitors.php
CHANGED
@@ -7,36 +7,30 @@
|
|
7 |
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
8 |
include( WP_Statistics::$reg['plugin-dir'] . 'includes/log/widgets/top.visitors.php' );
|
9 |
?>
|
10 |
-
<div class="wrap">
|
11 |
-
|
12 |
-
<?php do_action( 'wp_statistics_after_title' ); ?>
|
13 |
-
|
14 |
<?php
|
15 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
16 |
-
wp_register_style(
|
17 |
-
'jquery-ui-smoothness-css',
|
18 |
-
WP_Statistics::$reg['plugin-url'] . 'assets/css/jquery-ui-smoothness.min.css'
|
19 |
-
);
|
20 |
wp_enqueue_style( 'jquery-ui-smoothness-css' );
|
21 |
|
22 |
$current = 0;
|
23 |
-
|
24 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
$
|
28 |
}
|
29 |
|
30 |
echo '<br><form method="get">' . "\r\n";
|
31 |
-
|
32 |
echo ' ' . __( 'Date', 'wp-statistics' ) . ': ';
|
33 |
|
34 |
echo '<input type="hidden" name="page" value="' . WP_Statistics::$page['top-visitors'] . '">' . "\r\n";
|
35 |
-
echo '<input type="text" size="
|
36 |
-
|
37 |
echo '</form>' . "\r\n";
|
38 |
|
39 |
-
echo '<script>jQuery(function() { jQuery( "#statsdate" ).datepicker({dateFormat: \''.wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")).'\'}); } );</script>' . "\r\n";
|
40 |
|
41 |
?>
|
42 |
<div class="postbox-container" id="last-log" style="width: 100%;">
|
7 |
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
8 |
include( WP_Statistics::$reg['plugin-dir'] . 'includes/log/widgets/top.visitors.php' );
|
9 |
?>
|
10 |
+
<div class="wrap wps-wrap">
|
11 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Top 100 Visitors Today', 'wp-statistics' ) ); ?>
|
|
|
|
|
12 |
<?php
|
13 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
14 |
+
wp_register_style( 'jquery-ui-smoothness-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/jquery-ui-smoothness.min.css' );
|
|
|
|
|
|
|
15 |
wp_enqueue_style( 'jquery-ui-smoothness-css' );
|
16 |
|
17 |
$current = 0;
|
18 |
+
$statsdate = $WP_Statistics->Current_Date( get_option( "date_format" ), '-' . $current );
|
19 |
+
$rang_start = $WP_Statistics->Current_Date( "Y-m-d" );
|
20 |
+
if ( isset( $_GET['statsdate'] ) and strtotime( $_GET['statsdate'] ) != false ) {
|
21 |
+
$statsdate = date( get_option( "date_format" ), strtotime( $_GET['statsdate'] ) );
|
22 |
+
$rang_start = date( "Y-m-d", strtotime( $_GET['statsdate'] ) );
|
23 |
}
|
24 |
|
25 |
echo '<br><form method="get">' . "\r\n";
|
|
|
26 |
echo ' ' . __( 'Date', 'wp-statistics' ) . ': ';
|
27 |
|
28 |
echo '<input type="hidden" name="page" value="' . WP_Statistics::$page['top-visitors'] . '">' . "\r\n";
|
29 |
+
echo '<input type="text" size="18" name="statsdate" id="statsdate" value="' . htmlentities( $statsdate, ENT_QUOTES ) . '" autocomplete="off" placeholder="' . __( wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ), 'wp-statistics' ) . '"> <input type="submit" value="' . __( 'Go', 'wp-statistics' ) . '" class="button-primary">' . "\r\n";
|
30 |
+
echo '<input type="hidden" name="statsdate" id="stats-date" value="' . $rang_start . '">';
|
31 |
echo '</form>' . "\r\n";
|
32 |
|
33 |
+
echo '<script>jQuery(function() { jQuery( "#statsdate" ).datepicker({dateFormat: \'' . wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ) . '\', onSelect: function(selectedDate) {var v = jQuery(this).val(), d = new Date(v);if (v.length > 0) {jQuery("#rangeend").val(d.toISOString().split(\'T\')[0]);}}}); } );</script>' . "\r\n";
|
34 |
|
35 |
?>
|
36 |
<div class="postbox-container" id="last-log" style="width: 100%;">
|
includes/log/widgets/about.php
CHANGED
@@ -7,18 +7,22 @@ function wp_statistics_generate_about_postbox_content() {
|
|
7 |
</div>
|
8 |
|
9 |
<div id="about-links" style="text-align: center;">
|
10 |
-
<p
|
11 |
-
|
|
|
|
|
12 |
<?php
|
13 |
if ( current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) ) ) ) {
|
14 |
?>
|
15 |
-
| <p
|
16 |
-
|
|
|
|
|
17 |
<?php
|
18 |
}
|
19 |
?>
|
20 |
<div class="wps-postbox-veronalabs">
|
21 |
-
<a href="https://veronalabs.com" target="_blank" title="<?php _e('Power by VeronaLabs', 'wp-statistics'); ?>"><img src="https://veronalabs.com/wp-content/themes/veronalabs.com/assets/images/logo.svg"/></a>
|
22 |
</div>
|
23 |
</div>
|
24 |
<?php
|
7 |
</div>
|
8 |
|
9 |
<div id="about-links" style="text-align: center;">
|
10 |
+
<p>
|
11 |
+
<a href="https://wp-statistics.com" target="_blank"><?php _e( 'Website', 'wp-statistics' ); ?></a></p> | <p>
|
12 |
+
<a href="https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post" target="_blank"><?php _e( 'Rate & Review', 'wp-statistics' ); ?></a>
|
13 |
+
</p>
|
14 |
<?php
|
15 |
if ( current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) ) ) ) {
|
16 |
?>
|
17 |
+
| <p>
|
18 |
+
<a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'settings', array( 'tab' => 'about' ) ); ?>"><?php _e( 'More Info', 'wp-statistics' ); ?></a>
|
19 |
+
</p>| <p>
|
20 |
+
<a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'wps_welcome' ); ?>"><?php _e( 'What’s New', 'wp-statistics' ); ?>?</a></p>
|
21 |
<?php
|
22 |
}
|
23 |
?>
|
24 |
<div class="wps-postbox-veronalabs">
|
25 |
+
<a href="https://veronalabs.com" target="_blank" title="<?php _e( 'Power by VeronaLabs', 'wp-statistics' ); ?>"><img src="https://veronalabs.com/wp-content/themes/veronalabs.com/assets/images/logo.svg"/></a>
|
26 |
</div>
|
27 |
</div>
|
28 |
<?php
|
includes/log/widgets/browsers.php
CHANGED
@@ -30,7 +30,10 @@ function wp_statistics_generate_browsers_postbox_content() {
|
|
30 |
break;
|
31 |
}
|
32 |
|
33 |
-
|
|
|
|
|
|
|
34 |
$topten_browser_value[] = $value;
|
35 |
$topten_browser_color[] = wp_statistics_generate_rgba_color( $count, '0.4' );
|
36 |
}
|
@@ -44,6 +47,7 @@ function wp_statistics_generate_browsers_postbox_content() {
|
|
44 |
<canvas id="<?php echo $id; ?>" height="220"></canvas>
|
45 |
<script>
|
46 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
|
|
47 |
var ChartJs = new Chart(ctx, {
|
48 |
type: 'pie',
|
49 |
data: {
|
30 |
break;
|
31 |
}
|
32 |
|
33 |
+
//Get Browser name
|
34 |
+
$browser_name = wp_statistics_get_browser_list( strtolower( $key ) );
|
35 |
+
|
36 |
+
$topten_browser_name[] = "'" . $browser_name . "'";
|
37 |
$topten_browser_value[] = $value;
|
38 |
$topten_browser_color[] = wp_statistics_generate_rgba_color( $count, '0.4' );
|
39 |
}
|
47 |
<canvas id="<?php echo $id; ?>" height="220"></canvas>
|
48 |
<script>
|
49 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
50 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
51 |
var ChartJs = new Chart(ctx, {
|
52 |
type: 'pie',
|
53 |
data: {
|
includes/log/widgets/countries.php
CHANGED
@@ -17,12 +17,10 @@ function wp_statistics_generate_countries_postbox_content() {
|
|
17 |
$i ++;
|
18 |
$item->location = strtoupper( $item->location );
|
19 |
echo "<tr>";
|
20 |
-
echo "<td style='text-align: left'>$i</td>";
|
21 |
-
echo "<td style='text-align: left'><img src='" .
|
22 |
-
|
23 |
-
|
24 |
-
echo "<td style='text-align: left !important'>{$ISOCountryCode[$item->location]}</td>";
|
25 |
-
echo "<td style='text-align: left !important'>" . number_format_i18n( $item->count ) . "</td>";
|
26 |
echo "</tr>";
|
27 |
}
|
28 |
?>
|
17 |
$i ++;
|
18 |
$item->location = strtoupper( $item->location );
|
19 |
echo "<tr>";
|
20 |
+
echo "<td style='text-align: left;'>$i</td>";
|
21 |
+
echo "<td style='text-align: left;'><img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $item->location . '.png' ) . "' title='{$ISOCountryCode[$item->location]}'/></td>";
|
22 |
+
echo "<td style='text-align: left;'>{$ISOCountryCode[$item->location]}</td>";
|
23 |
+
echo "<td style='text-align: left;'><a href='" . WP_Statistics_Admin_Pages::admin_url( 'countries', array( 'country' => $item->location ) ) . "'>" . number_format_i18n( $item->count ) . "</a></td>";
|
|
|
|
|
24 |
echo "</tr>";
|
25 |
}
|
26 |
?>
|
includes/log/widgets/hits.php
CHANGED
@@ -20,6 +20,7 @@ function wp_statistics_generate_hits_postbox_content( $size = '300', $days = 20
|
|
20 |
<canvas id="<?php echo $id; ?>" height="<?php echo $size; ?>"></canvas>
|
21 |
<script>
|
22 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
|
|
23 |
var ChartJs = new Chart(ctx, {
|
24 |
type: 'line',
|
25 |
data: {
|
20 |
<canvas id="<?php echo $id; ?>" height="<?php echo $size; ?>"></canvas>
|
21 |
<script>
|
22 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
23 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
24 |
var ChartJs = new Chart(ctx, {
|
25 |
type: 'line',
|
26 |
data: {
|
includes/log/widgets/page.php
CHANGED
@@ -59,6 +59,7 @@ function wp_statistics_generate_page_postbox_content(
|
|
59 |
<canvas id="visits-stats" height="80"></canvas>
|
60 |
<script>
|
61 |
var ctx = document.getElementById("visits-stats").getContext('2d');
|
|
|
62 |
var ChartJs = new Chart(ctx, {
|
63 |
type: 'line',
|
64 |
data: {
|
59 |
<canvas id="visits-stats" height="80"></canvas>
|
60 |
<script>
|
61 |
var ctx = document.getElementById("visits-stats").getContext('2d');
|
62 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
63 |
var ChartJs = new Chart(ctx, {
|
64 |
type: 'line',
|
65 |
data: {
|
includes/log/widgets/pages.php
CHANGED
@@ -1,23 +1,11 @@
|
|
1 |
<?php
|
2 |
function wp_statistics_generate_pages_postbox_content() {
|
3 |
global $wpdb;
|
4 |
-
|
5 |
-
|
6 |
-
`pages`.`uri`,
|
7 |
-
`pages`.`id`,
|
8 |
-
SUM(`pages`.`count`) + IFNULL(`historical`.`value`, 0) AS `count_sum`
|
9 |
-
FROM `{$wpdb->prefix}statistics_pages` `pages`
|
10 |
-
LEFT JOIN `{$wpdb->prefix}statistics_historical` `historical`
|
11 |
-
ON `pages`.`uri`=`historical`.`uri` AND `historical`.`category`='uri'
|
12 |
-
GROUP BY `uri`
|
13 |
-
ORDER BY `count_sum` DESC
|
14 |
-
LIMIT 10
|
15 |
-
"
|
16 |
-
);
|
17 |
$site_url = site_url();
|
18 |
$counter = 0;
|
19 |
-
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
20 |
-
<tr>";
|
21 |
echo "<td width='10%'>" . __( 'ID', 'wp-statistics' ) . "</td>";
|
22 |
echo "<td width='40%'>" . __( 'Title', 'wp-statistics' ) . "</td>";
|
23 |
echo "<td width='40%'>" . __( 'Link', 'wp-statistics' ) . "</td>";
|
@@ -26,32 +14,34 @@ function wp_statistics_generate_pages_postbox_content() {
|
|
26 |
|
27 |
foreach ( $result as $item ) {
|
28 |
$counter += 1;
|
|
|
29 |
// Lookup the post title.
|
30 |
-
$
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
} else {
|
37 |
-
|
|
|
|
|
38 |
}
|
39 |
}
|
|
|
40 |
echo "<tr>";
|
41 |
echo "<td style=\"text-align: left\">" . $counter . "</td>";
|
42 |
echo "<td style=\"text-align: left\">" . $title . "</td>";
|
43 |
-
echo '<td style="text-align: left"><a href="' .
|
44 |
-
|
45 |
-
'">' .
|
46 |
-
htmlentities( urldecode( $item->uri ), ENT_QUOTES ) .
|
47 |
-
'</a></td>';
|
48 |
-
echo '<td style="text-align: left"><a href="?page=' .
|
49 |
-
WP_Statistics::$page['pages'] .
|
50 |
-
'&page-uri=' .
|
51 |
-
htmlentities( $item->uri, ENT_QUOTES ) .
|
52 |
-
'">' .
|
53 |
-
number_format_i18n( $item->count_sum ) .
|
54 |
-
'</a></td>';
|
55 |
echo '</tr>';
|
56 |
|
57 |
}
|
1 |
<?php
|
2 |
function wp_statistics_generate_pages_postbox_content() {
|
3 |
global $wpdb;
|
4 |
+
|
5 |
+
$result = $wpdb->get_results( "SELECT `pages`.`uri`,`pages`.`id`,`pages`.`type`, SUM(`pages`.`count`) + IFNULL(`historical`.`value`, 0) AS `count_sum` FROM `{$wpdb->prefix}statistics_pages` `pages` LEFT JOIN `{$wpdb->prefix}statistics_historical` `historical` ON `pages`.`uri`=`historical`.`uri` AND `historical`.`category`='uri' GROUP BY `uri` ORDER BY `count_sum` DESC LIMIT 10" );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
$site_url = site_url();
|
7 |
$counter = 0;
|
8 |
+
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\"><tr>";
|
|
|
9 |
echo "<td width='10%'>" . __( 'ID', 'wp-statistics' ) . "</td>";
|
10 |
echo "<td width='40%'>" . __( 'Title', 'wp-statistics' ) . "</td>";
|
11 |
echo "<td width='40%'>" . __( 'Link', 'wp-statistics' ) . "</td>";
|
14 |
|
15 |
foreach ( $result as $item ) {
|
16 |
$counter += 1;
|
17 |
+
|
18 |
// Lookup the post title.
|
19 |
+
$page_info = wp_statistics_get_page_info( $item->id, $item->type );
|
20 |
+
$title = mb_substr( $page_info['title'], 0, 200, "utf-8" );
|
21 |
+
$page_link = $page_info['link'];
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Check Get title by url
|
25 |
+
* @since v12.5.7
|
26 |
+
*/
|
27 |
+
if ( $page_link == '' ) {
|
28 |
+
$page_link = htmlentities( $site_url . $item->uri, ENT_QUOTES );
|
29 |
+
$id = wp_statistics_uri_to_id( $item->uri );
|
30 |
+
$post = get_post( $id );
|
31 |
+
if ( is_object( $post ) ) {
|
32 |
+
$title = $post->post_title;
|
33 |
} else {
|
34 |
+
if ( $item->uri == '/' ) {
|
35 |
+
$title = get_bloginfo();
|
36 |
+
}
|
37 |
}
|
38 |
}
|
39 |
+
|
40 |
echo "<tr>";
|
41 |
echo "<td style=\"text-align: left\">" . $counter . "</td>";
|
42 |
echo "<td style=\"text-align: left\">" . $title . "</td>";
|
43 |
+
echo '<td style="text-align: left"><a href="' . $page_link . '" target="_blank">' . htmlentities( urldecode( $item->uri ), ENT_QUOTES ) . '</a></td>';
|
44 |
+
echo '<td style="text-align: left"><a href="' . WP_Statistics_Admin_Pages::admin_url( 'pages', array( 'page-uri' => htmlentities( $item->uri, ENT_QUOTES ) ) ) . '">' . number_format_i18n( $item->count_sum ) . '</a></td>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
echo '</tr>';
|
46 |
|
47 |
}
|
includes/log/widgets/quickstats.php
CHANGED
@@ -11,8 +11,7 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
11 |
<tr>
|
12 |
<th><?php _e( 'Online Users:', 'wp-statistics' ); ?></th>
|
13 |
<th colspan="2" id="th-colspan">
|
14 |
-
|
15 |
-
href="admin.php?page=<?php echo WP_Statistics::$page['online']; ?>"><?php echo wp_statistics_useronline(); ?></a></span>
|
16 |
</th>
|
17 |
</tr>
|
18 |
<?php }
|
@@ -36,20 +35,12 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
36 |
<tr>
|
37 |
<th><?php _e( 'Today:', 'wp-statistics' ); ?></th>
|
38 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
39 |
-
echo '<a href="
|
40 |
-
WP_Statistics::$page['visitors'] .
|
41 |
-
'&hitdays=1"><span>' .
|
42 |
-
number_format_i18n( wp_statistics_visitor( 'today', null, true ) ) .
|
43 |
-
'</span></a>';
|
44 |
} else {
|
45 |
echo '';
|
46 |
} ?></th>
|
47 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
48 |
-
echo '<a href="
|
49 |
-
WP_Statistics::$page['hits'] .
|
50 |
-
'&hitdays=1"><span>' .
|
51 |
-
number_format_i18n( wp_statistics_visit( 'today' ) ) .
|
52 |
-
'</span></a>';
|
53 |
} else {
|
54 |
echo '';
|
55 |
} ?></th>
|
@@ -58,20 +49,12 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
58 |
<tr>
|
59 |
<th><?php _e( 'Yesterday:', 'wp-statistics' ); ?></th>
|
60 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
61 |
-
echo '<a href="
|
62 |
-
WP_Statistics::$page['visitors'] .
|
63 |
-
'&hitdays=1"><span>' .
|
64 |
-
number_format_i18n( wp_statistics_visitor( 'yesterday', null, true ) ) .
|
65 |
-
'</span></a>';
|
66 |
} else {
|
67 |
echo '';
|
68 |
} ?></th>
|
69 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
70 |
-
echo '<a href="
|
71 |
-
WP_Statistics::$page['hits'] .
|
72 |
-
'&hitdays=1"><span>' .
|
73 |
-
number_format_i18n( wp_statistics_visit( 'yesterday' ) ) .
|
74 |
-
'</span></a>';
|
75 |
} else {
|
76 |
echo '';
|
77 |
} ?></th>
|
@@ -80,20 +63,12 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
80 |
<tr>
|
81 |
<th><?php _e( 'Last 7 Days (Week):', 'wp-statistics' ); ?></th>
|
82 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
83 |
-
echo '<a href="
|
84 |
-
WP_Statistics::$page['visitors'] .
|
85 |
-
'&hitdays=7"><span>' .
|
86 |
-
number_format_i18n( wp_statistics_visitor( 'week', null, true ) ) .
|
87 |
-
'</span></a>';
|
88 |
} else {
|
89 |
echo '';
|
90 |
} ?></th>
|
91 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
92 |
-
echo '<a href="
|
93 |
-
WP_Statistics::$page['hits'] .
|
94 |
-
'&hitdays=7"><span>' .
|
95 |
-
number_format_i18n( wp_statistics_visit( 'week' ) ) .
|
96 |
-
'</span></a>';
|
97 |
} else {
|
98 |
echo '';
|
99 |
} ?></th>
|
@@ -102,20 +77,12 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
102 |
<tr>
|
103 |
<th><?php _e( 'Last 30 Days (Month):', 'wp-statistics' ); ?></th>
|
104 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
105 |
-
echo '<a href="
|
106 |
-
WP_Statistics::$page['visitors'] .
|
107 |
-
'&hitdays=30"><span>' .
|
108 |
-
number_format_i18n( wp_statistics_visitor( 'month', null, true ) ) .
|
109 |
-
'</span></a>';
|
110 |
} else {
|
111 |
echo '';
|
112 |
} ?></th>
|
113 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
114 |
-
echo '<a href="
|
115 |
-
WP_Statistics::$page['hits'] .
|
116 |
-
'&hitdays=30"><span>' .
|
117 |
-
number_format_i18n( wp_statistics_visit( 'month' ) ) .
|
118 |
-
'</span></a>';
|
119 |
} else {
|
120 |
echo '';
|
121 |
} ?></th>
|
@@ -124,20 +91,12 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
124 |
<tr>
|
125 |
<th><?php _e( 'Last 365 Days (Year):', 'wp-statistics' ); ?></th>
|
126 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
127 |
-
echo '<a href="
|
128 |
-
WP_Statistics::$page['visitors'] .
|
129 |
-
'&hitdays=365"><span>' .
|
130 |
-
number_format_i18n( wp_statistics_visitor( 'year', null, true ) ) .
|
131 |
-
'</span></a>';
|
132 |
} else {
|
133 |
echo '';
|
134 |
} ?></th>
|
135 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
136 |
-
echo '<a href="
|
137 |
-
WP_Statistics::$page['hits'] .
|
138 |
-
'&hitdays=365"><span>' .
|
139 |
-
number_format_i18n( wp_statistics_visit( 'year' ) ) .
|
140 |
-
'</span></a>';
|
141 |
} else {
|
142 |
echo '';
|
143 |
} ?></th>
|
@@ -146,20 +105,12 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
146 |
<tr>
|
147 |
<th><?php _e( 'Total:', 'wp-statistics' ); ?></th>
|
148 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
149 |
-
echo '<a href="
|
150 |
-
WP_Statistics::$page['visitors'] .
|
151 |
-
'&hitdays=365"><span>' .
|
152 |
-
number_format_i18n( wp_statistics_visitor( 'total', null, true ) ) .
|
153 |
-
'</span></a>';
|
154 |
} else {
|
155 |
echo '';
|
156 |
} ?></th>
|
157 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
158 |
-
echo '<a href="
|
159 |
-
WP_Statistics::$page['hits'] .
|
160 |
-
'&hitdays=365"><span>' .
|
161 |
-
number_format_i18n( wp_statistics_visit( 'total' ) ) .
|
162 |
-
'</span></a>';
|
163 |
} else {
|
164 |
echo '';
|
165 |
} ?></th>
|
@@ -273,8 +224,7 @@ function wp_statistics_generate_quickstats_postbox_content( $search_engines, $se
|
|
273 |
</table>
|
274 |
|
275 |
<br>
|
276 |
-
<hr width="80%"
|
277 |
-
<br>
|
278 |
<?php
|
279 |
|
280 |
// Include the hits chart widget, we're going to display the last 10 days only as the WordPress columns are kind of small to do much else.
|
11 |
<tr>
|
12 |
<th><?php _e( 'Online Users:', 'wp-statistics' ); ?></th>
|
13 |
<th colspan="2" id="th-colspan">
|
14 |
+
<span><a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'online' ); ?>"><?php echo wp_statistics_useronline(); ?></a></span>
|
|
|
15 |
</th>
|
16 |
</tr>
|
17 |
<?php }
|
35 |
<tr>
|
36 |
<th><?php _e( 'Today:', 'wp-statistics' ); ?></th>
|
37 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
38 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'today', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
39 |
} else {
|
40 |
echo '';
|
41 |
} ?></th>
|
42 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
43 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'today' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
44 |
} else {
|
45 |
echo '';
|
46 |
} ?></th>
|
49 |
<tr>
|
50 |
<th><?php _e( 'Yesterday:', 'wp-statistics' ); ?></th>
|
51 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
52 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'yesterday', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
53 |
} else {
|
54 |
echo '';
|
55 |
} ?></th>
|
56 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
57 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'yesterday' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
58 |
} else {
|
59 |
echo '';
|
60 |
} ?></th>
|
63 |
<tr>
|
64 |
<th><?php _e( 'Last 7 Days (Week):', 'wp-statistics' ); ?></th>
|
65 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
66 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 7 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'week', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
67 |
} else {
|
68 |
echo '';
|
69 |
} ?></th>
|
70 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
71 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 7 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'week' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
72 |
} else {
|
73 |
echo '';
|
74 |
} ?></th>
|
77 |
<tr>
|
78 |
<th><?php _e( 'Last 30 Days (Month):', 'wp-statistics' ); ?></th>
|
79 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
80 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 30 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'month', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
81 |
} else {
|
82 |
echo '';
|
83 |
} ?></th>
|
84 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
85 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 30 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'month' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
86 |
} else {
|
87 |
echo '';
|
88 |
} ?></th>
|
91 |
<tr>
|
92 |
<th><?php _e( 'Last 365 Days (Year):', 'wp-statistics' ); ?></th>
|
93 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
94 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'year', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
95 |
} else {
|
96 |
echo '';
|
97 |
} ?></th>
|
98 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
99 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'year' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
100 |
} else {
|
101 |
echo '';
|
102 |
} ?></th>
|
105 |
<tr>
|
106 |
<th><?php _e( 'Total:', 'wp-statistics' ); ?></th>
|
107 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
108 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'total', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
109 |
} else {
|
110 |
echo '';
|
111 |
} ?></th>
|
112 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
113 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'total' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
114 |
} else {
|
115 |
echo '';
|
116 |
} ?></th>
|
224 |
</table>
|
225 |
|
226 |
<br>
|
227 |
+
<hr width="80%"/><br>
|
|
|
228 |
<?php
|
229 |
|
230 |
// Include the hits chart widget, we're going to display the last 10 days only as the WordPress columns are kind of small to do much else.
|
includes/log/widgets/recent.php
CHANGED
@@ -35,7 +35,7 @@ function wp_statistics_generate_recent_postbox_content( $ISOCountryCode, $count
|
|
35 |
} else {
|
36 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
37 |
}
|
38 |
-
echo "<a href='
|
39 |
echo "</td>";
|
40 |
$city = '';
|
41 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
@@ -73,7 +73,7 @@ function wp_statistics_generate_recent_postbox_content( $ISOCountryCode, $count
|
|
73 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
74 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
75 |
} else {
|
76 |
-
$ip_string = "<a href='
|
77 |
}
|
78 |
echo $ip_string;
|
79 |
echo "</td>";
|
35 |
} else {
|
36 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
37 |
}
|
38 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
39 |
echo "</td>";
|
40 |
$city = '';
|
41 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
73 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
74 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
75 |
} else {
|
76 |
+
$ip_string = "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>{$items->ip}</a>";
|
77 |
}
|
78 |
echo $ip_string;
|
79 |
echo "</td>";
|
includes/log/widgets/referring.php
CHANGED
@@ -1,52 +1,67 @@
|
|
1 |
<?php
|
2 |
function wp_statistics_generate_referring_postbox_content( $count = 10 ) {
|
3 |
global $wpdb, $WP_Statistics;
|
4 |
-
$get_urls = array();
|
5 |
-
$urls = array();
|
6 |
-
$start = 0;
|
7 |
|
|
|
8 |
if ( false === ( $get_urls = get_transient( 'wps_top_referring' ) ) ) {
|
9 |
-
do {
|
10 |
-
$result = $wpdb->get_results("SELECT referred FROM {$wpdb->prefix}statistics_visitor WHERE referred <> '' LIMIT {$start}, 10000");
|
11 |
-
$start += count( $result );
|
12 |
-
|
13 |
-
foreach ( $result as $item ) {
|
14 |
-
$url = parse_url( $item->referred );
|
15 |
-
if ( empty( $url['host'] ) || stristr( get_bloginfo( 'url' ), $url['host'] ) ) {
|
16 |
-
continue;
|
17 |
-
}
|
18 |
-
$urls[] = $url['host'];
|
19 |
-
}
|
20 |
-
} while ( 10000 == count( $result ) );
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
$
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
// Put the results in a transient. Expire after
|
27 |
-
set_transient( 'wps_top_referring', $get_urls,
|
28 |
}
|
29 |
?>
|
30 |
-
<table width="100%" class="widefat table-stats" id="
|
31 |
<tr>
|
|
|
|
|
32 |
<td width="10%"><?php _e( 'References', 'wp-statistics' ); ?></td>
|
33 |
-
<td width="90%"><?php _e( 'Address', 'wp-statistics' ); ?></td>
|
34 |
</tr>
|
35 |
-
|
36 |
<?php
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
echo "<tr>";
|
40 |
-
echo "<td
|
41 |
-
|
42 |
-
|
43 |
-
$referrer_html .
|
44 |
-
"'>" .
|
45 |
-
number_format_i18n( $value ) .
|
46 |
-
"</a></td>";
|
47 |
-
echo "<td>" . $WP_Statistics->get_referrer_link( $items ) . "</td>";
|
48 |
echo "</tr>";
|
49 |
}
|
|
|
|
|
|
|
|
|
50 |
?>
|
51 |
</table>
|
52 |
<?php
|
1 |
<?php
|
2 |
function wp_statistics_generate_referring_postbox_content( $count = 10 ) {
|
3 |
global $wpdb, $WP_Statistics;
|
|
|
|
|
|
|
4 |
|
5 |
+
//Get Top Referring
|
6 |
if ( false === ( $get_urls = get_transient( 'wps_top_referring' ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
//Get Wordpress Domain
|
9 |
+
$site_url = wp_parse_url( get_site_url() );
|
10 |
+
$site_url = $site_url['scheme'] . "://" . $site_url['host'];
|
11 |
+
$result = $wpdb->get_results( "SELECT SUBSTRING_INDEX(REPLACE( REPLACE( referred, 'http://', '') , 'https://' , '') , '/', 1 ) as `domain`, count(referred) as `number` FROM {$wpdb->prefix}statistics_visitor WHERE `referred` REGEXP \"^(https?://|www\\.)[\.A-Za-z0-9\-]+\\.[a-zA-Z]{2,4}\" AND referred <> '' AND LENGTH(referred) >=12 AND `referred` NOT LIKE '{$site_url}%' GROUP BY domain ORDER BY `number` DESC LIMIT $count" );
|
12 |
+
foreach ( $result as $items ) {
|
13 |
+
$get_urls[ $items->domain ] = wp_statistics_get_number_referer_from_domain( $items->domain );
|
14 |
+
}
|
15 |
|
16 |
+
// Put the results in a transient. Expire after 12 hours.
|
17 |
+
set_transient( 'wps_top_referring', $get_urls, 12 * HOUR_IN_SECONDS );
|
18 |
}
|
19 |
?>
|
20 |
+
<table width="100%" class="widefat table-stats" id="top-referrer">
|
21 |
<tr>
|
22 |
+
<td width="50%"><?php _e( 'Address', 'wp-statistics' ); ?></td>
|
23 |
+
<td width="40%"><?php _e( 'Server IP', 'wp-statistics' ); ?></td>
|
24 |
<td width="10%"><?php _e( 'References', 'wp-statistics' ); ?></td>
|
|
|
25 |
</tr>
|
|
|
26 |
<?php
|
27 |
+
|
28 |
+
//Load country Code
|
29 |
+
$ISOCountryCode = $WP_Statistics->get_country_codes();
|
30 |
+
|
31 |
+
//Get Refer Site Detail
|
32 |
+
$refer_opt = get_option( 'wp_statistics_referrals_detail' );
|
33 |
+
$referrer_list = ( empty( $refer_opt ) ? array() : $refer_opt );
|
34 |
+
|
35 |
+
if ( ! $get_urls ) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
foreach ( $get_urls as $domain => $number ) {
|
40 |
+
|
41 |
+
//Get Site Link
|
42 |
+
$referrer_html = $WP_Statistics->html_sanitize_referrer( $domain );
|
43 |
+
|
44 |
+
//Get Site information if Not Exist
|
45 |
+
if ( ! array_key_exists( $domain, $referrer_list ) ) {
|
46 |
+
$get_site_inf = wp_statistics_get_domain_server( $domain );
|
47 |
+
$get_site_title = wp_statistics_get_site_title( $domain );
|
48 |
+
$referrer_list[ $domain ] = array(
|
49 |
+
'ip' => $get_site_inf['ip'],
|
50 |
+
'country' => $get_site_inf['country'],
|
51 |
+
'title' => ( $get_site_title === false ? '' : $get_site_title ),
|
52 |
+
);
|
53 |
+
}
|
54 |
+
|
55 |
echo "<tr>";
|
56 |
+
echo "<td>" . wp_statistics_show_site_icon( $domain ) . " " . $WP_Statistics->get_referrer_link( $domain, $referrer_list[ $domain ]['title'], true ) . "</td>";
|
57 |
+
echo "<td><span class='wps-cursor-default' " . ( $referrer_list[ $domain ]['country'] != "" ? 'title="' . $ISOCountryCode[ $referrer_list[ $domain ]['country'] ] . '"' : '' ) . ">" . ( $referrer_list[ $domain ]['ip'] != "" ? $referrer_list[ $domain ]['ip'] : '-' ) . "</span></td>";
|
58 |
+
echo "<td><a href='" . WP_Statistics_Admin_Pages::admin_url( 'referrers', array( 'referr' => $referrer_html ) ) . "'>" . number_format_i18n( $number ) . "</a></td>";
|
|
|
|
|
|
|
|
|
|
|
59 |
echo "</tr>";
|
60 |
}
|
61 |
+
|
62 |
+
//Save Referrer List Update
|
63 |
+
update_option( 'wp_statistics_referrals_detail', $referrer_list, 'no' );
|
64 |
+
|
65 |
?>
|
66 |
</table>
|
67 |
<?php
|
includes/log/widgets/search.php
CHANGED
@@ -37,6 +37,7 @@ function wp_statistics_generate_search_postbox_content( $search_engines, $size =
|
|
37 |
colors['qwant'] = ['rgba(53, 60, 82, 0.2)', 'rgba(53, 60, 82, 1)'];
|
38 |
|
39 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
|
|
40 |
var ChartJs = new Chart(ctx, {
|
41 |
type: 'line',
|
42 |
data: {
|
37 |
colors['qwant'] = ['rgba(53, 60, 82, 0.2)', 'rgba(53, 60, 82, 1)'];
|
38 |
|
39 |
var ctx = document.getElementById("<?php echo $id; ?>").getContext('2d');
|
40 |
+
<?php if(is_rtl()) { ?> Chart.defaults.global.defaultFontFamily = "tahoma"; <?php } ?>
|
41 |
var ChartJs = new Chart(ctx, {
|
42 |
type: 'line',
|
43 |
data: {
|
includes/log/widgets/searched.phrases.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
function wp_statistics_generate_searched_phrases_postbox_content() {
|
3 |
-
|
4 |
-
global $wpdb;
|
5 |
-
|
6 |
-
$result = $wpdb->get_results(
|
7 |
-
"SELECT `words` , count(`words`) as `count` FROM `{$wpdb->prefix}statistics_search` WHERE `words` <> '' AND `last_counter` BETWEEN DATE_SUB(CURDATE(), INTERVAL 30 DAY) AND CURDATE() GROUP BY `words` order by `count` DESC limit 10"
|
8 |
-
);
|
9 |
-
|
10 |
-
?>
|
11 |
-
<table width="100%" class="widefat table-stats" id="searched-phrases">
|
12 |
-
<tr>
|
13 |
-
<td width="90%"><?php _e( 'Phrase', 'wp-statistics' ); ?></td>
|
14 |
-
<td width="10%"><?php _e( 'Count', 'wp-statistics' ); ?></td>
|
15 |
-
</tr>
|
16 |
-
|
17 |
-
<?php
|
18 |
-
|
19 |
-
foreach ( $result as $item ) {
|
20 |
-
|
21 |
-
echo "<tr>";
|
22 |
-
echo "<td>{$item->words}</td>";
|
23 |
-
echo "<td>{$item->count}</td>";
|
24 |
-
echo "</tr>";
|
25 |
-
}
|
26 |
-
?>
|
27 |
-
</table>
|
28 |
-
<?php
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/log/widgets/summary.php
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
<?php
|
2 |
function wp_statistics_generate_summary_postbox_content( $search_engines, $search = true, $time = true ) {
|
3 |
-
|
4 |
global $wpdb, $WP_Statistics;
|
5 |
-
|
6 |
$show_visitors = $WP_Statistics->get_option( 'visitor' );
|
7 |
?>
|
8 |
<table width="100%" class="widefat table-stats" id="summary-stats">
|
@@ -11,8 +9,7 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
11 |
<tr>
|
12 |
<th><?php _e( 'Online Users:', 'wp-statistics' ); ?></th>
|
13 |
<th colspan="2" id="th-colspan">
|
14 |
-
|
15 |
-
href="admin.php?page=<?php echo WP_Statistics::$page['online']; ?>"><?php echo wp_statistics_useronline(); ?></a></span>
|
16 |
</th>
|
17 |
</tr>
|
18 |
<?php }
|
@@ -36,20 +33,12 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
36 |
<tr>
|
37 |
<th><?php _e( 'Today:', 'wp-statistics' ); ?></th>
|
38 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
39 |
-
echo '<a href="
|
40 |
-
WP_Statistics::$page['visitors'] .
|
41 |
-
'&hitdays=1"><span>' .
|
42 |
-
number_format_i18n( wp_statistics_visitor( 'today', null, true ) ) .
|
43 |
-
'</span></a>';
|
44 |
} else {
|
45 |
echo '';
|
46 |
} ?></th>
|
47 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
48 |
-
echo '<a href="
|
49 |
-
WP_Statistics::$page['hits'] .
|
50 |
-
'&hitdays=1"><span>' .
|
51 |
-
number_format_i18n( wp_statistics_visit( 'today' ) ) .
|
52 |
-
'</span></a>';
|
53 |
} else {
|
54 |
echo '';
|
55 |
} ?></th>
|
@@ -58,20 +47,12 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
58 |
<tr>
|
59 |
<th><?php _e( 'Yesterday:', 'wp-statistics' ); ?></th>
|
60 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
61 |
-
echo '<a href="
|
62 |
-
WP_Statistics::$page['visitors'] .
|
63 |
-
'&hitdays=1"><span>' .
|
64 |
-
number_format_i18n( wp_statistics_visitor( 'yesterday', null, true ) ) .
|
65 |
-
'</span></a>';
|
66 |
} else {
|
67 |
echo '';
|
68 |
} ?></th>
|
69 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
70 |
-
echo '<a href="
|
71 |
-
WP_Statistics::$page['hits'] .
|
72 |
-
'&hitdays=1"><span>' .
|
73 |
-
number_format_i18n( wp_statistics_visit( 'yesterday' ) ) .
|
74 |
-
'</span></a>';
|
75 |
} else {
|
76 |
echo '';
|
77 |
} ?></th>
|
@@ -80,20 +61,12 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
80 |
<tr>
|
81 |
<th><?php _e( 'Last 7 Days:', 'wp-statistics' ); ?></th>
|
82 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
83 |
-
echo '<a href="
|
84 |
-
WP_Statistics::$page['visitors'] .
|
85 |
-
'&hitdays=7"><span>' .
|
86 |
-
number_format_i18n( wp_statistics_visitor( 'week', null, true ) ) .
|
87 |
-
'</span></a>';
|
88 |
} else {
|
89 |
echo '';
|
90 |
} ?></th>
|
91 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
92 |
-
echo '<a href="
|
93 |
-
WP_Statistics::$page['hits'] .
|
94 |
-
'&hitdays=7"><span>' .
|
95 |
-
number_format_i18n( wp_statistics_visit( 'week' ) ) .
|
96 |
-
'</span></a>';
|
97 |
} else {
|
98 |
echo '';
|
99 |
} ?></th>
|
@@ -102,20 +75,12 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
102 |
<tr>
|
103 |
<th><?php _e( 'Last 30 Days:', 'wp-statistics' ); ?></th>
|
104 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
105 |
-
echo '<a href="
|
106 |
-
WP_Statistics::$page['visitors'] .
|
107 |
-
'&hitdays=30"><span>' .
|
108 |
-
number_format_i18n( wp_statistics_visitor( 'month', null, true ) ) .
|
109 |
-
'</span></a>';
|
110 |
} else {
|
111 |
echo '';
|
112 |
} ?></th>
|
113 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
114 |
-
echo '<a href="
|
115 |
-
WP_Statistics::$page['hits'] .
|
116 |
-
'&hitdays=30"><span>' .
|
117 |
-
number_format_i18n( wp_statistics_visit( 'month' ) ) .
|
118 |
-
'</span></a>';
|
119 |
} else {
|
120 |
echo '';
|
121 |
} ?></th>
|
@@ -124,20 +89,12 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
124 |
<tr>
|
125 |
<th><?php _e( 'Last 365 Days:', 'wp-statistics' ); ?></th>
|
126 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
127 |
-
echo '<a href="
|
128 |
-
WP_Statistics::$page['visitors'] .
|
129 |
-
'&hitdays=365"><span>' .
|
130 |
-
number_format_i18n( wp_statistics_visitor( 'year', null, true ) ) .
|
131 |
-
'</span></a>';
|
132 |
} else {
|
133 |
echo '';
|
134 |
} ?></th>
|
135 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
136 |
-
echo '<a href="
|
137 |
-
WP_Statistics::$page['hits'] .
|
138 |
-
'&hitdays=365"><span>' .
|
139 |
-
number_format_i18n( wp_statistics_visit( 'year' ) ) .
|
140 |
-
'</span></a>';
|
141 |
} else {
|
142 |
echo '';
|
143 |
} ?></th>
|
@@ -146,20 +103,12 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
146 |
<tr>
|
147 |
<th><?php _e( 'Total:', 'wp-statistics' ); ?></th>
|
148 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
149 |
-
echo '<a href="
|
150 |
-
WP_Statistics::$page['visitors'] .
|
151 |
-
'&hitdays=365"><span>' .
|
152 |
-
number_format_i18n( wp_statistics_visitor( 'total', null, true ) ) .
|
153 |
-
'</span></a>';
|
154 |
} else {
|
155 |
echo '';
|
156 |
} ?></th>
|
157 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
158 |
-
echo '<a href="
|
159 |
-
WP_Statistics::$page['hits'] .
|
160 |
-
'&hitdays=365"><span>' .
|
161 |
-
number_format_i18n( wp_statistics_visit( 'total' ) ) .
|
162 |
-
'</span></a>';
|
163 |
} else {
|
164 |
echo '';
|
165 |
} ?></th>
|
@@ -244,10 +193,7 @@ function wp_statistics_generate_summary_postbox_content( $search_engines, $searc
|
|
244 |
|
245 |
<tr>
|
246 |
<th colspan="3" style="text-align: center;"><?php _e( 'Current Time and Date', 'wp-statistics' ); ?>
|
247 |
-
<span id="time_zone"><a href="<?php echo admin_url( 'options-general.php' ); ?>"><?php _e(
|
248 |
-
'(Adjustment)',
|
249 |
-
'wp-statistics'
|
250 |
-
); ?></a></span>
|
251 |
</th>
|
252 |
</tr>
|
253 |
|
1 |
<?php
|
2 |
function wp_statistics_generate_summary_postbox_content( $search_engines, $search = true, $time = true ) {
|
|
|
3 |
global $wpdb, $WP_Statistics;
|
|
|
4 |
$show_visitors = $WP_Statistics->get_option( 'visitor' );
|
5 |
?>
|
6 |
<table width="100%" class="widefat table-stats" id="summary-stats">
|
9 |
<tr>
|
10 |
<th><?php _e( 'Online Users:', 'wp-statistics' ); ?></th>
|
11 |
<th colspan="2" id="th-colspan">
|
12 |
+
<span><a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'online' ); ?>"><?php echo wp_statistics_useronline(); ?></a></span>
|
|
|
13 |
</th>
|
14 |
</tr>
|
15 |
<?php }
|
33 |
<tr>
|
34 |
<th><?php _e( 'Today:', 'wp-statistics' ); ?></th>
|
35 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
36 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'today', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
37 |
} else {
|
38 |
echo '';
|
39 |
} ?></th>
|
40 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
41 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'today' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
42 |
} else {
|
43 |
echo '';
|
44 |
} ?></th>
|
47 |
<tr>
|
48 |
<th><?php _e( 'Yesterday:', 'wp-statistics' ); ?></th>
|
49 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
50 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'yesterday', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
51 |
} else {
|
52 |
echo '';
|
53 |
} ?></th>
|
54 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
55 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 1 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'yesterday' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
56 |
} else {
|
57 |
echo '';
|
58 |
} ?></th>
|
61 |
<tr>
|
62 |
<th><?php _e( 'Last 7 Days:', 'wp-statistics' ); ?></th>
|
63 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
64 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 7 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'week', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
65 |
} else {
|
66 |
echo '';
|
67 |
} ?></th>
|
68 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
69 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 7 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'week' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
70 |
} else {
|
71 |
echo '';
|
72 |
} ?></th>
|
75 |
<tr>
|
76 |
<th><?php _e( 'Last 30 Days:', 'wp-statistics' ); ?></th>
|
77 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
78 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 30 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'month', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
79 |
} else {
|
80 |
echo '';
|
81 |
} ?></th>
|
82 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
83 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 30 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'month' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
84 |
} else {
|
85 |
echo '';
|
86 |
} ?></th>
|
89 |
<tr>
|
90 |
<th><?php _e( 'Last 365 Days:', 'wp-statistics' ); ?></th>
|
91 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
92 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'year', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
93 |
} else {
|
94 |
echo '';
|
95 |
} ?></th>
|
96 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
97 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'year' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
98 |
} else {
|
99 |
echo '';
|
100 |
} ?></th>
|
103 |
<tr>
|
104 |
<th><?php _e( 'Total:', 'wp-statistics' ); ?></th>
|
105 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
106 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visitor( 'total', null, true ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
107 |
} else {
|
108 |
echo '';
|
109 |
} ?></th>
|
110 |
<th class="th-center"><?php if ( $WP_Statistics->get_option( 'visits' ) ) {
|
111 |
+
echo '<a href="' . WP_Statistics_Admin_Pages::admin_url( 'hits', array( 'hitdays' => 365 ) ) . '"><span>' . number_format_i18n( wp_statistics_visit( 'total' ) ) . '</span></a>';
|
|
|
|
|
|
|
|
|
112 |
} else {
|
113 |
echo '';
|
114 |
} ?></th>
|
193 |
|
194 |
<tr>
|
195 |
<th colspan="3" style="text-align: center;"><?php _e( 'Current Time and Date', 'wp-statistics' ); ?>
|
196 |
+
<span id="time_zone"><a href="<?php echo admin_url( 'options-general.php' ); ?>"><?php _e( '(Adjustment)', 'wp-statistics' ); ?></a></span>
|
|
|
|
|
|
|
197 |
</th>
|
198 |
</tr>
|
199 |
|
includes/log/widgets/users_online.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function wp_statistics_generate_users_online_postbox_content( $ISOCountryCode ) {
|
3 |
+
global $wpdb, $WP_Statistics;
|
4 |
+
|
5 |
+
$result = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}statistics_useronline` ORDER BY `ID` DESC LIMIT 10" );
|
6 |
+
$i = 0;
|
7 |
+
if ( count( $result ) > 0 ) {
|
8 |
+
|
9 |
+
?>
|
10 |
+
<table width="100%" class="widefat table-stats" id="current_page">
|
11 |
+
<tr>
|
12 |
+
<td width="10%" style='text-align: left'><?php _e( 'Country', 'wp-statistics' ); ?></td>
|
13 |
+
<td width="10%" style='text-align: left'><?php _e( 'IP', 'wp-statistics' ); ?></td>
|
14 |
+
<td width="40%" style='text-align: left'><?php _e( 'Page', 'wp-statistics' ); ?></td>
|
15 |
+
<td width="40%" style='text-align: left'><?php _e( 'Referrer', 'wp-statistics' ); ?></td>
|
16 |
+
</tr>
|
17 |
+
<?php
|
18 |
+
foreach ( $result as $item ) {
|
19 |
+
$i ++;
|
20 |
+
|
21 |
+
//Get current Location info
|
22 |
+
$item->location = strtoupper( $item->location );
|
23 |
+
|
24 |
+
//Get current Page info
|
25 |
+
$page_info = wp_statistics_get_page_info( $item->page_id, $item->type );
|
26 |
+
|
27 |
+
echo "<tr>";
|
28 |
+
echo "<td style='text-align: left'><img src='" . plugins_url( 'wp-statistics/assets/images/flags/' . $item->location . '.png' ) . "' title='{$ISOCountryCode[$item->location]}'/></td>";
|
29 |
+
echo "<td style='text-align: left !important'>{$item->ip}</td>";
|
30 |
+
echo "<td style='text-align: left !important'>" . ( $page_info['link'] != '' ? '<a href="' . $page_info['link'] . '" target="_blank">' : '' ) . mb_substr( $page_info['title'], 0, 200, "utf-8" ) . ( $page_info['link'] != '' ? '</a>' : '' ) . "</td>";
|
31 |
+
echo "<td style='text-align: left !important'>" . $WP_Statistics->get_referrer_link( $item->referred ) . "</td>";
|
32 |
+
echo "</tr>";
|
33 |
+
}
|
34 |
+
|
35 |
+
echo '</table>';
|
36 |
+
|
37 |
+
} else {
|
38 |
+
_e( "no online users yet.", 'wp-statistics' );
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
includes/log/widgets/words.php
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
<?php
|
2 |
function wp_statistics_generate_words_postbox_content( $ISOCountryCode, $count = 10 ) {
|
3 |
-
|
4 |
global $wpdb, $WP_Statistics;
|
5 |
|
6 |
// Retrieve MySQL data for the search words.
|
@@ -60,18 +59,14 @@ function wp_statistics_generate_words_postbox_content( $ISOCountryCode, $count =
|
|
60 |
}
|
61 |
|
62 |
echo "<tr>";
|
63 |
-
echo "<td style=\"text-align: left\">";
|
64 |
-
echo $words;
|
65 |
-
echo "</td>";
|
66 |
echo "<td style=\"text-align: left\">";
|
67 |
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false ) {
|
68 |
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
69 |
} else {
|
70 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
71 |
}
|
72 |
-
echo "<a href='
|
73 |
-
WP_Statistics::$page['overview'] .
|
74 |
-
"&type=last-all-visitor&agent={$items->agent}'>{$agent}</a>";
|
75 |
echo "</td>";
|
76 |
$city = '';
|
77 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
@@ -109,7 +104,7 @@ function wp_statistics_generate_words_postbox_content( $ISOCountryCode, $count =
|
|
109 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
110 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
111 |
} else {
|
112 |
-
$ip_string = "<a href='
|
113 |
}
|
114 |
echo $ip_string;
|
115 |
echo "</td>";
|
1 |
<?php
|
2 |
function wp_statistics_generate_words_postbox_content( $ISOCountryCode, $count = 10 ) {
|
|
|
3 |
global $wpdb, $WP_Statistics;
|
4 |
|
5 |
// Retrieve MySQL data for the search words.
|
59 |
}
|
60 |
|
61 |
echo "<tr>";
|
62 |
+
echo "<td style=\"text-align: left\"><span title='{$words}' class='wps-cursor-default wps-text-wrap'>".$words."</span></td>";
|
|
|
|
|
63 |
echo "<td style=\"text-align: left\">";
|
64 |
if ( array_search( strtolower( $items->agent ), wp_statistics_get_browser_list( 'key' ) ) !== false ) {
|
65 |
$agent = "<img src='" . plugins_url( 'wp-statistics/assets/images/' ) . $items->agent . ".png' class='log-tools' title='{$items->agent}'/>";
|
66 |
} else {
|
67 |
$agent = wp_statistics_icons( 'dashicons-editor-help', 'unknown' );
|
68 |
}
|
69 |
+
echo "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'overview', array( 'type' => 'last-all-visitor', 'agent' => $items->agent ) ) . "'>{$agent}</a>";
|
|
|
|
|
70 |
echo "</td>";
|
71 |
$city = '';
|
72 |
if ( $WP_Statistics->get_option( 'geoip_city' ) ) {
|
104 |
if ( substr( $items->ip, 0, 6 ) == '#hash#' ) {
|
105 |
$ip_string = __( '#hash#', 'wp-statistics' );
|
106 |
} else {
|
107 |
+
$ip_string = "<a href='" . WP_Statistics_Admin_Pages::admin_url( 'visitors', array( 'type' => 'last-all-visitor', 'ip' => $items->ip ) ) . "'>{$items->ip}</a>";
|
108 |
}
|
109 |
echo $ip_string;
|
110 |
echo "</td>";
|
includes/optimization/tabs/wps-optimization-database.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<div class="wrap">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
<tr valign="top">
|
@@ -11,14 +11,8 @@
|
|
11 |
</th>
|
12 |
|
13 |
<td>
|
14 |
-
<input id="install-submit" class="button button-primary" type="button"
|
15 |
-
|
16 |
-
onclick="location.href=document.URL+'&install=1&tab=database'">
|
17 |
-
|
18 |
-
<p class="description"><?php _e(
|
19 |
-
'If for some reason your installation of WP Statistics is missing the database tables or other core items, this will re-execute the install process.',
|
20 |
-
'wp-statistics'
|
21 |
-
); ?></p>
|
22 |
</td>
|
23 |
</tr>
|
24 |
|
@@ -47,41 +41,15 @@
|
|
47 |
if ( $result != 5 ) {
|
48 |
$dbupdates['date_ip_agent'] = true;
|
49 |
?>
|
50 |
-
<input id="index-submit" class="button button-primary" type="button"
|
51 |
-
|
52 |
-
|
53 |
-
<p class="description"><?php echo __(
|
54 |
-
'Older installs of WP Statistics allow for duplicate entries in the visitors table in a corner case.',
|
55 |
-
'wp-statistics'
|
56 |
-
) . ' ' . __(
|
57 |
-
'Newer installs protect against this with a unique index on the table.',
|
58 |
-
'wp-statistics'
|
59 |
-
) . ' ' . __(
|
60 |
-
'To create the index on the older installs duplicate entries must be deleted first.',
|
61 |
-
'wp-statistics'
|
62 |
-
) . ' ' . __(
|
63 |
-
'Clicking "Update Now" will scan the vistitors table, delete duplicate entries and add the index.',
|
64 |
-
'wp-statistics'
|
65 |
-
); ?></p>
|
66 |
-
<p class="description"><?php _e(
|
67 |
-
'This operation could take a long time on installs with many rows in the visitors table.',
|
68 |
-
'wp-statistics'
|
69 |
-
); ?></p>
|
70 |
<?php
|
71 |
} else {
|
72 |
$dbupdates['date_ip_agent'] = false;
|
73 |
?>
|
74 |
-
<p class="description"><?php echo __(
|
75 |
-
|
76 |
-
'wp-statistics'
|
77 |
-
) . ' ' . __(
|
78 |
-
'Newer installs protect against this with a unique index on the table.',
|
79 |
-
'wp-statistics'
|
80 |
-
); ?></p>
|
81 |
-
<p class="description"><?php _e(
|
82 |
-
'Congratulations, your installation is already up to date, nothing to do.',
|
83 |
-
'wp-statistics'
|
84 |
-
); ?></p>
|
85 |
<?php
|
86 |
}
|
87 |
?>
|
@@ -104,41 +72,15 @@
|
|
104 |
if ( $result != 1 ) {
|
105 |
$dbupdates['unique_date'] = true;
|
106 |
?>
|
107 |
-
<input id="visits-submit" class="button button-primary" type="button"
|
108 |
-
|
109 |
-
|
110 |
-
<p class="description"><?php echo __(
|
111 |
-
'Older installs of WP Statistics allow for duplicate entries in the visits table in a corner case.',
|
112 |
-
'wp-statistics'
|
113 |
-
) . ' ' . __(
|
114 |
-
'Newer installs protect against this with a unique index on the table.',
|
115 |
-
'wp-statistics'
|
116 |
-
) . ' ' . __(
|
117 |
-
'To create the index on the older installs duplicate entries must be deleted first.',
|
118 |
-
'wp-statistics'
|
119 |
-
) . ' ' . __(
|
120 |
-
'Clicking "Update Now" will scan the vistits table, delete duplicate entries and add the index.',
|
121 |
-
'wp-statistics'
|
122 |
-
); ?></p>
|
123 |
-
<p class="description"><?php _e(
|
124 |
-
'This operation could take a long time on installs with many rows in the visits table.',
|
125 |
-
'wp-statistics'
|
126 |
-
); ?></p>
|
127 |
<?php
|
128 |
} else {
|
129 |
$dbupdates['unique_date'] = false;
|
130 |
?>
|
131 |
-
<p class="description"><?php echo __(
|
132 |
-
|
133 |
-
'wp-statistics'
|
134 |
-
) . ' ' . __(
|
135 |
-
'Newer installs protect against this with a unique index on the table.',
|
136 |
-
'wp-statistics'
|
137 |
-
); ?></p>
|
138 |
-
<p class="description"><?php _e(
|
139 |
-
'Congratulations, your installation is already up to date, nothing to do.',
|
140 |
-
'wp-statistics'
|
141 |
-
); ?></p>
|
142 |
<?php
|
143 |
}
|
144 |
|
@@ -161,34 +103,14 @@
|
|
161 |
// Note, the result will be the number of fields contained in the index, so in our case 1.
|
162 |
if ( $WP_Statistics->get_option( 'search_converted' ) != 1 ) {
|
163 |
?>
|
164 |
-
<input id="visits-submit" class="button button-primary" type="button"
|
165 |
-
|
166 |
-
|
167 |
-
<p class="description"><?php echo __(
|
168 |
-
'Older installs of WP Statistics store details of searches in the visitors table which can become a performance issue on large datasets.',
|
169 |
-
'wp-statistics'
|
170 |
-
) . ' ' . __(
|
171 |
-
'A new table has been created to hold this information in a more scalable fashion, however the old data must first be converted to the new format before it can be used.',
|
172 |
-
'wp-statistics'
|
173 |
-
); ?></p>
|
174 |
-
<p class="description"><?php _e(
|
175 |
-
'This operation could take a long time on installs with many rows in the visitors table.',
|
176 |
-
'wp-statistics'
|
177 |
-
); ?></p>
|
178 |
<?php
|
179 |
} else {
|
180 |
?>
|
181 |
-
<p class="description"><?php echo __(
|
182 |
-
|
183 |
-
'wp-statistics'
|
184 |
-
) . ' ' . __(
|
185 |
-
'A new table has been created to hold this information in a more scalable fashion.',
|
186 |
-
'wp-statistics'
|
187 |
-
); ?></p>
|
188 |
-
<p class="description"><?php _e(
|
189 |
-
'Congratulations, your installation is already up to date, nothing to do.',
|
190 |
-
'wp-statistics'
|
191 |
-
); ?></p>
|
192 |
<?php
|
193 |
}
|
194 |
?>
|
1 |
+
<div class="wrap wps-wrap">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
<tr valign="top">
|
11 |
</th>
|
12 |
|
13 |
<td>
|
14 |
+
<input id="install-submit" class="button button-primary" type="button" value="<?php _e( 'Install Now!', 'wp-statistics' ); ?>" name="install-submit" onclick="location.href=document.URL+'&install=1&tab=database'">
|
15 |
+
<p class="description"><?php _e( 'If for some reason your installation of WP Statistics is missing the database tables or other core items, this will re-execute the install process.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
</td>
|
17 |
</tr>
|
18 |
|
41 |
if ( $result != 5 ) {
|
42 |
$dbupdates['date_ip_agent'] = true;
|
43 |
?>
|
44 |
+
<input id="index-submit" class="button button-primary" type="button" value="<?php _e( 'Update Now!', 'wp-statistics' ); ?>" name="index-submit" onclick="location.href=document.URL+'&index=1&tab=database'">
|
45 |
+
<p class="description"><?php echo __( 'Older installs of WP Statistics allow for duplicate entries in the visitors table in a corner case.', 'wp-statistics' ) . ' ' . __( 'Newer installs protect against this with a unique index on the table.', 'wp-statistics' ) . ' ' . __( 'To create the index on the older installs duplicate entries must be deleted first.', 'wp-statistics' ) . ' ' . __( 'Clicking "Update Now" will scan the vistitors table, delete duplicate entries and add the index.', 'wp-statistics' ); ?></p>
|
46 |
+
<p class="description"><?php _e( 'This operation could take a long time on installs with many rows in the visitors table.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
<?php
|
48 |
} else {
|
49 |
$dbupdates['date_ip_agent'] = false;
|
50 |
?>
|
51 |
+
<p class="description"><?php echo __( 'Older installs of WP Statistics allow for duplicate entries in the visitors table in a corner case.', 'wp-statistics' ) . ' ' . __( 'Newer installs protect against this with a unique index on the table.', 'wp-statistics' ); ?></p>
|
52 |
+
<p class="description"><?php _e( 'Congratulations, your installation is already up to date, nothing to do.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
<?php
|
54 |
}
|
55 |
?>
|
72 |
if ( $result != 1 ) {
|
73 |
$dbupdates['unique_date'] = true;
|
74 |
?>
|
75 |
+
<input id="visits-submit" class="button button-primary" type="button" value="<?php _e( 'Update Now!', 'wp-statistics' ); ?>" name="visit-submit" onclick="location.href=document.URL+'&visits=1&tab=database'">
|
76 |
+
<p class="description"><?php echo __( 'Older installs of WP Statistics allow for duplicate entries in the visits table in a corner case.', 'wp-statistics' ) . ' ' . __( 'Newer installs protect against this with a unique index on the table.', 'wp-statistics' ) . ' ' . __( 'To create the index on the older installs duplicate entries must be deleted first.', 'wp-statistics' ) . ' ' . __( 'Clicking "Update Now" will scan the vistits table, delete duplicate entries and add the index.', 'wp-statistics' ); ?></p>
|
77 |
+
<p class="description"><?php _e( 'This operation could take a long time on installs with many rows in the visits table.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<?php
|
79 |
} else {
|
80 |
$dbupdates['unique_date'] = false;
|
81 |
?>
|
82 |
+
<p class="description"><?php echo __( 'Older installs of WP Statistics allow for duplicate entries in the visits table in a corner case.', 'wp-statistics' ) . ' ' . __( 'Newer installs protect against this with a unique index on the table.', 'wp-statistics' ); ?></p>
|
83 |
+
<p class="description"><?php _e( 'Congratulations, your installation is already up to date, nothing to do.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
<?php
|
85 |
}
|
86 |
|
103 |
// Note, the result will be the number of fields contained in the index, so in our case 1.
|
104 |
if ( $WP_Statistics->get_option( 'search_converted' ) != 1 ) {
|
105 |
?>
|
106 |
+
<input id="visits-submit" class="button button-primary" type="button" value="<?php _e( 'Convert Now!', 'wp-statistics' ); ?>" name="search-submit" onclick="location.href=document.URL+'&search=1&tab=database'">
|
107 |
+
<p class="description"><?php echo __( 'Older installs of WP Statistics store details of searches in the visitors table which can become a performance issue on large datasets.', 'wp-statistics' ) . ' ' . __( 'A new table has been created to hold this information in a more scalable fashion, however the old data must first be converted to the new format before it can be used.', 'wp-statistics' ); ?></p>
|
108 |
+
<p class="description"><?php _e( 'This operation could take a long time on installs with many rows in the visitors table.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
<?php
|
110 |
} else {
|
111 |
?>
|
112 |
+
<p class="description"><?php echo __( 'Older installs of WP Statistics store details of searches in the visitors table which can become a performance issue on large datasets.', 'wp-statistics' ) . ' ' . __( 'A new table has been created to hold this information in a more scalable fashion.', 'wp-statistics' ); ?></p>
|
113 |
+
<p class="description"><?php _e( 'Congratulations, your installation is already up to date, nothing to do.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
<?php
|
115 |
}
|
116 |
?>
|
includes/optimization/tabs/wps-optimization-export.php
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
<div class="wrap">
|
2 |
|
3 |
<form method="post">
|
4 |
<input type="hidden" name="wps_export" value="true">
|
|
|
5 |
<table class="form-table">
|
6 |
<tbody>
|
7 |
<tr valign="top">
|
@@ -16,6 +17,11 @@
|
|
16 |
<td>
|
17 |
<select dir="ltr" id="table-to-export" name="table-to-export" required>
|
18 |
<option value=""><?php _e( 'Please select', 'wp-statistics' ); ?></option>
|
|
|
|
|
|
|
|
|
|
|
19 |
<option value="useronline"><?php echo $wpdb->prefix . 'statistics_useronline'; ?></option>
|
20 |
<option value="visit"><?php echo $wpdb->prefix . 'statistics_visit'; ?></option>
|
21 |
<option value="visitor"><?php echo $wpdb->prefix . 'statistics_visitor'; ?></option>
|
@@ -52,11 +58,7 @@
|
|
52 |
|
53 |
<td>
|
54 |
<input id="export-headers" type="checkbox" value="1" name="export-headers">
|
55 |
-
|
56 |
-
<p class="description"><?php _e(
|
57 |
-
'Include a header row as the first line of the exported file.',
|
58 |
-
'wp-statistics'
|
59 |
-
); ?></p>
|
60 |
<?php submit_button( __( 'Start Now!', 'wp-statistics' ), 'primary', 'export-file-submit' ); ?>
|
61 |
</td>
|
62 |
</tr>
|
1 |
+
<div class="wrap wps-wrap">
|
2 |
|
3 |
<form method="post">
|
4 |
<input type="hidden" name="wps_export" value="true">
|
5 |
+
<?php wp_nonce_field( 'wp_statistics_export_nonce', 'wps_export_file' ); ?>
|
6 |
<table class="form-table">
|
7 |
<tbody>
|
8 |
<tr valign="top">
|
17 |
<td>
|
18 |
<select dir="ltr" id="table-to-export" name="table-to-export" required>
|
19 |
<option value=""><?php _e( 'Please select', 'wp-statistics' ); ?></option>
|
20 |
+
<?php
|
21 |
+
foreach ( wp_statistics_db_table( 'all', array( 'historical', 'visitor_relationships' ) ) as $tbl_key => $tbl_name ) {
|
22 |
+
echo '<option value="' . $tbl_key . '">' . $tbl_name . '</option>';
|
23 |
+
}
|
24 |
+
?>
|
25 |
<option value="useronline"><?php echo $wpdb->prefix . 'statistics_useronline'; ?></option>
|
26 |
<option value="visit"><?php echo $wpdb->prefix . 'statistics_visit'; ?></option>
|
27 |
<option value="visitor"><?php echo $wpdb->prefix . 'statistics_visitor'; ?></option>
|
58 |
|
59 |
<td>
|
60 |
<input id="export-headers" type="checkbox" value="1" name="export-headers">
|
61 |
+
<p class="description"><?php _e( 'Include a header row as the first line of the exported file.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
62 |
<?php submit_button( __( 'Start Now!', 'wp-statistics' ), 'primary', 'export-file-submit' ); ?>
|
63 |
</td>
|
64 |
</tr>
|
includes/optimization/tabs/wps-optimization-historical.php
CHANGED
@@ -6,7 +6,7 @@ $historical_visitors = $WP_Statistics->Get_Historical_Data( 'visitors' );
|
|
6 |
$historical_visits = $WP_Statistics->Get_Historical_Data( 'visits' );
|
7 |
|
8 |
?>
|
9 |
-
<div class="wrap">
|
10 |
<form id="wps_historical_form" method="post">
|
11 |
<?php wp_nonce_field( 'historical_form', 'wp-statistics-nonce' ); ?>
|
12 |
<table class="form-table">
|
6 |
$historical_visits = $WP_Statistics->Get_Historical_Data( 'visits' );
|
7 |
|
8 |
?>
|
9 |
+
<div class="wrap wps-wrap">
|
10 |
<form id="wps_historical_form" method="post">
|
11 |
<?php wp_nonce_field( 'historical_form', 'wp-statistics-nonce' ); ?>
|
12 |
<table class="form-table">
|
includes/optimization/tabs/wps-optimization-purging.php
CHANGED
@@ -206,7 +206,7 @@
|
|
206 |
});
|
207 |
</script>
|
208 |
|
209 |
-
<div class="wrap">
|
210 |
<table class="form-table">
|
211 |
<tbody>
|
212 |
<tr valign="top">
|
@@ -221,19 +221,16 @@
|
|
221 |
<td>
|
222 |
<select dir="ltr" id="empty-table" name="empty-table">
|
223 |
<option value="0"><?php _e( 'Please select', 'wp-statistics' ); ?></option>
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
<option value="search"><?php echo $wpdb->prefix . 'statistics_search'; ?></option>
|
230 |
<option value="all"><?php echo __( 'All', 'wp-statistics' ); ?></option>
|
231 |
</select>
|
232 |
|
233 |
<p class="description"><?php _e( 'All data table will be lost.', 'wp-statistics' ); ?></p>
|
234 |
-
<input id="empty-table-submit" class="button button-primary" type="submit"
|
235 |
-
value="<?php _e( 'Clear now!', 'wp-statistics' ); ?>" name="empty-table-submit"
|
236 |
-
Onclick="return false;"/>
|
237 |
<span id="empty-status"></span>
|
238 |
<div id="empty-result"></div>
|
239 |
</td>
|
@@ -248,16 +245,8 @@
|
|
248 |
<input type="text" class="small-text code" id="purge-data" name="wps_purge_data" value="365"/>
|
249 |
<label for="purge-data"><?php _e( 'Days', 'wp-statistics' ); ?></label>
|
250 |
|
251 |
-
<p class="description"><?php echo __(
|
252 |
-
|
253 |
-
'wp-statistics'
|
254 |
-
) . ' ' . __(
|
255 |
-
'Minimum value is 30 days.',
|
256 |
-
'wp-statistics'
|
257 |
-
); ?></p>
|
258 |
-
<input id="purge-data-submit" class="button button-primary" type="submit"
|
259 |
-
value="<?php _e( 'Purge now!', 'wp-statistics' ); ?>" name="purge-data-submit"
|
260 |
-
Onclick="return false;"/>
|
261 |
<span id="purge-data-status"></span>
|
262 |
<div id="purge-data-result"></div>
|
263 |
</td>
|
@@ -269,26 +258,11 @@
|
|
269 |
</th>
|
270 |
|
271 |
<td>
|
272 |
-
<input type="text" class="small-text code" id="purge-visitor-hits" name="wps_purge_visitor_hits"
|
273 |
-
value="10"/>
|
274 |
<label for="purge-visitor-hits"><?php _e( 'Hits', 'wp-statistics' ); ?></label>
|
275 |
|
276 |
-
<p class="description"><?php echo __(
|
277 |
-
|
278 |
-
'wp-statistics'
|
279 |
-
) . ' ' . __(
|
280 |
-
'This can be useful to clear up old data when your site has been hit by a bot.',
|
281 |
-
'wp-statistics'
|
282 |
-
) . ' ' . __(
|
283 |
-
'This will remove the visitor and their hits to the site, however it will not remove individual page hits as that data is not recorded on a per use basis.',
|
284 |
-
'wp-statistics'
|
285 |
-
) . ' ' . __(
|
286 |
-
'Minimum value is 10 hits.',
|
287 |
-
'wp-statistics'
|
288 |
-
); ?></p>
|
289 |
-
<input id="purge-visitor-hits-submit" class="button button-primary" type="submit"
|
290 |
-
value="<?php _e( 'Purge now!', 'wp-statistics' ); ?>" name="purge-visitor-hits-submit"
|
291 |
-
Onclick="return false;"/>
|
292 |
<span id="purge-visitor-hits-status"></span>
|
293 |
<div id="purge-visitor-hits-result"></div>
|
294 |
</td>
|
@@ -316,13 +290,8 @@
|
|
316 |
?>
|
317 |
</select>
|
318 |
|
319 |
-
<p class="description"><?php _e(
|
320 |
-
|
321 |
-
'wp-statistics'
|
322 |
-
); ?></p>
|
323 |
-
<input id="delete-agents-submit" class="button button-primary" type="submit"
|
324 |
-
value="<?php _e( 'Delete now!', 'wp-statistics' ); ?>" name="delete-agents-submit"
|
325 |
-
Onclick="return false;">
|
326 |
<span id="delete-agents-status"></span>
|
327 |
<div id="delete-agents-result"></div>
|
328 |
</td>
|
@@ -336,23 +305,18 @@
|
|
336 |
<td>
|
337 |
<select dir="ltr" id="delete-platform" name="delete-platform">
|
338 |
<option value="0"><?php _e( 'Please select', 'wp-statistics' ); ?></option>
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
</select>
|
348 |
|
349 |
-
<p class="description"><?php _e(
|
350 |
-
|
351 |
-
'wp-statistics'
|
352 |
-
); ?></p>
|
353 |
-
<input id="delete-platforms-submit" class="button button-primary" type="submit"
|
354 |
-
value="<?php _e( 'Delete now!', 'wp-statistics' ); ?>" name="delete-platforms-submit"
|
355 |
-
Onclick="return false;">
|
356 |
<span id="delete-platforms-status"></span>
|
357 |
<div id="delete-platforms-result"></div>
|
358 |
</td>
|
@@ -366,13 +330,8 @@
|
|
366 |
<td>
|
367 |
<input dir="ltr" id="delete-ip" type="text" name="delete-ip"/>
|
368 |
|
369 |
-
<p class="description"><?php _e(
|
370 |
-
|
371 |
-
'wp-statistics'
|
372 |
-
); ?></p>
|
373 |
-
<input id="delete-ip-submit" class="button button-primary" type="submit"
|
374 |
-
value="<?php _e( 'Delete now!', 'wp-statistics' ); ?>" name="delete-ip-submit"
|
375 |
-
Onclick="return false;">
|
376 |
<span id="delete-ip-status"></span>
|
377 |
<div id="delete-ip-result"></div>
|
378 |
</td>
|
206 |
});
|
207 |
</script>
|
208 |
|
209 |
+
<div class="wrap wps-wrap">
|
210 |
<table class="form-table">
|
211 |
<tbody>
|
212 |
<tr valign="top">
|
221 |
<td>
|
222 |
<select dir="ltr" id="empty-table" name="empty-table">
|
223 |
<option value="0"><?php _e( 'Please select', 'wp-statistics' ); ?></option>
|
224 |
+
<?php
|
225 |
+
foreach ( wp_statistics_db_table( 'all', 'historical' ) as $tbl_key => $tbl_name ) {
|
226 |
+
echo '<option value="' . $tbl_key . '">' . $tbl_name . '</option>';
|
227 |
+
}
|
228 |
+
?>
|
|
|
229 |
<option value="all"><?php echo __( 'All', 'wp-statistics' ); ?></option>
|
230 |
</select>
|
231 |
|
232 |
<p class="description"><?php _e( 'All data table will be lost.', 'wp-statistics' ); ?></p>
|
233 |
+
<input id="empty-table-submit" class="button button-primary" type="submit" value="<?php _e( 'Clear now!', 'wp-statistics' ); ?>" name="empty-table-submit" Onclick="return false;"/>
|
|
|
|
|
234 |
<span id="empty-status"></span>
|
235 |
<div id="empty-result"></div>
|
236 |
</td>
|
245 |
<input type="text" class="small-text code" id="purge-data" name="wps_purge_data" value="365"/>
|
246 |
<label for="purge-data"><?php _e( 'Days', 'wp-statistics' ); ?></label>
|
247 |
|
248 |
+
<p class="description"><?php echo __( 'Delete user statistics data older than the selected number of days.', 'wp-statistics' ) . ' ' . __( 'Minimum value is 30 days.', 'wp-statistics' ); ?></p>
|
249 |
+
<input id="purge-data-submit" class="button button-primary" type="submit" value="<?php _e( 'Purge now!', 'wp-statistics' ); ?>" name="purge-data-submit" Onclick="return false;"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
<span id="purge-data-status"></span>
|
251 |
<div id="purge-data-result"></div>
|
252 |
</td>
|
258 |
</th>
|
259 |
|
260 |
<td>
|
261 |
+
<input type="text" class="small-text code" id="purge-visitor-hits" name="wps_purge_visitor_hits" value="10"/>
|
|
|
262 |
<label for="purge-visitor-hits"><?php _e( 'Hits', 'wp-statistics' ); ?></label>
|
263 |
|
264 |
+
<p class="description"><?php echo __( 'Delete user statistics data where the user has more than the defined number of hits in a day.', 'wp-statistics' ) . ' ' . __( 'This can be useful to clear up old data when your site has been hit by a bot.', 'wp-statistics' ) . ' ' . __( 'This will remove the visitor and their hits to the site, however it will not remove individual page hits as that data is not recorded on a per use basis.', 'wp-statistics' ) . ' ' . __( 'Minimum value is 10 hits.', 'wp-statistics' ); ?></p>
|
265 |
+
<input id="purge-visitor-hits-submit" class="button button-primary" type="submit" value="<?php _e( 'Purge now!', 'wp-statistics' ); ?>" name="purge-visitor-hits-submit" Onclick="return false;"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
<span id="purge-visitor-hits-status"></span>
|
267 |
<div id="purge-visitor-hits-result"></div>
|
268 |
</td>
|
290 |
?>
|
291 |
</select>
|
292 |
|
293 |
+
<p class="description"><?php _e( 'All visitor data will be lost for this agent type.', 'wp-statistics' ); ?></p>
|
294 |
+
<input id="delete-agents-submit" class="button button-primary" type="submit" value="<?php _e( 'Delete now!', 'wp-statistics' ); ?>" name="delete-agents-submit" Onclick="return false;">
|
|
|
|
|
|
|
|
|
|
|
295 |
<span id="delete-agents-status"></span>
|
296 |
<div id="delete-agents-result"></div>
|
297 |
</td>
|
305 |
<td>
|
306 |
<select dir="ltr" id="delete-platform" name="delete-platform">
|
307 |
<option value="0"><?php _e( 'Please select', 'wp-statistics' ); ?></option>
|
308 |
+
<?php
|
309 |
+
$platforms = wp_statistics_platform_list();
|
310 |
+
|
311 |
+
foreach ( $platforms as $platform ) {
|
312 |
+
$pid = preg_replace( "/[^a-zA-Z]/", "", $platform );
|
313 |
+
echo "<option value='$platform' id='platform-" . $pid . "-id'>" . $platform . "</option>";
|
314 |
+
}
|
315 |
+
?>
|
316 |
</select>
|
317 |
|
318 |
+
<p class="description"><?php _e( 'All visitor data will be lost for this platform type.', 'wp-statistics' ); ?></p>
|
319 |
+
<input id="delete-platforms-submit" class="button button-primary" type="submit" value="<?php _e( 'Delete now!', 'wp-statistics' ); ?>" name="delete-platforms-submit" Onclick="return false;">
|
|
|
|
|
|
|
|
|
|
|
320 |
<span id="delete-platforms-status"></span>
|
321 |
<div id="delete-platforms-result"></div>
|
322 |
</td>
|
330 |
<td>
|
331 |
<input dir="ltr" id="delete-ip" type="text" name="delete-ip"/>
|
332 |
|
333 |
+
<p class="description"><?php _e( 'All visitor data will be lost for this IP.', 'wp-statistics' ); ?></p>
|
334 |
+
<input id="delete-ip-submit" class="button button-primary" type="submit" value="<?php _e( 'Delete now!', 'wp-statistics' ); ?>" name="delete-ip-submit" Onclick="return false;">
|
|
|
|
|
|
|
|
|
|
|
335 |
<span id="delete-ip-status"></span>
|
336 |
<div id="delete-ip-result"></div>
|
337 |
</td>
|
includes/optimization/tabs/wps-optimization-resources.php
CHANGED
@@ -1,26 +1,4 @@
|
|
1 |
-
|
2 |
-
/* format size of file
|
3 |
-
* @author Mike Zriel
|
4 |
-
* @date 7 March 2011
|
5 |
-
* @website www.zriel.com
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* @param $size
|
10 |
-
*
|
11 |
-
* @return string
|
12 |
-
*/
|
13 |
-
function formatSize( $size ) {
|
14 |
-
$sizes = array( " Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB" );
|
15 |
-
if ( $size == 0 ) {
|
16 |
-
return ( 'n/a' );
|
17 |
-
} else {
|
18 |
-
return ( round( $size / pow( 1024, ( $i = floor( log( $size, 1024 ) ) ) ), 2 ) . $sizes[ $i ] );
|
19 |
-
}
|
20 |
-
}
|
21 |
-
|
22 |
-
?>
|
23 |
-
<div class="wrap">
|
24 |
<table class="form-table">
|
25 |
<tbody>
|
26 |
<tr valign="top">
|
@@ -33,10 +11,7 @@ function formatSize( $size ) {
|
|
33 |
</th>
|
34 |
|
35 |
<td>
|
36 |
-
<strong><?php echo number_format_i18n( memory_get_usage() ); ?></strong> <?php _e(
|
37 |
-
'Bytes',
|
38 |
-
'wp-statistics'
|
39 |
-
); ?>
|
40 |
<p class="description"><?php _e( 'Memory usage in PHP', 'wp-statistics' ); ?></p>
|
41 |
</td>
|
42 |
</tr>
|
@@ -48,167 +23,26 @@ function formatSize( $size ) {
|
|
48 |
|
49 |
<td>
|
50 |
<strong><?php echo ini_get( 'memory_limit' ); ?></strong>
|
51 |
-
|
52 |
-
<p class="description"><?php _e(
|
53 |
-
'The memory limit a script is allowed to consume, set in php.ini.',
|
54 |
-
'wp-statistics'
|
55 |
-
); ?></p>
|
56 |
-
</td>
|
57 |
-
</tr>
|
58 |
-
|
59 |
-
<tr valign="top">
|
60 |
-
<th scope="row">
|
61 |
-
<?php echo sprintf(
|
62 |
-
__( 'Number of rows in the %s table', 'wp-statistics' ),
|
63 |
-
'<code>' . $wpdb->prefix . 'statistics_' . 'useronline' . '</code>'
|
64 |
-
); ?>
|
65 |
-
:
|
66 |
-
</th>
|
67 |
-
|
68 |
-
<td>
|
69 |
-
<strong><?php echo number_format_i18n( $result['useronline'] ); ?></strong> <?php echo _n(
|
70 |
-
'Row',
|
71 |
-
'Rows',
|
72 |
-
number_format_i18n(
|
73 |
-
$result['useronline']
|
74 |
-
),
|
75 |
-
'wp-statistics'
|
76 |
-
); ?>
|
77 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
78 |
-
</td>
|
79 |
-
</tr>
|
80 |
-
|
81 |
-
<tr valign="top">
|
82 |
-
<th scope="row">
|
83 |
-
<?php echo sprintf(
|
84 |
-
__( 'Number of rows in the %s table', 'wp-statistics' ),
|
85 |
-
'<code>' . $wpdb->prefix . 'statistics_' . 'visit' . '</code>'
|
86 |
-
); ?>
|
87 |
-
:
|
88 |
-
</th>
|
89 |
-
|
90 |
-
<td>
|
91 |
-
<strong><?php echo number_format_i18n( $result['visit'] ); ?></strong> <?php echo _n(
|
92 |
-
'Row',
|
93 |
-
'Rows',
|
94 |
-
number_format_i18n(
|
95 |
-
$result['visit']
|
96 |
-
),
|
97 |
-
'wp-statistics'
|
98 |
-
); ?>
|
99 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
100 |
-
</td>
|
101 |
-
</tr>
|
102 |
-
|
103 |
-
<tr valign="top">
|
104 |
-
<th scope="row">
|
105 |
-
<?php echo sprintf(
|
106 |
-
__( 'Number of rows in the %s table', 'wp-statistics' ),
|
107 |
-
'<code>' . $wpdb->prefix . 'statistics_' . 'visitor' . '</code>'
|
108 |
-
); ?>
|
109 |
-
:
|
110 |
-
</th>
|
111 |
-
|
112 |
-
<td>
|
113 |
-
<strong><?php echo number_format_i18n( $result['visitor'] ); ?></strong> <?php echo _n(
|
114 |
-
'Row',
|
115 |
-
'Rows',
|
116 |
-
number_format_i18n(
|
117 |
-
$result['visitor']
|
118 |
-
),
|
119 |
-
'wp-statistics'
|
120 |
-
); ?>
|
121 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
122 |
</td>
|
123 |
</tr>
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
'wp-statistics'
|
142 |
-
); ?>
|
143 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
144 |
-
</td>
|
145 |
-
</tr>
|
146 |
-
|
147 |
-
<tr valign="top">
|
148 |
-
<th scope="row">
|
149 |
-
<?php echo sprintf(
|
150 |
-
__( 'Number of rows in the %s table', 'wp-statistics' ),
|
151 |
-
'<code>' . $wpdb->prefix . 'statistics_' . 'pages' . '</code>'
|
152 |
-
); ?>
|
153 |
-
:
|
154 |
-
</th>
|
155 |
-
|
156 |
-
<td>
|
157 |
-
<strong><?php echo number_format_i18n( $result['pages'] ); ?></strong> <?php echo _n(
|
158 |
-
'Row',
|
159 |
-
'Rows',
|
160 |
-
number_format_i18n(
|
161 |
-
$result['pages']
|
162 |
-
),
|
163 |
-
'wp-statistics'
|
164 |
-
); ?>
|
165 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
166 |
-
</td>
|
167 |
-
</tr>
|
168 |
-
|
169 |
-
<tr valign="top">
|
170 |
-
<th scope="row">
|
171 |
-
<?php echo sprintf(
|
172 |
-
__( 'Number of rows in the %s table', 'wp-statistics' ),
|
173 |
-
'<code>' . $wpdb->prefix . 'statistics_' . 'historical' . '</code>'
|
174 |
-
); ?>
|
175 |
-
:
|
176 |
-
</th>
|
177 |
-
|
178 |
-
<td>
|
179 |
-
<strong><?php echo number_format_i18n( $result['historical'] ); ?></strong> <?php echo _n(
|
180 |
-
'Row',
|
181 |
-
'Rows',
|
182 |
-
number_format_i18n(
|
183 |
-
$result['historical']
|
184 |
-
),
|
185 |
-
'wp-statistics'
|
186 |
-
); ?>
|
187 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
188 |
-
</td>
|
189 |
-
</tr>
|
190 |
-
|
191 |
-
<tr valign="top">
|
192 |
-
<th scope="row">
|
193 |
-
<?php echo sprintf(
|
194 |
-
__( 'Number of rows in the %s table', 'wp-statistics' ),
|
195 |
-
'<code>' . $wpdb->prefix . 'statistics_' . 'search' . '</code>'
|
196 |
-
); ?>
|
197 |
-
:
|
198 |
-
</th>
|
199 |
-
|
200 |
-
<td>
|
201 |
-
<strong><?php echo number_format_i18n( $result['search'] ); ?></strong> <?php echo _n(
|
202 |
-
'Row',
|
203 |
-
'Rows',
|
204 |
-
number_format_i18n(
|
205 |
-
$result['search']
|
206 |
-
),
|
207 |
-
'wp-statistics'
|
208 |
-
); ?>
|
209 |
-
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
210 |
-
</td>
|
211 |
-
</tr>
|
212 |
|
213 |
<tr valign="top">
|
214 |
<th scope="row" colspan="2"><h3><?php _e( 'Version Info', 'wp-statistics' ); ?></h3></th>
|
@@ -221,7 +55,6 @@ function formatSize( $size ) {
|
|
221 |
|
222 |
<td>
|
223 |
<strong><?php echo WP_Statistics::$reg['version']; ?></strong>
|
224 |
-
|
225 |
<p class="description"><?php _e( 'The WP Statistics version you are running.', 'wp-statistics' ); ?></p>
|
226 |
</td>
|
227 |
</tr>
|
@@ -233,7 +66,6 @@ function formatSize( $size ) {
|
|
233 |
|
234 |
<td>
|
235 |
<strong><?php echo phpversion(); ?></strong>
|
236 |
-
|
237 |
<p class="description"><?php _e( 'The PHP version you are running.', 'wp-statistics' ); ?></p>
|
238 |
</td>
|
239 |
</tr>
|
@@ -250,10 +82,7 @@ function formatSize( $size ) {
|
|
250 |
_e( 'No', 'wp-statistics' );
|
251 |
} ?></strong>
|
252 |
|
253 |
-
<p class="description"><?php _e(
|
254 |
-
'Is PHP Safe Mode active. The GeoIP code is not supported in Safe Mode.',
|
255 |
-
'wp-statistics'
|
256 |
-
); ?></p>
|
257 |
</td>
|
258 |
</tr>
|
259 |
|
@@ -269,10 +98,7 @@ function formatSize( $size ) {
|
|
269 |
_e( 'No', 'wp-statistics' );
|
270 |
} ?></strong>
|
271 |
|
272 |
-
<p class="description"><?php _e(
|
273 |
-
'Is PHP compiled with IPv6 support. You may see warning messages in your PHP log if it is not and you receive HTTP headers with IPv6 addresses in them.',
|
274 |
-
'wp-statistics'
|
275 |
-
); ?></p>
|
276 |
</td>
|
277 |
</tr>
|
278 |
|
@@ -322,10 +148,7 @@ function formatSize( $size ) {
|
|
322 |
_e( 'Not installed', 'wp-statistics' );
|
323 |
} ?></strong>
|
324 |
|
325 |
-
<p class="description"><?php _e(
|
326 |
-
'If the gzopen() function is installed. The gzopen() function is required for the GeoIP database to be downloaded successfully.',
|
327 |
-
'wp-statistics'
|
328 |
-
); ?></p>
|
329 |
</td>
|
330 |
</tr>
|
331 |
|
@@ -341,10 +164,7 @@ function formatSize( $size ) {
|
|
341 |
_e( 'Not installed', 'wp-statistics' );
|
342 |
} ?></strong>
|
343 |
|
344 |
-
<p class="description"><?php _e(
|
345 |
-
'If the GMP Math PHP extension is loaded, either GMP or BCMath is required for the GeoIP database to be read successfully.',
|
346 |
-
'wp-statistics'
|
347 |
-
); ?></p>
|
348 |
</td>
|
349 |
</tr>
|
350 |
|
@@ -360,10 +180,7 @@ function formatSize( $size ) {
|
|
360 |
_e( 'Not installed', 'wp-statistics' );
|
361 |
} ?></strong>
|
362 |
|
363 |
-
<p class="description"><?php _e(
|
364 |
-
'If the BCMath PHP extension is loaded, either GMP or BCMath is required for the GeoIP database to be read successfully.',
|
365 |
-
'wp-statistics'
|
366 |
-
); ?></p>
|
367 |
</td>
|
368 |
</tr>
|
369 |
|
@@ -384,15 +201,10 @@ function formatSize( $size ) {
|
|
384 |
if ( $GeoIP_filedate === false ) {
|
385 |
_e( 'Database file does not exist.', 'wp-statistics' );
|
386 |
} else {
|
387 |
-
echo
|
388 |
-
__( ', created on ', 'wp-statistics' ) .
|
389 |
-
date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $GeoIP_filedate );
|
390 |
} ?></strong>
|
391 |
|
392 |
-
<p class="description"><?php _e(
|
393 |
-
'The file size and date of the GeoIP database.',
|
394 |
-
'wp-statistics'
|
395 |
-
); ?></p>
|
396 |
</td>
|
397 |
</tr>
|
398 |
|
@@ -407,7 +219,6 @@ function formatSize( $size ) {
|
|
407 |
|
408 |
<td>
|
409 |
<strong><?php echo $WP_Statistics->get_IP(); ?></strong>
|
410 |
-
|
411 |
<p class="description"><?php _e( 'The client IP address.', 'wp-statistics' ); ?></p>
|
412 |
</td>
|
413 |
</tr>
|
@@ -419,7 +230,6 @@ function formatSize( $size ) {
|
|
419 |
|
420 |
<td>
|
421 |
<strong><?php echo htmlentities( $_SERVER['HTTP_USER_AGENT'], ENT_QUOTES ); ?></strong>
|
422 |
-
|
423 |
<p class="description"><?php _e( 'The client user agent string.', 'wp-statistics' ); ?></p>
|
424 |
</td>
|
425 |
</tr>
|
@@ -445,7 +255,6 @@ function formatSize( $size ) {
|
|
445 |
|
446 |
<td>
|
447 |
<strong><?php echo $agent['version']; ?></strong>
|
448 |
-
|
449 |
<p class="description"><?php _e( 'The detected client browser version.', 'wp-statistics' ); ?></p>
|
450 |
</td>
|
451 |
</tr>
|
@@ -457,7 +266,6 @@ function formatSize( $size ) {
|
|
457 |
|
458 |
<td>
|
459 |
<strong><?php echo $agent['platform']; ?></strong>
|
460 |
-
|
461 |
<p class="description"><?php _e( 'The detected client platform.', 'wp-statistics' ); ?></p>
|
462 |
</td>
|
463 |
</tr>
|
1 |
+
<div class="wrap wps-wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
<tr valign="top">
|
11 |
</th>
|
12 |
|
13 |
<td>
|
14 |
+
<strong><?php echo number_format_i18n( memory_get_usage() ); ?></strong> <?php _e( 'Bytes', 'wp-statistics' ); ?>
|
|
|
|
|
|
|
15 |
<p class="description"><?php _e( 'Memory usage in PHP', 'wp-statistics' ); ?></p>
|
16 |
</td>
|
17 |
</tr>
|
23 |
|
24 |
<td>
|
25 |
<strong><?php echo ini_get( 'memory_limit' ); ?></strong>
|
26 |
+
<p class="description"><?php _e( 'The memory limit a script is allowed to consume, set in php.ini.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
</td>
|
28 |
</tr>
|
29 |
|
30 |
+
<?php
|
31 |
+
foreach ( $result as $table_name => $number_row ) {
|
32 |
+
?>
|
33 |
+
<tr valign="top">
|
34 |
+
<th scope="row">
|
35 |
+
<?php echo sprintf( __( 'Number of rows in the %s table', 'wp-statistics' ), '<code>' . $table_name . '</code>' ); ?>
|
36 |
+
:
|
37 |
+
</th>
|
38 |
+
<td>
|
39 |
+
<strong><?php echo number_format_i18n( $number_row ); ?></strong> <?php echo _n( 'Row', 'Rows', number_format_i18n( $number_row ), 'wp-statistics' ); ?>
|
40 |
+
<p class="description"><?php _e( 'Number of rows', 'wp-statistics' ); ?></p>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
<tr valign="top">
|
48 |
<th scope="row" colspan="2"><h3><?php _e( 'Version Info', 'wp-statistics' ); ?></h3></th>
|
55 |
|
56 |
<td>
|
57 |
<strong><?php echo WP_Statistics::$reg['version']; ?></strong>
|
|
|
58 |
<p class="description"><?php _e( 'The WP Statistics version you are running.', 'wp-statistics' ); ?></p>
|
59 |
</td>
|
60 |
</tr>
|
66 |
|
67 |
<td>
|
68 |
<strong><?php echo phpversion(); ?></strong>
|
|
|
69 |
<p class="description"><?php _e( 'The PHP version you are running.', 'wp-statistics' ); ?></p>
|
70 |
</td>
|
71 |
</tr>
|
82 |
_e( 'No', 'wp-statistics' );
|
83 |
} ?></strong>
|
84 |
|
85 |
+
<p class="description"><?php _e( 'Is PHP Safe Mode active. The GeoIP code is not supported in Safe Mode.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
86 |
</td>
|
87 |
</tr>
|
88 |
|
98 |
_e( 'No', 'wp-statistics' );
|
99 |
} ?></strong>
|
100 |
|
101 |
+
<p class="description"><?php _e( 'Is PHP compiled with IPv6 support. You may see warning messages in your PHP log if it is not and you receive HTTP headers with IPv6 addresses in them.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
102 |
</td>
|
103 |
</tr>
|
104 |
|
148 |
_e( 'Not installed', 'wp-statistics' );
|
149 |
} ?></strong>
|
150 |
|
151 |
+
<p class="description"><?php _e( 'If the gzopen() function is installed. The gzopen() function is required for the GeoIP database to be downloaded successfully.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
152 |
</td>
|
153 |
</tr>
|
154 |
|
164 |
_e( 'Not installed', 'wp-statistics' );
|
165 |
} ?></strong>
|
166 |
|
167 |
+
<p class="description"><?php _e( 'If the GMP Math PHP extension is loaded, either GMP or BCMath is required for the GeoIP database to be read successfully.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
168 |
</td>
|
169 |
</tr>
|
170 |
|
180 |
_e( 'Not installed', 'wp-statistics' );
|
181 |
} ?></strong>
|
182 |
|
183 |
+
<p class="description"><?php _e( 'If the BCMath PHP extension is loaded, either GMP or BCMath is required for the GeoIP database to be read successfully.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
184 |
</td>
|
185 |
</tr>
|
186 |
|
201 |
if ( $GeoIP_filedate === false ) {
|
202 |
_e( 'Database file does not exist.', 'wp-statistics' );
|
203 |
} else {
|
204 |
+
echo size_format( @filesize( $GeoIP_filename ), 2 ) . __( ', created on ', 'wp-statistics' ) . date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $GeoIP_filedate );
|
|
|
|
|
205 |
} ?></strong>
|
206 |
|
207 |
+
<p class="description"><?php _e( 'The file size and date of the GeoIP database.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
208 |
</td>
|
209 |
</tr>
|
210 |
|
219 |
|
220 |
<td>
|
221 |
<strong><?php echo $WP_Statistics->get_IP(); ?></strong>
|
|
|
222 |
<p class="description"><?php _e( 'The client IP address.', 'wp-statistics' ); ?></p>
|
223 |
</td>
|
224 |
</tr>
|
230 |
|
231 |
<td>
|
232 |
<strong><?php echo htmlentities( $_SERVER['HTTP_USER_AGENT'], ENT_QUOTES ); ?></strong>
|
|
|
233 |
<p class="description"><?php _e( 'The client user agent string.', 'wp-statistics' ); ?></p>
|
234 |
</td>
|
235 |
</tr>
|
255 |
|
256 |
<td>
|
257 |
<strong><?php echo $agent['version']; ?></strong>
|
|
|
258 |
<p class="description"><?php _e( 'The detected client browser version.', 'wp-statistics' ); ?></p>
|
259 |
</td>
|
260 |
</tr>
|
266 |
|
267 |
<td>
|
268 |
<strong><?php echo $agent['platform']; ?></strong>
|
|
|
269 |
<p class="description"><?php _e( 'The detected client platform.', 'wp-statistics' ); ?></p>
|
270 |
</td>
|
271 |
</tr>
|
includes/optimization/tabs/wps-optimization-updates.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
});
|
10 |
});
|
11 |
</script>
|
12 |
-
<div class="wrap">
|
13 |
<table class="form-table">
|
14 |
<tbody>
|
15 |
<tr valign="top">
|
9 |
});
|
10 |
});
|
11 |
</script>
|
12 |
+
<div class="wrap wps-wrap">
|
13 |
<table class="form-table">
|
14 |
<tbody>
|
15 |
<tr valign="top">
|
includes/optimization/wps-optimization.php
CHANGED
@@ -224,23 +224,18 @@ if ( array_key_exists( 'search', $_GET ) ) {
|
|
224 |
}
|
225 |
|
226 |
$WP_Statistics->update_option( 'search_converted', 1 );
|
227 |
-
echo "<div class='updated settings-error'><p><strong>" .
|
228 |
-
sprintf( __( 'Search table conversion complete, %d rows added.', 'wp-statistics' ), $total ) .
|
229 |
-
"</strong></p></div>";
|
230 |
}
|
231 |
?>
|
232 |
-
<div class="wrap wp-statistics-settings">
|
233 |
-
|
234 |
|
235 |
<div id="poststuff">
|
236 |
<div id="post-body" class="metabox-holder columns-2">
|
237 |
<div class="wp-list-table widefat widefat">
|
238 |
<div class="wp-statistics-container">
|
239 |
<ul class="tabs">
|
240 |
-
<li class="tab-link current" data-tab="resources"><?php _e(
|
241 |
-
'Resources/Information',
|
242 |
-
'wp-statistics'
|
243 |
-
); ?></li>
|
244 |
<li class="tab-link" data-tab="export"><?php _e( 'Export', 'wp-statistics' ); ?></li>
|
245 |
<li class="tab-link" data-tab="purging"><?php _e( 'Purging', 'wp-statistics' ); ?></li>
|
246 |
<li class="tab-link" data-tab="database"><?php _e( 'Database', 'wp-statistics' ); ?></li>
|
224 |
}
|
225 |
|
226 |
$WP_Statistics->update_option( 'search_converted', 1 );
|
227 |
+
echo "<div class='updated settings-error'><p><strong>" . sprintf( __( 'Search table conversion complete, %d rows added.', 'wp-statistics' ), $total ) . "</strong></p></div>";
|
|
|
|
|
228 |
}
|
229 |
?>
|
230 |
+
<div class="wrap wps-wrap wp-statistics-settings">
|
231 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Optimization', 'wp-statistics' ) ); ?>
|
232 |
|
233 |
<div id="poststuff">
|
234 |
<div id="post-body" class="metabox-holder columns-2">
|
235 |
<div class="wp-list-table widefat widefat">
|
236 |
<div class="wp-statistics-container">
|
237 |
<ul class="tabs">
|
238 |
+
<li class="tab-link current" data-tab="resources"><?php _e( 'Resources/Information', 'wp-statistics' ); ?></li>
|
|
|
|
|
|
|
239 |
<li class="tab-link" data-tab="export"><?php _e( 'Export', 'wp-statistics' ); ?></li>
|
240 |
<li class="tab-link" data-tab="purging"><?php _e( 'Purging', 'wp-statistics' ); ?></li>
|
241 |
<li class="tab-link" data-tab="database"><?php _e( 'Database', 'wp-statistics' ); ?></li>
|
includes/settings/tabs/wps-access-level.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
-
global $wp_roles;
|
3 |
|
|
|
|
|
4 |
$role_list = $wp_roles->get_names();
|
5 |
|
|
|
6 |
if ( $wps_nonce_valid ) {
|
7 |
-
|
8 |
$wps_option_list = array_merge( $wps_option_list, array( 'wps_read_capability', 'wps_manage_capability' ) );
|
9 |
-
|
10 |
foreach ( $wps_option_list as $option ) {
|
11 |
$new_option = str_replace( "wps_", "", $option );
|
12 |
|
@@ -20,22 +20,19 @@ if ( $wps_nonce_valid ) {
|
|
20 |
}
|
21 |
|
22 |
?>
|
23 |
-
|
24 |
<table class="form-table">
|
25 |
<tbody>
|
26 |
<tr valign="top">
|
27 |
<th scope="row" colspan="2"><h3><?php _e( 'Access Levels', 'wp-statistics' ); ?></h3></th>
|
28 |
</tr>
|
29 |
<?php
|
30 |
-
global $wp_roles;
|
31 |
-
|
32 |
-
$role_list = $wp_roles->get_names();
|
33 |
|
|
|
34 |
foreach ( $wp_roles->roles as $role ) {
|
35 |
-
|
36 |
$cap_list = $role['capabilities'];
|
37 |
-
|
38 |
foreach ( $cap_list as $key => $cap ) {
|
|
|
|
|
39 |
if ( substr( $key, 0, 6 ) != 'level_' ) {
|
40 |
$all_caps[ $key ] = 1;
|
41 |
}
|
@@ -43,10 +40,8 @@ if ( $wps_nonce_valid ) {
|
|
43 |
}
|
44 |
|
45 |
ksort( $all_caps );
|
46 |
-
|
47 |
$read_cap = $WP_Statistics->get_option( 'read_capability', 'manage_options' );
|
48 |
$option_list = '';
|
49 |
-
|
50 |
foreach ( $all_caps as $key => $cap ) {
|
51 |
if ( $key == $read_cap ) {
|
52 |
$selected = " SELECTED";
|
@@ -58,10 +53,7 @@ if ( $wps_nonce_valid ) {
|
|
58 |
?>
|
59 |
<tr valign="top">
|
60 |
<th scope="row">
|
61 |
-
<label for="wps_read_capability"><?php _e(
|
62 |
-
'Required user level to view WP Statistics:',
|
63 |
-
'wp-statistics'
|
64 |
-
) ?></label>
|
65 |
</th>
|
66 |
<td>
|
67 |
<select dir="ltr" id="wps_read_capability" name="wps_read_capability"><?php echo $option_list; ?></select>
|
@@ -70,7 +62,6 @@ if ( $wps_nonce_valid ) {
|
|
70 |
|
71 |
<?php
|
72 |
$manage_cap = $WP_Statistics->get_option( 'manage_capability', 'manage_options' );
|
73 |
-
|
74 |
foreach ( $all_caps as $key => $cap ) {
|
75 |
if ( $key == $manage_cap ) {
|
76 |
$selected = " SELECTED";
|
@@ -82,10 +73,7 @@ if ( $wps_nonce_valid ) {
|
|
82 |
?>
|
83 |
<tr valign="top">
|
84 |
<th scope="row">
|
85 |
-
<label for="wps_manage_capability"><?php _e(
|
86 |
-
'Required user level to manage WP Statistics:',
|
87 |
-
'wp-statistics'
|
88 |
-
) ?></label>
|
89 |
</th>
|
90 |
<td>
|
91 |
<select dir="ltr" id="wps_manage_capability" name="wps_manage_capability"><?php echo $option_list; ?></select>
|
@@ -94,36 +82,13 @@ if ( $wps_nonce_valid ) {
|
|
94 |
|
95 |
<tr valign="top">
|
96 |
<th scope="row" colspan="2">
|
97 |
-
<p class="description"><?php echo sprintf(
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
),
|
102 |
-
'<a target=_blank href="http://codex.wordpress.org/Roles_and_Capabilities">',
|
103 |
-
'</a>'
|
104 |
-
); ?></p>
|
105 |
-
|
106 |
-
<p class="description"><?php echo __(
|
107 |
-
'Hint: manage_network = Super Admin Network, manage_options = Administrator, edit_others_posts = Editor, publish_posts = Author, edit_posts = Contributor, read = Everyone.',
|
108 |
-
'wp-statistics'
|
109 |
-
); ?></p>
|
110 |
-
|
111 |
-
<p class="description"><?php echo __(
|
112 |
-
'Each of the above cascades the rights upwards in the default WordPress configuration. So for example selecting publish_posts grants the right to Authors, Editors, Admins and Super Admins.',
|
113 |
-
'wp-statistics'
|
114 |
-
); ?></p>
|
115 |
-
|
116 |
-
<p class="description"><?php echo sprintf(
|
117 |
-
__(
|
118 |
-
'If you need a more robust solution to delegate access you might want to look at %s in the WordPress plugin directory.',
|
119 |
-
'wp-statistics'
|
120 |
-
),
|
121 |
-
'<a href="http://wordpress.org/plugins/capability-manager-enhanced/" target=_blank>Capability Manager Enhanced</a>'
|
122 |
-
); ?></p>
|
123 |
</th>
|
124 |
</tr>
|
125 |
|
126 |
</tbody>
|
127 |
</table>
|
128 |
-
|
129 |
<?php submit_button( __( 'Update', 'wp-statistics' ), 'primary', 'submit' );
|
1 |
<?php
|
|
|
2 |
|
3 |
+
//Get List Roles Wordpress
|
4 |
+
global $wp_roles;
|
5 |
$role_list = $wp_roles->get_names();
|
6 |
|
7 |
+
//Save Option Access
|
8 |
if ( $wps_nonce_valid ) {
|
|
|
9 |
$wps_option_list = array_merge( $wps_option_list, array( 'wps_read_capability', 'wps_manage_capability' ) );
|
|
|
10 |
foreach ( $wps_option_list as $option ) {
|
11 |
$new_option = str_replace( "wps_", "", $option );
|
12 |
|
20 |
}
|
21 |
|
22 |
?>
|
|
|
23 |
<table class="form-table">
|
24 |
<tbody>
|
25 |
<tr valign="top">
|
26 |
<th scope="row" colspan="2"><h3><?php _e( 'Access Levels', 'wp-statistics' ); ?></h3></th>
|
27 |
</tr>
|
28 |
<?php
|
|
|
|
|
|
|
29 |
|
30 |
+
//Get List Of Capability
|
31 |
foreach ( $wp_roles->roles as $role ) {
|
|
|
32 |
$cap_list = $role['capabilities'];
|
|
|
33 |
foreach ( $cap_list as $key => $cap ) {
|
34 |
+
|
35 |
+
//remove level_ from List
|
36 |
if ( substr( $key, 0, 6 ) != 'level_' ) {
|
37 |
$all_caps[ $key ] = 1;
|
38 |
}
|
40 |
}
|
41 |
|
42 |
ksort( $all_caps );
|
|
|
43 |
$read_cap = $WP_Statistics->get_option( 'read_capability', 'manage_options' );
|
44 |
$option_list = '';
|
|
|
45 |
foreach ( $all_caps as $key => $cap ) {
|
46 |
if ( $key == $read_cap ) {
|
47 |
$selected = " SELECTED";
|
53 |
?>
|
54 |
<tr valign="top">
|
55 |
<th scope="row">
|
56 |
+
<label for="wps_read_capability"><?php _e( 'Required user level to view WP Statistics:', 'wp-statistics' ) ?></label>
|
|
|
|
|
|
|
57 |
</th>
|
58 |
<td>
|
59 |
<select dir="ltr" id="wps_read_capability" name="wps_read_capability"><?php echo $option_list; ?></select>
|
62 |
|
63 |
<?php
|
64 |
$manage_cap = $WP_Statistics->get_option( 'manage_capability', 'manage_options' );
|
|
|
65 |
foreach ( $all_caps as $key => $cap ) {
|
66 |
if ( $key == $manage_cap ) {
|
67 |
$selected = " SELECTED";
|
73 |
?>
|
74 |
<tr valign="top">
|
75 |
<th scope="row">
|
76 |
+
<label for="wps_manage_capability"><?php _e( 'Required user level to manage WP Statistics:', 'wp-statistics' ) ?></label>
|
|
|
|
|
|
|
77 |
</th>
|
78 |
<td>
|
79 |
<select dir="ltr" id="wps_manage_capability" name="wps_manage_capability"><?php echo $option_list; ?></select>
|
82 |
|
83 |
<tr valign="top">
|
84 |
<th scope="row" colspan="2">
|
85 |
+
<p class="description"><?php echo sprintf( __( 'See the %sWordPress Roles and Capabilities page%s for details on capability levels.', 'wp-statistics' ), '<a target=_blank href="http://codex.wordpress.org/Roles_and_Capabilities">', '</a>' ); ?></p>
|
86 |
+
<p class="description"><?php echo __( 'Hint: manage_network = Super Admin Network, manage_options = Administrator, edit_others_posts = Editor, publish_posts = Author, edit_posts = Contributor, read = Everyone.', 'wp-statistics' ); ?></p>
|
87 |
+
<p class="description"><?php echo __( 'Each of the above cascades the rights upwards in the default WordPress configuration. So for example selecting publish_posts grants the right to Authors, Editors, Admins and Super Admins.', 'wp-statistics' ); ?></p>
|
88 |
+
<p class="description"><?php echo sprintf( __( 'If you need a more robust solution to delegate access you might want to look at %s in the WordPress plugin directory.', 'wp-statistics' ), '<a href="http://wordpress.org/plugins/capability-manager-enhanced/" target=_blank>Capability Manager Enhanced</a>' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
</th>
|
90 |
</tr>
|
91 |
|
92 |
</tbody>
|
93 |
</table>
|
|
|
94 |
<?php submit_button( __( 'Update', 'wp-statistics' ), 'primary', 'submit' );
|
includes/settings/tabs/wps-externals.php
CHANGED
@@ -8,6 +8,8 @@ if ( $wps_nonce_valid ) {
|
|
8 |
'wps_geoip_city',
|
9 |
'wps_auto_pop',
|
10 |
'wps_private_country_code',
|
|
|
|
|
11 |
);
|
12 |
|
13 |
// For country codes we always use upper case, otherwise default to 000 which is 'unknown'.
|
@@ -58,12 +60,12 @@ if ( $wps_nonce_valid ) {
|
|
58 |
</th>
|
59 |
|
60 |
<td>
|
61 |
-
<input id="geoip-enable" type="checkbox" name="wps_geoip" <?php echo
|
62 |
<label for="geoip-enable">
|
63 |
-
|
64 |
<form action="" method="post" style="display: inline;">
|
65 |
<input type="hidden" name="geoip_name" value="country">
|
66 |
-
|
67 |
</form>
|
68 |
</label>
|
69 |
|
@@ -80,20 +82,19 @@ if ( $wps_nonce_valid ) {
|
|
80 |
</th>
|
81 |
|
82 |
<td>
|
83 |
-
<input id="geoip-city" type="checkbox"
|
84 |
-
name="wps_geoip_city" <?php echo ($WP_Statistics->get_option( 'geoip_city' ) == 'on' ? "checked='checked'" : ''); ?>>
|
85 |
<label for="geoip-city">
|
86 |
-
|
87 |
<form action="" method="post" style="display: inline;">
|
88 |
<input type="hidden" name="geoip_name" value="city">
|
89 |
-
|
90 |
</form>
|
91 |
</label>
|
92 |
|
93 |
<p class="description"><?php _e(
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
</td>
|
98 |
</tr>
|
99 |
|
@@ -103,9 +104,7 @@ if ( $wps_nonce_valid ) {
|
|
103 |
</th>
|
104 |
|
105 |
<td>
|
106 |
-
<input id="geoip-schedule" type="checkbox"
|
107 |
-
name="wps_schedule_geoip" <?php echo $WP_Statistics->get_option( 'schedule_geoip' ) == true
|
108 |
-
? "checked='checked'" : ''; ?>>
|
109 |
<label for="geoip-schedule"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
110 |
<?php
|
111 |
if ( $WP_Statistics->get_option( 'schedule_geoip' ) ) {
|
@@ -156,8 +155,7 @@ if ( $wps_nonce_valid ) {
|
|
156 |
</th>
|
157 |
|
158 |
<td>
|
159 |
-
<input id="geoip-auto-pop" type="checkbox"
|
160 |
-
name="wps_auto_pop" <?php echo $WP_Statistics->get_option( 'auto_pop' ) == true
|
161 |
? "checked='checked'" : ''; ?>>
|
162 |
<label for="geoip-auto-pop"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
163 |
|
@@ -174,19 +172,18 @@ if ( $wps_nonce_valid ) {
|
|
174 |
</th>
|
175 |
|
176 |
<td>
|
177 |
-
<input type="text" size="3" id="geoip-private-country-code" name="wps_private_country_code"
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
); ?>">
|
182 |
|
183 |
<p class="description"><?php echo __(
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
</td>
|
191 |
</tr>
|
192 |
<?php
|
@@ -229,73 +226,55 @@ if ( $wps_nonce_valid ) {
|
|
229 |
<?php
|
230 |
} ?>
|
231 |
|
232 |
-
|
233 |
-
|
234 |
<tr valign="top">
|
235 |
<th scope="row" colspan="2">
|
236 |
-
<h3><?php _e( '
|
237 |
</th>
|
238 |
</tr>
|
239 |
|
240 |
<tr valign="top">
|
241 |
<th scope="row" colspan="2">
|
242 |
<?php echo sprintf(
|
243 |
-
__( 'Referrer spam blacklist is provided by
|
244 |
-
'<a href="https://github.com/
|
245 |
); ?>
|
246 |
</th>
|
247 |
</tr>
|
248 |
|
249 |
<tr valign="top">
|
250 |
<th scope="row">
|
251 |
-
<label for="referrerspam-enable"><?php _e( '
|
252 |
</th>
|
253 |
|
254 |
<td>
|
255 |
-
<input id="referrerspam-enable" type="checkbox"
|
256 |
-
name="wps_referrerspam" <?php echo $WP_Statistics->get_option( 'referrerspam' ) == true
|
257 |
-
? "checked='checked'" : ''; ?>>
|
258 |
<label for="referrerspam-enable"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
259 |
|
260 |
<p class="description"><?php _e(
|
261 |
-
'The
|
262 |
'wp-statistics'
|
263 |
); ?></p>
|
264 |
</td>
|
265 |
</tr>
|
266 |
|
267 |
-
<tr valign="top"
|
268 |
<th scope="row">
|
269 |
-
<label for="geoip-update"><?php _e( 'Update
|
270 |
</th>
|
271 |
|
272 |
<td>
|
273 |
-
<
|
274 |
-
|
275 |
-
true ? "checked='checked'" : ''; ?>>
|
276 |
-
<label for="referrerspam-update"><?php _e(
|
277 |
-
'Download Piwik Referrer Spam Blacklist Database',
|
278 |
-
'wp-statistics'
|
279 |
-
); ?></label>
|
280 |
-
|
281 |
-
<p class="description"><?php _e(
|
282 |
-
'Save changes on this page to download the update.',
|
283 |
-
'wp-statistics'
|
284 |
-
); ?></p>
|
285 |
</td>
|
286 |
</tr>
|
287 |
|
288 |
-
<tr valign="top"
|
289 |
<th scope="row">
|
290 |
-
<label for="referrerspam-schedule"><?php _e(
|
291 |
-
'Schedule weekly update of Piwik Referrer Spam Blacklist DB:',
|
292 |
-
'wp-statistics'
|
293 |
-
); ?></label>
|
294 |
</th>
|
295 |
|
296 |
<td>
|
297 |
-
<input id="referrerspam-schedule" type="checkbox"
|
298 |
-
name="wps_schedule_referrerspam" <?php echo $WP_Statistics->get_option(
|
299 |
'schedule_referrerspam'
|
300 |
) == true ? "checked='checked'" : ''; ?>>
|
301 |
<label for="referrerspam-schedule"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
@@ -324,7 +303,7 @@ if ( $wps_nonce_valid ) {
|
|
324 |
}
|
325 |
?>
|
326 |
<p class="description"><?php _e(
|
327 |
-
'Download of the
|
328 |
'wp-statistics'
|
329 |
); ?></p>
|
330 |
</td>
|
@@ -333,4 +312,4 @@ if ( $wps_nonce_valid ) {
|
|
333 |
</tbody>
|
334 |
</table>
|
335 |
|
336 |
-
<?php submit_button( __( 'Update', 'wp-statistics' ), 'primary', 'submit' );
|
8 |
'wps_geoip_city',
|
9 |
'wps_auto_pop',
|
10 |
'wps_private_country_code',
|
11 |
+
'wps_referrerspam',
|
12 |
+
'wps_schedule_referrerspam'
|
13 |
);
|
14 |
|
15 |
// For country codes we always use upper case, otherwise default to 000 which is 'unknown'.
|
60 |
</th>
|
61 |
|
62 |
<td>
|
63 |
+
<input id="geoip-enable" type="checkbox" name="wps_geoip" <?php echo( $WP_Statistics->get_option( 'geoip' ) === 'on' ? "checked='checked'" : '' ); ?>>
|
64 |
<label for="geoip-enable">
|
65 |
+
<?php _e( 'Enable', 'wp-statistics' ); ?>
|
66 |
<form action="" method="post" style="display: inline;">
|
67 |
<input type="hidden" name="geoip_name" value="country">
|
68 |
+
<?php submit_button( __( "Update Database", 'wp-statistics' ), "secondary", "update_geoip", false ); ?>
|
69 |
</form>
|
70 |
</label>
|
71 |
|
82 |
</th>
|
83 |
|
84 |
<td>
|
85 |
+
<input id="geoip-city" type="checkbox" name="wps_geoip_city" <?php echo( $WP_Statistics->get_option( 'geoip_city' ) == 'on' ? "checked='checked'" : '' ); ?>>
|
|
|
86 |
<label for="geoip-city">
|
87 |
+
<?php _e( 'Enable', 'wp-statistics' ); ?>
|
88 |
<form action="" method="post" style="display: inline;">
|
89 |
<input type="hidden" name="geoip_name" value="city">
|
90 |
+
<?php submit_button( __( "Update Database", 'wp-statistics' ), "secondary", "update_geoip", false ); ?>
|
91 |
</form>
|
92 |
</label>
|
93 |
|
94 |
<p class="description"><?php _e(
|
95 |
+
'See Visitor\'s City Name',
|
96 |
+
'wp-statistics'
|
97 |
+
); ?></p>
|
98 |
</td>
|
99 |
</tr>
|
100 |
|
104 |
</th>
|
105 |
|
106 |
<td>
|
107 |
+
<input id="geoip-schedule" type="checkbox" name="wps_schedule_geoip" <?php echo $WP_Statistics->get_option( 'schedule_geoip' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
108 |
<label for="geoip-schedule"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
109 |
<?php
|
110 |
if ( $WP_Statistics->get_option( 'schedule_geoip' ) ) {
|
155 |
</th>
|
156 |
|
157 |
<td>
|
158 |
+
<input id="geoip-auto-pop" type="checkbox" name="wps_auto_pop" <?php echo $WP_Statistics->get_option( 'auto_pop' ) == true
|
|
|
159 |
? "checked='checked'" : ''; ?>>
|
160 |
<label for="geoip-auto-pop"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
161 |
|
172 |
</th>
|
173 |
|
174 |
<td>
|
175 |
+
<input type="text" size="3" id="geoip-private-country-code" name="wps_private_country_code" value="<?php echo htmlentities(
|
176 |
+
$WP_Statistics->get_option( 'private_country_code', '000' ),
|
177 |
+
ENT_QUOTES
|
178 |
+
); ?>">
|
|
|
179 |
|
180 |
<p class="description"><?php echo __(
|
181 |
+
'The international standard two letter country code (ie. US = United States, CA = Canada, etc.) for private (non-routable) IP addresses (ie. 10.0.0.1, 192.158.1.1, 127.0.0.1, etc.).',
|
182 |
+
'wp-statistics'
|
183 |
+
) . ' ' . __(
|
184 |
+
'Use "000" (three zeros) to use "Unknown" as the country code.',
|
185 |
+
'wp-statistics'
|
186 |
+
); ?></p>
|
187 |
</td>
|
188 |
</tr>
|
189 |
<?php
|
226 |
<?php
|
227 |
} ?>
|
228 |
|
|
|
|
|
229 |
<tr valign="top">
|
230 |
<th scope="row" colspan="2">
|
231 |
+
<h3><?php _e( 'Matomo Referrer Spam Blacklist settings', 'wp-statistics' ); ?></h3>
|
232 |
</th>
|
233 |
</tr>
|
234 |
|
235 |
<tr valign="top">
|
236 |
<th scope="row" colspan="2">
|
237 |
<?php echo sprintf(
|
238 |
+
__( 'Referrer spam blacklist is provided by Matomo, available from %s.', 'wp-statistics' ),
|
239 |
+
'<a href="https://github.com/matomo-org/referrer-spam-blacklist" target=_blank>https://github.com/matomo-org/referrer-spam-blacklist</a>'
|
240 |
); ?>
|
241 |
</th>
|
242 |
</tr>
|
243 |
|
244 |
<tr valign="top">
|
245 |
<th scope="row">
|
246 |
+
<label for="referrerspam-enable"><?php _e( 'Matomo Referrer Spam Blacklist usage:', 'wp-statistics' ); ?></label>
|
247 |
</th>
|
248 |
|
249 |
<td>
|
250 |
+
<input id="referrerspam-enable" type="checkbox" name="wps_referrerspam" <?php echo $WP_Statistics->get_option( 'referrerspam' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
251 |
<label for="referrerspam-enable"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
252 |
|
253 |
<p class="description"><?php _e(
|
254 |
+
'The Matomo Referrer Spam Blacklist database will be downloaded and used to detect referrer spam.',
|
255 |
'wp-statistics'
|
256 |
); ?></p>
|
257 |
</td>
|
258 |
</tr>
|
259 |
|
260 |
+
<tr valign="top" class="referrerspam_field"<?php if ( ! $WP_Statistics->get_option( 'referrerspam' ) ) { echo ' style="display:none;"'; } ?>>
|
261 |
<th scope="row">
|
262 |
+
<label for="geoip-update"><?php _e( 'Update Matomo Referrer Spam Blacklist Info:', 'wp-statistics' ); ?></label>
|
263 |
</th>
|
264 |
|
265 |
<td>
|
266 |
+
<a href = "<?php echo WP_Statistics_Admin_Pages::admin_url( 'settings', array( 'tab' => 'externals-settings', 'update-referrerspam' => 'yes' ) ) ?>" class="button"><?php _e( 'Update', 'wp-staitsitcs' ); ?></a>
|
267 |
+
<p class="description"><?php _e( 'Click button to download the update.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
</td>
|
269 |
</tr>
|
270 |
|
271 |
+
<tr valign="top" class="referrerspam_field"<?php if ( ! $WP_Statistics->get_option( 'referrerspam' ) ) { echo ' style="display:none;"'; } ?>>
|
272 |
<th scope="row">
|
273 |
+
<label for="referrerspam-schedule"><?php _e( 'Schedule weekly update of Matomo Referrer Spam Blacklist DB:', 'wp-statistics' ); ?></label>
|
|
|
|
|
|
|
274 |
</th>
|
275 |
|
276 |
<td>
|
277 |
+
<input id="referrerspam-schedule" type="checkbox" name="wps_schedule_referrerspam" <?php echo $WP_Statistics->get_option(
|
|
|
278 |
'schedule_referrerspam'
|
279 |
) == true ? "checked='checked'" : ''; ?>>
|
280 |
<label for="referrerspam-schedule"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
303 |
}
|
304 |
?>
|
305 |
<p class="description"><?php _e(
|
306 |
+
'Download of the Matomo Referrer Spam Blacklist database will be scheduled for once a week.',
|
307 |
'wp-statistics'
|
308 |
); ?></p>
|
309 |
</td>
|
312 |
</tbody>
|
313 |
</table>
|
314 |
|
315 |
+
<?php submit_button( __( 'Update', 'wp-statistics' ), 'primary', 'submit' );
|
includes/settings/tabs/wps-general.php
CHANGED
@@ -24,6 +24,7 @@ if ( $wps_nonce_valid ) {
|
|
24 |
'wps_useronline',
|
25 |
'wps_visits',
|
26 |
'wps_visitors',
|
|
|
27 |
'wps_pages',
|
28 |
'wps_track_all_pages',
|
29 |
'wps_use_cache_plugin',
|
@@ -75,8 +76,7 @@ if ( $wps_nonce_valid ) {
|
|
75 |
</th>
|
76 |
|
77 |
<td>
|
78 |
-
<input id="useronline" type="checkbox" value="1"
|
79 |
-
name="wps_useronline" <?php echo $WP_Statistics->get_option( 'useronline' ) == true
|
80 |
? "checked='checked'" : ''; ?>>
|
81 |
<label for="useronline"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
82 |
|
@@ -90,8 +90,7 @@ if ( $wps_nonce_valid ) {
|
|
90 |
</th>
|
91 |
|
92 |
<td>
|
93 |
-
<input type="text" class="small-text code" id="check_online" name="wps_check_online"
|
94 |
-
value="<?php echo htmlentities( $WP_Statistics->get_option( 'check_online' ), ENT_QUOTES ); ?>"/>
|
95 |
<?php _e( 'Seconds', 'wp-statistics' ); ?>
|
96 |
<p class="description"><?php echo sprintf(
|
97 |
__( 'Time for the check accurate online user in the site. Now: %s Seconds', 'wp-statistics' ),
|
@@ -106,8 +105,7 @@ if ( $wps_nonce_valid ) {
|
|
106 |
</th>
|
107 |
|
108 |
<td>
|
109 |
-
<input id="allonline" type="checkbox" value="1"
|
110 |
-
name="wps_all_online" <?php echo $WP_Statistics->get_option( 'all_online' ) == true
|
111 |
? "checked='checked'" : ''; ?>>
|
112 |
<label for="allonline"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
113 |
|
@@ -128,9 +126,7 @@ if ( $wps_nonce_valid ) {
|
|
128 |
</th>
|
129 |
|
130 |
<td>
|
131 |
-
<input id="visits" type="checkbox" value="1" name="wps_visits" <?php echo $WP_Statistics->get_option(
|
132 |
-
'visits'
|
133 |
-
) == true ? "checked='checked'" : ''; ?>>
|
134 |
<label for="visits"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
135 |
|
136 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
@@ -141,29 +137,39 @@ if ( $wps_nonce_valid ) {
|
|
141 |
<th scope="row" colspan="2"><h3><?php _e( 'Visitors', 'wp-statistics' ); ?></h3></th>
|
142 |
</tr>
|
143 |
|
144 |
-
<tr valign="top">
|
145 |
<th scope="row">
|
146 |
<label for="visitors"><?php _e( 'Visitors:', 'wp-statistics' ); ?></label>
|
147 |
</th>
|
148 |
|
149 |
<td>
|
150 |
-
<input id="visitors" type="checkbox" value="1"
|
151 |
-
name="wps_visitors" <?php echo $WP_Statistics->get_option( 'visitors' ) == true
|
152 |
-
? "checked='checked'" : ''; ?>>
|
153 |
<label for="visitors"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
154 |
|
155 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
156 |
</td>
|
157 |
</tr>
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
<tr valign="top">
|
160 |
<th scope="row">
|
161 |
<label for="coefficient"><?php _e( 'Coefficient per visitor:', 'wp-statistics' ); ?></label>
|
162 |
</th>
|
163 |
|
164 |
<td>
|
165 |
-
<input type="text" class="small-text code" id="coefficient" name="wps_coefficient"
|
166 |
-
value="<?php echo htmlentities( $WP_Statistics->get_option( 'coefficient' ), ENT_QUOTES ); ?>"/>
|
167 |
|
168 |
<p class="description"><?php echo sprintf(
|
169 |
__( 'For each visit to account for several hits. Currently %s.', 'wp-statistics' ),
|
@@ -182,9 +188,7 @@ if ( $wps_nonce_valid ) {
|
|
182 |
</th>
|
183 |
|
184 |
<td>
|
185 |
-
<input id="pages" type="checkbox" value="1" name="wps_pages" <?php echo $WP_Statistics->get_option(
|
186 |
-
'pages'
|
187 |
-
) == true ? "checked='checked'" : ''; ?>>
|
188 |
<label for="pages"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
189 |
|
190 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
@@ -197,12 +201,11 @@ if ( $wps_nonce_valid ) {
|
|
197 |
</th>
|
198 |
|
199 |
<td>
|
200 |
-
<input id="all_pages" type="checkbox" value="1"
|
201 |
-
name="wps_track_all_pages" <?php echo $WP_Statistics->get_option( 'track_all_pages' ) == true
|
202 |
-
? "checked='checked'" : ''; ?>>
|
203 |
<label for="all_pages"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
204 |
|
205 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
|
|
206 |
</td>
|
207 |
</tr>
|
208 |
|
@@ -215,16 +218,10 @@ if ( $wps_nonce_valid ) {
|
|
215 |
</th>
|
216 |
|
217 |
<td>
|
218 |
-
<input id="strip_uri_parameters" type="checkbox" value="1"
|
219 |
-
name="wps_strip_uri_parameters" <?php echo $WP_Statistics->get_option(
|
220 |
-
'strip_uri_parameters'
|
221 |
-
) == true ? "checked='checked'" : ''; ?>>
|
222 |
<label for="strip_uri_parameters"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
223 |
|
224 |
-
<p class="description"><?php _e(
|
225 |
-
'This will remove anything after the ? in a URL.',
|
226 |
-
'wp-statistics'
|
227 |
-
); ?></p>
|
228 |
</td>
|
229 |
</tr>
|
230 |
<?php
|
@@ -236,8 +233,7 @@ if ( $wps_nonce_valid ) {
|
|
236 |
</th>
|
237 |
|
238 |
<td>
|
239 |
-
<input id="disable_column" type="checkbox" value="1"
|
240 |
-
name="wps_disable_column" <?php echo $WP_Statistics->get_option( 'disable_column' ) == true
|
241 |
? "checked='checked'" : ''; ?>>
|
242 |
<label for="disable_column"><?php _e( 'Disable', 'wp-statistics' ); ?></label>
|
243 |
|
@@ -252,9 +248,7 @@ if ( $wps_nonce_valid ) {
|
|
252 |
</th>
|
253 |
|
254 |
<td>
|
255 |
-
<input id="hit_post_metabox" type="checkbox" value="1"
|
256 |
-
name="wps_hit_post_metabox" <?php echo $WP_Statistics->get_option( 'hit_post_metabox' ) == true
|
257 |
-
? "checked='checked'" : ''; ?>>
|
258 |
<label for="hit_post_metabox"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
259 |
|
260 |
<p class="description"><?php _e( 'Show hits meta box chart in the edit of all post types page.', 'wp-statistics' ); ?></p>
|
@@ -267,8 +261,7 @@ if ( $wps_nonce_valid ) {
|
|
267 |
</th>
|
268 |
|
269 |
<td>
|
270 |
-
<input id="show_hits" type="checkbox" value="1"
|
271 |
-
name="wps_show_hits" <?php echo $WP_Statistics->get_option( 'show_hits' ) == true
|
272 |
? "checked='checked'" : ''; ?> onClick='ToggleShowHitsOptions();'>
|
273 |
<label for="show_hits"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
274 |
|
@@ -320,14 +313,13 @@ if ( $wps_nonce_valid ) {
|
|
320 |
</th>
|
321 |
|
322 |
<td>
|
323 |
-
<input id="use_cache_plugin" type="checkbox" value="1"
|
324 |
-
|
325 |
-
? "checked='checked'" : ''; ?>>
|
326 |
<label for="use_cache_plugin"><?php _e( 'Yes', 'wp-statistics' ); ?></label>
|
327 |
|
328 |
<p class="description"><?php _e( 'If you use WordPress Cache Plugins, enable this option.', 'wp-statistics' ); ?></p>
|
329 |
-
<p class="description"><?php echo sprintf( __( 'To register WP-Statistics REST API endpoint ( %s ) , go to the <a href="%s">Permalink page</a> and update the permalink with press Save Changes.', 'wp-statistics' ), WP_Statistics_Rest::route
|
330 |
-
<p class="description"><?php echo
|
331 |
</td>
|
332 |
</tr>
|
333 |
|
@@ -363,8 +355,7 @@ if ( $wps_nonce_valid ) {
|
|
363 |
</th>
|
364 |
|
365 |
<td>
|
366 |
-
<input id="hide_notices" type="checkbox" value="1"
|
367 |
-
name="wps_hide_notices" <?php echo $WP_Statistics->get_option( 'hide_notices' ) == true
|
368 |
? "checked='checked'" : ''; ?>>
|
369 |
<label for="hide_notices"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
370 |
|
@@ -385,8 +376,7 @@ if ( $wps_nonce_valid ) {
|
|
385 |
</th>
|
386 |
|
387 |
<td>
|
388 |
-
<input id="addsearchwords" type="checkbox" value="1"
|
389 |
-
name="wps_addsearchwords" <?php echo $WP_Statistics->get_option( 'addsearchwords' ) == true
|
390 |
? "checked='checked'" : ''; ?>>
|
391 |
<label for="addsearchwords"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
392 |
|
@@ -419,8 +409,7 @@ if ( $wps_nonce_valid ) {
|
|
419 |
<label for="<?php echo $option_name; ?>"><?php _e( $se['name'], 'wp-statistics' ); ?>:</label>
|
420 |
</th>
|
421 |
<td>
|
422 |
-
<input id="<?php echo $option_name; ?>" type="checkbox" value="1"
|
423 |
-
name="<?php echo $option_name; ?>" <?php echo $WP_Statistics->get_option( $store_name ) == true
|
424 |
? "checked='checked'" : ''; ?>><label for="<?php echo $option_name; ?>"><?php _e(
|
425 |
'Disable',
|
426 |
'wp-statistics'
|
@@ -444,8 +433,7 @@ if ( $wps_nonce_valid ) {
|
|
444 |
</th>
|
445 |
|
446 |
<td>
|
447 |
-
<input id="chart-totals" type="checkbox" value="1"
|
448 |
-
name="wps_chart_totals" <?php echo $WP_Statistics->get_option( 'chart_totals' ) == true
|
449 |
? "checked='checked'" : ''; ?>>
|
450 |
<label for="chart-totals"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
451 |
|
24 |
'wps_useronline',
|
25 |
'wps_visits',
|
26 |
'wps_visitors',
|
27 |
+
'wps_visitors_log',
|
28 |
'wps_pages',
|
29 |
'wps_track_all_pages',
|
30 |
'wps_use_cache_plugin',
|
76 |
</th>
|
77 |
|
78 |
<td>
|
79 |
+
<input id="useronline" type="checkbox" value="1" name="wps_useronline" <?php echo $WP_Statistics->get_option( 'useronline' ) == true
|
|
|
80 |
? "checked='checked'" : ''; ?>>
|
81 |
<label for="useronline"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
82 |
|
90 |
</th>
|
91 |
|
92 |
<td>
|
93 |
+
<input type="text" class="small-text code" id="check_online" name="wps_check_online" value="<?php echo htmlentities( $WP_Statistics->get_option( 'check_online' ), ENT_QUOTES ); ?>"/>
|
|
|
94 |
<?php _e( 'Seconds', 'wp-statistics' ); ?>
|
95 |
<p class="description"><?php echo sprintf(
|
96 |
__( 'Time for the check accurate online user in the site. Now: %s Seconds', 'wp-statistics' ),
|
105 |
</th>
|
106 |
|
107 |
<td>
|
108 |
+
<input id="allonline" type="checkbox" value="1" name="wps_all_online" <?php echo $WP_Statistics->get_option( 'all_online' ) == true
|
|
|
109 |
? "checked='checked'" : ''; ?>>
|
110 |
<label for="allonline"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
111 |
|
126 |
</th>
|
127 |
|
128 |
<td>
|
129 |
+
<input id="visits" type="checkbox" value="1" name="wps_visits" <?php echo $WP_Statistics->get_option( 'visits' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
130 |
<label for="visits"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
131 |
|
132 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
137 |
<th scope="row" colspan="2"><h3><?php _e( 'Visitors', 'wp-statistics' ); ?></h3></th>
|
138 |
</tr>
|
139 |
|
140 |
+
<tr valign="top" id="visitors_tr">
|
141 |
<th scope="row">
|
142 |
<label for="visitors"><?php _e( 'Visitors:', 'wp-statistics' ); ?></label>
|
143 |
</th>
|
144 |
|
145 |
<td>
|
146 |
+
<input id="visitors" type="checkbox" value="1" name="wps_visitors" <?php echo $WP_Statistics->get_option( 'visitors' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
147 |
<label for="visitors"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
148 |
|
149 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
150 |
</td>
|
151 |
</tr>
|
152 |
|
153 |
+
<tr valign="top" id="visitors_log_tr" <?php echo( $WP_Statistics->get_option( 'visitors' ) == false ? 'style="display:none;"' : '' ) ?>>
|
154 |
+
<th scope="row">
|
155 |
+
<label for="visitors_log"><?php _e( 'Visitors logs:', 'wp-statistics' ); ?></label>
|
156 |
+
</th>
|
157 |
+
|
158 |
+
<td>
|
159 |
+
<input id="visitors_log" type="checkbox" value="1" name="wps_visitors_log" <?php echo $WP_Statistics->get_option( 'visitors_log' ) == true ? "checked='checked'" : ''; ?>>
|
160 |
+
<label for="visitors_log"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
161 |
+
|
162 |
+
<p class="description"><?php _e( 'If enabled, you will receive a report of each user\'s visit to the pages', 'wp-statistics' ); ?></p>
|
163 |
+
</td>
|
164 |
+
</tr>
|
165 |
+
|
166 |
<tr valign="top">
|
167 |
<th scope="row">
|
168 |
<label for="coefficient"><?php _e( 'Coefficient per visitor:', 'wp-statistics' ); ?></label>
|
169 |
</th>
|
170 |
|
171 |
<td>
|
172 |
+
<input type="text" class="small-text code" id="coefficient" name="wps_coefficient" value="<?php echo htmlentities( $WP_Statistics->get_option( 'coefficient' ), ENT_QUOTES ); ?>"/>
|
|
|
173 |
|
174 |
<p class="description"><?php echo sprintf(
|
175 |
__( 'For each visit to account for several hits. Currently %s.', 'wp-statistics' ),
|
188 |
</th>
|
189 |
|
190 |
<td>
|
191 |
+
<input id="pages" type="checkbox" value="1" name="wps_pages" <?php echo $WP_Statistics->get_option( 'pages' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
192 |
<label for="pages"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
193 |
|
194 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
201 |
</th>
|
202 |
|
203 |
<td>
|
204 |
+
<input id="all_pages" type="checkbox" value="1" name="wps_track_all_pages" <?php echo $WP_Statistics->get_option( 'track_all_pages' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
205 |
<label for="all_pages"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
206 |
|
207 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
208 |
+
<p class="description"><?php echo sprintf( __( 'Track All Wordpress Page Contains Category, Post Tags, Author, Custom Taxonomy and ...', 'wp-statistics' ), admin_url( 'options-permalink.php' ) ); ?></p>
|
209 |
</td>
|
210 |
</tr>
|
211 |
|
218 |
</th>
|
219 |
|
220 |
<td>
|
221 |
+
<input id="strip_uri_parameters" type="checkbox" value="1" name="wps_strip_uri_parameters" <?php echo $WP_Statistics->get_option( 'strip_uri_parameters' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
|
|
222 |
<label for="strip_uri_parameters"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
223 |
|
224 |
+
<p class="description"><?php _e( 'This will remove anything after the ? in a URL.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
225 |
</td>
|
226 |
</tr>
|
227 |
<?php
|
233 |
</th>
|
234 |
|
235 |
<td>
|
236 |
+
<input id="disable_column" type="checkbox" value="1" name="wps_disable_column" <?php echo $WP_Statistics->get_option( 'disable_column' ) == true
|
|
|
237 |
? "checked='checked'" : ''; ?>>
|
238 |
<label for="disable_column"><?php _e( 'Disable', 'wp-statistics' ); ?></label>
|
239 |
|
248 |
</th>
|
249 |
|
250 |
<td>
|
251 |
+
<input id="hit_post_metabox" type="checkbox" value="1" name="wps_hit_post_metabox" <?php echo $WP_Statistics->get_option( 'hit_post_metabox' ) == true ? "checked='checked'" : ''; ?>>
|
|
|
|
|
252 |
<label for="hit_post_metabox"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
253 |
|
254 |
<p class="description"><?php _e( 'Show hits meta box chart in the edit of all post types page.', 'wp-statistics' ); ?></p>
|
261 |
</th>
|
262 |
|
263 |
<td>
|
264 |
+
<input id="show_hits" type="checkbox" value="1" name="wps_show_hits" <?php echo $WP_Statistics->get_option( 'show_hits' ) == true
|
|
|
265 |
? "checked='checked'" : ''; ?> onClick='ToggleShowHitsOptions();'>
|
266 |
<label for="show_hits"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
267 |
|
313 |
</th>
|
314 |
|
315 |
<td>
|
316 |
+
<input id="use_cache_plugin" type="checkbox" value="1" name="wps_use_cache_plugin" <?php echo $WP_Statistics->get_option( 'use_cache_plugin' ) == true
|
317 |
+
? "checked='checked'" : ''; ?>>
|
|
|
318 |
<label for="use_cache_plugin"><?php _e( 'Yes', 'wp-statistics' ); ?></label>
|
319 |
|
320 |
<p class="description"><?php _e( 'If you use WordPress Cache Plugins, enable this option.', 'wp-statistics' ); ?></p>
|
321 |
+
<p class="description"><?php echo sprintf( __( 'To register WP-Statistics REST API endpoint ( %s ) , go to the <a href="%s">Permalink page</a> and update the permalink with press Save Changes.', 'wp-statistics' ), WP_Statistics_Rest::route, admin_url( 'options-permalink.php' ) ); ?></p>
|
322 |
+
<p class="description"><?php echo __( 'Don\'t forget to clear your enabled plugin cache.', 'wp-statistics' ); ?></p>
|
323 |
</td>
|
324 |
</tr>
|
325 |
|
355 |
</th>
|
356 |
|
357 |
<td>
|
358 |
+
<input id="hide_notices" type="checkbox" value="1" name="wps_hide_notices" <?php echo $WP_Statistics->get_option( 'hide_notices' ) == true
|
|
|
359 |
? "checked='checked'" : ''; ?>>
|
360 |
<label for="hide_notices"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
361 |
|
376 |
</th>
|
377 |
|
378 |
<td>
|
379 |
+
<input id="addsearchwords" type="checkbox" value="1" name="wps_addsearchwords" <?php echo $WP_Statistics->get_option( 'addsearchwords' ) == true
|
|
|
380 |
? "checked='checked'" : ''; ?>>
|
381 |
<label for="addsearchwords"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
382 |
|
409 |
<label for="<?php echo $option_name; ?>"><?php _e( $se['name'], 'wp-statistics' ); ?>:</label>
|
410 |
</th>
|
411 |
<td>
|
412 |
+
<input id="<?php echo $option_name; ?>" type="checkbox" value="1" name="<?php echo $option_name; ?>" <?php echo $WP_Statistics->get_option( $store_name ) == true
|
|
|
413 |
? "checked='checked'" : ''; ?>><label for="<?php echo $option_name; ?>"><?php _e(
|
414 |
'Disable',
|
415 |
'wp-statistics'
|
433 |
</th>
|
434 |
|
435 |
<td>
|
436 |
+
<input id="chart-totals" type="checkbox" value="1" name="wps_chart_totals" <?php echo $WP_Statistics->get_option( 'chart_totals' ) == true
|
|
|
437 |
? "checked='checked'" : ''; ?>>
|
438 |
<label for="chart-totals"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
439 |
|
includes/settings/tabs/wps-notifications.php
CHANGED
@@ -64,11 +64,10 @@ if ( $wps_nonce_valid ) {
|
|
64 |
</td>
|
65 |
|
66 |
<td>
|
67 |
-
<input dir="ltr" type="text" id="email_list" name="wps_email_list" size="30"
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
echo htmlentities( $WP_Statistics->get_option( 'email_list' ), ENT_QUOTES ); ?>"/>
|
72 |
|
73 |
<p class="description"><?php _e(
|
74 |
'A comma separated list of e-mail addresses to send reports to.',
|
@@ -87,8 +86,7 @@ if ( $wps_nonce_valid ) {
|
|
87 |
</td>
|
88 |
|
89 |
<td>
|
90 |
-
<input id="geoip-report" type="checkbox" value="1"
|
91 |
-
name="wps_geoip_report" <?php echo $WP_Statistics->get_option( 'geoip_report' ) == true
|
92 |
? "checked='checked'" : ''; ?>>
|
93 |
<label for="geoip-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
94 |
|
@@ -105,8 +103,7 @@ if ( $wps_nonce_valid ) {
|
|
105 |
</td>
|
106 |
|
107 |
<td>
|
108 |
-
<input id="prune-report" type="checkbox" value="1"
|
109 |
-
name="wps_prune_report" <?php echo $WP_Statistics->get_option( 'prune_report' ) == true
|
110 |
? "checked='checked'" : ''; ?>>
|
111 |
<label for="prune-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
112 |
|
@@ -123,8 +120,7 @@ if ( $wps_nonce_valid ) {
|
|
123 |
</td>
|
124 |
|
125 |
<td>
|
126 |
-
<input id="upgrade-report" type="checkbox" value="1"
|
127 |
-
name="wps_upgrade_report" <?php echo $WP_Statistics->get_option( 'upgrade_report' ) == true
|
128 |
? "checked='checked'" : ''; ?>>
|
129 |
<label for="upgrade-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
130 |
|
@@ -145,8 +141,7 @@ if ( $wps_nonce_valid ) {
|
|
145 |
</th>
|
146 |
|
147 |
<td>
|
148 |
-
<input id="stats-report" type="checkbox" value="1"
|
149 |
-
name="wps_stats_report" <?php echo $WP_Statistics->get_option( 'stats_report' ) == true
|
150 |
? "checked='checked'" : ''; ?> onClick='ToggleStatOptions();'>
|
151 |
<label for="stats-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
152 |
|
@@ -179,26 +174,21 @@ if ( $wps_nonce_valid ) {
|
|
179 |
return ( $a['interval'] < $b['interval'] ) ? - 1 : 1;
|
180 |
}
|
181 |
|
|
|
182 |
$schedules = wp_get_schedules();
|
183 |
-
|
184 |
uasort( $schedules, 'wp_statistics_schedule_sort' );
|
|
|
185 |
|
186 |
foreach ( $schedules as $key => $value ) {
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
'>' .
|
192 |
-
$value['display'] .
|
193 |
-
'</option>';
|
194 |
}
|
195 |
?>
|
196 |
</select>
|
197 |
|
198 |
-
<p class="description"><?php _e(
|
199 |
-
'Select how often to receive statistical report.',
|
200 |
-
'wp-statistics'
|
201 |
-
); ?></p>
|
202 |
</td>
|
203 |
</tr>
|
204 |
|
@@ -263,8 +253,7 @@ if ( $wps_nonce_valid ) {
|
|
263 |
'Any shortcode supported by your installation of WordPress, include all shortcodes for WP Statistics (see the documentation for a list of codes available) are supported in the body of the message. Here are some examples:',
|
264 |
'wp-statistics'
|
265 |
); ?>
|
266 |
-
<br><br>
|
267 |
-
<?php _e( 'Online User', 'wp-statistics' ); ?>: <code>[wpstatistics
|
268 |
stat=usersonline]</code><br>
|
269 |
<?php _e( 'Today\'s Visitors', 'wp-statistics' ); ?>: <code>[wpstatistics
|
270 |
stat=visitors time=today]</code><br>
|
@@ -295,7 +284,7 @@ if ( $wps_nonce_valid ) {
|
|
295 |
<input id="admin-notices" type="checkbox" value="1" name="wps_admin_notices" <?php echo $WP_Statistics->get_option( 'admin_notices' ) == true ? "checked='checked'" : ''; ?>>
|
296 |
<label for="admin-notices"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
297 |
|
298 |
-
<p class="description"><?php _e('Show all notices and suggestion from WP-Statistics in the admin.', 'wp-statistics'); ?></p>
|
299 |
</td>
|
300 |
</tr>
|
301 |
</tbody>
|
64 |
</td>
|
65 |
|
66 |
<td>
|
67 |
+
<input dir="ltr" type="text" id="email_list" name="wps_email_list" size="30" value="<?php if ( $WP_Statistics->get_option( 'email_list' ) == '' ) {
|
68 |
+
$WP_Statistics->store_option( 'email_list', get_bloginfo( 'admin_email' ) );
|
69 |
+
}
|
70 |
+
echo htmlentities( $WP_Statistics->get_option( 'email_list' ), ENT_QUOTES ); ?>"/>
|
|
|
71 |
|
72 |
<p class="description"><?php _e(
|
73 |
'A comma separated list of e-mail addresses to send reports to.',
|
86 |
</td>
|
87 |
|
88 |
<td>
|
89 |
+
<input id="geoip-report" type="checkbox" value="1" name="wps_geoip_report" <?php echo $WP_Statistics->get_option( 'geoip_report' ) == true
|
|
|
90 |
? "checked='checked'" : ''; ?>>
|
91 |
<label for="geoip-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
92 |
|
103 |
</td>
|
104 |
|
105 |
<td>
|
106 |
+
<input id="prune-report" type="checkbox" value="1" name="wps_prune_report" <?php echo $WP_Statistics->get_option( 'prune_report' ) == true
|
|
|
107 |
? "checked='checked'" : ''; ?>>
|
108 |
<label for="prune-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
109 |
|
120 |
</td>
|
121 |
|
122 |
<td>
|
123 |
+
<input id="upgrade-report" type="checkbox" value="1" name="wps_upgrade_report" <?php echo $WP_Statistics->get_option( 'upgrade_report' ) == true
|
|
|
124 |
? "checked='checked'" : ''; ?>>
|
125 |
<label for="upgrade-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
126 |
|
141 |
</th>
|
142 |
|
143 |
<td>
|
144 |
+
<input id="stats-report" type="checkbox" value="1" name="wps_stats_report" <?php echo $WP_Statistics->get_option( 'stats_report' ) == true
|
|
|
145 |
? "checked='checked'" : ''; ?> onClick='ToggleStatOptions();'>
|
146 |
<label for="stats-report"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
147 |
|
174 |
return ( $a['interval'] < $b['interval'] ) ? - 1 : 1;
|
175 |
}
|
176 |
|
177 |
+
//Get List Of Schedules Wordpress
|
178 |
$schedules = wp_get_schedules();
|
|
|
179 |
uasort( $schedules, 'wp_statistics_schedule_sort' );
|
180 |
+
$schedules_item = array();
|
181 |
|
182 |
foreach ( $schedules as $key => $value ) {
|
183 |
+
if ( ! in_array( $value, $schedules_item ) ) {
|
184 |
+
echo '<option value="' . $key . '" ' . selected( $WP_Statistics->get_option( 'time_report' ), $key ) . '>' . $value['display'] . '</option>';
|
185 |
+
$schedules_item[] = $value;
|
186 |
+
}
|
|
|
|
|
|
|
187 |
}
|
188 |
?>
|
189 |
</select>
|
190 |
|
191 |
+
<p class="description"><?php _e( 'Select how often to receive statistical report.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
192 |
</td>
|
193 |
</tr>
|
194 |
|
253 |
'Any shortcode supported by your installation of WordPress, include all shortcodes for WP Statistics (see the documentation for a list of codes available) are supported in the body of the message. Here are some examples:',
|
254 |
'wp-statistics'
|
255 |
); ?>
|
256 |
+
<br><br> <?php _e( 'Online User', 'wp-statistics' ); ?>: <code>[wpstatistics
|
|
|
257 |
stat=usersonline]</code><br>
|
258 |
<?php _e( 'Today\'s Visitors', 'wp-statistics' ); ?>: <code>[wpstatistics
|
259 |
stat=visitors time=today]</code><br>
|
284 |
<input id="admin-notices" type="checkbox" value="1" name="wps_admin_notices" <?php echo $WP_Statistics->get_option( 'admin_notices' ) == true ? "checked='checked'" : ''; ?>>
|
285 |
<label for="admin-notices"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
286 |
|
287 |
+
<p class="description"><?php _e( 'Show all notices and suggestion from WP-Statistics in the admin.', 'wp-statistics' ); ?></p>
|
288 |
</td>
|
289 |
</tr>
|
290 |
</tbody>
|
includes/settings/tabs/wps-privacy.php
CHANGED
@@ -30,8 +30,7 @@ if ( $wps_nonce_valid ) {
|
|
30 |
</tr>
|
31 |
|
32 |
<tr valign="top">
|
33 |
-
<td scope="row"
|
34 |
-
colspan="2"><?php echo sprintf( __( 'If you want to delete visitor data, please <a href="%s">click here</a>.', 'wp-statistics' ), admin_url( 'admin.php?page=wps_optimization_page&tab=purging' ) ); ?></td>
|
35 |
</tr>
|
36 |
|
37 |
<tr valign="top">
|
@@ -40,12 +39,11 @@ if ( $wps_nonce_valid ) {
|
|
40 |
</th>
|
41 |
|
42 |
<td>
|
43 |
-
<input id="anonymize_ips" type="checkbox" value="1"
|
44 |
-
|
45 |
-
? "checked='checked'" : ''; ?>>
|
46 |
<label for="anonymize_ips"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
47 |
|
48 |
-
<p class="description"><?php echo __('This option anonymizes the user IP address for GDPR compliance. For example, 888.888.888.888 > 888.888.888.000.', 'wp-statistics'); ?></p>
|
49 |
</td>
|
50 |
</tr>
|
51 |
|
@@ -55,8 +53,7 @@ if ( $wps_nonce_valid ) {
|
|
55 |
</th>
|
56 |
|
57 |
<td>
|
58 |
-
<input id="hash_ips" type="checkbox" value="1"
|
59 |
-
name="wps_hash_ips" <?php echo $WP_Statistics->get_option( 'hash_ips' ) == true
|
60 |
? "checked='checked'" : ''; ?>>
|
61 |
<label for="hash_ips"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
62 |
|
@@ -79,8 +76,7 @@ if ( $wps_nonce_valid ) {
|
|
79 |
</th>
|
80 |
|
81 |
<td>
|
82 |
-
<input id="store_ua" type="checkbox" value="1"
|
83 |
-
name="wps_store_ua" <?php echo $WP_Statistics->get_option( 'store_ua' ) == true
|
84 |
? "checked='checked'" : ''; ?>>
|
85 |
<label for="store_ua"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
86 |
|
30 |
</tr>
|
31 |
|
32 |
<tr valign="top">
|
33 |
+
<td scope="row" colspan="2"><?php echo sprintf( __( 'If you want to delete visitor data, please <a href="%s">click here</a>.', 'wp-statistics' ), WP_Statistics_Admin_Pages::admin_url( 'optimization', array( 'tab' => 'purging' ) ) ); ?></td>
|
|
|
34 |
</tr>
|
35 |
|
36 |
<tr valign="top">
|
39 |
</th>
|
40 |
|
41 |
<td>
|
42 |
+
<input id="anonymize_ips" type="checkbox" value="1" name="wps_anonymize_ips" <?php echo $WP_Statistics->get_option( 'anonymize_ips' ) == true
|
43 |
+
? "checked='checked'" : ''; ?>>
|
|
|
44 |
<label for="anonymize_ips"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
45 |
|
46 |
+
<p class="description"><?php echo __( 'This option anonymizes the user IP address for GDPR compliance. For example, 888.888.888.888 > 888.888.888.000.', 'wp-statistics' ); ?></p>
|
47 |
</td>
|
48 |
</tr>
|
49 |
|
53 |
</th>
|
54 |
|
55 |
<td>
|
56 |
+
<input id="hash_ips" type="checkbox" value="1" name="wps_hash_ips" <?php echo $WP_Statistics->get_option( 'hash_ips' ) == true
|
|
|
57 |
? "checked='checked'" : ''; ?>>
|
58 |
<label for="hash_ips"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
59 |
|
76 |
</th>
|
77 |
|
78 |
<td>
|
79 |
+
<input id="store_ua" type="checkbox" value="1" name="wps_store_ua" <?php echo $WP_Statistics->get_option( 'store_ua' ) == true
|
|
|
80 |
? "checked='checked'" : ''; ?>>
|
81 |
<label for="store_ua"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
82 |
|
includes/settings/tabs/wps-removal.php
CHANGED
@@ -64,9 +64,7 @@ if ( $wps_nonce_valid ) {
|
|
64 |
|
65 |
// We need to reload the page after we reset the options but it's too late to do it through a HTTP redirect so do a
|
66 |
// JavaScript redirect instead.
|
67 |
-
echo '<script type="text/javascript">window.location.href="' .
|
68 |
-
admin_url() .
|
69 |
-
'admin.php?page=wps_settings_page";</script>';
|
70 |
}
|
71 |
}
|
72 |
}
|
64 |
|
65 |
// We need to reload the page after we reset the options but it's too late to do it through a HTTP redirect so do a
|
66 |
// JavaScript redirect instead.
|
67 |
+
echo '<script type="text/javascript">window.location.href="' . WP_Statistics_Admin_Pages::admin_url( 'settings' ) . '";</script>';
|
|
|
|
|
68 |
}
|
69 |
}
|
70 |
}
|
includes/settings/wps-settings.php
CHANGED
@@ -1,119 +1,92 @@
|
|
1 |
<?php
|
2 |
-
$wps_nonce_valid = false;
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
8 |
}
|
9 |
|
|
|
10 |
$wps_admin = false;
|
11 |
-
|
12 |
-
|
13 |
-
wp_statistics_validate_capability($WP_Statistics->get_option('manage_capability', 'manage_options'))
|
14 |
-
)) {
|
15 |
-
$wps_admin = true;
|
16 |
}
|
17 |
|
18 |
-
if ($wps_admin === false) {
|
19 |
-
|
20 |
}
|
|
|
21 |
?>
|
22 |
-
<div class="wrap wp-statistics-settings">
|
23 |
-
|
24 |
|
25 |
<div id="poststuff">
|
26 |
<div id="post-body" class="metabox-holder columns-2">
|
27 |
<div class="wp-list-table widefat widefat">
|
28 |
<form id="wp-statistics-settings-form" method="post">
|
29 |
-
|
30 |
<div class="wp-statistics-container">
|
31 |
<ul class="tabs">
|
32 |
-
|
33 |
-
<li class="tab-link current" data-tab="general-settings"><?php _e(
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
<li class="tab-link" data-tab="
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
<li class="tab-link" data-tab="
|
42 |
-
|
43 |
-
|
44 |
-
); ?></li>
|
45 |
-
<li class="tab-link" data-tab="overview-display-settings"><?php _e(
|
46 |
-
'Dashboard',
|
47 |
-
'wp-statistics'
|
48 |
-
); ?></li>
|
49 |
-
<li class="tab-link" data-tab="access-settings"><?php _e(
|
50 |
-
'Access Levels',
|
51 |
-
'wp-statistics'
|
52 |
-
); ?></li>
|
53 |
-
<li class="tab-link" data-tab="exclusions-settings"><?php _e(
|
54 |
-
'Exclusions',
|
55 |
-
'wp-statistics'
|
56 |
-
); ?></li>
|
57 |
-
<li class="tab-link" data-tab="externals-settings"><?php _e(
|
58 |
-
'Externals',
|
59 |
-
'wp-statistics'
|
60 |
-
); ?></li>
|
61 |
-
<li class="tab-link" data-tab="maintenance-settings"><?php _e(
|
62 |
-
'Maintenance',
|
63 |
-
'wp-statistics'
|
64 |
-
); ?></li>
|
65 |
-
<li class="tab-link" data-tab="removal-settings"><?php _e(
|
66 |
-
'Removal',
|
67 |
-
'wp-statistics'
|
68 |
-
); ?></li>
|
69 |
-
<?php } ?>
|
70 |
-
<li class="tab-link" data-tab="about"><?php _e('About', 'wp-statistics'); ?></li>
|
71 |
</ul>
|
72 |
|
73 |
-
|
74 |
<div id="general-settings" class="tab-content current">
|
75 |
-
|
76 |
</div>
|
77 |
<div id="privacy-settings" class="tab-content">
|
78 |
-
|
79 |
</div>
|
80 |
<div id="notifications-settings" class="tab-content">
|
81 |
-
|
82 |
</div>
|
83 |
<div id="overview-display-settings" class="tab-content">
|
84 |
-
|
85 |
</div>
|
86 |
<div id="access-settings" class="tab-content">
|
87 |
-
|
88 |
</div>
|
89 |
<div id="exclusions-settings" class="tab-content">
|
90 |
-
|
91 |
</div>
|
92 |
<div id="externals-settings" class="tab-content">
|
93 |
-
|
94 |
</div>
|
95 |
<div id="maintenance-settings" class="tab-content">
|
96 |
-
|
97 |
</div>
|
98 |
<div id="removal-settings" class="tab-content">
|
99 |
-
|
100 |
</div>
|
101 |
-
|
102 |
<div id="about" class="tab-content">
|
103 |
-
|
104 |
</div>
|
105 |
</div><!-- container -->
|
106 |
</form>
|
107 |
</div>
|
108 |
-
|
109 |
</div>
|
110 |
</div>
|
111 |
</div>
|
112 |
|
113 |
<?php
|
114 |
-
if ($wps_nonce_valid) {
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
}
|
1 |
<?php
|
|
|
2 |
|
3 |
+
//Check Form Security nonce
|
4 |
+
$wps_nonce_valid = false;
|
5 |
+
if ( array_key_exists( 'wp-statistics-nonce', $_POST ) ) {
|
6 |
+
if ( wp_verify_nonce( $_POST['wp-statistics-nonce'], 'update-options' ) ) {
|
7 |
+
$wps_nonce_valid = true;
|
8 |
+
}
|
9 |
}
|
10 |
|
11 |
+
//Check User Access To Save Setting
|
12 |
$wps_admin = false;
|
13 |
+
if ( current_user_can( wp_statistics_validate_capability( $WP_Statistics->get_option( 'manage_capability', 'manage_options' ) ) ) ) {
|
14 |
+
$wps_admin = true;
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
+
if ( $wps_admin === false ) {
|
18 |
+
$wps_admin = 0;
|
19 |
}
|
20 |
+
|
21 |
?>
|
22 |
+
<div class="wrap wps-wrap wp-statistics-settings">
|
23 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Settings', 'wp-statistics' ) ); ?>
|
24 |
|
25 |
<div id="poststuff">
|
26 |
<div id="post-body" class="metabox-holder columns-2">
|
27 |
<div class="wp-list-table widefat widefat">
|
28 |
<form id="wp-statistics-settings-form" method="post">
|
29 |
+
<?php wp_nonce_field( 'update-options', 'wp-statistics-nonce' ); ?>
|
30 |
<div class="wp-statistics-container">
|
31 |
<ul class="tabs">
|
32 |
+
<?php if ( $wps_admin ) { ?>
|
33 |
+
<li class="tab-link current" data-tab="general-settings"><?php _e( 'General', 'wp-statistics' ); ?></li>
|
34 |
+
<li class="tab-link" data-tab="privacy-settings"><?php _e( 'Privacy', 'wp-statistics' ); ?></li>
|
35 |
+
<li class="tab-link" data-tab="notifications-settings"><?php _e( 'Notifications', 'wp-statistics' ); ?></li>
|
36 |
+
<li class="tab-link" data-tab="overview-display-settings"><?php _e( 'Dashboard', 'wp-statistics' ); ?></li>
|
37 |
+
<li class="tab-link" data-tab="access-settings"><?php _e( 'Access Levels', 'wp-statistics' ); ?></li>
|
38 |
+
<li class="tab-link" data-tab="exclusions-settings"><?php _e( 'Exclusions', 'wp-statistics' ); ?></li>
|
39 |
+
<li class="tab-link" data-tab="externals-settings"><?php _e( 'Externals', 'wp-statistics' ); ?></li>
|
40 |
+
<li class="tab-link" data-tab="maintenance-settings"><?php _e( 'Maintenance', 'wp-statistics' ); ?></li>
|
41 |
+
<li class="tab-link" data-tab="removal-settings"><?php _e( 'Removal', 'wp-statistics' ); ?></li>
|
42 |
+
<?php } ?>
|
43 |
+
<li class="tab-link" data-tab="about"><?php _e( 'About', 'wp-statistics' ); ?></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
</ul>
|
45 |
|
46 |
+
<?php if ( $wps_admin ) { ?>
|
47 |
<div id="general-settings" class="tab-content current">
|
48 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-general.php' ); ?>
|
49 |
</div>
|
50 |
<div id="privacy-settings" class="tab-content">
|
51 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-privacy.php' ); ?>
|
52 |
</div>
|
53 |
<div id="notifications-settings" class="tab-content">
|
54 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-notifications.php' ); ?>
|
55 |
</div>
|
56 |
<div id="overview-display-settings" class="tab-content">
|
57 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-overview-display.php' ); ?>
|
58 |
</div>
|
59 |
<div id="access-settings" class="tab-content">
|
60 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-access-level.php' ); ?>
|
61 |
</div>
|
62 |
<div id="exclusions-settings" class="tab-content">
|
63 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-exclusions.php' ); ?>
|
64 |
</div>
|
65 |
<div id="externals-settings" class="tab-content">
|
66 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-externals.php' ); ?>
|
67 |
</div>
|
68 |
<div id="maintenance-settings" class="tab-content">
|
69 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-maintenance.php' ); ?>
|
70 |
</div>
|
71 |
<div id="removal-settings" class="tab-content">
|
72 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-removal.php' ); ?>
|
73 |
</div>
|
74 |
+
<?php } ?>
|
75 |
<div id="about" class="tab-content">
|
76 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . 'includes/settings/tabs/wps-about.php' ); ?>
|
77 |
</div>
|
78 |
</div><!-- container -->
|
79 |
</form>
|
80 |
</div>
|
81 |
+
<?php include WP_Statistics::$reg['plugin-dir'] . 'includes/templates/postbox.php'; ?>
|
82 |
</div>
|
83 |
</div>
|
84 |
</div>
|
85 |
|
86 |
<?php
|
87 |
+
if ( $wps_nonce_valid ) {
|
88 |
+
if ( $wps_admin ) {
|
89 |
+
$WP_Statistics->save_options();
|
90 |
+
}
|
91 |
+
$WP_Statistics->save_user_options();
|
92 |
}
|
includes/templates/add-ons.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="poststuff" class="wp-statistics-plugins">
|
2 |
+
<div id="post-body" class="metabox-holder">
|
3 |
+
<div class="wp-list-table widefat widefat plugin-install">
|
4 |
+
<div id="the-list">
|
5 |
+
<?php foreach ( $plugins->items as $plugin ) : ?>
|
6 |
+
<div class="plugin-card">
|
7 |
+
<?php if ( $plugin->is_feature and $plugin->featured_label ) : ?>
|
8 |
+
<div class="cover-ribbon">
|
9 |
+
<div class="cover-ribbon-inside"><?php echo $plugin->featured_label; ?></div>
|
10 |
+
</div>
|
11 |
+
<?php endif; ?>
|
12 |
+
|
13 |
+
<div class="plugin-card-top">
|
14 |
+
<div class="name column-name">
|
15 |
+
<h3>
|
16 |
+
<a target="_blank" href="<?php echo $plugin->url; ?>" class="thickbox open-plugin-details-modal">
|
17 |
+
<?php echo $plugin->name; ?>
|
18 |
+
<img src="<?php echo $plugin->icon; ?>" class="plugin-icon" alt="">
|
19 |
+
</a>
|
20 |
+
</h3>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<div class="desc column-description">
|
24 |
+
<p><?php echo wp_trim_words( $plugin->description, 15 ); ?></p>
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
<div class="plugin-card-bottom">
|
28 |
+
<div class="column-downloaded">
|
29 |
+
<strong><?php _e( 'Version:', 'wp-statistics' ); ?></strong><?php echo ' ' .
|
30 |
+
$plugin->version; ?>
|
31 |
+
<p><strong><?php _e( 'Status:', 'wp-statistics' ); ?></strong>
|
32 |
+
<?php
|
33 |
+
if ( is_plugin_active( $plugin->slug . '/' . $plugin->slug . '.php' ) ) {
|
34 |
+
_e( 'Active', 'wp-statistics' );
|
35 |
+
} else if ( file_exists(
|
36 |
+
WP_PLUGIN_DIR . '/' . $plugin->slug . '/' . $plugin->slug . '.php'
|
37 |
+
) ) {
|
38 |
+
_e( 'Inactive', 'wp-statistics' );
|
39 |
+
} else {
|
40 |
+
_e( 'Not installed', 'wp-statistics' );
|
41 |
+
}
|
42 |
+
?>
|
43 |
+
</p>
|
44 |
+
</div>
|
45 |
+
<div class="column-compatibility">
|
46 |
+
<?php if ( is_plugin_active( $plugin->slug . '/' . $plugin->slug . '.php' ) ) { ?>
|
47 |
+
<a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'plugins', array( 'action' => 'deactivate', 'plugin' => $plugin->slug ) ); ?>" class="button"><?php _e( 'Deactivate Add-On', 'wp-statistics' ); ?></a>
|
48 |
+
<?php } else { ?><?php if ( file_exists(
|
49 |
+
WP_PLUGIN_DIR . '/' . $plugin->slug . '/' . $plugin->slug . '.php'
|
50 |
+
) ) { ?>
|
51 |
+
<a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'plugins', array( 'action' => 'activate', 'plugin' => $plugin->slug ) ); ?>" class="button"><?php _e( 'Activate Add-On', 'wp-statistics' ); ?></a>
|
52 |
+
<?php } else { ?>
|
53 |
+
<div class="column-price">
|
54 |
+
<strong>$<?php echo $plugin->price; ?></strong>
|
55 |
+
</div>
|
56 |
+
<a target="_blank" href="<?php echo $plugin->url; ?>" class="button-primary"><?php _e( 'Buy Add-On', 'wp-statistics' ); ?></a>
|
57 |
+
<?php } ?><?php } ?>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
<?php endforeach; ?>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
</div>
|
includes/templates/plugins.php
CHANGED
@@ -1,78 +1,6 @@
|
|
1 |
-
<div class="wrap">
|
2 |
-
|
3 |
|
4 |
-
<
|
5 |
-
|
6 |
-
class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
7 |
-
<p><?php _e( 'These extensions add functionality to your WP-Statistics.', 'wp-statistics' ); ?></p>
|
8 |
-
|
9 |
-
<div class="wp-list-table widefat widefat plugin-install">
|
10 |
-
<div id="the-list">
|
11 |
-
<?php foreach ( $plugins->items as $plugin ) : ?>
|
12 |
-
<div class="plugin-card">
|
13 |
-
<?php if ( $plugin->is_feature and $plugin->featured_label ) : ?>
|
14 |
-
<div class="cover-ribbon">
|
15 |
-
<div class="cover-ribbon-inside"><?php echo $plugin->featured_label; ?></div>
|
16 |
-
</div>
|
17 |
-
<?php endif; ?>
|
18 |
-
|
19 |
-
<div class="plugin-card-top">
|
20 |
-
<div class="name column-name">
|
21 |
-
<h3>
|
22 |
-
<a target="_blank" href="<?php echo $plugin->url; ?>"
|
23 |
-
class="thickbox open-plugin-details-modal">
|
24 |
-
<?php echo $plugin->name; ?>
|
25 |
-
<img src="<?php echo $plugin->icon; ?>" class="plugin-icon" alt="">
|
26 |
-
</a>
|
27 |
-
</h3>
|
28 |
-
</div>
|
29 |
-
|
30 |
-
<div class="desc column-description">
|
31 |
-
<p><?php echo wp_trim_words( $plugin->description, 20 ); ?></p>
|
32 |
-
</div>
|
33 |
-
</div>
|
34 |
-
<div class="plugin-card-bottom">
|
35 |
-
<div class="column-downloaded">
|
36 |
-
<strong><?php _e( 'Version:', 'wp-statistics' ); ?></strong><?php echo ' ' .
|
37 |
-
$plugin->version; ?>
|
38 |
-
<p><strong><?php _e( 'Status:', 'wp-statistics' ); ?></strong>
|
39 |
-
<?php
|
40 |
-
if ( is_plugin_active( $plugin->slug . '/' . $plugin->slug . '.php' ) ) {
|
41 |
-
_e( 'Active', 'wp-statistics' );
|
42 |
-
} else if ( file_exists(
|
43 |
-
WP_PLUGIN_DIR . '/' . $plugin->slug . '/' . $plugin->slug . '.php'
|
44 |
-
) ) {
|
45 |
-
_e( 'Inactive', 'wp-statistics' );
|
46 |
-
} else {
|
47 |
-
_e( 'Not installed', 'wp-statistics' );
|
48 |
-
}
|
49 |
-
?>
|
50 |
-
</p>
|
51 |
-
</div>
|
52 |
-
<div class="column-compatibility">
|
53 |
-
<?php if ( is_plugin_active( $plugin->slug . '/' . $plugin->slug . '.php' ) ) { ?>
|
54 |
-
<a href="admin.php?page=wps_plugins_page&action=deactivate&plugin=<?php echo $plugin->slug; ?>"
|
55 |
-
class="button"><?php _e( 'Deactivate Add-On', 'wp-statistics' ); ?></a>
|
56 |
-
<?php } else { ?>
|
57 |
-
<?php if ( file_exists(
|
58 |
-
WP_PLUGIN_DIR . '/' . $plugin->slug . '/' . $plugin->slug . '.php'
|
59 |
-
) ) { ?>
|
60 |
-
<a href="admin.php?page=wps_plugins_page&action=activate&plugin=<?php echo $plugin->slug; ?>"
|
61 |
-
class="button"><?php _e( 'Activate Add-On', 'wp-statistics' ); ?></a>
|
62 |
-
<?php } else { ?>
|
63 |
-
<div class="column-price">
|
64 |
-
<strong>$<?php echo $plugin->price; ?></strong>
|
65 |
-
</div>
|
66 |
-
<a target="_blank" href="<?php echo $plugin->url; ?>"
|
67 |
-
class="button-primary"><?php _e( 'Buy Add-On', 'wp-statistics' ); ?></a>
|
68 |
-
<?php } ?>
|
69 |
-
<?php } ?>
|
70 |
-
</div>
|
71 |
-
</div>
|
72 |
-
</div>
|
73 |
-
<?php endforeach; ?>
|
74 |
-
</div>
|
75 |
-
</div>
|
76 |
-
</div>
|
77 |
-
</div>
|
78 |
</div>
|
1 |
+
<div class="wrap wps-wrap">
|
2 |
+
<?php WP_Statistics_Admin_Pages::show_page_title( __( 'Extensions for WP-Statistics', 'wp-statistics' ) ); ?>
|
3 |
|
4 |
+
<p><p><?php _e( 'These extensions add functionality to your WP-Statistics.', 'wp-statistics' ); ?></p><br/></p>
|
5 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . "includes/templates/add-ons.php" ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
</div>
|
includes/templates/welcome.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<div class="wrap about-wrap full-width-layout">
|
2 |
<div class="wp-statistics-welcome">
|
3 |
<h1><?php printf( __( 'Welcome to WP-Statistics %s', 'wp-statistics' ), WP_Statistics::$reg['version'] ); ?></h1>
|
4 |
|
5 |
<p class="about-text">
|
6 |
-
<?php printf(__('Thank you for updating to the latest version! We encourage you to submit a %srating and review%s over at WordPress.org. Your feedback is greatly appreciated!','wp-statistics'),'<a href="https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post" target="_blank">','</a>'); ?>
|
7 |
<?php _e( 'Submit your rating:', 'wp-statistics' ); ?>
|
8 |
<a href="https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post" target="_blank"><img src="<?php echo plugins_url( 'wp-statistics/assets/images/stars.png' ); ?>"/></a>
|
9 |
</p>
|
@@ -12,15 +12,17 @@
|
|
12 |
|
13 |
<h2 class="nav-tab-wrapper wp-clearfix">
|
14 |
<a href="#" class="nav-tab nav-tab-active" data-tab="whats-news"><?php _e( 'What’s New', 'wp-statistics' ); ?></a>
|
|
|
15 |
<a href="#" class="nav-tab" data-tab="credit"><?php _e( 'Credits', 'wp-statistics' ); ?></a>
|
16 |
<a href="#" class="nav-tab" data-tab="changelog"><?php _e( 'Changelog', 'wp-statistics' ); ?></a>
|
|
|
17 |
</h2>
|
18 |
|
19 |
<div data-content="whats-news" class="tab-content current">
|
20 |
<section class="center-section">
|
21 |
<div class="left">
|
22 |
<div class="content-padding">
|
23 |
-
<h2><?php _e( 'Great update for
|
24 |
</div>
|
25 |
</div>
|
26 |
</section>
|
@@ -28,101 +30,71 @@
|
|
28 |
<section class="normal-section">
|
29 |
<div class="left">
|
30 |
<div class="content-padding">
|
31 |
-
<h2
|
32 |
-
<p><?php _e( '
|
33 |
-
<p><?php _e( '<span style="font-weight: bold;">New:</span> Visitor on Map', 'wp-statistics' ); ?></p>
|
34 |
-
<p><?php _e( '<span style="font-weight: bold;">New:</span> Live Chart', 'wp-statistics' ); ?></p>
|
35 |
-
<p><?php _e( '<span style="font-weight: bold;">New:</span> Better Performance', 'wp-statistics' ); ?></p>
|
36 |
-
<p><?php _e( 'And much more!', 'wp-statistics' ); ?></p>
|
37 |
-
|
38 |
-
<div class="col">
|
39 |
-
<a class="button button-primary button-hero" href="https://wp-statistics.com/downloads/wp-statistics-realtime-stats/" target="_blank">Get Real-Time Stats</a>
|
40 |
-
</div>
|
41 |
</div>
|
42 |
</div>
|
43 |
|
44 |
<div class="right text-center">
|
45 |
-
<img src="<?php echo plugins_url( 'wp-statistics/assets/images/welcome/
|
46 |
</div>
|
47 |
</section>
|
48 |
|
49 |
<section class="normal-section">
|
50 |
<div class="right">
|
51 |
<div class="content-padding">
|
52 |
-
<h2
|
53 |
-
<p><?php _e( '
|
54 |
-
<p><?php _e( 'New: Ability to customize reports based on data widgets.', 'wp-statistics' ); ?></p>
|
55 |
-
<p><?php _e( 'Ability to send preview & test email.', 'wp-statistics' ); ?></p>
|
56 |
-
<p><?php _e( 'Added “Top Countries” stats for sending with the report.', 'wp-statistics' ); ?></p>
|
57 |
-
|
58 |
-
<div class="col">
|
59 |
-
<a class="button button-primary button-hero" href="https://wp-statistics.com/downloads/wp-statistics-advanced-reporting/" target="_blank">Get Advanced Reporting</a>
|
60 |
-
</div>
|
61 |
</div>
|
62 |
</div>
|
63 |
|
64 |
<div class="left text-center">
|
65 |
-
<img src="<?php echo plugins_url( 'wp-statistics/assets/images/welcome/
|
66 |
</div>
|
67 |
</section>
|
68 |
|
69 |
<section class="normal-section">
|
70 |
<div class="left">
|
71 |
<div class="content-padding">
|
72 |
-
<h2><?php _e( '
|
73 |
-
<p><?php _e( '
|
74 |
-
|
75 |
-
<div class="col">
|
76 |
-
<a class="button button-primary button-hero" href="https://wp-statistics.com/downloads/wp-statistics-widgets/" target="_blank">Get Widgets</a>
|
77 |
-
</div>
|
78 |
</div>
|
79 |
</div>
|
80 |
|
81 |
<div class="right text-center">
|
82 |
-
<img src="<?php echo plugins_url( 'wp-statistics/assets/images/welcome/
|
83 |
</div>
|
84 |
</section>
|
85 |
|
86 |
-
<section class="normal-section">
|
87 |
-
<div class="
|
88 |
<div class="content-padding">
|
89 |
-
<h2><?php _e( '
|
90 |
-
<p><?php _e( 'Now include customization and show based on post type settings', 'wp-statistics' ); ?></p>
|
91 |
-
|
92 |
-
<div class="col">
|
93 |
-
<a class="button button-primary button-hero" href="https://wp-statistics.com/downloads/wp-statistics-mini-chart/" target="_blank">Get Mini Chart</a>
|
94 |
-
</div>
|
95 |
</div>
|
96 |
</div>
|
97 |
|
98 |
-
<div class="
|
99 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
</div>
|
101 |
</section>
|
|
|
102 |
|
|
|
103 |
<section class="center-section">
|
104 |
-
|
105 |
-
<div class="content-padding">
|
106 |
-
<h2>Add-Ons Bundle</h2>
|
107 |
-
<p>Buying a bundle is always a good way to access all add-ons with lower money.<br>According to your requests we have defined all 5 add-ons, in a package with a good discount.</p>
|
108 |
-
<p style="margin: 32px 0;"><a href="https://wp-statistics.com/downloads/add-ons-bundle/" target="_blank"><img src="https://wp-statistics.com/wp-content/uploads/2018/12/welcome-page-bundle.png"/></a></p>
|
109 |
-
|
110 |
-
<div class="col">
|
111 |
-
<a class="button button-primary button-hero" href="https://wp-statistics.com/downloads/add-ons-bundle/" target="_blank">Get Add-Ons Bundle!</a>
|
112 |
-
</div>
|
113 |
-
</div>
|
114 |
-
</div>
|
115 |
-
</section>
|
116 |
-
|
117 |
-
<section class="center-section logo">
|
118 |
-
<a href="https://veronalabs.com" target="_blank" title="WordPress Solutions and Services"><img src="http://bit.ly/2FsmZlq"/></a>
|
119 |
-
<p><?php echo __( 'WP-Statistics is one of the VeronaLabs.com projects.', 'wp-statistics' ); ?></p>
|
120 |
</section>
|
121 |
</div>
|
122 |
|
123 |
<div data-content="credit" class="tab-content">
|
124 |
<div class="about-wrap-content">
|
125 |
-
<p class="about-description"><?php echo sprintf( __( 'WP-Statistics is created by some people and is one of the <a href="%s" target="_blank">VeronaLabs.com</a> projects.', 'wp-statistics' ), '
|
126 |
<h3 class="wp-people-group"><?php _e( 'Project Leaders', 'wp-statistics' ); ?></h3>
|
127 |
<ul class="wp-people-group ">
|
128 |
<li class="wp-person">
|
@@ -163,14 +135,12 @@
|
|
163 |
</div>
|
164 |
</div>
|
165 |
|
166 |
-
<div data-content="changelog" class="
|
167 |
-
|
168 |
</div>
|
169 |
-
|
170 |
-
<hr>
|
171 |
-
|
172 |
<div class="wps-return-to-dashboard">
|
173 |
-
<a href="<?php echo admin_url( '
|
174 |
</div>
|
175 |
</div>
|
176 |
</div>
|
1 |
+
<div class="wrap wps-wrap about-wrap full-width-layout">
|
2 |
<div class="wp-statistics-welcome">
|
3 |
<h1><?php printf( __( 'Welcome to WP-Statistics %s', 'wp-statistics' ), WP_Statistics::$reg['version'] ); ?></h1>
|
4 |
|
5 |
<p class="about-text">
|
6 |
+
<?php printf( __( 'Thank you for updating to the latest version! We encourage you to submit a %srating and review%s over at WordPress.org. Your feedback is greatly appreciated!', 'wp-statistics' ), '<a href="https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post" target="_blank">', '</a>' ); ?>
|
7 |
<?php _e( 'Submit your rating:', 'wp-statistics' ); ?>
|
8 |
<a href="https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post" target="_blank"><img src="<?php echo plugins_url( 'wp-statistics/assets/images/stars.png' ); ?>"/></a>
|
9 |
</p>
|
12 |
|
13 |
<h2 class="nav-tab-wrapper wp-clearfix">
|
14 |
<a href="#" class="nav-tab nav-tab-active" data-tab="whats-news"><?php _e( 'What’s New', 'wp-statistics' ); ?></a>
|
15 |
+
<a href="#" class="nav-tab" data-tab="addons"><?php _e( 'Add-Ons', 'wp-statistics' ); ?></a>
|
16 |
<a href="#" class="nav-tab" data-tab="credit"><?php _e( 'Credits', 'wp-statistics' ); ?></a>
|
17 |
<a href="#" class="nav-tab" data-tab="changelog"><?php _e( 'Changelog', 'wp-statistics' ); ?></a>
|
18 |
+
<a href="https://wp-statistics.com/donate/" class="nav-tab donate" data-tab="link" target="_blank"><?php _e( 'Donate', 'wp-statistics' ); ?></a>
|
19 |
</h2>
|
20 |
|
21 |
<div data-content="whats-news" class="tab-content current">
|
22 |
<section class="center-section">
|
23 |
<div class="left">
|
24 |
<div class="content-padding">
|
25 |
+
<h2><?php _e( 'Great update for WP-Statistics', 'wp-statistics' ); ?></h2>
|
26 |
</div>
|
27 |
</div>
|
28 |
</section>
|
30 |
<section class="normal-section">
|
31 |
<div class="left">
|
32 |
<div class="content-padding">
|
33 |
+
<h2><?php _e( 'Online Users Widget', 'wp-statistics' ); ?></h2>
|
34 |
+
<p><?php _e( 'A cool widget to show current online users!', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</div>
|
36 |
</div>
|
37 |
|
38 |
<div class="right text-center">
|
39 |
+
<img src="<?php echo plugins_url( 'wp-statistics/assets/images/welcome/usersonline-widget.png' ); ?>"/>
|
40 |
</div>
|
41 |
</section>
|
42 |
|
43 |
<section class="normal-section">
|
44 |
<div class="right">
|
45 |
<div class="content-padding">
|
46 |
+
<h2><?php _e( 'Top Referring Sites', 'wp-statistics' ); ?></h2>
|
47 |
+
<p><?php _e( 'Site icon, Server IP and minor improvements.', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
</div>
|
49 |
</div>
|
50 |
|
51 |
<div class="left text-center">
|
52 |
+
<img src="<?php echo plugins_url( 'wp-statistics/assets/images/welcome/topreferring-widget.png' ); ?>"/>
|
53 |
</div>
|
54 |
</section>
|
55 |
|
56 |
<section class="normal-section">
|
57 |
<div class="left">
|
58 |
<div class="content-padding">
|
59 |
+
<h2><?php _e( 'Top 10 Counties', 'wp-statistics' ); ?></h2>
|
60 |
+
<p><?php _e( 'You can see all visitor of a country!', 'wp-statistics' ); ?></p>
|
|
|
|
|
|
|
|
|
61 |
</div>
|
62 |
</div>
|
63 |
|
64 |
<div class="right text-center">
|
65 |
+
<img src="<?php echo plugins_url( 'wp-statistics/assets/images/welcome/topcountry-widget.png' ); ?>"/>
|
66 |
</div>
|
67 |
</section>
|
68 |
|
69 |
+
<section class="normal-section" style="border-bottom: 0px none;">
|
70 |
+
<div class="left">
|
71 |
<div class="content-padding">
|
72 |
+
<h2><?php _e( 'Other changes', 'wp-statistics' ); ?></h2>
|
|
|
|
|
|
|
|
|
|
|
73 |
</div>
|
74 |
</div>
|
75 |
|
76 |
+
<div class="right">
|
77 |
+
<ul>
|
78 |
+
<li>Added new table `visitor_relationship` for saving visitors logs.</li>
|
79 |
+
<li>Update database version.</li>
|
80 |
+
<li>Improvement MySQL time query in all functions.</li>
|
81 |
+
<li>Improvement CSV exporter.</li>
|
82 |
+
<li>Improvement pagination in admin pages.</li>
|
83 |
+
<li>Improvement time filter in admin pages stats.</li>
|
84 |
+
</ul>
|
85 |
</div>
|
86 |
</section>
|
87 |
+
</div>
|
88 |
|
89 |
+
<div data-content="addons" class="tab-content">
|
90 |
<section class="center-section">
|
91 |
+
<?php include( WP_Statistics::$reg['plugin-dir'] . "includes/templates/add-ons.php" ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
</section>
|
93 |
</div>
|
94 |
|
95 |
<div data-content="credit" class="tab-content">
|
96 |
<div class="about-wrap-content">
|
97 |
+
<p class="about-description"><?php echo sprintf( __( 'WP-Statistics is created by some people and is one of the <a href="%s" target="_blank">VeronaLabs.com</a> projects.', 'wp-statistics' ), 'https://veronalabs.com' ); ?></p>
|
98 |
<h3 class="wp-people-group"><?php _e( 'Project Leaders', 'wp-statistics' ); ?></h3>
|
99 |
<ul class="wp-people-group ">
|
100 |
<li class="wp-person">
|
135 |
</div>
|
136 |
</div>
|
137 |
|
138 |
+
<div data-content="changelog" class="tab-content">
|
139 |
+
<?php WP_Statistics_Welcome::show_change_log(); ?>
|
140 |
</div>
|
141 |
+
<hr style="clear: both;">
|
|
|
|
|
142 |
<div class="wps-return-to-dashboard">
|
143 |
+
<a href="<?php echo WP_Statistics_Admin_Pages::admin_url( 'overview' ); ?>"><?php _e( 'Go to Statistics → Overview', 'wp-statistics' ); ?></a>
|
144 |
</div>
|
145 |
</div>
|
146 |
</div>
|
includes/vendor/composer/ClassLoader.php
CHANGED
@@ -377,7 +377,7 @@ class ClassLoader
|
|
377 |
$subPath = $class;
|
378 |
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
$subPath = substr($subPath, 0, $lastPos);
|
380 |
-
$search = $subPath
|
381 |
if (isset($this->prefixDirsPsr4[$search])) {
|
382 |
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
383 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
377 |
$subPath = $class;
|
378 |
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
$subPath = substr($subPath, 0, $lastPos);
|
380 |
+
$search = $subPath.'\\';
|
381 |
if (isset($this->prefixDirsPsr4[$search])) {
|
382 |
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
383 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
includes/vendor/composer/installed.json
CHANGED
@@ -161,17 +161,17 @@
|
|
161 |
},
|
162 |
{
|
163 |
"name": "jaybizzle/crawler-detect",
|
164 |
-
"version": "v1.2.
|
165 |
-
"version_normalized": "1.2.
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
|
169 |
-
"reference": "
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
-
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/
|
174 |
-
"reference": "
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
@@ -181,7 +181,7 @@
|
|
181 |
"phpunit/phpunit": "^4.8|^5.5|^6.5",
|
182 |
"satooshi/php-coveralls": "1.*"
|
183 |
},
|
184 |
-
"time": "
|
185 |
"type": "library",
|
186 |
"installation-source": "dist",
|
187 |
"autoload": {
|
@@ -212,17 +212,17 @@
|
|
212 |
},
|
213 |
{
|
214 |
"name": "maxmind-db/reader",
|
215 |
-
"version": "v1.
|
216 |
-
"version_normalized": "1.
|
217 |
"source": {
|
218 |
"type": "git",
|
219 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
220 |
-
"reference": "
|
221 |
},
|
222 |
"dist": {
|
223 |
"type": "zip",
|
224 |
-
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/
|
225 |
-
"reference": "
|
226 |
"shasum": ""
|
227 |
},
|
228 |
"require": {
|
@@ -239,7 +239,7 @@
|
|
239 |
"ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
|
240 |
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
|
241 |
},
|
242 |
-
"time": "
|
243 |
"type": "library",
|
244 |
"installation-source": "dist",
|
245 |
"autoload": {
|
161 |
},
|
162 |
{
|
163 |
"name": "jaybizzle/crawler-detect",
|
164 |
+
"version": "v1.2.78",
|
165 |
+
"version_normalized": "1.2.78.0",
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
|
169 |
+
"reference": "0f91f34d375ddd5d7034b9eaf6b74acd0b2a0ed6"
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
+
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/0f91f34d375ddd5d7034b9eaf6b74acd0b2a0ed6",
|
174 |
+
"reference": "0f91f34d375ddd5d7034b9eaf6b74acd0b2a0ed6",
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
181 |
"phpunit/phpunit": "^4.8|^5.5|^6.5",
|
182 |
"satooshi/php-coveralls": "1.*"
|
183 |
},
|
184 |
+
"time": "2019-01-15T21:21:27+00:00",
|
185 |
"type": "library",
|
186 |
"installation-source": "dist",
|
187 |
"autoload": {
|
212 |
},
|
213 |
{
|
214 |
"name": "maxmind-db/reader",
|
215 |
+
"version": "v1.4.1",
|
216 |
+
"version_normalized": "1.4.1.0",
|
217 |
"source": {
|
218 |
"type": "git",
|
219 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
220 |
+
"reference": "eb83d0ee1c1f9b8a340206302136bc81ee02ae74"
|
221 |
},
|
222 |
"dist": {
|
223 |
"type": "zip",
|
224 |
+
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/eb83d0ee1c1f9b8a340206302136bc81ee02ae74",
|
225 |
+
"reference": "eb83d0ee1c1f9b8a340206302136bc81ee02ae74",
|
226 |
"shasum": ""
|
227 |
},
|
228 |
"require": {
|
239 |
"ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
|
240 |
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
|
241 |
},
|
242 |
+
"time": "2019-01-04T19:55:56+00:00",
|
243 |
"type": "library",
|
244 |
"installation-source": "dist",
|
245 |
"autoload": {
|
includes/vendor/jaybizzle/crawler-detect/raw/Crawlers.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
[".*Java.*outbrain"," YLT","008\\\/","192\\.comAgent","2ip\\.ru","404checker","404enemy","80legs","^b0t$","^bluefish ","^Calypso v\\\/","^COMODO DCV","^DangDang","^DavClnt","^FDM ","^git\\\/","^Goose\\\/","^Grabber","^HTTPClient\\\/","^Java\\\/","^Jeode\\\/","^Jetty\\\/","^Mail\\\/","^Mget","^Microsoft URL Control","^NG\\\/[0-9\\.]","^NING\\\/","^PHP\\\/[0-9]","^RMA\\\/","^Ruby|Ruby\\\/[0-9]","^VSE\\\/[0-9]","^WordPress\\.com","^XRL\\\/[0-9]","^ZmEu","a3logics\\.in","A6-Indexer","a\\.pr-cy\\.ru","Abonti","Aboundex","aboutthedomain","Accoona-AI-Agent","acoon","acrylicapps\\.com\\\/pulp","Acunetix","AdAuth\\\/","adbeat","AddThis","ADmantX","adressendeutschland","adscanner\\\/","Advanced Email Extractor v","agentslug","AHC","aihit","aiohttp\\\/","Airmail","akka-http\\\/","akula\\\/","alertra","alexa site audit","Alibaba\\.Security\\.Heimdall","Alligator","allloadin\\.com","AllSubmitter","alyze\\.info","amagit","Anarchie","AndroidDownloadManager","Anemone","AngleSharp\\\/","annotate_google","Ant\\.com","Anturis Agent","AnyEvent-HTTP\\\/","Apache Droid","Apache OpenOffice","Apache-HttpAsyncClient\\\/","Apache-HttpClient\\\/","ApacheBench\\\/","Apexoo","APIs-Google","AportWorm\\\/[0-9]","AppBeat\\\/[0-9]","AppEngine-Google","AppStoreScraperZ","Arachmo","arachnode","Arachnophilia","aria2","Arukereso","asafaweb.com","AskQuickly","ASPSeek","Asterias","Astute","asynchttp","Attach","autocite","Autonomy","axios\\\/","B-l-i-t-z-B-O-T","Backlink-Ceck","backlink-check","BackStreet","BackWeb","Bad-Neighborhood","Badass","baidu\\.com","Bandit","BatchFTP","Battleztar\\ Bazinga","baypup\\\/[0-9]","baypup\\\/colbert","BazQux","BBBike","BCKLINKS","BDFetch","BegunAdvertising\\\/","Bidtellect\\\/","BigBozz","Bigfoot","biglotron","BingLocalSearch","BingPreview","binlar","biNu image cacher","Bitacle","biz_Directory","Black\\ Hole","Blackboard Safeassign","BlackWidow","BlockNote\\.Net","Bloglines\\\/","Bloglovin","BlogPulseLive","BlogSearch","Blogtrottr","BlowFish","Boardreader","boitho\\.com-dc","BPImageWalker","Braintree-Webhooks","Branch Metrics API","Branch-Passthrough","Brandprotect","Brandwatch","Brodie\\\/","Browsershots","BUbiNG","Buck\\\/","Buddy","BuiltWith","Bullseye","BunnySlippers","Burf Search","Butterfly\\\/","BuzzSumo","CAAM\\\/[0-9]","CakePHP","Calculon","CapsuleChecker","CaretNail","catexplorador","cb crawl","CC Metadata Scaper","Cegbfeieh","Cerberian Drtrs","CERT\\.at-Statistics-Survey","cg-eye","changedetection","ChangesMeter\\\/","Charlotte","CheckHost","checkprivacy","CherryPicker","ChinaClaw","Chirp\\\/[0-9]","chkme\\.com","Chlooe","CirrusExplorer\\\/","CISPA Vulnerability Notification","Citoid","CJNetworkQuality","Clarsentia","clips\\.ua\\.ac\\.be","Cloud\\ mapping","CloudEndure","CloudFlare-AlwaysOnline","Cloudinary\\\/[0-9]","cmcm\\.com","coccoc","cognitiveseo","colly -","CommaFeed","Commons-HttpClient","Comodo SSL Checker","contactbigdatafr","contentkingapp","convera","CookieReports\\.com","copyright sheriff","CopyRightCheck","Copyscape","Cosmos4j\\.feedback","Covario-IDS","CrawlForMe\\\/[0-9]","Crescent","cron-job\\.org","Crowsnest","CSHttp","curb","Curious George","curl","cuwhois\\\/[0-9]","cybo\\.com","DareBoost","DatabaseDriverMysqli","DataCha0s","Datanyze","DataparkSearch","dataprovider","DataXu","Daum(oa)?[ \\\/][0-9]","DemandbasePublisherAnalyzer\\\/","Demon","DeuSu","developers\\.google\\.com\\\/\\+\\\/web\\\/snippet\\\/","Devil","Digg","Digincore","DigitalPebble","Dirbuster","Dispatch\\\/","DittoSpyder","dlvr","DMBrowser","DNS-Tools Header-Analyzer","DNSPod-reporting","docoloc","Dolphin http client\\\/","DomainAppender","Donuts Content Explorer","dotMailer content retrieval","dotSemantic","downforeveryoneorjustme","Download\\ Wonder","downnotifier\\.com","DowntimeDetector","Dragonfly File Reader","Drip","drupact","Drupal \\(\\+http:\\\/\\\/drupal\\.org\\\/\\)","DTS\\ Agent","dubaiindex","EARTHCOM","Easy-Thumb","EasyDL","Ebingbong","ec2linkfinder","eCairn-Grabber","eCatch","ECCP","echocrawl","eContext\\\/","Ecxi","EirGrabber","ElectricMonk","elefent","EMail Exractor","Email%20Extractor%20Lite","EMail\\ Wolf","EmailWolf","Embed PHP Library","Embedly","endo\\\/","europarchive\\.org","evc-batch","EventMachine HttpClient","Everwall Link Expander","Evidon","Evrinid","ExactSearch","ExaleadCloudview","Excel\\\/","Exif Viewer","ExperianCrawlUK","Exploratodo","Express WebPictures","ExtractorPro","Extreme\\ Picture\\ Finder","EyeNetIE","ezooms","facebookexternalhit","facebookplatform","fairshare","Faraday v","fasthttp","Faveeo","Favicon downloader","FavOrg","Feed Wrangler","Feedable\\\/","Feedbin","FeedBooster","FeedBucket","FeedBunch\\\/[0-9]","FeedBurner","FeedChecker","Feedly","Feedreader","FeedshowOnline","Feedspot","Feedwind\\\/[0-9]","FeedZcollector","feeltiptop","Fetch API","Fetch\\\/[0-9]","Fever\\\/[0-9]","FHscan","Fimap","findlink","findthatfile","FlashGet","FlipboardBrowserProxy","FlipboardProxy","FlipboardRSS","Flock\\\/","fluffy","Flunky","flynxapp","forensiq","FoundSeoTool\\\/[0-9]","free thumbnails","Freeuploader","FreeWebMonitoring SiteChecker","Funnelback","G-i-g-a-b-o-t","g00g1e\\.net","GAChecker","ganarvisitas\\\/[0-9]","geek-tools","Genderanalyzer","Genieo","GentleSource","Getintent","GetLinkInfo","getprismatic\\.com","GetRight","GetURLInfo\\\/[0-9]","GetWeb","Ghost Inspector","GigablastOpenSource","GIS-LABS","github-camo","github\\.com\\\/","Go [\\d\\.]* package http","Go http package","Go!Zilla","Go-Ahead-Got-It","Go-http-client","gobyus","gofetch","GomezAgent","gooblog","Goodzer\\\/[0-9]","GoogleCloudMonitoring","Google favicon","Google Keyword Suggestion","Google Keyword Tool","Google Page Speed Insights","Google PP Default","Google Search Console","Google Web Preview","Google-Adwords","Google-Apps-Script","Google-Calendar-Importer","Google-HotelAdsVerifier","Google-HTTP-Java-Client","Google-Publisher-Plugin","Google-SearchByImage","Google-Site-Verification","Google-Structured-Data-Testing-Tool","Google-Youtube-Links","google_partner_monitoring","GoogleDocs","GoogleHC\\\/","GoogleProducer","Gookey","GoScraper","GoSpotCheck","GoSquared-Status-Checker","gosquared-thumbnailer","Gotit","GoZilla","grabify","GrabNet","Grafula","Grammarly","GrapeFX","grokkit","grouphigh","grub-client","gSOAP\\\/","GT::WWW","GTmetrix","GuzzleHttp","gvfs\\\/","HAA(A)?RTLAND http client","Haansoft","hackney\\\/","Hatena","Havij","hawkReader","HEADMasterSEO","HeartRails_Capture","help@dataminr\\.com","heritrix","historious\\\/","hledejLevne\\.cz\\\/[0-9]","Hloader","HMView","Holmes","HonesoSearchEngine\\\/","HootSuite Image proxy","Hootsuite-WebFeed\\\/[0-9]","hosterstats","HostTracker","ht:\\\/\\\/check","htdig","HTMLparser","htmlyse\\.com","http-get","HTTP-Header-Abfrage","http-kit","http-request\\\/","HTTP-Tiny","HTTP::Lite","http\\.rb\\\/","HTTP_Compression_Test","http_request2","http_requester","HttpComponents","httphr","HTTPMon","httpscheck","httpssites_power","httpunit","HttpUrlConnection","httrack","huaweisymantec","HubPages.*crawlingpolicy","HubSpot ","Humanlinks","HyperZbozi.cz Feeder","i2kconnect\\\/","Iblog","ichiro","Id-search","IdeelaborPlagiaat","IDG Twitter Links Resolver","IDwhois\\\/[0-9]","Iframely","igdeSpyder","IlTrovatore","ImageVisu\\\/","Image\\ Fetch","Image\\ Sucker","ImageEngine\\\/","Imagga","imgsizer","InAGist","inbound\\.li parser","InDesign%20CC","Indy\\ Library","InetURL","infegy","infohelfer","InfoTekies","InfoWizards Reciprocal Link System PRO","inpwrd\\.com","instabid","Instapaper","Integrity","integromedb","Intelliseek","InterGET","Internet\\ Ninja","internet_archive","InternetSeer","internetVista monitor","intraVnews","IODC","IOI","iplabel","ips-agent","IPS\\\/[0-9]","IPWorks HTTP\\\/S Component","iqdb\\\/","Iria","Irokez","isitup\\.org","iskanie","iZSearch","janforman","Jaunt\\\/","Jbrofuzz","Jersey\\\/","JetCar","Jigsaw","Jobboerse","JobFeed discovery","Jobg8 URL Monitor","jobo","Jobrapido","Jobsearch1\\.5","JoinVision Generic","JolokiaPwn","Joomla","Jorgee","JS-Kit","JustView","Kaspersky Lab CFR link resolver","KeepRight OpenStreetMap Checker","Kelny\\\/","Kerrigan\\\/","KeyCDN","Keyword Extractor","Keyword\\ Density","Keywords Research","KickFire","KimonoLabs\\\/","Kml-Google","knows\\.is","KOCMOHABT","kouio","kube-probe","kulturarw3","KumKie","L\\.webis","Larbin","Lavf\\\/","LayeredExtractor","LeechFTP","LeechGet","letsencrypt","Lftp","LibVLC","LibWeb","Libwhisker","libwww","Licorne Image Snapshot","Liferea\\\/","Lightspeedsystems","Likse","link checker","Link Valet","link_thumbnailer","LinkAlarm\\\/","linkCheck","linkdex","LinkExaminer","linkfluence","linkpeek","LinkPreviewGenerator","LinkScan","LinksManager","LinkTiger","LinkWalker","Lipperhey","Litemage_walker","livedoor ScreenShot","LoadImpactRload","localsearch-web","LongURL API","looksystems\\.net","ltx71","lua-resty-http","lwp-request","lwp-trivial","LWP::Simple","lycos","LYT\\.SR","mabontland","Mag-Net","MagpieRSS","Mail.Ru","MailChimp","Majestic12","makecontact\\\/","Mandrill","MapperCmd","marketinggrader","MarkMonitor","MarkWatch","Mass\\ Downloader","masscan\\\/[0-9]","Mata\\ Hari","Mediapartners-Google","mediawords","MegaIndex\\.ru","Melvil Rawi\\\/","MergeFlow-PageReader","Metaspinner","MetaURI","MFC_Tear_Sample","Microsearch","Microsoft Office ","Microsoft Outlook","Microsoft Windows Network Diagnostics","Microsoft-WebDAV-MiniRedir","Microsoft\\ Data\\ Access","MIDown\\ tool","MIIxpc","Mindjet","Miniature.io\\\/","Miniflux","Mister\\ PiX","mixdata dot com","mixed-content-scan","Mixmax-LinkPreview","mixnode","Mnogosearch","mogimogi","Mojeek","Mojolicious \\(Perl\\)","monitis","Monit\\\/","Monitority\\\/[0-9]","montastic","MonTools","Moreover","Morfeus\\ Fucking\\ Scanner","Morning Paper","MovableType","mowser","Mrcgiguy","MS\\ Web\\ Services\\ Client\\ Protocol","MSFrontPage","mShots","MuckRack\\\/","muhstik-scan","MVAClient","MxToolbox\\\/","nagios","Najdi\\.si\\\/","Name\\ Intelligence","Nameprotect","Navroad","NearSite","Needle","Nessus","Net\\ Vampire","NetAnts","NETCRAFT","NetLyzer","NetMechanic","NetNewsWire","Netpursual","netresearch","NetShelter ContentScan","Netsparker","NetTrack","Netvibes","NetZIP","Neustar WPM","NeutrinoAPI","NewRelicPinger","NewsBlur .*Finder","NewsGator","newsme","newspaper\\\/","Nexgate Ruby Client","NG-Search","Nibbler","NICErsPRO","Nikto","nineconnections\\.com","NLNZ_IAHarvester","Nmap Scripting Engine","node-superagent","node-urllib\\\/","node\\.io","nominet\\.org\\.uk","Norton-Safeweb","Notifixious","notifyninja","nuhk","nutch","Nuzzel","nWormFeedFinder","Nymesis","NYU","Ocelli\\\/[0-9]","Octopus","oegp","og-scraper\\\/","Offline Explorer","Offline\\ Navigator","okhttp","Omea Reader","omgili","OMSC","Online Domain Tools","OpenCalaisSemanticProxy","Openfind","OpenLinkProfiler","Openstat\\\/","OpenVAS","Optimizer","Orbiter","OrgProbe\\\/[0-9]","orion-semantics","Outlook-Express","ow\\.ly","Owler","ownCloud News","OxfordCloudService\\\/[0-9]","Page Analyzer","Page Valet","page2rss","page\\ scorer","page_verifier","PageAnalyzer","PageGrabber","PagePeeker","PageScorer","Pagespeed\\\/[0-9]","Panopta","panscient","Papa\\ Foto","parsijoo","Pavuk","PayPal IPN","pcBrowser","Pcore-HTTP","PEAR HTTPRequest","Pearltrees","PECL::HTTP","peerindex","Peew","PeoplePal","Perlu -","PhantomJS Screenshoter","PhantomJS\\\/","Photon\\\/","phpcrawl","phpservermon","Pi-Monster","Picscout","Picsearch","PictureFinder","Pimonster","ping\\.blo\\.gs\\\/","Pingability","PingAdmin\\.Ru","Pingdom","Pingoscope","PingSpot","pinterest\\.com","Pixray","Pizilla","Plagger\\\/","PleaseCrawl","Ploetz \\+ Zeller","Plukkie","plumanalytics","PocketParser","Pockey","POE-Component-Client-HTTP","Pompos","Porkbun","Port Monitor","postano","PostmanRuntime\\\/","PostPost","postrank","PowerPoint\\\/","Priceonomics Analysis Engine","PrintFriendly\\.com","PritTorrent\\\/[0-9]","Prlog","probethenet","Project 25499","Promotion_Tools_www.searchenginepromotionhelp.com","prospectb2b","Protopage","ProWebWalker","proximic","PRTG Network Monitor","pshtt, https scanning","PTST ","PTST\\\/[0-9]+","Pulsepoint XT3 web scraper","Pump","Python-httplib2","python-requests","Python-urllib","Qirina Hurdler","QQDownload","QrafterPro","Qseero","Qualidator.com SiteAnalyzer","QueryN\\ Metasearch","Quora Link Preview","Qwantify","Radian6","RankActive","RankFlex","RankSonicSiteAuditor","raynette_httprequest","Readability","RealDownload","RealPlayer%20Downloader","RebelMouse","Recorder","RecurPost\\\/","redback\\\/","Redirect Checker Tool","ReederForMac","ReGet","RepoMonkey","request\\.js","ResponseCodeTest\\\/[0-9]","RestSharp","Riddler","Rival IQ","Robosourcer","Robozilla\\\/[0-9]","ROI Hunter","RPT-HTTPClient","RSSOwl","RssReader\\\/","safe-agent-scanner","SalesIntelligent","Saleslift","SauceNAO","SBIder","scalaj-http","scan\\.lol","ScanAlert","ScrapeBox Page Scanner","Scoop","scooter","ScoutJet","ScoutURLMonitor","Scrapy","Screaming","ScreenShotService\\\/[0-9]","Scrubby","Scrutiny\\\/","Search37\\\/","search\\.thunderstone","Searchestate","SearchExpress","SearchSight","Seeker","semanticdiscovery","semanticjuice","Semiocast HTTP client","Semrush","sentry\\\/","SEO Browser","Seo Servis","seo-nastroj.cz","Seobility","SEOCentro","SeoCheck","SEOkicks","Seomoz","SEOprofiler","SeopultContentAnalyzer","seoscanners","SEOstats","Server Density Service Monitoring","servernfo\\.com","SetCronJob\\\/","sexsearcher","Seznam","Shelob","Shodan","Shoppimon Analyzer","ShoppimonAgent\\\/[0-9]","ShopWiki","ShortLinkTranslate","shrinktheweb","Sideqik","SilverReader","SimplePie","SimplyFast","Siphon","SISTRIX","Site-Shot\\\/","Site24x7","Site\\ Sucker","SiteBar","Sitebeam","Sitebulb\\\/","SiteCondor","SiteExplorer","SiteGuardian","Siteimprove","SiteIndexed","Sitemap(s)? Generator","SiteMonitor","Siteshooter B0t","SiteSnagger","SiteSucker","SiteTruth","Sitevigil","sitexy\\.com","SkypeUriPreview","Slack\\\/","slider\\.com","slurp","SlySearch","SmartDownload","SMRF URL Expander","SMUrlExpander","Snarfer\\\/","Snake","Snappy","SniffRSS","sniptracker","Snoopy","SnowHaze Search","sogou web","SortSite","Sottopop","sovereign\\.ai","SpaceBison","Spammen","Spanner","spaziodati","SPDYCheck","Specificfeeds","speedy","SPEng","Spinn3r","spray-can","Sprinklr ","spyonweb","sqlmap","Sqlworm","Sqworm","SSL Labs","ssl-tools","StackRambler","Statastico\\\/","StatusCake","Steeler","Stratagems Kumo","Stroke.cz","StudioFACA","suchen","Sucuri","summify","Super Monitoring","SuperHTTP","Surphace Scout","Suzuran","SwiteScraper","Symfony BrowserKit","Symfony2 BrowserKit","SynHttpClient-Built","Sysomos","sysscan","Szukacz","T0PHackTeam","tAkeOut","Tarantula\\\/","Taringa UGC","Teleport","Telesoft","Telesphoreo","Telesphorep","Tenon\\.io","teoma","terrainformatica\\.com","Test Certificate Info","Tetrahedron\\\/[0-9]","The Drop Reaper","The Expert HTML Source Viewer","The Knowledge AI","The\\ Intraformant","theinternetrules","TheNomad","theoldreader\\.com","Thinklab","Thumbshots","ThumbSniper","TinEye","Tiny Tiny RSS","TLSProbe\\\/","Toata","topster","touche.com","Traackr.com","TrapitAgent","Trendiction","Trendsmap Resolver","trendspottr\\.com","truwoGPS","TulipChain","Turingos","Turnitin","tweetedtimes\\.com","Tweetminster","Tweezler\\\/","twibble","Twice","Twikle","Twingly","Twisted PageGetter","Typhoeus","ubermetrics-technologies","uclassify","uCrawlr\\\/","UdmSearch","unirest-java","UniversalFeedParser","Unshorten\\.It","Untiny","UnwindFetchor","updated","updown\\.io daemon","Upflow","Uptimia","URL Verifier","URLChecker","URLitor.com","urlresolver","Urlstat","UrlTrends Ranking Updater","URLy\\ Warning","URLy\\.Warning","Vacuum","Vagabondo","VB\\ Project","vBSEO","VCI","via ggpht\\.com GoogleImageProxy","VidibleScraper","Virusdie","visionutils","vkShare","VoidEYE","Voil","voltron","voyager\\\/","VSAgent\\\/[0-9]","VSB-TUO\\\/[0-9]","Vulnbusters Meter","VYU2","w3af\\.org","W3C-checklink","W3C-mobileOK","W3C_I18n-Checker","W3C_Unicorn","Wallpapers\\\/[0-9]+","WallpapersHD","wangling","Wappalyzer","WatchMouse","WbSrch\\\/","web-capture\\.net","Web-Monitoring","Web-sniffer","Web\\ Auto","Web\\ Collage","Web\\ Enhancer","Web\\ Fetch","Web\\ Fuck","Web\\ Pix","Web\\ Sauger","Web\\ Sucker","Webalta","Webauskunft","WebAuto","WebCapture","WebClient\\\/","webcollage","WebCookies","WebCopier","WebCorp","WebDoc","WebEnhancer","WebFetch","WebFuck","WebGo\\ IS","WebImageCollector","WebImages","WebIndex","webkit2png","WebLeacher","webmastercoffee","webmon ","WebPix","WebReaper","WebSauger","webscreenie","Webshag","Webshot","Website Analyzer\\\/","Website\\ Quester","WebsiteExtractor","websitepulse agent","websitepulse[+ ]checker","WebsiteQuester","Websnapr\\\/","Webster","WebStripper","WebSucker","Webthumb\\\/[0-9]","WebThumbnail","WebWhacker","WebZIP","WeCrawlForThePeace","WeLikeLinks","WEPA","WeSEE","wf84","Wfuzz\\\/","wget","WhatsApp","WhatsMyIP","WhatWeb","WhereGoes\\?","Whibse","WhoRunsCoinHive","Whynder Magnet","Windows-RSS-Platform","WinHttpRequest","WinPodder","wkhtmlto","wmtips","Woko","Word\\\/","WordPress\\\/","WordupinfoSearch","wotbox","WP Engine Install Performance API","wpif","wprecon\\.com survey","WPScan","wscheck","Wtrace","WWW-Collector-E","WWW-Mechanize","WWW::Mechanize","www\\.monitor\\.us","WWWOFFLE","x09Mozilla","x22Mozilla","XaxisSemanticsClassifier","Xenu Link Sleuth","XING-contenttabreceiver\\\/[0-9]","XmlSitemapGenerator","xpymep([0-9]?)\\.exe","Y!J-(ASR|BSC)","Yaanb","yacy","Yahoo Ad monitoring","Yahoo Link Preview","YahooCacheSystem","YahooYSMcm","YandeG","Yandex(?!Search)","yanga","yeti","Yo-yo","Yoleo Consumer","yoogliFetchAgent","YottaaMonitor","Your-Website-Sucks\\\/[0-9]","yourls\\.org","Zade","Zao","Zauba","Zemanta Aggregator","Zend\\\\Http\\\\Client","Zend_Http_Client","Zermelo","Zeus","zgrab","ZnajdzFoto","Zombie\\.js","ZyBorg","SpamExperts","[a-z0-9\\-_]*(bot|crawler|archiver|transcoder|spider|uptime|validator|fetcher)"]
|
1 |
+
[".*Java.*outbrain"," YLT","^b0t$","^bluefish ","^Calypso v\\\/","^COMODO DCV","^DangDang","^DavClnt","^FDM ","^git\\\/","^Goose\\\/","^Grabber","^HTTPClient\\\/","^Java\\\/","^Jeode\\\/","^Jetty\\\/","^Mail\\\/","^Mget","^Microsoft URL Control","^NG\\\/[0-9\\.]","^NING\\\/","^PHP\\\/[0-9]","^RMA\\\/","^Ruby|Ruby\\\/[0-9]","^VSE\\\/[0-9]","^WordPress\\.com","^XRL\\\/[0-9]","^ZmEu","008\\\/","13TABS","192\\.comAgent","2ip\\.ru","404enemy","7Siters","80legs","a\\.pr-cy\\.ru","a3logics\\.in","A6-Indexer","Abonti","Aboundex","aboutthedomain","Accoona-AI-Agent","acoon","acrylicapps\\.com\\\/pulp","Acunetix","AdAuth\\\/","adbeat","AddThis","ADmantX","AdminLabs","adressendeutschland","adscanner","agentslug","AHC","aihit","aiohttp\\\/","Airmail","akka-http\\\/","akula\\\/","alertra","alexa site audit","Alibaba\\.Security\\.Heimdall","Alligator","allloadin","AllSubmitter","alyze\\.info","amagit","Anarchie","AndroidDownloadManager","Anemone","AngleSharp","annotate_google","Ant\\.com","Anturis Agent","AnyEvent-HTTP\\\/","Apache Droid","Apache OpenOffice","Apache-HttpAsyncClient","Apache-HttpClient","ApacheBench","Apexoo","APIs-Google","AportWorm\\\/","AppBeat\\\/","AppEngine-Google","AppStoreScraperZ","Aprc\\\/[0-9]","Arachmo","arachnode","Arachnophilia","aria2","Arukereso","asafaweb","AskQuickly","Ask Jeeves","ASPSeek","Asterias","Astute","asynchttp","Attach","autocite","Autonomy","axios\\\/","B-l-i-t-z-B-O-T","Backlink-Ceck","backlink-check","BacklinkHttpStatus","BackStreet","BackWeb","Bad-Neighborhood","Badass","baidu\\.com","Bandit","basicstate","BatchFTP","Battleztar Bazinga","baypup\\\/","BazQux","BBBike","BCKLINKS","BDFetch","BegunAdvertising","Bidtellect","BigBozz","Bigfoot","biglotron","BingLocalSearch","BingPreview","binlar","biNu image cacher","Bitacle","biz_Directory","Black Hole","Blackboard Safeassign","BlackWidow","BlockNote\\.Net","Bloglines","Bloglovin","BlogPulseLive","BlogSearch","Blogtrottr","BlowFish","boitho\\.com-dc","BPImageWalker","Braintree-Webhooks","Branch Metrics API","Branch-Passthrough","Brandprotect","BrandVerity","Brandwatch","Brodie\\\/","Browsershots","BUbiNG","Buck\\\/","Buddy","BuiltWith","Bullseye","BunnySlippers","Burf Search","Butterfly\\\/","BuzzSumo","CAAM\\\/[0-9]","CakePHP","Calculon","Canary%20Mail","CaretNail","catexplorador","CC Metadata Scaper","Cegbfeieh","censys","Cerberian Drtrs","CERT\\.at-Statistics-Survey","cg-eye","changedetection","ChangesMeter","Charlotte","CheckHost","checkprivacy","CherryPicker","ChinaClaw","Chirp\\\/","chkme\\.com","Chlooe","Chromaxa","CirrusExplorer","CISPA Vulnerability Notification","Citoid","CJNetworkQuality","Clarsentia","clips\\.ua\\.ac\\.be","Cloud mapping","CloudEndure","CloudFlare-AlwaysOnline","Cloudinary","cmcm\\.com","coccoc","cognitiveseo","colly -","CommaFeed","Commons-HttpClient","commonscan","contactbigdatafr","contentkingapp","convera","CookieReports","copyright sheriff","CopyRightCheck","Copyscape","Cosmos4j\\.feedback","Covario-IDS","Crescent","Crowsnest","Criteo","CSHttp","curb","Curious George","curl","cuwhois\\\/","cybo\\.com","DAP\\\/NetHTTP","DareBoost","DatabaseDriverMysqli","DataCha0s","Datafeedwatch","Datanyze","DataparkSearch","dataprovider","DataXu","Daum(oa)?[ \\\/][0-9]","Demon","DeuSu","developers\\.google\\.com\\\/\\+\\\/web\\\/snippet\\\/","Devil","Digg","Digincore","DigitalPebble","Dirbuster","Disqus\\\/","Dispatch\\\/","DittoSpyder","dlvr","DMBrowser","DNSPod-reporting","docoloc","Dolphin http client","DomainAppender","Donuts Content Explorer","dotMailer content retrieval","dotSemantic","downforeveryoneorjustme","Download Wonder","downnotifier","DowntimeDetector","Drip","drupact","Drupal \\(\\+http:\\\/\\\/drupal\\.org\\\/\\)","DTS Agent","dubaiindex","EARTHCOM","Easy-Thumb","EasyDL","Ebingbong","ec2linkfinder","eCairn-Grabber","eCatch","ECCP","eContext\\\/","Ecxi","EirGrabber","ElectricMonk","elefent","EMail Exractor","EMail Wolf","EmailWolf","Embarcadero","Embed PHP Library","Embedly","endo\\\/","europarchive\\.org","evc-batch","EventMachine HttpClient","Everwall Link Expander","Evidon","Evrinid","ExactSearch","ExaleadCloudview","Excel\\\/","exif","Exploratodo","Express WebPictures","Extreme Picture Finder","EyeNetIE","ezooms","facebookexternalhit","facebookplatform","fairshare","Faraday v","fasthttp","Faveeo","Favicon downloader","faviconkit","FavOrg","Feed Wrangler","Feedable\\\/","Feedbin","FeedBooster","FeedBucket","FeedBunch\\\/","FeedBurner","feeder","Feedly","FeedshowOnline","Feedspot","Feedwind\\\/","FeedZcollector","feeltiptop","Fetch API","Fetch\\\/[0-9]","Fever\\\/[0-9]","FHscan","Fimap","findlink","findthatfile","FlashGet","FlipboardBrowserProxy","FlipboardProxy","FlipboardRSS","Flock\\\/","fluffy","Flunky","flynxapp","forensiq","FoundSeoTool","http:\\\/\\\/www.neomo.de\\\/","free thumbnails","Freeuploader","Funnelback","G-i-g-a-b-o-t","g00g1e\\.net","ganarvisitas","geek-tools","Genieo","GentleSource","GetCode","Getintent","GetLinkInfo","getprismatic","GetRight","getroot","GetURLInfo\\\/","GetWeb","Ghost Inspector","GigablastOpenSource","GIS-LABS","github-camo","github\\.com","Go [\\d\\.]* package http","Go http package","Go-Ahead-Got-It","Go-http-client","Go!Zilla","gobyus","gofetch","GomezAgent","gooblog","Goodzer\\\/","Google AppsViewer","Google Desktop","Google favicon","Google Keyword Suggestion","Google Keyword Tool","Google Page Speed Insights","Google PP Default","Google Search Console","Google Web Preview","Google-Adwords","Google-Apps-Script","Google-Calendar-Importer","Google-HotelAdsVerifier","Google-HTTP-Java-Client","Google-Publisher-Plugin","Google-SearchByImage","Google-Site-Verification","Google-Structured-Data-Testing-Tool","Google-Youtube-Links","google-xrawler","GoogleDocs","GoogleHC\\\/","GoogleProducer","GoogleSites","Google-Transparency-Report","Gookey","GoScraper","GoSpotCheck","gosquared-thumbnailer","Gotit","GoZilla","grabify","GrabNet","Grafula","Grammarly","GrapeFX","Gregarius","GRequests","grokkit","grouphigh","grub-client","gSOAP\\\/","GT::WWW","GTmetrix","GuzzleHttp","gvfs\\\/","HAA(A)?RTLAND http client","Haansoft","hackney\\\/","Hadi Agent","HappyApps-WebCheck","Hatena","Havij","HeadlessChrome","HEADMasterSEO","HeartRails_Capture","help@dataminr\\.com","heritrix","historious","hkedcity","hledejLevne\\.cz","Hloader","HMView","Holmes","HonesoSearchEngine","HootSuite Image proxy","Hootsuite-WebFeed","hosterstats","HostTracker","ht:\\\/\\\/check","htdig","HTMLparser","htmlyse","HTTP Banner Detection","HTTP_Compression_Test","http_request2","http_requester","http-get","HTTP-Header-Abfrage","http-kit","http-request\\\/","HTTP-Tiny","HTTP::Lite","http\\.rb\\\/","http_get","HttpComponents","httphr","HTTPMon","httpRequest","httpscheck","httpssites_power","httpunit","HttpUrlConnection","httrack","huaweisymantec","HubSpot ","Humanlinks","i2kconnect\\\/","Iblog","ichiro","Id-search","IdeelaborPlagiaat","IDG Twitter Links Resolver","IDwhois\\\/","Iframely","igdeSpyder","IlTrovatore","Image Fetch","Image Sucker","ImageEngine\\\/","ImageVisu\\\/","Imagga","imagineeasy","imgsizer","InAGist","inbound\\.li parser","InDesign%20CC","Indy Library","InetURL","infegy","infohelfer","InfoTekies","InfoWizards Reciprocal Link","inpwrd\\.com","instabid","Instapaper","Integrity","integromedb","Intelliseek","InterGET","internet_archive","Internet Ninja","InternetSeer","internetVista monitor","intraVnews","IODC","IOI","iplabel","ips-agent","IPS\\\/[0-9]","IPWorks HTTP\\\/S Component","iqdb\\\/","Iria","Irokez","isitup\\.org","iskanie","isUp\\.li","iThemes Sync\\\/","iZSearch","JAHHO","janforman","Jaunt\\\/","Jbrofuzz","Jersey\\\/","JetCar","Jigsaw","Jobboerse","JobFeed discovery","Jobg8 URL Monitor","jobo","Jobrapido","Jobsearch1\\.5","JoinVision Generic","JolokiaPwn","Joomla","Jorgee","JS-Kit","JustView","Kaspersky Lab CFR link resolver","Kelny\\\/","Kerrigan\\\/","KeyCDN","Keyword Density","Keywords Research","KickFire","KimonoLabs\\\/","Kml-Google","knows\\.is","KOCMOHABT","kouio","kube-probe","kulturarw3","KumKie","L\\.webis","Larbin","Lavf\\\/","LeechFTP","LeechGet","letsencrypt","Lftp","LibVLC","LibWeb","Libwhisker","libwww","Licorne","Liferea\\\/","Lightspeedsystems","Likse","Link Valet","link_thumbnailer","LinkAlarm\\\/","linkCheck","linkdex","LinkExaminer","linkfluence","linkpeek","LinkPreviewGenerator","LinkScan","LinksManager","LinkTiger","LinkWalker","Lipperhey","Litemage_walker","livedoor ScreenShot","LoadImpactRload","localsearch-web","LongURL API","looksystems\\.net","ltx71","lua-resty-http","lwp-request","lwp-trivial","LWP::Simple","lycos","LYT\\.SR","mabontland","Mag-Net","MagpieRSS","Mail\\.Ru","MailChimp","Majestic12","makecontact\\\/","Mandrill","MapperCmd","marketinggrader","MarkMonitor","MarkWatch","Mass Downloader","masscan\\\/","Mata Hari","Mediapartners-Google","mediawords","MegaIndex\\.ru","MeltwaterNews","Melvil Rawi","Metaspinner","MetaURI","MFC_Tear_Sample","Microsearch","Microsoft Office ","Microsoft Outlook","Microsoft Windows Network Diagnostics","Microsoft-WebDAV-MiniRedir","Microsoft Data Access","MIDown tool","MIIxpc","Mindjet","Miniature\\.io","Miniflux","Mister PiX","mixdata dot com","mixed-content-scan","Mixmax-LinkPreview","mixnode","Mnogosearch","mogimogi","Mojeek","Mojolicious \\(Perl\\)","Monit\\\/","monitis","Monitority\\\/","montastic","MonTools","Moreover","Morfeus Fucking Scanner","Morning Paper","MovableType","mowser","Mrcgiguy","MS Web Services Client Protocol","MSFrontPage","mShots","MuckRack\\\/","muhstik-scan","MVAClient","MxToolbox\\\/","nagios","Najdi\\.si","Name Intelligence","Nameprotect","Navroad","NearSite","Needle","Nessus","Net Vampire","NetAnts","NETCRAFT","NetLyzer","NetMechanic","NetNewsWire","Netpursual","netresearch","NetShelter ContentScan","Netsparker","NetTrack","Netvibes","NetZIP","Neustar WPM","NeutrinoAPI","NewRelicPinger","NewsBlur .*Finder","NewsGator","newsme","newspaper\\\/","Nexgate Ruby Client","NG-Search","Nibbler","NICErsPRO","Nikto","nineconnections","NLNZ_IAHarvester","Nmap Scripting Engine","node-superagent","node-urllib","node\\.io","Nodemeter","NodePing","nominet\\.org\\.uk","Norton-Safeweb","Notifixious","notifyninja","nuhk","nutch","Nuzzel","nWormFeedFinder","nyawc\\\/","Nymesis","NYU","Ocelli\\\/","Octopus","oegp","Offline Explorer","Offline Navigator","og-scraper","okhttp","omgili","OMSC","Online Domain Tools","OpenCalaisSemanticProxy","Openfind","OpenLinkProfiler","Openstat\\\/","OpenVAS","Optimizer","Orbiter","OrgProbe\\\/","orion-semantics","Outlook-Express","Outlook-iOS","ow\\.ly","Owler","ownCloud News","OxfordCloudService","Page Valet","page_verifier","page scorer","page2rss","PageGrabber","PagePeeker","PageScorer","Pagespeed\\\/","Panopta","panscient","Papa Foto","parsijoo","Pavuk","PayPal IPN","pcBrowser","Pcore-HTTP","Pearltrees","PECL::HTTP","peerindex","Peew","PeoplePal","Perlu -","PhantomJS Screenshoter","PhantomJS\\\/","Photon\\\/","phpservermon","Pi-Monster","Picscout","Picsearch","PictureFinder","Pimonster","ping\\.blo\\.gs","Pingability","PingAdmin\\.Ru","Pingdom","Pingoscope","PingSpot","pinterest\\.com","Pixray","Pizilla","Plagger\\\/","Ploetz \\+ Zeller","Plukkie","plumanalytics","PocketImageCache","PocketParser","Pockey","POE-Component-Client-HTTP","Polymail\\\/","Pompos","Porkbun","Port Monitor","postano","PostmanRuntime","PostPost","postrank","PowerPoint\\\/","Priceonomics Analysis Engine","PrintFriendly","PritTorrent","Prlog","probethenet","Project 25499","prospectb2b","Protopage","ProWebWalker","proximic","PRTG Network Monitor","pshtt, https scanning","PTST ","PTST\\\/[0-9]+","Pulsepoint XT3 web scraper","Pump","Python-httplib2","python-requests","Python-urllib","Qirina Hurdler","QQDownload","QrafterPro","Qseero","Qualidator","QueryN Metasearch","queuedriver","Quora Link Preview","Qwantify","Radian6","RankActive","RankFlex","RankSonicSiteAuditor","Re-re Studio","Readability","RealDownload","RealPlayer%20Downloader","RebelMouse","Recorder","RecurPost\\\/","redback\\\/","ReederForMac","ReGet","RepoMonkey","request\\.js","ResponseCodeTest","RestSharp","Riddler","Rival IQ","Robosourcer","Robozilla","ROI Hunter","RPT-HTTPClient","RSSOwl","safe-agent-scanner","SalesIntelligent","Saleslift","Sendsay\\.Ru","SauceNAO","SBIder","scalaj-http","scan\\.lol","ScanAlert","Scoop","scooter","ScoutJet","ScoutURLMonitor","ScrapeBox Page Scanner","SimpleScraper","Scrapy","Screaming","ScreenShotService","Scrubby","Scrutiny\\\/","search\\.thunderstone","Search37","searchenginepromotionhelp","Searchestate","SearchExpress","SearchSight","Seeker","semanticdiscovery","semanticjuice","Semiocast HTTP client","Semrush","sentry\\\/","SEO Browser","Seo Servis","seo-nastroj\\.cz","seo4ajax","Seobility","SEOCentro","SeoCheck","SEOkicks","Seomoz","SEOprofiler","SEOsearch","seoscanners","seositecheckup","SEOstats","servernfo","sexsearcher","Seznam","Shelob","Shodan","Shoppimon","ShopWiki","ShortLinkTranslate","shrinktheweb","Sideqik","SimplePie","SimplyFast","Siphon","SISTRIX","Site-Shot\\\/","Site Sucker","Site24x7","SiteBar","Sitebeam","Sitebulb\\\/","SiteCondor","SiteExplorer","SiteGuardian","Siteimprove","SiteIndexed","Sitemap(s)? Generator","SitemapGenerator","SiteMonitor","Siteshooter B0t","SiteSnagger","SiteSucker","SiteTruth","Sitevigil","sitexy\\.com","SkypeUriPreview","Slack\\\/","slider\\.com","slurp","SlySearch","SmartDownload","SMRF URL Expander","SMUrlExpander","Snake","Snappy","SnapSearch","Snarfer\\\/","SniffRSS","sniptracker","Snoopy","SnowHaze Search","sogou web","SortSite","Sottopop","sovereign\\.ai","SpaceBison","SpamExperts","Spammen","Spanner","spaziodati","SPDYCheck","Specificfeeds","speedy","SPEng","Spinn3r","spray-can","Sprinklr ","spyonweb","sqlmap","Sqlworm","Sqworm","SSL Labs","ssl-tools","StackRambler","Statastico\\\/","StatusCake","Steeler","Stratagems Kumo","Stroke\\.cz","StudioFACA","StumbleUpon","suchen","Sucuri","summify","SuperHTTP","Surphace Scout","Suzuran","SwiteScraper","Symfony BrowserKit","Symfony2 BrowserKit","SynHttpClient-Built","Sysomos","sysscan","Szukacz","T0PHackTeam","tAkeOut","Tarantula\\\/","Taringa UGC","TarmotGezgin","Teleport","Telesoft","Telesphoreo","Telesphorep","Tenon\\.io","teoma","terrainformatica","Test Certificate Info","testuri","Tetrahedron","The Drop Reaper","The Expert HTML Source Viewer","The Knowledge AI","The Intraformant","theinternetrules","TheNomad","Thinklab","Thumbshots","ThumbSniper","timewe\\.net","TinEye","Tiny Tiny RSS","TLSProbe\\\/","Toata","topster","touche\\.com","Traackr\\.com","tracemyfile","TrapitAgent","Trendiction","Trendsmap","trendspottr","truwoGPS","TryJsoup","TulipChain","Turingos","Turnitin","tweetedtimes","Tweetminster","Tweezler\\\/","twibble","Twice","Twikle","Twingly","Twisted PageGetter","Typhoeus","ubermetrics-technologies","uclassify","UdmSearch","unirest-java","UniversalFeedParser","Unshorten\\.It","Untiny","UnwindFetchor","updated","updown\\.io daemon","Upflow","Uptimia","URL Verifier","URLitor","urlresolver","Urlstat","UrlTrends Ranking Updater","URLy Warning","URLy\\.Warning","Vacuum","Vagabondo","VB Project","vBSEO","VCI","via ggpht\\.com GoogleImageProxy","VidibleScraper","Virusdie","visionutils","vkShare","VoidEYE","Voil","voltron","voyager\\\/","VSAgent\\\/","VSB-TUO\\\/","Vulnbusters Meter","VYU2","w3af\\.org","W3C_Unicorn","W3C-checklink","W3C-mobileOK","WAC-OFU","Wallpapers\\\/[0-9]+","WallpapersHD","wangling","Wappalyzer","WatchMouse","WbSrch\\\/","WDT\\.io","web-capture\\.net","Web-sniffer","Web Auto","Web Collage","Web Enhancer","Web Fetch","Web Fuck","Web Pix","Web Sauger","Web Sucker","Webalta","Webauskunft","WebAuto","WebCapture","WebClient\\\/","webcollage","WebCookies","WebCopier","WebCorp","WebDataStats","WebDoc","WebEnhancer","WebFetch","WebFuck","WebGazer","WebGo IS","WebImageCollector","WebImages","WebIndex","webkit2png","WebLeacher","webmastercoffee","webmon ","WebPix","WebReaper","WebSauger","webscreenie","Webshag","Webshot","Website Quester","websitepulse agent","WebsiteQuester","Websnapr","WebSniffer","Webster","WebStripper","WebSucker","Webthumb\\\/","WebThumbnail","WebWhacker","WebZIP","WeLikeLinks","WEPA","WeSEE","wf84","Wfuzz\\\/","wget","WhatsApp","WhatsMyIP","WhatWeb","WhereGoes\\?","Whibse","WhoRunsCoinHive","Whynder Magnet","Windows-RSS-Platform","WinPodder","wkhtmlto","wmtips","Woko","Word\\\/","WordPress\\\/","WordupinfoSearch","wotbox","WP Engine Install Performance API","wpif","wprecon\\.com survey","WPScan","wscheck","Wtrace","WWW-Collector-E","WWW-Mechanize","WWW::Document","WWW::Mechanize","www\\.monitor\\.us","WWWOFFLE","x09Mozilla","x22Mozilla","XaxisSemanticsClassifier","Xenu Link Sleuth","XING-contenttabreceiver","xpymep([0-9]?)\\.exe","Y!J-(ASR|BSC)","Y\\!J-BRW","Yaanb","yacy","Yahoo Link Preview","YahooCacheSystem","YahooYSMcm","YandeG","Yandex(?!Search)","yanga","yeti","Yo-yo","Yoleo Consumer","yoogliFetchAgent","YottaaMonitor","Your-Website-Sucks","yourls\\.org","YoYs\\.net","YP\\.PL","Zabbix","Zade","Zao","Zauba","Zemanta Aggregator","Zend_Http_Client","Zend\\\\Http\\\\Client","Zermelo","Zeus","zgrab","ZnajdzFoto","Zombie\\.js","Zoom\\.Mac","ZyBorg","[a-z0-9\\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer)"]
|
includes/vendor/jaybizzle/crawler-detect/raw/Crawlers.txt
CHANGED
@@ -1,11 +1,5 @@
|
|
1 |
.*Java.*outbrain
|
2 |
YLT
|
3 |
-
008\/
|
4 |
-
192\.comAgent
|
5 |
-
2ip\.ru
|
6 |
-
404checker
|
7 |
-
404enemy
|
8 |
-
80legs
|
9 |
^b0t$
|
10 |
^bluefish
|
11 |
^Calypso v\/
|
@@ -32,9 +26,16 @@
|
|
32 |
^WordPress\.com
|
33 |
^XRL\/[0-9]
|
34 |
^ZmEu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
a3logics\.in
|
36 |
A6-Indexer
|
37 |
-
a\.pr-cy\.ru
|
38 |
Abonti
|
39 |
Aboundex
|
40 |
aboutthedomain
|
@@ -46,9 +47,9 @@ AdAuth\/
|
|
46 |
adbeat
|
47 |
AddThis
|
48 |
ADmantX
|
|
|
49 |
adressendeutschland
|
50 |
-
adscanner
|
51 |
-
Advanced Email Extractor v
|
52 |
agentslug
|
53 |
AHC
|
54 |
aihit
|
@@ -60,36 +61,38 @@ alertra
|
|
60 |
alexa site audit
|
61 |
Alibaba\.Security\.Heimdall
|
62 |
Alligator
|
63 |
-
allloadin
|
64 |
AllSubmitter
|
65 |
alyze\.info
|
66 |
amagit
|
67 |
Anarchie
|
68 |
AndroidDownloadManager
|
69 |
Anemone
|
70 |
-
AngleSharp
|
71 |
annotate_google
|
72 |
Ant\.com
|
73 |
Anturis Agent
|
74 |
AnyEvent-HTTP\/
|
75 |
Apache Droid
|
76 |
Apache OpenOffice
|
77 |
-
Apache-HttpAsyncClient
|
78 |
-
Apache-HttpClient
|
79 |
-
ApacheBench
|
80 |
Apexoo
|
81 |
APIs-Google
|
82 |
-
AportWorm\/
|
83 |
-
AppBeat\/
|
84 |
AppEngine-Google
|
85 |
AppStoreScraperZ
|
|
|
86 |
Arachmo
|
87 |
arachnode
|
88 |
Arachnophilia
|
89 |
aria2
|
90 |
Arukereso
|
91 |
-
asafaweb
|
92 |
AskQuickly
|
|
|
93 |
ASPSeek
|
94 |
Asterias
|
95 |
Astute
|
@@ -101,22 +104,23 @@ axios\/
|
|
101 |
B-l-i-t-z-B-O-T
|
102 |
Backlink-Ceck
|
103 |
backlink-check
|
|
|
104 |
BackStreet
|
105 |
BackWeb
|
106 |
Bad-Neighborhood
|
107 |
Badass
|
108 |
baidu\.com
|
109 |
Bandit
|
|
|
110 |
BatchFTP
|
111 |
-
Battleztar
|
112 |
-
baypup\/
|
113 |
-
baypup\/colbert
|
114 |
BazQux
|
115 |
BBBike
|
116 |
BCKLINKS
|
117 |
BDFetch
|
118 |
-
BegunAdvertising
|
119 |
-
Bidtellect
|
120 |
BigBozz
|
121 |
Bigfoot
|
122 |
biglotron
|
@@ -126,23 +130,23 @@ binlar
|
|
126 |
biNu image cacher
|
127 |
Bitacle
|
128 |
biz_Directory
|
129 |
-
Black
|
130 |
Blackboard Safeassign
|
131 |
BlackWidow
|
132 |
BlockNote\.Net
|
133 |
-
Bloglines
|
134 |
Bloglovin
|
135 |
BlogPulseLive
|
136 |
BlogSearch
|
137 |
Blogtrottr
|
138 |
BlowFish
|
139 |
-
Boardreader
|
140 |
boitho\.com-dc
|
141 |
BPImageWalker
|
142 |
Braintree-Webhooks
|
143 |
Branch Metrics API
|
144 |
Branch-Passthrough
|
145 |
Brandprotect
|
|
|
146 |
Brandwatch
|
147 |
Brodie\/
|
148 |
Browsershots
|
@@ -158,70 +162,71 @@ BuzzSumo
|
|
158 |
CAAM\/[0-9]
|
159 |
CakePHP
|
160 |
Calculon
|
161 |
-
|
162 |
CaretNail
|
163 |
catexplorador
|
164 |
-
cb crawl
|
165 |
CC Metadata Scaper
|
166 |
Cegbfeieh
|
|
|
167 |
Cerberian Drtrs
|
168 |
CERT\.at-Statistics-Survey
|
169 |
cg-eye
|
170 |
changedetection
|
171 |
-
ChangesMeter
|
172 |
Charlotte
|
173 |
CheckHost
|
174 |
checkprivacy
|
175 |
CherryPicker
|
176 |
ChinaClaw
|
177 |
-
Chirp\/
|
178 |
chkme\.com
|
179 |
Chlooe
|
180 |
-
|
|
|
181 |
CISPA Vulnerability Notification
|
182 |
Citoid
|
183 |
CJNetworkQuality
|
184 |
Clarsentia
|
185 |
clips\.ua\.ac\.be
|
186 |
-
Cloud
|
187 |
CloudEndure
|
188 |
CloudFlare-AlwaysOnline
|
189 |
-
Cloudinary
|
190 |
cmcm\.com
|
191 |
coccoc
|
192 |
cognitiveseo
|
193 |
colly -
|
194 |
CommaFeed
|
195 |
Commons-HttpClient
|
196 |
-
|
197 |
contactbigdatafr
|
198 |
contentkingapp
|
199 |
convera
|
200 |
-
CookieReports
|
201 |
copyright sheriff
|
202 |
CopyRightCheck
|
203 |
Copyscape
|
204 |
Cosmos4j\.feedback
|
205 |
Covario-IDS
|
206 |
-
CrawlForMe\/[0-9]
|
207 |
Crescent
|
208 |
-
cron-job\.org
|
209 |
Crowsnest
|
|
|
210 |
CSHttp
|
211 |
curb
|
212 |
Curious George
|
213 |
curl
|
214 |
-
cuwhois\/
|
215 |
cybo\.com
|
|
|
216 |
DareBoost
|
217 |
DatabaseDriverMysqli
|
218 |
DataCha0s
|
|
|
219 |
Datanyze
|
220 |
DataparkSearch
|
221 |
dataprovider
|
222 |
DataXu
|
223 |
Daum(oa)?[ \/][0-9]
|
224 |
-
DemandbasePublisherAnalyzer\/
|
225 |
Demon
|
226 |
DeuSu
|
227 |
developers\.google\.com\/\+\/web\/snippet\/
|
@@ -230,27 +235,26 @@ Digg
|
|
230 |
Digincore
|
231 |
DigitalPebble
|
232 |
Dirbuster
|
|
|
233 |
Dispatch\/
|
234 |
DittoSpyder
|
235 |
dlvr
|
236 |
DMBrowser
|
237 |
-
DNS-Tools Header-Analyzer
|
238 |
DNSPod-reporting
|
239 |
docoloc
|
240 |
-
Dolphin http client
|
241 |
DomainAppender
|
242 |
Donuts Content Explorer
|
243 |
dotMailer content retrieval
|
244 |
dotSemantic
|
245 |
downforeveryoneorjustme
|
246 |
-
Download
|
247 |
-
downnotifier
|
248 |
DowntimeDetector
|
249 |
-
Dragonfly File Reader
|
250 |
Drip
|
251 |
drupact
|
252 |
Drupal \(\+http:\/\/drupal\.org\/\)
|
253 |
-
DTS
|
254 |
dubaiindex
|
255 |
EARTHCOM
|
256 |
Easy-Thumb
|
@@ -260,16 +264,15 @@ ec2linkfinder
|
|
260 |
eCairn-Grabber
|
261 |
eCatch
|
262 |
ECCP
|
263 |
-
echocrawl
|
264 |
eContext\/
|
265 |
Ecxi
|
266 |
EirGrabber
|
267 |
ElectricMonk
|
268 |
elefent
|
269 |
EMail Exractor
|
270 |
-
|
271 |
-
EMail\ Wolf
|
272 |
EmailWolf
|
|
|
273 |
Embed PHP Library
|
274 |
Embedly
|
275 |
endo\/
|
@@ -282,12 +285,10 @@ Evrinid
|
|
282 |
ExactSearch
|
283 |
ExaleadCloudview
|
284 |
Excel\/
|
285 |
-
|
286 |
-
ExperianCrawlUK
|
287 |
Exploratodo
|
288 |
Express WebPictures
|
289 |
-
|
290 |
-
Extreme\ Picture\ Finder
|
291 |
EyeNetIE
|
292 |
ezooms
|
293 |
facebookexternalhit
|
@@ -297,20 +298,20 @@ Faraday v
|
|
297 |
fasthttp
|
298 |
Faveeo
|
299 |
Favicon downloader
|
|
|
300 |
FavOrg
|
301 |
Feed Wrangler
|
302 |
Feedable\/
|
303 |
Feedbin
|
304 |
FeedBooster
|
305 |
FeedBucket
|
306 |
-
FeedBunch\/
|
307 |
FeedBurner
|
308 |
-
|
309 |
Feedly
|
310 |
-
Feedreader
|
311 |
FeedshowOnline
|
312 |
Feedspot
|
313 |
-
Feedwind\/
|
314 |
FeedZcollector
|
315 |
feeltiptop
|
316 |
Fetch API
|
@@ -329,41 +330,42 @@ fluffy
|
|
329 |
Flunky
|
330 |
flynxapp
|
331 |
forensiq
|
332 |
-
FoundSeoTool
|
|
|
333 |
free thumbnails
|
334 |
Freeuploader
|
335 |
-
FreeWebMonitoring SiteChecker
|
336 |
Funnelback
|
337 |
G-i-g-a-b-o-t
|
338 |
g00g1e\.net
|
339 |
-
|
340 |
-
ganarvisitas\/[0-9]
|
341 |
geek-tools
|
342 |
-
Genderanalyzer
|
343 |
Genieo
|
344 |
GentleSource
|
|
|
345 |
Getintent
|
346 |
GetLinkInfo
|
347 |
-
getprismatic
|
348 |
GetRight
|
349 |
-
|
|
|
350 |
GetWeb
|
351 |
Ghost Inspector
|
352 |
GigablastOpenSource
|
353 |
GIS-LABS
|
354 |
github-camo
|
355 |
-
github\.com
|
356 |
Go [\d\.]* package http
|
357 |
Go http package
|
358 |
-
Go!Zilla
|
359 |
Go-Ahead-Got-It
|
360 |
Go-http-client
|
|
|
361 |
gobyus
|
362 |
gofetch
|
363 |
GomezAgent
|
364 |
gooblog
|
365 |
-
Goodzer\/
|
366 |
-
|
|
|
367 |
Google favicon
|
368 |
Google Keyword Suggestion
|
369 |
Google Keyword Tool
|
@@ -381,14 +383,15 @@ Google-SearchByImage
|
|
381 |
Google-Site-Verification
|
382 |
Google-Structured-Data-Testing-Tool
|
383 |
Google-Youtube-Links
|
384 |
-
|
385 |
GoogleDocs
|
386 |
GoogleHC\/
|
387 |
GoogleProducer
|
|
|
|
|
388 |
Gookey
|
389 |
GoScraper
|
390 |
GoSpotCheck
|
391 |
-
GoSquared-Status-Checker
|
392 |
gosquared-thumbnailer
|
393 |
Gotit
|
394 |
GoZilla
|
@@ -397,6 +400,8 @@ GrabNet
|
|
397 |
Grafula
|
398 |
Grammarly
|
399 |
GrapeFX
|
|
|
|
|
400 |
grokkit
|
401 |
grouphigh
|
402 |
grub-client
|
@@ -408,27 +413,34 @@ gvfs\/
|
|
408 |
HAA(A)?RTLAND http client
|
409 |
Haansoft
|
410 |
hackney\/
|
|
|
|
|
411 |
Hatena
|
412 |
Havij
|
413 |
-
|
414 |
HEADMasterSEO
|
415 |
HeartRails_Capture
|
416 |
help@dataminr\.com
|
417 |
heritrix
|
418 |
-
historious
|
419 |
-
|
|
|
420 |
Hloader
|
421 |
HMView
|
422 |
Holmes
|
423 |
-
HonesoSearchEngine
|
424 |
HootSuite Image proxy
|
425 |
-
Hootsuite-WebFeed
|
426 |
hosterstats
|
427 |
HostTracker
|
428 |
ht:\/\/check
|
429 |
htdig
|
430 |
HTMLparser
|
431 |
-
htmlyse
|
|
|
|
|
|
|
|
|
432 |
http-get
|
433 |
HTTP-Header-Abfrage
|
434 |
http-kit
|
@@ -436,47 +448,45 @@ http-request\/
|
|
436 |
HTTP-Tiny
|
437 |
HTTP::Lite
|
438 |
http\.rb\/
|
439 |
-
|
440 |
-
http_request2
|
441 |
-
http_requester
|
442 |
HttpComponents
|
443 |
httphr
|
444 |
HTTPMon
|
|
|
445 |
httpscheck
|
446 |
httpssites_power
|
447 |
httpunit
|
448 |
HttpUrlConnection
|
449 |
httrack
|
450 |
huaweisymantec
|
451 |
-
HubPages.*crawlingpolicy
|
452 |
HubSpot
|
453 |
Humanlinks
|
454 |
-
HyperZbozi.cz Feeder
|
455 |
i2kconnect\/
|
456 |
Iblog
|
457 |
ichiro
|
458 |
Id-search
|
459 |
IdeelaborPlagiaat
|
460 |
IDG Twitter Links Resolver
|
461 |
-
IDwhois\/
|
462 |
Iframely
|
463 |
igdeSpyder
|
464 |
IlTrovatore
|
465 |
-
|
466 |
-
Image
|
467 |
-
Image\ Sucker
|
468 |
ImageEngine\/
|
|
|
469 |
Imagga
|
|
|
470 |
imgsizer
|
471 |
InAGist
|
472 |
inbound\.li parser
|
473 |
InDesign%20CC
|
474 |
-
Indy
|
475 |
InetURL
|
476 |
infegy
|
477 |
infohelfer
|
478 |
InfoTekies
|
479 |
-
InfoWizards Reciprocal Link
|
480 |
inpwrd\.com
|
481 |
instabid
|
482 |
Instapaper
|
@@ -484,8 +494,8 @@ Integrity
|
|
484 |
integromedb
|
485 |
Intelliseek
|
486 |
InterGET
|
487 |
-
Internet\ Ninja
|
488 |
internet_archive
|
|
|
489 |
InternetSeer
|
490 |
internetVista monitor
|
491 |
intraVnews
|
@@ -500,7 +510,10 @@ Iria
|
|
500 |
Irokez
|
501 |
isitup\.org
|
502 |
iskanie
|
|
|
|
|
503 |
iZSearch
|
|
|
504 |
janforman
|
505 |
Jaunt\/
|
506 |
Jbrofuzz
|
@@ -520,12 +533,10 @@ Jorgee
|
|
520 |
JS-Kit
|
521 |
JustView
|
522 |
Kaspersky Lab CFR link resolver
|
523 |
-
KeepRight OpenStreetMap Checker
|
524 |
Kelny\/
|
525 |
Kerrigan\/
|
526 |
KeyCDN
|
527 |
-
Keyword
|
528 |
-
Keyword\ Density
|
529 |
Keywords Research
|
530 |
KickFire
|
531 |
KimonoLabs\/
|
@@ -539,7 +550,6 @@ KumKie
|
|
539 |
L\.webis
|
540 |
Larbin
|
541 |
Lavf\/
|
542 |
-
LayeredExtractor
|
543 |
LeechFTP
|
544 |
LeechGet
|
545 |
letsencrypt
|
@@ -548,11 +558,10 @@ LibVLC
|
|
548 |
LibWeb
|
549 |
Libwhisker
|
550 |
libwww
|
551 |
-
Licorne
|
552 |
Liferea\/
|
553 |
Lightspeedsystems
|
554 |
Likse
|
555 |
-
link checker
|
556 |
Link Valet
|
557 |
link_thumbnailer
|
558 |
LinkAlarm\/
|
@@ -583,7 +592,7 @@ LYT\.SR
|
|
583 |
mabontland
|
584 |
Mag-Net
|
585 |
MagpieRSS
|
586 |
-
Mail
|
587 |
MailChimp
|
588 |
Majestic12
|
589 |
makecontact\/
|
@@ -592,14 +601,14 @@ MapperCmd
|
|
592 |
marketinggrader
|
593 |
MarkMonitor
|
594 |
MarkWatch
|
595 |
-
Mass
|
596 |
-
masscan\/
|
597 |
-
Mata
|
598 |
Mediapartners-Google
|
599 |
mediawords
|
600 |
MegaIndex\.ru
|
601 |
-
|
602 |
-
|
603 |
Metaspinner
|
604 |
MetaURI
|
605 |
MFC_Tear_Sample
|
@@ -608,13 +617,13 @@ Microsoft Office
|
|
608 |
Microsoft Outlook
|
609 |
Microsoft Windows Network Diagnostics
|
610 |
Microsoft-WebDAV-MiniRedir
|
611 |
-
Microsoft
|
612 |
-
MIDown
|
613 |
MIIxpc
|
614 |
Mindjet
|
615 |
-
Miniature
|
616 |
Miniflux
|
617 |
-
Mister
|
618 |
mixdata dot com
|
619 |
mixed-content-scan
|
620 |
Mixmax-LinkPreview
|
@@ -623,18 +632,18 @@ Mnogosearch
|
|
623 |
mogimogi
|
624 |
Mojeek
|
625 |
Mojolicious \(Perl\)
|
626 |
-
monitis
|
627 |
Monit\/
|
628 |
-
|
|
|
629 |
montastic
|
630 |
MonTools
|
631 |
Moreover
|
632 |
-
Morfeus
|
633 |
Morning Paper
|
634 |
MovableType
|
635 |
mowser
|
636 |
Mrcgiguy
|
637 |
-
MS
|
638 |
MSFrontPage
|
639 |
mShots
|
640 |
MuckRack\/
|
@@ -642,14 +651,14 @@ muhstik-scan
|
|
642 |
MVAClient
|
643 |
MxToolbox\/
|
644 |
nagios
|
645 |
-
Najdi\.si
|
646 |
-
Name
|
647 |
Nameprotect
|
648 |
Navroad
|
649 |
NearSite
|
650 |
Needle
|
651 |
Nessus
|
652 |
-
Net
|
653 |
NetAnts
|
654 |
NETCRAFT
|
655 |
NetLyzer
|
@@ -674,12 +683,14 @@ NG-Search
|
|
674 |
Nibbler
|
675 |
NICErsPRO
|
676 |
Nikto
|
677 |
-
nineconnections
|
678 |
NLNZ_IAHarvester
|
679 |
Nmap Scripting Engine
|
680 |
node-superagent
|
681 |
-
node-urllib
|
682 |
node\.io
|
|
|
|
|
683 |
nominet\.org\.uk
|
684 |
Norton-Safeweb
|
685 |
Notifixious
|
@@ -688,16 +699,16 @@ nuhk
|
|
688 |
nutch
|
689 |
Nuzzel
|
690 |
nWormFeedFinder
|
|
|
691 |
Nymesis
|
692 |
NYU
|
693 |
-
Ocelli\/
|
694 |
Octopus
|
695 |
oegp
|
696 |
-
og-scraper\/
|
697 |
Offline Explorer
|
698 |
-
Offline
|
|
|
699 |
okhttp
|
700 |
-
Omea Reader
|
701 |
omgili
|
702 |
OMSC
|
703 |
Online Domain Tools
|
@@ -708,32 +719,30 @@ Openstat\/
|
|
708 |
OpenVAS
|
709 |
Optimizer
|
710 |
Orbiter
|
711 |
-
OrgProbe\/
|
712 |
orion-semantics
|
713 |
Outlook-Express
|
|
|
714 |
ow\.ly
|
715 |
Owler
|
716 |
ownCloud News
|
717 |
-
OxfordCloudService
|
718 |
-
Page Analyzer
|
719 |
Page Valet
|
720 |
-
page2rss
|
721 |
-
page\ scorer
|
722 |
page_verifier
|
723 |
-
|
|
|
724 |
PageGrabber
|
725 |
PagePeeker
|
726 |
PageScorer
|
727 |
-
Pagespeed\/
|
728 |
Panopta
|
729 |
panscient
|
730 |
-
Papa
|
731 |
parsijoo
|
732 |
Pavuk
|
733 |
PayPal IPN
|
734 |
pcBrowser
|
735 |
Pcore-HTTP
|
736 |
-
PEAR HTTPRequest
|
737 |
Pearltrees
|
738 |
PECL::HTTP
|
739 |
peerindex
|
@@ -743,14 +752,13 @@ Perlu -
|
|
743 |
PhantomJS Screenshoter
|
744 |
PhantomJS\/
|
745 |
Photon\/
|
746 |
-
phpcrawl
|
747 |
phpservermon
|
748 |
Pi-Monster
|
749 |
Picscout
|
750 |
Picsearch
|
751 |
PictureFinder
|
752 |
Pimonster
|
753 |
-
ping\.blo\.gs
|
754 |
Pingability
|
755 |
PingAdmin\.Ru
|
756 |
Pingdom
|
@@ -760,28 +768,28 @@ pinterest\.com
|
|
760 |
Pixray
|
761 |
Pizilla
|
762 |
Plagger\/
|
763 |
-
PleaseCrawl
|
764 |
Ploetz \+ Zeller
|
765 |
Plukkie
|
766 |
plumanalytics
|
|
|
767 |
PocketParser
|
768 |
Pockey
|
769 |
POE-Component-Client-HTTP
|
|
|
770 |
Pompos
|
771 |
Porkbun
|
772 |
Port Monitor
|
773 |
postano
|
774 |
-
PostmanRuntime
|
775 |
PostPost
|
776 |
postrank
|
777 |
PowerPoint\/
|
778 |
Priceonomics Analysis Engine
|
779 |
-
PrintFriendly
|
780 |
-
PritTorrent
|
781 |
Prlog
|
782 |
probethenet
|
783 |
Project 25499
|
784 |
-
Promotion_Tools_www.searchenginepromotionhelp.com
|
785 |
prospectb2b
|
786 |
Protopage
|
787 |
ProWebWalker
|
@@ -799,15 +807,16 @@ Qirina Hurdler
|
|
799 |
QQDownload
|
800 |
QrafterPro
|
801 |
Qseero
|
802 |
-
Qualidator
|
803 |
-
QueryN
|
|
|
804 |
Quora Link Preview
|
805 |
Qwantify
|
806 |
Radian6
|
807 |
RankActive
|
808 |
RankFlex
|
809 |
RankSonicSiteAuditor
|
810 |
-
|
811 |
Readability
|
812 |
RealDownload
|
813 |
RealPlayer%20Downloader
|
@@ -815,41 +824,42 @@ RebelMouse
|
|
815 |
Recorder
|
816 |
RecurPost\/
|
817 |
redback\/
|
818 |
-
Redirect Checker Tool
|
819 |
ReederForMac
|
820 |
ReGet
|
821 |
RepoMonkey
|
822 |
request\.js
|
823 |
-
ResponseCodeTest
|
824 |
RestSharp
|
825 |
Riddler
|
826 |
Rival IQ
|
827 |
Robosourcer
|
828 |
-
Robozilla
|
829 |
ROI Hunter
|
830 |
RPT-HTTPClient
|
831 |
RSSOwl
|
832 |
-
RssReader\/
|
833 |
safe-agent-scanner
|
834 |
SalesIntelligent
|
835 |
Saleslift
|
|
|
836 |
SauceNAO
|
837 |
SBIder
|
838 |
scalaj-http
|
839 |
scan\.lol
|
840 |
ScanAlert
|
841 |
-
ScrapeBox Page Scanner
|
842 |
Scoop
|
843 |
scooter
|
844 |
ScoutJet
|
845 |
ScoutURLMonitor
|
|
|
|
|
846 |
Scrapy
|
847 |
Screaming
|
848 |
-
ScreenShotService
|
849 |
Scrubby
|
850 |
Scrutiny\/
|
851 |
-
Search37\/
|
852 |
search\.thunderstone
|
|
|
|
|
853 |
Searchestate
|
854 |
SearchExpress
|
855 |
SearchSight
|
@@ -861,37 +871,35 @@ Semrush
|
|
861 |
sentry\/
|
862 |
SEO Browser
|
863 |
Seo Servis
|
864 |
-
seo-nastroj
|
|
|
865 |
Seobility
|
866 |
SEOCentro
|
867 |
SeoCheck
|
868 |
SEOkicks
|
869 |
Seomoz
|
870 |
SEOprofiler
|
871 |
-
|
872 |
seoscanners
|
|
|
873 |
SEOstats
|
874 |
-
|
875 |
-
servernfo\.com
|
876 |
-
SetCronJob\/
|
877 |
sexsearcher
|
878 |
Seznam
|
879 |
Shelob
|
880 |
Shodan
|
881 |
-
Shoppimon
|
882 |
-
ShoppimonAgent\/[0-9]
|
883 |
ShopWiki
|
884 |
ShortLinkTranslate
|
885 |
shrinktheweb
|
886 |
Sideqik
|
887 |
-
SilverReader
|
888 |
SimplePie
|
889 |
SimplyFast
|
890 |
Siphon
|
891 |
SISTRIX
|
892 |
Site-Shot\/
|
|
|
893 |
Site24x7
|
894 |
-
Site\ Sucker
|
895 |
SiteBar
|
896 |
Sitebeam
|
897 |
Sitebulb\/
|
@@ -901,6 +909,7 @@ SiteGuardian
|
|
901 |
Siteimprove
|
902 |
SiteIndexed
|
903 |
Sitemap(s)? Generator
|
|
|
904 |
SiteMonitor
|
905 |
Siteshooter B0t
|
906 |
SiteSnagger
|
@@ -916,9 +925,10 @@ SlySearch
|
|
916 |
SmartDownload
|
917 |
SMRF URL Expander
|
918 |
SMUrlExpander
|
919 |
-
Snarfer\/
|
920 |
Snake
|
921 |
Snappy
|
|
|
|
|
922 |
SniffRSS
|
923 |
sniptracker
|
924 |
Snoopy
|
@@ -928,6 +938,7 @@ SortSite
|
|
928 |
Sottopop
|
929 |
sovereign\.ai
|
930 |
SpaceBison
|
|
|
931 |
Spammen
|
932 |
Spanner
|
933 |
spaziodati
|
@@ -949,12 +960,12 @@ Statastico\/
|
|
949 |
StatusCake
|
950 |
Steeler
|
951 |
Stratagems Kumo
|
952 |
-
Stroke
|
953 |
StudioFACA
|
|
|
954 |
suchen
|
955 |
Sucuri
|
956 |
summify
|
957 |
-
Super Monitoring
|
958 |
SuperHTTP
|
959 |
Surphace Scout
|
960 |
Suzuran
|
@@ -969,41 +980,45 @@ T0PHackTeam
|
|
969 |
tAkeOut
|
970 |
Tarantula\/
|
971 |
Taringa UGC
|
|
|
972 |
Teleport
|
973 |
Telesoft
|
974 |
Telesphoreo
|
975 |
Telesphorep
|
976 |
Tenon\.io
|
977 |
teoma
|
978 |
-
terrainformatica
|
979 |
Test Certificate Info
|
980 |
-
|
|
|
981 |
The Drop Reaper
|
982 |
The Expert HTML Source Viewer
|
983 |
The Knowledge AI
|
984 |
-
The
|
985 |
theinternetrules
|
986 |
TheNomad
|
987 |
-
theoldreader\.com
|
988 |
Thinklab
|
989 |
Thumbshots
|
990 |
ThumbSniper
|
|
|
991 |
TinEye
|
992 |
Tiny Tiny RSS
|
993 |
TLSProbe\/
|
994 |
Toata
|
995 |
topster
|
996 |
-
touche
|
997 |
-
Traackr
|
|
|
998 |
TrapitAgent
|
999 |
Trendiction
|
1000 |
-
Trendsmap
|
1001 |
-
trendspottr
|
1002 |
truwoGPS
|
|
|
1003 |
TulipChain
|
1004 |
Turingos
|
1005 |
Turnitin
|
1006 |
-
tweetedtimes
|
1007 |
Tweetminster
|
1008 |
Tweezler\/
|
1009 |
twibble
|
@@ -1014,7 +1029,6 @@ Twisted PageGetter
|
|
1014 |
Typhoeus
|
1015 |
ubermetrics-technologies
|
1016 |
uclassify
|
1017 |
-
uCrawlr\/
|
1018 |
UdmSearch
|
1019 |
unirest-java
|
1020 |
UniversalFeedParser
|
@@ -1026,16 +1040,15 @@ updown\.io daemon
|
|
1026 |
Upflow
|
1027 |
Uptimia
|
1028 |
URL Verifier
|
1029 |
-
|
1030 |
-
URLitor.com
|
1031 |
urlresolver
|
1032 |
Urlstat
|
1033 |
UrlTrends Ranking Updater
|
1034 |
-
URLy
|
1035 |
URLy\.Warning
|
1036 |
Vacuum
|
1037 |
Vagabondo
|
1038 |
-
VB
|
1039 |
vBSEO
|
1040 |
VCI
|
1041 |
via ggpht\.com GoogleImageProxy
|
@@ -1047,32 +1060,32 @@ VoidEYE
|
|
1047 |
Voil
|
1048 |
voltron
|
1049 |
voyager\/
|
1050 |
-
VSAgent\/
|
1051 |
-
VSB-TUO\/
|
1052 |
Vulnbusters Meter
|
1053 |
VYU2
|
1054 |
w3af\.org
|
|
|
1055 |
W3C-checklink
|
1056 |
W3C-mobileOK
|
1057 |
-
|
1058 |
-
W3C_Unicorn
|
1059 |
Wallpapers\/[0-9]+
|
1060 |
WallpapersHD
|
1061 |
wangling
|
1062 |
Wappalyzer
|
1063 |
WatchMouse
|
1064 |
WbSrch\/
|
|
|
1065 |
web-capture\.net
|
1066 |
-
Web-Monitoring
|
1067 |
Web-sniffer
|
1068 |
-
Web
|
1069 |
-
Web
|
1070 |
-
Web
|
1071 |
-
Web
|
1072 |
-
Web
|
1073 |
-
Web
|
1074 |
-
Web
|
1075 |
-
Web
|
1076 |
Webalta
|
1077 |
Webauskunft
|
1078 |
WebAuto
|
@@ -1082,11 +1095,13 @@ webcollage
|
|
1082 |
WebCookies
|
1083 |
WebCopier
|
1084 |
WebCorp
|
|
|
1085 |
WebDoc
|
1086 |
WebEnhancer
|
1087 |
WebFetch
|
1088 |
WebFuck
|
1089 |
-
|
|
|
1090 |
WebImageCollector
|
1091 |
WebImages
|
1092 |
WebIndex
|
@@ -1100,21 +1115,18 @@ WebSauger
|
|
1100 |
webscreenie
|
1101 |
Webshag
|
1102 |
Webshot
|
1103 |
-
Website
|
1104 |
-
Website\ Quester
|
1105 |
-
WebsiteExtractor
|
1106 |
websitepulse agent
|
1107 |
-
websitepulse[+ ]checker
|
1108 |
WebsiteQuester
|
1109 |
-
Websnapr
|
|
|
1110 |
Webster
|
1111 |
WebStripper
|
1112 |
WebSucker
|
1113 |
-
Webthumb\/
|
1114 |
WebThumbnail
|
1115 |
WebWhacker
|
1116 |
WebZIP
|
1117 |
-
WeCrawlForThePeace
|
1118 |
WeLikeLinks
|
1119 |
WEPA
|
1120 |
WeSEE
|
@@ -1129,7 +1141,6 @@ Whibse
|
|
1129 |
WhoRunsCoinHive
|
1130 |
Whynder Magnet
|
1131 |
Windows-RSS-Platform
|
1132 |
-
WinHttpRequest
|
1133 |
WinPodder
|
1134 |
wkhtmlto
|
1135 |
wmtips
|
@@ -1146,6 +1157,7 @@ wscheck
|
|
1146 |
Wtrace
|
1147 |
WWW-Collector-E
|
1148 |
WWW-Mechanize
|
|
|
1149 |
WWW::Mechanize
|
1150 |
www\.monitor\.us
|
1151 |
WWWOFFLE
|
@@ -1153,13 +1165,12 @@ x09Mozilla
|
|
1153 |
x22Mozilla
|
1154 |
XaxisSemanticsClassifier
|
1155 |
Xenu Link Sleuth
|
1156 |
-
XING-contenttabreceiver
|
1157 |
-
XmlSitemapGenerator
|
1158 |
xpymep([0-9]?)\.exe
|
1159 |
Y!J-(ASR|BSC)
|
|
|
1160 |
Yaanb
|
1161 |
yacy
|
1162 |
-
Yahoo Ad monitoring
|
1163 |
Yahoo Link Preview
|
1164 |
YahooCacheSystem
|
1165 |
YahooYSMcm
|
@@ -1171,19 +1182,22 @@ Yo-yo
|
|
1171 |
Yoleo Consumer
|
1172 |
yoogliFetchAgent
|
1173 |
YottaaMonitor
|
1174 |
-
Your-Website-Sucks
|
1175 |
yourls\.org
|
|
|
|
|
|
|
1176 |
Zade
|
1177 |
Zao
|
1178 |
Zauba
|
1179 |
Zemanta Aggregator
|
1180 |
-
Zend\\Http\\Client
|
1181 |
Zend_Http_Client
|
|
|
1182 |
Zermelo
|
1183 |
Zeus
|
1184 |
zgrab
|
1185 |
ZnajdzFoto
|
1186 |
Zombie\.js
|
|
|
1187 |
ZyBorg
|
1188 |
-
|
1189 |
-
[a-z0-9\-_]*(bot|crawler|archiver|transcoder|spider|uptime|validator|fetcher)
|
1 |
.*Java.*outbrain
|
2 |
YLT
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
^b0t$
|
4 |
^bluefish
|
5 |
^Calypso v\/
|
26 |
^WordPress\.com
|
27 |
^XRL\/[0-9]
|
28 |
^ZmEu
|
29 |
+
008\/
|
30 |
+
13TABS
|
31 |
+
192\.comAgent
|
32 |
+
2ip\.ru
|
33 |
+
404enemy
|
34 |
+
7Siters
|
35 |
+
80legs
|
36 |
+
a\.pr-cy\.ru
|
37 |
a3logics\.in
|
38 |
A6-Indexer
|
|
|
39 |
Abonti
|
40 |
Aboundex
|
41 |
aboutthedomain
|
47 |
adbeat
|
48 |
AddThis
|
49 |
ADmantX
|
50 |
+
AdminLabs
|
51 |
adressendeutschland
|
52 |
+
adscanner
|
|
|
53 |
agentslug
|
54 |
AHC
|
55 |
aihit
|
61 |
alexa site audit
|
62 |
Alibaba\.Security\.Heimdall
|
63 |
Alligator
|
64 |
+
allloadin
|
65 |
AllSubmitter
|
66 |
alyze\.info
|
67 |
amagit
|
68 |
Anarchie
|
69 |
AndroidDownloadManager
|
70 |
Anemone
|
71 |
+
AngleSharp
|
72 |
annotate_google
|
73 |
Ant\.com
|
74 |
Anturis Agent
|
75 |
AnyEvent-HTTP\/
|
76 |
Apache Droid
|
77 |
Apache OpenOffice
|
78 |
+
Apache-HttpAsyncClient
|
79 |
+
Apache-HttpClient
|
80 |
+
ApacheBench
|
81 |
Apexoo
|
82 |
APIs-Google
|
83 |
+
AportWorm\/
|
84 |
+
AppBeat\/
|
85 |
AppEngine-Google
|
86 |
AppStoreScraperZ
|
87 |
+
Aprc\/[0-9]
|
88 |
Arachmo
|
89 |
arachnode
|
90 |
Arachnophilia
|
91 |
aria2
|
92 |
Arukereso
|
93 |
+
asafaweb
|
94 |
AskQuickly
|
95 |
+
Ask Jeeves
|
96 |
ASPSeek
|
97 |
Asterias
|
98 |
Astute
|
104 |
B-l-i-t-z-B-O-T
|
105 |
Backlink-Ceck
|
106 |
backlink-check
|
107 |
+
BacklinkHttpStatus
|
108 |
BackStreet
|
109 |
BackWeb
|
110 |
Bad-Neighborhood
|
111 |
Badass
|
112 |
baidu\.com
|
113 |
Bandit
|
114 |
+
basicstate
|
115 |
BatchFTP
|
116 |
+
Battleztar Bazinga
|
117 |
+
baypup\/
|
|
|
118 |
BazQux
|
119 |
BBBike
|
120 |
BCKLINKS
|
121 |
BDFetch
|
122 |
+
BegunAdvertising
|
123 |
+
Bidtellect
|
124 |
BigBozz
|
125 |
Bigfoot
|
126 |
biglotron
|
130 |
biNu image cacher
|
131 |
Bitacle
|
132 |
biz_Directory
|
133 |
+
Black Hole
|
134 |
Blackboard Safeassign
|
135 |
BlackWidow
|
136 |
BlockNote\.Net
|
137 |
+
Bloglines
|
138 |
Bloglovin
|
139 |
BlogPulseLive
|
140 |
BlogSearch
|
141 |
Blogtrottr
|
142 |
BlowFish
|
|
|
143 |
boitho\.com-dc
|
144 |
BPImageWalker
|
145 |
Braintree-Webhooks
|
146 |
Branch Metrics API
|
147 |
Branch-Passthrough
|
148 |
Brandprotect
|
149 |
+
BrandVerity
|
150 |
Brandwatch
|
151 |
Brodie\/
|
152 |
Browsershots
|
162 |
CAAM\/[0-9]
|
163 |
CakePHP
|
164 |
Calculon
|
165 |
+
Canary%20Mail
|
166 |
CaretNail
|
167 |
catexplorador
|
|
|
168 |
CC Metadata Scaper
|
169 |
Cegbfeieh
|
170 |
+
censys
|
171 |
Cerberian Drtrs
|
172 |
CERT\.at-Statistics-Survey
|
173 |
cg-eye
|
174 |
changedetection
|
175 |
+
ChangesMeter
|
176 |
Charlotte
|
177 |
CheckHost
|
178 |
checkprivacy
|
179 |
CherryPicker
|
180 |
ChinaClaw
|
181 |
+
Chirp\/
|
182 |
chkme\.com
|
183 |
Chlooe
|
184 |
+
Chromaxa
|
185 |
+
CirrusExplorer
|
186 |
CISPA Vulnerability Notification
|
187 |
Citoid
|
188 |
CJNetworkQuality
|
189 |
Clarsentia
|
190 |
clips\.ua\.ac\.be
|
191 |
+
Cloud mapping
|
192 |
CloudEndure
|
193 |
CloudFlare-AlwaysOnline
|
194 |
+
Cloudinary
|
195 |
cmcm\.com
|
196 |
coccoc
|
197 |
cognitiveseo
|
198 |
colly -
|
199 |
CommaFeed
|
200 |
Commons-HttpClient
|
201 |
+
commonscan
|
202 |
contactbigdatafr
|
203 |
contentkingapp
|
204 |
convera
|
205 |
+
CookieReports
|
206 |
copyright sheriff
|
207 |
CopyRightCheck
|
208 |
Copyscape
|
209 |
Cosmos4j\.feedback
|
210 |
Covario-IDS
|
|
|
211 |
Crescent
|
|
|
212 |
Crowsnest
|
213 |
+
Criteo
|
214 |
CSHttp
|
215 |
curb
|
216 |
Curious George
|
217 |
curl
|
218 |
+
cuwhois\/
|
219 |
cybo\.com
|
220 |
+
DAP\/NetHTTP
|
221 |
DareBoost
|
222 |
DatabaseDriverMysqli
|
223 |
DataCha0s
|
224 |
+
Datafeedwatch
|
225 |
Datanyze
|
226 |
DataparkSearch
|
227 |
dataprovider
|
228 |
DataXu
|
229 |
Daum(oa)?[ \/][0-9]
|
|
|
230 |
Demon
|
231 |
DeuSu
|
232 |
developers\.google\.com\/\+\/web\/snippet\/
|
235 |
Digincore
|
236 |
DigitalPebble
|
237 |
Dirbuster
|
238 |
+
Disqus\/
|
239 |
Dispatch\/
|
240 |
DittoSpyder
|
241 |
dlvr
|
242 |
DMBrowser
|
|
|
243 |
DNSPod-reporting
|
244 |
docoloc
|
245 |
+
Dolphin http client
|
246 |
DomainAppender
|
247 |
Donuts Content Explorer
|
248 |
dotMailer content retrieval
|
249 |
dotSemantic
|
250 |
downforeveryoneorjustme
|
251 |
+
Download Wonder
|
252 |
+
downnotifier
|
253 |
DowntimeDetector
|
|
|
254 |
Drip
|
255 |
drupact
|
256 |
Drupal \(\+http:\/\/drupal\.org\/\)
|
257 |
+
DTS Agent
|
258 |
dubaiindex
|
259 |
EARTHCOM
|
260 |
Easy-Thumb
|
264 |
eCairn-Grabber
|
265 |
eCatch
|
266 |
ECCP
|
|
|
267 |
eContext\/
|
268 |
Ecxi
|
269 |
EirGrabber
|
270 |
ElectricMonk
|
271 |
elefent
|
272 |
EMail Exractor
|
273 |
+
EMail Wolf
|
|
|
274 |
EmailWolf
|
275 |
+
Embarcadero
|
276 |
Embed PHP Library
|
277 |
Embedly
|
278 |
endo\/
|
285 |
ExactSearch
|
286 |
ExaleadCloudview
|
287 |
Excel\/
|
288 |
+
exif
|
|
|
289 |
Exploratodo
|
290 |
Express WebPictures
|
291 |
+
Extreme Picture Finder
|
|
|
292 |
EyeNetIE
|
293 |
ezooms
|
294 |
facebookexternalhit
|
298 |
fasthttp
|
299 |
Faveeo
|
300 |
Favicon downloader
|
301 |
+
faviconkit
|
302 |
FavOrg
|
303 |
Feed Wrangler
|
304 |
Feedable\/
|
305 |
Feedbin
|
306 |
FeedBooster
|
307 |
FeedBucket
|
308 |
+
FeedBunch\/
|
309 |
FeedBurner
|
310 |
+
feeder
|
311 |
Feedly
|
|
|
312 |
FeedshowOnline
|
313 |
Feedspot
|
314 |
+
Feedwind\/
|
315 |
FeedZcollector
|
316 |
feeltiptop
|
317 |
Fetch API
|
330 |
Flunky
|
331 |
flynxapp
|
332 |
forensiq
|
333 |
+
FoundSeoTool
|
334 |
+
http:\/\/www.neomo.de\/
|
335 |
free thumbnails
|
336 |
Freeuploader
|
|
|
337 |
Funnelback
|
338 |
G-i-g-a-b-o-t
|
339 |
g00g1e\.net
|
340 |
+
ganarvisitas
|
|
|
341 |
geek-tools
|
|
|
342 |
Genieo
|
343 |
GentleSource
|
344 |
+
GetCode
|
345 |
Getintent
|
346 |
GetLinkInfo
|
347 |
+
getprismatic
|
348 |
GetRight
|
349 |
+
getroot
|
350 |
+
GetURLInfo\/
|
351 |
GetWeb
|
352 |
Ghost Inspector
|
353 |
GigablastOpenSource
|
354 |
GIS-LABS
|
355 |
github-camo
|
356 |
+
github\.com
|
357 |
Go [\d\.]* package http
|
358 |
Go http package
|
|
|
359 |
Go-Ahead-Got-It
|
360 |
Go-http-client
|
361 |
+
Go!Zilla
|
362 |
gobyus
|
363 |
gofetch
|
364 |
GomezAgent
|
365 |
gooblog
|
366 |
+
Goodzer\/
|
367 |
+
Google AppsViewer
|
368 |
+
Google Desktop
|
369 |
Google favicon
|
370 |
Google Keyword Suggestion
|
371 |
Google Keyword Tool
|
383 |
Google-Site-Verification
|
384 |
Google-Structured-Data-Testing-Tool
|
385 |
Google-Youtube-Links
|
386 |
+
google-xrawler
|
387 |
GoogleDocs
|
388 |
GoogleHC\/
|
389 |
GoogleProducer
|
390 |
+
GoogleSites
|
391 |
+
Google-Transparency-Report
|
392 |
Gookey
|
393 |
GoScraper
|
394 |
GoSpotCheck
|
|
|
395 |
gosquared-thumbnailer
|
396 |
Gotit
|
397 |
GoZilla
|
400 |
Grafula
|
401 |
Grammarly
|
402 |
GrapeFX
|
403 |
+
Gregarius
|
404 |
+
GRequests
|
405 |
grokkit
|
406 |
grouphigh
|
407 |
grub-client
|
413 |
HAA(A)?RTLAND http client
|
414 |
Haansoft
|
415 |
hackney\/
|
416 |
+
Hadi Agent
|
417 |
+
HappyApps-WebCheck
|
418 |
Hatena
|
419 |
Havij
|
420 |
+
HeadlessChrome
|
421 |
HEADMasterSEO
|
422 |
HeartRails_Capture
|
423 |
help@dataminr\.com
|
424 |
heritrix
|
425 |
+
historious
|
426 |
+
hkedcity
|
427 |
+
hledejLevne\.cz
|
428 |
Hloader
|
429 |
HMView
|
430 |
Holmes
|
431 |
+
HonesoSearchEngine
|
432 |
HootSuite Image proxy
|
433 |
+
Hootsuite-WebFeed
|
434 |
hosterstats
|
435 |
HostTracker
|
436 |
ht:\/\/check
|
437 |
htdig
|
438 |
HTMLparser
|
439 |
+
htmlyse
|
440 |
+
HTTP Banner Detection
|
441 |
+
HTTP_Compression_Test
|
442 |
+
http_request2
|
443 |
+
http_requester
|
444 |
http-get
|
445 |
HTTP-Header-Abfrage
|
446 |
http-kit
|
448 |
HTTP-Tiny
|
449 |
HTTP::Lite
|
450 |
http\.rb\/
|
451 |
+
http_get
|
|
|
|
|
452 |
HttpComponents
|
453 |
httphr
|
454 |
HTTPMon
|
455 |
+
httpRequest
|
456 |
httpscheck
|
457 |
httpssites_power
|
458 |
httpunit
|
459 |
HttpUrlConnection
|
460 |
httrack
|
461 |
huaweisymantec
|
|
|
462 |
HubSpot
|
463 |
Humanlinks
|
|
|
464 |
i2kconnect\/
|
465 |
Iblog
|
466 |
ichiro
|
467 |
Id-search
|
468 |
IdeelaborPlagiaat
|
469 |
IDG Twitter Links Resolver
|
470 |
+
IDwhois\/
|
471 |
Iframely
|
472 |
igdeSpyder
|
473 |
IlTrovatore
|
474 |
+
Image Fetch
|
475 |
+
Image Sucker
|
|
|
476 |
ImageEngine\/
|
477 |
+
ImageVisu\/
|
478 |
Imagga
|
479 |
+
imagineeasy
|
480 |
imgsizer
|
481 |
InAGist
|
482 |
inbound\.li parser
|
483 |
InDesign%20CC
|
484 |
+
Indy Library
|
485 |
InetURL
|
486 |
infegy
|
487 |
infohelfer
|
488 |
InfoTekies
|
489 |
+
InfoWizards Reciprocal Link
|
490 |
inpwrd\.com
|
491 |
instabid
|
492 |
Instapaper
|
494 |
integromedb
|
495 |
Intelliseek
|
496 |
InterGET
|
|
|
497 |
internet_archive
|
498 |
+
Internet Ninja
|
499 |
InternetSeer
|
500 |
internetVista monitor
|
501 |
intraVnews
|
510 |
Irokez
|
511 |
isitup\.org
|
512 |
iskanie
|
513 |
+
isUp\.li
|
514 |
+
iThemes Sync\/
|
515 |
iZSearch
|
516 |
+
JAHHO
|
517 |
janforman
|
518 |
Jaunt\/
|
519 |
Jbrofuzz
|
533 |
JS-Kit
|
534 |
JustView
|
535 |
Kaspersky Lab CFR link resolver
|
|
|
536 |
Kelny\/
|
537 |
Kerrigan\/
|
538 |
KeyCDN
|
539 |
+
Keyword Density
|
|
|
540 |
Keywords Research
|
541 |
KickFire
|
542 |
KimonoLabs\/
|
550 |
L\.webis
|
551 |
Larbin
|
552 |
Lavf\/
|
|
|
553 |
LeechFTP
|
554 |
LeechGet
|
555 |
letsencrypt
|
558 |
LibWeb
|
559 |
Libwhisker
|
560 |
libwww
|
561 |
+
Licorne
|
562 |
Liferea\/
|
563 |
Lightspeedsystems
|
564 |
Likse
|
|
|
565 |
Link Valet
|
566 |
link_thumbnailer
|
567 |
LinkAlarm\/
|
592 |
mabontland
|
593 |
Mag-Net
|
594 |
MagpieRSS
|
595 |
+
Mail\.Ru
|
596 |
MailChimp
|
597 |
Majestic12
|
598 |
makecontact\/
|
601 |
marketinggrader
|
602 |
MarkMonitor
|
603 |
MarkWatch
|
604 |
+
Mass Downloader
|
605 |
+
masscan\/
|
606 |
+
Mata Hari
|
607 |
Mediapartners-Google
|
608 |
mediawords
|
609 |
MegaIndex\.ru
|
610 |
+
MeltwaterNews
|
611 |
+
Melvil Rawi
|
612 |
Metaspinner
|
613 |
MetaURI
|
614 |
MFC_Tear_Sample
|
617 |
Microsoft Outlook
|
618 |
Microsoft Windows Network Diagnostics
|
619 |
Microsoft-WebDAV-MiniRedir
|
620 |
+
Microsoft Data Access
|
621 |
+
MIDown tool
|
622 |
MIIxpc
|
623 |
Mindjet
|
624 |
+
Miniature\.io
|
625 |
Miniflux
|
626 |
+
Mister PiX
|
627 |
mixdata dot com
|
628 |
mixed-content-scan
|
629 |
Mixmax-LinkPreview
|
632 |
mogimogi
|
633 |
Mojeek
|
634 |
Mojolicious \(Perl\)
|
|
|
635 |
Monit\/
|
636 |
+
monitis
|
637 |
+
Monitority\/
|
638 |
montastic
|
639 |
MonTools
|
640 |
Moreover
|
641 |
+
Morfeus Fucking Scanner
|
642 |
Morning Paper
|
643 |
MovableType
|
644 |
mowser
|
645 |
Mrcgiguy
|
646 |
+
MS Web Services Client Protocol
|
647 |
MSFrontPage
|
648 |
mShots
|
649 |
MuckRack\/
|
651 |
MVAClient
|
652 |
MxToolbox\/
|
653 |
nagios
|
654 |
+
Najdi\.si
|
655 |
+
Name Intelligence
|
656 |
Nameprotect
|
657 |
Navroad
|
658 |
NearSite
|
659 |
Needle
|
660 |
Nessus
|
661 |
+
Net Vampire
|
662 |
NetAnts
|
663 |
NETCRAFT
|
664 |
NetLyzer
|
683 |
Nibbler
|
684 |
NICErsPRO
|
685 |
Nikto
|
686 |
+
nineconnections
|
687 |
NLNZ_IAHarvester
|
688 |
Nmap Scripting Engine
|
689 |
node-superagent
|
690 |
+
node-urllib
|
691 |
node\.io
|
692 |
+
Nodemeter
|
693 |
+
NodePing
|
694 |
nominet\.org\.uk
|
695 |
Norton-Safeweb
|
696 |
Notifixious
|
699 |
nutch
|
700 |
Nuzzel
|
701 |
nWormFeedFinder
|
702 |
+
nyawc\/
|
703 |
Nymesis
|
704 |
NYU
|
705 |
+
Ocelli\/
|
706 |
Octopus
|
707 |
oegp
|
|
|
708 |
Offline Explorer
|
709 |
+
Offline Navigator
|
710 |
+
og-scraper
|
711 |
okhttp
|
|
|
712 |
omgili
|
713 |
OMSC
|
714 |
Online Domain Tools
|
719 |
OpenVAS
|
720 |
Optimizer
|
721 |
Orbiter
|
722 |
+
OrgProbe\/
|
723 |
orion-semantics
|
724 |
Outlook-Express
|
725 |
+
Outlook-iOS
|
726 |
ow\.ly
|
727 |
Owler
|
728 |
ownCloud News
|
729 |
+
OxfordCloudService
|
|
|
730 |
Page Valet
|
|
|
|
|
731 |
page_verifier
|
732 |
+
page scorer
|
733 |
+
page2rss
|
734 |
PageGrabber
|
735 |
PagePeeker
|
736 |
PageScorer
|
737 |
+
Pagespeed\/
|
738 |
Panopta
|
739 |
panscient
|
740 |
+
Papa Foto
|
741 |
parsijoo
|
742 |
Pavuk
|
743 |
PayPal IPN
|
744 |
pcBrowser
|
745 |
Pcore-HTTP
|
|
|
746 |
Pearltrees
|
747 |
PECL::HTTP
|
748 |
peerindex
|
752 |
PhantomJS Screenshoter
|
753 |
PhantomJS\/
|
754 |
Photon\/
|
|
|
755 |
phpservermon
|
756 |
Pi-Monster
|
757 |
Picscout
|
758 |
Picsearch
|
759 |
PictureFinder
|
760 |
Pimonster
|
761 |
+
ping\.blo\.gs
|
762 |
Pingability
|
763 |
PingAdmin\.Ru
|
764 |
Pingdom
|
768 |
Pixray
|
769 |
Pizilla
|
770 |
Plagger\/
|
|
|
771 |
Ploetz \+ Zeller
|
772 |
Plukkie
|
773 |
plumanalytics
|
774 |
+
PocketImageCache
|
775 |
PocketParser
|
776 |
Pockey
|
777 |
POE-Component-Client-HTTP
|
778 |
+
Polymail\/
|
779 |
Pompos
|
780 |
Porkbun
|
781 |
Port Monitor
|
782 |
postano
|
783 |
+
PostmanRuntime
|
784 |
PostPost
|
785 |
postrank
|
786 |
PowerPoint\/
|
787 |
Priceonomics Analysis Engine
|
788 |
+
PrintFriendly
|
789 |
+
PritTorrent
|
790 |
Prlog
|
791 |
probethenet
|
792 |
Project 25499
|
|
|
793 |
prospectb2b
|
794 |
Protopage
|
795 |
ProWebWalker
|
807 |
QQDownload
|
808 |
QrafterPro
|
809 |
Qseero
|
810 |
+
Qualidator
|
811 |
+
QueryN Metasearch
|
812 |
+
queuedriver
|
813 |
Quora Link Preview
|
814 |
Qwantify
|
815 |
Radian6
|
816 |
RankActive
|
817 |
RankFlex
|
818 |
RankSonicSiteAuditor
|
819 |
+
Re-re Studio
|
820 |
Readability
|
821 |
RealDownload
|
822 |
RealPlayer%20Downloader
|
824 |
Recorder
|
825 |
RecurPost\/
|
826 |
redback\/
|
|
|
827 |
ReederForMac
|
828 |
ReGet
|
829 |
RepoMonkey
|
830 |
request\.js
|
831 |
+
ResponseCodeTest
|
832 |
RestSharp
|
833 |
Riddler
|
834 |
Rival IQ
|
835 |
Robosourcer
|
836 |
+
Robozilla
|
837 |
ROI Hunter
|
838 |
RPT-HTTPClient
|
839 |
RSSOwl
|
|
|
840 |
safe-agent-scanner
|
841 |
SalesIntelligent
|
842 |
Saleslift
|
843 |
+
Sendsay\.Ru
|
844 |
SauceNAO
|
845 |
SBIder
|
846 |
scalaj-http
|
847 |
scan\.lol
|
848 |
ScanAlert
|
|
|
849 |
Scoop
|
850 |
scooter
|
851 |
ScoutJet
|
852 |
ScoutURLMonitor
|
853 |
+
ScrapeBox Page Scanner
|
854 |
+
SimpleScraper
|
855 |
Scrapy
|
856 |
Screaming
|
857 |
+
ScreenShotService
|
858 |
Scrubby
|
859 |
Scrutiny\/
|
|
|
860 |
search\.thunderstone
|
861 |
+
Search37
|
862 |
+
searchenginepromotionhelp
|
863 |
Searchestate
|
864 |
SearchExpress
|
865 |
SearchSight
|
871 |
sentry\/
|
872 |
SEO Browser
|
873 |
Seo Servis
|
874 |
+
seo-nastroj\.cz
|
875 |
+
seo4ajax
|
876 |
Seobility
|
877 |
SEOCentro
|
878 |
SeoCheck
|
879 |
SEOkicks
|
880 |
Seomoz
|
881 |
SEOprofiler
|
882 |
+
SEOsearch
|
883 |
seoscanners
|
884 |
+
seositecheckup
|
885 |
SEOstats
|
886 |
+
servernfo
|
|
|
|
|
887 |
sexsearcher
|
888 |
Seznam
|
889 |
Shelob
|
890 |
Shodan
|
891 |
+
Shoppimon
|
|
|
892 |
ShopWiki
|
893 |
ShortLinkTranslate
|
894 |
shrinktheweb
|
895 |
Sideqik
|
|
|
896 |
SimplePie
|
897 |
SimplyFast
|
898 |
Siphon
|
899 |
SISTRIX
|
900 |
Site-Shot\/
|
901 |
+
Site Sucker
|
902 |
Site24x7
|
|
|
903 |
SiteBar
|
904 |
Sitebeam
|
905 |
Sitebulb\/
|
909 |
Siteimprove
|
910 |
SiteIndexed
|
911 |
Sitemap(s)? Generator
|
912 |
+
SitemapGenerator
|
913 |
SiteMonitor
|
914 |
Siteshooter B0t
|
915 |
SiteSnagger
|
925 |
SmartDownload
|
926 |
SMRF URL Expander
|
927 |
SMUrlExpander
|
|
|
928 |
Snake
|
929 |
Snappy
|
930 |
+
SnapSearch
|
931 |
+
Snarfer\/
|
932 |
SniffRSS
|
933 |
sniptracker
|
934 |
Snoopy
|
938 |
Sottopop
|
939 |
sovereign\.ai
|
940 |
SpaceBison
|
941 |
+
SpamExperts
|
942 |
Spammen
|
943 |
Spanner
|
944 |
spaziodati
|
960 |
StatusCake
|
961 |
Steeler
|
962 |
Stratagems Kumo
|
963 |
+
Stroke\.cz
|
964 |
StudioFACA
|
965 |
+
StumbleUpon
|
966 |
suchen
|
967 |
Sucuri
|
968 |
summify
|
|
|
969 |
SuperHTTP
|
970 |
Surphace Scout
|
971 |
Suzuran
|
980 |
tAkeOut
|
981 |
Tarantula\/
|
982 |
Taringa UGC
|
983 |
+
TarmotGezgin
|
984 |
Teleport
|
985 |
Telesoft
|
986 |
Telesphoreo
|
987 |
Telesphorep
|
988 |
Tenon\.io
|
989 |
teoma
|
990 |
+
terrainformatica
|
991 |
Test Certificate Info
|
992 |
+
testuri
|
993 |
+
Tetrahedron
|
994 |
The Drop Reaper
|
995 |
The Expert HTML Source Viewer
|
996 |
The Knowledge AI
|
997 |
+
The Intraformant
|
998 |
theinternetrules
|
999 |
TheNomad
|
|
|
1000 |
Thinklab
|
1001 |
Thumbshots
|
1002 |
ThumbSniper
|
1003 |
+
timewe\.net
|
1004 |
TinEye
|
1005 |
Tiny Tiny RSS
|
1006 |
TLSProbe\/
|
1007 |
Toata
|
1008 |
topster
|
1009 |
+
touche\.com
|
1010 |
+
Traackr\.com
|
1011 |
+
tracemyfile
|
1012 |
TrapitAgent
|
1013 |
Trendiction
|
1014 |
+
Trendsmap
|
1015 |
+
trendspottr
|
1016 |
truwoGPS
|
1017 |
+
TryJsoup
|
1018 |
TulipChain
|
1019 |
Turingos
|
1020 |
Turnitin
|
1021 |
+
tweetedtimes
|
1022 |
Tweetminster
|
1023 |
Tweezler\/
|
1024 |
twibble
|
1029 |
Typhoeus
|
1030 |
ubermetrics-technologies
|
1031 |
uclassify
|
|
|
1032 |
UdmSearch
|
1033 |
unirest-java
|
1034 |
UniversalFeedParser
|
1040 |
Upflow
|
1041 |
Uptimia
|
1042 |
URL Verifier
|
1043 |
+
URLitor
|
|
|
1044 |
urlresolver
|
1045 |
Urlstat
|
1046 |
UrlTrends Ranking Updater
|
1047 |
+
URLy Warning
|
1048 |
URLy\.Warning
|
1049 |
Vacuum
|
1050 |
Vagabondo
|
1051 |
+
VB Project
|
1052 |
vBSEO
|
1053 |
VCI
|
1054 |
via ggpht\.com GoogleImageProxy
|
1060 |
Voil
|
1061 |
voltron
|
1062 |
voyager\/
|
1063 |
+
VSAgent\/
|
1064 |
+
VSB-TUO\/
|
1065 |
Vulnbusters Meter
|
1066 |
VYU2
|
1067 |
w3af\.org
|
1068 |
+
W3C_Unicorn
|
1069 |
W3C-checklink
|
1070 |
W3C-mobileOK
|
1071 |
+
WAC-OFU
|
|
|
1072 |
Wallpapers\/[0-9]+
|
1073 |
WallpapersHD
|
1074 |
wangling
|
1075 |
Wappalyzer
|
1076 |
WatchMouse
|
1077 |
WbSrch\/
|
1078 |
+
WDT\.io
|
1079 |
web-capture\.net
|
|
|
1080 |
Web-sniffer
|
1081 |
+
Web Auto
|
1082 |
+
Web Collage
|
1083 |
+
Web Enhancer
|
1084 |
+
Web Fetch
|
1085 |
+
Web Fuck
|
1086 |
+
Web Pix
|
1087 |
+
Web Sauger
|
1088 |
+
Web Sucker
|
1089 |
Webalta
|
1090 |
Webauskunft
|
1091 |
WebAuto
|
1095 |
WebCookies
|
1096 |
WebCopier
|
1097 |
WebCorp
|
1098 |
+
WebDataStats
|
1099 |
WebDoc
|
1100 |
WebEnhancer
|
1101 |
WebFetch
|
1102 |
WebFuck
|
1103 |
+
WebGazer
|
1104 |
+
WebGo IS
|
1105 |
WebImageCollector
|
1106 |
WebImages
|
1107 |
WebIndex
|
1115 |
webscreenie
|
1116 |
Webshag
|
1117 |
Webshot
|
1118 |
+
Website Quester
|
|
|
|
|
1119 |
websitepulse agent
|
|
|
1120 |
WebsiteQuester
|
1121 |
+
Websnapr
|
1122 |
+
WebSniffer
|
1123 |
Webster
|
1124 |
WebStripper
|
1125 |
WebSucker
|
1126 |
+
Webthumb\/
|
1127 |
WebThumbnail
|
1128 |
WebWhacker
|
1129 |
WebZIP
|
|
|
1130 |
WeLikeLinks
|
1131 |
WEPA
|
1132 |
WeSEE
|
1141 |
WhoRunsCoinHive
|
1142 |
Whynder Magnet
|
1143 |
Windows-RSS-Platform
|
|
|
1144 |
WinPodder
|
1145 |
wkhtmlto
|
1146 |
wmtips
|
1157 |
Wtrace
|
1158 |
WWW-Collector-E
|
1159 |
WWW-Mechanize
|
1160 |
+
WWW::Document
|
1161 |
WWW::Mechanize
|
1162 |
www\.monitor\.us
|
1163 |
WWWOFFLE
|
1165 |
x22Mozilla
|
1166 |
XaxisSemanticsClassifier
|
1167 |
Xenu Link Sleuth
|
1168 |
+
XING-contenttabreceiver
|
|
|
1169 |
xpymep([0-9]?)\.exe
|
1170 |
Y!J-(ASR|BSC)
|
1171 |
+
Y\!J-BRW
|
1172 |
Yaanb
|
1173 |
yacy
|
|
|
1174 |
Yahoo Link Preview
|
1175 |
YahooCacheSystem
|
1176 |
YahooYSMcm
|
1182 |
Yoleo Consumer
|
1183 |
yoogliFetchAgent
|
1184 |
YottaaMonitor
|
1185 |
+
Your-Website-Sucks
|
1186 |
yourls\.org
|
1187 |
+
YoYs\.net
|
1188 |
+
YP\.PL
|
1189 |
+
Zabbix
|
1190 |
Zade
|
1191 |
Zao
|
1192 |
Zauba
|
1193 |
Zemanta Aggregator
|
|
|
1194 |
Zend_Http_Client
|
1195 |
+
Zend\\Http\\Client
|
1196 |
Zermelo
|
1197 |
Zeus
|
1198 |
zgrab
|
1199 |
ZnajdzFoto
|
1200 |
Zombie\.js
|
1201 |
+
Zoom\.Mac
|
1202 |
ZyBorg
|
1203 |
+
[a-z0-9\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer)
|
|
includes/vendor/jaybizzle/crawler-detect/raw/Exclusions.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
["Safari.[\\d\\.]*","Firefox.[\\d\\.]*","Chrome.[\\d\\.]*","Chromium.[\\d\\.]*","MSIE.[\\d\\.]","Opera\\\/[\\d\\.]*","Mozilla.[\\d\\.]*","AppleWebKit.[\\d\\.]*","Trident.[\\d\\.]*","Windows NT.[\\d\\.]*","Android [\\d\\.]*","Macintosh.","Ubuntu","Linux","[ ]Intel","Mac OS X [\\d_]*","(like )?Gecko(.[\\d\\.]*)?","KHTML,","CriOS.[\\d\\.]*","CPU iPhone OS ([0-9_])* like Mac OS X","CPU OS ([0-9_])* like Mac OS X","iPod","compatible","x86_..","i686","x64","X11","rv:[\\d\\.]*","Version.[\\d\\.]*","WOW64","Win64","Dalvik.[\\d\\.]*"," \\.NET CLR [\\d\\.]*","Presto.[\\d\\.]*","Media Center PC","BlackBerry","Build","Opera Mini\\\/\\d{1,2}\\.\\d{1,2}\\.[\\d\\.]*\\\/\\d{1,2}\\.","Opera"," \\.NET[\\d\\.]*","cubot","; M bot","; B bot","; IDbot","; ID bot","; POWER BOT",";"]
|
1 |
+
["Safari.[\\d\\.]*","Firefox.[\\d\\.]*"," Chrome.[\\d\\.]*","Chromium.[\\d\\.]*","MSIE.[\\d\\.]","Opera\\\/[\\d\\.]*","Mozilla.[\\d\\.]*","AppleWebKit.[\\d\\.]*","Trident.[\\d\\.]*","Windows NT.[\\d\\.]*","Android [\\d\\.]*","Macintosh.","Ubuntu","Linux","[ ]Intel","Mac OS X [\\d_]*","(like )?Gecko(.[\\d\\.]*)?","KHTML,","CriOS.[\\d\\.]*","CPU iPhone OS ([0-9_])* like Mac OS X","CPU OS ([0-9_])* like Mac OS X","iPod","compatible","x86_..","i686","x64","X11","rv:[\\d\\.]*","Version.[\\d\\.]*","WOW64","Win64","Dalvik.[\\d\\.]*"," \\.NET CLR [\\d\\.]*","Presto.[\\d\\.]*","Media Center PC","BlackBerry","Build","Opera Mini\\\/\\d{1,2}\\.\\d{1,2}\\.[\\d\\.]*\\\/\\d{1,2}\\.","Opera"," \\.NET[\\d\\.]*","cubot","; M bot","; B bot","; IDbot","; ID bot","; POWER BOT",";"]
|
includes/vendor/jaybizzle/crawler-detect/raw/Exclusions.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
Safari.[\d\.]*
|
2 |
Firefox.[\d\.]*
|
3 |
-
Chrome.[\d\.]*
|
4 |
Chromium.[\d\.]*
|
5 |
MSIE.[\d\.]
|
6 |
Opera\/[\d\.]*
|
1 |
Safari.[\d\.]*
|
2 |
Firefox.[\d\.]*
|
3 |
+
Chrome.[\d\.]*
|
4 |
Chromium.[\d\.]*
|
5 |
MSIE.[\d\.]
|
6 |
Opera\/[\d\.]*
|
includes/vendor/jaybizzle/crawler-detect/src/CrawlerDetect.php
CHANGED
@@ -86,7 +86,7 @@ class CrawlerDetect
|
|
86 |
$this->compiledExclusions = $this->compileRegex($this->exclusions->getAll());
|
87 |
|
88 |
$this->setHttpHeaders($headers);
|
89 |
-
$this->
|
90 |
}
|
91 |
|
92 |
/**
|
@@ -150,7 +150,7 @@ class CrawlerDetect
|
|
150 |
}
|
151 |
}
|
152 |
|
153 |
-
return $userAgent;
|
154 |
}
|
155 |
|
156 |
/**
|
@@ -162,15 +162,17 @@ class CrawlerDetect
|
|
162 |
*/
|
163 |
public function isCrawler($userAgent = null)
|
164 |
{
|
165 |
-
$agent =
|
|
|
|
|
|
|
|
|
166 |
|
167 |
-
$agent
|
168 |
-
|
169 |
-
if (strlen(trim($agent)) == 0) {
|
170 |
return false;
|
171 |
}
|
172 |
|
173 |
-
$result = preg_match(
|
174 |
|
175 |
if ($matches) {
|
176 |
$this->matches = $matches;
|
86 |
$this->compiledExclusions = $this->compileRegex($this->exclusions->getAll());
|
87 |
|
88 |
$this->setHttpHeaders($headers);
|
89 |
+
$this->setUserAgent($userAgent);
|
90 |
}
|
91 |
|
92 |
/**
|
150 |
}
|
151 |
}
|
152 |
|
153 |
+
return $this->userAgent = $userAgent;
|
154 |
}
|
155 |
|
156 |
/**
|
162 |
*/
|
163 |
public function isCrawler($userAgent = null)
|
164 |
{
|
165 |
+
$agent = trim(preg_replace(
|
166 |
+
"/{$this->compiledExclusions}/i",
|
167 |
+
'',
|
168 |
+
$userAgent ?: $this->userAgent
|
169 |
+
));
|
170 |
|
171 |
+
if ($agent == '') {
|
|
|
|
|
172 |
return false;
|
173 |
}
|
174 |
|
175 |
+
$result = preg_match("/{$this->compiledRegex}/i", $agent, $matches);
|
176 |
|
177 |
if ($matches) {
|
178 |
$this->matches = $matches;
|
includes/vendor/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php
CHANGED
@@ -19,6 +19,7 @@ abstract class AbstractProvider
|
|
19 |
* @var array
|
20 |
*/
|
21 |
protected $data;
|
|
|
22 |
/**
|
23 |
* Return the data set.
|
24 |
*
|
19 |
* @var array
|
20 |
*/
|
21 |
protected $data;
|
22 |
+
|
23 |
/**
|
24 |
* Return the data set.
|
25 |
*
|
includes/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php
CHANGED
@@ -21,12 +21,6 @@ class Crawlers extends AbstractProvider
|
|
21 |
protected $data = array(
|
22 |
'.*Java.*outbrain',
|
23 |
' YLT',
|
24 |
-
'008\/',
|
25 |
-
'192\.comAgent',
|
26 |
-
'2ip\.ru',
|
27 |
-
'404checker',
|
28 |
-
'404enemy',
|
29 |
-
'80legs',
|
30 |
'^b0t$',
|
31 |
'^bluefish ',
|
32 |
'^Calypso v\/',
|
@@ -53,9 +47,16 @@ class Crawlers extends AbstractProvider
|
|
53 |
'^WordPress\.com',
|
54 |
'^XRL\/[0-9]',
|
55 |
'^ZmEu',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
'a3logics\.in',
|
57 |
'A6-Indexer',
|
58 |
-
'a\.pr-cy\.ru',
|
59 |
'Abonti',
|
60 |
'Aboundex',
|
61 |
'aboutthedomain',
|
@@ -67,9 +68,9 @@ class Crawlers extends AbstractProvider
|
|
67 |
'adbeat',
|
68 |
'AddThis',
|
69 |
'ADmantX',
|
|
|
70 |
'adressendeutschland',
|
71 |
-
'adscanner
|
72 |
-
'Advanced Email Extractor v',
|
73 |
'agentslug',
|
74 |
'AHC',
|
75 |
'aihit',
|
@@ -81,36 +82,38 @@ class Crawlers extends AbstractProvider
|
|
81 |
'alexa site audit',
|
82 |
'Alibaba\.Security\.Heimdall',
|
83 |
'Alligator',
|
84 |
-
'allloadin
|
85 |
'AllSubmitter',
|
86 |
'alyze\.info',
|
87 |
'amagit',
|
88 |
'Anarchie',
|
89 |
'AndroidDownloadManager',
|
90 |
'Anemone',
|
91 |
-
'AngleSharp
|
92 |
'annotate_google',
|
93 |
'Ant\.com',
|
94 |
'Anturis Agent',
|
95 |
'AnyEvent-HTTP\/',
|
96 |
'Apache Droid',
|
97 |
'Apache OpenOffice',
|
98 |
-
'Apache-HttpAsyncClient
|
99 |
-
'Apache-HttpClient
|
100 |
-
'ApacheBench
|
101 |
'Apexoo',
|
102 |
'APIs-Google',
|
103 |
-
'AportWorm\/
|
104 |
-
'AppBeat\/
|
105 |
'AppEngine-Google',
|
106 |
'AppStoreScraperZ',
|
|
|
107 |
'Arachmo',
|
108 |
'arachnode',
|
109 |
'Arachnophilia',
|
110 |
'aria2',
|
111 |
'Arukereso',
|
112 |
-
'asafaweb
|
113 |
'AskQuickly',
|
|
|
114 |
'ASPSeek',
|
115 |
'Asterias',
|
116 |
'Astute',
|
@@ -122,22 +125,23 @@ class Crawlers extends AbstractProvider
|
|
122 |
'B-l-i-t-z-B-O-T',
|
123 |
'Backlink-Ceck',
|
124 |
'backlink-check',
|
|
|
125 |
'BackStreet',
|
126 |
'BackWeb',
|
127 |
'Bad-Neighborhood',
|
128 |
'Badass',
|
129 |
'baidu\.com',
|
130 |
'Bandit',
|
|
|
131 |
'BatchFTP',
|
132 |
-
'Battleztar
|
133 |
-
'baypup\/
|
134 |
-
'baypup\/colbert',
|
135 |
'BazQux',
|
136 |
'BBBike',
|
137 |
'BCKLINKS',
|
138 |
'BDFetch',
|
139 |
-
'BegunAdvertising
|
140 |
-
'Bidtellect
|
141 |
'BigBozz',
|
142 |
'Bigfoot',
|
143 |
'biglotron',
|
@@ -147,23 +151,23 @@ class Crawlers extends AbstractProvider
|
|
147 |
'biNu image cacher',
|
148 |
'Bitacle',
|
149 |
'biz_Directory',
|
150 |
-
'Black
|
151 |
'Blackboard Safeassign',
|
152 |
'BlackWidow',
|
153 |
'BlockNote\.Net',
|
154 |
-
'Bloglines
|
155 |
'Bloglovin',
|
156 |
'BlogPulseLive',
|
157 |
'BlogSearch',
|
158 |
'Blogtrottr',
|
159 |
'BlowFish',
|
160 |
-
'Boardreader',
|
161 |
'boitho\.com-dc',
|
162 |
'BPImageWalker',
|
163 |
'Braintree-Webhooks',
|
164 |
'Branch Metrics API',
|
165 |
'Branch-Passthrough',
|
166 |
'Brandprotect',
|
|
|
167 |
'Brandwatch',
|
168 |
'Brodie\/',
|
169 |
'Browsershots',
|
@@ -179,70 +183,71 @@ class Crawlers extends AbstractProvider
|
|
179 |
'CAAM\/[0-9]',
|
180 |
'CakePHP',
|
181 |
'Calculon',
|
182 |
-
'
|
183 |
'CaretNail',
|
184 |
'catexplorador',
|
185 |
-
'cb crawl',
|
186 |
'CC Metadata Scaper',
|
187 |
'Cegbfeieh',
|
|
|
188 |
'Cerberian Drtrs',
|
189 |
'CERT\.at-Statistics-Survey',
|
190 |
'cg-eye',
|
191 |
'changedetection',
|
192 |
-
'ChangesMeter
|
193 |
'Charlotte',
|
194 |
'CheckHost',
|
195 |
'checkprivacy',
|
196 |
'CherryPicker',
|
197 |
'ChinaClaw',
|
198 |
-
'Chirp\/
|
199 |
'chkme\.com',
|
200 |
'Chlooe',
|
201 |
-
'
|
|
|
202 |
'CISPA Vulnerability Notification',
|
203 |
'Citoid',
|
204 |
'CJNetworkQuality',
|
205 |
'Clarsentia',
|
206 |
'clips\.ua\.ac\.be',
|
207 |
-
'Cloud
|
208 |
'CloudEndure',
|
209 |
'CloudFlare-AlwaysOnline',
|
210 |
-
'Cloudinary
|
211 |
'cmcm\.com',
|
212 |
'coccoc',
|
213 |
'cognitiveseo',
|
214 |
'colly -',
|
215 |
'CommaFeed',
|
216 |
'Commons-HttpClient',
|
217 |
-
'
|
218 |
'contactbigdatafr',
|
219 |
'contentkingapp',
|
220 |
'convera',
|
221 |
-
'CookieReports
|
222 |
'copyright sheriff',
|
223 |
'CopyRightCheck',
|
224 |
'Copyscape',
|
225 |
'Cosmos4j\.feedback',
|
226 |
'Covario-IDS',
|
227 |
-
'CrawlForMe\/[0-9]',
|
228 |
'Crescent',
|
229 |
-
'cron-job\.org',
|
230 |
'Crowsnest',
|
|
|
231 |
'CSHttp',
|
232 |
'curb',
|
233 |
'Curious George',
|
234 |
'curl',
|
235 |
-
'cuwhois\/
|
236 |
'cybo\.com',
|
|
|
237 |
'DareBoost',
|
238 |
'DatabaseDriverMysqli',
|
239 |
'DataCha0s',
|
|
|
240 |
'Datanyze',
|
241 |
'DataparkSearch',
|
242 |
'dataprovider',
|
243 |
'DataXu',
|
244 |
'Daum(oa)?[ \/][0-9]',
|
245 |
-
'DemandbasePublisherAnalyzer\/',
|
246 |
'Demon',
|
247 |
'DeuSu',
|
248 |
'developers\.google\.com\/\+\/web\/snippet\/',
|
@@ -251,27 +256,26 @@ class Crawlers extends AbstractProvider
|
|
251 |
'Digincore',
|
252 |
'DigitalPebble',
|
253 |
'Dirbuster',
|
|
|
254 |
'Dispatch\/',
|
255 |
'DittoSpyder',
|
256 |
'dlvr',
|
257 |
'DMBrowser',
|
258 |
-
'DNS-Tools Header-Analyzer',
|
259 |
'DNSPod-reporting',
|
260 |
'docoloc',
|
261 |
-
'Dolphin http client
|
262 |
'DomainAppender',
|
263 |
'Donuts Content Explorer',
|
264 |
'dotMailer content retrieval',
|
265 |
'dotSemantic',
|
266 |
'downforeveryoneorjustme',
|
267 |
-
'Download
|
268 |
-
'downnotifier
|
269 |
'DowntimeDetector',
|
270 |
-
'Dragonfly File Reader',
|
271 |
'Drip',
|
272 |
'drupact',
|
273 |
'Drupal \(\+http:\/\/drupal\.org\/\)',
|
274 |
-
'DTS
|
275 |
'dubaiindex',
|
276 |
'EARTHCOM',
|
277 |
'Easy-Thumb',
|
@@ -281,16 +285,15 @@ class Crawlers extends AbstractProvider
|
|
281 |
'eCairn-Grabber',
|
282 |
'eCatch',
|
283 |
'ECCP',
|
284 |
-
'echocrawl',
|
285 |
'eContext\/',
|
286 |
'Ecxi',
|
287 |
'EirGrabber',
|
288 |
'ElectricMonk',
|
289 |
'elefent',
|
290 |
'EMail Exractor',
|
291 |
-
'
|
292 |
-
'EMail\ Wolf',
|
293 |
'EmailWolf',
|
|
|
294 |
'Embed PHP Library',
|
295 |
'Embedly',
|
296 |
'endo\/',
|
@@ -303,12 +306,10 @@ class Crawlers extends AbstractProvider
|
|
303 |
'ExactSearch',
|
304 |
'ExaleadCloudview',
|
305 |
'Excel\/',
|
306 |
-
'
|
307 |
-
'ExperianCrawlUK',
|
308 |
'Exploratodo',
|
309 |
'Express WebPictures',
|
310 |
-
'
|
311 |
-
'Extreme\ Picture\ Finder',
|
312 |
'EyeNetIE',
|
313 |
'ezooms',
|
314 |
'facebookexternalhit',
|
@@ -318,20 +319,20 @@ class Crawlers extends AbstractProvider
|
|
318 |
'fasthttp',
|
319 |
'Faveeo',
|
320 |
'Favicon downloader',
|
|
|
321 |
'FavOrg',
|
322 |
'Feed Wrangler',
|
323 |
'Feedable\/',
|
324 |
'Feedbin',
|
325 |
'FeedBooster',
|
326 |
'FeedBucket',
|
327 |
-
'FeedBunch\/
|
328 |
'FeedBurner',
|
329 |
-
'
|
330 |
'Feedly',
|
331 |
-
'Feedreader',
|
332 |
'FeedshowOnline',
|
333 |
'Feedspot',
|
334 |
-
'Feedwind\/
|
335 |
'FeedZcollector',
|
336 |
'feeltiptop',
|
337 |
'Fetch API',
|
@@ -350,41 +351,42 @@ class Crawlers extends AbstractProvider
|
|
350 |
'Flunky',
|
351 |
'flynxapp',
|
352 |
'forensiq',
|
353 |
-
'FoundSeoTool
|
|
|
354 |
'free thumbnails',
|
355 |
'Freeuploader',
|
356 |
-
'FreeWebMonitoring SiteChecker',
|
357 |
'Funnelback',
|
358 |
'G-i-g-a-b-o-t',
|
359 |
'g00g1e\.net',
|
360 |
-
'
|
361 |
-
'ganarvisitas\/[0-9]',
|
362 |
'geek-tools',
|
363 |
-
'Genderanalyzer',
|
364 |
'Genieo',
|
365 |
'GentleSource',
|
|
|
366 |
'Getintent',
|
367 |
'GetLinkInfo',
|
368 |
-
'getprismatic
|
369 |
'GetRight',
|
370 |
-
'
|
|
|
371 |
'GetWeb',
|
372 |
'Ghost Inspector',
|
373 |
'GigablastOpenSource',
|
374 |
'GIS-LABS',
|
375 |
'github-camo',
|
376 |
-
'github\.com
|
377 |
'Go [\d\.]* package http',
|
378 |
'Go http package',
|
379 |
-
'Go!Zilla',
|
380 |
'Go-Ahead-Got-It',
|
381 |
'Go-http-client',
|
|
|
382 |
'gobyus',
|
383 |
'gofetch',
|
384 |
'GomezAgent',
|
385 |
'gooblog',
|
386 |
-
'Goodzer\/
|
387 |
-
'
|
|
|
388 |
'Google favicon',
|
389 |
'Google Keyword Suggestion',
|
390 |
'Google Keyword Tool',
|
@@ -402,14 +404,15 @@ class Crawlers extends AbstractProvider
|
|
402 |
'Google-Site-Verification',
|
403 |
'Google-Structured-Data-Testing-Tool',
|
404 |
'Google-Youtube-Links',
|
405 |
-
'
|
406 |
'GoogleDocs',
|
407 |
'GoogleHC\/',
|
408 |
'GoogleProducer',
|
|
|
|
|
409 |
'Gookey',
|
410 |
'GoScraper',
|
411 |
'GoSpotCheck',
|
412 |
-
'GoSquared-Status-Checker',
|
413 |
'gosquared-thumbnailer',
|
414 |
'Gotit',
|
415 |
'GoZilla',
|
@@ -418,6 +421,8 @@ class Crawlers extends AbstractProvider
|
|
418 |
'Grafula',
|
419 |
'Grammarly',
|
420 |
'GrapeFX',
|
|
|
|
|
421 |
'grokkit',
|
422 |
'grouphigh',
|
423 |
'grub-client',
|
@@ -429,27 +434,34 @@ class Crawlers extends AbstractProvider
|
|
429 |
'HAA(A)?RTLAND http client',
|
430 |
'Haansoft',
|
431 |
'hackney\/',
|
|
|
|
|
432 |
'Hatena',
|
433 |
'Havij',
|
434 |
-
'
|
435 |
'HEADMasterSEO',
|
436 |
'HeartRails_Capture',
|
437 |
'help@dataminr\.com',
|
438 |
'heritrix',
|
439 |
-
'historious
|
440 |
-
'
|
|
|
441 |
'Hloader',
|
442 |
'HMView',
|
443 |
'Holmes',
|
444 |
-
'HonesoSearchEngine
|
445 |
'HootSuite Image proxy',
|
446 |
-
'Hootsuite-WebFeed
|
447 |
'hosterstats',
|
448 |
'HostTracker',
|
449 |
'ht:\/\/check',
|
450 |
'htdig',
|
451 |
'HTMLparser',
|
452 |
-
'htmlyse
|
|
|
|
|
|
|
|
|
453 |
'http-get',
|
454 |
'HTTP-Header-Abfrage',
|
455 |
'http-kit',
|
@@ -457,47 +469,45 @@ class Crawlers extends AbstractProvider
|
|
457 |
'HTTP-Tiny',
|
458 |
'HTTP::Lite',
|
459 |
'http\.rb\/',
|
460 |
-
'
|
461 |
-
'http_request2',
|
462 |
-
'http_requester',
|
463 |
'HttpComponents',
|
464 |
'httphr',
|
465 |
'HTTPMon',
|
|
|
466 |
'httpscheck',
|
467 |
'httpssites_power',
|
468 |
'httpunit',
|
469 |
'HttpUrlConnection',
|
470 |
'httrack',
|
471 |
'huaweisymantec',
|
472 |
-
'HubPages.*crawlingpolicy',
|
473 |
'HubSpot ',
|
474 |
'Humanlinks',
|
475 |
-
'HyperZbozi.cz Feeder',
|
476 |
'i2kconnect\/',
|
477 |
'Iblog',
|
478 |
'ichiro',
|
479 |
'Id-search',
|
480 |
'IdeelaborPlagiaat',
|
481 |
'IDG Twitter Links Resolver',
|
482 |
-
'IDwhois\/
|
483 |
'Iframely',
|
484 |
'igdeSpyder',
|
485 |
'IlTrovatore',
|
486 |
-
'
|
487 |
-
'Image
|
488 |
-
'Image\ Sucker',
|
489 |
'ImageEngine\/',
|
|
|
490 |
'Imagga',
|
|
|
491 |
'imgsizer',
|
492 |
'InAGist',
|
493 |
'inbound\.li parser',
|
494 |
'InDesign%20CC',
|
495 |
-
'Indy
|
496 |
'InetURL',
|
497 |
'infegy',
|
498 |
'infohelfer',
|
499 |
'InfoTekies',
|
500 |
-
'InfoWizards Reciprocal Link
|
501 |
'inpwrd\.com',
|
502 |
'instabid',
|
503 |
'Instapaper',
|
@@ -505,8 +515,8 @@ class Crawlers extends AbstractProvider
|
|
505 |
'integromedb',
|
506 |
'Intelliseek',
|
507 |
'InterGET',
|
508 |
-
'Internet\ Ninja',
|
509 |
'internet_archive',
|
|
|
510 |
'InternetSeer',
|
511 |
'internetVista monitor',
|
512 |
'intraVnews',
|
@@ -521,7 +531,10 @@ class Crawlers extends AbstractProvider
|
|
521 |
'Irokez',
|
522 |
'isitup\.org',
|
523 |
'iskanie',
|
|
|
|
|
524 |
'iZSearch',
|
|
|
525 |
'janforman',
|
526 |
'Jaunt\/',
|
527 |
'Jbrofuzz',
|
@@ -541,12 +554,10 @@ class Crawlers extends AbstractProvider
|
|
541 |
'JS-Kit',
|
542 |
'JustView',
|
543 |
'Kaspersky Lab CFR link resolver',
|
544 |
-
'KeepRight OpenStreetMap Checker',
|
545 |
'Kelny\/',
|
546 |
'Kerrigan\/',
|
547 |
'KeyCDN',
|
548 |
-
'Keyword
|
549 |
-
'Keyword\ Density',
|
550 |
'Keywords Research',
|
551 |
'KickFire',
|
552 |
'KimonoLabs\/',
|
@@ -560,7 +571,6 @@ class Crawlers extends AbstractProvider
|
|
560 |
'L\.webis',
|
561 |
'Larbin',
|
562 |
'Lavf\/',
|
563 |
-
'LayeredExtractor',
|
564 |
'LeechFTP',
|
565 |
'LeechGet',
|
566 |
'letsencrypt',
|
@@ -569,11 +579,10 @@ class Crawlers extends AbstractProvider
|
|
569 |
'LibWeb',
|
570 |
'Libwhisker',
|
571 |
'libwww',
|
572 |
-
'Licorne
|
573 |
'Liferea\/',
|
574 |
'Lightspeedsystems',
|
575 |
'Likse',
|
576 |
-
'link checker',
|
577 |
'Link Valet',
|
578 |
'link_thumbnailer',
|
579 |
'LinkAlarm\/',
|
@@ -604,7 +613,7 @@ class Crawlers extends AbstractProvider
|
|
604 |
'mabontland',
|
605 |
'Mag-Net',
|
606 |
'MagpieRSS',
|
607 |
-
'Mail
|
608 |
'MailChimp',
|
609 |
'Majestic12',
|
610 |
'makecontact\/',
|
@@ -613,14 +622,14 @@ class Crawlers extends AbstractProvider
|
|
613 |
'marketinggrader',
|
614 |
'MarkMonitor',
|
615 |
'MarkWatch',
|
616 |
-
'Mass
|
617 |
-
'masscan\/
|
618 |
-
'Mata
|
619 |
'Mediapartners-Google',
|
620 |
'mediawords',
|
621 |
'MegaIndex\.ru',
|
622 |
-
'
|
623 |
-
'
|
624 |
'Metaspinner',
|
625 |
'MetaURI',
|
626 |
'MFC_Tear_Sample',
|
@@ -629,13 +638,13 @@ class Crawlers extends AbstractProvider
|
|
629 |
'Microsoft Outlook',
|
630 |
'Microsoft Windows Network Diagnostics',
|
631 |
'Microsoft-WebDAV-MiniRedir',
|
632 |
-
'Microsoft
|
633 |
-
'MIDown
|
634 |
'MIIxpc',
|
635 |
'Mindjet',
|
636 |
-
'Miniature
|
637 |
'Miniflux',
|
638 |
-
'Mister
|
639 |
'mixdata dot com',
|
640 |
'mixed-content-scan',
|
641 |
'Mixmax-LinkPreview',
|
@@ -644,18 +653,18 @@ class Crawlers extends AbstractProvider
|
|
644 |
'mogimogi',
|
645 |
'Mojeek',
|
646 |
'Mojolicious \(Perl\)',
|
647 |
-
'monitis',
|
648 |
'Monit\/',
|
649 |
-
'
|
|
|
650 |
'montastic',
|
651 |
'MonTools',
|
652 |
'Moreover',
|
653 |
-
'Morfeus
|
654 |
'Morning Paper',
|
655 |
'MovableType',
|
656 |
'mowser',
|
657 |
'Mrcgiguy',
|
658 |
-
'MS
|
659 |
'MSFrontPage',
|
660 |
'mShots',
|
661 |
'MuckRack\/',
|
@@ -663,14 +672,14 @@ class Crawlers extends AbstractProvider
|
|
663 |
'MVAClient',
|
664 |
'MxToolbox\/',
|
665 |
'nagios',
|
666 |
-
'Najdi\.si
|
667 |
-
'Name
|
668 |
'Nameprotect',
|
669 |
'Navroad',
|
670 |
'NearSite',
|
671 |
'Needle',
|
672 |
'Nessus',
|
673 |
-
'Net
|
674 |
'NetAnts',
|
675 |
'NETCRAFT',
|
676 |
'NetLyzer',
|
@@ -695,12 +704,14 @@ class Crawlers extends AbstractProvider
|
|
695 |
'Nibbler',
|
696 |
'NICErsPRO',
|
697 |
'Nikto',
|
698 |
-
'nineconnections
|
699 |
'NLNZ_IAHarvester',
|
700 |
'Nmap Scripting Engine',
|
701 |
'node-superagent',
|
702 |
-
'node-urllib
|
703 |
'node\.io',
|
|
|
|
|
704 |
'nominet\.org\.uk',
|
705 |
'Norton-Safeweb',
|
706 |
'Notifixious',
|
@@ -709,16 +720,16 @@ class Crawlers extends AbstractProvider
|
|
709 |
'nutch',
|
710 |
'Nuzzel',
|
711 |
'nWormFeedFinder',
|
|
|
712 |
'Nymesis',
|
713 |
'NYU',
|
714 |
-
'Ocelli\/
|
715 |
'Octopus',
|
716 |
'oegp',
|
717 |
-
'og-scraper\/',
|
718 |
'Offline Explorer',
|
719 |
-
'Offline
|
|
|
720 |
'okhttp',
|
721 |
-
'Omea Reader',
|
722 |
'omgili',
|
723 |
'OMSC',
|
724 |
'Online Domain Tools',
|
@@ -729,32 +740,30 @@ class Crawlers extends AbstractProvider
|
|
729 |
'OpenVAS',
|
730 |
'Optimizer',
|
731 |
'Orbiter',
|
732 |
-
'OrgProbe\/
|
733 |
'orion-semantics',
|
734 |
'Outlook-Express',
|
|
|
735 |
'ow\.ly',
|
736 |
'Owler',
|
737 |
'ownCloud News',
|
738 |
-
'OxfordCloudService
|
739 |
-
'Page Analyzer',
|
740 |
'Page Valet',
|
741 |
-
'page2rss',
|
742 |
-
'page\ scorer',
|
743 |
'page_verifier',
|
744 |
-
'
|
|
|
745 |
'PageGrabber',
|
746 |
'PagePeeker',
|
747 |
'PageScorer',
|
748 |
-
'Pagespeed\/
|
749 |
'Panopta',
|
750 |
'panscient',
|
751 |
-
'Papa
|
752 |
'parsijoo',
|
753 |
'Pavuk',
|
754 |
'PayPal IPN',
|
755 |
'pcBrowser',
|
756 |
'Pcore-HTTP',
|
757 |
-
'PEAR HTTPRequest',
|
758 |
'Pearltrees',
|
759 |
'PECL::HTTP',
|
760 |
'peerindex',
|
@@ -764,14 +773,13 @@ class Crawlers extends AbstractProvider
|
|
764 |
'PhantomJS Screenshoter',
|
765 |
'PhantomJS\/',
|
766 |
'Photon\/',
|
767 |
-
'phpcrawl',
|
768 |
'phpservermon',
|
769 |
'Pi-Monster',
|
770 |
'Picscout',
|
771 |
'Picsearch',
|
772 |
'PictureFinder',
|
773 |
'Pimonster',
|
774 |
-
'ping\.blo\.gs
|
775 |
'Pingability',
|
776 |
'PingAdmin\.Ru',
|
777 |
'Pingdom',
|
@@ -781,28 +789,28 @@ class Crawlers extends AbstractProvider
|
|
781 |
'Pixray',
|
782 |
'Pizilla',
|
783 |
'Plagger\/',
|
784 |
-
'PleaseCrawl',
|
785 |
'Ploetz \+ Zeller',
|
786 |
'Plukkie',
|
787 |
'plumanalytics',
|
|
|
788 |
'PocketParser',
|
789 |
'Pockey',
|
790 |
'POE-Component-Client-HTTP',
|
|
|
791 |
'Pompos',
|
792 |
'Porkbun',
|
793 |
'Port Monitor',
|
794 |
'postano',
|
795 |
-
'PostmanRuntime
|
796 |
'PostPost',
|
797 |
'postrank',
|
798 |
'PowerPoint\/',
|
799 |
'Priceonomics Analysis Engine',
|
800 |
-
'PrintFriendly
|
801 |
-
'PritTorrent
|
802 |
'Prlog',
|
803 |
'probethenet',
|
804 |
'Project 25499',
|
805 |
-
'Promotion_Tools_www.searchenginepromotionhelp.com',
|
806 |
'prospectb2b',
|
807 |
'Protopage',
|
808 |
'ProWebWalker',
|
@@ -820,15 +828,16 @@ class Crawlers extends AbstractProvider
|
|
820 |
'QQDownload',
|
821 |
'QrafterPro',
|
822 |
'Qseero',
|
823 |
-
'Qualidator
|
824 |
-
'QueryN
|
|
|
825 |
'Quora Link Preview',
|
826 |
'Qwantify',
|
827 |
'Radian6',
|
828 |
'RankActive',
|
829 |
'RankFlex',
|
830 |
'RankSonicSiteAuditor',
|
831 |
-
'
|
832 |
'Readability',
|
833 |
'RealDownload',
|
834 |
'RealPlayer%20Downloader',
|
@@ -836,41 +845,42 @@ class Crawlers extends AbstractProvider
|
|
836 |
'Recorder',
|
837 |
'RecurPost\/',
|
838 |
'redback\/',
|
839 |
-
'Redirect Checker Tool',
|
840 |
'ReederForMac',
|
841 |
'ReGet',
|
842 |
'RepoMonkey',
|
843 |
'request\.js',
|
844 |
-
'ResponseCodeTest
|
845 |
'RestSharp',
|
846 |
'Riddler',
|
847 |
'Rival IQ',
|
848 |
'Robosourcer',
|
849 |
-
'Robozilla
|
850 |
'ROI Hunter',
|
851 |
'RPT-HTTPClient',
|
852 |
'RSSOwl',
|
853 |
-
'RssReader\/',
|
854 |
'safe-agent-scanner',
|
855 |
'SalesIntelligent',
|
856 |
'Saleslift',
|
|
|
857 |
'SauceNAO',
|
858 |
'SBIder',
|
859 |
'scalaj-http',
|
860 |
'scan\.lol',
|
861 |
'ScanAlert',
|
862 |
-
'ScrapeBox Page Scanner',
|
863 |
'Scoop',
|
864 |
'scooter',
|
865 |
'ScoutJet',
|
866 |
'ScoutURLMonitor',
|
|
|
|
|
867 |
'Scrapy',
|
868 |
'Screaming',
|
869 |
-
'ScreenShotService
|
870 |
'Scrubby',
|
871 |
'Scrutiny\/',
|
872 |
-
'Search37\/',
|
873 |
'search\.thunderstone',
|
|
|
|
|
874 |
'Searchestate',
|
875 |
'SearchExpress',
|
876 |
'SearchSight',
|
@@ -882,37 +892,35 @@ class Crawlers extends AbstractProvider
|
|
882 |
'sentry\/',
|
883 |
'SEO Browser',
|
884 |
'Seo Servis',
|
885 |
-
'seo-nastroj
|
|
|
886 |
'Seobility',
|
887 |
'SEOCentro',
|
888 |
'SeoCheck',
|
889 |
'SEOkicks',
|
890 |
'Seomoz',
|
891 |
'SEOprofiler',
|
892 |
-
'
|
893 |
'seoscanners',
|
|
|
894 |
'SEOstats',
|
895 |
-
'
|
896 |
-
'servernfo\.com',
|
897 |
-
'SetCronJob\/',
|
898 |
'sexsearcher',
|
899 |
'Seznam',
|
900 |
'Shelob',
|
901 |
'Shodan',
|
902 |
-
'Shoppimon
|
903 |
-
'ShoppimonAgent\/[0-9]',
|
904 |
'ShopWiki',
|
905 |
'ShortLinkTranslate',
|
906 |
'shrinktheweb',
|
907 |
'Sideqik',
|
908 |
-
'SilverReader',
|
909 |
'SimplePie',
|
910 |
'SimplyFast',
|
911 |
'Siphon',
|
912 |
'SISTRIX',
|
913 |
'Site-Shot\/',
|
|
|
914 |
'Site24x7',
|
915 |
-
'Site\ Sucker',
|
916 |
'SiteBar',
|
917 |
'Sitebeam',
|
918 |
'Sitebulb\/',
|
@@ -922,6 +930,7 @@ class Crawlers extends AbstractProvider
|
|
922 |
'Siteimprove',
|
923 |
'SiteIndexed',
|
924 |
'Sitemap(s)? Generator',
|
|
|
925 |
'SiteMonitor',
|
926 |
'Siteshooter B0t',
|
927 |
'SiteSnagger',
|
@@ -937,9 +946,10 @@ class Crawlers extends AbstractProvider
|
|
937 |
'SmartDownload',
|
938 |
'SMRF URL Expander',
|
939 |
'SMUrlExpander',
|
940 |
-
'Snarfer\/',
|
941 |
'Snake',
|
942 |
'Snappy',
|
|
|
|
|
943 |
'SniffRSS',
|
944 |
'sniptracker',
|
945 |
'Snoopy',
|
@@ -949,6 +959,7 @@ class Crawlers extends AbstractProvider
|
|
949 |
'Sottopop',
|
950 |
'sovereign\.ai',
|
951 |
'SpaceBison',
|
|
|
952 |
'Spammen',
|
953 |
'Spanner',
|
954 |
'spaziodati',
|
@@ -970,12 +981,12 @@ class Crawlers extends AbstractProvider
|
|
970 |
'StatusCake',
|
971 |
'Steeler',
|
972 |
'Stratagems Kumo',
|
973 |
-
'Stroke
|
974 |
'StudioFACA',
|
|
|
975 |
'suchen',
|
976 |
'Sucuri',
|
977 |
'summify',
|
978 |
-
'Super Monitoring',
|
979 |
'SuperHTTP',
|
980 |
'Surphace Scout',
|
981 |
'Suzuran',
|
@@ -990,41 +1001,45 @@ class Crawlers extends AbstractProvider
|
|
990 |
'tAkeOut',
|
991 |
'Tarantula\/',
|
992 |
'Taringa UGC',
|
|
|
993 |
'Teleport',
|
994 |
'Telesoft',
|
995 |
'Telesphoreo',
|
996 |
'Telesphorep',
|
997 |
'Tenon\.io',
|
998 |
'teoma',
|
999 |
-
'terrainformatica
|
1000 |
'Test Certificate Info',
|
1001 |
-
'
|
|
|
1002 |
'The Drop Reaper',
|
1003 |
'The Expert HTML Source Viewer',
|
1004 |
'The Knowledge AI',
|
1005 |
-
'The
|
1006 |
'theinternetrules',
|
1007 |
'TheNomad',
|
1008 |
-
'theoldreader\.com',
|
1009 |
'Thinklab',
|
1010 |
'Thumbshots',
|
1011 |
'ThumbSniper',
|
|
|
1012 |
'TinEye',
|
1013 |
'Tiny Tiny RSS',
|
1014 |
'TLSProbe\/',
|
1015 |
'Toata',
|
1016 |
'topster',
|
1017 |
-
'touche
|
1018 |
-
'Traackr
|
|
|
1019 |
'TrapitAgent',
|
1020 |
'Trendiction',
|
1021 |
-
'Trendsmap
|
1022 |
-
'trendspottr
|
1023 |
'truwoGPS',
|
|
|
1024 |
'TulipChain',
|
1025 |
'Turingos',
|
1026 |
'Turnitin',
|
1027 |
-
'tweetedtimes
|
1028 |
'Tweetminster',
|
1029 |
'Tweezler\/',
|
1030 |
'twibble',
|
@@ -1035,7 +1050,6 @@ class Crawlers extends AbstractProvider
|
|
1035 |
'Typhoeus',
|
1036 |
'ubermetrics-technologies',
|
1037 |
'uclassify',
|
1038 |
-
'uCrawlr\/',
|
1039 |
'UdmSearch',
|
1040 |
'unirest-java',
|
1041 |
'UniversalFeedParser',
|
@@ -1047,16 +1061,15 @@ class Crawlers extends AbstractProvider
|
|
1047 |
'Upflow',
|
1048 |
'Uptimia',
|
1049 |
'URL Verifier',
|
1050 |
-
'
|
1051 |
-
'URLitor.com',
|
1052 |
'urlresolver',
|
1053 |
'Urlstat',
|
1054 |
'UrlTrends Ranking Updater',
|
1055 |
-
'URLy
|
1056 |
'URLy\.Warning',
|
1057 |
'Vacuum',
|
1058 |
'Vagabondo',
|
1059 |
-
'VB
|
1060 |
'vBSEO',
|
1061 |
'VCI',
|
1062 |
'via ggpht\.com GoogleImageProxy',
|
@@ -1068,32 +1081,32 @@ class Crawlers extends AbstractProvider
|
|
1068 |
'Voil',
|
1069 |
'voltron',
|
1070 |
'voyager\/',
|
1071 |
-
'VSAgent\/
|
1072 |
-
'VSB-TUO\/
|
1073 |
'Vulnbusters Meter',
|
1074 |
'VYU2',
|
1075 |
'w3af\.org',
|
|
|
1076 |
'W3C-checklink',
|
1077 |
'W3C-mobileOK',
|
1078 |
-
'
|
1079 |
-
'W3C_Unicorn',
|
1080 |
'Wallpapers\/[0-9]+',
|
1081 |
'WallpapersHD',
|
1082 |
'wangling',
|
1083 |
'Wappalyzer',
|
1084 |
'WatchMouse',
|
1085 |
'WbSrch\/',
|
|
|
1086 |
'web-capture\.net',
|
1087 |
-
'Web-Monitoring',
|
1088 |
'Web-sniffer',
|
1089 |
-
'Web
|
1090 |
-
'Web
|
1091 |
-
'Web
|
1092 |
-
'Web
|
1093 |
-
'Web
|
1094 |
-
'Web
|
1095 |
-
'Web
|
1096 |
-
'Web
|
1097 |
'Webalta',
|
1098 |
'Webauskunft',
|
1099 |
'WebAuto',
|
@@ -1103,11 +1116,13 @@ class Crawlers extends AbstractProvider
|
|
1103 |
'WebCookies',
|
1104 |
'WebCopier',
|
1105 |
'WebCorp',
|
|
|
1106 |
'WebDoc',
|
1107 |
'WebEnhancer',
|
1108 |
'WebFetch',
|
1109 |
'WebFuck',
|
1110 |
-
'
|
|
|
1111 |
'WebImageCollector',
|
1112 |
'WebImages',
|
1113 |
'WebIndex',
|
@@ -1121,21 +1136,18 @@ class Crawlers extends AbstractProvider
|
|
1121 |
'webscreenie',
|
1122 |
'Webshag',
|
1123 |
'Webshot',
|
1124 |
-
'Website
|
1125 |
-
'Website\ Quester',
|
1126 |
-
'WebsiteExtractor',
|
1127 |
'websitepulse agent',
|
1128 |
-
'websitepulse[+ ]checker',
|
1129 |
'WebsiteQuester',
|
1130 |
-
'Websnapr
|
|
|
1131 |
'Webster',
|
1132 |
'WebStripper',
|
1133 |
'WebSucker',
|
1134 |
-
'Webthumb\/
|
1135 |
'WebThumbnail',
|
1136 |
'WebWhacker',
|
1137 |
'WebZIP',
|
1138 |
-
'WeCrawlForThePeace',
|
1139 |
'WeLikeLinks',
|
1140 |
'WEPA',
|
1141 |
'WeSEE',
|
@@ -1150,7 +1162,6 @@ class Crawlers extends AbstractProvider
|
|
1150 |
'WhoRunsCoinHive',
|
1151 |
'Whynder Magnet',
|
1152 |
'Windows-RSS-Platform',
|
1153 |
-
'WinHttpRequest',
|
1154 |
'WinPodder',
|
1155 |
'wkhtmlto',
|
1156 |
'wmtips',
|
@@ -1167,6 +1178,7 @@ class Crawlers extends AbstractProvider
|
|
1167 |
'Wtrace',
|
1168 |
'WWW-Collector-E',
|
1169 |
'WWW-Mechanize',
|
|
|
1170 |
'WWW::Mechanize',
|
1171 |
'www\.monitor\.us',
|
1172 |
'WWWOFFLE',
|
@@ -1174,13 +1186,12 @@ class Crawlers extends AbstractProvider
|
|
1174 |
'x22Mozilla',
|
1175 |
'XaxisSemanticsClassifier',
|
1176 |
'Xenu Link Sleuth',
|
1177 |
-
'XING-contenttabreceiver
|
1178 |
-
'XmlSitemapGenerator',
|
1179 |
'xpymep([0-9]?)\.exe',
|
1180 |
'Y!J-(ASR|BSC)',
|
|
|
1181 |
'Yaanb',
|
1182 |
'yacy',
|
1183 |
-
'Yahoo Ad monitoring',
|
1184 |
'Yahoo Link Preview',
|
1185 |
'YahooCacheSystem',
|
1186 |
'YahooYSMcm',
|
@@ -1192,21 +1203,24 @@ class Crawlers extends AbstractProvider
|
|
1192 |
'Yoleo Consumer',
|
1193 |
'yoogliFetchAgent',
|
1194 |
'YottaaMonitor',
|
1195 |
-
'Your-Website-Sucks
|
1196 |
'yourls\.org',
|
|
|
|
|
|
|
1197 |
'Zade',
|
1198 |
'Zao',
|
1199 |
'Zauba',
|
1200 |
'Zemanta Aggregator',
|
1201 |
-
'Zend\\\\Http\\\\Client',
|
1202 |
'Zend_Http_Client',
|
|
|
1203 |
'Zermelo',
|
1204 |
'Zeus',
|
1205 |
'zgrab',
|
1206 |
'ZnajdzFoto',
|
1207 |
'Zombie\.js',
|
|
|
1208 |
'ZyBorg',
|
1209 |
-
'
|
1210 |
-
'[a-z0-9\-_]*(bot|crawler|archiver|transcoder|spider|uptime|validator|fetcher)',
|
1211 |
);
|
1212 |
}
|
21 |
protected $data = array(
|
22 |
'.*Java.*outbrain',
|
23 |
' YLT',
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
'^b0t$',
|
25 |
'^bluefish ',
|
26 |
'^Calypso v\/',
|
47 |
'^WordPress\.com',
|
48 |
'^XRL\/[0-9]',
|
49 |
'^ZmEu',
|
50 |
+
'008\/',
|
51 |
+
'13TABS',
|
52 |
+
'192\.comAgent',
|
53 |
+
'2ip\.ru',
|
54 |
+
'404enemy',
|
55 |
+
'7Siters',
|
56 |
+
'80legs',
|
57 |
+
'a\.pr-cy\.ru',
|
58 |
'a3logics\.in',
|
59 |
'A6-Indexer',
|
|
|
60 |
'Abonti',
|
61 |
'Aboundex',
|
62 |
'aboutthedomain',
|
68 |
'adbeat',
|
69 |
'AddThis',
|
70 |
'ADmantX',
|
71 |
+
'AdminLabs',
|
72 |
'adressendeutschland',
|
73 |
+
'adscanner',
|
|
|
74 |
'agentslug',
|
75 |
'AHC',
|
76 |
'aihit',
|
82 |
'alexa site audit',
|
83 |
'Alibaba\.Security\.Heimdall',
|
84 |
'Alligator',
|
85 |
+
'allloadin',
|
86 |
'AllSubmitter',
|
87 |
'alyze\.info',
|
88 |
'amagit',
|
89 |
'Anarchie',
|
90 |
'AndroidDownloadManager',
|
91 |
'Anemone',
|
92 |
+
'AngleSharp',
|
93 |
'annotate_google',
|
94 |
'Ant\.com',
|
95 |
'Anturis Agent',
|
96 |
'AnyEvent-HTTP\/',
|
97 |
'Apache Droid',
|
98 |
'Apache OpenOffice',
|
99 |
+
'Apache-HttpAsyncClient',
|
100 |
+
'Apache-HttpClient',
|
101 |
+
'ApacheBench',
|
102 |
'Apexoo',
|
103 |
'APIs-Google',
|
104 |
+
'AportWorm\/',
|
105 |
+
'AppBeat\/',
|
106 |
'AppEngine-Google',
|
107 |
'AppStoreScraperZ',
|
108 |
+
'Aprc\/[0-9]',
|
109 |
'Arachmo',
|
110 |
'arachnode',
|
111 |
'Arachnophilia',
|
112 |
'aria2',
|
113 |
'Arukereso',
|
114 |
+
'asafaweb',
|
115 |
'AskQuickly',
|
116 |
+
'Ask Jeeves',
|
117 |
'ASPSeek',
|
118 |
'Asterias',
|
119 |
'Astute',
|
125 |
'B-l-i-t-z-B-O-T',
|
126 |
'Backlink-Ceck',
|
127 |
'backlink-check',
|
128 |
+
'BacklinkHttpStatus',
|
129 |
'BackStreet',
|
130 |
'BackWeb',
|
131 |
'Bad-Neighborhood',
|
132 |
'Badass',
|
133 |
'baidu\.com',
|
134 |
'Bandit',
|
135 |
+
'basicstate',
|
136 |
'BatchFTP',
|
137 |
+
'Battleztar Bazinga',
|
138 |
+
'baypup\/',
|
|
|
139 |
'BazQux',
|
140 |
'BBBike',
|
141 |
'BCKLINKS',
|
142 |
'BDFetch',
|
143 |
+
'BegunAdvertising',
|
144 |
+
'Bidtellect',
|
145 |
'BigBozz',
|
146 |
'Bigfoot',
|
147 |
'biglotron',
|
151 |
'biNu image cacher',
|
152 |
'Bitacle',
|
153 |
'biz_Directory',
|
154 |
+
'Black Hole',
|
155 |
'Blackboard Safeassign',
|
156 |
'BlackWidow',
|
157 |
'BlockNote\.Net',
|
158 |
+
'Bloglines',
|
159 |
'Bloglovin',
|
160 |
'BlogPulseLive',
|
161 |
'BlogSearch',
|
162 |
'Blogtrottr',
|
163 |
'BlowFish',
|
|
|
164 |
'boitho\.com-dc',
|
165 |
'BPImageWalker',
|
166 |
'Braintree-Webhooks',
|
167 |
'Branch Metrics API',
|
168 |
'Branch-Passthrough',
|
169 |
'Brandprotect',
|
170 |
+
'BrandVerity',
|
171 |
'Brandwatch',
|
172 |
'Brodie\/',
|
173 |
'Browsershots',
|
183 |
'CAAM\/[0-9]',
|
184 |
'CakePHP',
|
185 |
'Calculon',
|
186 |
+
'Canary%20Mail',
|
187 |
'CaretNail',
|
188 |
'catexplorador',
|
|
|
189 |
'CC Metadata Scaper',
|
190 |
'Cegbfeieh',
|
191 |
+
'censys',
|
192 |
'Cerberian Drtrs',
|
193 |
'CERT\.at-Statistics-Survey',
|
194 |
'cg-eye',
|
195 |
'changedetection',
|
196 |
+
'ChangesMeter',
|
197 |
'Charlotte',
|
198 |
'CheckHost',
|
199 |
'checkprivacy',
|
200 |
'CherryPicker',
|
201 |
'ChinaClaw',
|
202 |
+
'Chirp\/',
|
203 |
'chkme\.com',
|
204 |
'Chlooe',
|
205 |
+
'Chromaxa',
|
206 |
+
'CirrusExplorer',
|
207 |
'CISPA Vulnerability Notification',
|
208 |
'Citoid',
|
209 |
'CJNetworkQuality',
|
210 |
'Clarsentia',
|
211 |
'clips\.ua\.ac\.be',
|
212 |
+
'Cloud mapping',
|
213 |
'CloudEndure',
|
214 |
'CloudFlare-AlwaysOnline',
|
215 |
+
'Cloudinary',
|
216 |
'cmcm\.com',
|
217 |
'coccoc',
|
218 |
'cognitiveseo',
|
219 |
'colly -',
|
220 |
'CommaFeed',
|
221 |
'Commons-HttpClient',
|
222 |
+
'commonscan',
|
223 |
'contactbigdatafr',
|
224 |
'contentkingapp',
|
225 |
'convera',
|
226 |
+
'CookieReports',
|
227 |
'copyright sheriff',
|
228 |
'CopyRightCheck',
|
229 |
'Copyscape',
|
230 |
'Cosmos4j\.feedback',
|
231 |
'Covario-IDS',
|
|
|
232 |
'Crescent',
|
|
|
233 |
'Crowsnest',
|
234 |
+
'Criteo',
|
235 |
'CSHttp',
|
236 |
'curb',
|
237 |
'Curious George',
|
238 |
'curl',
|
239 |
+
'cuwhois\/',
|
240 |
'cybo\.com',
|
241 |
+
'DAP\/NetHTTP',
|
242 |
'DareBoost',
|
243 |
'DatabaseDriverMysqli',
|
244 |
'DataCha0s',
|
245 |
+
'Datafeedwatch',
|
246 |
'Datanyze',
|
247 |
'DataparkSearch',
|
248 |
'dataprovider',
|
249 |
'DataXu',
|
250 |
'Daum(oa)?[ \/][0-9]',
|
|
|
251 |
'Demon',
|
252 |
'DeuSu',
|
253 |
'developers\.google\.com\/\+\/web\/snippet\/',
|
256 |
'Digincore',
|
257 |
'DigitalPebble',
|
258 |
'Dirbuster',
|
259 |
+
'Disqus\/',
|
260 |
'Dispatch\/',
|
261 |
'DittoSpyder',
|
262 |
'dlvr',
|
263 |
'DMBrowser',
|
|
|
264 |
'DNSPod-reporting',
|
265 |
'docoloc',
|
266 |
+
'Dolphin http client',
|
267 |
'DomainAppender',
|
268 |
'Donuts Content Explorer',
|
269 |
'dotMailer content retrieval',
|
270 |
'dotSemantic',
|
271 |
'downforeveryoneorjustme',
|
272 |
+
'Download Wonder',
|
273 |
+
'downnotifier',
|
274 |
'DowntimeDetector',
|
|
|
275 |
'Drip',
|
276 |
'drupact',
|
277 |
'Drupal \(\+http:\/\/drupal\.org\/\)',
|
278 |
+
'DTS Agent',
|
279 |
'dubaiindex',
|
280 |
'EARTHCOM',
|
281 |
'Easy-Thumb',
|
285 |
'eCairn-Grabber',
|
286 |
'eCatch',
|
287 |
'ECCP',
|
|
|
288 |
'eContext\/',
|
289 |
'Ecxi',
|
290 |
'EirGrabber',
|
291 |
'ElectricMonk',
|
292 |
'elefent',
|
293 |
'EMail Exractor',
|
294 |
+
'EMail Wolf',
|
|
|
295 |
'EmailWolf',
|
296 |
+
'Embarcadero',
|
297 |
'Embed PHP Library',
|
298 |
'Embedly',
|
299 |
'endo\/',
|
306 |
'ExactSearch',
|
307 |
'ExaleadCloudview',
|
308 |
'Excel\/',
|
309 |
+
'exif',
|
|
|
310 |
'Exploratodo',
|
311 |
'Express WebPictures',
|
312 |
+
'Extreme Picture Finder',
|
|
|
313 |
'EyeNetIE',
|
314 |
'ezooms',
|
315 |
'facebookexternalhit',
|
319 |
'fasthttp',
|
320 |
'Faveeo',
|
321 |
'Favicon downloader',
|
322 |
+
'faviconkit',
|
323 |
'FavOrg',
|
324 |
'Feed Wrangler',
|
325 |
'Feedable\/',
|
326 |
'Feedbin',
|
327 |
'FeedBooster',
|
328 |
'FeedBucket',
|
329 |
+
'FeedBunch\/',
|
330 |
'FeedBurner',
|
331 |
+
'feeder',
|
332 |
'Feedly',
|
|
|
333 |
'FeedshowOnline',
|
334 |
'Feedspot',
|
335 |
+
'Feedwind\/',
|
336 |
'FeedZcollector',
|
337 |
'feeltiptop',
|
338 |
'Fetch API',
|
351 |
'Flunky',
|
352 |
'flynxapp',
|
353 |
'forensiq',
|
354 |
+
'FoundSeoTool',
|
355 |
+
'http:\/\/www.neomo.de\/', //'Francis [Bot]'
|
356 |
'free thumbnails',
|
357 |
'Freeuploader',
|
|
|
358 |
'Funnelback',
|
359 |
'G-i-g-a-b-o-t',
|
360 |
'g00g1e\.net',
|
361 |
+
'ganarvisitas',
|
|
|
362 |
'geek-tools',
|
|
|
363 |
'Genieo',
|
364 |
'GentleSource',
|
365 |
+
'GetCode',
|
366 |
'Getintent',
|
367 |
'GetLinkInfo',
|
368 |
+
'getprismatic',
|
369 |
'GetRight',
|
370 |
+
'getroot',
|
371 |
+
'GetURLInfo\/',
|
372 |
'GetWeb',
|
373 |
'Ghost Inspector',
|
374 |
'GigablastOpenSource',
|
375 |
'GIS-LABS',
|
376 |
'github-camo',
|
377 |
+
'github\.com',
|
378 |
'Go [\d\.]* package http',
|
379 |
'Go http package',
|
|
|
380 |
'Go-Ahead-Got-It',
|
381 |
'Go-http-client',
|
382 |
+
'Go!Zilla',
|
383 |
'gobyus',
|
384 |
'gofetch',
|
385 |
'GomezAgent',
|
386 |
'gooblog',
|
387 |
+
'Goodzer\/',
|
388 |
+
'Google AppsViewer',
|
389 |
+
'Google Desktop',
|
390 |
'Google favicon',
|
391 |
'Google Keyword Suggestion',
|
392 |
'Google Keyword Tool',
|
404 |
'Google-Site-Verification',
|
405 |
'Google-Structured-Data-Testing-Tool',
|
406 |
'Google-Youtube-Links',
|
407 |
+
'google-xrawler',
|
408 |
'GoogleDocs',
|
409 |
'GoogleHC\/',
|
410 |
'GoogleProducer',
|
411 |
+
'GoogleSites',
|
412 |
+
'Google-Transparency-Report',
|
413 |
'Gookey',
|
414 |
'GoScraper',
|
415 |
'GoSpotCheck',
|
|
|
416 |
'gosquared-thumbnailer',
|
417 |
'Gotit',
|
418 |
'GoZilla',
|
421 |
'Grafula',
|
422 |
'Grammarly',
|
423 |
'GrapeFX',
|
424 |
+
'Gregarius',
|
425 |
+
'GRequests',
|
426 |
'grokkit',
|
427 |
'grouphigh',
|
428 |
'grub-client',
|
434 |
'HAA(A)?RTLAND http client',
|
435 |
'Haansoft',
|
436 |
'hackney\/',
|
437 |
+
'Hadi Agent',
|
438 |
+
'HappyApps-WebCheck',
|
439 |
'Hatena',
|
440 |
'Havij',
|
441 |
+
'HeadlessChrome',
|
442 |
'HEADMasterSEO',
|
443 |
'HeartRails_Capture',
|
444 |
'help@dataminr\.com',
|
445 |
'heritrix',
|
446 |
+
'historious',
|
447 |
+
'hkedcity',
|
448 |
+
'hledejLevne\.cz',
|
449 |
'Hloader',
|
450 |
'HMView',
|
451 |
'Holmes',
|
452 |
+
'HonesoSearchEngine',
|
453 |
'HootSuite Image proxy',
|
454 |
+
'Hootsuite-WebFeed',
|
455 |
'hosterstats',
|
456 |
'HostTracker',
|
457 |
'ht:\/\/check',
|
458 |
'htdig',
|
459 |
'HTMLparser',
|
460 |
+
'htmlyse',
|
461 |
+
'HTTP Banner Detection',
|
462 |
+
'HTTP_Compression_Test',
|
463 |
+
'http_request2',
|
464 |
+
'http_requester',
|
465 |
'http-get',
|
466 |
'HTTP-Header-Abfrage',
|
467 |
'http-kit',
|
469 |
'HTTP-Tiny',
|
470 |
'HTTP::Lite',
|
471 |
'http\.rb\/',
|
472 |
+
'http_get',
|
|
|
|
|
473 |
'HttpComponents',
|
474 |
'httphr',
|
475 |
'HTTPMon',
|
476 |
+
'httpRequest',
|
477 |
'httpscheck',
|
478 |
'httpssites_power',
|
479 |
'httpunit',
|
480 |
'HttpUrlConnection',
|
481 |
'httrack',
|
482 |
'huaweisymantec',
|
|
|
483 |
'HubSpot ',
|
484 |
'Humanlinks',
|
|
|
485 |
'i2kconnect\/',
|
486 |
'Iblog',
|
487 |
'ichiro',
|
488 |
'Id-search',
|
489 |
'IdeelaborPlagiaat',
|
490 |
'IDG Twitter Links Resolver',
|
491 |
+
'IDwhois\/',
|
492 |
'Iframely',
|
493 |
'igdeSpyder',
|
494 |
'IlTrovatore',
|
495 |
+
'Image Fetch',
|
496 |
+
'Image Sucker',
|
|
|
497 |
'ImageEngine\/',
|
498 |
+
'ImageVisu\/',
|
499 |
'Imagga',
|
500 |
+
'imagineeasy',
|
501 |
'imgsizer',
|
502 |
'InAGist',
|
503 |
'inbound\.li parser',
|
504 |
'InDesign%20CC',
|
505 |
+
'Indy Library',
|
506 |
'InetURL',
|
507 |
'infegy',
|
508 |
'infohelfer',
|
509 |
'InfoTekies',
|
510 |
+
'InfoWizards Reciprocal Link',
|
511 |
'inpwrd\.com',
|
512 |
'instabid',
|
513 |
'Instapaper',
|
515 |
'integromedb',
|
516 |
'Intelliseek',
|
517 |
'InterGET',
|
|
|
518 |
'internet_archive',
|
519 |
+
'Internet Ninja',
|
520 |
'InternetSeer',
|
521 |
'internetVista monitor',
|
522 |
'intraVnews',
|
531 |
'Irokez',
|
532 |
'isitup\.org',
|
533 |
'iskanie',
|
534 |
+
'isUp\.li',
|
535 |
+
'iThemes Sync\/',
|
536 |
'iZSearch',
|
537 |
+
'JAHHO',
|
538 |
'janforman',
|
539 |
'Jaunt\/',
|
540 |
'Jbrofuzz',
|
554 |
'JS-Kit',
|
555 |
'JustView',
|
556 |
'Kaspersky Lab CFR link resolver',
|
|
|
557 |
'Kelny\/',
|
558 |
'Kerrigan\/',
|
559 |
'KeyCDN',
|
560 |
+
'Keyword Density',
|
|
|
561 |
'Keywords Research',
|
562 |
'KickFire',
|
563 |
'KimonoLabs\/',
|
571 |
'L\.webis',
|
572 |
'Larbin',
|
573 |
'Lavf\/',
|
|
|
574 |
'LeechFTP',
|
575 |
'LeechGet',
|
576 |
'letsencrypt',
|
579 |
'LibWeb',
|
580 |
'Libwhisker',
|
581 |
'libwww',
|
582 |
+
'Licorne',
|
583 |
'Liferea\/',
|
584 |
'Lightspeedsystems',
|
585 |
'Likse',
|
|
|
586 |
'Link Valet',
|
587 |
'link_thumbnailer',
|
588 |
'LinkAlarm\/',
|
613 |
'mabontland',
|
614 |
'Mag-Net',
|
615 |
'MagpieRSS',
|
616 |
+
'Mail\.Ru',
|
617 |
'MailChimp',
|
618 |
'Majestic12',
|
619 |
'makecontact\/',
|
622 |
'marketinggrader',
|
623 |
'MarkMonitor',
|
624 |
'MarkWatch',
|
625 |
+
'Mass Downloader',
|
626 |
+
'masscan\/',
|
627 |
+
'Mata Hari',
|
628 |
'Mediapartners-Google',
|
629 |
'mediawords',
|
630 |
'MegaIndex\.ru',
|
631 |
+
'MeltwaterNews',
|
632 |
+
'Melvil Rawi',
|
633 |
'Metaspinner',
|
634 |
'MetaURI',
|
635 |
'MFC_Tear_Sample',
|
638 |
'Microsoft Outlook',
|
639 |
'Microsoft Windows Network Diagnostics',
|
640 |
'Microsoft-WebDAV-MiniRedir',
|
641 |
+
'Microsoft Data Access',
|
642 |
+
'MIDown tool',
|
643 |
'MIIxpc',
|
644 |
'Mindjet',
|
645 |
+
'Miniature\.io',
|
646 |
'Miniflux',
|
647 |
+
'Mister PiX',
|
648 |
'mixdata dot com',
|
649 |
'mixed-content-scan',
|
650 |
'Mixmax-LinkPreview',
|
653 |
'mogimogi',
|
654 |
'Mojeek',
|
655 |
'Mojolicious \(Perl\)',
|
|
|
656 |
'Monit\/',
|
657 |
+
'monitis',
|
658 |
+
'Monitority\/',
|
659 |
'montastic',
|
660 |
'MonTools',
|
661 |
'Moreover',
|
662 |
+
'Morfeus Fucking Scanner',
|
663 |
'Morning Paper',
|
664 |
'MovableType',
|
665 |
'mowser',
|
666 |
'Mrcgiguy',
|
667 |
+
'MS Web Services Client Protocol',
|
668 |
'MSFrontPage',
|
669 |
'mShots',
|
670 |
'MuckRack\/',
|
672 |
'MVAClient',
|
673 |
'MxToolbox\/',
|
674 |
'nagios',
|
675 |
+
'Najdi\.si',
|
676 |
+
'Name Intelligence',
|
677 |
'Nameprotect',
|
678 |
'Navroad',
|
679 |
'NearSite',
|
680 |
'Needle',
|
681 |
'Nessus',
|
682 |
+
'Net Vampire',
|
683 |
'NetAnts',
|
684 |
'NETCRAFT',
|
685 |
'NetLyzer',
|
704 |
'Nibbler',
|
705 |
'NICErsPRO',
|
706 |
'Nikto',
|
707 |
+
'nineconnections',
|
708 |
'NLNZ_IAHarvester',
|
709 |
'Nmap Scripting Engine',
|
710 |
'node-superagent',
|
711 |
+
'node-urllib',
|
712 |
'node\.io',
|
713 |
+
'Nodemeter',
|
714 |
+
'NodePing',
|
715 |
'nominet\.org\.uk',
|
716 |
'Norton-Safeweb',
|
717 |
'Notifixious',
|
720 |
'nutch',
|
721 |
'Nuzzel',
|
722 |
'nWormFeedFinder',
|
723 |
+
'nyawc\/',
|
724 |
'Nymesis',
|
725 |
'NYU',
|
726 |
+
'Ocelli\/',
|
727 |
'Octopus',
|
728 |
'oegp',
|
|
|
729 |
'Offline Explorer',
|
730 |
+
'Offline Navigator',
|
731 |
+
'og-scraper',
|
732 |
'okhttp',
|
|
|
733 |
'omgili',
|
734 |
'OMSC',
|
735 |
'Online Domain Tools',
|
740 |
'OpenVAS',
|
741 |
'Optimizer',
|
742 |
'Orbiter',
|
743 |
+
'OrgProbe\/',
|
744 |
'orion-semantics',
|
745 |
'Outlook-Express',
|
746 |
+
'Outlook-iOS',
|
747 |
'ow\.ly',
|
748 |
'Owler',
|
749 |
'ownCloud News',
|
750 |
+
'OxfordCloudService',
|
|
|
751 |
'Page Valet',
|
|
|
|
|
752 |
'page_verifier',
|
753 |
+
'page scorer',
|
754 |
+
'page2rss',
|
755 |
'PageGrabber',
|
756 |
'PagePeeker',
|
757 |
'PageScorer',
|
758 |
+
'Pagespeed\/',
|
759 |
'Panopta',
|
760 |
'panscient',
|
761 |
+
'Papa Foto',
|
762 |
'parsijoo',
|
763 |
'Pavuk',
|
764 |
'PayPal IPN',
|
765 |
'pcBrowser',
|
766 |
'Pcore-HTTP',
|
|
|
767 |
'Pearltrees',
|
768 |
'PECL::HTTP',
|
769 |
'peerindex',
|
773 |
'PhantomJS Screenshoter',
|
774 |
'PhantomJS\/',
|
775 |
'Photon\/',
|
|
|
776 |
'phpservermon',
|
777 |
'Pi-Monster',
|
778 |
'Picscout',
|
779 |
'Picsearch',
|
780 |
'PictureFinder',
|
781 |
'Pimonster',
|
782 |
+
'ping\.blo\.gs',
|
783 |
'Pingability',
|
784 |
'PingAdmin\.Ru',
|
785 |
'Pingdom',
|
789 |
'Pixray',
|
790 |
'Pizilla',
|
791 |
'Plagger\/',
|
|
|
792 |
'Ploetz \+ Zeller',
|
793 |
'Plukkie',
|
794 |
'plumanalytics',
|
795 |
+
'PocketImageCache',
|
796 |
'PocketParser',
|
797 |
'Pockey',
|
798 |
'POE-Component-Client-HTTP',
|
799 |
+
'Polymail\/',
|
800 |
'Pompos',
|
801 |
'Porkbun',
|
802 |
'Port Monitor',
|
803 |
'postano',
|
804 |
+
'PostmanRuntime',
|
805 |
'PostPost',
|
806 |
'postrank',
|
807 |
'PowerPoint\/',
|
808 |
'Priceonomics Analysis Engine',
|
809 |
+
'PrintFriendly',
|
810 |
+
'PritTorrent',
|
811 |
'Prlog',
|
812 |
'probethenet',
|
813 |
'Project 25499',
|
|
|
814 |
'prospectb2b',
|
815 |
'Protopage',
|
816 |
'ProWebWalker',
|
828 |
'QQDownload',
|
829 |
'QrafterPro',
|
830 |
'Qseero',
|
831 |
+
'Qualidator',
|
832 |
+
'QueryN Metasearch',
|
833 |
+
'queuedriver',
|
834 |
'Quora Link Preview',
|
835 |
'Qwantify',
|
836 |
'Radian6',
|
837 |
'RankActive',
|
838 |
'RankFlex',
|
839 |
'RankSonicSiteAuditor',
|
840 |
+
'Re-re Studio',
|
841 |
'Readability',
|
842 |
'RealDownload',
|
843 |
'RealPlayer%20Downloader',
|
845 |
'Recorder',
|
846 |
'RecurPost\/',
|
847 |
'redback\/',
|
|
|
848 |
'ReederForMac',
|
849 |
'ReGet',
|
850 |
'RepoMonkey',
|
851 |
'request\.js',
|
852 |
+
'ResponseCodeTest',
|
853 |
'RestSharp',
|
854 |
'Riddler',
|
855 |
'Rival IQ',
|
856 |
'Robosourcer',
|
857 |
+
'Robozilla',
|
858 |
'ROI Hunter',
|
859 |
'RPT-HTTPClient',
|
860 |
'RSSOwl',
|
|
|
861 |
'safe-agent-scanner',
|
862 |
'SalesIntelligent',
|
863 |
'Saleslift',
|
864 |
+
'Sendsay\.Ru',
|
865 |
'SauceNAO',
|
866 |
'SBIder',
|
867 |
'scalaj-http',
|
868 |
'scan\.lol',
|
869 |
'ScanAlert',
|
|
|
870 |
'Scoop',
|
871 |
'scooter',
|
872 |
'ScoutJet',
|
873 |
'ScoutURLMonitor',
|
874 |
+
'ScrapeBox Page Scanner',
|
875 |
+
'SimpleScraper',
|
876 |
'Scrapy',
|
877 |
'Screaming',
|
878 |
+
'ScreenShotService',
|
879 |
'Scrubby',
|
880 |
'Scrutiny\/',
|
|
|
881 |
'search\.thunderstone',
|
882 |
+
'Search37',
|
883 |
+
'searchenginepromotionhelp',
|
884 |
'Searchestate',
|
885 |
'SearchExpress',
|
886 |
'SearchSight',
|
892 |
'sentry\/',
|
893 |
'SEO Browser',
|
894 |
'Seo Servis',
|
895 |
+
'seo-nastroj\.cz',
|
896 |
+
'seo4ajax',
|
897 |
'Seobility',
|
898 |
'SEOCentro',
|
899 |
'SeoCheck',
|
900 |
'SEOkicks',
|
901 |
'Seomoz',
|
902 |
'SEOprofiler',
|
903 |
+
'SEOsearch',
|
904 |
'seoscanners',
|
905 |
+
'seositecheckup',
|
906 |
'SEOstats',
|
907 |
+
'servernfo',
|
|
|
|
|
908 |
'sexsearcher',
|
909 |
'Seznam',
|
910 |
'Shelob',
|
911 |
'Shodan',
|
912 |
+
'Shoppimon',
|
|
|
913 |
'ShopWiki',
|
914 |
'ShortLinkTranslate',
|
915 |
'shrinktheweb',
|
916 |
'Sideqik',
|
|
|
917 |
'SimplePie',
|
918 |
'SimplyFast',
|
919 |
'Siphon',
|
920 |
'SISTRIX',
|
921 |
'Site-Shot\/',
|
922 |
+
'Site Sucker',
|
923 |
'Site24x7',
|
|
|
924 |
'SiteBar',
|
925 |
'Sitebeam',
|
926 |
'Sitebulb\/',
|
930 |
'Siteimprove',
|
931 |
'SiteIndexed',
|
932 |
'Sitemap(s)? Generator',
|
933 |
+
'SitemapGenerator',
|
934 |
'SiteMonitor',
|
935 |
'Siteshooter B0t',
|
936 |
'SiteSnagger',
|
946 |
'SmartDownload',
|
947 |
'SMRF URL Expander',
|
948 |
'SMUrlExpander',
|
|
|
949 |
'Snake',
|
950 |
'Snappy',
|
951 |
+
'SnapSearch',
|
952 |
+
'Snarfer\/',
|
953 |
'SniffRSS',
|
954 |
'sniptracker',
|
955 |
'Snoopy',
|
959 |
'Sottopop',
|
960 |
'sovereign\.ai',
|
961 |
'SpaceBison',
|
962 |
+
'SpamExperts',
|
963 |
'Spammen',
|
964 |
'Spanner',
|
965 |
'spaziodati',
|
981 |
'StatusCake',
|
982 |
'Steeler',
|
983 |
'Stratagems Kumo',
|
984 |
+
'Stroke\.cz',
|
985 |
'StudioFACA',
|
986 |
+
'StumbleUpon',
|
987 |
'suchen',
|
988 |
'Sucuri',
|
989 |
'summify',
|
|
|
990 |
'SuperHTTP',
|
991 |
'Surphace Scout',
|
992 |
'Suzuran',
|
1001 |
'tAkeOut',
|
1002 |
'Tarantula\/',
|
1003 |
'Taringa UGC',
|
1004 |
+
'TarmotGezgin',
|
1005 |
'Teleport',
|
1006 |
'Telesoft',
|
1007 |
'Telesphoreo',
|
1008 |
'Telesphorep',
|
1009 |
'Tenon\.io',
|
1010 |
'teoma',
|
1011 |
+
'terrainformatica',
|
1012 |
'Test Certificate Info',
|
1013 |
+
'testuri',
|
1014 |
+
'Tetrahedron',
|
1015 |
'The Drop Reaper',
|
1016 |
'The Expert HTML Source Viewer',
|
1017 |
'The Knowledge AI',
|
1018 |
+
'The Intraformant',
|
1019 |
'theinternetrules',
|
1020 |
'TheNomad',
|
|
|
1021 |
'Thinklab',
|
1022 |
'Thumbshots',
|
1023 |
'ThumbSniper',
|
1024 |
+
'timewe\.net',
|
1025 |
'TinEye',
|
1026 |
'Tiny Tiny RSS',
|
1027 |
'TLSProbe\/',
|
1028 |
'Toata',
|
1029 |
'topster',
|
1030 |
+
'touche\.com',
|
1031 |
+
'Traackr\.com',
|
1032 |
+
'tracemyfile',
|
1033 |
'TrapitAgent',
|
1034 |
'Trendiction',
|
1035 |
+
'Trendsmap',
|
1036 |
+
'trendspottr',
|
1037 |
'truwoGPS',
|
1038 |
+
'TryJsoup',
|
1039 |
'TulipChain',
|
1040 |
'Turingos',
|
1041 |
'Turnitin',
|
1042 |
+
'tweetedtimes',
|
1043 |
'Tweetminster',
|
1044 |
'Tweezler\/',
|
1045 |
'twibble',
|
1050 |
'Typhoeus',
|
1051 |
'ubermetrics-technologies',
|
1052 |
'uclassify',
|
|
|
1053 |
'UdmSearch',
|
1054 |
'unirest-java',
|
1055 |
'UniversalFeedParser',
|
1061 |
'Upflow',
|
1062 |
'Uptimia',
|
1063 |
'URL Verifier',
|
1064 |
+
'URLitor',
|
|
|
1065 |
'urlresolver',
|
1066 |
'Urlstat',
|
1067 |
'UrlTrends Ranking Updater',
|
1068 |
+
'URLy Warning',
|
1069 |
'URLy\.Warning',
|
1070 |
'Vacuum',
|
1071 |
'Vagabondo',
|
1072 |
+
'VB Project',
|
1073 |
'vBSEO',
|
1074 |
'VCI',
|
1075 |
'via ggpht\.com GoogleImageProxy',
|
1081 |
'Voil',
|
1082 |
'voltron',
|
1083 |
'voyager\/',
|
1084 |
+
'VSAgent\/',
|
1085 |
+
'VSB-TUO\/',
|
1086 |
'Vulnbusters Meter',
|
1087 |
'VYU2',
|
1088 |
'w3af\.org',
|
1089 |
+
'W3C_Unicorn',
|
1090 |
'W3C-checklink',
|
1091 |
'W3C-mobileOK',
|
1092 |
+
'WAC-OFU',
|
|
|
1093 |
'Wallpapers\/[0-9]+',
|
1094 |
'WallpapersHD',
|
1095 |
'wangling',
|
1096 |
'Wappalyzer',
|
1097 |
'WatchMouse',
|
1098 |
'WbSrch\/',
|
1099 |
+
'WDT\.io',
|
1100 |
'web-capture\.net',
|
|
|
1101 |
'Web-sniffer',
|
1102 |
+
'Web Auto',
|
1103 |
+
'Web Collage',
|
1104 |
+
'Web Enhancer',
|
1105 |
+
'Web Fetch',
|
1106 |
+
'Web Fuck',
|
1107 |
+
'Web Pix',
|
1108 |
+
'Web Sauger',
|
1109 |
+
'Web Sucker',
|
1110 |
'Webalta',
|
1111 |
'Webauskunft',
|
1112 |
'WebAuto',
|
1116 |
'WebCookies',
|
1117 |
'WebCopier',
|
1118 |
'WebCorp',
|
1119 |
+
'WebDataStats',
|
1120 |
'WebDoc',
|
1121 |
'WebEnhancer',
|
1122 |
'WebFetch',
|
1123 |
'WebFuck',
|
1124 |
+
'WebGazer',
|
1125 |
+
'WebGo IS',
|
1126 |
'WebImageCollector',
|
1127 |
'WebImages',
|
1128 |
'WebIndex',
|
1136 |
'webscreenie',
|
1137 |
'Webshag',
|
1138 |
'Webshot',
|
1139 |
+
'Website Quester',
|
|
|
|
|
1140 |
'websitepulse agent',
|
|
|
1141 |
'WebsiteQuester',
|
1142 |
+
'Websnapr',
|
1143 |
+
'WebSniffer',
|
1144 |
'Webster',
|
1145 |
'WebStripper',
|
1146 |
'WebSucker',
|
1147 |
+
'Webthumb\/',
|
1148 |
'WebThumbnail',
|
1149 |
'WebWhacker',
|
1150 |
'WebZIP',
|
|
|
1151 |
'WeLikeLinks',
|
1152 |
'WEPA',
|
1153 |
'WeSEE',
|
1162 |
'WhoRunsCoinHive',
|
1163 |
'Whynder Magnet',
|
1164 |
'Windows-RSS-Platform',
|
|
|
1165 |
'WinPodder',
|
1166 |
'wkhtmlto',
|
1167 |
'wmtips',
|
1178 |
'Wtrace',
|
1179 |
'WWW-Collector-E',
|
1180 |
'WWW-Mechanize',
|
1181 |
+
'WWW::Document',
|
1182 |
'WWW::Mechanize',
|
1183 |
'www\.monitor\.us',
|
1184 |
'WWWOFFLE',
|
1186 |
'x22Mozilla',
|
1187 |
'XaxisSemanticsClassifier',
|
1188 |
'Xenu Link Sleuth',
|
1189 |
+
'XING-contenttabreceiver',
|
|
|
1190 |
'xpymep([0-9]?)\.exe',
|
1191 |
'Y!J-(ASR|BSC)',
|
1192 |
+
'Y\!J-BRW',
|
1193 |
'Yaanb',
|
1194 |
'yacy',
|
|
|
1195 |
'Yahoo Link Preview',
|
1196 |
'YahooCacheSystem',
|
1197 |
'YahooYSMcm',
|
1203 |
'Yoleo Consumer',
|
1204 |
'yoogliFetchAgent',
|
1205 |
'YottaaMonitor',
|
1206 |
+
'Your-Website-Sucks',
|
1207 |
'yourls\.org',
|
1208 |
+
'YoYs\.net',
|
1209 |
+
'YP\.PL',
|
1210 |
+
'Zabbix',
|
1211 |
'Zade',
|
1212 |
'Zao',
|
1213 |
'Zauba',
|
1214 |
'Zemanta Aggregator',
|
|
|
1215 |
'Zend_Http_Client',
|
1216 |
+
'Zend\\\\Http\\\\Client',
|
1217 |
'Zermelo',
|
1218 |
'Zeus',
|
1219 |
'zgrab',
|
1220 |
'ZnajdzFoto',
|
1221 |
'Zombie\.js',
|
1222 |
+
'Zoom\.Mac',
|
1223 |
'ZyBorg',
|
1224 |
+
'[a-z0-9\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer)',
|
|
|
1225 |
);
|
1226 |
}
|
includes/vendor/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php
CHANGED
@@ -22,7 +22,7 @@ class Exclusions extends AbstractProvider
|
|
22 |
protected $data = array(
|
23 |
'Safari.[\d\.]*',
|
24 |
'Firefox.[\d\.]*',
|
25 |
-
'Chrome.[\d\.]*',
|
26 |
'Chromium.[\d\.]*',
|
27 |
'MSIE.[\d\.]',
|
28 |
'Opera\/[\d\.]*',
|
22 |
protected $data = array(
|
23 |
'Safari.[\d\.]*',
|
24 |
'Firefox.[\d\.]*',
|
25 |
+
' Chrome.[\d\.]*',
|
26 |
'Chromium.[\d\.]*',
|
27 |
'MSIE.[\d\.]',
|
28 |
'Opera\/[\d\.]*',
|
includes/vendor/maxmind-db/reader/CHANGELOG.md
CHANGED
@@ -1,6 +1,34 @@
|
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
1.3.0 (2018-02-21)
|
5 |
------------------
|
6 |
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
4 |
+
1.4.1 (2019-01-04)
|
5 |
+
------------------
|
6 |
+
|
7 |
+
* The `maxminddb` extension now returns a string when a `uint32`
|
8 |
+
value is greater than `LONG_MAX`. Previously, the value would
|
9 |
+
overflow. This generally only affects 32-bit machines. Reported
|
10 |
+
by Remi Collet. GitHub #79.
|
11 |
+
* For `uint64` values, the `maxminddb` extension now returns an
|
12 |
+
integer rather than a string when the value is less than or equal
|
13 |
+
to `LONG_MAX`. This more closely matches the behavior of the pure
|
14 |
+
PHP reader.
|
15 |
+
|
16 |
+
1.4.0 (2018-11-20)
|
17 |
+
------------------
|
18 |
+
|
19 |
+
* The `maxminddb` extension now has the arginfo when using reflection.
|
20 |
+
PR by Remi Collet. GitHub #75.
|
21 |
+
* The `maxminddb` extension now provides `MINFO()` function that
|
22 |
+
displays the extension version and the libmaxminddb version. PR by
|
23 |
+
Remi Collet. GitHub #74.
|
24 |
+
* The `maxminddb` `configure` script now uses `pkg-config` when
|
25 |
+
available to get libmaxmindb build info. PR by Remi Collet.
|
26 |
+
GitHub #73.
|
27 |
+
* The pure PHP reader now correctly decodes integers on 32-bit platforms.
|
28 |
+
Previously, large integers would overflow. Reported by Remi Collet.
|
29 |
+
GitHub #77.
|
30 |
+
* There are small performance improvements for the pure PHP reader.
|
31 |
+
|
32 |
1.3.0 (2018-02-21)
|
33 |
------------------
|
34 |
|
includes/vendor/maxmind-db/reader/README.md
CHANGED
@@ -134,8 +134,8 @@ client API, please see [our support page](http://www.maxmind.com/en/support).
|
|
134 |
|
135 |
## Requirements ##
|
136 |
|
137 |
-
This library requires PHP 5.4 or greater. The pure PHP reader included
|
138 |
-
|
139 |
|
140 |
The GMP or BCMath extension may be required to read some databases
|
141 |
using the pure PHP API.
|
@@ -151,6 +151,6 @@ The MaxMind DB Reader PHP API uses [Semantic Versioning](http://semver.org/).
|
|
151 |
|
152 |
## Copyright and License ##
|
153 |
|
154 |
-
This software is Copyright (c) 2014-
|
155 |
|
156 |
This is free software, licensed under the Apache License, Version 2.0.
|
134 |
|
135 |
## Requirements ##
|
136 |
|
137 |
+
This library requires PHP 5.4 or greater. The pure PHP reader included is
|
138 |
+
compatible with HHVM.
|
139 |
|
140 |
The GMP or BCMath extension may be required to read some databases
|
141 |
using the pure PHP API.
|
151 |
|
152 |
## Copyright and License ##
|
153 |
|
154 |
+
This software is Copyright (c) 2014-2018 by MaxMind, Inc.
|
155 |
|
156 |
This is free software, licensed under the Apache License, Version 2.0.
|
includes/vendor/maxmind-db/reader/autoload.php
CHANGED
@@ -4,15 +4,15 @@
|
|
4 |
* PSR-4 autoloader implementation for the MaxMind\DB namespace.
|
5 |
* First we define the 'mmdb_autoload' function, and then we register
|
6 |
* it with 'spl_autoload_register' so that PHP knows to use it.
|
|
|
|
|
7 |
*/
|
8 |
|
9 |
/**
|
10 |
* Automatically include the file that defines <code>class</code>.
|
11 |
*
|
12 |
* @param string $class
|
13 |
-
*
|
14 |
-
*
|
15 |
-
* @return void
|
16 |
*/
|
17 |
function mmdb_autoload($class)
|
18 |
{
|
@@ -23,10 +23,9 @@ function mmdb_autoload($class)
|
|
23 |
* to extend in the future if (for example) the test classes
|
24 |
* begin to use one another.
|
25 |
*/
|
26 |
-
$namespace_map =
|
27 |
|
28 |
-
foreach ($namespace_map as $prefix => $dir)
|
29 |
-
{
|
30 |
/* First swap out the namespace prefix with a directory... */
|
31 |
$path = str_replace($prefix, $dir, $class);
|
32 |
|
@@ -37,7 +36,9 @@ function mmdb_autoload($class)
|
|
37 |
$path = $path . '.php';
|
38 |
|
39 |
/* $path should now contain the path to a PHP file defining $class */
|
40 |
-
|
|
|
|
|
41 |
}
|
42 |
}
|
43 |
|
4 |
* PSR-4 autoloader implementation for the MaxMind\DB namespace.
|
5 |
* First we define the 'mmdb_autoload' function, and then we register
|
6 |
* it with 'spl_autoload_register' so that PHP knows to use it.
|
7 |
+
*
|
8 |
+
* @param mixed $class
|
9 |
*/
|
10 |
|
11 |
/**
|
12 |
* Automatically include the file that defines <code>class</code>.
|
13 |
*
|
14 |
* @param string $class
|
15 |
+
* the name of the class to load
|
|
|
|
|
16 |
*/
|
17 |
function mmdb_autoload($class)
|
18 |
{
|
23 |
* to extend in the future if (for example) the test classes
|
24 |
* begin to use one another.
|
25 |
*/
|
26 |
+
$namespace_map = ['MaxMind\\Db\\' => __DIR__ . '/src/MaxMind/Db/'];
|
27 |
|
28 |
+
foreach ($namespace_map as $prefix => $dir) {
|
|
|
29 |
/* First swap out the namespace prefix with a directory... */
|
30 |
$path = str_replace($prefix, $dir, $class);
|
31 |
|
36 |
$path = $path . '.php';
|
37 |
|
38 |
/* $path should now contain the path to a PHP file defining $class */
|
39 |
+
if (file_exists($path)) {
|
40 |
+
include $path;
|
41 |
+
}
|
42 |
}
|
43 |
}
|
44 |
|
includes/vendor/maxmind-db/reader/ext/config.m4
CHANGED
@@ -6,13 +6,34 @@ PHP_ARG_ENABLE(maxminddb-debug, for MaxMind DB debug support,
|
|
6 |
[ --enable-maxminddb-debug Enable enable MaxMind DB deubg support], no, no)
|
7 |
|
8 |
if test $PHP_MAXMINDDB != "no"; then
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
if test $PHP_MAXMINDDB_DEBUG != "no"; then
|
12 |
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror"
|
13 |
fi
|
14 |
|
15 |
-
PHP_ADD_LIBRARY(maxminddb, 1, MAXMINDDB_SHARED_LIBADD)
|
16 |
PHP_SUBST(MAXMINDDB_SHARED_LIBADD)
|
17 |
|
18 |
PHP_NEW_EXTENSION(maxminddb, maxminddb.c, $ext_shared)
|
6 |
[ --enable-maxminddb-debug Enable enable MaxMind DB deubg support], no, no)
|
7 |
|
8 |
if test $PHP_MAXMINDDB != "no"; then
|
9 |
+
|
10 |
+
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
11 |
+
|
12 |
+
AC_MSG_CHECKING(for libmaxminddb)
|
13 |
+
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmaxminddb; then
|
14 |
+
dnl retrieve build options from pkg-config
|
15 |
+
if $PKG_CONFIG libmaxminddb --atleast-version 1.0.0; then
|
16 |
+
LIBMAXMINDDB_INC=`$PKG_CONFIG libmaxminddb --cflags`
|
17 |
+
LIBMAXMINDDB_LIB=`$PKG_CONFIG libmaxminddb --libs`
|
18 |
+
LIBMAXMINDDB_VER=`$PKG_CONFIG libmaxminddb --modversion`
|
19 |
+
AC_MSG_RESULT(found version $LIBMAXMINDDB_VER)
|
20 |
+
else
|
21 |
+
AC_MSG_ERROR(system libmaxminddb must be upgraded to version >= 1.0.0)
|
22 |
+
fi
|
23 |
+
PHP_EVAL_LIBLINE($LIBMAXMINDDB_LIB, MAXMINDDB_SHARED_LIBADD)
|
24 |
+
PHP_EVAL_INCLINE($LIBMAXMINDDB_INC)
|
25 |
+
else
|
26 |
+
AC_MSG_RESULT(pkg-config information missing)
|
27 |
+
AC_MSG_WARN(will use libmaxmxinddb from compiler default path)
|
28 |
+
|
29 |
+
PHP_CHECK_LIBRARY(maxminddb, MMDB_open)
|
30 |
+
PHP_ADD_LIBRARY(maxminddb, 1, MAXMINDDB_SHARED_LIBADD)
|
31 |
+
fi
|
32 |
|
33 |
if test $PHP_MAXMINDDB_DEBUG != "no"; then
|
34 |
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror"
|
35 |
fi
|
36 |
|
|
|
37 |
PHP_SUBST(MAXMINDDB_SHARED_LIBADD)
|
38 |
|
39 |
PHP_NEW_EXTENSION(maxminddb, maxminddb.c, $ext_shared)
|
includes/vendor/maxmind-db/reader/ext/maxminddb.c
CHANGED
@@ -20,6 +20,7 @@
|
|
20 |
#include <php.h>
|
21 |
#include <zend.h>
|
22 |
#include "Zend/zend_exceptions.h"
|
|
|
23 |
#include <maxminddb.h>
|
24 |
|
25 |
#ifdef ZTS
|
@@ -77,6 +78,8 @@ static void handle_uint128(const MMDB_entry_data_list_s *entry_data_list,
|
|
77 |
zval *z_value TSRMLS_DC);
|
78 |
static void handle_uint64(const MMDB_entry_data_list_s *entry_data_list,
|
79 |
zval *z_value TSRMLS_DC);
|
|
|
|
|
80 |
static zend_class_entry * lookup_class(const char *name TSRMLS_DC);
|
81 |
|
82 |
#define CHECK_ALLOCATED(val) \
|
@@ -115,6 +118,10 @@ static inline maxminddb_obj *php_maxminddb_fetch_object(zend_object *obj TSRMLS_
|
|
115 |
#endif
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
118 |
PHP_METHOD(MaxMind_Db_Reader, __construct){
|
119 |
char *db_file = NULL;
|
120 |
strsize_t name_len;
|
@@ -150,6 +157,10 @@ PHP_METHOD(MaxMind_Db_Reader, __construct){
|
|
150 |
mmdb_obj->mmdb = mmdb;
|
151 |
}
|
152 |
|
|
|
|
|
|
|
|
|
153 |
PHP_METHOD(MaxMind_Db_Reader, get){
|
154 |
char *ip_address = NULL;
|
155 |
strsize_t name_len;
|
@@ -225,6 +236,9 @@ PHP_METHOD(MaxMind_Db_Reader, get){
|
|
225 |
MMDB_free_entry_data_list(entry_data_list);
|
226 |
}
|
227 |
|
|
|
|
|
|
|
228 |
PHP_METHOD(MaxMind_Db_Reader, metadata){
|
229 |
if (ZEND_NUM_ARGS() != 0) {
|
230 |
THROW_EXCEPTION("InvalidArgumentException",
|
@@ -326,7 +340,7 @@ static const MMDB_entry_data_list_s *handle_entry_data_list(
|
|
326 |
ZVAL_LONG(z_value, entry_data_list->entry_data.uint16);
|
327 |
break;
|
328 |
case MMDB_DATA_TYPE_UINT32:
|
329 |
-
|
330 |
break;
|
331 |
case MMDB_DATA_TYPE_BOOLEAN:
|
332 |
ZVAL_BOOL(z_value, entry_data_list->entry_data.boolean);
|
@@ -439,17 +453,51 @@ static void handle_uint128(const MMDB_entry_data_list_s *entry_data_list,
|
|
439 |
efree(num_str);
|
440 |
}
|
441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
static void handle_uint64(const MMDB_entry_data_list_s *entry_data_list,
|
443 |
zval *z_value TSRMLS_DC)
|
444 |
{
|
445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
char *int_str;
|
447 |
-
spprintf(&int_str, 0, "%" PRIu64,
|
448 |
-
entry_data_list->entry_data.uint64);
|
449 |
CHECK_ALLOCATED(int_str);
|
450 |
|
451 |
_ZVAL_STRING(z_value, int_str);
|
452 |
efree(int_str);
|
|
|
453 |
}
|
454 |
|
455 |
static zend_class_entry *lookup_class(const char *name TSRMLS_DC)
|
@@ -520,11 +568,11 @@ static zend_object_value maxminddb_create_handler(
|
|
520 |
|
521 |
/* *INDENT-OFF* */
|
522 |
static zend_function_entry maxminddb_methods[] = {
|
523 |
-
PHP_ME(MaxMind_Db_Reader, __construct,
|
524 |
ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
|
525 |
-
PHP_ME(MaxMind_Db_Reader, close,
|
526 |
-
PHP_ME(MaxMind_Db_Reader, get,
|
527 |
-
PHP_ME(MaxMind_Db_Reader, metadata,
|
528 |
{ NULL, NULL, NULL }
|
529 |
};
|
530 |
/* *INDENT-ON* */
|
@@ -546,6 +594,17 @@ PHP_MINIT_FUNCTION(maxminddb){
|
|
546 |
return SUCCESS;
|
547 |
}
|
548 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
zend_module_entry maxminddb_module_entry = {
|
550 |
STANDARD_MODULE_HEADER,
|
551 |
PHP_MAXMINDDB_EXTNAME,
|
@@ -554,7 +613,7 @@ zend_module_entry maxminddb_module_entry = {
|
|
554 |
NULL,
|
555 |
NULL,
|
556 |
NULL,
|
557 |
-
|
558 |
PHP_MAXMINDDB_VERSION,
|
559 |
STANDARD_MODULE_PROPERTIES
|
560 |
};
|
20 |
#include <php.h>
|
21 |
#include <zend.h>
|
22 |
#include "Zend/zend_exceptions.h"
|
23 |
+
#include "ext/standard/info.h"
|
24 |
#include <maxminddb.h>
|
25 |
|
26 |
#ifdef ZTS
|
78 |
zval *z_value TSRMLS_DC);
|
79 |
static void handle_uint64(const MMDB_entry_data_list_s *entry_data_list,
|
80 |
zval *z_value TSRMLS_DC);
|
81 |
+
static void handle_uint32(const MMDB_entry_data_list_s *entry_data_list,
|
82 |
+
zval *z_value TSRMLS_DC);
|
83 |
static zend_class_entry * lookup_class(const char *name TSRMLS_DC);
|
84 |
|
85 |
#define CHECK_ALLOCATED(val) \
|
118 |
#endif
|
119 |
}
|
120 |
|
121 |
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_construct, 0, 0, 1)
|
122 |
+
ZEND_ARG_INFO(0, db_file)
|
123 |
+
ZEND_END_ARG_INFO()
|
124 |
+
|
125 |
PHP_METHOD(MaxMind_Db_Reader, __construct){
|
126 |
char *db_file = NULL;
|
127 |
strsize_t name_len;
|
157 |
mmdb_obj->mmdb = mmdb;
|
158 |
}
|
159 |
|
160 |
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_get, 0, 0, 1)
|
161 |
+
ZEND_ARG_INFO(0, ip_address)
|
162 |
+
ZEND_END_ARG_INFO()
|
163 |
+
|
164 |
PHP_METHOD(MaxMind_Db_Reader, get){
|
165 |
char *ip_address = NULL;
|
166 |
strsize_t name_len;
|
236 |
MMDB_free_entry_data_list(entry_data_list);
|
237 |
}
|
238 |
|
239 |
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_void, 0, 0, 0)
|
240 |
+
ZEND_END_ARG_INFO()
|
241 |
+
|
242 |
PHP_METHOD(MaxMind_Db_Reader, metadata){
|
243 |
if (ZEND_NUM_ARGS() != 0) {
|
244 |
THROW_EXCEPTION("InvalidArgumentException",
|
340 |
ZVAL_LONG(z_value, entry_data_list->entry_data.uint16);
|
341 |
break;
|
342 |
case MMDB_DATA_TYPE_UINT32:
|
343 |
+
handle_uint32(entry_data_list, z_value TSRMLS_CC);
|
344 |
break;
|
345 |
case MMDB_DATA_TYPE_BOOLEAN:
|
346 |
ZVAL_BOOL(z_value, entry_data_list->entry_data.boolean);
|
453 |
efree(num_str);
|
454 |
}
|
455 |
|
456 |
+
static void handle_uint32(const MMDB_entry_data_list_s *entry_data_list,
|
457 |
+
zval *z_value TSRMLS_DC)
|
458 |
+
{
|
459 |
+
uint32_t val = entry_data_list->entry_data.uint32;
|
460 |
+
|
461 |
+
#if LONG_MAX >= UINT32_MAX
|
462 |
+
ZVAL_LONG(z_value, val);
|
463 |
+
return;
|
464 |
+
#else
|
465 |
+
if (val <= LONG_MAX) {
|
466 |
+
ZVAL_LONG(z_value, val);
|
467 |
+
return;
|
468 |
+
}
|
469 |
+
|
470 |
+
char *int_str;
|
471 |
+
spprintf(&int_str, 0, "%" PRIu32, val);
|
472 |
+
CHECK_ALLOCATED(int_str);
|
473 |
+
|
474 |
+
_ZVAL_STRING(z_value, int_str);
|
475 |
+
efree(int_str);
|
476 |
+
#endif
|
477 |
+
}
|
478 |
+
|
479 |
+
|
480 |
static void handle_uint64(const MMDB_entry_data_list_s *entry_data_list,
|
481 |
zval *z_value TSRMLS_DC)
|
482 |
{
|
483 |
+
uint64_t val = entry_data_list->entry_data.uint64;
|
484 |
+
|
485 |
+
#if LONG_MAX >= UINT64_MAX
|
486 |
+
ZVAL_LONG(z_value, val);
|
487 |
+
return;
|
488 |
+
#else
|
489 |
+
if (val <= LONG_MAX) {
|
490 |
+
ZVAL_LONG(z_value, val);
|
491 |
+
return;
|
492 |
+
}
|
493 |
+
|
494 |
char *int_str;
|
495 |
+
spprintf(&int_str, 0, "%" PRIu64, val);
|
|
|
496 |
CHECK_ALLOCATED(int_str);
|
497 |
|
498 |
_ZVAL_STRING(z_value, int_str);
|
499 |
efree(int_str);
|
500 |
+
#endif
|
501 |
}
|
502 |
|
503 |
static zend_class_entry *lookup_class(const char *name TSRMLS_DC)
|
568 |
|
569 |
/* *INDENT-OFF* */
|
570 |
static zend_function_entry maxminddb_methods[] = {
|
571 |
+
PHP_ME(MaxMind_Db_Reader, __construct, arginfo_maxmindbreader_construct,
|
572 |
ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
|
573 |
+
PHP_ME(MaxMind_Db_Reader, close, arginfo_maxmindbreader_void, ZEND_ACC_PUBLIC)
|
574 |
+
PHP_ME(MaxMind_Db_Reader, get, arginfo_maxmindbreader_get, ZEND_ACC_PUBLIC)
|
575 |
+
PHP_ME(MaxMind_Db_Reader, metadata, arginfo_maxmindbreader_void, ZEND_ACC_PUBLIC)
|
576 |
{ NULL, NULL, NULL }
|
577 |
};
|
578 |
/* *INDENT-ON* */
|
594 |
return SUCCESS;
|
595 |
}
|
596 |
|
597 |
+
static PHP_MINFO_FUNCTION(maxminddb)
|
598 |
+
{
|
599 |
+
php_info_print_table_start();
|
600 |
+
|
601 |
+
php_info_print_table_row(2, "MaxMind DB Reader", "enabled");
|
602 |
+
php_info_print_table_row(2, "maxminddb extension version", PHP_MAXMINDDB_VERSION);
|
603 |
+
php_info_print_table_row(2, "libmaxminddb library version", MMDB_lib_version());
|
604 |
+
|
605 |
+
php_info_print_table_end();
|
606 |
+
}
|
607 |
+
|
608 |
zend_module_entry maxminddb_module_entry = {
|
609 |
STANDARD_MODULE_HEADER,
|
610 |
PHP_MAXMINDDB_EXTNAME,
|
613 |
NULL,
|
614 |
NULL,
|
615 |
NULL,
|
616 |
+
PHP_MINFO(maxminddb),
|
617 |
PHP_MAXMINDDB_VERSION,
|
618 |
STANDARD_MODULE_PROPERTIES
|
619 |
};
|
includes/vendor/maxmind-db/reader/ext/php_maxminddb.h
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
|
16 |
#ifndef PHP_MAXMINDDB_H
|
17 |
#define PHP_MAXMINDDB_H 1
|
18 |
-
#define PHP_MAXMINDDB_VERSION "1.
|
19 |
#define PHP_MAXMINDDB_EXTNAME "maxminddb"
|
20 |
|
21 |
extern zend_module_entry maxminddb_module_entry;
|
15 |
|
16 |
#ifndef PHP_MAXMINDDB_H
|
17 |
#define PHP_MAXMINDDB_H 1
|
18 |
+
#define PHP_MAXMINDDB_VERSION "1.4.1"
|
19 |
#define PHP_MAXMINDDB_EXTNAME "maxminddb"
|
20 |
|
21 |
extern zend_module_entry maxminddb_module_entry;
|
includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php
CHANGED
@@ -38,7 +38,7 @@ class Reader
|
|
38 |
*/
|
39 |
public function __construct($database)
|
40 |
{
|
41 |
-
if (func_num_args() !== 1) {
|
42 |
throw new \InvalidArgumentException(
|
43 |
'The constructor takes exactly one argument.'
|
44 |
);
|
@@ -88,13 +88,13 @@ class Reader
|
|
88 |
*/
|
89 |
public function get($ipAddress)
|
90 |
{
|
91 |
-
if (func_num_args() !== 1) {
|
92 |
throw new \InvalidArgumentException(
|
93 |
'Method takes exactly one argument.'
|
94 |
);
|
95 |
}
|
96 |
|
97 |
-
if (
|
98 |
throw new \BadMethodCallException(
|
99 |
'Attempt to read from a closed MaxMind DB.'
|
100 |
);
|
@@ -125,13 +125,13 @@ class Reader
|
|
125 |
// XXX - could simplify. Done as a byte array to ease porting
|
126 |
$rawAddress = array_merge(unpack('C*', inet_pton($ipAddress)));
|
127 |
|
128 |
-
$bitCount = count($rawAddress) * 8;
|
129 |
|
130 |
// The first node of the tree is always node 0, at the beginning of the
|
131 |
// value
|
132 |
$node = $this->startNode($bitCount);
|
133 |
|
134 |
-
for ($i = 0; $i < $bitCount;
|
135 |
if ($node >= $this->metadata->nodeCount) {
|
136 |
break;
|
137 |
}
|
@@ -175,7 +175,7 @@ class Reader
|
|
175 |
}
|
176 |
$node = 0;
|
177 |
|
178 |
-
for ($i = 0; $i < 96 && $node < $this->metadata->nodeCount;
|
179 |
$node = $this->readNode($node, 0);
|
180 |
}
|
181 |
$this->ipV4Start = $node;
|
@@ -203,7 +203,7 @@ class Reader
|
|
203 |
$middle = 0x0F & $middle;
|
204 |
}
|
205 |
$bytes = Util::read($this->fileHandle, $baseOffset + $index * 4, 3);
|
206 |
-
list(, $node) = unpack('N', chr($middle) . $bytes);
|
207 |
|
208 |
return $node;
|
209 |
case 32:
|
@@ -249,8 +249,8 @@ class Reader
|
|
249 |
$metadataMaxLengthExcludingMarker
|
250 |
= min(self::$METADATA_MAX_SIZE, $fileSize) - $markerLength;
|
251 |
|
252 |
-
for ($i = 0; $i <= $metadataMaxLengthExcludingMarker;
|
253 |
-
for ($j = 0; $j < $markerLength;
|
254 |
fseek($handle, $fileSize - $i - $j - 1);
|
255 |
$matchBit = fgetc($handle);
|
256 |
if ($matchBit !== $marker[$markerLength - $j - 1]) {
|
@@ -274,7 +274,7 @@ class Reader
|
|
274 |
*/
|
275 |
public function metadata()
|
276 |
{
|
277 |
-
if (func_num_args()) {
|
278 |
throw new \InvalidArgumentException(
|
279 |
'Method takes no arguments.'
|
280 |
);
|
@@ -282,7 +282,7 @@ class Reader
|
|
282 |
|
283 |
// Not technically required, but this makes it consistent with
|
284 |
// C extension and it allows us to change our implementation later.
|
285 |
-
if (
|
286 |
throw new \BadMethodCallException(
|
287 |
'Attempt to read from a closed MaxMind DB.'
|
288 |
);
|
@@ -299,7 +299,7 @@ class Reader
|
|
299 |
*/
|
300 |
public function close()
|
301 |
{
|
302 |
-
if (
|
303 |
throw new \BadMethodCallException(
|
304 |
'Attempt to close a closed MaxMind DB.'
|
305 |
);
|
38 |
*/
|
39 |
public function __construct($database)
|
40 |
{
|
41 |
+
if (\func_num_args() !== 1) {
|
42 |
throw new \InvalidArgumentException(
|
43 |
'The constructor takes exactly one argument.'
|
44 |
);
|
88 |
*/
|
89 |
public function get($ipAddress)
|
90 |
{
|
91 |
+
if (\func_num_args() !== 1) {
|
92 |
throw new \InvalidArgumentException(
|
93 |
'Method takes exactly one argument.'
|
94 |
);
|
95 |
}
|
96 |
|
97 |
+
if (!\is_resource($this->fileHandle)) {
|
98 |
throw new \BadMethodCallException(
|
99 |
'Attempt to read from a closed MaxMind DB.'
|
100 |
);
|
125 |
// XXX - could simplify. Done as a byte array to ease porting
|
126 |
$rawAddress = array_merge(unpack('C*', inet_pton($ipAddress)));
|
127 |
|
128 |
+
$bitCount = \count($rawAddress) * 8;
|
129 |
|
130 |
// The first node of the tree is always node 0, at the beginning of the
|
131 |
// value
|
132 |
$node = $this->startNode($bitCount);
|
133 |
|
134 |
+
for ($i = 0; $i < $bitCount; ++$i) {
|
135 |
if ($node >= $this->metadata->nodeCount) {
|
136 |
break;
|
137 |
}
|
175 |
}
|
176 |
$node = 0;
|
177 |
|
178 |
+
for ($i = 0; $i < 96 && $node < $this->metadata->nodeCount; ++$i) {
|
179 |
$node = $this->readNode($node, 0);
|
180 |
}
|
181 |
$this->ipV4Start = $node;
|
203 |
$middle = 0x0F & $middle;
|
204 |
}
|
205 |
$bytes = Util::read($this->fileHandle, $baseOffset + $index * 4, 3);
|
206 |
+
list(, $node) = unpack('N', \chr($middle) . $bytes);
|
207 |
|
208 |
return $node;
|
209 |
case 32:
|
249 |
$metadataMaxLengthExcludingMarker
|
250 |
= min(self::$METADATA_MAX_SIZE, $fileSize) - $markerLength;
|
251 |
|
252 |
+
for ($i = 0; $i <= $metadataMaxLengthExcludingMarker; ++$i) {
|
253 |
+
for ($j = 0; $j < $markerLength; ++$j) {
|
254 |
fseek($handle, $fileSize - $i - $j - 1);
|
255 |
$matchBit = fgetc($handle);
|
256 |
if ($matchBit !== $marker[$markerLength - $j - 1]) {
|
274 |
*/
|
275 |
public function metadata()
|
276 |
{
|
277 |
+
if (\func_num_args()) {
|
278 |
throw new \InvalidArgumentException(
|
279 |
'Method takes no arguments.'
|
280 |
);
|
282 |
|
283 |
// Not technically required, but this makes it consistent with
|
284 |
// C extension and it allows us to change our implementation later.
|
285 |
+
if (!\is_resource($this->fileHandle)) {
|
286 |
throw new \BadMethodCallException(
|
287 |
'Attempt to read from a closed MaxMind DB.'
|
288 |
);
|
299 |
*/
|
300 |
public function close()
|
301 |
{
|
302 |
+
if (!\is_resource($this->fileHandle)) {
|
303 |
throw new \BadMethodCallException(
|
304 |
'Attempt to close a closed MaxMind DB.'
|
305 |
);
|
includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php
CHANGED
@@ -2,32 +2,35 @@
|
|
2 |
|
3 |
namespace MaxMind\Db\Reader;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Decoder
|
6 |
{
|
7 |
private $fileStream;
|
8 |
private $pointerBase;
|
|
|
9 |
// This is only used for unit testing
|
10 |
private $pointerTestHack;
|
11 |
private $switchByteOrder;
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
15 => 'float',
|
30 |
-
];
|
31 |
|
32 |
public function __construct(
|
33 |
$fileStream,
|
@@ -36,6 +39,8 @@ class Decoder
|
|
36 |
) {
|
37 |
$this->fileStream = $fileStream;
|
38 |
$this->pointerBase = $pointerBase;
|
|
|
|
|
39 |
$this->pointerTestHack = $pointerTestHack;
|
40 |
|
41 |
$this->switchByteOrder = $this->isPlatformLittleEndian();
|
@@ -47,14 +52,14 @@ class Decoder
|
|
47 |
'C',
|
48 |
Util::read($this->fileStream, $offset, 1)
|
49 |
);
|
50 |
-
|
51 |
|
52 |
-
$type = $
|
53 |
|
54 |
// Pointers are a special case, we don't read the next $size bytes, we
|
55 |
// use the size to determine the length of the pointer and then follow
|
56 |
// it.
|
57 |
-
if ($type ===
|
58 |
list($pointer, $offset) = $this->decodePointer($ctrlByte, $offset);
|
59 |
|
60 |
// for unit testing
|
@@ -67,25 +72,24 @@ class Decoder
|
|
67 |
return [$result, $offset];
|
68 |
}
|
69 |
|
70 |
-
if ($type ===
|
71 |
list(, $nextByte) = unpack(
|
72 |
'C',
|
73 |
Util::read($this->fileStream, $offset, 1)
|
74 |
);
|
75 |
|
76 |
-
$
|
77 |
|
78 |
-
if ($
|
79 |
throw new InvalidDatabaseException(
|
80 |
'Something went horribly wrong in the decoder. An extended type '
|
81 |
. 'resolved to a type number < 8 ('
|
82 |
-
. $
|
83 |
. ')'
|
84 |
);
|
85 |
}
|
86 |
|
87 |
-
|
88 |
-
$offset++;
|
89 |
}
|
90 |
|
91 |
list($size, $offset) = $this->sizeFromCtrlByte($ctrlByte, $offset);
|
@@ -96,37 +100,35 @@ class Decoder
|
|
96 |
private function decodeByType($type, $offset, $size)
|
97 |
{
|
98 |
switch ($type) {
|
99 |
-
case
|
100 |
return $this->decodeMap($size, $offset);
|
101 |
-
case
|
102 |
return $this->decodeArray($size, $offset);
|
103 |
-
case
|
104 |
return [$this->decodeBoolean($size), $offset];
|
105 |
}
|
106 |
|
107 |
$newOffset = $offset + $size;
|
108 |
$bytes = Util::read($this->fileStream, $offset, $size);
|
109 |
switch ($type) {
|
110 |
-
case
|
111 |
-
|
112 |
-
|
|
|
113 |
$this->verifySize(8, $size);
|
114 |
|
115 |
return [$this->decodeDouble($bytes), $newOffset];
|
116 |
-
case
|
117 |
$this->verifySize(4, $size);
|
118 |
|
119 |
return [$this->decodeFloat($bytes), $newOffset];
|
120 |
-
case
|
121 |
-
return [$bytes, $newOffset];
|
122 |
-
case
|
123 |
-
case
|
124 |
-
|
125 |
-
case
|
126 |
-
return [$this->
|
127 |
-
case 'uint64':
|
128 |
-
case 'uint128':
|
129 |
-
return [$this->decodeBigUint($bytes, $size), $newOffset];
|
130 |
default:
|
131 |
throw new InvalidDatabaseException(
|
132 |
'Unknown or unexpected type: ' . $type
|
@@ -147,7 +149,7 @@ class Decoder
|
|
147 |
{
|
148 |
$array = [];
|
149 |
|
150 |
-
for ($i = 0; $i < $size;
|
151 |
list($value, $offset) = $this->decode($offset);
|
152 |
array_push($array, $value);
|
153 |
}
|
@@ -162,7 +164,12 @@ class Decoder
|
|
162 |
|
163 |
private function decodeDouble($bits)
|
164 |
{
|
165 |
-
//
|
|
|
|
|
|
|
|
|
|
|
166 |
list(, $double) = unpack('d', $this->maybeSwitchByteOrder($bits));
|
167 |
|
168 |
return $double;
|
@@ -170,15 +177,35 @@ class Decoder
|
|
170 |
|
171 |
private function decodeFloat($bits)
|
172 |
{
|
173 |
-
//
|
|
|
|
|
|
|
|
|
|
|
174 |
list(, $float) = unpack('f', $this->maybeSwitchByteOrder($bits));
|
175 |
|
176 |
return $float;
|
177 |
}
|
178 |
|
179 |
-
private function decodeInt32($bytes)
|
180 |
{
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
list(, $int) = unpack('l', $this->maybeSwitchByteOrder($bytes));
|
183 |
|
184 |
return $int;
|
@@ -188,7 +215,7 @@ class Decoder
|
|
188 |
{
|
189 |
$map = [];
|
190 |
|
191 |
-
for ($i = 0; $i < $size;
|
192 |
list($key, $offset) = $this->decode($offset);
|
193 |
list($value, $offset) = $this->decode($offset);
|
194 |
$map[$key] = $value;
|
@@ -197,13 +224,6 @@ class Decoder
|
|
197 |
return [$map, $offset];
|
198 |
}
|
199 |
|
200 |
-
private $pointerValueOffset = [
|
201 |
-
1 => 0,
|
202 |
-
2 => 2048,
|
203 |
-
3 => 526336,
|
204 |
-
4 => 0,
|
205 |
-
];
|
206 |
-
|
207 |
private function decodePointer($ctrlByte, $offset)
|
208 |
{
|
209 |
$pointerSize = (($ctrlByte >> 3) & 0x3) + 1;
|
@@ -211,50 +231,66 @@ class Decoder
|
|
211 |
$buffer = Util::read($this->fileStream, $offset, $pointerSize);
|
212 |
$offset = $offset + $pointerSize;
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
return [$pointer, $offset];
|
223 |
}
|
224 |
|
225 |
-
private function decodeUint($bytes)
|
226 |
-
{
|
227 |
-
list(, $int) = unpack('N', $this->zeroPadLeft($bytes, 4));
|
228 |
-
|
229 |
-
return $int;
|
230 |
-
}
|
231 |
-
|
232 |
-
private function decodeBigUint($bytes, $byteLength)
|
233 |
{
|
234 |
-
$maxUintBytes = log(PHP_INT_MAX, 2) / 8;
|
235 |
-
|
236 |
if ($byteLength === 0) {
|
237 |
return 0;
|
238 |
}
|
239 |
|
240 |
-
$numberOfLongs = ceil($byteLength / 4);
|
241 |
-
$paddedLength = $numberOfLongs * 4;
|
242 |
-
$paddedBytes = $this->zeroPadLeft($bytes, $paddedLength);
|
243 |
-
$unpacked = array_merge(unpack("N$numberOfLongs", $paddedBytes));
|
244 |
-
|
245 |
$integer = 0;
|
246 |
|
247 |
-
|
248 |
-
|
249 |
|
250 |
-
foreach ($unpacked as $part) {
|
251 |
// We only use gmp or bcmath if the final value is too big
|
252 |
-
if ($byteLength <=
|
253 |
-
$integer = ($integer <<
|
254 |
-
} elseif (extension_loaded('gmp')) {
|
255 |
-
$integer = gmp_strval(gmp_add(gmp_mul($integer,
|
256 |
-
} elseif (extension_loaded('bcmath')) {
|
257 |
-
$integer = bcadd(bcmul($integer,
|
258 |
} else {
|
259 |
throw new \RuntimeException(
|
260 |
'The gmp or bcmath extension must be installed to read this database.'
|
@@ -265,37 +301,31 @@ class Decoder
|
|
265 |
return $integer;
|
266 |
}
|
267 |
|
268 |
-
private function decodeString($bytes)
|
269 |
-
{
|
270 |
-
// XXX - NOOP. As far as I know, the end user has to explicitly set the
|
271 |
-
// encoding in PHP. Strings are just bytes.
|
272 |
-
return $bytes;
|
273 |
-
}
|
274 |
-
|
275 |
private function sizeFromCtrlByte($ctrlByte, $offset)
|
276 |
{
|
277 |
$size = $ctrlByte & 0x1f;
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
279 |
$bytes = Util::read($this->fileStream, $offset, $bytesToRead);
|
280 |
-
$decoded = $this->decodeUint($bytes);
|
281 |
|
282 |
if ($size === 29) {
|
283 |
-
$size = 29 + $
|
284 |
} elseif ($size === 30) {
|
285 |
-
$
|
|
|
286 |
} elseif ($size > 30) {
|
287 |
-
$
|
|
|
288 |
+ 65821;
|
289 |
}
|
290 |
|
291 |
return [$size, $offset + $bytesToRead];
|
292 |
}
|
293 |
|
294 |
-
private function zeroPadLeft($content, $desiredLength)
|
295 |
-
{
|
296 |
-
return str_pad($content, $desiredLength, "\x00", STR_PAD_LEFT);
|
297 |
-
}
|
298 |
-
|
299 |
private function maybeSwitchByteOrder($bytes)
|
300 |
{
|
301 |
return $this->switchByteOrder ? strrev($bytes) : $bytes;
|
2 |
|
3 |
namespace MaxMind\Db\Reader;
|
4 |
|
5 |
+
// @codingStandardsIgnoreLine
|
6 |
+
// We subtract 1 from the log to protect against precision loss.
|
7 |
+
\define(__NAMESPACE__ . '\_MM_MAX_INT_BYTES', (log(PHP_INT_MAX, 2) - 1) / 8);
|
8 |
+
|
9 |
class Decoder
|
10 |
{
|
11 |
private $fileStream;
|
12 |
private $pointerBase;
|
13 |
+
private $pointerBaseByteSize;
|
14 |
// This is only used for unit testing
|
15 |
private $pointerTestHack;
|
16 |
private $switchByteOrder;
|
17 |
|
18 |
+
const _EXTENDED = 0;
|
19 |
+
const _POINTER = 1;
|
20 |
+
const _UTF8_STRING = 2;
|
21 |
+
const _DOUBLE = 3;
|
22 |
+
const _BYTES = 4;
|
23 |
+
const _UINT16 = 5;
|
24 |
+
const _UINT32 = 6;
|
25 |
+
const _MAP = 7;
|
26 |
+
const _INT32 = 8;
|
27 |
+
const _UINT64 = 9;
|
28 |
+
const _UINT128 = 10;
|
29 |
+
const _ARRAY = 11;
|
30 |
+
const _CONTAINER = 12;
|
31 |
+
const _END_MARKER = 13;
|
32 |
+
const _BOOLEAN = 14;
|
33 |
+
const _FLOAT = 15;
|
|
|
|
|
34 |
|
35 |
public function __construct(
|
36 |
$fileStream,
|
39 |
) {
|
40 |
$this->fileStream = $fileStream;
|
41 |
$this->pointerBase = $pointerBase;
|
42 |
+
|
43 |
+
$this->pointerBaseByteSize = $pointerBase > 0 ? log($pointerBase, 2) / 8 : 0;
|
44 |
$this->pointerTestHack = $pointerTestHack;
|
45 |
|
46 |
$this->switchByteOrder = $this->isPlatformLittleEndian();
|
52 |
'C',
|
53 |
Util::read($this->fileStream, $offset, 1)
|
54 |
);
|
55 |
+
++$offset;
|
56 |
|
57 |
+
$type = $ctrlByte >> 5;
|
58 |
|
59 |
// Pointers are a special case, we don't read the next $size bytes, we
|
60 |
// use the size to determine the length of the pointer and then follow
|
61 |
// it.
|
62 |
+
if ($type === self::_POINTER) {
|
63 |
list($pointer, $offset) = $this->decodePointer($ctrlByte, $offset);
|
64 |
|
65 |
// for unit testing
|
72 |
return [$result, $offset];
|
73 |
}
|
74 |
|
75 |
+
if ($type === self::_EXTENDED) {
|
76 |
list(, $nextByte) = unpack(
|
77 |
'C',
|
78 |
Util::read($this->fileStream, $offset, 1)
|
79 |
);
|
80 |
|
81 |
+
$type = $nextByte + 7;
|
82 |
|
83 |
+
if ($type < 8) {
|
84 |
throw new InvalidDatabaseException(
|
85 |
'Something went horribly wrong in the decoder. An extended type '
|
86 |
. 'resolved to a type number < 8 ('
|
87 |
+
. $type
|
88 |
. ')'
|
89 |
);
|
90 |
}
|
91 |
|
92 |
+
++$offset;
|
|
|
93 |
}
|
94 |
|
95 |
list($size, $offset) = $this->sizeFromCtrlByte($ctrlByte, $offset);
|
100 |
private function decodeByType($type, $offset, $size)
|
101 |
{
|
102 |
switch ($type) {
|
103 |
+
case self::_MAP:
|
104 |
return $this->decodeMap($size, $offset);
|
105 |
+
case self::_ARRAY:
|
106 |
return $this->decodeArray($size, $offset);
|
107 |
+
case self::_BOOLEAN:
|
108 |
return [$this->decodeBoolean($size), $offset];
|
109 |
}
|
110 |
|
111 |
$newOffset = $offset + $size;
|
112 |
$bytes = Util::read($this->fileStream, $offset, $size);
|
113 |
switch ($type) {
|
114 |
+
case self::_BYTES:
|
115 |
+
case self::_UTF8_STRING:
|
116 |
+
return [$bytes, $newOffset];
|
117 |
+
case self::_DOUBLE:
|
118 |
$this->verifySize(8, $size);
|
119 |
|
120 |
return [$this->decodeDouble($bytes), $newOffset];
|
121 |
+
case self::_FLOAT:
|
122 |
$this->verifySize(4, $size);
|
123 |
|
124 |
return [$this->decodeFloat($bytes), $newOffset];
|
125 |
+
case self::_INT32:
|
126 |
+
return [$this->decodeInt32($bytes, $size), $newOffset];
|
127 |
+
case self::_UINT16:
|
128 |
+
case self::_UINT32:
|
129 |
+
case self::_UINT64:
|
130 |
+
case self::_UINT128:
|
131 |
+
return [$this->decodeUint($bytes, $size), $newOffset];
|
|
|
|
|
|
|
132 |
default:
|
133 |
throw new InvalidDatabaseException(
|
134 |
'Unknown or unexpected type: ' . $type
|
149 |
{
|
150 |
$array = [];
|
151 |
|
152 |
+
for ($i = 0; $i < $size; ++$i) {
|
153 |
list($value, $offset) = $this->decode($offset);
|
154 |
array_push($array, $value);
|
155 |
}
|
164 |
|
165 |
private function decodeDouble($bits)
|
166 |
{
|
167 |
+
// This assumes IEEE 754 doubles, but most (all?) modern platforms
|
168 |
+
// use them.
|
169 |
+
//
|
170 |
+
// We are not using the "E" format as that was only added in
|
171 |
+
// 7.0.15 and 7.1.1. As such, we must switch byte order on
|
172 |
+
// little endian machines.
|
173 |
list(, $double) = unpack('d', $this->maybeSwitchByteOrder($bits));
|
174 |
|
175 |
return $double;
|
177 |
|
178 |
private function decodeFloat($bits)
|
179 |
{
|
180 |
+
// This assumes IEEE 754 floats, but most (all?) modern platforms
|
181 |
+
// use them.
|
182 |
+
//
|
183 |
+
// We are not using the "G" format as that was only added in
|
184 |
+
// 7.0.15 and 7.1.1. As such, we must switch byte order on
|
185 |
+
// little endian machines.
|
186 |
list(, $float) = unpack('f', $this->maybeSwitchByteOrder($bits));
|
187 |
|
188 |
return $float;
|
189 |
}
|
190 |
|
191 |
+
private function decodeInt32($bytes, $size)
|
192 |
{
|
193 |
+
switch ($size) {
|
194 |
+
case 0:
|
195 |
+
return 0;
|
196 |
+
case 1:
|
197 |
+
case 2:
|
198 |
+
case 3:
|
199 |
+
$bytes = str_pad($bytes, 4, "\x00", STR_PAD_LEFT);
|
200 |
+
break;
|
201 |
+
case 4:
|
202 |
+
break;
|
203 |
+
default:
|
204 |
+
throw new InvalidDatabaseException(
|
205 |
+
"The MaxMind DB file's data section contains bad data (unknown data type or corrupt data)"
|
206 |
+
);
|
207 |
+
}
|
208 |
+
|
209 |
list(, $int) = unpack('l', $this->maybeSwitchByteOrder($bytes));
|
210 |
|
211 |
return $int;
|
215 |
{
|
216 |
$map = [];
|
217 |
|
218 |
+
for ($i = 0; $i < $size; ++$i) {
|
219 |
list($key, $offset) = $this->decode($offset);
|
220 |
list($value, $offset) = $this->decode($offset);
|
221 |
$map[$key] = $value;
|
224 |
return [$map, $offset];
|
225 |
}
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
private function decodePointer($ctrlByte, $offset)
|
228 |
{
|
229 |
$pointerSize = (($ctrlByte >> 3) & 0x3) + 1;
|
231 |
$buffer = Util::read($this->fileStream, $offset, $pointerSize);
|
232 |
$offset = $offset + $pointerSize;
|
233 |
|
234 |
+
switch ($pointerSize) {
|
235 |
+
case 1:
|
236 |
+
$packed = (pack('C', $ctrlByte & 0x7)) . $buffer;
|
237 |
+
list(, $pointer) = unpack('n', $packed);
|
238 |
+
$pointer += $this->pointerBase;
|
239 |
+
break;
|
240 |
+
case 2:
|
241 |
+
$packed = "\x00" . (pack('C', $ctrlByte & 0x7)) . $buffer;
|
242 |
+
list(, $pointer) = unpack('N', $packed);
|
243 |
+
$pointer += $this->pointerBase + 2048;
|
244 |
+
break;
|
245 |
+
case 3:
|
246 |
+
$packed = (pack('C', $ctrlByte & 0x7)) . $buffer;
|
247 |
+
|
248 |
+
// It is safe to use 'N' here, even on 32 bit machines as the
|
249 |
+
// first bit is 0.
|
250 |
+
list(, $pointer) = unpack('N', $packed);
|
251 |
+
$pointer += $this->pointerBase + 526336;
|
252 |
+
break;
|
253 |
+
case 4:
|
254 |
+
// We cannot use unpack here as we might overflow on 32 bit
|
255 |
+
// machines
|
256 |
+
$pointerOffset = $this->decodeUint($buffer, $pointerSize);
|
257 |
+
|
258 |
+
$byteLength = $pointerSize + $this->pointerBaseByteSize;
|
259 |
+
|
260 |
+
if ($byteLength <= _MM_MAX_INT_BYTES) {
|
261 |
+
$pointer = $pointerOffset + $this->pointerBase;
|
262 |
+
} elseif (\extension_loaded('gmp')) {
|
263 |
+
$pointer = gmp_strval(gmp_add($pointerOffset, $this->pointerBase));
|
264 |
+
} elseif (\extension_loaded('bcmath')) {
|
265 |
+
$pointer = bcadd($pointerOffset, $this->pointerBase);
|
266 |
+
} else {
|
267 |
+
throw new \RuntimeException(
|
268 |
+
'The gmp or bcmath extension must be installed to read this database.'
|
269 |
+
);
|
270 |
+
}
|
271 |
+
}
|
272 |
|
273 |
return [$pointer, $offset];
|
274 |
}
|
275 |
|
276 |
+
private function decodeUint($bytes, $byteLength)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
{
|
|
|
|
|
278 |
if ($byteLength === 0) {
|
279 |
return 0;
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
282 |
$integer = 0;
|
283 |
|
284 |
+
for ($i = 0; $i < $byteLength; ++$i) {
|
285 |
+
$part = \ord($bytes[$i]);
|
286 |
|
|
|
287 |
// We only use gmp or bcmath if the final value is too big
|
288 |
+
if ($byteLength <= _MM_MAX_INT_BYTES) {
|
289 |
+
$integer = ($integer << 8) + $part;
|
290 |
+
} elseif (\extension_loaded('gmp')) {
|
291 |
+
$integer = gmp_strval(gmp_add(gmp_mul($integer, 256), $part));
|
292 |
+
} elseif (\extension_loaded('bcmath')) {
|
293 |
+
$integer = bcadd(bcmul($integer, 256), $part);
|
294 |
} else {
|
295 |
throw new \RuntimeException(
|
296 |
'The gmp or bcmath extension must be installed to read this database.'
|
301 |
return $integer;
|
302 |
}
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
private function sizeFromCtrlByte($ctrlByte, $offset)
|
305 |
{
|
306 |
$size = $ctrlByte & 0x1f;
|
307 |
+
|
308 |
+
if ($size < 29) {
|
309 |
+
return [$size, $offset];
|
310 |
+
}
|
311 |
+
|
312 |
+
$bytesToRead = $size - 28;
|
313 |
$bytes = Util::read($this->fileStream, $offset, $bytesToRead);
|
|
|
314 |
|
315 |
if ($size === 29) {
|
316 |
+
$size = 29 + \ord($bytes);
|
317 |
} elseif ($size === 30) {
|
318 |
+
list(, $adjust) = unpack('n', $bytes);
|
319 |
+
$size = 285 + $adjust;
|
320 |
} elseif ($size > 30) {
|
321 |
+
list(, $adjust) = unpack('N', "\x00" . $bytes);
|
322 |
+
$size = ($adjust & (0x0FFFFFFF >> (32 - (8 * $bytesToRead))))
|
323 |
+ 65821;
|
324 |
}
|
325 |
|
326 |
return [$size, $offset + $bytesToRead];
|
327 |
}
|
328 |
|
|
|
|
|
|
|
|
|
|
|
329 |
private function maybeSwitchByteOrder($bytes)
|
330 |
{
|
331 |
return $this->switchByteOrder ? strrev($bytes) : $bytes;
|
changelog.txt → older-changelog.txt
RENAMED
File without changes
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: mostafa.s1990, mehrshaddarzi, ghasemi71ir, GregRoss, dedidata
|
|
3 |
Donate link: https://wp-statistics.com/donate/
|
4 |
Tags: analytics, wordpress analytics, stats, statistics, visit, visitors, hits, chart, browser, today, yesterday, week, month, year, total, post, page, sidebar, google, live visit, search word, agent, google analytics, webmasters, google webmasters, geoip, location
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 12.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -59,7 +59,7 @@ Yes, the cache support added in v12.5.1
|
|
59 |
|
60 |
If you're using a plugin cache:
|
61 |
* Don't forget to clear your enabled plugin cache.
|
62 |
-
* You should
|
63 |
* Making sure the below endpoint registered in your WordPress.
|
64 |
http://yourwebsite.com/wp-json/wpstatistics/v1
|
65 |
|
@@ -116,7 +116,42 @@ If IPv6 is not enabled, you may see an warning like:
|
|
116 |
= 12.5.3 =
|
117 |
Please consider that after updating, you will probably see some changes in Hits. The reason is that we have better-recognized crawlers and robots to get more accurate statistics for you.
|
118 |
|
|
|
|
|
|
|
|
|
|
|
119 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
= 12.5.7 =
|
121 |
* Added: The Edge To Browser List.
|
122 |
* Added: `date_i18n` function in dates for retrieving localized date.
|
3 |
Donate link: https://wp-statistics.com/donate/
|
4 |
Tags: analytics, wordpress analytics, stats, statistics, visit, visitors, hits, chart, browser, today, yesterday, week, month, year, total, post, page, sidebar, google, live visit, search word, agent, google analytics, webmasters, google webmasters, geoip, location
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 5.1
|
7 |
+
Stable tag: 12.6
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
59 |
|
60 |
If you're using a plugin cache:
|
61 |
* Don't forget to clear your enabled plugin cache.
|
62 |
+
* You should enable the plugin cache option in the Settings page.
|
63 |
* Making sure the below endpoint registered in your WordPress.
|
64 |
http://yourwebsite.com/wp-json/wpstatistics/v1
|
65 |
|
116 |
= 12.5.3 =
|
117 |
Please consider that after updating, you will probably see some changes in Hits. The reason is that we have better-recognized crawlers and robots to get more accurate statistics for you.
|
118 |
|
119 |
+
If the cache option is enabled in your WordPress, you should make sure the below endpoint registered in your WordPress.
|
120 |
+
http://yourwebsite.com/wp-json/wpstatistics/v1
|
121 |
+
|
122 |
+
To register, go to the Permalink page and update the permalink with press Save Changes.
|
123 |
+
|
124 |
== Changelog ==
|
125 |
+
= 12.6 =
|
126 |
+
# Added
|
127 |
+
- Post/Page Select in statistics page reporting according to post Type.
|
128 |
+
- Online Users widget, A cool widget to show current online users!
|
129 |
+
- A new table `visitor_relationship` for saving visitors logs.
|
130 |
+
- `user_id`, `page_id`, `type` columns to `statistics_useronline` table.
|
131 |
+
- Visitor count column in Top Country widget.
|
132 |
+
|
133 |
+
# Improvement
|
134 |
+
- Improvement MySQL time query in all functions.
|
135 |
+
- Improvement online users page UI.
|
136 |
+
- Improvement Top referrals UI.
|
137 |
+
- Improvement CSV exporter.
|
138 |
+
- Improvement pagination in admin pages that used the WordPress `paginate_links`.
|
139 |
+
- Improvement time filter in admin pages stats.
|
140 |
+
- Improvement `admin_url` link in all admin pages.
|
141 |
+
- Improvement text wrap in all meta boxes.
|
142 |
+
- Fixed reset number online users list in period time.
|
143 |
+
- Schedule list in statistical reporting.
|
144 |
+
- Refer Param in Top Referring Sites page.
|
145 |
+
- Fix method to get IP addresses.
|
146 |
+
- Fix Page CSS.
|
147 |
+
- Fix the error of No page title found in the meta box.
|
148 |
+
- Fix show number refer link from custom URL.
|
149 |
+
- Fix update option for Piwik blacklist.
|
150 |
+
|
151 |
+
# Deprecated
|
152 |
+
- Remove `WP_Statistics_Pagination` class.
|
153 |
+
- Deprecate Top Search Words (30 Days) widget.
|
154 |
+
|
155 |
= 12.5.7 =
|
156 |
* Added: The Edge To Browser List.
|
157 |
* Added: `date_i18n` function in dates for retrieving localized date.
|
wp-statistics.php
CHANGED
@@ -3,10 +3,9 @@
|
|
3 |
* Plugin Name: WP Statistics
|
4 |
* Plugin URI: https://wp-statistics.com/
|
5 |
* Description: Complete WordPress Analytics and Statistics for your site!
|
6 |
-
* Version: 12.
|
7 |
* Author: VeronaLabs
|
8 |
* Author URI: http://veronalabs.com/
|
9 |
-
*
|
10 |
* Text Domain: wp-statistics
|
11 |
* Domain Path: /languages/
|
12 |
*/
|
3 |
* Plugin Name: WP Statistics
|
4 |
* Plugin URI: https://wp-statistics.com/
|
5 |
* Description: Complete WordPress Analytics and Statistics for your site!
|
6 |
+
* Version: 12.6
|
7 |
* Author: VeronaLabs
|
8 |
* Author URI: http://veronalabs.com/
|
|
|
9 |
* Text Domain: wp-statistics
|
10 |
* Domain Path: /languages/
|
11 |
*/
|