Version Description
= 13.0 = IMPORTANT NOTE Welcome to WP-Statistics v13.0, our biggest update! Thank you for being part of our community. Weve been working hard for one year to develop this version and make WP-Statistics better for you. Before updating, make sure you disabled all your add-ons, then after that, try to update add-ons.
If you encounter any bug, please create an issue on Github where we can act upon them more efficiently. Since Github is not a support forum, just bugs are welcomed, and any other request will be closed.
Download this release
Release Info
Developer | mostafa.s1990 |
Plugin | WP Statistics |
Version | 13.1.2 |
Comparing to | |
See all releases |
Code changes from version 13.1.1 to 13.1.2
- assets/dev/javascript/meta-box/pages.js +1 -1
- assets/js/admin.min.js +1 -1
- changelog.txt +888 -0
- composer.json +16 -0
- gulpfile.js +89 -0
- includes/admin/TinyMCE/class-wp-statistics-tinymce.php +133 -125
- includes/admin/TinyMCE/locale.php +6 -4
- includes/admin/class-wp-statistics-admin-assets.php +1 -1
- includes/admin/class-wp-statistics-admin-notices.php +2 -2
- includes/admin/meta-box/wp-statistics-meta-box-countries.php +0 -3
- includes/admin/meta-box/wp-statistics-meta-box-exclusions.php +0 -1
- includes/admin/meta-box/wp-statistics-meta-box-post.php +0 -2
- includes/admin/meta-box/wp-statistics-meta-box-top-pages-chart.php +0 -1
- includes/admin/pages/class-wp-statistics-admin-page-optimization.php +4 -4
- includes/admin/pages/class-wp-statistics-admin-page-pages.php +8 -8
- includes/admin/pages/class-wp-statistics-admin-page-plugins.php +7 -3
- includes/admin/templates/add-ons.php +2 -2
- includes/admin/templates/layout/date.range.php +3 -4
- includes/admin/templates/layout/footer.php +1 -2
- includes/admin/templates/layout/header.php +1 -1
- includes/admin/templates/layout/postbox.hide.php +2 -2
- includes/admin/templates/layout/tabs-settings.php +14 -14
- includes/admin/templates/layout/title-after.php +3 -3
- includes/admin/templates/layout/title.php +3 -3
- includes/admin/templates/optimization/database.php +19 -23
- includes/admin/templates/optimization/export.php +22 -22
- includes/admin/templates/optimization/historical.php +37 -37
- includes/admin/templates/optimization/purging.php +81 -81
- includes/admin/templates/optimization/resources.php +133 -133
- includes/admin/templates/optimization/updates.php +24 -24
- includes/admin/templates/pages/online.php +3 -2
- includes/admin/templates/pages/pages.php +2 -4
- includes/admin/templates/plugins.php +7 -7
- includes/admin/templates/settings/about.php +152 -152
- includes/admin/templates/settings/exclusions.php +160 -160
- includes/admin/templates/settings/externals.php +178 -187
- includes/admin/templates/settings/general.php +125 -125
- includes/admin/templates/settings/maintenance.php +49 -49
- includes/admin/templates/settings/notifications.php +162 -162
- includes/admin/templates/settings/overview-display.php +17 -17
- includes/admin/templates/settings/reset.php +13 -13
- includes/admin/templates/settings/visitor-ip.php +118 -118
- includes/admin/templates/settings/wp-cli.php +47 -47
- includes/api/v2/class-wp-statistics-api-hit.php +5 -5
- includes/api/v2/class-wp-statistics-api-meta-box.php +4 -6
- includes/class-wp-statistics-db.php +31 -0
- includes/class-wp-statistics-exclusion.php +2 -2
- includes/class-wp-statistics-frontend.php +2 -2
- includes/class-wp-statistics-geoip.php +5 -6
- includes/class-wp-statistics-hits.php +1 -1
- includes/class-wp-statistics-install.php +22 -11
- includes/class-wp-statistics-pages.php +31 -31
- includes/class-wp-statistics-purge.php +12 -12
- includes/class-wp-statistics-referred.php +12 -12
- includes/class-wp-statistics-schedule.php +7 -7
- includes/class-wp-statistics-widget.php +1 -1
- includes/template-functions.php +41 -41
- package.json +18 -0
- readme.txt +8 -1
- wp-statistics.php +2 -2
assets/dev/javascript/meta-box/pages.js
CHANGED
@@ -2,7 +2,7 @@ wps_js.pages_meta_box = {
|
|
2 |
|
3 |
view: function (args = []) {
|
4 |
let t = '';
|
5 |
-
t += `<table width="100%" class="widefat table-stats wps-report-table"><tbody>
|
6 |
<tr>
|
7 |
<td width='10%'>${wps_js._('id')}</td>
|
8 |
<td width='40%'>${wps_js._('title')}</td>
|
2 |
|
3 |
view: function (args = []) {
|
4 |
let t = '';
|
5 |
+
t += `<table width="100%" class="widefat table-stats wps-report-table wps-table-fixed"><tbody>
|
6 |
<tr>
|
7 |
<td width='10%'>${wps_js._('id')}</td>
|
8 |
<td width='40%'>${wps_js._('title')}</td>
|
assets/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}jQuery(document).ready(function(e){var t;t=function(c){var l={},d={};c.ajaxq=function(e,a){if(void 0===a)throw"AjaxQ: queue name is not provided";var r=c.Deferred(),t=r.promise();t.success=t.done,t.error=t.fail,t.complete=t.always;var o,s="function"==typeof a,n=s?null:c.extend(!0,{},a);return o=function(){var t=c.ajax.apply(window,[s?a():n]);return t.done(function(){r.resolve.apply(this,arguments)}),t.fail(function(){r.reject.apply(this,arguments)}),t.always(i),t},l[e]?l[e].push(o):(l[e]=[],o=o(),d[e]=o),t;function i(){var t;l[e]&&((t=l[e].shift())?(t=t(),d[e]=t):(delete l[e],delete d[e]))}},c.each(["getq","postq"],function(t,s){c[s]=function(t,e,a,r,o){return c.isFunction(a)&&(o=o||r,r=a,a=void 0),c.ajaxq(t,{type:"postq"===s?"post":"get",url:e,data:a,success:r,dataType:o})}});function e(t){return l.hasOwnProperty(t)&&0<l[t].length||d.hasOwnProperty(t)}c.ajaxq.isRunning=function(t){return t?e(t):function(){for(var t in l)if(e(t))return!0;return!1}()},c.ajaxq.getActiveRequest=function(t){if(!t)throw"AjaxQ: queue name is required";return d[t]},c.ajaxq.abort=function(t){if(!t)throw"AjaxQ: queue name is required";var e=c.ajaxq.getActiveRequest(t);delete l[t],delete d[t],e&&e.abort()},c.ajaxq.clear=function(t){if(t)l[t]&&(l[t]=[]);else for(var e in l)l.hasOwnProperty(e)&&(l[e]=[])}},"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=t(require("jquery")):t(jQuery);var a,r,o,s,n,i,c,l,d,p,u,_,h={};function m(t){jQuery(".wp-statistics-settings ul.tabs li").removeClass("current"),jQuery(".wp-statistics-settings .tab-content").removeClass("current"),jQuery("[data-tab="+t+"]").addClass("current"),jQuery("#"+t).addClass("current"),jQuery("#wp-statistics-settings-form").length&&(t=jQuery(location).attr("href")+"&tab="+t,jQuery("#wp-statistics-settings-form").attr("action",t).submit())}function g(t,e){jQuery(document).on("change",t,function(t){t.preventDefault();t=jQuery(e);this.checked?t.show("slow"):(t.hide("slow"),t.find("input[type=checkbox]").prop("checked",!1))})}h.global="undefined"!=typeof wps_global?wps_global:[],h._=function(t){return t in this.global.i18n?this.global.i18n[t]:""},h.is_active=function(t){return 1===h.global.options[t]},h.ajax_queue={key:"wp-statistics",time:400},h.ajaxQ=function(r,o,e,s){var t=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"GET",n=!(5<arguments.length&&void 0!==arguments[5])||arguments[5],t={url:r=!1===r||"metabox"===r?h.global.meta_box_api:r,type:t,dataType:"json",crossDomain:!0,cache:!1,data:o,success:function(t){r===h.global.meta_box_api&&!0===n?t.no_data?jQuery(h.meta_box_inner(o.name)).empty().html(h.no_meta_box_data()):(jQuery(h.meta_box_inner(o.name)).empty().html(h[e].view(t)),h[e].meta_box_init&&setTimeout(function(){h[e].meta_box_init(t)},150)):h[e](t)},error:function(t,e,a){r===h.global.meta_box_api&&!0===n?jQuery(h.meta_box_inner(o.name)).empty().html(h[s](t.responseText)):h[s](t.responseText)}};r===h.global.meta_box_api&&(t.beforeSend=function(t){t.setRequestHeader("X-WP-Nonce",h.global.rest_api_nonce),t.setRequestHeader("Access-Control-Allow-Origin","*")}),jQuery.ajaxq(h.ajax_queue.key,t)},h.placeholder=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return'<div class="wps-ph-item"><div class="wps-ph-col-12">'.concat(h.placeholder_content("picture"),"").concat(h.placeholder_content("line"),"</div>")+(!1!==t?t:"")+"</div>"},h.line_placeholder=function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e='<div class="wps-ph-item">',a=0;a<t;a++)e+='<div class="wps-ph-col-12"> <div class="wps-ph-row"><div class="wps-ph-col-6 big"></div><div class="wps-ph-col-4 empty big"></div><div class="wps-ph-col-4"></div><div class="wps-ph-col-8 empty"></div><div class="wps-ph-col-6"></div><div class="wps-ph-col-6 empty"></div><div class="wps-ph-col-12"></div> </div></div>';return e+="</div>"},h.circle_placeholder=function(){return'<div class="wps-ph-item"> '.concat(h.placeholder_content("circle"),"</div>")},h.rectangle_placeholder=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return'<div class="wps-ph-item'+(0<t.length?" "+t:"")+'"><div class="wps-ph-col-12">'.concat(h.placeholder_content("picture"),"</div></div>")},h.placeholder_content=function(){var t="";switch(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"line"){case"picture":t='<div class="wps-ph-picture"></div>';break;case"line":t='<div class="wps-ph-row"><div class="wps-ph-col-6 big"></div><div class="wps-ph-col-4 empty big"></div><div class="wps-ph-col-2 big"></div><div class="wps-ph-col-4"></div><div class="wps-ph-col-8 empty"></div><div class="wps-ph-col-6"></div><div class="wps-ph-col-6 empty"></div><div class="wps-ph-col-12"></div> </div>';break;case"circle":t='<div class="wps-ph-col-2"></div><div class="wps-ph-col-8"><div class="wps-ph-avatar"></div></div>'}return t},h.exist_tag=function(t){return jQuery(t).length},h.date_picker=function(){jQuery.fn.datepicker&&"undefined"!=typeof wps_i18n_jquery_datepicker&&jQuery("input[data-wps-date-picker]").datepicker({monthNames:wps_i18n_jquery_datepicker.monthNames,monthNamesShort:wps_i18n_jquery_datepicker.monthNamesShort,dayNames:wps_i18n_jquery_datepicker.dayNames,dayNamesShort:wps_i18n_jquery_datepicker.dayNamesShort,dayNamesMin:wps_i18n_jquery_datepicker.dayNamesMin,dateFormat:wps_i18n_jquery_datepicker.dateFormat,firstDay:wps_i18n_jquery_datepicker.firstDay,isRTL:wps_i18n_jquery_datepicker.isRTL,onSelect:function(t){var e=jQuery(this).attr("data-wps-date-picker");0<t.length&&jQuery("input[id=date-"+e+"]").val(t)}})},h.select2=function(){jQuery("select[data-type-show=select2]").select2()},h.redirect=function(t){window.location.replace(t)},h.line_chart=function(t,e,a,r){t=document.getElementById(t).getContext("2d");h.is_active("rtl")&&(Chart.defaults.global={defaultFontFamily:"Tahoma"}),new Chart(t,{type:"line",data:{labels:a,datasets:r},options:{responsive:!0,legend:{position:"bottom"},animation:{duration:1500},title:{display:!0,text:e},tooltips:{mode:"index",intersect:!1},scales:{yAxes:[{ticks:{beginAtZero:!0}}]}}})},h.pie_chart=function(t,e,a){var r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],t=document.getElementById(t).getContext("2d");h.is_active("rtl")&&(Chart.defaults.global={defaultFontFamily:"Tahoma"}),!1===r&&(r=function(t,e){var a=e.datasets[t.datasetIndex],r=a.data.reduce(function(t,e,a,r){return t+e}),a=a.data[t.index];return Math.floor(a/r*100+.5)+"% - "+e.labels[t.index]}),new Chart(t,{type:"pie",data:{labels:e,datasets:a},options:{responsive:!0,legend:{position:"bottom"},animation:{duration:1500},tooltips:{callbacks:{label:r}}},plugins:[{afterDraw:function(t){var e,a,r;!0===t.data.datasets[0].data.every(function(t){return 0==t})&&(e=t.chart.ctx,a=t.chart.width,r=t.chart.height,t.clear(),e.save(),e.textAlign="center",e.textBaseline="middle",e.font="14px normal 'Tahoma'",e.fillText(h._("no_data"),a/2,r/2),e.restore())}}]})},h.chart_id=function(t){return"wp-statistics-"+t+"-meta-box-chart"},h.random_color=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=[[243,156,18,"#f39c12"],[52,152,219,"#3498db"],[192,57,43,"#c0392b"],[155,89,182,"#9b59b6"],[39,174,96,"#27ae60"],[230,126,34,"#e67e22"],[142,68,173,"#8e44ad"],[46,204,113,"#2ecc71"],[41,128,185,"#2980b9"],[22,160,133,"#16a085"],[211,84,0,"#d35400"],[44,62,80,"#2c3e50"],[241,196,15,"#f1c40f"],[231,76,60,"#e74c3c"],[26,188,156,"#1abc9c"],[46,204,113,"#2ecc71"],[52,152,219,"#3498db"],[155,89,182,"#9b59b6"],[52,73,94,"#34495e"],[22,160,133,"#16a085"],[39,174,96,"#27ae60"],[44,62,80,"#2c3e50"],[241,196,15,"#f1c40f"],[230,126,34,"#e67e22"],[231,76,60,"#e74c3c"],[236,240,241,"#9b9e9f"],[149,165,166,"#a65d20"]];return e[!1===t?Math.floor(Math.random()*e.length):t]},h.site_icon=function(t){return'<img src="https://www.google.com/s2/favicons?domain='.concat(t,'" width="16" height="16" alt="').concat(t,'" style="vertical-align: -3px;" />')},h.wordpress_postbox_ajax=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"enable",e=jQuery(".postbox .hndle, .postbox .handlediv");"enable"===t?e.on("click",window.postboxes.handle_click):e.off("click",window.postboxes.handle_click)},h.isset=function(t){for(var e=Array.prototype.slice.call(arguments,1),a=0;a<e.length;a++){if(!t||!t.hasOwnProperty(e[a]))return!1;t=t[e[a]]}return!0},h.number_format=function(t,e,a,r){if(null==t||!isFinite(t))throw new TypeError("number is not valid");var o;e||(e=1<(o=t.toString().split(".").length)?o:0),a=a||".",r=r||",";e=(t=(t=parseFloat(t).toFixed(e)).replace(".",a)).split(a);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,r),t=e.join(a)},h.set_equal_height=function(t,e){var a=jQuery(t).height(),r=jQuery(e).height(),o=e,e=a;a<r&&(o=t,e=r),jQuery(o).css("height",e+"px")},h.Create_Half_PostBox=function(t,e){return'<div class="postbox-container wps-postbox-half '.concat(t,'"><div class="metabox-holder"><div class="meta-box-sortables"> <div class="postbox" id="').concat(e,'"> <div class="inside"></div></div></div></div></div>')},h.isIP=function(t){var e="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";return new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"$")).test(t)},h.getLinkParams=function(t){t=(1<arguments.length&&void 0!==arguments[1]&&arguments[1]||window.location.href).match(new RegExp("(?:[?&]"+t+"=)([^&]+)"));return t?t[1]:null},h.sum=function(t){return t.reduce(function(t,e){return t+e},0)},h.sanitize_meta_box_name=function(t){return t.replace(new RegExp("-","g"),"_")},h.get_meta_box_method=function(t){return this.sanitize_meta_box_name(t)+"_meta_box"},h.getMetaBoxKey=function(t){return"wp-statistics-"+t+"-widget"},h.no_meta_box_data=function(){return h._("no_data")},h.error_meta_box_data=function(t){t=JSON.parse(t);return h.isset(t,"message")?t.message:h._("rest_connect")},h.get_meta_box_info=function(t){return t in h.global.meta_boxes?h.global.meta_boxes[t]:[]},h.meta_box_lang=function(t,e){return e in h.global.meta_boxes[t].lang?h.global.meta_boxes[t].lang[e]:""},h.meta_box_inner=function(t){return"#"+h.getMetaBoxKey(t)+" div.inside"},h.meta_box_name_by_id=function(t){return t.split("statistics-").pop().split("-widget")[0]},h.meta_box_button=function(t){var e="#"+h.getMetaBoxKey(t)+" .handle-actions button:first",a=h.get_meta_box_info(t),r="z-index: 9999;position: absolute;top: 1px;",o="right";h.is_active("rtl")&&(o="left"),jQuery("#"+h.getMetaBoxKey(t)+" button[class*=wps-refresh], #"+h.getMetaBoxKey(t)+" button[class*=wps-more]").remove(),h.is_active("more_btn")&&h.isset(a,"page_url")&&jQuery('<button class="handlediv wps-more"'+(h.is_active("gutenberg")?' style="'.concat(r).concat(o,': 3%;" '):'style="line-height: 28px;"')+' type="button" onclick="location.href = \''+h.global.admin_url+"admin.php?page="+a.page_url+'\';"><span class="screen-reader-text">'+h._("more_detail")+'</span> <span class="dashicons dashicons-external"></span></button>').insertBefore(e),h.is_active("more_btn")&&h.isset(a,"page_url")?jQuery('<button class="handlediv wps-refresh"'+(h.is_active("gutenberg")?' style="'.concat(r).concat(o,': 6%;" '):'style="line-height: 28px;"')+' type="button"><span class="screen-reader-text">'+h._("reload")+'</span> <span class="dashicons dashicons-update"></span> </button>').insertAfter("#"+h.getMetaBoxKey(t)+" button[class*=wps-more]"):jQuery('<button class="handlediv wps-refresh"'+(h.is_active("gutenberg")?' style="'.concat(r).concat(o,': 3%;" '):'style="line-height: 28px;"')+' type="button"><span class="screen-reader-text">'+h._("reload")+'</span> <span class="dashicons dashicons-update"></span> </button>').insertBefore(e)},h.run_meta_box=function(t){var e,a,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];h.exist_tag("#"+h.getMetaBoxKey(t))&&(h.is_active("gutenberg")||!h.is_active("gutenberg")&&jQuery("#"+h.getMetaBoxKey(t)).is(":visible"))&&(e=jQuery(h.meta_box_inner(t)),(a=h.get_meta_box_method(t))in h&&("placeholder"in h[a]?e.html(h[a].placeholder()):e.html(h.placeholder()),!0===o&&h.meta_box_button(t),!(t={name:t})!==r&&(t=Object.assign(r,t)),"params"in h[a]&&(t=Object.assign(t,h[a].params())),h.ajaxQ("metabox",t,a,"error_meta_box_data")))},h.run_meta_boxes=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];(t=!1===t?Object.keys(h.global.meta_boxes):t).forEach(function(t){h.run_meta_box(t)})},jQuery(document).on("mouseenter mouseleave",".wps-refresh, .wps-more",function(t){"mouseenter"===t.type?h.wordpress_postbox_ajax("disable"):h.wordpress_postbox_ajax("enable")}),jQuery(document).on("click",".wps-refresh",function(t){t.preventDefault();t=jQuery(this).closest(".postbox").attr("id"),t=h.meta_box_name_by_id(t);h.run_meta_box(t)}),jQuery(document).on("click",'input[type=checkbox][id^="wp-statistics-"][id$="-widget-hide"]',function(){var t;jQuery(this).is(":checked")&&(t=jQuery(this).attr("id"),t=h.meta_box_name_by_id(t),h.run_meta_box(t))}),h.btn_group_chart=function(e){var a,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r={7:h._("str_week"),30:h._("str_month"),365:h._("str_year")};"ago"==t.type&&(a=parseInt(t.days));var o='<div class="wps-btn-group"><div class="btn-group" role="group">';return Object.keys(r).forEach(function(t){o+='<button type="button" class="btn '+(t==a?"btn-primary":"btn-default")+'" data-chart-time="'.concat(e,'" data-time="').concat(t,'">').concat(r[t],"</button>")}),o+='<button type="button" class="btn '+("between"==t.type?"btn-primary":"btn-default")+'" data-custom-date-picker="'.concat(e,'">').concat(h._("custom"),"</button>"),o+="</div></div>",o+='<div data-chart-date-picker="'.concat(e,'"')+("ago"==t.type?' style="display:none;"':"")+'><input type="text" size="18" name="date-from" data-wps-date-picker="from" value="'.concat(t.from,'" placeholder="YYYY-MM-DD" autocomplete="off">')+h._("to")+'<input type="text" size="18" name="date-to" data-wps-date-picker="to" value="'.concat(t.to,'" placeholder="YYYY-MM-DD" autocomplete="off"><input type="submit" value="')+h._("go")+'" data-between-chart-show="'.concat(e,'" class="button-primary"><input type="hidden" name="" id="date-from" value="').concat(t.from,'"><input type="hidden" name="" id="date-to" value="').concat(t.to,'"></div>')},jQuery(document).on("click",".wps-btn-group button",function(){jQuery(".wps-btn-group button").attr("class","btn btn-default"),jQuery(this).attr("class","btn btn-primary")}),jQuery(document).on("click","button[data-custom-date-picker]",function(){jQuery("div[data-chart-date-picker= "+jQuery(this).attr("data-custom-date-picker")+"]").slideDown()}),jQuery(document).on("click","button[data-chart-time]",function(){h.run_meta_box(jQuery(this).attr("data-chart-time"),{ago:jQuery(this).attr("data-time"),"no-data":"no"})}),jQuery(document).on("click","input[data-between-chart-show]",function(){var t=jQuery(this).attr("data-between-chart-show");h.run_meta_box(t,{from:jQuery("div[data-chart-date-picker="+t+"] input[id=date-from]").val(),to:jQuery("div[data-chart-date-picker="+t+"] input[id=date-to]").val(),"no-data":"no"})}),h.browsers_meta_box={placeholder:function(){return h.circle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return h.is_active("overview_page")&&(e+=h.btn_group_chart("browsers",t),setTimeout(function(){h.date_picker()},1e3)),e+='<canvas id="'+h.chart_id("browsers")+'" height="220"></canvas>'},meta_box_init:function(){for(var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a=[],r=0;r<=10;r++)t=h.random_color(r),a.push("rgba("+t[0]+","+t[1]+","+t[2]+",0.4)");var o=[{label:h._("browsers"),data:e.browsers_value,backgroundColor:a}];if(h.pie_chart(h.chart_id("browsers"),e.browsers_name,o),h.exist_tag("#"+h.getMetaBoxKey("browsers-table"))){["browsers-table","browsers"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").removeAttr("style")});for(var s='<div class="title-center">'.concat(e.title,'</div><table width="100%" class="widefat table-stats"><tr><td class="wps-text-danger">').concat(h._("browser"),'</td><td class="wps-text-danger">').concat(h._("visitor_count"),'</td><td class="wps-text-danger">').concat(h._("percentage"),"</td></tr>"),n=0;n<e.browsers_name.length;n++)s+=" <tr><td>".concat(e.browsers_name[n],"</td><td>").concat(0<parseInt(e.browsers_value[n])?"".concat("other"!==e.info.agent[n]?'<a href="'+e.info.visitor_page+"&agent="+e.info.agent[n]+"&from="+e.from+"&to="+e.to+'" target="_blank">':""," ").concat(h.number_format(e.browsers_value[n])," ").concat("other"!==e.info.agent[n]?"</a>":""):e.browsers_value[n],"</td><td>").concat(h.number_format(e.browsers_value[n]/e.total*100),"%</td> </tr>");s+=" <tr><td>".concat(h._("total"),"</td><td>").concat(h.number_format(e.total),"</td><td></td></tr>"),s+="</table>",jQuery("#"+h.getMetaBoxKey("browsers-table")+" .inside").html(s),h.set_equal_height(".postBox-table .inside",".postBox-chart .inside");for(var i="",c=0;c<e.browsers_name.length;c++)0<parseInt(e.browsers_value[c])&&e.info.agent[c]&&(i+='<div class="wps-title-group"><img src="'.concat(e.info.logo[c],'" alt="').concat(e.browsers_name[c],'" style="vertical-align: -3px;"> ').concat(e.browsers_name[c],'</div><div class="wp-clearfix"></div>'),i+=h.Create_Half_PostBox("postBox-chart-"+e.info.agent[c],"browser-"+e.info.agent[c]+"-chart"),i+=h.Create_Half_PostBox("postBox-table-"+e.info.agent[c],"browser-"+e.info.agent[c]+"-table"),i+='<div class="wp-clearfix"></div>');jQuery(i).insertAfter("#browsers-table");for(var l=0;l<e.browsers_name.length;l++)0<parseInt(e.browsers_value[l])&&e.info.agent[l]&&this.run_custom_browser(e.info.agent[l])}},run_custom_browser:function(t){["browser-"+t+"-chart","browser-"+t+"-table"].forEach(function(t){jQuery("#"+t+" .inside").css("height","430px")}),jQuery("#browser-"+t+"-table .inside").html(h.placeholder()),jQuery("#browser-"+t+"-chart .inside").html(h.circle_placeholder()),jQuery(".wps-ph-picture").attr("style","height: 310px;");var e={name:"browsers",browser:t};["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(e[t]=h.global.request_params[t])}),h.ajaxQ(h.global.meta_box_api,e,"show_custom_agent","error_custom_agent","GET",!1)}},h.show_custom_agent=function(n){var i=n.info.agent[0];jQuery("#browser-"+i+"-chart .inside").html('<canvas id="'+h.chart_id("browser-"+i)+'" height="220"></canvas>'),setTimeout(function(){for(var t,e=[],a=0;a<=10;a++)t=h.random_color(a),e.push("rgba("+t[0]+","+t[1]+","+t[2]+",0.4)");var r=[{label:h._("browsers"),data:n.browsers_value,backgroundColor:e}];h.pie_chart(h.chart_id("browser-"+i),n.browsers_name,r),["browser-"+i+"-chart","browser-"+i+"-table"].forEach(function(t){jQuery("#"+t+" .inside").removeAttr("style")});for(var o='<div class="title-center">'.concat(n.title,'</div><table width="100%" class="widefat table-stats"><tr><td class="wps-text-danger">').concat(h._("version_list"),'</td><td class="wps-text-danger">').concat(h._("visitor_count"),'</td><td class="wps-text-danger">').concat(h._("percentage"),"</td></tr>"),s=0;s<n.browsers_name.length;s++)o+=" <tr><td>".concat(n.browsers_name[s],"</td><td>").concat(0<parseInt(n.browsers_value[s])?h.number_format(n.browsers_value[s]):n.browsers_value[s],"</td><td>").concat(h.number_format(n.browsers_value[s]/n.total*100),"%</td></tr>");o+=" <tr><td>".concat(h._("total"),"</td><td>").concat(h.number_format(n.total),"</td><td></td></tr>"),o+="</table>";r="#browser-"+i+"-table .inside";jQuery(r).html(o),h.set_equal_height(r,"#browser-"+i+"-chart .inside")},500)},h.error_custom_agent=function(t){},h.countries_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td width="10%" style=\'text-align: left\'>'.concat(h._("rank"),"</td><td width=\"10%\" style='text-align: left'>").concat(h._("flag"),"</td><td width=\"40%\" style='text-align: left'>").concat(h._("country"),"</td><td width=\"40%\" style='text-align: left'>").concat(h._("visitor_count"),"</td></tr>");var a=1;return t.forEach(function(t){e+="<tr><td style='text-align: left;'>".concat(a,"</td><td style='text-align: left;'><img src=\"").concat(t.flag,'" title="').concat(t.name,'" alt="').concat(t.name,"\"/></td><td style='text-align: left;'>").concat(t.name,"</td><td style='text-align: left;'><a href=\"").concat(t.link,'" title="').concat(t.name,'" target="_blank">').concat(h.number_format(t.number),"</a></td></tr>"),a++}),e+="</tbody></table>"}},h.exclusions_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t=h.is_active("overview_page")?110:210;h.isset(h.global,"request_params","page")&&"exclusions"===h.global.request_params.page&&(t=80);var e="";return e+='<canvas id="'+h.chart_id("exclusions")+'" height="'+t+'"></canvas>'},meta_box_init:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.show_chart(h.chart_id("exclusions"),e),!h.isset(h.global,"request_params","page")||"exclusions"!==h.global.request_params.page||h.exist_tag(t="span[id='number-total-chart-exclusions']")&&(e=h.sum(Object.values(e.total)),jQuery(t).html(h.number_format(e)))},show_chart:function(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],s="",n=[],i=0;Object.keys(o.exclusions).forEach(function(t){var e,a,r=h.sum(Object.values(o.value[t]));0<r&&(e=o.exclusions[t],a=h.random_color(i),n.push({label:e,data:o.value[t],backgroundColor:"rgba("+a[0]+","+a[1]+","+a[2]+",0.3)",borderColor:"rgba("+a[0]+","+a[1]+","+a[2]+",1)",borderWidth:1,fill:!0}),s+="<tr><th>".concat(e,'</th> <th class="th-center"><span style="color: #9a9494 !important;">').concat(h.number_format(r),"</span></th></tr>"),i++)}),h.exist_tag("table[data-table=exclusions]")&&jQuery(s).insertAfter("table[data-table=exclusions] tr:first"),h.line_chart(t,o.title,o.date,n)}},h.hits_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=h.is_active("overview_page")?110:210;h.isset(h.global,"request_params","page")&&"hits"===h.global.request_params.page&&(e=80);var a="";return h.is_active("overview_page")&&(a+=h.btn_group_chart("hits",t),setTimeout(function(){h.date_picker()},1e3)),a+='<canvas id="'+h.chart_id("hits")+'" height="'+e+'"></canvas>'},meta_box_init:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.hits_chart(h.chart_id("hits"),a),h.isset(h.global,"request_params","page")&&"hits"===h.global.request_params.page&&["visits","visitors"].forEach(function(t){var e="span[id^='number-total-chart-"+t+"']";h.exist_tag(e)&&jQuery(e).html(a.total[t])})},hits_chart:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],a=e;"hits-chart"in e&&(a=e["hits-chart"]);e=[];h.is_active("visitors")&&e.push({label:h._("visitors"),data:a.visitors,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgba(255, 99, 132, 1)",borderWidth:1,fill:!0}),h.is_active("visits")&&e.push({label:h._("visits"),data:a.visits,backgroundColor:"rgba(54, 162, 235, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1,fill:!0}),h.line_chart(t,a.title,a.date,e)}},h.hitsmap_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){return'<div id="wp-statistics-visitors-map"></div>'},meta_box_init:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],o=Array();r.hasOwnProperty("country")&&Object.keys(r.country).forEach(function(e){var a="<div class='map-html-marker'><img src='".concat(r.country[e].flag,"' alt=\"").concat(r.country[e].name,"\" title='").concat(r.country[e].name,"' class='log-tools'/> ").concat(r.country[e].name," [").concat(r.total_country[e],"]<hr />");Object.keys(r.visitor[e]).forEach(function(t){a+="<p><img src='".concat(r.visitor[e][t].browser.logo,"' alt=\"").concat(r.visitor[e][t].browser.name,"\" class='log-tools' title='").concat(r.visitor[e][t].browser.name,"'/> ").concat(r.visitor[e][t].ip," ")+("Unknown"!==r.visitor[e][t].city?"- "+r.visitor[e][t].city:"")+"</p>"}),a+="</div>",o[e]=a}),jQuery("#wp-statistics-visitors-map").vectorMap({map:"world_en",backgroundColor:"#fff",borderColor:"#7e7e7e",borderOpacity:.6,color:"#e6e5e2",hoverColor:"#c3403c",colors:r.color,onLabelShow:function(t,e,a){void 0!==o[a]?e.html(o[a]):e.html(e.html()+" [0]<hr />")}})}},h.pages_chart_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){return'<canvas id="'+h.chart_id("pages-chart")+'" height="80"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.show_chart(h.chart_id("pages-chart"),t),h.exist_tag("span[id=number-total-visits]")&&jQuery("span[id=number-total-visits]").html(t.total),h.exist_tag("span[id=number-total-chart-visits]")&&jQuery("span[id=number-total-chart-visits]").html(t.total_dates)},show_chart:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];h.line_chart(t,e.title,e.date,[{label:h._("visits"),data:e.stat,backgroundColor:"rgba(54, 162, 235, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1,fill:!0}])}},h.pages_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td width=\'10%\'>'.concat(h._("id"),"</td><td width='40%'>").concat(h._("title"),"</td><td width='40%'>").concat(h._("link"),"</td><td width='10%'>").concat(h._("visits"),"</td></tr>");var a=1;return t.forEach(function(t){e+="<tr><td style='text-align: left;'>".concat(a,"</td><td style='text-align: left;'><span title='").concat(t.title,"' class='wps-cursor-default wps-text-wrap'>").concat(t.title,"</span></td><td style='text-align: left;'><a href=\"").concat(t.link,'" title="').concat(t.title,'" target="_blank">').concat(t.str_url,'</a></td><td style="text-align: left"><a href="').concat(t.hits_page,'" class="wps-text-danger">').concat(t.number,"</a></td></tr>"),a++}),e+="</tbody></table>"}},h.platforms_meta_box={placeholder:function(){return h.circle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return h.is_active("overview_page")&&(e+=h.btn_group_chart("platforms",t),setTimeout(function(){h.date_picker()},1e3)),e+='<canvas id="'+h.chart_id("platforms")+'" height="220"></canvas>'},meta_box_init:function(){for(var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a=[],r=0;r<=20;r++)t=h.random_color(),a.push("rgba("+t[0]+","+t[1]+","+t[2]+",0.4)");var o=[{label:h._("platform"),data:e.platform_value,backgroundColor:a}];if(h.pie_chart(h.chart_id("platforms"),e.platform_name,o),h.exist_tag("#"+h.getMetaBoxKey("platforms-table"))){["platforms-table","platforms"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").removeAttr("style")});for(var s='<div class="title-center">'.concat(e.title,'</div><table width="100%" class="widefat table-stats"><tr><td class="wps-text-danger">').concat(h._("platform"),'</td><td class="wps-text-danger">').concat(h._("visitor_count"),'</td><td class="wps-text-danger">').concat(h._("percentage"),"</td></tr>"),n=0;n<e.platform_name.length;n++)s+=" <tr><td>".concat(e.platform_name[n],"</td><td>").concat(0<parseInt(e.platform_value[n])?'<a href="'+e.info.visitor_page+"&platform="+e.platform_name[n]+"&from="+e.from+"&to="+e.to+'" target="_blank"> '.concat(h.number_format(e.platform_value[n])," </a>"):h.number_format(e.platform_value[n]),"</td><td>").concat(h.number_format(e.platform_value[n]/e.total*100),"%</td> </tr>");s+=" <tr><td>".concat(h._("total"),"</td><td>").concat(h.number_format(e.total),"</td><td></td></tr>"),s+="</table>",jQuery("#"+h.getMetaBoxKey("platforms-table")+" .inside").html(s),h.set_equal_height(".postBox-table .inside",".postBox-chart .inside")}}},h.post_meta_box={params:function(){return{ID:h.global.page.ID}},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return t.hasOwnProperty("content")?'<div class="wps-center" style="padding: 15px;"> '+t.content+"</div>":'<canvas id="'+h.chart_id("post")+'" height="85"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];t.hasOwnProperty("content")?jQuery("#"+h.getMetaBoxKey("post")+" button[onclick]").remove():this.post_hits_chart(h.chart_id("post"),t)},post_hits_chart:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];h.line_chart(t,e.title,e.date,[{label:e.post_title,data:e.state,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgba(255, 99, 132, 1)",borderWidth:1,fill:!0}])}},h.quickstats_meta_box={view:function(){var t="";return t+='<table width="100%" class="widefat table-stats wps-summary-stats"><tbody>',t+=h.summary_meta_box.summary_statistics(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]),t+="</tbody></table>",t+='<br><hr width="80%"/><br>',t+='<canvas id="'+h.chart_id("quickstats")+'" height="210"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];h.hits_meta_box.hits_chart(h.chart_id("quickstats"),t)}},h.recent_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return e+='<div class="wp-statistics-responsive-table">',e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td>'.concat(h._("browser"),"</td>")+(h.is_active("geo_ip")?"<td>".concat(h._("country"),"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(h._("city"),"</td>"):"")+"<td>".concat(h._("date"),"</td><td>").concat(h._("ip"),"</td><td>").concat(h._("referrer"),"</td></tr>"),t.forEach(function(t){e+='<tr><td style="text-align: left"><a href="'.concat(t.browser.link,'" title="').concat(t.browser.name,'"><img src="').concat(t.browser.logo,'" alt="').concat(t.browser.name,"\" class='log-tools' title='").concat(t.browser.name,"'/></a></td>")+(h.is_active("geo_ip")?'<td style="text-align: left"><img src=\''.concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(t.city,"</td>"):"")+'<td style="text-align: left">'.concat(t.date,'</td><td style="text-align: left">')+(t.hash_ip||"<a href='".concat(t.ip.link,"'>").concat(t.ip.value,"</a>"))+'</td><td style="text-align: left">'.concat(t.referred,"</td></tr>")}),e+="</tbody></table>",e+="</div>"}},h.referring_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td width="80%">'.concat(h._("address"),'</td><td width="20%">').concat(h.meta_box_lang("referring","references"),"</td></tr>"),t.forEach(function(t){e+="<tr><td>"+h.site_icon(t.domain)+" <a href='//".concat(t.domain,"' title='").concat(t.title,'\' target="_blank">').concat(t.domain,"</a><span class='wps-cursor-default wps-referring-widget-ip'")+(2<t.country.length?' title="'.concat(t.country,'"'):"")+">".concat(t.ip,'</span></td><td class="wps-middle-vertical"><a href="').concat(t.page_link,'">').concat(t.number,"</a></td></tr>")}),e+="</tbody></table>"}},h.search_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=h.is_active("overview_page")?110:210;h.isset(h.global,"request_params","page")&&"searches"===h.global.request_params.page&&(e=80);var a="";return h.is_active("overview_page")&&(a+=h.btn_group_chart("search",t),setTimeout(function(){h.date_picker()},1e3)),a+='<canvas id="'+h.chart_id("search")+'" height="'+e+'"></canvas>'},meta_box_init:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],r=[],o=0;Object.keys(a["search-engine"]).forEach(function(t){var e=a["search-engine"][t].name,t=h.random_color(o);r.push({label:e,data:a.stat[e],backgroundColor:"rgba("+t[0]+","+t[1]+","+t[2]+",0.3)",borderColor:"rgba("+t[0]+","+t[1]+","+t[2]+",1)",borderWidth:1,fill:!0}),o++}),1===a.total.active&&r.push({label:h._("total"),data:a.total.stat,backgroundColor:"rgba("+a.total.color+", 0.2)",borderColor:"rgba("+a.total.color+", 1)",borderWidth:1,fill:!0}),h.line_chart(h.chart_id("search"),a.title,a.date,r)}},h.summary_meta_box={summary_statistics:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],o="";return r.user_online&&(o="<tr><th>".concat(h._("online_users"),':</th><th colspan="2" id="th-colspan"><span><a href="').concat(r.user_online.link,'">').concat(r.user_online.value,"</a></span></th></tr>")),(h.is_active("visitors")||h.is_active("visits"))&&function(){o+='<tr><th width="60%"></th>',["visitors","visits"].forEach(function(t){o+='<th class="th-center">'+(h.is_active(t)?h._(t):"")+"</th>"}),o+="</tr>";for(var a=["today","yesterday","week","month","year","total"],t=0;t<a.length;t++)!function(e){o+="<tr><th>".concat(h._(a[e]),": </th>"),["visitors","visits"].forEach(function(t){o+='<th class="th-center">'+(h.is_active(t)?'<a href="'.concat(r[t][a[e]].link,'"><span>').concat(r[t][a[e]].value,"</span></a>"):"")+"</th>"}),o+="</tr>"}(t)}(),o},view:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a="";return a+='<table width="100%" class="widefat table-stats wps-summary-stats"><tbody>',a+=this.summary_statistics(e),h.is_active("visitors")&&(a+='<tr><th colspan="3"><br><hr></th></tr>',a+='<tr><th colspan="3" style="text-align: center;">'.concat(h.meta_box_lang("summary","search_engine"),'</th></tr><tr><th width="60%"></th><th class="th-center">').concat(h._("today"),'</th><th class="th-center">').concat(h._("yesterday"),"</th></tr>"),Object.keys(e["search-engine"]).forEach(function(t){a+='<tr><th><img src="'.concat(e["search-engine"][t].logo,'" alt="').concat(e["search-engine"][t].name,'" class="wps-engine-logo"> ').concat(e["search-engine"][t].name,':</th><th class="th-center"><span>').concat(e["search-engine"][t].today,'</span></th><th class="th-center"><span>').concat(e["search-engine"][t].yesterday,"</span></th></tr>")}),a+="<tr><th>".concat(h._("daily_total"),':</th><td id="th-colspan" class="th-center"><span>').concat(e["search-engine-total"].today,'</span></td><td id="th-colspan" class="th-center"><span>').concat(e["search-engine-total"].yesterday,"</span></td></tr><tr><th>").concat(h._("total"),':</th><th colspan="2" id="th-colspan"><span>').concat(e["search-engine-total"].total,"</span></th></tr>")),a+=' <tr><th colspan="3"><br><hr></th></tr><tr><th colspan="3" style="text-align: center;">'.concat(h.meta_box_lang("summary","current_time_date"),'<span id="time_zone"><a href="').concat(e.timezone["option-link"],'"> ').concat(h.meta_box_lang("summary","adjustment"),'</a></span></th></tr><tr><th colspan="3">').concat(h._("date"),': <code dir="ltr">').concat(e.timezone.date,'</code></th></tr><tr> <th colspan="3">').concat(h._("time"),': <code dir="ltr">').concat(e.timezone.time,"</code></th></tr>"),a+="</tbody></table>"}},h.top_pages_chart_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t="";return setTimeout(function(){h.date_picker()},1e3),t+='<canvas id="'+h.chart_id("top-pages-chart")+'" height="80"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.top_pages_chart(h.chart_id("top-pages-chart"),t)},top_pages_chart:function(t){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],r=[],o=0;Object.keys(a.stat).forEach(function(t){var e=h.random_color(o);r.push({label:t,data:a.stat[t],backgroundColor:"rgba("+e[0]+","+e[1]+","+e[2]+",0.3)",borderColor:"rgba("+e[0]+","+e[1]+","+e[2]+",1)",borderWidth:1,fill:!0}),o++}),h.line_chart(t,a.title,a.date,r)}},h.top_visitors_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<div class="wp-statistics-responsive-table">',e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td>'.concat(h._("rank"),"</td><td>").concat(h._("hits"),"</td>")+(h.is_active("geo_ip")?"<td>".concat(h._("flag"),"</td><td>").concat(h._("country"),"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(h._("city"),"</td>"):"")+"<td>".concat(h._("ip"),"</td><td>").concat(h._("agent"),"</td><td>").concat(h._("platform"),"</td><td>").concat(h._("version"),"</td></tr>");var a=1;return t.forEach(function(t){e+="<tr><td>".concat(a,"</td><td>").concat(t.hits,"</td>")+(h.is_active("geo_ip")?"<td><img src='".concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td><td>").concat(t.country.name,"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(t.city,"</td>"):"")+"<td>"+(t.hash_ip||"<a href='".concat(t.ip.link,"'>").concat(t.ip.value,"</a>"))+"</td><td>".concat(t.agent,"</td><td>").concat(t.platform,"</td><td>").concat(t.version,"</td></tr>"),a++}),e+="</tbody></table>",e+="</div>"}},h.useronline_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return e+='<table class="widefat table-stats wps-report-table wps-table-fixed"><tr>'+(h.is_active("geo_ip")?"<td style='text-align: left;'>".concat(h._("country"),"</td>"):"")+"<td style='text-align: left;'>".concat(h._("ip"),"</td><td width=\"35%\" style='text-align: left;'>").concat(h._("page"),"</td><td style='text-align: left;'>").concat(h._("referrer"),"</td></tr>"),t.forEach(function(t){e+="<tr>"+(h.is_active("geo_ip")?'<td style="text-align: left"><img src=\''.concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td>"):"")+"<td style='text-align: left !important'>"+(t.hash_ip||t.ip.value)+"</td><td style='text-align: left !important;'><span class=\"wps-text-wrap\">"+(2<t.page.link.length?'<a href="'.concat(t.page.link,'" title="').concat(t.page.title,'" target="_blank" class="wps-text-danger">'):"")+t.page.title+(2<t.page.link.length?"</a>":"")+'</span></td><td style="text-align: left !important">'.concat(t.referred,"</td></tr>")}),e+="</table>"}},h.words_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<div class="wp-statistics-responsive-table">',e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td>'.concat(h._("word"),"</td><td>").concat(h._("browser"),"</td>")+(h.is_active("geo_ip")?"<td>".concat(h._("country"),"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(h._("city"),"</td>"):"")+"<td>".concat(h._("date"),"</td><td>").concat(h._("ip"),"</td><td>").concat(h._("referrer"),"</td></tr>");return t.forEach(function(t){e+='<tr><td style="text-align: left"><span title=\''.concat(t.word,"' class='wps-cursor-default wps-text-wrap")+(h.is_active("overview_page")?" wps-200-px":"")+"'>".concat(t.word,'</span></td><td style="text-align: left"><a href="').concat(t.browser.link,'" title="').concat(t.browser.name,'"><img src="').concat(t.browser.logo,'" alt="').concat(t.browser.name,"\" class='log-tools' title='").concat(t.browser.name,"'/></a></td>")+(h.is_active("geo_ip")?'<td style="text-align: left"><img src=\''.concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td>"):"")+(h.is_active("geo_city")?'<td style="text-align: left">'.concat(t.city,"</td>"):"")+'<td style="text-align: left">'.concat(t.date,'</td><td style="text-align: left">')+(t.hash_ip||"<a href='".concat(t.ip.link,"'>").concat(t.ip.value,"</a>"))+'</td><td style="text-align: left">'.concat(t.referred,"</td></tr>"),0}),e+="</tbody></table>",e+="</div>"}},h.isset(h.global,"request_params","page")&&"authors"===h.global.request_params.page&&(a={ago:30,type:"author",ID:0},["from","to","ID"].forEach(function(t){h.isset(h.global,"request_params",t)&&(a[t]=h.global.request_params[t])}),jQuery("span[id^='number-total-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("pages-chart",a,!1)),h.isset(h.global,"request_params","page")&&"browser"===h.global.request_params.page&&(r={},["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(r[t]=h.global.request_params[t])}),["browsers-table","browsers"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").css("height","430px")}),jQuery("#wp-statistics-browsers-table-widget .inside").html(h.placeholder()),jQuery(".wps-ph-picture").attr("style","height: 310px;"),h.run_meta_box("browsers",r,!1)),h.isset(h.global,"request_params","page")&&"categories"===h.global.request_params.page&&(o={ago:30,type:"category",ID:0},["from","to","ID"].forEach(function(t){h.isset(h.global,"request_params",t)&&(o[t]=h.global.request_params[t])}),jQuery("span[id^='number-total-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("pages-chart",o,!1)),h.isset(h.global,"request_params","page")&&"countries"===h.global.request_params.page&&(s={limit:0},["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(s[t]=h.global.request_params[t])}),h.run_meta_box("countries",s,!1)),h.isset(h.global,"request_params","page")&&"exclusions"===h.global.request_params.page&&(n=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},jQuery("span[id^='number-total-chart-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("exclusions",n,!1)),h.isset(h.global,"request_params","page")&&"hits"===h.global.request_params.page&&(n={},n=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},jQuery("span[id^='number-total-chart-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("hits",n,!1)),h.isset(h.global,"request_params","page")&&"overview"===h.global.request_params.page&&h.isset(h.global,"overview","ads")&&h.is_active("overview_ads")&&(i='<div id="wps_overview_ads_postbox" class="postbox"><div class="inside"><div class="close-overview-ads"><span class="dashicons dashicons-dismiss"></span></div><a href="'.concat(h.global.overview.ads.link,'" title="').concat(h.global.overview.ads.title,'" ').concat("yes"==h.global.overview.ads._target?' target="_blank"':"",'><img src="').concat(h.global.overview.ads.image,'" id="wps_overview_ads_image" alt="').concat(h.global.overview.ads.title,'"></a></div></div>'),jQuery(i).insertAfter("#wps-postbox-container-2 #normal-sortables div.postbox:first"),jQuery(document).on("click",".close-overview-ads",function(){jQuery("#wps_overview_ads_postbox").fadeOut("normal"),jQuery.ajax({url:h.global.admin_url+"admin-ajax.php",type:"get",data:{action:"wp_statistics_close_overview_ads",ads_id:""+h.global.overview.ads.ID,wps_nonce:""+h.global.rest_api_nonce},datatype:"json"})}),jQuery("#wps-donate-notice").on("click",".notice-dismiss",function(){jQuery.ajax({url:h.global.admin_url+"admin-ajax.php",type:"get",data:{action:"wp_statistics_close_notice",notice:"donate",wps_nonce:""+h.global.rest_api_nonce},datatype:"json"})}),jQuery("#wps_overview_ads_image").on("error",function(){jQuery("#wps_overview_ads_postbox").remove()})),h.isset(h.global,"request_params","page")&&"pages"===h.global.request_params.page&&(h.isset(h.global,"request_params","ID")&&h.isset(h.global,"request_params","type")?(i=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},i=Object.assign(i,{ID:h.global.request_params.ID,type:h.global.request_params.type}),h.run_meta_box("pages-chart",i,!1),h.exist_tag("form#wp-statistics-select-pages")&&h.select2(),jQuery(document).on("change","select[name=ID]",function(){jQuery("span.submit-form").html(h._("please_wait")),jQuery(this).closest("form").trigger("submit")})):(l={},h.isset(h.global,"request_params","pagination-page")&&(l.paged=h.global.request_params["pagination-page"]),h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?(l.from=h.global.request_params.from,l.to=h.global.request_params.to):l.ago=30,h.run_meta_box("top-pages-chart",l,!1))),h.isset(h.global,"request_params","page")&&"platform"===h.global.request_params.page&&(c={},["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(c[t]=h.global.request_params[t])}),["platforms-table","platforms"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").css("height","430px")}),jQuery("#wp-statistics-platforms-table-widget .inside").html(h.placeholder()),jQuery(".wps-ph-picture").attr("style","height: 310px;"),h.run_meta_box("platforms",c,!1)),h.isset(h.global,"request_params","page")&&"searches"===h.global.request_params.page&&(l=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},h.run_meta_box("search",l,!1)),jQuery(".wp-statistics-settings").length&&((d=function(t){if(t=new RegExp("[?&]"+t+"=([^&#]*)").exec(window.location.href))return t[1]}("tab"))&&m(d),jQuery(".wp-statistics-settings ul.tabs li").click(function(){m(jQuery(this).attr("data-tab"))})),g("input[name=wps_visitors]","tr[data-view=visitors_log_tr]"),g("input[name=wps_referrerspam]","tr.referrerspam_field"),h.isset(h.global,"request_params","page")&&"settings"===h.global.request_params.page&&(jQuery("#wp-statistics-settings-form ul.tabs li").click(function(t){t.preventDefault();t=e(this).attr("data-tab");"undefined"!=typeof localStorage&&localStorage.setItem("wp-statistics-settings-active-tab",t)}),"undefined"==typeof localStorage||!h.isset(h.global,"request_params","save_setting")||"yes"!==h.global.request_params.save_setting||0<(d=localStorage.getItem("wp-statistics-settings-active-tab")).length&&e("#wp-statistics-settings-form ul.tabs li[data-tab="+d+"]").click()),h.isset(h.global,"request_params","page")&&"tags"===h.global.request_params.page&&(p={ago:30,type:"post_tag",ID:0},["from","to","ID"].forEach(function(t){h.isset(h.global,"request_params",t)&&(p[t]=h.global.request_params[t])}),jQuery("span[id^='number-total-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("pages-chart",p,!1)),h.isset(h.global,"request_params","page")&&"visitors"===h.global.request_params.page&&(u=function(t,r){var o='<table class="widefat">',s={browsers:["agent","browsers"],country:["location","location"],platform:["platform","platform"],referrer:["referrer","referrer"],user:["user_id","users"]};Object.keys(s).forEach(function(e){o+="<tr><td>".concat(h._(e),"</td></tr>"),o+='<tr><td><select name="'.concat(s[e][0],'" class="select2 wps-width-100" data-type-show="select2">'),o+="<option value=''>".concat(h._("all"),"</option>");var a=h.getLinkParams(s[e][0]);Object.keys(r[s[e][1]]).forEach(function(t){o+="<option value='".concat(t,"' ").concat(null!=a&&a==t?"selected":"",">").concat(r[s[e][1]][t],"</option>")}),o+="</select></td></tr>"}),o+="<tr><td>".concat(h._("ip"),"</td></tr>"),o+='<tr><td><input name="ip" value="'.concat(null!=h.getLinkParams("ip")?h.getLinkParams("ip"):"",'" class="wps-width-100" placeholder=\'xxx.xxx.xxx.xxx\' autocomplete="off"></td></tr>'),o+="<tr><td>".concat(h._("date"),"</td></tr>");var e="width: calc(50% - 5px);display: inline-block;";o+='<tr><td><div style="'.concat(e,'">').concat(h._("from"),': <input name="date-from" data-wps-date-picker="from" value="').concat(null!=h.getLinkParams("from")?h.getLinkParams("from"):"",'" style="width: calc(100% - 5px);" placeholder="YYYY-MM-DD" autocomplete="off"></div><div style="').concat(e,'">').concat(h._("to"),': <input name="date-to" data-wps-date-picker="to" value="').concat(null!=h.getLinkParams("to")?h.getLinkParams("to"):"",'" style="width: 100%;" placeholder="YYYY-MM-DD" autocomplete="off"></div><input type="hidden" name="from" id="date-from" value="').concat(null!=h.getLinkParams("from")?h.getLinkParams("from"):"",'"><input type="hidden" name="to" id="date-to" value="').concat(null!=h.getLinkParams("to")?h.getLinkParams("to"):"",'"></td></tr>'),o+="<tr><td></td></tr>",o+='<tr><td><input type="submit" value="'.concat(h._("filter"),'" class="button-primary"> <span class="filter-loading"></span></td></tr>'),o+="</table>",jQuery(t).html(o),setTimeout(function(){h.date_picker(),h.select2()},200)},jQuery(document).on("click","div#visitors-filter",function(t){t.preventDefault(),tb_show("","#TB_inline?&width=430&height=668&inlineId=visitors-filter-popup"),setTimeout(function(){var t,e,a="#wps-visitors-filter-form";h.exist_tag(a+" input[type=submit]")||(jQuery(a).html('<div style="height: 50px;"></div>'+h.line_placeholder(5)),t=localStorage.getItem("wp-statistics-visitors-filter")?JSON.parse(localStorage.getItem("wp-statistics-visitors-filter")):{},!h.isset(t,"timestamp")||!h.isset(t,"value")||h.isset(t,"timestamp")&&h.isset(t,"value")&&(new Date).getTime().toString()>parseInt(t.timestamp)?(e={wps_nonce:h.global.rest_api_nonce,action:"wp_statistics_visitors_page_filters"},e=Object.assign(e,h.global.request_params),jQuery.ajax({url:h.global.admin_url+"admin-ajax.php",type:"GET",dataType:"json",data:e,timeout:3e4,success:function(t){localStorage.setItem("wp-statistics-visitors-filter",JSON.stringify({value:t,timestamp:(new Date).getTime()+216e5})),u(a,t)},error:function(t,e,a){jQuery("span.tb-close-icon").click()}})):u(a,t.value))},500)}),_="#wp_statistics_visitors_filter_form",jQuery(document).on("submit",_,function(){var t=jQuery(_+" input[name=date-from]"),e=jQuery(_+" input[name=date-to]");if(0<t.val().length&&e.val().length<1||t.val().length<1&&1<e.val().length)return alert(h._("er_datepicker")),!1;e=jQuery(_+" input[name=ip]").val();if(0<e.length&&!1===h.isIP(e))return alert(h._("er_valid_ip")),!1;jQuery("input[data-wps-date-picker]").prop("disabled",!0);var r={input:["date-from","date-to","ip"],select:["agent","platform","location","referrer","user_id"]};Object.keys(r).forEach(function(a){r[a].forEach(function(e){var t=jQuery(_+" "+a+"[name="+e+"]");t.val().length<1&&(t.prop("disabled",!0),["from","to"].forEach(function(t){e=="date-"+t&&jQuery(_+" input[name="+t+"]").prop("disabled",!0)}))})});e=h.getLinkParams("order");return null!=e&&jQuery(this).append('<input type="hidden" name="order" value="'+e+'" /> '),jQuery("span.filter-loading").html(h._("please_wait")),!0})),h.date_picker(),("index.php"===h.global.page.file||h.is_active("overview_page")||"post-new.php"===h.global.page.file||"post.php"===h.global.page.file&&h.isset(h.global,"page","ID"))&&h.run_meta_boxes()});
|
1 |
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}jQuery(document).ready(function(e){var t;t=function(c){var l={},d={};c.ajaxq=function(e,a){if(void 0===a)throw"AjaxQ: queue name is not provided";var r=c.Deferred(),t=r.promise();t.success=t.done,t.error=t.fail,t.complete=t.always;var o,s="function"==typeof a,n=s?null:c.extend(!0,{},a);return o=function(){var t=c.ajax.apply(window,[s?a():n]);return t.done(function(){r.resolve.apply(this,arguments)}),t.fail(function(){r.reject.apply(this,arguments)}),t.always(i),t},l[e]?l[e].push(o):(l[e]=[],o=o(),d[e]=o),t;function i(){var t;l[e]&&((t=l[e].shift())?(t=t(),d[e]=t):(delete l[e],delete d[e]))}},c.each(["getq","postq"],function(t,s){c[s]=function(t,e,a,r,o){return c.isFunction(a)&&(o=o||r,r=a,a=void 0),c.ajaxq(t,{type:"postq"===s?"post":"get",url:e,data:a,success:r,dataType:o})}});function e(t){return l.hasOwnProperty(t)&&0<l[t].length||d.hasOwnProperty(t)}c.ajaxq.isRunning=function(t){return t?e(t):function(){for(var t in l)if(e(t))return!0;return!1}()},c.ajaxq.getActiveRequest=function(t){if(!t)throw"AjaxQ: queue name is required";return d[t]},c.ajaxq.abort=function(t){if(!t)throw"AjaxQ: queue name is required";var e=c.ajaxq.getActiveRequest(t);delete l[t],delete d[t],e&&e.abort()},c.ajaxq.clear=function(t){if(t)l[t]&&(l[t]=[]);else for(var e in l)l.hasOwnProperty(e)&&(l[e]=[])}},"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=t(require("jquery")):t(jQuery);var a,r,o,s,n,i,c,l,d,p,u,_,h={};function m(t){jQuery(".wp-statistics-settings ul.tabs li").removeClass("current"),jQuery(".wp-statistics-settings .tab-content").removeClass("current"),jQuery("[data-tab="+t+"]").addClass("current"),jQuery("#"+t).addClass("current"),jQuery("#wp-statistics-settings-form").length&&(t=jQuery(location).attr("href")+"&tab="+t,jQuery("#wp-statistics-settings-form").attr("action",t).submit())}function g(t,e){jQuery(document).on("change",t,function(t){t.preventDefault();t=jQuery(e);this.checked?t.show("slow"):(t.hide("slow"),t.find("input[type=checkbox]").prop("checked",!1))})}h.global="undefined"!=typeof wps_global?wps_global:[],h._=function(t){return t in this.global.i18n?this.global.i18n[t]:""},h.is_active=function(t){return 1===h.global.options[t]},h.ajax_queue={key:"wp-statistics",time:400},h.ajaxQ=function(r,o,e,s){var t=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"GET",n=!(5<arguments.length&&void 0!==arguments[5])||arguments[5],t={url:r=!1===r||"metabox"===r?h.global.meta_box_api:r,type:t,dataType:"json",crossDomain:!0,cache:!1,data:o,success:function(t){r===h.global.meta_box_api&&!0===n?t.no_data?jQuery(h.meta_box_inner(o.name)).empty().html(h.no_meta_box_data()):(jQuery(h.meta_box_inner(o.name)).empty().html(h[e].view(t)),h[e].meta_box_init&&setTimeout(function(){h[e].meta_box_init(t)},150)):h[e](t)},error:function(t,e,a){r===h.global.meta_box_api&&!0===n?jQuery(h.meta_box_inner(o.name)).empty().html(h[s](t.responseText)):h[s](t.responseText)}};r===h.global.meta_box_api&&(t.beforeSend=function(t){t.setRequestHeader("X-WP-Nonce",h.global.rest_api_nonce),t.setRequestHeader("Access-Control-Allow-Origin","*")}),jQuery.ajaxq(h.ajax_queue.key,t)},h.placeholder=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return'<div class="wps-ph-item"><div class="wps-ph-col-12">'.concat(h.placeholder_content("picture"),"").concat(h.placeholder_content("line"),"</div>")+(!1!==t?t:"")+"</div>"},h.line_placeholder=function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e='<div class="wps-ph-item">',a=0;a<t;a++)e+='<div class="wps-ph-col-12"> <div class="wps-ph-row"><div class="wps-ph-col-6 big"></div><div class="wps-ph-col-4 empty big"></div><div class="wps-ph-col-4"></div><div class="wps-ph-col-8 empty"></div><div class="wps-ph-col-6"></div><div class="wps-ph-col-6 empty"></div><div class="wps-ph-col-12"></div> </div></div>';return e+="</div>"},h.circle_placeholder=function(){return'<div class="wps-ph-item"> '.concat(h.placeholder_content("circle"),"</div>")},h.rectangle_placeholder=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return'<div class="wps-ph-item'+(0<t.length?" "+t:"")+'"><div class="wps-ph-col-12">'.concat(h.placeholder_content("picture"),"</div></div>")},h.placeholder_content=function(){var t="";switch(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"line"){case"picture":t='<div class="wps-ph-picture"></div>';break;case"line":t='<div class="wps-ph-row"><div class="wps-ph-col-6 big"></div><div class="wps-ph-col-4 empty big"></div><div class="wps-ph-col-2 big"></div><div class="wps-ph-col-4"></div><div class="wps-ph-col-8 empty"></div><div class="wps-ph-col-6"></div><div class="wps-ph-col-6 empty"></div><div class="wps-ph-col-12"></div> </div>';break;case"circle":t='<div class="wps-ph-col-2"></div><div class="wps-ph-col-8"><div class="wps-ph-avatar"></div></div>'}return t},h.exist_tag=function(t){return jQuery(t).length},h.date_picker=function(){jQuery.fn.datepicker&&"undefined"!=typeof wps_i18n_jquery_datepicker&&jQuery("input[data-wps-date-picker]").datepicker({monthNames:wps_i18n_jquery_datepicker.monthNames,monthNamesShort:wps_i18n_jquery_datepicker.monthNamesShort,dayNames:wps_i18n_jquery_datepicker.dayNames,dayNamesShort:wps_i18n_jquery_datepicker.dayNamesShort,dayNamesMin:wps_i18n_jquery_datepicker.dayNamesMin,dateFormat:wps_i18n_jquery_datepicker.dateFormat,firstDay:wps_i18n_jquery_datepicker.firstDay,isRTL:wps_i18n_jquery_datepicker.isRTL,onSelect:function(t){var e=jQuery(this).attr("data-wps-date-picker");0<t.length&&jQuery("input[id=date-"+e+"]").val(t)}})},h.select2=function(){jQuery("select[data-type-show=select2]").select2()},h.redirect=function(t){window.location.replace(t)},h.line_chart=function(t,e,a,r){t=document.getElementById(t).getContext("2d");h.is_active("rtl")&&(Chart.defaults.global={defaultFontFamily:"Tahoma"}),new Chart(t,{type:"line",data:{labels:a,datasets:r},options:{responsive:!0,legend:{position:"bottom"},animation:{duration:1500},title:{display:!0,text:e},tooltips:{mode:"index",intersect:!1},scales:{yAxes:[{ticks:{beginAtZero:!0}}]}}})},h.pie_chart=function(t,e,a){var r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],t=document.getElementById(t).getContext("2d");h.is_active("rtl")&&(Chart.defaults.global={defaultFontFamily:"Tahoma"}),!1===r&&(r=function(t,e){var a=e.datasets[t.datasetIndex],r=a.data.reduce(function(t,e,a,r){return t+e}),a=a.data[t.index];return Math.floor(a/r*100+.5)+"% - "+e.labels[t.index]}),new Chart(t,{type:"pie",data:{labels:e,datasets:a},options:{responsive:!0,legend:{position:"bottom"},animation:{duration:1500},tooltips:{callbacks:{label:r}}},plugins:[{afterDraw:function(t){var e,a,r;!0===t.data.datasets[0].data.every(function(t){return 0==t})&&(e=t.chart.ctx,a=t.chart.width,r=t.chart.height,t.clear(),e.save(),e.textAlign="center",e.textBaseline="middle",e.font="14px normal 'Tahoma'",e.fillText(h._("no_data"),a/2,r/2),e.restore())}}]})},h.chart_id=function(t){return"wp-statistics-"+t+"-meta-box-chart"},h.random_color=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=[[243,156,18,"#f39c12"],[52,152,219,"#3498db"],[192,57,43,"#c0392b"],[155,89,182,"#9b59b6"],[39,174,96,"#27ae60"],[230,126,34,"#e67e22"],[142,68,173,"#8e44ad"],[46,204,113,"#2ecc71"],[41,128,185,"#2980b9"],[22,160,133,"#16a085"],[211,84,0,"#d35400"],[44,62,80,"#2c3e50"],[241,196,15,"#f1c40f"],[231,76,60,"#e74c3c"],[26,188,156,"#1abc9c"],[46,204,113,"#2ecc71"],[52,152,219,"#3498db"],[155,89,182,"#9b59b6"],[52,73,94,"#34495e"],[22,160,133,"#16a085"],[39,174,96,"#27ae60"],[44,62,80,"#2c3e50"],[241,196,15,"#f1c40f"],[230,126,34,"#e67e22"],[231,76,60,"#e74c3c"],[236,240,241,"#9b9e9f"],[149,165,166,"#a65d20"]];return e[!1===t?Math.floor(Math.random()*e.length):t]},h.site_icon=function(t){return'<img src="https://www.google.com/s2/favicons?domain='.concat(t,'" width="16" height="16" alt="').concat(t,'" style="vertical-align: -3px;" />')},h.wordpress_postbox_ajax=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"enable",e=jQuery(".postbox .hndle, .postbox .handlediv");"enable"===t?e.on("click",window.postboxes.handle_click):e.off("click",window.postboxes.handle_click)},h.isset=function(t){for(var e=Array.prototype.slice.call(arguments,1),a=0;a<e.length;a++){if(!t||!t.hasOwnProperty(e[a]))return!1;t=t[e[a]]}return!0},h.number_format=function(t,e,a,r){if(null==t||!isFinite(t))throw new TypeError("number is not valid");var o;e||(e=1<(o=t.toString().split(".").length)?o:0),a=a||".",r=r||",";e=(t=(t=parseFloat(t).toFixed(e)).replace(".",a)).split(a);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,r),t=e.join(a)},h.set_equal_height=function(t,e){var a=jQuery(t).height(),r=jQuery(e).height(),o=e,e=a;a<r&&(o=t,e=r),jQuery(o).css("height",e+"px")},h.Create_Half_PostBox=function(t,e){return'<div class="postbox-container wps-postbox-half '.concat(t,'"><div class="metabox-holder"><div class="meta-box-sortables"> <div class="postbox" id="').concat(e,'"> <div class="inside"></div></div></div></div></div>')},h.isIP=function(t){var e="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";return new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"$")).test(t)},h.getLinkParams=function(t){t=(1<arguments.length&&void 0!==arguments[1]&&arguments[1]||window.location.href).match(new RegExp("(?:[?&]"+t+"=)([^&]+)"));return t?t[1]:null},h.sum=function(t){return t.reduce(function(t,e){return t+e},0)},h.sanitize_meta_box_name=function(t){return t.replace(new RegExp("-","g"),"_")},h.get_meta_box_method=function(t){return this.sanitize_meta_box_name(t)+"_meta_box"},h.getMetaBoxKey=function(t){return"wp-statistics-"+t+"-widget"},h.no_meta_box_data=function(){return h._("no_data")},h.error_meta_box_data=function(t){t=JSON.parse(t);return h.isset(t,"message")?t.message:h._("rest_connect")},h.get_meta_box_info=function(t){return t in h.global.meta_boxes?h.global.meta_boxes[t]:[]},h.meta_box_lang=function(t,e){return e in h.global.meta_boxes[t].lang?h.global.meta_boxes[t].lang[e]:""},h.meta_box_inner=function(t){return"#"+h.getMetaBoxKey(t)+" div.inside"},h.meta_box_name_by_id=function(t){return t.split("statistics-").pop().split("-widget")[0]},h.meta_box_button=function(t){var e="#"+h.getMetaBoxKey(t)+" .handle-actions button:first",a=h.get_meta_box_info(t),r="z-index: 9999;position: absolute;top: 1px;",o="right";h.is_active("rtl")&&(o="left"),jQuery("#"+h.getMetaBoxKey(t)+" button[class*=wps-refresh], #"+h.getMetaBoxKey(t)+" button[class*=wps-more]").remove(),h.is_active("more_btn")&&h.isset(a,"page_url")&&jQuery('<button class="handlediv wps-more"'+(h.is_active("gutenberg")?' style="'.concat(r).concat(o,': 3%;" '):'style="line-height: 28px;"')+' type="button" onclick="location.href = \''+h.global.admin_url+"admin.php?page="+a.page_url+'\';"><span class="screen-reader-text">'+h._("more_detail")+'</span> <span class="dashicons dashicons-external"></span></button>').insertBefore(e),h.is_active("more_btn")&&h.isset(a,"page_url")?jQuery('<button class="handlediv wps-refresh"'+(h.is_active("gutenberg")?' style="'.concat(r).concat(o,': 6%;" '):'style="line-height: 28px;"')+' type="button"><span class="screen-reader-text">'+h._("reload")+'</span> <span class="dashicons dashicons-update"></span> </button>').insertAfter("#"+h.getMetaBoxKey(t)+" button[class*=wps-more]"):jQuery('<button class="handlediv wps-refresh"'+(h.is_active("gutenberg")?' style="'.concat(r).concat(o,': 3%;" '):'style="line-height: 28px;"')+' type="button"><span class="screen-reader-text">'+h._("reload")+'</span> <span class="dashicons dashicons-update"></span> </button>').insertBefore(e)},h.run_meta_box=function(t){var e,a,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];h.exist_tag("#"+h.getMetaBoxKey(t))&&(h.is_active("gutenberg")||!h.is_active("gutenberg")&&jQuery("#"+h.getMetaBoxKey(t)).is(":visible"))&&(e=jQuery(h.meta_box_inner(t)),(a=h.get_meta_box_method(t))in h&&("placeholder"in h[a]?e.html(h[a].placeholder()):e.html(h.placeholder()),!0===o&&h.meta_box_button(t),!(t={name:t})!==r&&(t=Object.assign(r,t)),"params"in h[a]&&(t=Object.assign(t,h[a].params())),h.ajaxQ("metabox",t,a,"error_meta_box_data")))},h.run_meta_boxes=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];(t=!1===t?Object.keys(h.global.meta_boxes):t).forEach(function(t){h.run_meta_box(t)})},jQuery(document).on("mouseenter mouseleave",".wps-refresh, .wps-more",function(t){"mouseenter"===t.type?h.wordpress_postbox_ajax("disable"):h.wordpress_postbox_ajax("enable")}),jQuery(document).on("click",".wps-refresh",function(t){t.preventDefault();t=jQuery(this).closest(".postbox").attr("id"),t=h.meta_box_name_by_id(t);h.run_meta_box(t)}),jQuery(document).on("click",'input[type=checkbox][id^="wp-statistics-"][id$="-widget-hide"]',function(){var t;jQuery(this).is(":checked")&&(t=jQuery(this).attr("id"),t=h.meta_box_name_by_id(t),h.run_meta_box(t))}),h.btn_group_chart=function(e){var a,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r={7:h._("str_week"),30:h._("str_month"),365:h._("str_year")};"ago"==t.type&&(a=parseInt(t.days));var o='<div class="wps-btn-group"><div class="btn-group" role="group">';return Object.keys(r).forEach(function(t){o+='<button type="button" class="btn '+(t==a?"btn-primary":"btn-default")+'" data-chart-time="'.concat(e,'" data-time="').concat(t,'">').concat(r[t],"</button>")}),o+='<button type="button" class="btn '+("between"==t.type?"btn-primary":"btn-default")+'" data-custom-date-picker="'.concat(e,'">').concat(h._("custom"),"</button>"),o+="</div></div>",o+='<div data-chart-date-picker="'.concat(e,'"')+("ago"==t.type?' style="display:none;"':"")+'><input type="text" size="18" name="date-from" data-wps-date-picker="from" value="'.concat(t.from,'" placeholder="YYYY-MM-DD" autocomplete="off">')+h._("to")+'<input type="text" size="18" name="date-to" data-wps-date-picker="to" value="'.concat(t.to,'" placeholder="YYYY-MM-DD" autocomplete="off"><input type="submit" value="')+h._("go")+'" data-between-chart-show="'.concat(e,'" class="button-primary"><input type="hidden" name="" id="date-from" value="').concat(t.from,'"><input type="hidden" name="" id="date-to" value="').concat(t.to,'"></div>')},jQuery(document).on("click",".wps-btn-group button",function(){jQuery(".wps-btn-group button").attr("class","btn btn-default"),jQuery(this).attr("class","btn btn-primary")}),jQuery(document).on("click","button[data-custom-date-picker]",function(){jQuery("div[data-chart-date-picker= "+jQuery(this).attr("data-custom-date-picker")+"]").slideDown()}),jQuery(document).on("click","button[data-chart-time]",function(){h.run_meta_box(jQuery(this).attr("data-chart-time"),{ago:jQuery(this).attr("data-time"),"no-data":"no"})}),jQuery(document).on("click","input[data-between-chart-show]",function(){var t=jQuery(this).attr("data-between-chart-show");h.run_meta_box(t,{from:jQuery("div[data-chart-date-picker="+t+"] input[id=date-from]").val(),to:jQuery("div[data-chart-date-picker="+t+"] input[id=date-to]").val(),"no-data":"no"})}),h.browsers_meta_box={placeholder:function(){return h.circle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return h.is_active("overview_page")&&(e+=h.btn_group_chart("browsers",t),setTimeout(function(){h.date_picker()},1e3)),e+='<canvas id="'+h.chart_id("browsers")+'" height="220"></canvas>'},meta_box_init:function(){for(var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a=[],r=0;r<=10;r++)t=h.random_color(r),a.push("rgba("+t[0]+","+t[1]+","+t[2]+",0.4)");var o=[{label:h._("browsers"),data:e.browsers_value,backgroundColor:a}];if(h.pie_chart(h.chart_id("browsers"),e.browsers_name,o),h.exist_tag("#"+h.getMetaBoxKey("browsers-table"))){["browsers-table","browsers"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").removeAttr("style")});for(var s='<div class="title-center">'.concat(e.title,'</div><table width="100%" class="widefat table-stats"><tr><td class="wps-text-danger">').concat(h._("browser"),'</td><td class="wps-text-danger">').concat(h._("visitor_count"),'</td><td class="wps-text-danger">').concat(h._("percentage"),"</td></tr>"),n=0;n<e.browsers_name.length;n++)s+=" <tr><td>".concat(e.browsers_name[n],"</td><td>").concat(0<parseInt(e.browsers_value[n])?"".concat("other"!==e.info.agent[n]?'<a href="'+e.info.visitor_page+"&agent="+e.info.agent[n]+"&from="+e.from+"&to="+e.to+'" target="_blank">':""," ").concat(h.number_format(e.browsers_value[n])," ").concat("other"!==e.info.agent[n]?"</a>":""):e.browsers_value[n],"</td><td>").concat(h.number_format(e.browsers_value[n]/e.total*100),"%</td> </tr>");s+=" <tr><td>".concat(h._("total"),"</td><td>").concat(h.number_format(e.total),"</td><td></td></tr>"),s+="</table>",jQuery("#"+h.getMetaBoxKey("browsers-table")+" .inside").html(s),h.set_equal_height(".postBox-table .inside",".postBox-chart .inside");for(var i="",c=0;c<e.browsers_name.length;c++)0<parseInt(e.browsers_value[c])&&e.info.agent[c]&&(i+='<div class="wps-title-group"><img src="'.concat(e.info.logo[c],'" alt="').concat(e.browsers_name[c],'" style="vertical-align: -3px;"> ').concat(e.browsers_name[c],'</div><div class="wp-clearfix"></div>'),i+=h.Create_Half_PostBox("postBox-chart-"+e.info.agent[c],"browser-"+e.info.agent[c]+"-chart"),i+=h.Create_Half_PostBox("postBox-table-"+e.info.agent[c],"browser-"+e.info.agent[c]+"-table"),i+='<div class="wp-clearfix"></div>');jQuery(i).insertAfter("#browsers-table");for(var l=0;l<e.browsers_name.length;l++)0<parseInt(e.browsers_value[l])&&e.info.agent[l]&&this.run_custom_browser(e.info.agent[l])}},run_custom_browser:function(t){["browser-"+t+"-chart","browser-"+t+"-table"].forEach(function(t){jQuery("#"+t+" .inside").css("height","430px")}),jQuery("#browser-"+t+"-table .inside").html(h.placeholder()),jQuery("#browser-"+t+"-chart .inside").html(h.circle_placeholder()),jQuery(".wps-ph-picture").attr("style","height: 310px;");var e={name:"browsers",browser:t};["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(e[t]=h.global.request_params[t])}),h.ajaxQ(h.global.meta_box_api,e,"show_custom_agent","error_custom_agent","GET",!1)}},h.show_custom_agent=function(n){var i=n.info.agent[0];jQuery("#browser-"+i+"-chart .inside").html('<canvas id="'+h.chart_id("browser-"+i)+'" height="220"></canvas>'),setTimeout(function(){for(var t,e=[],a=0;a<=10;a++)t=h.random_color(a),e.push("rgba("+t[0]+","+t[1]+","+t[2]+",0.4)");var r=[{label:h._("browsers"),data:n.browsers_value,backgroundColor:e}];h.pie_chart(h.chart_id("browser-"+i),n.browsers_name,r),["browser-"+i+"-chart","browser-"+i+"-table"].forEach(function(t){jQuery("#"+t+" .inside").removeAttr("style")});for(var o='<div class="title-center">'.concat(n.title,'</div><table width="100%" class="widefat table-stats"><tr><td class="wps-text-danger">').concat(h._("version_list"),'</td><td class="wps-text-danger">').concat(h._("visitor_count"),'</td><td class="wps-text-danger">').concat(h._("percentage"),"</td></tr>"),s=0;s<n.browsers_name.length;s++)o+=" <tr><td>".concat(n.browsers_name[s],"</td><td>").concat(0<parseInt(n.browsers_value[s])?h.number_format(n.browsers_value[s]):n.browsers_value[s],"</td><td>").concat(h.number_format(n.browsers_value[s]/n.total*100),"%</td></tr>");o+=" <tr><td>".concat(h._("total"),"</td><td>").concat(h.number_format(n.total),"</td><td></td></tr>"),o+="</table>";r="#browser-"+i+"-table .inside";jQuery(r).html(o),h.set_equal_height(r,"#browser-"+i+"-chart .inside")},500)},h.error_custom_agent=function(t){},h.countries_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td width="10%" style=\'text-align: left\'>'.concat(h._("rank"),"</td><td width=\"10%\" style='text-align: left'>").concat(h._("flag"),"</td><td width=\"40%\" style='text-align: left'>").concat(h._("country"),"</td><td width=\"40%\" style='text-align: left'>").concat(h._("visitor_count"),"</td></tr>");var a=1;return t.forEach(function(t){e+="<tr><td style='text-align: left;'>".concat(a,"</td><td style='text-align: left;'><img src=\"").concat(t.flag,'" title="').concat(t.name,'" alt="').concat(t.name,"\"/></td><td style='text-align: left;'>").concat(t.name,"</td><td style='text-align: left;'><a href=\"").concat(t.link,'" title="').concat(t.name,'" target="_blank">').concat(h.number_format(t.number),"</a></td></tr>"),a++}),e+="</tbody></table>"}},h.exclusions_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t=h.is_active("overview_page")?110:210;h.isset(h.global,"request_params","page")&&"exclusions"===h.global.request_params.page&&(t=80);var e="";return e+='<canvas id="'+h.chart_id("exclusions")+'" height="'+t+'"></canvas>'},meta_box_init:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.show_chart(h.chart_id("exclusions"),e),!h.isset(h.global,"request_params","page")||"exclusions"!==h.global.request_params.page||h.exist_tag(t="span[id='number-total-chart-exclusions']")&&(e=h.sum(Object.values(e.total)),jQuery(t).html(h.number_format(e)))},show_chart:function(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],s="",n=[],i=0;Object.keys(o.exclusions).forEach(function(t){var e,a,r=h.sum(Object.values(o.value[t]));0<r&&(e=o.exclusions[t],a=h.random_color(i),n.push({label:e,data:o.value[t],backgroundColor:"rgba("+a[0]+","+a[1]+","+a[2]+",0.3)",borderColor:"rgba("+a[0]+","+a[1]+","+a[2]+",1)",borderWidth:1,fill:!0}),s+="<tr><th>".concat(e,'</th> <th class="th-center"><span style="color: #9a9494 !important;">').concat(h.number_format(r),"</span></th></tr>"),i++)}),h.exist_tag("table[data-table=exclusions]")&&jQuery(s).insertAfter("table[data-table=exclusions] tr:first"),h.line_chart(t,o.title,o.date,n)}},h.hits_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=h.is_active("overview_page")?110:210;h.isset(h.global,"request_params","page")&&"hits"===h.global.request_params.page&&(e=80);var a="";return h.is_active("overview_page")&&(a+=h.btn_group_chart("hits",t),setTimeout(function(){h.date_picker()},1e3)),a+='<canvas id="'+h.chart_id("hits")+'" height="'+e+'"></canvas>'},meta_box_init:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.hits_chart(h.chart_id("hits"),a),h.isset(h.global,"request_params","page")&&"hits"===h.global.request_params.page&&["visits","visitors"].forEach(function(t){var e="span[id^='number-total-chart-"+t+"']";h.exist_tag(e)&&jQuery(e).html(a.total[t])})},hits_chart:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],a=e;"hits-chart"in e&&(a=e["hits-chart"]);e=[];h.is_active("visitors")&&e.push({label:h._("visitors"),data:a.visitors,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgba(255, 99, 132, 1)",borderWidth:1,fill:!0}),h.is_active("visits")&&e.push({label:h._("visits"),data:a.visits,backgroundColor:"rgba(54, 162, 235, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1,fill:!0}),h.line_chart(t,a.title,a.date,e)}},h.hitsmap_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){return'<div id="wp-statistics-visitors-map"></div>'},meta_box_init:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],o=Array();r.hasOwnProperty("country")&&Object.keys(r.country).forEach(function(e){var a="<div class='map-html-marker'><img src='".concat(r.country[e].flag,"' alt=\"").concat(r.country[e].name,"\" title='").concat(r.country[e].name,"' class='log-tools'/> ").concat(r.country[e].name," [").concat(r.total_country[e],"]<hr />");Object.keys(r.visitor[e]).forEach(function(t){a+="<p><img src='".concat(r.visitor[e][t].browser.logo,"' alt=\"").concat(r.visitor[e][t].browser.name,"\" class='log-tools' title='").concat(r.visitor[e][t].browser.name,"'/> ").concat(r.visitor[e][t].ip," ")+("Unknown"!==r.visitor[e][t].city?"- "+r.visitor[e][t].city:"")+"</p>"}),a+="</div>",o[e]=a}),jQuery("#wp-statistics-visitors-map").vectorMap({map:"world_en",backgroundColor:"#fff",borderColor:"#7e7e7e",borderOpacity:.6,color:"#e6e5e2",hoverColor:"#c3403c",colors:r.color,onLabelShow:function(t,e,a){void 0!==o[a]?e.html(o[a]):e.html(e.html()+" [0]<hr />")}})}},h.pages_chart_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){return'<canvas id="'+h.chart_id("pages-chart")+'" height="80"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.show_chart(h.chart_id("pages-chart"),t),h.exist_tag("span[id=number-total-visits]")&&jQuery("span[id=number-total-visits]").html(t.total),h.exist_tag("span[id=number-total-chart-visits]")&&jQuery("span[id=number-total-chart-visits]").html(t.total_dates)},show_chart:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];h.line_chart(t,e.title,e.date,[{label:h._("visits"),data:e.stat,backgroundColor:"rgba(54, 162, 235, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1,fill:!0}])}},h.pages_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<table width="100%" class="widefat table-stats wps-report-table wps-table-fixed"><tbody><tr><td width=\'10%\'>'.concat(h._("id"),"</td><td width='40%'>").concat(h._("title"),"</td><td width='40%'>").concat(h._("link"),"</td><td width='10%'>").concat(h._("visits"),"</td></tr>");var a=1;return t.forEach(function(t){e+="<tr><td style='text-align: left;'>".concat(a,"</td><td style='text-align: left;'><span title='").concat(t.title,"' class='wps-cursor-default wps-text-wrap'>").concat(t.title,"</span></td><td style='text-align: left;'><a href=\"").concat(t.link,'" title="').concat(t.title,'" target="_blank">').concat(t.str_url,'</a></td><td style="text-align: left"><a href="').concat(t.hits_page,'" class="wps-text-danger">').concat(t.number,"</a></td></tr>"),a++}),e+="</tbody></table>"}},h.platforms_meta_box={placeholder:function(){return h.circle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return h.is_active("overview_page")&&(e+=h.btn_group_chart("platforms",t),setTimeout(function(){h.date_picker()},1e3)),e+='<canvas id="'+h.chart_id("platforms")+'" height="220"></canvas>'},meta_box_init:function(){for(var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a=[],r=0;r<=20;r++)t=h.random_color(),a.push("rgba("+t[0]+","+t[1]+","+t[2]+",0.4)");var o=[{label:h._("platform"),data:e.platform_value,backgroundColor:a}];if(h.pie_chart(h.chart_id("platforms"),e.platform_name,o),h.exist_tag("#"+h.getMetaBoxKey("platforms-table"))){["platforms-table","platforms"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").removeAttr("style")});for(var s='<div class="title-center">'.concat(e.title,'</div><table width="100%" class="widefat table-stats"><tr><td class="wps-text-danger">').concat(h._("platform"),'</td><td class="wps-text-danger">').concat(h._("visitor_count"),'</td><td class="wps-text-danger">').concat(h._("percentage"),"</td></tr>"),n=0;n<e.platform_name.length;n++)s+=" <tr><td>".concat(e.platform_name[n],"</td><td>").concat(0<parseInt(e.platform_value[n])?'<a href="'+e.info.visitor_page+"&platform="+e.platform_name[n]+"&from="+e.from+"&to="+e.to+'" target="_blank"> '.concat(h.number_format(e.platform_value[n])," </a>"):h.number_format(e.platform_value[n]),"</td><td>").concat(h.number_format(e.platform_value[n]/e.total*100),"%</td> </tr>");s+=" <tr><td>".concat(h._("total"),"</td><td>").concat(h.number_format(e.total),"</td><td></td></tr>"),s+="</table>",jQuery("#"+h.getMetaBoxKey("platforms-table")+" .inside").html(s),h.set_equal_height(".postBox-table .inside",".postBox-chart .inside")}}},h.post_meta_box={params:function(){return{ID:h.global.page.ID}},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return t.hasOwnProperty("content")?'<div class="wps-center" style="padding: 15px;"> '+t.content+"</div>":'<canvas id="'+h.chart_id("post")+'" height="85"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];t.hasOwnProperty("content")?jQuery("#"+h.getMetaBoxKey("post")+" button[onclick]").remove():this.post_hits_chart(h.chart_id("post"),t)},post_hits_chart:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];h.line_chart(t,e.title,e.date,[{label:e.post_title,data:e.state,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgba(255, 99, 132, 1)",borderWidth:1,fill:!0}])}},h.quickstats_meta_box={view:function(){var t="";return t+='<table width="100%" class="widefat table-stats wps-summary-stats"><tbody>',t+=h.summary_meta_box.summary_statistics(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]),t+="</tbody></table>",t+='<br><hr width="80%"/><br>',t+='<canvas id="'+h.chart_id("quickstats")+'" height="210"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];h.hits_meta_box.hits_chart(h.chart_id("quickstats"),t)}},h.recent_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return e+='<div class="wp-statistics-responsive-table">',e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td>'.concat(h._("browser"),"</td>")+(h.is_active("geo_ip")?"<td>".concat(h._("country"),"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(h._("city"),"</td>"):"")+"<td>".concat(h._("date"),"</td><td>").concat(h._("ip"),"</td><td>").concat(h._("referrer"),"</td></tr>"),t.forEach(function(t){e+='<tr><td style="text-align: left"><a href="'.concat(t.browser.link,'" title="').concat(t.browser.name,'"><img src="').concat(t.browser.logo,'" alt="').concat(t.browser.name,"\" class='log-tools' title='").concat(t.browser.name,"'/></a></td>")+(h.is_active("geo_ip")?'<td style="text-align: left"><img src=\''.concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(t.city,"</td>"):"")+'<td style="text-align: left">'.concat(t.date,'</td><td style="text-align: left">')+(t.hash_ip||"<a href='".concat(t.ip.link,"'>").concat(t.ip.value,"</a>"))+'</td><td style="text-align: left">'.concat(t.referred,"</td></tr>")}),e+="</tbody></table>",e+="</div>"}},h.referring_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td width="80%">'.concat(h._("address"),'</td><td width="20%">').concat(h.meta_box_lang("referring","references"),"</td></tr>"),t.forEach(function(t){e+="<tr><td>"+h.site_icon(t.domain)+" <a href='//".concat(t.domain,"' title='").concat(t.title,'\' target="_blank">').concat(t.domain,"</a><span class='wps-cursor-default wps-referring-widget-ip'")+(2<t.country.length?' title="'.concat(t.country,'"'):"")+">".concat(t.ip,'</span></td><td class="wps-middle-vertical"><a href="').concat(t.page_link,'">').concat(t.number,"</a></td></tr>")}),e+="</tbody></table>"}},h.search_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=h.is_active("overview_page")?110:210;h.isset(h.global,"request_params","page")&&"searches"===h.global.request_params.page&&(e=80);var a="";return h.is_active("overview_page")&&(a+=h.btn_group_chart("search",t),setTimeout(function(){h.date_picker()},1e3)),a+='<canvas id="'+h.chart_id("search")+'" height="'+e+'"></canvas>'},meta_box_init:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],r=[],o=0;Object.keys(a["search-engine"]).forEach(function(t){var e=a["search-engine"][t].name,t=h.random_color(o);r.push({label:e,data:a.stat[e],backgroundColor:"rgba("+t[0]+","+t[1]+","+t[2]+",0.3)",borderColor:"rgba("+t[0]+","+t[1]+","+t[2]+",1)",borderWidth:1,fill:!0}),o++}),1===a.total.active&&r.push({label:h._("total"),data:a.total.stat,backgroundColor:"rgba("+a.total.color+", 0.2)",borderColor:"rgba("+a.total.color+", 1)",borderWidth:1,fill:!0}),h.line_chart(h.chart_id("search"),a.title,a.date,r)}},h.summary_meta_box={summary_statistics:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],o="";return r.user_online&&(o="<tr><th>".concat(h._("online_users"),':</th><th colspan="2" id="th-colspan"><span><a href="').concat(r.user_online.link,'">').concat(r.user_online.value,"</a></span></th></tr>")),(h.is_active("visitors")||h.is_active("visits"))&&function(){o+='<tr><th width="60%"></th>',["visitors","visits"].forEach(function(t){o+='<th class="th-center">'+(h.is_active(t)?h._(t):"")+"</th>"}),o+="</tr>";for(var a=["today","yesterday","week","month","year","total"],t=0;t<a.length;t++)!function(e){o+="<tr><th>".concat(h._(a[e]),": </th>"),["visitors","visits"].forEach(function(t){o+='<th class="th-center">'+(h.is_active(t)?'<a href="'.concat(r[t][a[e]].link,'"><span>').concat(r[t][a[e]].value,"</span></a>"):"")+"</th>"}),o+="</tr>"}(t)}(),o},view:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a="";return a+='<table width="100%" class="widefat table-stats wps-summary-stats"><tbody>',a+=this.summary_statistics(e),h.is_active("visitors")&&(a+='<tr><th colspan="3"><br><hr></th></tr>',a+='<tr><th colspan="3" style="text-align: center;">'.concat(h.meta_box_lang("summary","search_engine"),'</th></tr><tr><th width="60%"></th><th class="th-center">').concat(h._("today"),'</th><th class="th-center">').concat(h._("yesterday"),"</th></tr>"),Object.keys(e["search-engine"]).forEach(function(t){a+='<tr><th><img src="'.concat(e["search-engine"][t].logo,'" alt="').concat(e["search-engine"][t].name,'" class="wps-engine-logo"> ').concat(e["search-engine"][t].name,':</th><th class="th-center"><span>').concat(e["search-engine"][t].today,'</span></th><th class="th-center"><span>').concat(e["search-engine"][t].yesterday,"</span></th></tr>")}),a+="<tr><th>".concat(h._("daily_total"),':</th><td id="th-colspan" class="th-center"><span>').concat(e["search-engine-total"].today,'</span></td><td id="th-colspan" class="th-center"><span>').concat(e["search-engine-total"].yesterday,"</span></td></tr><tr><th>").concat(h._("total"),':</th><th colspan="2" id="th-colspan"><span>').concat(e["search-engine-total"].total,"</span></th></tr>")),a+=' <tr><th colspan="3"><br><hr></th></tr><tr><th colspan="3" style="text-align: center;">'.concat(h.meta_box_lang("summary","current_time_date"),'<span id="time_zone"><a href="').concat(e.timezone["option-link"],'"> ').concat(h.meta_box_lang("summary","adjustment"),'</a></span></th></tr><tr><th colspan="3">').concat(h._("date"),': <code dir="ltr">').concat(e.timezone.date,'</code></th></tr><tr> <th colspan="3">').concat(h._("time"),': <code dir="ltr">').concat(e.timezone.time,"</code></th></tr>"),a+="</tbody></table>"}},h.top_pages_chart_meta_box={placeholder:function(){return h.rectangle_placeholder()},view:function(){var t="";return setTimeout(function(){h.date_picker()},1e3),t+='<canvas id="'+h.chart_id("top-pages-chart")+'" height="80"></canvas>'},meta_box_init:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.top_pages_chart(h.chart_id("top-pages-chart"),t)},top_pages_chart:function(t){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],r=[],o=0;Object.keys(a.stat).forEach(function(t){var e=h.random_color(o);r.push({label:t,data:a.stat[t],backgroundColor:"rgba("+e[0]+","+e[1]+","+e[2]+",0.3)",borderColor:"rgba("+e[0]+","+e[1]+","+e[2]+",1)",borderWidth:1,fill:!0}),o++}),h.line_chart(t,a.title,a.date,r)}},h.top_visitors_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<div class="wp-statistics-responsive-table">',e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td>'.concat(h._("rank"),"</td><td>").concat(h._("hits"),"</td>")+(h.is_active("geo_ip")?"<td>".concat(h._("flag"),"</td><td>").concat(h._("country"),"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(h._("city"),"</td>"):"")+"<td>".concat(h._("ip"),"</td><td>").concat(h._("agent"),"</td><td>").concat(h._("platform"),"</td><td>").concat(h._("version"),"</td></tr>");var a=1;return t.forEach(function(t){e+="<tr><td>".concat(a,"</td><td>").concat(t.hits,"</td>")+(h.is_active("geo_ip")?"<td><img src='".concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td><td>").concat(t.country.name,"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(t.city,"</td>"):"")+"<td>"+(t.hash_ip||"<a href='".concat(t.ip.link,"'>").concat(t.ip.value,"</a>"))+"</td><td>".concat(t.agent,"</td><td>").concat(t.platform,"</td><td>").concat(t.version,"</td></tr>"),a++}),e+="</tbody></table>",e+="</div>"}},h.useronline_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";return e+='<table class="widefat table-stats wps-report-table wps-table-fixed"><tr>'+(h.is_active("geo_ip")?"<td style='text-align: left;'>".concat(h._("country"),"</td>"):"")+"<td style='text-align: left;'>".concat(h._("ip"),"</td><td width=\"35%\" style='text-align: left;'>").concat(h._("page"),"</td><td style='text-align: left;'>").concat(h._("referrer"),"</td></tr>"),t.forEach(function(t){e+="<tr>"+(h.is_active("geo_ip")?'<td style="text-align: left"><img src=\''.concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td>"):"")+"<td style='text-align: left !important'>"+(t.hash_ip||t.ip.value)+"</td><td style='text-align: left !important;'><span class=\"wps-text-wrap\">"+(2<t.page.link.length?'<a href="'.concat(t.page.link,'" title="').concat(t.page.title,'" target="_blank" class="wps-text-danger">'):"")+t.page.title+(2<t.page.link.length?"</a>":"")+'</span></td><td style="text-align: left !important">'.concat(t.referred,"</td></tr>")}),e+="</table>"}},h.words_meta_box={view:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e="";e+='<div class="wp-statistics-responsive-table">',e+='<table width="100%" class="widefat table-stats wps-report-table"><tbody><tr><td>'.concat(h._("word"),"</td><td>").concat(h._("browser"),"</td>")+(h.is_active("geo_ip")?"<td>".concat(h._("country"),"</td>"):"")+""+(h.is_active("geo_city")?"<td>".concat(h._("city"),"</td>"):"")+"<td>".concat(h._("date"),"</td><td>").concat(h._("ip"),"</td><td>").concat(h._("referrer"),"</td></tr>");return t.forEach(function(t){e+='<tr><td style="text-align: left"><span title=\''.concat(t.word,"' class='wps-cursor-default wps-text-wrap")+(h.is_active("overview_page")?" wps-200-px":"")+"'>".concat(t.word,'</span></td><td style="text-align: left"><a href="').concat(t.browser.link,'" title="').concat(t.browser.name,'"><img src="').concat(t.browser.logo,'" alt="').concat(t.browser.name,"\" class='log-tools' title='").concat(t.browser.name,"'/></a></td>")+(h.is_active("geo_ip")?'<td style="text-align: left"><img src=\''.concat(t.country.flag,"' alt='").concat(t.country.name,"' title='").concat(t.country.name,"' class='log-tools'/></td>"):"")+(h.is_active("geo_city")?'<td style="text-align: left">'.concat(t.city,"</td>"):"")+'<td style="text-align: left">'.concat(t.date,'</td><td style="text-align: left">')+(t.hash_ip||"<a href='".concat(t.ip.link,"'>").concat(t.ip.value,"</a>"))+'</td><td style="text-align: left">'.concat(t.referred,"</td></tr>"),0}),e+="</tbody></table>",e+="</div>"}},h.isset(h.global,"request_params","page")&&"authors"===h.global.request_params.page&&(a={ago:30,type:"author",ID:0},["from","to","ID"].forEach(function(t){h.isset(h.global,"request_params",t)&&(a[t]=h.global.request_params[t])}),jQuery("span[id^='number-total-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("pages-chart",a,!1)),h.isset(h.global,"request_params","page")&&"browser"===h.global.request_params.page&&(r={},["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(r[t]=h.global.request_params[t])}),["browsers-table","browsers"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").css("height","430px")}),jQuery("#wp-statistics-browsers-table-widget .inside").html(h.placeholder()),jQuery(".wps-ph-picture").attr("style","height: 310px;"),h.run_meta_box("browsers",r,!1)),h.isset(h.global,"request_params","page")&&"categories"===h.global.request_params.page&&(o={ago:30,type:"category",ID:0},["from","to","ID"].forEach(function(t){h.isset(h.global,"request_params",t)&&(o[t]=h.global.request_params[t])}),jQuery("span[id^='number-total-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("pages-chart",o,!1)),h.isset(h.global,"request_params","page")&&"countries"===h.global.request_params.page&&(s={limit:0},["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(s[t]=h.global.request_params[t])}),h.run_meta_box("countries",s,!1)),h.isset(h.global,"request_params","page")&&"exclusions"===h.global.request_params.page&&(n=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},jQuery("span[id^='number-total-chart-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("exclusions",n,!1)),h.isset(h.global,"request_params","page")&&"hits"===h.global.request_params.page&&(n={},n=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},jQuery("span[id^='number-total-chart-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("hits",n,!1)),h.isset(h.global,"request_params","page")&&"overview"===h.global.request_params.page&&h.isset(h.global,"overview","ads")&&h.is_active("overview_ads")&&(i='<div id="wps_overview_ads_postbox" class="postbox"><div class="inside"><div class="close-overview-ads"><span class="dashicons dashicons-dismiss"></span></div><a href="'.concat(h.global.overview.ads.link,'" title="').concat(h.global.overview.ads.title,'" ').concat("yes"==h.global.overview.ads._target?' target="_blank"':"",'><img src="').concat(h.global.overview.ads.image,'" id="wps_overview_ads_image" alt="').concat(h.global.overview.ads.title,'"></a></div></div>'),jQuery(i).insertAfter("#wps-postbox-container-2 #normal-sortables div.postbox:first"),jQuery(document).on("click",".close-overview-ads",function(){jQuery("#wps_overview_ads_postbox").fadeOut("normal"),jQuery.ajax({url:h.global.admin_url+"admin-ajax.php",type:"get",data:{action:"wp_statistics_close_overview_ads",ads_id:""+h.global.overview.ads.ID,wps_nonce:""+h.global.rest_api_nonce},datatype:"json"})}),jQuery("#wps-donate-notice").on("click",".notice-dismiss",function(){jQuery.ajax({url:h.global.admin_url+"admin-ajax.php",type:"get",data:{action:"wp_statistics_close_notice",notice:"donate",wps_nonce:""+h.global.rest_api_nonce},datatype:"json"})}),jQuery("#wps_overview_ads_image").on("error",function(){jQuery("#wps_overview_ads_postbox").remove()})),h.isset(h.global,"request_params","page")&&"pages"===h.global.request_params.page&&(h.isset(h.global,"request_params","ID")&&h.isset(h.global,"request_params","type")?(i=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},i=Object.assign(i,{ID:h.global.request_params.ID,type:h.global.request_params.type}),h.run_meta_box("pages-chart",i,!1),h.exist_tag("form#wp-statistics-select-pages")&&h.select2(),jQuery(document).on("change","select[name=ID]",function(){jQuery("span.submit-form").html(h._("please_wait")),jQuery(this).closest("form").trigger("submit")})):(l={},h.isset(h.global,"request_params","pagination-page")&&(l.paged=h.global.request_params["pagination-page"]),h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?(l.from=h.global.request_params.from,l.to=h.global.request_params.to):l.ago=30,h.run_meta_box("top-pages-chart",l,!1))),h.isset(h.global,"request_params","page")&&"platform"===h.global.request_params.page&&(c={},["from","to"].forEach(function(t){h.isset(h.global,"request_params",t)&&(c[t]=h.global.request_params[t])}),["platforms-table","platforms"].forEach(function(t){jQuery("#"+h.getMetaBoxKey(t)+" .inside").css("height","430px")}),jQuery("#wp-statistics-platforms-table-widget .inside").html(h.placeholder()),jQuery(".wps-ph-picture").attr("style","height: 310px;"),h.run_meta_box("platforms",c,!1)),h.isset(h.global,"request_params","page")&&"searches"===h.global.request_params.page&&(l=h.isset(h.global,"request_params","from")&&h.isset(h.global,"request_params","to")?{from:h.global.request_params.from,to:h.global.request_params.to}:{ago:30},h.run_meta_box("search",l,!1)),jQuery(".wp-statistics-settings").length&&((d=function(t){if(t=new RegExp("[?&]"+t+"=([^&#]*)").exec(window.location.href))return t[1]}("tab"))&&m(d),jQuery(".wp-statistics-settings ul.tabs li").click(function(){m(jQuery(this).attr("data-tab"))})),g("input[name=wps_visitors]","tr[data-view=visitors_log_tr]"),g("input[name=wps_referrerspam]","tr.referrerspam_field"),h.isset(h.global,"request_params","page")&&"settings"===h.global.request_params.page&&(jQuery("#wp-statistics-settings-form ul.tabs li").click(function(t){t.preventDefault();t=e(this).attr("data-tab");"undefined"!=typeof localStorage&&localStorage.setItem("wp-statistics-settings-active-tab",t)}),"undefined"==typeof localStorage||!h.isset(h.global,"request_params","save_setting")||"yes"!==h.global.request_params.save_setting||0<(d=localStorage.getItem("wp-statistics-settings-active-tab")).length&&e("#wp-statistics-settings-form ul.tabs li[data-tab="+d+"]").click()),h.isset(h.global,"request_params","page")&&"tags"===h.global.request_params.page&&(p={ago:30,type:"post_tag",ID:0},["from","to","ID"].forEach(function(t){h.isset(h.global,"request_params",t)&&(p[t]=h.global.request_params[t])}),jQuery("span[id^='number-total-']").html(h.rectangle_placeholder("wps-text-placeholder")),h.run_meta_box("pages-chart",p,!1)),h.isset(h.global,"request_params","page")&&"visitors"===h.global.request_params.page&&(u=function(t,r){var o='<table class="widefat">',s={browsers:["agent","browsers"],country:["location","location"],platform:["platform","platform"],referrer:["referrer","referrer"],user:["user_id","users"]};Object.keys(s).forEach(function(e){o+="<tr><td>".concat(h._(e),"</td></tr>"),o+='<tr><td><select name="'.concat(s[e][0],'" class="select2 wps-width-100" data-type-show="select2">'),o+="<option value=''>".concat(h._("all"),"</option>");var a=h.getLinkParams(s[e][0]);Object.keys(r[s[e][1]]).forEach(function(t){o+="<option value='".concat(t,"' ").concat(null!=a&&a==t?"selected":"",">").concat(r[s[e][1]][t],"</option>")}),o+="</select></td></tr>"}),o+="<tr><td>".concat(h._("ip"),"</td></tr>"),o+='<tr><td><input name="ip" value="'.concat(null!=h.getLinkParams("ip")?h.getLinkParams("ip"):"",'" class="wps-width-100" placeholder=\'xxx.xxx.xxx.xxx\' autocomplete="off"></td></tr>'),o+="<tr><td>".concat(h._("date"),"</td></tr>");var e="width: calc(50% - 5px);display: inline-block;";o+='<tr><td><div style="'.concat(e,'">').concat(h._("from"),': <input name="date-from" data-wps-date-picker="from" value="').concat(null!=h.getLinkParams("from")?h.getLinkParams("from"):"",'" style="width: calc(100% - 5px);" placeholder="YYYY-MM-DD" autocomplete="off"></div><div style="').concat(e,'">').concat(h._("to"),': <input name="date-to" data-wps-date-picker="to" value="').concat(null!=h.getLinkParams("to")?h.getLinkParams("to"):"",'" style="width: 100%;" placeholder="YYYY-MM-DD" autocomplete="off"></div><input type="hidden" name="from" id="date-from" value="').concat(null!=h.getLinkParams("from")?h.getLinkParams("from"):"",'"><input type="hidden" name="to" id="date-to" value="').concat(null!=h.getLinkParams("to")?h.getLinkParams("to"):"",'"></td></tr>'),o+="<tr><td></td></tr>",o+='<tr><td><input type="submit" value="'.concat(h._("filter"),'" class="button-primary"> <span class="filter-loading"></span></td></tr>'),o+="</table>",jQuery(t).html(o),setTimeout(function(){h.date_picker(),h.select2()},200)},jQuery(document).on("click","div#visitors-filter",function(t){t.preventDefault(),tb_show("","#TB_inline?&width=430&height=668&inlineId=visitors-filter-popup"),setTimeout(function(){var t,e,a="#wps-visitors-filter-form";h.exist_tag(a+" input[type=submit]")||(jQuery(a).html('<div style="height: 50px;"></div>'+h.line_placeholder(5)),t=localStorage.getItem("wp-statistics-visitors-filter")?JSON.parse(localStorage.getItem("wp-statistics-visitors-filter")):{},!h.isset(t,"timestamp")||!h.isset(t,"value")||h.isset(t,"timestamp")&&h.isset(t,"value")&&(new Date).getTime().toString()>parseInt(t.timestamp)?(e={wps_nonce:h.global.rest_api_nonce,action:"wp_statistics_visitors_page_filters"},e=Object.assign(e,h.global.request_params),jQuery.ajax({url:h.global.admin_url+"admin-ajax.php",type:"GET",dataType:"json",data:e,timeout:3e4,success:function(t){localStorage.setItem("wp-statistics-visitors-filter",JSON.stringify({value:t,timestamp:(new Date).getTime()+216e5})),u(a,t)},error:function(t,e,a){jQuery("span.tb-close-icon").click()}})):u(a,t.value))},500)}),_="#wp_statistics_visitors_filter_form",jQuery(document).on("submit",_,function(){var t=jQuery(_+" input[name=date-from]"),e=jQuery(_+" input[name=date-to]");if(0<t.val().length&&e.val().length<1||t.val().length<1&&1<e.val().length)return alert(h._("er_datepicker")),!1;e=jQuery(_+" input[name=ip]").val();if(0<e.length&&!1===h.isIP(e))return alert(h._("er_valid_ip")),!1;jQuery("input[data-wps-date-picker]").prop("disabled",!0);var r={input:["date-from","date-to","ip"],select:["agent","platform","location","referrer","user_id"]};Object.keys(r).forEach(function(a){r[a].forEach(function(e){var t=jQuery(_+" "+a+"[name="+e+"]");t.val().length<1&&(t.prop("disabled",!0),["from","to"].forEach(function(t){e=="date-"+t&&jQuery(_+" input[name="+t+"]").prop("disabled",!0)}))})});e=h.getLinkParams("order");return null!=e&&jQuery(this).append('<input type="hidden" name="order" value="'+e+'" /> '),jQuery("span.filter-loading").html(h._("please_wait")),!0})),h.date_picker(),("index.php"===h.global.page.file||h.is_active("overview_page")||"post-new.php"===h.global.page.file||"post.php"===h.global.page.file&&h.isset(h.global,"page","ID"))&&h.run_meta_boxes()});
|
changelog.txt
ADDED
@@ -0,0 +1,888 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
== Changelog ==
|
2 |
+
= 10.0 =
|
3 |
+
* Release Date: January 15, 2016
|
4 |
+
* Added: Widgets now support reloading on overview and dashboard screen.
|
5 |
+
* Updated: Overview screen now loads widgets dynamically to reduce memory usage.
|
6 |
+
* Updated: Dashboard widgets now load dynamically.
|
7 |
+
* Updated: Enabling dashboard widgets now no longer require a page load to display the contents.
|
8 |
+
* Updated: Replaced the old eye icon and "more..." link on the right of the title on the overview widgets with a new icon on the right beside the open/close icon.
|
9 |
+
* Fixed: Removed extraneous single quote in SQL statement on referrers page, thanks jhertel.
|
10 |
+
* Fixed: Order of parameters in referrers page when viewing individual referrers was incorrect and resulted in a blank list.
|
11 |
+
* Fixed: UpdatedSQL for last post date detection to order by post_date instead of ID as someone could enter a date in the past for their publish date. Thanks PC1271 for the fix.
|
12 |
+
* Fixed: The referrers widget would only select the first 100k records due to a limit in PHP/MySQL, it will now select all records.
|
13 |
+
* Removed: Widget selection and ordering from the settings page, the "Screen Options" tab can now be used on the enabled/disable widgets and drag and drop will remember their location.
|
14 |
+
* Removed: Overview page memory usage in the optimization page as it is no longer relevant.
|
15 |
+
|
16 |
+
= 9.7 =
|
17 |
+
* Release Date: December 30, 2015
|
18 |
+
* Added: A date range to the referrers page.
|
19 |
+
* Added: A Date range selector to browsers page.
|
20 |
+
* Updated: General SQL cleanups.
|
21 |
+
* Updated: browscap library to 2.1.1.
|
22 |
+
* Updated: GeoIP library to 2.3.3.
|
23 |
+
* Updated: phpUserAgent library to 0.5
|
24 |
+
|
25 |
+
= 9.6.6 =
|
26 |
+
* Release Date: November 1, 2015
|
27 |
+
* Updated: Use timezone corrected dates for date pickers.
|
28 |
+
* Updated the get_ip code to return 127.0.0.1 if no IP address is found (can happen when a user runs WordPress from a command line function, like when setting up a scheduled cron job).
|
29 |
+
* Fixed: Several security related updates, thanks CodeV.
|
30 |
+
|
31 |
+
= 9.6.5 =
|
32 |
+
* Release Date: September 18, 2015
|
33 |
+
* Updated: Updated support libraries, including browscap (2.0.5) and GeoIP (webservices).
|
34 |
+
* Updated: The hits column in the post/pages list no longer requires manage permissions but instead view permission.
|
35 |
+
* Fixed: New browscap.ini format was causing fatal errors in certain circumstances.
|
36 |
+
* Fixed: Missing close tag on the summary widget's users online link.
|
37 |
+
* Fixed: When purging data an incorrect column name was used when updating the historical table.
|
38 |
+
|
39 |
+
= 9.6.4 =
|
40 |
+
* Release Date: September 15, 2015
|
41 |
+
* Updated: Support new browscap.ini file format.
|
42 |
+
|
43 |
+
= 9.6.3 =
|
44 |
+
* Release Date: September 11, 2015
|
45 |
+
* Updated: The database update nag link to the optimization page instead of the settings page.
|
46 |
+
* Updated: Handle the case where the downloads haven't happened yet.
|
47 |
+
* Fixed: In some cases the extenrals tab would show the wrong date for the next scheduled update.
|
48 |
+
* Fixed: In some cases the Piwik and other features may not be enabled even when the checkboxes were selected.
|
49 |
+
* Fixed: If no page id was passed in on the pagestats shortcode the wrong default for page id would be used and no stats would be displayed.
|
50 |
+
|
51 |
+
= 9.6.2 =
|
52 |
+
* Release Date: September 5, 2015
|
53 |
+
* Added: Search table to the empty table list.
|
54 |
+
* Added: Search table size to the optimization page.
|
55 |
+
* Added: Updated SQL calls to the pages table to use $wpdb->prepare() to protect against SQL inject attacks.
|
56 |
+
* Fixed: Check of $wp_roles type as it is an object and not an array which caused only admins to be able to view the statistics.
|
57 |
+
* Fixed: Top referring only displayed search engines.
|
58 |
+
* Updated: Layout of the maintenance tab.
|
59 |
+
|
60 |
+
= 9.6.1 =
|
61 |
+
* Release Date: September 4, 2015
|
62 |
+
* Fixed: Error with undeclared global $WP_Statistics when updating the database.
|
63 |
+
* Added: Re-validation of the current database updates required when loading the optimization page.
|
64 |
+
|
65 |
+
= 9.6 =
|
66 |
+
* Release Date: September 3, 2015
|
67 |
+
* Added: New admin notices for if the database requires updates.
|
68 |
+
* Added: Page/post id field to pagestats shortcode.
|
69 |
+
* Added: Ask.com to search engine list, disabled by default.
|
70 |
+
* Fixed: Display of the dashboard referrers widget.
|
71 |
+
* Fixed: incorrect table name when dropping the old 'AString' field.
|
72 |
+
* Fixed: Error message if the global $wp_roles hadn't been set when we accessed it.
|
73 |
+
* Fixed: When exporting, no data was exported.
|
74 |
+
* Fixed: When excluding countries, multiple entries would not be parsed correctly.
|
75 |
+
* Updated: Purging code now includes the search table.
|
76 |
+
* Updated: Search conversion code to limit the number of records retreived to 10000 and then loop through them to ensure we don't run out of memory during the conversion process.
|
77 |
+
* Updated: Cleaned up the admin notices code.
|
78 |
+
* Updated: Persian translation. Thanks Ali Zeinali.
|
79 |
+
|
80 |
+
= 9.5.3 =
|
81 |
+
* Release Date: August 19, 2015
|
82 |
+
* Added: More robust error reporting if a plugin table is missing.
|
83 |
+
* Added: Support to export the search table.
|
84 |
+
* Fixed: The install script for older versions of MySQL (5.0.x).
|
85 |
+
* Fixed: Export script no longer generates errors when exporting an empty table.
|
86 |
+
* Fixed: WP_Debug error on $crawler when it was an object but didn't have the right properties (aka wasn't the right object).
|
87 |
+
* Fixed: Sidebar widget works again in WordPress 4.3.
|
88 |
+
|
89 |
+
= 9.5.2 =
|
90 |
+
* Release Date: August 8, 2015
|
91 |
+
* Fixed: XSS issue with top-referrers page, thanks Swift Security (http://swiftsecurity.swte.ch/).
|
92 |
+
* Updated: If the GeoIP code is disabled, the warning message was pointing to the old GeoIP tab instead of the new Externals tab.
|
93 |
+
* Updated: French translation.
|
94 |
+
|
95 |
+
= 9.5.1 =
|
96 |
+
* Release Date: August 4, 2015
|
97 |
+
* Fixed: Issue with verifying the WP Statistics tables exist on databases with hyphens in their names.
|
98 |
+
* Updated: Arabic translation.
|
99 |
+
|
100 |
+
= 9.5 =
|
101 |
+
* Release Date: August 3, 2015
|
102 |
+
* Added: Referrer Spam exclusions using the Piwik Referrer Spam Blacklist (see Statistics->Settings->Externals to enable).
|
103 |
+
* Added: Code to remove 'AString' column if it exists in the visitors table during upgrades (bug in a older previous version of WP Statistics erroneously created it).
|
104 |
+
* Fixed: Duplicate key name warning during upgrades for 'date_ip_agent' index.
|
105 |
+
* Fixed: Warning on 'date_ip' index does not exist when trying to drop it during upgrades.
|
106 |
+
* Updated: Storing of search engine/words data is now in it's own table for better performance.
|
107 |
+
* Updated: Combined the GeoIP and browscap tabs in settings in to the Externals tab.
|
108 |
+
* Updated: GeoIP library to V 2.3.1.
|
109 |
+
|
110 |
+
= 9.4.1 =
|
111 |
+
* Release Date: July 9, 2015
|
112 |
+
* Fixed: SQL injection security issue for users with access to the admin pages.
|
113 |
+
* Fixed: Bug in code to save new "Treat corrupt browser info as a bot" setting.
|
114 |
+
* Fixed: Bug in scheduled data pruge code that would not append the correct table prefix.
|
115 |
+
* Updated: Admin manual.
|
116 |
+
|
117 |
+
= 9.4 =
|
118 |
+
* Release Date: July 3, 2015
|
119 |
+
* Added: Date selector to top visitors page.
|
120 |
+
* Added: Option to exclude WordPress's "Not Found" page from the statistics.
|
121 |
+
* Added: Option to treat corrupt http header information as bots (missing IP addresses or user agents).
|
122 |
+
* Added: New robots to list; 007ac9, 5bot, advbot, alphabot, anyevent, blexbot, bubing, cliqzbot, dl2bot, duckduckgo, EveryoneSocialBot, findxbot, glbot, linkapediabot, ltx71, mediabot, medialbot, monobot, OrangeBot, owler, pageanalyzer, porkbun, pr-cy, pwbot, r4bot, revip, riddler, rogerbot, sistrix, SputnikBot, u2bot, uni5download, unrulymedia, wsowner, wsr-agent, x100bot and xzybot
|
123 |
+
* Fixed: Make sure the admin bar only appears for users that have read/manage permissions in WP Statistics.
|
124 |
+
* Updated: Split the access and exclusions tabs in settings.
|
125 |
+
|
126 |
+
= 9.3.1 =
|
127 |
+
* Release Date: May 15, 2015
|
128 |
+
* Fixed: Typo in options name that caused the visitors map to never be displayed.
|
129 |
+
|
130 |
+
= 9.3 =
|
131 |
+
* Release Date: May 15, 2015
|
132 |
+
* Added: Shortcode UI (aka ShortCake) support.
|
133 |
+
* Added: Donation menu and dismissble banner on the overview page.
|
134 |
+
* Added: Applebot, Superfeedr, jetmon, sfFeedReader and feedzirra to the robots list.
|
135 |
+
* Added: Summary postbox on hit statistics page.
|
136 |
+
* Added: Summary postbox on exclusions page.
|
137 |
+
* Added: Date range selector on top countries page.
|
138 |
+
* Added: Purge data based on visitor's hit count on the optimization page.
|
139 |
+
* Added: Option to purge data based on visitor's hit count on a daily basis.
|
140 |
+
* Added: Option to record the page title for search referrals that do not contain a query value.
|
141 |
+
* Updated: Moved all ajax and pseudo ajax calls to use the standard WordPress ajax and init routines instead of using wp-load.php.
|
142 |
+
* Updated: Widgets and pages will only be displayed if the associated statistics is being collected, for example the search engine referrals will only be displayed if the visitor tracking option is enabled.
|
143 |
+
* Fixed: Typo in variable name for one of the dashboard widgets.
|
144 |
+
* Fixed: PHP error when the $browser object wasn't an object when we checked the crawler property.
|
145 |
+
* Fixed: Incorrect parameter for get_option() on two option in the settings page.
|
146 |
+
* Fixed: Widget's didn't translate correctly.
|
147 |
+
|
148 |
+
= 9.2 =
|
149 |
+
* Release Date: April 26, 2015
|
150 |
+
* Added: Date range selector for charts now supports arbitrary date ranges with JavaScript date selector.
|
151 |
+
* Added: If the site is using the blogroll for the homepage, use the blog title as the page name instead of leaving it blank.
|
152 |
+
* Updated: How country codes are loaded for dashboard, widgets and pages.
|
153 |
+
* Fixed: Incorrect URL in the admin manual.
|
154 |
+
* Fixed: WP_DEBUG warning if formatting was not specified in the short code.
|
155 |
+
|
156 |
+
= 9.1.3 =
|
157 |
+
* Release Date: April 14, 2015
|
158 |
+
* Added: Quick link to summary stats.
|
159 |
+
* Added: Escaped text fields in the settings page with htmlentities() to protect against rouge administrators hijacking other admin sessions, thanks Kaustubh.
|
160 |
+
* Fixed: Exclusions page had duplicate quotation marks in some JavaScript fields causing errors.
|
161 |
+
* Fixed: Display of last_counter that is already set to the correct date and doesn't need to be adjusted for timezone.
|
162 |
+
|
163 |
+
= 9.1.2 =
|
164 |
+
* Release Date: March 20, 2015
|
165 |
+
* Fixed: Removed spurious comma in SQL creation script for Visits table, thanks kitchin.
|
166 |
+
|
167 |
+
= 9.1.1 =
|
168 |
+
* Release Date: March 19, 2015
|
169 |
+
* Fixed: Verify the $display settings return an array before using it as an array to avoid warning on overview page.
|
170 |
+
|
171 |
+
= 9.1 =
|
172 |
+
* Release Date: March 18, 2015
|
173 |
+
* Added: Unique index requirement on visits table to avoid race condition creating duplicate entires.
|
174 |
+
* Added: Option to the optimization page to remove duplicates and add new unique index to visits table on existing installs.
|
175 |
+
* Updated: Translations, thanks to all of our translators!
|
176 |
+
* Updated: Cleanup of some WP Debug warnings.
|
177 |
+
* Fixed: JavaScript postboxes call was currupted on some pages causing a javascript error.
|
178 |
+
* Fixed: Change html encode to jason_ecnode for data to be used in javascript to avoid single quotes as part of the translation breaking the javascript array, this change now fixes extended character display in the JavaScript charts.
|
179 |
+
* Fixed: Verify $WP_Statistics is an object before using it, which was causing a fatal error on some installs.
|
180 |
+
* Removed: Redudnent e modifier in preg_replace_callback to avoid php warning message.
|
181 |
+
|
182 |
+
= 9.0 =
|
183 |
+
* Release Date: March 12, 2015
|
184 |
+
* Added: URL exclusions option.
|
185 |
+
* Added: Swedish translation, thanks ronneborn.
|
186 |
+
* Added: Kurdish (Sorani) translation, thanks sardar4it.
|
187 |
+
* Added: Daily wp cron job to create an entry in the visits table for the next day to avoid a race condition.
|
188 |
+
* Updated: The visits code now uses a SQL UPDATE instead of WP's update() to avoid a race condition.
|
189 |
+
* Updated: Performance improvements in the last visitors page.
|
190 |
+
* Updated: Performance improvements in the referrers page.
|
191 |
+
* Updated: Added missing dash_icon call in online users page.
|
192 |
+
* Updated: Make sure the $wp_object global variable is an object before using it, just in case, in the hits code.
|
193 |
+
* Updated: Make sure the $wp_query global variable is an object before using it, just in case, in the hits code.
|
194 |
+
* Updated: Removed variables from i18n functions for better translation support.
|
195 |
+
* Updated: Removed requirement for date_default_timezone_set() which conflicted with some other plugins.
|
196 |
+
* Updated: Make sure to html encode data to be used in javascript to avoid single quotes as part of the translation breaking the javascript array.
|
197 |
+
* Updated: Change summary widget to be clearer about time frames.
|
198 |
+
* Updated: Replace deprecated preg_replace (with /e) with preg_replace_callback. Thanks gbonvehi.
|
199 |
+
* Updated: Use full path to ensure the require_once finds the purge file in the scheduled db maintenance script.
|
200 |
+
* Updated: Persian translation.
|
201 |
+
* Updated: Renamed pagination class to avoid name collisions with other plugins.
|
202 |
+
* Updated: Date display in recent visitors and search words now uses the WordPress date format setting.
|
203 |
+
* Updated: Upgrade email is now send at the end of the page load as wp_mail() hasn't been created during the upgrade script.
|
204 |
+
* Fixed: Export code to handle large tables.
|
205 |
+
* Fixed: Exclusion display for some 'reasons' always being 0.
|
206 |
+
* Removed: Replaced use of global $table_prefix with $wpdb->prefix.
|
207 |
+
* Removed: Use of deprecated $blog_id. Thanks gbonvehi.
|
208 |
+
|
209 |
+
= 8.8.1 =
|
210 |
+
* Release Date: March 9, 2015
|
211 |
+
* Updated license to GPL3.
|
212 |
+
|
213 |
+
= 8.8 =
|
214 |
+
* Release Date: January 31, 2015
|
215 |
+
* Added: Installation/upgrades/removals on WordPress multi-sites now upgrade all sites in the network if the installing user has the appropriate rights.
|
216 |
+
* Added: RSS feed URL's can now be excluded.
|
217 |
+
* Added: Option to set the country code for private IP addresses.
|
218 |
+
* Fixed: Additional WP_DEBUG warning fixes.
|
219 |
+
* Fixed: Incorrect parameter list in get_home_url() when checking for self referrals.
|
220 |
+
* Fixed: Single quotes can now be used in the report content without being escaped.
|
221 |
+
* Fixed: Referrers menu item was misspelled.
|
222 |
+
* Updated: Italian, French, Polish, Arabic, Persian and Chinese translation.
|
223 |
+
* Updated: Widget now formats numbers with international standards.
|
224 |
+
* Updated: Short codes now support three number formatting options; i18n, english or none.
|
225 |
+
* Updated: Removed old throttling code for hits which is no longer required.
|
226 |
+
* Updated: IP address exclusions without a subnet mask now assume a single IP address instead of all IP addresses.
|
227 |
+
|
228 |
+
= 8.7.2 =
|
229 |
+
* Release Date: January 6, 2015
|
230 |
+
* Added: shareaholic-bot to robots list.
|
231 |
+
* Fixed: Robot threshold setting was not being saved.
|
232 |
+
* Updated: Italian translation, thanks illatooscuro.
|
233 |
+
* Updated: Arabic translation, thanks Hammad.
|
234 |
+
* Updated: Honey pot page title now includes "Pot" in it.
|
235 |
+
|
236 |
+
= 8.7.1 =
|
237 |
+
* Release Date: December 28, 2014
|
238 |
+
* Fixed: Variable scope for the exclusion match/reason updated to protected from private to allow the GeoIP code to set them. This could cause various issues including failed uploades depending on the error reporting level set for PHP.
|
239 |
+
|
240 |
+
= 8.7 =
|
241 |
+
* Release Date: December 27, 2014
|
242 |
+
* Added: Charts with multiple lines now include the data set name in the tooltip.
|
243 |
+
* Added: Honey pot option to detect crawlers.
|
244 |
+
* Added: Robot threshold option.
|
245 |
+
* Added: Hit count for visitors is now recorded and displayed.
|
246 |
+
* Added: Top Visitors today widget and page.
|
247 |
+
* Fixed: GeoIP exclusion logic didn't work as the location information was not set before it was applied, moved it to the appropriate location.
|
248 |
+
* Fixed: Incorrect setting names for country include/excludes as well as hosts.
|
249 |
+
* Fixed: Page URI length could exceed the database storage limit and cause duplicate entry warnings, URI is now truncated before being stored.
|
250 |
+
* Updated: Polish and Farsi translations.
|
251 |
+
* Updated: User agent parser to V0.3.2.
|
252 |
+
* Updated: GeoIP library to v2.1.1.
|
253 |
+
|
254 |
+
= 8.6.3 =
|
255 |
+
* Release Date: December 11, 2014
|
256 |
+
* Fixed: Really fix included countries code this time.
|
257 |
+
* Fixed: Typo in excluded hosts code.
|
258 |
+
|
259 |
+
= 8.6.2 =
|
260 |
+
* Release Date: December 11, 2014
|
261 |
+
* Fixed: New included countries code incorrectly identified all countries as excluded.
|
262 |
+
|
263 |
+
= 8.6.1 =
|
264 |
+
* Release Date: December 11, 2014
|
265 |
+
* Added: Code to perform additional clean up of uncommon user agents.
|
266 |
+
* Fixed: Spurious break statement in GeoIP exclusion code which caused a fatal error in certian cases.
|
267 |
+
|
268 |
+
= 8.6 =
|
269 |
+
* Release Date: December 11, 2014
|
270 |
+
* Added: Option to remove URI parameters from page tracking.
|
271 |
+
* Added: GeoIP exclusion options.
|
272 |
+
* Added: Host name exclusion options.
|
273 |
+
* Fixed: Map dashboard widget fails when Google is selected as map provider.
|
274 |
+
* Fixed: Changing the statistical report schedule would not actually change the schedule unless you disabled and then enabled the statistical reports feature.
|
275 |
+
* Updated: French language.
|
276 |
+
|
277 |
+
= 8.5.1 =
|
278 |
+
* Release Date: December 2, 2014
|
279 |
+
* Fixed: Typo in last search page causing fatal error in PHP.
|
280 |
+
|
281 |
+
= 8.5 =
|
282 |
+
* Release Date: December 2, 2014
|
283 |
+
* Added: try/catch condition around browscap call to avoid fatal errors stopping the script.
|
284 |
+
* Added: Page trend widget to post/page editor.
|
285 |
+
* Added: Aland Islands Flag icon.
|
286 |
+
* Added: Option to record all online users regardless if they would otherwise be excluded.
|
287 |
+
* Added: Option to disable the page editor widget.
|
288 |
+
* Fixed: Various security fixes, thanks Ryan.
|
289 |
+
* Fixed: Resolved warnings when natcasesort received a null list, thanks robertalks.
|
290 |
+
* Fixed: Before updating the browscap.ini cache file, remove stale lock files.
|
291 |
+
* Fixed: Avoid throwing a fatal error when the shutdown code is called if for some reason the global $WP_Statistics variable has been destroyed during a page load.
|
292 |
+
* Updated: The online code now uses the same rules to exclude users as the hits code.
|
293 |
+
* Updated: Minor code cleanups and data return checks.
|
294 |
+
* Updated: German translations, thanks bios4.
|
295 |
+
* Updated: Polish and Turkish translations.
|
296 |
+
* Updated: Use built in WordPress function to translate user roles instead of custom strings in our PO file, thanks bios4.
|
297 |
+
|
298 |
+
= 8.4 =
|
299 |
+
* Release Date: November 26, 2014
|
300 |
+
* Added: Dashboard widgets for all of the widgets on the overview page.
|
301 |
+
* Added: Option to disable all dashboard widgets.
|
302 |
+
* Added: Old dashboard widget upgraded with last 10 days of hits statistics.
|
303 |
+
* Added: Online users page and time a user has been online.
|
304 |
+
* Fixed: Fixed missing site_url on top 10 pages in the overview page.
|
305 |
+
* Fixed: Incorrect url generated for Google map if dashboard was being forced in to https mode.
|
306 |
+
* Fixed: Properly un-escape quotation marks in report body if magic quotes is enabled.
|
307 |
+
* Fixed: URL referrer CSS style would 'push' other entires to the next line on small displays.
|
308 |
+
* Fixed: Various PHP warnings on uninitalized variables, thanks bseddon
|
309 |
+
* Updated: Polish translations.
|
310 |
+
* Updated: Default map type now set to JQVMap.
|
311 |
+
|
312 |
+
= 8.3.1 =
|
313 |
+
* Release Date: November 19, 2014
|
314 |
+
* Updated: Various SQL code clean ups.
|
315 |
+
* Updated: Varioud data validation clean ups.
|
316 |
+
* Updated: Various data output encoding updates, thanks Marc.
|
317 |
+
|
318 |
+
= 8.3 =
|
319 |
+
* Release Date: November 14, 2014
|
320 |
+
* Added: Sanity checks for file size and results to browscap.ini updates, if the new cache file size is wrong or it mis-identifies a common real browser as a crawler the update will be rolled back.
|
321 |
+
* Added: Option to e-mail a report on browscap.ini, database pruning, upgrades and GeoIP database updates.
|
322 |
+
* Updated: Polish translations.
|
323 |
+
* Updated: Added "Notificaitons" tab to the settings page and moved statistical report settings to it.
|
324 |
+
* Fixed: The historical data table no longer uses reserved keywords as column names which caused issues on older versions of MySQL.
|
325 |
+
* Fixed: Unable to set visits historical count.
|
326 |
+
* Fixed: Purging did not record visits/visitors correctly if not already set through the optimization page.
|
327 |
+
* Fixed: JavaScript bug when a non-administrative user viewed the settings page.
|
328 |
+
* Removed: Reference to old settings file for the widget.
|
329 |
+
|
330 |
+
= 8.2 =
|
331 |
+
* Release Date: November 6, 2014
|
332 |
+
* Added: Support for historical data.
|
333 |
+
* Added: Removal option.
|
334 |
+
* Updated: Optimized SQL statements to hopefully get rid of duplicate key error/warnings.
|
335 |
+
* Updated: Persian, Polish, Italian translations.
|
336 |
+
* Fixed: Duplicate date display on charts due to DST time change.
|
337 |
+
|
338 |
+
= 8.1.1 =
|
339 |
+
* Release Date: October 26, 2014
|
340 |
+
* Fixed: Bug in browscap.ini update code that could mis-identify all hits as robots.
|
341 |
+
* Fixed: Bug in the scheduled reports code that failed to process the report content correctly.
|
342 |
+
* Fixed: Bug in schedule reports that failed to select the current schedule in the drop down.
|
343 |
+
* Removed: Depricated variables from the report content description.
|
344 |
+
|
345 |
+
= 8.1 =
|
346 |
+
* Release Date: October 18, 2014
|
347 |
+
* Added: Detected browser information to the optimization page.
|
348 |
+
* Updated: Re-organized new browscap code to avoid PHP 5.2 or below throwing a parse error.
|
349 |
+
* Fixed: If the client sent no user agent string a fatal error would be generated, added additional logic to handle this case.
|
350 |
+
* Removed: Unused code in various log displays.
|
351 |
+
|
352 |
+
= 8.0 =
|
353 |
+
* Release Date: October 16, 2014
|
354 |
+
* Added: browscap.ini support for robot detection.
|
355 |
+
* Added: Statistics->Optimization->Database tab now how an option to re-run the install routine in case you have had to delete tables from the database.
|
356 |
+
* Added: PHP version check, WP Statistics now requires PHP 5.3 and will no longer execute without it.
|
357 |
+
* Added: Dashboard widget.
|
358 |
+
* Updated: Top pages now decode the URL for better readability.
|
359 |
+
* Updated: GeoIP library from version 0.5 to 2.0.
|
360 |
+
* Updated: User Agent detection code.
|
361 |
+
* Updated: Serbian, Polish translations.
|
362 |
+
* Updated: All missing language strings have been machine translated when possible.
|
363 |
+
* Updated: IP hashing code has moved out of beta.
|
364 |
+
* Fixed: Incorrect country name being displayed for Georgia.
|
365 |
+
* Fixed: Bug in detecting the new index in the Statistics->Optimization->Database tab.
|
366 |
+
* Fixed: Duplicate closing tag in summary page.
|
367 |
+
* Fixed: Purging the database did not display the results.
|
368 |
+
* Removed: Support for old format substitution codes in the statistics reports, upgrade now converts them to short codes.
|
369 |
+
|
370 |
+
= 7.4 =
|
371 |
+
* Release Date: September 19, 2014
|
372 |
+
* Added: Link URL for referred.
|
373 |
+
* Updated: Widget code now adhears to WordPress standards.
|
374 |
+
* Updated: Persian, Arabic and German (thanks Mike) translations.
|
375 |
+
* Updated: Unique index on visitors table now takes in to account the agent/platform/version information.
|
376 |
+
* Updated: Line charts now redraw when the legend is clicked to add/remove a line.
|
377 |
+
* Fixed: Dates on charts with large number of data points now no longer overwrite each other.
|
378 |
+
* Fixed: Admin bar menu item would use the incorrect admin URL in some circumstances.
|
379 |
+
* Removed: Screenshots are no longer included in the distribution.
|
380 |
+
|
381 |
+
= 7.3 =
|
382 |
+
* Release Date: September 8, 2014
|
383 |
+
* Added: Option to delete the admin manual.
|
384 |
+
* Added: Option to force the robots list to be updated during an upgrade.
|
385 |
+
* Added: Beta code for not storing IP addresses in the database.
|
386 |
+
* Fixed: Bug with new JQVMap code not displaying flags correctly.
|
387 |
+
* Updated: French (fr_FR) language, thanks apeedn.
|
388 |
+
* Updated: Visitors online code now treats different browsers/platforms from the same IP address as different users (this helps with multiple users behind proxy servers).
|
389 |
+
* Updated: Visitors code now treats different browsers/platforms from the same IP address as different users (this helps with multiple users behind proxy servers).
|
390 |
+
* Updated: Persian (fa_IR) language.
|
391 |
+
* Updated: Tested with WordPress 4.0.
|
392 |
+
|
393 |
+
= 7.2 =
|
394 |
+
* Release Date: August 22, 2014
|
395 |
+
* Added: Total visitors by country to the push pins on the overview map.
|
396 |
+
* Added: Statistical reports can now be sent to a custom list of e-mail addresses instead of just the administrator.
|
397 |
+
* Added: JQVMap option for the overview map.
|
398 |
+
* Fixed: Additional WP_DEBUG warnings cleaned up.
|
399 |
+
* Fixed: Google map would sometimes only use part of the area to draw the map in the overview page.
|
400 |
+
* Updated: Statistical report schedules are now listed by occurrence instead of randomly.
|
401 |
+
* Updated: Vertical alignment of statistical report option label column now correct.
|
402 |
+
* Updated: Various grammatical updates.
|
403 |
+
* Updated: Overview map now limits the number of visitors to five per country.
|
404 |
+
* Updated: Persian (fa_IR) language.
|
405 |
+
|
406 |
+
= 7.1 =
|
407 |
+
* Release Date: August 13, 2014
|
408 |
+
* Added: clearch.org search provider, disabled by default.
|
409 |
+
* Added: Database tab to optimization page to manually add unique index on the visitors table removed in 7.0.3.
|
410 |
+
* Updated: Additional WP_DEBUG message fixes.
|
411 |
+
* Updated: Overview widgets no longer overflows on smaller displays.
|
412 |
+
* Updated: Charts now properly resize when the browser window does.
|
413 |
+
|
414 |
+
= 7.0.4 =
|
415 |
+
* Release Date: August 9, 2014
|
416 |
+
* Fixed: Typo in table definition of visitor table's UAString field.
|
417 |
+
|
418 |
+
= 7.0.3 =
|
419 |
+
* Release Date: August 8, 2014
|
420 |
+
* Added: Extra check that the co-efficient setting is valid.
|
421 |
+
* Updated: Format of the dbDetla scripts to match the guidelines from WordPress, thanks kitchin.
|
422 |
+
* Updated: Handled some WP_DEBUG warning messages, thanks kitchin.
|
423 |
+
* Updated: Multiple additional WP_DEBUG warning fixes.
|
424 |
+
* Updated: Arabic (ar) language.
|
425 |
+
* Updated: Polish (pl_PL) language.
|
426 |
+
* Fixed: Typo in variable name which causes the robots list to be overwritten with the defaults incorrectly.
|
427 |
+
* Fixed: Access role exclusions and search engine exclusions options not displaying correctly in the settings page.
|
428 |
+
* Removed: Database upgrade code to add the unique index on the visitors table due to issues with multiple users. Will add back in a future release as a user selectable option.
|
429 |
+
|
430 |
+
= 7.0.2 =
|
431 |
+
* Release Date: August 7, 2014
|
432 |
+
* Fixed: Database prefix not being used when creating/updating tables correctly.
|
433 |
+
* Fixed: New installs caused an error in the new upgrade code as the visitor table did not exist yet.
|
434 |
+
* Fixed: Replaced use of deprecated $table_prefix global during install/update.
|
435 |
+
|
436 |
+
= 7.0.1 =
|
437 |
+
* Release Date: August 5, 2014
|
438 |
+
* Fixed: Error during new installations due to $wpdb object not being available.
|
439 |
+
|
440 |
+
= 7.0 =
|
441 |
+
* Release Date: August 5, 2014
|
442 |
+
* Added: New robots to the robots list: aiHitBot, AntivirusPro, BeetleBot, Blekkobot, cbot, clumboot, coccoc, crowsnest.tv, dbot, dotbot, downloadbot, EasouSpider, Exabot, facebook.com, FriendFeedBot, gimme60bot, GroupHigh, IstellaBot, Kraken, LinkpadBot, MojeekBot, NetcraftSurveyAgent, p4Bot, PaperLiBot, Pimonster, scrapy.org, SearchmetricsBot, SemanticBot, SemrushBot, SiteExplorer, Socialradarbot, SpiderLing, uMBot-LN, Vagabondo, vBSEO, WASALive-Bot, WebMasterAid, WeSEE, XoviBot, YoudaoBot,
|
443 |
+
* Added: Overview page can now be customized for what is displayed on a per user basis.
|
444 |
+
* Added: Overview tab to the settings page to control what is displayed. This page is available to any user that has read access to WP Statistics.
|
445 |
+
* Added: Dutch (nl_NL) translation, thanks Friso van Wieringen.
|
446 |
+
* Added: New index on visitor table for existing installs to avoid duplicate entries being created.
|
447 |
+
* Added: jqPlot javascript library.
|
448 |
+
* Added: Three new schedule options for statistical reports; weekly, bi-weekly and every 4 weeks.
|
449 |
+
* Fixed: Some country codes not displaying in the "Top Countries" overview widget/page.
|
450 |
+
* Fixed: Export filename contained a colon, which is not a valid character.
|
451 |
+
* Fixed: In some cases purging data in the optimization page would succeed but the UI would "re-activate".
|
452 |
+
* Updated: All charts now use jqPlot instead of HighCharts so we are now fully GPL compliant.
|
453 |
+
* Updated: "Top Referring Sites" on the overview page now only displays if there are entries to be displayed.
|
454 |
+
* Updated: "Latest Search Words" on the overview page now only displays if there are entries to be displayed.
|
455 |
+
* Updated: "Top Pages Visited" on the overview page now only displays if there are entries to be displayed.
|
456 |
+
* Updated: About on the overview page box.
|
457 |
+
* Updated: Settings page from css tabs to jQuery tabs.
|
458 |
+
* Updated: Settings system (which used individual WordPress settings for each option) to a new unified system (uses a single WordPress setting and stores it as an array)
|
459 |
+
* Updated: Optimization page from css tabs to jQuery tabs.
|
460 |
+
* Updated: Install/Upgrade code to share a single code base.
|
461 |
+
* Updated: Persian (fa_IR) language.
|
462 |
+
* Updated: Arabic (ar) language.
|
463 |
+
* Updated: rtl.css file for new version.
|
464 |
+
* Updated: Lots of code comments.
|
465 |
+
* Updated: Statistical report schedule list in settings is now dynamically generated.
|
466 |
+
* Updated: WP-Statistics screenshots.
|
467 |
+
* Removed: "Alternate map location" setting as it has been made redundant by the new overview display settings.
|
468 |
+
* Removed: "Chart type" setting as chart types are now hard coded to the appropriate type for the data.
|
469 |
+
* Removed: HighCharts javascript library.
|
470 |
+
* Removed: Unused function objectToArray().
|
471 |
+
|
472 |
+
= 6.1 =
|
473 |
+
* Release Date: June 29, 2014
|
474 |
+
* Added: Display of the current memory_limit setting from php.ini in the optimization page.
|
475 |
+
* Added: New index on visitor table for new installs to avoid duplicate entries being created. A future update will add this index to existing installs but will need additional testing before it is implemented.
|
476 |
+
* Added: Seychelles flag.
|
477 |
+
* Updated: Support international number formats in statistics display.
|
478 |
+
* Updated: Description of WordPress.org plugin link in plugin list.
|
479 |
+
* Updated: Widget and shortcode now use the countonly option in wp_statistics_vistor() for better performance.
|
480 |
+
* Updated: Renamed plugin from "WordPress Statistics" to "WP Statistics".
|
481 |
+
* Fixed: bug in new IP validation code and support for stripping off port numbers if they are passed through the headers. Thanks Stephanos Io.
|
482 |
+
* Updated: Persian (fa_IR) language.
|
483 |
+
|
484 |
+
= 6.0 =
|
485 |
+
* Release Date: June 11, 2014
|
486 |
+
* Added: Page tracking support. Includes new overview widget and detail page. Also supports page hit count in the pages/post list and in the page/post editor.
|
487 |
+
* Added: Admin manual, online viewing as well as downloadable version.
|
488 |
+
* Added: Links for “Settings”, “WordPress Plugin Page” and “Rate” pages to the plugin list for WP Statistics.
|
489 |
+
* Updated: General settings tab re-organization.
|
490 |
+
* Updated: Several typo's and other minor issues.
|
491 |
+
* Updated: Highcharts JS v3.0.9 to JS v4.0.1.
|
492 |
+
* Updated: Persian (fa_IR) language.
|
493 |
+
* Updated: Polish (pl_PL) language.
|
494 |
+
* Updated: Arabic (ar) language.
|
495 |
+
* Updated: Turkish (tr_TR) language.
|
496 |
+
* Removed: shortcode and functions reference from readme.txt, now in admin manual.
|
497 |
+
|
498 |
+
= 5.4 =
|
499 |
+
* Release Date: May 31, 2014
|
500 |
+
* Fixed: GeoIP dependency code to ignore safe mode check in PHP 5.4 or newer.
|
501 |
+
* Fixed: GeoIP dependency code to properly detect safe mode with PHP 5.3 or older.
|
502 |
+
* Fixed: Browser information not recorded if GeoIP was not enabled.
|
503 |
+
* Updated: get_IP code to better handle malformed IP addresses.
|
504 |
+
* Updated: Persian (fa_IR) language.
|
505 |
+
* Updated: Arabic (ar) language.
|
506 |
+
* Updated: Chinese (zh_CN) language.
|
507 |
+
|
508 |
+
= 5.3 =
|
509 |
+
* Release Date: April 17, 2014
|
510 |
+
* Added: New robot's to the robots list: BOT for JCE, Leikibot, LoadTimeBot, NerdyBot, niki-bot, PagesInventory, sees.co, SurveyBot, trendictionbot, Twitterbot, Wotbox, ZemlyaCrawl
|
511 |
+
* Added: Check for PHP's Safe Mode as the GeoIP code does not function with it enabled.
|
512 |
+
* Added: Option to disable administrative notices of inactive features.
|
513 |
+
* Added: Option to export column names as first line of export files.
|
514 |
+
* Added: Options to disable search engines from being collected/displayed.
|
515 |
+
* Updated: French (fr_FR) language translation.
|
516 |
+
* Fixed: Download of the GeoIP database could cause a fatal error message at the end of a page if it was triggered outside the admin area.
|
517 |
+
|
518 |
+
= 5.2 =
|
519 |
+
* Release Date: March 10, 2014
|
520 |
+
* Added: Additional checks for BC Math and cURL which are required for the GeoIP code.
|
521 |
+
* Updated: GeoIP database handling if it is missing or invalid.
|
522 |
+
* Updated: GeoIP database is now stored in uploads/wp-statistics directory so it does not get overwritten during upgrades.
|
523 |
+
* Fixed: Typo's in the shortcode codes (thanks g33kg0dd3ss).
|
524 |
+
* Updated: Polish (pl_PL) language.
|
525 |
+
|
526 |
+
= 5.1 =
|
527 |
+
* Release Date: March 3, 2014
|
528 |
+
* Fixes: Small bug in referral url.
|
529 |
+
* Fixes: Problem export table.
|
530 |
+
* Updated: Arabic (ar) language.
|
531 |
+
|
532 |
+
= 5.0 =
|
533 |
+
* Release Date: March 2, 2014
|
534 |
+
* Added: Show last visitor in Google Map.
|
535 |
+
* Added: Search visitor by IP in log pages.
|
536 |
+
* Added: Total line to charts with multiple values, like the search engine referrals.
|
537 |
+
* Added: Shortcodes. [By Greg Ross](http://profiles.wordpress.org/gregross)
|
538 |
+
* Added: Dashicons to log pages.
|
539 |
+
* Fixes: Small bugs.
|
540 |
+
* Fixes: More debug warnings.
|
541 |
+
* Fixes: User access function level code always returned manage_options no matter what it was actaully set to.
|
542 |
+
* Updated: Hungarian (hu_HU) language.
|
543 |
+
* Updated: Turkish (tr_TR) language.
|
544 |
+
* Removed: Parameter from `wp_statistics_lastpostdate()` function and return date type became dynamic.
|
545 |
+
|
546 |
+
= 4.8.1 =
|
547 |
+
* Release Date: February 4, 2014
|
548 |
+
* Fixes: Small bug in the `Current_Date`.
|
549 |
+
* Fixes: Small bug in the `exclusions.php` file.
|
550 |
+
* Updated: Polish (pl_PL) language.
|
551 |
+
|
552 |
+
= 4.8 =
|
553 |
+
* Release Date: February 4, 2014
|
554 |
+
* Added: Converting Gregorian date to Persian When enabled [wp-parsidate](http://wordpress.org/plugins/wp-parsidate/) plugin.
|
555 |
+
* Added: New feature, option to record the number and type of excluded hits to your site.
|
556 |
+
* Added: New exclusion types for login and admin pages.
|
557 |
+
* Fixes: GeoIP populate code now REALLY functions again.
|
558 |
+
* Updated: Arabic (ar) language.
|
559 |
+
* Updated: Polish (pl_PL) language.
|
560 |
+
|
561 |
+
= 4.7 =
|
562 |
+
* Release Date: February 2, 2014
|
563 |
+
* Added: Responsive Stats page for smaller-screen devices.
|
564 |
+
* Added: Dashicons icon for plugin page.
|
565 |
+
* Added: Tabs option in setting page.
|
566 |
+
* Added: Tabs category in optimization page.
|
567 |
+
* Fixes: More debug warnings.
|
568 |
+
* Fixes: GeoIP populate code now functions again.
|
569 |
+
* Updated: Some optimization of the statistics code.
|
570 |
+
* Updated: Search Words now reports results only for referrers with actual search queries.
|
571 |
+
* Updated: Highcharts JS v3.0.7 to JS v3.0.9.
|
572 |
+
* Updated: Brazil (pt_BR) language.
|
573 |
+
|
574 |
+
= 4.6.1 =
|
575 |
+
* Release Date: January 24, 2014
|
576 |
+
* Fixes: a Small bug in to get rid of one of the reported warnings from debug mode.
|
577 |
+
|
578 |
+
= 4.6 =
|
579 |
+
* Release Date: January 20, 2014
|
580 |
+
* Added: In the optimization page you can now empty all tables at once.
|
581 |
+
* Added: In the optimization page you can now purge statistics over a given number of days old.
|
582 |
+
* Added: Daily scheduled job to purge statistics over a given number of days old.
|
583 |
+
* Fixes: Bug in the robots code that on new installs failed to populate the defaults in the database.
|
584 |
+
* Fixes: All known warning messages when running in WordPress debug mode.
|
585 |
+
* Fixes: Incorrect description of co-efficient value in the setting page.
|
586 |
+
* Fixes: Top level links on the various stats pages now update highlight the current page in the admin menu instead of the overview page.
|
587 |
+
* Fixes: Install code now only executes on a true new installation instead of on each activation.
|
588 |
+
* Fixes: Bug in hits code when GeoIP was disabled, IP address would not be recorded.
|
589 |
+
|
590 |
+
= 4.5 =
|
591 |
+
* Release Date: January 18, 2014
|
592 |
+
* Added: Support for more search engines: DuckDuckGo, Baidu and Yandex.
|
593 |
+
* Added: Support for Google local sites like google.ca, google.fr, etc.
|
594 |
+
* Added: Anchor links in the optimization and settings page to the main sections.
|
595 |
+
* Added: Icon for Opera Next.
|
596 |
+
* Updated: Added new bot match strings: 'archive.org_bot', 'meanpathbot', 'moreover', 'spbot'.
|
597 |
+
* Updated: Replaced bot match string 'ezooms.bot' with 'ezooms'.
|
598 |
+
* Updated: Overview summary statistics layout.
|
599 |
+
* Fixes: Bug in widget code that didn't allow you to edit the settings after adding the widget to your site.
|
600 |
+
|
601 |
+
= 4.4 =
|
602 |
+
* Release Date: January 16, 2014
|
603 |
+
* Added: option to set the required capability level to view statistics in the admin interface.
|
604 |
+
* Added: option to set the required capability level to manage statistics in the admin interface.
|
605 |
+
* Fixes: 'See More' links on the overview page now update highlight the current page in the admin menu instead of the overview page.
|
606 |
+
* Added: Schedule downloads of the GeoIP database.
|
607 |
+
* Added: Auto populate missing GeoIP information after a download of the GeoIP database.
|
608 |
+
* Fixes: Unschedule of report event if reporting is disabled.
|
609 |
+
|
610 |
+
= 4.3.1 =
|
611 |
+
* Release Date: January 13, 2014
|
612 |
+
* Fixes: Critical bug that caused only a single visitor to be recorded.
|
613 |
+
* Added: Version information to the optimization page.
|
614 |
+
[Thanks Greg Ross](http://profiles.wordpress.org/gregross)
|
615 |
+
|
616 |
+
= 4.3 =
|
617 |
+
* Release Date: January 12, 2014
|
618 |
+
* Added: Definable robots list to exclude based upon the user agent string from the client.
|
619 |
+
* Added: IP address and subnet exclusion support.
|
620 |
+
* Added: Client IP and user agent information to the optimization page.
|
621 |
+
* Added: Support to exclude users from data collection based on their WordPress role.
|
622 |
+
* Fixes: A bug when the GeoIP code was disabled with optimization page.
|
623 |
+
|
624 |
+
= 4.2 =
|
625 |
+
* Release Date: December 31, 2013
|
626 |
+
* Added: Statistical menus.
|
627 |
+
* Fixes: Small bug in the geoip version.
|
628 |
+
* Language: Serbian (sr_RS) was updated.
|
629 |
+
* Language: German (de_DE) was updated.
|
630 |
+
* Language: French (fr_FR) was updated.
|
631 |
+
|
632 |
+
= 4.1 =
|
633 |
+
* Release Date: December 23, 2013
|
634 |
+
* Language: Arabic (ar) was updated
|
635 |
+
* Fixes: small bug in moved the GeoIP database.
|
636 |
+
* Updated: update to the spiders list.
|
637 |
+
|
638 |
+
= 4.0 =
|
639 |
+
* Release Date: December 21, 2013
|
640 |
+
* Added: GeoIP location support for visitors country.
|
641 |
+
* Added: Download option in settings for GeoIP database.
|
642 |
+
* Added: Populate location entries with unknown or missing location information to the optimization page.
|
643 |
+
* Added: Detect self referrals and disregard them like webcrawlers.
|
644 |
+
* Added: "All Browsers" and "Top Countries" pages.
|
645 |
+
* Added: "more" page to hit statistics chart, support for charts from 10 days to 1 year.
|
646 |
+
* Added: "more" page to search engine statistics chart, support for charts from 10 days to 1 year.
|
647 |
+
* Added: Option to store complete user agent string for debugging purposes.
|
648 |
+
* Added: Option to delete specific browser or platform types from the database in the optimization page.
|
649 |
+
* Updated: Browser detection now supports more browsers and includes platform and version information.
|
650 |
+
* Updated: List of webcrawlers to catch more bots.
|
651 |
+
* Updated: Statistics reporting options in settings no longer needs a page reload to hide/show the settings.
|
652 |
+
* Updated: Summary Statistcs now uses the WordPress set format for the time and date.
|
653 |
+
* Fixes: Webcrawler detection now works and is case insensitive.
|
654 |
+
* Fixes: Install code now correctly sets defaults.
|
655 |
+
* Fixes: Upgrade code now works correctly. If you are running V3.2, your old data will be preserved, older versions will delete the tables and recreate them.
|
656 |
+
* Fixes: Ajax submissions on the optmiziation page (like the empty table function) should work in IE and other browsers that are sensitive to cross site attacks.
|
657 |
+
* Fixes: Replaced call to the dashboard code (to support the postbox widgets on the log screen) with the proper call to the postbox code as WordPress 3.8 beta 1 did not work with the old code.
|
658 |
+
* Updated: Highcharts JS 3.0.1 to JS 3.0.7 version.
|
659 |
+
|
660 |
+
= 3.2 =
|
661 |
+
* Release Date: August 7, 2013
|
662 |
+
* Added: Optimization plugin page.
|
663 |
+
* Added: Export data to excel, xml, csv and tsv files.
|
664 |
+
* Added: Delete table data.
|
665 |
+
* Added: Show memory usage in optimization page.
|
666 |
+
* Language: Polish (pl_PL) was updated.
|
667 |
+
* Language: updated.
|
668 |
+
|
669 |
+
= 3.1.4 =
|
670 |
+
* Release Date: July 18, 2013
|
671 |
+
* Added: Chart Type in the settings plugin.
|
672 |
+
* Added: Search Engine referrer chart in the view stats page.
|
673 |
+
* Added: Search Engine stats in Summary Statistics.
|
674 |
+
* Optimized: 'wp_statistics_searchengine()' and add second parameter in the function.
|
675 |
+
* Language: Chinese (China) was added.
|
676 |
+
* Language: Russian was updated.
|
677 |
+
* Language: updated.
|
678 |
+
|
679 |
+
= 3.1.3 =
|
680 |
+
* Release Date: June 9, 2013
|
681 |
+
* Optimized: View statistics.
|
682 |
+
* Added: Chinese (Taiwan) language.
|
683 |
+
|
684 |
+
= 3.1.2 =
|
685 |
+
* Release Date: June 4, 2013
|
686 |
+
* Added: Top referring sites with full details.
|
687 |
+
* Resolved: Loads the plugin's translated strings problem.
|
688 |
+
* Resolved: View the main site in top referring sites.
|
689 |
+
* Resolved: Empty referrer.
|
690 |
+
* Resolved: Empty search words.
|
691 |
+
* Update: Highcharts js 2.3.5 to v3.0.1.
|
692 |
+
* Language: Arabic was updated.
|
693 |
+
* Language: Hungarian was updated.
|
694 |
+
* Language: updated.
|
695 |
+
|
696 |
+
= 3.1.1 =
|
697 |
+
* Release Date: April 11, 2013
|
698 |
+
* Bug Fix: Security problem. (Thanks Mohammad Teimori) for report bug.
|
699 |
+
* Optimized: Statistics screen in resolution 1024x768.
|
700 |
+
* Language: Persian was updated.
|
701 |
+
|
702 |
+
= 3.1.0 =
|
703 |
+
* Release Date: April 3, 2013
|
704 |
+
* Bug Fix: Statistics Menu bar.
|
705 |
+
* Bug Fix: Referral link of the last visitors.
|
706 |
+
* Added: Latest all search words with full details.
|
707 |
+
* Added: Recent all visitors with full details.
|
708 |
+
* Optimized: View statistics.
|
709 |
+
* Language: updated.
|
710 |
+
* Language: Arabic was updated.
|
711 |
+
* Remove: IP Information in setting page.
|
712 |
+
|
713 |
+
= 3.0.2 =
|
714 |
+
* Release Date: February 5, 2013
|
715 |
+
* Added: Hungarian language.
|
716 |
+
* Added: Insert value in useronline table by Primary_Values function.
|
717 |
+
* Added: Opera browser in get_UserAgent function.
|
718 |
+
* Added: prefix wps_ in options.
|
719 |
+
* Added: Notices to enable or disable the plugin.
|
720 |
+
* Changed: Statistics class to WP_Statistics because Resemblance name.
|
721 |
+
|
722 |
+
= 3.0.1 =
|
723 |
+
* Release Date: February 3, 2013
|
724 |
+
* Bug Fix: Table plugin problem.
|
725 |
+
|
726 |
+
= 3.0 =
|
727 |
+
* Release Date: February 3, 2013
|
728 |
+
* Bug Fix: problem in calculating Statistics.
|
729 |
+
* Optimized: and speed up the process.
|
730 |
+
* Optimized: Overall reconstruction and coding plug with a new structure.
|
731 |
+
* Optimized: The use of object-oriented programming.
|
732 |
+
* Added: statistics screen to complete.
|
733 |
+
* Added: Chart Show.
|
734 |
+
* Added: Graph of Browsers.
|
735 |
+
* Added: Latest search words.
|
736 |
+
* Added: Specification (Country and county) Visitors.
|
737 |
+
* Added: Top referring sites.
|
738 |
+
* Added: Send stats to Email/[SMS](http://wordpress.org/extend/plugins/wp-sms/)
|
739 |
+
|
740 |
+
= 2.3.3 =
|
741 |
+
* Release Date: December 18, 2012
|
742 |
+
* Serbian language was solved.
|
743 |
+
* Server variables were optimized by m.emami.
|
744 |
+
* Turkish translation was complete.
|
745 |
+
|
746 |
+
= 2.3.2 =
|
747 |
+
* Release Date: October 24, 2012
|
748 |
+
* Added Indonesia language.
|
749 |
+
* Turkish language file corrected by MBOZ.
|
750 |
+
|
751 |
+
= 2.3.1 =
|
752 |
+
* Release Date: October 12, 2012
|
753 |
+
* Added Polish language.
|
754 |
+
* Added Support forum link in menu.
|
755 |
+
* Fix problem error in delete plugin.
|
756 |
+
|
757 |
+
= 2.3.0 =
|
758 |
+
* Release Date: Not released
|
759 |
+
* Added Serbian language.
|
760 |
+
|
761 |
+
= 2.2.9 =
|
762 |
+
* Release Date: September 20, 2012
|
763 |
+
* Added Bengali language.
|
764 |
+
|
765 |
+
= 2.2.8 =
|
766 |
+
* Release Date: July 27, 2012
|
767 |
+
* Added Russian language.
|
768 |
+
* Fix problem in count views.
|
769 |
+
* Added more filter for check spider.
|
770 |
+
* Optimize plugin.
|
771 |
+
|
772 |
+
= 2.2.7 =
|
773 |
+
* Release Date: May 20, 2012
|
774 |
+
* Fix problem in widget class.
|
775 |
+
* Redundancy in Arabic translation.
|
776 |
+
* Fix problem in [countposts] shortcode.
|
777 |
+
* Optimized Style Reports.
|
778 |
+
|
779 |
+
= 2.2.6 =
|
780 |
+
* Release Date: April 19, 2012
|
781 |
+
* Fix a small problem.
|
782 |
+
|
783 |
+
= 2.2.5 =
|
784 |
+
* Release Date: April 18, 2012
|
785 |
+
* The security problem was solved. Please be sure to update!
|
786 |
+
* Redundancy in French translation.
|
787 |
+
* Add CSS Class for the containing widget. (Thanks Luai Mohammed).
|
788 |
+
* Add daily or total search engines in setting page.
|
789 |
+
* Using wordpress jQuery in setting page.
|
790 |
+
|
791 |
+
= 2.2.4 =
|
792 |
+
* Release Date: March 12, 2012
|
793 |
+
* Added Turkish language.
|
794 |
+
* Added Italian language.
|
795 |
+
* Added German language.
|
796 |
+
* Arabic language was solved.
|
797 |
+
* Romanian language was solved.
|
798 |
+
* The words in setting page were complete. (Thanks Will Abbott) default.po file is Updated.
|
799 |
+
* The change of time from minutes to seconds to check users online.
|
800 |
+
* Ignoring search engine crawler.
|
801 |
+
* Added features premium version to free version.
|
802 |
+
* Added user online live.
|
803 |
+
* Added total visit live.
|
804 |
+
* Added Increased to visit.
|
805 |
+
* Added Reduced to visit.
|
806 |
+
* Added Coefficient statistics for each user.
|
807 |
+
|
808 |
+
= 2.2.3 =
|
809 |
+
* Release Date: February 3, 2012
|
810 |
+
* Optimized Counting.
|
811 |
+
* Added Arabic language.
|
812 |
+
* Draging problem was solved in Widgets
|
813 |
+
* css problem was solved in sidebar
|
814 |
+
|
815 |
+
= 2.2.2 =
|
816 |
+
* Release Date: January 11, 2012
|
817 |
+
* Solving show functions in setting page.
|
818 |
+
* Solving month visit in widget.
|
819 |
+
* Added Spanish language.
|
820 |
+
|
821 |
+
= 2.2.1 =
|
822 |
+
* Release Date: December 27, 2011
|
823 |
+
* Solving drap uploader problem in media-new.php.
|
824 |
+
|
825 |
+
= 2.2.0 =
|
826 |
+
* Release Date: December 26, 2011
|
827 |
+
* Added statistics to admin bar wordpress 3.3.
|
828 |
+
* Added Uninstall for remove data and table from database.
|
829 |
+
* Added all statistics item in widget and Their choice.
|
830 |
+
* Optimize show function code in setting page.
|
831 |
+
* Calling jQuery in wordpress admin for plugin.
|
832 |
+
* Remove the word "disabled" in the statistics When the plugin was disabled.
|
833 |
+
* Solving scroll problem in statistics page.
|
834 |
+
|
835 |
+
= 2.1.6 =
|
836 |
+
* Release Date: October 21, 2011
|
837 |
+
* Added Russian language.
|
838 |
+
|
839 |
+
= 2.1.5 =
|
840 |
+
* Release Date: October 29, 2011
|
841 |
+
* Added French language.
|
842 |
+
* Rounds a float Averages.
|
843 |
+
|
844 |
+
= 2.1.4 =
|
845 |
+
* Release Date: October 21, 2011
|
846 |
+
* Added Romanian language.
|
847 |
+
|
848 |
+
= 2.1.3 =
|
849 |
+
* Release Date: October 14, 2011
|
850 |
+
* Active plugin in setting page was solved.
|
851 |
+
|
852 |
+
= 2.1.2 =
|
853 |
+
* Release Date: October 12, 2011
|
854 |
+
* Added default language file.
|
855 |
+
* Added Portuguese language.
|
856 |
+
|
857 |
+
= 2.1.1 =
|
858 |
+
* Release Date: September 27, 2011
|
859 |
+
* Complete files
|
860 |
+
|
861 |
+
= 2.1 =
|
862 |
+
* Release Date: September 25, 2011
|
863 |
+
* Edit string
|
864 |
+
|
865 |
+
= 2.0 =
|
866 |
+
* Release Date: September 20, 2011
|
867 |
+
* Support from Database
|
868 |
+
* Added Setting Page
|
869 |
+
* Added decimals number
|
870 |
+
* Added Online user check time
|
871 |
+
* Added Database check time
|
872 |
+
* Added User Online
|
873 |
+
* Added Today Visit
|
874 |
+
* Added Yesterday Visit
|
875 |
+
* Added Week Visit
|
876 |
+
* Added Month Visit
|
877 |
+
* Added Years Visit
|
878 |
+
* Added Search Engine reffered
|
879 |
+
* Added Average Posts
|
880 |
+
* Added Average Comments
|
881 |
+
* Added Average Users
|
882 |
+
* Added Google Pagerank
|
883 |
+
* Added Alexa Pagerank
|
884 |
+
* Added wordpress shortcode
|
885 |
+
|
886 |
+
= 1.0 =
|
887 |
+
* Release Date: March 20, 2011
|
888 |
+
* Start plugin
|
composer.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"require": {
|
3 |
+
"php": ">=5.4",
|
4 |
+
"geoip2/geoip2": "2.10.0",
|
5 |
+
"s1lentium/iptools": "^1.1.0",
|
6 |
+
"whichbrowser/parser": "2.0.37",
|
7 |
+
"jaybizzle/crawler-detect": "1.2.102"
|
8 |
+
},
|
9 |
+
"config": {
|
10 |
+
"vendor-dir": "includes/vendor",
|
11 |
+
"platform-check": false,
|
12 |
+
"platform": {
|
13 |
+
"php": "5.6"
|
14 |
+
}
|
15 |
+
}
|
16 |
+
}
|
gulpfile.js
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var gulp = require('gulp'),
|
2 |
+
cleanCSS = require('gulp-clean-css'),
|
3 |
+
rename = require('gulp-rename'),
|
4 |
+
concat = require('gulp-concat'),
|
5 |
+
insert = require('gulp-insert'),
|
6 |
+
babel = require('gulp-babel'),
|
7 |
+
uglify = require('gulp-uglify'),
|
8 |
+
replace = require('gulp-replace'),
|
9 |
+
sass = require('gulp-sass'),
|
10 |
+
pipeline = require('readable-stream').pipeline;
|
11 |
+
|
12 |
+
// Gulp Sass Compiler
|
13 |
+
sass.compiler = require('node-sass');
|
14 |
+
gulp.task('sass', function () {
|
15 |
+
return gulp.src([
|
16 |
+
'./assets/dev/sass/admin.scss',
|
17 |
+
'./assets/dev/sass/jquery-datepicker/datepicker.scss',
|
18 |
+
'./assets/dev/sass/rtl.scss',
|
19 |
+
'./assets/dev/sass/frontend.scss',
|
20 |
+
])
|
21 |
+
.pipe(sass({outputStyle: 'compressed'}))
|
22 |
+
.pipe(rename({suffix: '.min'}))
|
23 |
+
.pipe(gulp.dest(['./assets/css/']));
|
24 |
+
});
|
25 |
+
|
26 |
+
//Gulp Script Concat
|
27 |
+
gulp.task('script', function () {
|
28 |
+
return gulp.src([
|
29 |
+
'./assets/dev/javascript/plugin/*.js',
|
30 |
+
'./assets/dev/javascript/config.js',
|
31 |
+
'./assets/dev/javascript/ajax.js',
|
32 |
+
'./assets/dev/javascript/placeholder.js',
|
33 |
+
'./assets/dev/javascript/helper.js',
|
34 |
+
'./assets/dev/javascript/meta-box.js',
|
35 |
+
'./assets/dev/javascript/meta-box/*.js',
|
36 |
+
'./assets/dev/javascript/pages/*.js',
|
37 |
+
'./assets/dev/javascript/run.js',
|
38 |
+
])
|
39 |
+
.pipe(concat('admin.min.js'))
|
40 |
+
.pipe(insert.prepend('jQuery(document).ready(function ($) {'))
|
41 |
+
.pipe(insert.append('});'))
|
42 |
+
.pipe(gulp.dest('./assets/js/'))
|
43 |
+
.pipe(babel({presets: ['@babel/env']}))
|
44 |
+
.pipe(replace("\\n", ''))
|
45 |
+
.pipe(replace("\\t", ''))
|
46 |
+
.pipe(replace(" ", ''))
|
47 |
+
.pipe(uglify())
|
48 |
+
.pipe(gulp.dest('./assets/js/'));
|
49 |
+
});
|
50 |
+
|
51 |
+
// Gulp TinyMce Script
|
52 |
+
gulp.task('mce', function () {
|
53 |
+
return gulp.src(['./assets/dev/javascript/Tinymce/*.js'])
|
54 |
+
.pipe(concat('tinymce.min.js'))
|
55 |
+
.pipe(gulp.dest('./assets/js/')).pipe(babel({presets: ['@babel/env']})).pipe(replace("\\n", '')).pipe(replace("\\t", '')).pipe(replace(" ", '')).pipe(uglify()).pipe(gulp.dest('./assets/js/'));
|
56 |
+
});
|
57 |
+
|
58 |
+
// Gulp Script Minify
|
59 |
+
gulp.task('js', function () {
|
60 |
+
return gulp.src(['./assets/js/*.js', '!./assets/js/*.min.js'])
|
61 |
+
.pipe(babel({presets: ['@babel/env']}))
|
62 |
+
.pipe(uglify())
|
63 |
+
.pipe(rename({suffix: '.min'}))
|
64 |
+
.pipe(gulp.dest(function (file) {
|
65 |
+
return file.base;
|
66 |
+
}));
|
67 |
+
});
|
68 |
+
|
69 |
+
// Gulp Css Minify
|
70 |
+
gulp.task('css', function () {
|
71 |
+
return gulp.src(['./assets/css/*.css', '!./assets/css/*.min.css'])
|
72 |
+
.pipe(cleanCSS({
|
73 |
+
keepSpecialComments: 1,
|
74 |
+
level: 2
|
75 |
+
}))
|
76 |
+
.pipe(rename({suffix: '.min'}))
|
77 |
+
.pipe(gulp.dest(function (file) {
|
78 |
+
return file.base;
|
79 |
+
}));
|
80 |
+
});
|
81 |
+
|
82 |
+
// Gulp Watch
|
83 |
+
gulp.task('watch', function () {
|
84 |
+
gulp.watch('assets/dev/javascript/**/*.js', gulp.series('script'));
|
85 |
+
gulp.watch('assets/dev/sass/**/*.scss', gulp.series('sass'));
|
86 |
+
});
|
87 |
+
|
88 |
+
// global Task
|
89 |
+
gulp.task('default', gulp.parallel('sass', 'script', 'mce'));
|
includes/admin/TinyMCE/class-wp-statistics-tinymce.php
CHANGED
@@ -5,138 +5,146 @@ namespace WP_STATISTICS;
|
|
5 |
/**
|
6 |
* Class WP_Statistics_TinyMCE
|
7 |
*/
|
8 |
-
class TinyMCE
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
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 |
-
|
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 |
<script type="text/javascript">
|
129 |
jQuery( document ).on( \'tinymce-editor-setup\', function( event, editor ) {
|
130 |
editor.settings.toolbar1 += \',wp_statistic_tc_button\';
|
131 |
});
|
132 |
';
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
tinyMCEPreInit.load_ext("' . rtrim(
|
137 |
</script>
|
138 |
';
|
139 |
-
|
140 |
}
|
141 |
|
142 |
new TinyMCE;
|
5 |
/**
|
6 |
* Class WP_Statistics_TinyMCE
|
7 |
*/
|
8 |
+
class TinyMCE
|
9 |
+
{
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Setup an TinyMCE action to close the notice on the overview page.
|
13 |
+
*/
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
|
17 |
+
// Add Filter TinyMce Editor
|
18 |
+
add_action('admin_head', array($this, 'wp_statistic_add_my_tc_button'));
|
19 |
+
|
20 |
+
// Add TextLang
|
21 |
+
add_action('admin_footer-widgets.php', array($this, 'my_post_edit_page_footer'), 999);
|
22 |
+
}
|
23 |
+
|
24 |
+
/*
|
25 |
+
* Language List Text Domain
|
26 |
+
*/
|
27 |
+
static public function lang()
|
28 |
+
{
|
29 |
+
if (!class_exists('_WP_Editors')) {
|
30 |
+
require(ABSPATH . WPINC . '/class-wp-editor.php');
|
31 |
+
}
|
32 |
+
|
33 |
+
$strings = array(
|
34 |
+
'insert' => __('WP Statistics Shortcodes', 'wp-statistics'),
|
35 |
+
'stat' => __('Stat', 'wp-statistics'),
|
36 |
+
'usersonline' => __('Online Users', 'wp-statistics'),
|
37 |
+
'visits' => __('Visits', 'wp-statistics'),
|
38 |
+
'visitors' => __('Visitors', 'wp-statistics'),
|
39 |
+
'pagevisits' => __('Page Visits', 'wp-statistics'),
|
40 |
+
'searches' => __('Searches', 'wp-statistics'),
|
41 |
+
'postcount' => __('Post Count', 'wp-statistics'),
|
42 |
+
'pagecount' => __('Page Count', 'wp-statistics'),
|
43 |
+
'commentcount' => __('Comment Count', 'wp-statistics'),
|
44 |
+
'spamcount' => __('Spam Count', 'wp-statistics'),
|
45 |
+
'usercount' => __('User Count', 'wp-statistics'),
|
46 |
+
'postaverage' => __('Post Average', 'wp-statistics'),
|
47 |
+
'commentaverage' => __('Comment Average', 'wp-statistics'),
|
48 |
+
'useraverage' => __('User Average', 'wp-statistics'),
|
49 |
+
'lpd' => __('Last Post Date', 'wp-statistics'),
|
50 |
+
'referrer' => __('Referrer', 'wp-statistics'),
|
51 |
+
'help_stat' => __('The statistics you want, see the next table for available options.', 'wp-statistics'),
|
52 |
+
'time' => __('Time', 'wp-statistics'),
|
53 |
+
'se' => __('Select item ...', 'wp-statistics'),
|
54 |
+
'today' => __('Today', 'wp-statistics'),
|
55 |
+
'yesterday' => __('Yesterday', 'wp-statistics'),
|
56 |
+
'week' => __('Week', 'wp-statistics'),
|
57 |
+
'month' => __('Month', 'wp-statistics'),
|
58 |
+
'year' => __('Year', 'wp-statistics'),
|
59 |
+
'total' => __('Total', 'wp-statistics'),
|
60 |
+
'help_time' => __('Is the time frame (time periods) for the statistic', 'wp-statistics'),
|
61 |
+
'provider' => __('Provider', 'wp-statistics'),
|
62 |
+
'help_provider' => __('The search provider to get statistics on.', 'wp-statistics'),
|
63 |
+
'format' => __('Format', 'wp-statistics'),
|
64 |
+
'help_format' => __('The format to display numbers in: i18n, english, none.', 'wp-statistics'),
|
65 |
+
'id' => __('ID', 'wp-statistics'),
|
66 |
+
'help_id' => __('The post/page ID to get page statistics on.', 'wp-statistics'),
|
67 |
+
);
|
68 |
+
|
69 |
+
$locale = \_WP_Editors::$mce_locale;
|
70 |
+
$translated = 'tinyMCE.addI18n("' . $locale . '.wp_statistic_tinymce_plugin", ' . json_encode($strings) . ");\n";
|
71 |
+
|
72 |
+
return array('locale' => $locale, 'translate' => $translated);
|
73 |
+
}
|
74 |
+
|
75 |
+
/*
|
76 |
+
* Add Filter TinyMCE
|
77 |
+
*/
|
78 |
+
public function wp_statistic_add_my_tc_button()
|
79 |
+
{
|
80 |
+
global $typenow;
|
81 |
+
|
82 |
+
// check user permissions
|
83 |
+
if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
|
87 |
+
// verify the post type
|
88 |
+
if (!in_array($typenow, array('post', 'page'))) {
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
|
92 |
+
// check if WYSIWYG is enabled
|
93 |
+
if (get_user_option('rich_editing') == 'true') {
|
94 |
+
add_filter("mce_external_plugins", array($this, 'wp_statistic_add_tinymce_plugin'));
|
95 |
+
add_filter('mce_buttons', array($this, 'wp_statistic_register_my_tc_button'));
|
96 |
+
add_filter('mce_external_languages', array($this, 'wp_statistic_tinymce_plugin_add_locale'));
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/*
|
101 |
+
* Add Js Bottun to Editor
|
102 |
+
*/
|
103 |
+
public function wp_statistic_add_tinymce_plugin($plugin_array)
|
104 |
+
{
|
105 |
+
$plugin_array['wp_statistic_tc_button'] = Admin_Assets::url('tinymce.min.js');
|
106 |
+
|
107 |
+
return $plugin_array;
|
108 |
+
}
|
109 |
+
|
110 |
+
/*
|
111 |
+
* Push Button to TinyMCE Advance
|
112 |
+
*/
|
113 |
+
public function wp_statistic_register_my_tc_button($buttons)
|
114 |
+
{
|
115 |
+
array_push($buttons, "wp_statistic_tc_button");
|
116 |
+
|
117 |
+
return $buttons;
|
118 |
+
}
|
119 |
+
|
120 |
+
/*
|
121 |
+
* Add Lang Text Domain
|
122 |
+
*/
|
123 |
+
public function wp_statistic_tinymce_plugin_add_locale($locales)
|
124 |
+
{
|
125 |
+
$locales ['wp-statistic-tinymce-plugin'] = WP_STATISTICS_DIR . 'includes/admin/TinyMCE/locale.php';
|
126 |
+
|
127 |
+
return $locales;
|
128 |
+
}
|
129 |
+
|
130 |
+
/*
|
131 |
+
* Add Lang for Text Widget
|
132 |
+
*/
|
133 |
+
public function my_post_edit_page_footer()
|
134 |
+
{
|
135 |
+
echo '
|
136 |
<script type="text/javascript">
|
137 |
jQuery( document ).on( \'tinymce-editor-setup\', function( event, editor ) {
|
138 |
editor.settings.toolbar1 += \',wp_statistic_tc_button\';
|
139 |
});
|
140 |
';
|
141 |
+
$lang = TinyMCE::lang();
|
142 |
+
echo $lang['translate'];
|
143 |
+
echo '
|
144 |
+
tinyMCEPreInit.load_ext("' . rtrim(WP_STATISTICS_URL, "/") . '", "' . $lang['locale'] . '");
|
145 |
</script>
|
146 |
';
|
147 |
+
}
|
148 |
}
|
149 |
|
150 |
new TinyMCE;
|
includes/admin/TinyMCE/locale.php
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
-
|
5 |
} // Exit if accessed directly
|
6 |
|
7 |
//Load TinyMCE Plugin translation
|
8 |
-
function wp_statistic_tinymce_plugin_translation()
|
9 |
-
|
|
|
10 |
$translated = $lang['translate'];
|
11 |
return $translated;
|
12 |
}
|
|
|
13 |
$strings = wp_statistic_tinymce_plugin_translation();
|
1 |
<?php
|
2 |
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
exit;
|
5 |
} // Exit if accessed directly
|
6 |
|
7 |
//Load TinyMCE Plugin translation
|
8 |
+
function wp_statistic_tinymce_plugin_translation()
|
9 |
+
{
|
10 |
+
$lang = \WP_STATISTICS\TinyMCE::lang();
|
11 |
$translated = $lang['translate'];
|
12 |
return $translated;
|
13 |
}
|
14 |
+
|
15 |
$strings = wp_statistic_tinymce_plugin_translation();
|
includes/admin/class-wp-statistics-admin-assets.php
CHANGED
@@ -277,7 +277,7 @@ class Admin_Assets
|
|
277 |
'er_valid_ip' => __('Please enter a valid ip.', 'wp-statistics'),
|
278 |
'please_wait' => __('Please Wait ...', 'wp-statistics'),
|
279 |
'user' => __('User', 'wp-statistics'),
|
280 |
-
'rest_connect'
|
281 |
);
|
282 |
|
283 |
// Rest-API Meta Box Url
|
277 |
'er_valid_ip' => __('Please enter a valid ip.', 'wp-statistics'),
|
278 |
'please_wait' => __('Please Wait ...', 'wp-statistics'),
|
279 |
'user' => __('User', 'wp-statistics'),
|
280 |
+
'rest_connect' => __('An error occurred while connecting to WordPress REST API. It seems blocked by one of your plugins or your theme.', 'wp-statistics'),
|
281 |
);
|
282 |
|
283 |
// Rest-API Meta Box Url
|
includes/admin/class-wp-statistics-admin-notices.php
CHANGED
@@ -50,12 +50,12 @@ class Admin_Notices
|
|
50 |
if (Option::get('use_cache_plugin') and false === ($check_rest_api = get_transient('check-wp-statistics-rest'))) {
|
51 |
|
52 |
// Check Connect To WordPress Rest API
|
53 |
-
$status
|
54 |
$message = '';
|
55 |
$request = wp_remote_get(get_rest_url(null, RestAPI::$namespace . '/check'), array('timeout' => 30, 'sslverify' => false));
|
56 |
|
57 |
if (is_wp_error($request)) {
|
58 |
-
$status
|
59 |
$message = $request->get_error_message();
|
60 |
} else {
|
61 |
$body = wp_remote_retrieve_body($request);
|
50 |
if (Option::get('use_cache_plugin') and false === ($check_rest_api = get_transient('check-wp-statistics-rest'))) {
|
51 |
|
52 |
// Check Connect To WordPress Rest API
|
53 |
+
$status = true;
|
54 |
$message = '';
|
55 |
$request = wp_remote_get(get_rest_url(null, RestAPI::$namespace . '/check'), array('timeout' => 30, 'sslverify' => false));
|
56 |
|
57 |
if (is_wp_error($request)) {
|
58 |
+
$status = false;
|
59 |
$message = $request->get_error_message();
|
60 |
} else {
|
61 |
$body = wp_remote_retrieve_body($request);
|
includes/admin/meta-box/wp-statistics-meta-box-countries.php
CHANGED
@@ -3,9 +3,6 @@
|
|
3 |
namespace WP_STATISTICS\MetaBox;
|
4 |
|
5 |
use WP_STATISTICS\Country;
|
6 |
-
use WP_STATISTICS\DB;
|
7 |
-
use WP_STATISTICS\Helper;
|
8 |
-
use WP_STATISTICS\Menus;
|
9 |
|
10 |
class countries
|
11 |
{
|
3 |
namespace WP_STATISTICS\MetaBox;
|
4 |
|
5 |
use WP_STATISTICS\Country;
|
|
|
|
|
|
|
6 |
|
7 |
class countries
|
8 |
{
|
includes/admin/meta-box/wp-statistics-meta-box-exclusions.php
CHANGED
@@ -4,7 +4,6 @@ namespace WP_STATISTICS\MetaBox;
|
|
4 |
|
5 |
use WP_STATISTICS\DB;
|
6 |
use WP_STATISTICS\Exclusion;
|
7 |
-
use WP_STATISTICS\Option;
|
8 |
use WP_STATISTICS\TimeZone;
|
9 |
|
10 |
class exclusions
|
4 |
|
5 |
use WP_STATISTICS\DB;
|
6 |
use WP_STATISTICS\Exclusion;
|
|
|
7 |
use WP_STATISTICS\TimeZone;
|
8 |
|
9 |
class exclusions
|
includes/admin/meta-box/wp-statistics-meta-box-post.php
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
namespace WP_STATISTICS\MetaBox;
|
4 |
|
5 |
-
use WP_STATISTICS\Option;
|
6 |
-
use WP_STATISTICS\RestAPI;
|
7 |
use WP_STATISTICS\TimeZone;
|
8 |
|
9 |
class post
|
2 |
|
3 |
namespace WP_STATISTICS\MetaBox;
|
4 |
|
|
|
|
|
5 |
use WP_STATISTICS\TimeZone;
|
6 |
|
7 |
class post
|
includes/admin/meta-box/wp-statistics-meta-box-top-pages-chart.php
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
|
3 |
namespace WP_STATISTICS\MetaBox;
|
4 |
|
5 |
-
use WP_STATISTICS\Option;
|
6 |
use WP_STATISTICS\TimeZone;
|
7 |
|
8 |
class top_pages_chart
|
2 |
|
3 |
namespace WP_STATISTICS\MetaBox;
|
4 |
|
|
|
5 |
use WP_STATISTICS\TimeZone;
|
6 |
|
7 |
class top_pages_chart
|
includes/admin/pages/class-wp-statistics-admin-page-optimization.php
CHANGED
@@ -31,7 +31,7 @@ class optimization_page
|
|
31 |
|
32 |
// Get List Table
|
33 |
$args['list_table'] = DB::table('all');
|
34 |
-
$args['result']
|
35 |
|
36 |
Admin_Template::get_template(array('layout/header', 'layout/tabs-optimization', 'layout/title-after', 'optimization', 'layout/footer'), $args);
|
37 |
}
|
@@ -107,7 +107,7 @@ class optimization_page
|
|
107 |
|
108 |
if (!empty($tables)) {
|
109 |
$notice = '';
|
110 |
-
$okay
|
111 |
|
112 |
// Use wp-admin/maint/repair.php
|
113 |
foreach ($tables as $table) {
|
@@ -125,9 +125,9 @@ class optimization_page
|
|
125 |
if ('OK' === $repair->Msg_text) {
|
126 |
$notice .= sprintf(__('Successfully repaired the %s table.', "wp-statistics"), "<code>$table</code>");
|
127 |
} else {
|
128 |
-
$notice
|
129 |
$problems[$table] = $check->Msg_text;
|
130 |
-
$okay
|
131 |
}
|
132 |
}
|
133 |
|
31 |
|
32 |
// Get List Table
|
33 |
$args['list_table'] = DB::table('all');
|
34 |
+
$args['result'] = DB::getTableRows();
|
35 |
|
36 |
Admin_Template::get_template(array('layout/header', 'layout/tabs-optimization', 'layout/title-after', 'optimization', 'layout/footer'), $args);
|
37 |
}
|
107 |
|
108 |
if (!empty($tables)) {
|
109 |
$notice = '';
|
110 |
+
$okay = true;
|
111 |
|
112 |
// Use wp-admin/maint/repair.php
|
113 |
foreach ($tables as $table) {
|
125 |
if ('OK' === $repair->Msg_text) {
|
126 |
$notice .= sprintf(__('Successfully repaired the %s table.', "wp-statistics"), "<code>$table</code>");
|
127 |
} else {
|
128 |
+
$notice .= sprintf(__('Failed to repair the %1$s table. Error: %2$s', "wp-statistics"), "<code>$table</code>", "<code>$check->Msg_text</code>") . '<br />';
|
129 |
$problems[$table] = $check->Msg_text;
|
130 |
+
$okay = false;
|
131 |
}
|
132 |
}
|
133 |
|
includes/admin/pages/class-wp-statistics-admin-page-pages.php
CHANGED
@@ -63,7 +63,7 @@ class pages_page
|
|
63 |
$args['title'] = __('Top Pages', 'wp-statistics');
|
64 |
|
65 |
// Get Current Page Url
|
66 |
-
$args['pageName']
|
67 |
$args['pagination'] = Admin_Template::getCurrentPaged();
|
68 |
|
69 |
// Get Date-Range
|
@@ -72,8 +72,8 @@ class pages_page
|
|
72 |
// Get List
|
73 |
$args['lists'] = \WP_STATISTICS\Pages::getTop(array(
|
74 |
'paged' => Admin_Template::getCurrentPaged(),
|
75 |
-
'from'
|
76 |
-
'to'
|
77 |
));
|
78 |
|
79 |
// Total Number
|
@@ -84,7 +84,7 @@ class pages_page
|
|
84 |
if ($args['total'] > 0) {
|
85 |
$args['pagination'] = Admin_Template::paginate_links(array(
|
86 |
'total' => $args['total'],
|
87 |
-
'echo'
|
88 |
));
|
89 |
}
|
90 |
|
@@ -101,16 +101,16 @@ class pages_page
|
|
101 |
global $wpdb;
|
102 |
|
103 |
// Page ID
|
104 |
-
$ID
|
105 |
$Type = esc_html($_GET['type']);
|
106 |
|
107 |
// Page title
|
108 |
$args['title'] = __('Page Statistics', 'wp-statistics');
|
109 |
|
110 |
// Get Current Page Url
|
111 |
-
$args['pageName']
|
112 |
$args['custom_get'] = array(
|
113 |
-
'ID'
|
114 |
'type' => $Type
|
115 |
);
|
116 |
|
@@ -140,7 +140,7 @@ class pages_page
|
|
140 |
|
141 |
// Create Select List For WordPress Terms
|
142 |
if ($_is_term and isset($query)) {
|
143 |
-
$this_term
|
144 |
$args['list'][$ID] = $this_term['title'];
|
145 |
foreach ($query as $item) {
|
146 |
$get_page_info = Pages::get_page_info($item['id'], $Type);
|
63 |
$args['title'] = __('Top Pages', 'wp-statistics');
|
64 |
|
65 |
// Get Current Page Url
|
66 |
+
$args['pageName'] = Menus::get_page_slug('pages');
|
67 |
$args['pagination'] = Admin_Template::getCurrentPaged();
|
68 |
|
69 |
// Get Date-Range
|
72 |
// Get List
|
73 |
$args['lists'] = \WP_STATISTICS\Pages::getTop(array(
|
74 |
'paged' => Admin_Template::getCurrentPaged(),
|
75 |
+
'from' => $args['DateRang']['from'],
|
76 |
+
'to' => $args['DateRang']['to']
|
77 |
));
|
78 |
|
79 |
// Total Number
|
84 |
if ($args['total'] > 0) {
|
85 |
$args['pagination'] = Admin_Template::paginate_links(array(
|
86 |
'total' => $args['total'],
|
87 |
+
'echo' => false
|
88 |
));
|
89 |
}
|
90 |
|
101 |
global $wpdb;
|
102 |
|
103 |
// Page ID
|
104 |
+
$ID = esc_html($_GET['ID']);
|
105 |
$Type = esc_html($_GET['type']);
|
106 |
|
107 |
// Page title
|
108 |
$args['title'] = __('Page Statistics', 'wp-statistics');
|
109 |
|
110 |
// Get Current Page Url
|
111 |
+
$args['pageName'] = Menus::get_page_slug('pages');
|
112 |
$args['custom_get'] = array(
|
113 |
+
'ID' => $ID,
|
114 |
'type' => $Type
|
115 |
);
|
116 |
|
140 |
|
141 |
// Create Select List For WordPress Terms
|
142 |
if ($_is_term and isset($query)) {
|
143 |
+
$this_term = Pages::get_page_info($ID, $Type);
|
144 |
$args['list'][$ID] = $this_term['title'];
|
145 |
foreach ($query as $item) {
|
146 |
$get_page_info = Pages::get_page_info($item['id'], $Type);
|
includes/admin/pages/class-wp-statistics-admin-page-plugins.php
CHANGED
@@ -87,9 +87,11 @@ class plugins_page
|
|
87 |
*/
|
88 |
public static function view()
|
89 |
{
|
90 |
-
|
91 |
// Activate or deactivate the selected plugin
|
92 |
-
if (isset($_GET['action'])) {
|
|
|
|
|
|
|
93 |
|
94 |
if ($_GET['action'] == 'activate') {
|
95 |
$result = activate_plugin($_GET['plugin'] . '/' . $_GET['plugin'] . '.php');
|
@@ -98,7 +100,6 @@ class plugins_page
|
|
98 |
} else {
|
99 |
Helper::wp_admin_notice(__('Add-On activated.', 'wp-statistics'), "success");
|
100 |
}
|
101 |
-
|
102 |
}
|
103 |
|
104 |
if ($_GET['action'] == 'deactivate') {
|
@@ -109,6 +110,9 @@ class plugins_page
|
|
109 |
Helper::wp_admin_notice(__('Add-On deactivated.', 'wp-statistics'), "success");
|
110 |
}
|
111 |
}
|
|
|
|
|
|
|
112 |
}
|
113 |
|
114 |
Admin_Template::get_template(array('plugins'), self::get_list_addons());
|
87 |
*/
|
88 |
public static function view()
|
89 |
{
|
|
|
90 |
// Activate or deactivate the selected plugin
|
91 |
+
if (isset($_GET['page']) && $_GET['page'] === 'wps_plugins_page' && isset($_GET['action']) && isset($_GET['plugin'])) {
|
92 |
+
|
93 |
+
// check the nonce
|
94 |
+
check_admin_referer($_GET['plugin']);
|
95 |
|
96 |
if ($_GET['action'] == 'activate') {
|
97 |
$result = activate_plugin($_GET['plugin'] . '/' . $_GET['plugin'] . '.php');
|
100 |
} else {
|
101 |
Helper::wp_admin_notice(__('Add-On activated.', 'wp-statistics'), "success");
|
102 |
}
|
|
|
103 |
}
|
104 |
|
105 |
if ($_GET['action'] == 'deactivate') {
|
110 |
Helper::wp_admin_notice(__('Add-On deactivated.', 'wp-statistics'), "success");
|
111 |
}
|
112 |
}
|
113 |
+
|
114 |
+
wp_safe_redirect(admin_url('admin.php?page=wps_plugins_page'));
|
115 |
+
exit();
|
116 |
}
|
117 |
|
118 |
Admin_Template::get_template(array('plugins'), self::get_list_addons());
|
includes/admin/templates/add-ons.php
CHANGED
@@ -45,11 +45,11 @@
|
|
45 |
</div>
|
46 |
<div class="column-compatibility">
|
47 |
<?php if (is_plugin_active($plugin->slug . '/' . $plugin->slug . '.php')) { ?>
|
48 |
-
<a href="<?php echo WP_STATISTICS\Menus::admin_url('plugins', array('action' => 'deactivate', 'plugin' => $plugin->slug)); ?>" class="button"><?php _e('Deactivate Add-On', 'wp-statistics'); ?></a>
|
49 |
<?php } else { ?><?php if (file_exists(
|
50 |
WP_PLUGIN_DIR . '/' . $plugin->slug . '/' . $plugin->slug . '.php'
|
51 |
)) { ?>
|
52 |
-
<a href="<?php echo WP_STATISTICS\Menus::admin_url('plugins', array('action' => 'activate', 'plugin' => $plugin->slug)); ?>" class="button"><?php _e('Activate Add-On', 'wp-statistics'); ?></a>
|
53 |
<?php } else { ?>
|
54 |
<div class="column-price">
|
55 |
<strong>$<?php echo $plugin->price; ?></strong>
|
45 |
</div>
|
46 |
<div class="column-compatibility">
|
47 |
<?php if (is_plugin_active($plugin->slug . '/' . $plugin->slug . '.php')) { ?>
|
48 |
+
<a href="<?php echo wp_nonce_url(WP_STATISTICS\Menus::admin_url('plugins', array('action' => 'deactivate', 'plugin' => $plugin->slug)), $plugin->slug); ?>" class="button"><?php _e('Deactivate Add-On', 'wp-statistics'); ?></a>
|
49 |
<?php } else { ?><?php if (file_exists(
|
50 |
WP_PLUGIN_DIR . '/' . $plugin->slug . '/' . $plugin->slug . '.php'
|
51 |
)) { ?>
|
52 |
+
<a href="<?php echo wp_nonce_url(WP_STATISTICS\Menus::admin_url('plugins', array('action' => 'activate', 'plugin' => $plugin->slug)), $plugin->slug); ?>" class="button"><?php _e('Activate Add-On', 'wp-statistics'); ?></a>
|
53 |
<?php } else { ?>
|
54 |
<div class="column-price">
|
55 |
<strong>$<?php echo $plugin->price; ?></strong>
|
includes/admin/templates/layout/date.range.php
CHANGED
@@ -2,9 +2,8 @@
|
|
2 |
<?php
|
3 |
if (isset($select_box)) {
|
4 |
?>
|
5 |
-
<br
|
6 |
-
<?php echo $select_box['title']; ?>:
|
7 |
-
<select name="<?php echo $select_box['name']; ?>" id="<?php echo $select_box['name']; ?>">
|
8 |
<?php
|
9 |
foreach ($select_box['list'] as $value => $name) {
|
10 |
$selected = ((isset($select_box['active']) and $select_box['active'] == $value) ? ' selected' : '');
|
@@ -13,7 +12,7 @@
|
|
13 |
<?php
|
14 |
}
|
15 |
?>
|
16 |
-
</select><input type="submit" value="<?php _e('Select', 'wp-statistics'); ?>" class="button-primary btn-danger wps-btn-inline"><br
|
17 |
<?php
|
18 |
}
|
19 |
?>
|
2 |
<?php
|
3 |
if (isset($select_box)) {
|
4 |
?>
|
5 |
+
<br/>
|
6 |
+
<?php echo $select_box['title']; ?>: <select name="<?php echo $select_box['name']; ?>" id="<?php echo $select_box['name']; ?>">
|
|
|
7 |
<?php
|
8 |
foreach ($select_box['list'] as $value => $name) {
|
9 |
$selected = ((isset($select_box['active']) and $select_box['active'] == $value) ? ' selected' : '');
|
12 |
<?php
|
13 |
}
|
14 |
?>
|
15 |
+
</select><input type="submit" value="<?php _e('Select', 'wp-statistics'); ?>" class="button-primary btn-danger wps-btn-inline"><br/>
|
16 |
<?php
|
17 |
}
|
18 |
?>
|
includes/admin/templates/layout/footer.php
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
</div>
|
2 |
-
</div>
|
1 |
+
</div></div>
|
|
includes/admin/templates/layout/header.php
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<div class="wrap wps-wrap<?php echo(isset($class) ? ' ' . $class : ''); ?>">
|
2 |
-
<?php require_once WP_STATISTICS_DIR . "/includes/admin/templates/header.php";
|
1 |
<div class="wrap wps-wrap<?php echo(isset($class) ? ' ' . $class : ''); ?>">
|
2 |
+
<?php require_once WP_STATISTICS_DIR . "/includes/admin/templates/header.php"; ?>
|
includes/admin/templates/layout/postbox.hide.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<script type="text/javascript">
|
2 |
jQuery(document).ready(function ($) {
|
3 |
-
$(".postbox button.handlediv").click(function(){
|
4 |
-
|
5 |
});
|
6 |
});
|
7 |
</script>
|
1 |
<script type="text/javascript">
|
2 |
jQuery(document).ready(function ($) {
|
3 |
+
$(".postbox button.handlediv").click(function () {
|
4 |
+
$(this).parent('.postbox').toggleClass("closed");
|
5 |
});
|
6 |
});
|
7 |
</script>
|
includes/admin/templates/layout/tabs-settings.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<ul class="tabs">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
</ul>
|
1 |
<ul class="tabs">
|
2 |
+
<?php if ($wps_admin) { ?>
|
3 |
+
<li class="tab-link current" data-tab="general-settings"><?php _e('General', 'wp-statistics'); ?></li>
|
4 |
+
<li class="tab-link" data-tab="visitor-ip-settings"><?php _e('Visitor IP', 'wp-statistics'); ?></li>
|
5 |
+
<li class="tab-link" data-tab="privacy-settings"><?php _e('Privacy', 'wp-statistics'); ?></li>
|
6 |
+
<li class="tab-link" data-tab="notifications-settings"><?php _e('Notifications', 'wp-statistics'); ?></li>
|
7 |
+
<li class="tab-link" data-tab="overview-display-settings"><?php _e('Dashboard', 'wp-statistics'); ?></li>
|
8 |
+
<li class="tab-link" data-tab="access-settings"><?php _e('Roles', 'wp-statistics'); ?></li>
|
9 |
+
<li class="tab-link" data-tab="exclusions-settings"><?php _e('Exclusions', 'wp-statistics'); ?></li>
|
10 |
+
<li class="tab-link" data-tab="wp-cli-settings"><?php _e('CLI', 'wp-statistics'); ?></li>
|
11 |
+
<li class="tab-link" data-tab="externals-settings"><?php _e('Externals', 'wp-statistics'); ?></li>
|
12 |
+
<li class="tab-link" data-tab="maintenance-settings"><?php _e('Maintenance', 'wp-statistics'); ?></li>
|
13 |
+
<li class="tab-link" data-tab="reset-settings"><?php _e('Reset', 'wp-statistics'); ?></li>
|
14 |
+
<li class="tab-link" data-tab="about"><?php _e('About', 'wp-statistics'); ?></li>
|
15 |
+
<?php } ?>
|
16 |
</ul>
|
includes/admin/templates/layout/title-after.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<div class="wps-wrap__main">
|
2 |
-
<h2 class="wps_title"></h2>
|
3 |
-
<?php do_action('wp_statistics_after_admin_page_title'); ?>
|
4 |
-
<div class="wp-clearfix"></div>
|
1 |
<div class="wps-wrap__main">
|
2 |
+
<h2 class="wps_title"></h2>
|
3 |
+
<?php do_action('wp_statistics_after_admin_page_title'); ?>
|
4 |
+
<div class="wp-clearfix"></div>
|
includes/admin/templates/layout/title.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<div class="wps-wrap__main">
|
2 |
-
<h2 class="wps_title"><?php echo(isset($title) ? $title : (function_exists('get_admin_page_title') ? get_admin_page_title() : '')); ?></h2>
|
3 |
-
<?php do_action('wp_statistics_after_admin_page_title'); ?>
|
4 |
-
<div class="wp-clearfix"></div>
|
1 |
<div class="wps-wrap__main">
|
2 |
+
<h2 class="wps_title"><?php echo(isset($title) ? $title : (function_exists('get_admin_page_title') ? get_admin_page_title() : '')); ?></h2>
|
3 |
+
<?php do_action('wp_statistics_after_admin_page_title'); ?>
|
4 |
+
<div class="wp-clearfix"></div>
|
includes/admin/templates/optimization/database.php
CHANGED
@@ -3,19 +3,17 @@
|
|
3 |
<table class="form-table">
|
4 |
<tbody>
|
5 |
<tr valign="top">
|
6 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
7 |
</tr>
|
8 |
|
9 |
<tr valign="top">
|
10 |
<th scope="row">
|
11 |
-
<label for="index-submit"><?php _e(
|
12 |
</th>
|
13 |
<td>
|
14 |
-
<input id="install-submit" class="button button-primary" type="button"
|
15 |
-
|
16 |
-
|
17 |
-
<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.',
|
18 |
-
'wp-statistics' ); ?></p>
|
19 |
</td>
|
20 |
</tr>
|
21 |
</tbody>
|
@@ -26,12 +24,12 @@
|
|
26 |
<tbody>
|
27 |
<tr valign="top">
|
28 |
<th scope="row" colspan="2">
|
29 |
-
<h3><?php _e(
|
30 |
</tr>
|
31 |
|
32 |
<tr valign="top">
|
33 |
<th scope="row">
|
34 |
-
<label for="index-submit"><?php _e(
|
35 |
</th>
|
36 |
<td>
|
37 |
<script type="text/javascript">
|
@@ -39,7 +37,7 @@
|
|
39 |
jQuery("#wp-statistics-run-optimize-database-table").click(function () {
|
40 |
var tbl = jQuery('#optimize-table').val();
|
41 |
if (tbl == "0") {
|
42 |
-
alert('<?php _e(
|
43 |
return;
|
44 |
}
|
45 |
window.location.href = document.URL + '&optimize-table=' + tbl + '&tab=database';
|
@@ -47,21 +45,19 @@
|
|
47 |
});
|
48 |
</script>
|
49 |
|
50 |
-
<select dir="<?php echo(
|
51 |
-
<option value="0"><?php _e(
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
<option value="all"><?php echo __(
|
58 |
</select>
|
59 |
-
<p class="description"><?php _e(
|
60 |
-
|
61 |
|
62 |
-
<input id="wp-statistics-run-optimize-database-table" class="button button-primary" type="button"
|
63 |
-
value="<?php _e( 'Run Now!', 'wp-statistics' ); ?>"
|
64 |
-
name="wp-statistics-run-optimize-database-table" style="margin-top:5px;">
|
65 |
</td>
|
66 |
</tr>
|
67 |
|
3 |
<table class="form-table">
|
4 |
<tbody>
|
5 |
<tr valign="top">
|
6 |
+
<th scope="row" colspan="2"><h3><?php _e('Database Setup', 'wp-statistics'); ?></h3></th>
|
7 |
</tr>
|
8 |
|
9 |
<tr valign="top">
|
10 |
<th scope="row">
|
11 |
+
<label for="index-submit"><?php _e('Re-run Install:', 'wp-statistics'); ?></label>
|
12 |
</th>
|
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.',
|
16 |
+
'wp-statistics'); ?></p>
|
|
|
|
|
17 |
</td>
|
18 |
</tr>
|
19 |
</tbody>
|
24 |
<tbody>
|
25 |
<tr valign="top">
|
26 |
<th scope="row" colspan="2">
|
27 |
+
<h3><?php _e('Repair and Optimization Database Tables', 'wp-statistics'); ?></h3></th>
|
28 |
</tr>
|
29 |
|
30 |
<tr valign="top">
|
31 |
<th scope="row">
|
32 |
+
<label for="index-submit"><?php _e('Optimize Table:', 'wp-statistics'); ?></label>
|
33 |
</th>
|
34 |
<td>
|
35 |
<script type="text/javascript">
|
37 |
jQuery("#wp-statistics-run-optimize-database-table").click(function () {
|
38 |
var tbl = jQuery('#optimize-table').val();
|
39 |
if (tbl == "0") {
|
40 |
+
alert('<?php _e("Please select database table", "wp-statistics"); ?>');
|
41 |
return;
|
42 |
}
|
43 |
window.location.href = document.URL + '&optimize-table=' + tbl + '&tab=database';
|
45 |
});
|
46 |
</script>
|
47 |
|
48 |
+
<select dir="<?php echo(is_rtl() ? 'rtl' : 'ltr'); ?>" id="optimize-table" name="optimize-table">
|
49 |
+
<option value="0"><?php _e('Please select', 'wp-statistics'); ?></option>
|
50 |
+
<?php
|
51 |
+
foreach (WP_STATISTICS\DB::table('all') as $tbl_key => $tbl_name) {
|
52 |
+
echo '<option value="' . $tbl_key . '">' . $tbl_name . '</option>';
|
53 |
+
}
|
54 |
+
?>
|
55 |
+
<option value="all"><?php echo __('All', 'wp-statistics'); ?></option>
|
56 |
</select>
|
57 |
+
<p class="description"><?php _e('Please select the table you would like to optimize and repair',
|
58 |
+
'wp-statistics'); ?></p>
|
59 |
|
60 |
+
<input id="wp-statistics-run-optimize-database-table" class="button button-primary" type="button" value="<?php _e('Run Now!', 'wp-statistics'); ?>" name="wp-statistics-run-optimize-database-table" style="margin-top:5px;">
|
|
|
|
|
61 |
</td>
|
62 |
</tr>
|
63 |
|
includes/admin/templates/optimization/export.php
CHANGED
@@ -2,63 +2,63 @@
|
|
2 |
<div class="postbox">
|
3 |
<form method="post">
|
4 |
<input type="hidden" name="wps_export" value="true">
|
5 |
-
|
6 |
<table class="form-table">
|
7 |
<tbody>
|
8 |
<tr valign="top">
|
9 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
10 |
</tr>
|
11 |
|
12 |
<tr valign="top">
|
13 |
<th scope="row">
|
14 |
-
<label for="table-to-export"><?php _e(
|
15 |
</th>
|
16 |
|
17 |
<td>
|
18 |
-
<select dir="<?php echo(
|
19 |
-
<option value=""><?php _e(
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
</select>
|
29 |
|
30 |
-
<p class="description"><?php _e(
|
31 |
-
|
32 |
</td>
|
33 |
</tr>
|
34 |
|
35 |
<tr valign="top">
|
36 |
<th scope="row">
|
37 |
-
<label for="export-file-type"><?php _e(
|
38 |
</th>
|
39 |
|
40 |
<td>
|
41 |
<select dir="ltr" id="export-file-type" name="export-file-type" required>
|
42 |
-
<option value=""><?php _e(
|
43 |
<option value="xml">XML</option>
|
44 |
<option value="csv">CSV</option>
|
45 |
<option value="tsv">TSV</option>
|
46 |
</select>
|
47 |
|
48 |
-
<p class="description"><?php _e(
|
49 |
</td>
|
50 |
</tr>
|
51 |
|
52 |
<tr valign="top">
|
53 |
<th scope="row">
|
54 |
-
<label for="export-headers"><?php _e(
|
55 |
</th>
|
56 |
|
57 |
<td>
|
58 |
<input id="export-headers" type="checkbox" value="1" name="export-headers">
|
59 |
-
<p class="description"><?php _e(
|
60 |
-
|
61 |
-
|
62 |
</td>
|
63 |
</tr>
|
64 |
|
2 |
<div class="postbox">
|
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">
|
9 |
+
<th scope="row" colspan="2"><h3><?php _e('Export', 'wp-statistics'); ?></h3></th>
|
10 |
</tr>
|
11 |
|
12 |
<tr valign="top">
|
13 |
<th scope="row">
|
14 |
+
<label for="table-to-export"><?php _e('Export from:', 'wp-statistics'); ?></label>
|
15 |
</th>
|
16 |
|
17 |
<td>
|
18 |
+
<select dir="<?php echo(is_rtl() ? 'rtl' : 'ltr'); ?>" id="table-to-export" name="table-to-export" required>
|
19 |
+
<option value=""><?php _e('Please select', 'wp-statistics'); ?></option>
|
20 |
+
<?php
|
21 |
+
foreach (
|
22 |
+
WP_STATISTICS\DB::table('all',
|
23 |
+
array('historical', 'visitor_relationships')) as $tbl_key => $tbl_name
|
24 |
+
) {
|
25 |
+
echo '<option value="' . $tbl_key . '">' . $tbl_name . '</option>';
|
26 |
+
}
|
27 |
+
?>
|
28 |
</select>
|
29 |
|
30 |
+
<p class="description"><?php _e('Select the table for the output file.',
|
31 |
+
'wp-statistics'); ?></p>
|
32 |
</td>
|
33 |
</tr>
|
34 |
|
35 |
<tr valign="top">
|
36 |
<th scope="row">
|
37 |
+
<label for="export-file-type"><?php _e('Export To:', 'wp-statistics'); ?></label>
|
38 |
</th>
|
39 |
|
40 |
<td>
|
41 |
<select dir="ltr" id="export-file-type" name="export-file-type" required>
|
42 |
+
<option value=""><?php _e('Please select', 'wp-statistics'); ?></option>
|
43 |
<option value="xml">XML</option>
|
44 |
<option value="csv">CSV</option>
|
45 |
<option value="tsv">TSV</option>
|
46 |
</select>
|
47 |
|
48 |
+
<p class="description"><?php _e('Select the output file type.', 'wp-statistics'); ?></p>
|
49 |
</td>
|
50 |
</tr>
|
51 |
|
52 |
<tr valign="top">
|
53 |
<th scope="row">
|
54 |
+
<label for="export-headers"><?php _e('Include Header Row:', 'wp-statistics'); ?></label>
|
55 |
</th>
|
56 |
|
57 |
<td>
|
58 |
<input id="export-headers" type="checkbox" value="1" name="export-headers">
|
59 |
+
<p class="description"><?php _e('Include a header row as the first line of the exported file.',
|
60 |
+
'wp-statistics'); ?></p>
|
61 |
+
<?php submit_button(__('Start Now!', 'wp-statistics'), 'primary', 'export-file-submit'); ?>
|
62 |
</td>
|
63 |
</tr>
|
64 |
|
includes/admin/templates/optimization/historical.php
CHANGED
@@ -9,46 +9,46 @@ $historical_visits = WP_STATISTICS\Historical::get('visits');
|
|
9 |
<div class="wrap wps-wrap">
|
10 |
<div class="postbox">
|
11 |
<form id="wps_historical_form" method="post">
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
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 |
</div>
|
54 |
</div>
|
9 |
<div class="wrap wps-wrap">
|
10 |
<div class="postbox">
|
11 |
<form id="wps_historical_form" method="post">
|
12 |
+
<?php wp_nonce_field('historical_form', 'wp-statistics-nonce'); ?>
|
13 |
+
<table class="form-table">
|
14 |
+
<tbody>
|
15 |
+
<tr valign="top">
|
16 |
+
<th scope="row" colspan="2"><h3><?php _e('Historical Values', 'wp-statistics'); ?></h3></th>
|
17 |
+
</tr>
|
18 |
|
19 |
+
<tr valign="top" id="wps_historical_purge" style="display: none">
|
20 |
+
<th scope="row" colspan=2>
|
21 |
+
<?php _e('Note: As you have just purged the database you must reload this page for these numbers to be correct.', 'wp-statistics'); ?>
|
22 |
+
</th>
|
23 |
+
</tr>
|
24 |
|
25 |
+
<tr valign="top">
|
26 |
+
<th scope="row">
|
27 |
+
<?php _e('Visitors', 'wp-statistics'); ?>:
|
28 |
+
</th>
|
29 |
+
<td>
|
30 |
+
<input type="text" size="10" value="<?php echo $historical_visitors; ?>" id="wps_historical_visitors" name="wps_historical_visitors">
|
31 |
+
<p class="description"><?php echo sprintf(__('Number of historical number of visitors to the site (current value is %s).', 'wp-statistics'), number_format_i18n($historical_visitors)); ?></p>
|
32 |
+
</td>
|
33 |
+
</tr>
|
34 |
|
35 |
+
<tr valign="top">
|
36 |
+
<th scope="row">
|
37 |
+
<?php _e('Visits', 'wp-statistics'); ?>:
|
38 |
+
</th>
|
39 |
+
<td>
|
40 |
+
<input type="text" size="10" value="<?php echo $historical_visits; ?>" id="wps_historical_visits" name="wps_historical_visits">
|
41 |
+
<p class="description"><?php echo sprintf(__('Number of historical number of visits to the site (current value is %s).', 'wp-statistics'), number_format_i18n($historical_visits)); ?></p>
|
42 |
+
</td>
|
43 |
+
</tr>
|
44 |
|
45 |
+
<tr valign="top">
|
46 |
+
<td colspan=2>
|
47 |
+
<input id="historical-submit" class="button button-primary" type="submit" value="<?php _e('Update Now!', 'wp-statistics'); ?>" name="historical-submit"/>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
</tbody>
|
51 |
+
</table>
|
52 |
+
</form>
|
53 |
</div>
|
54 |
</div>
|
includes/admin/templates/optimization/purging.php
CHANGED
@@ -7,20 +7,20 @@
|
|
7 |
if (action == 0)
|
8 |
return false;
|
9 |
|
10 |
-
var agree = confirm('<?php _e(
|
11 |
|
12 |
if (!agree)
|
13 |
return false;
|
14 |
|
15 |
jQuery("#purge-data-submit").attr("disabled", "disabled");
|
16 |
-
jQuery("#purge-data-status").html("<img src='<?php echo plugins_url(
|
17 |
jQuery.ajax({
|
18 |
url: ajaxurl,
|
19 |
type: 'post',
|
20 |
data: {
|
21 |
'action': 'wp_statistics_purge_data',
|
22 |
'purge-days': action,
|
23 |
-
'wps_nonce': '<?php echo wp_create_nonce(
|
24 |
},
|
25 |
datatype: 'json',
|
26 |
})
|
@@ -39,20 +39,20 @@
|
|
39 |
if (action == 0)
|
40 |
return false;
|
41 |
|
42 |
-
var agree = confirm('<?php _e(
|
43 |
|
44 |
if (!agree)
|
45 |
return false;
|
46 |
|
47 |
jQuery("#purge-visitor-hits-submit").attr("disabled", "disabled");
|
48 |
-
jQuery("#purge-visitor-hits-status").html("<img src='<?php echo plugins_url(
|
49 |
jQuery.ajax({
|
50 |
url: ajaxurl,
|
51 |
type: 'post',
|
52 |
data: {
|
53 |
'action': 'wp_statistics_purge_visitor_hits',
|
54 |
'purge-hits': action,
|
55 |
-
'wps_nonce': '<?php echo wp_create_nonce(
|
56 |
},
|
57 |
datatype: 'json',
|
58 |
})
|
@@ -70,20 +70,20 @@
|
|
70 |
if (action == 0)
|
71 |
return false;
|
72 |
|
73 |
-
var agree = confirm('<?php _e(
|
74 |
|
75 |
if (!agree)
|
76 |
return false;
|
77 |
|
78 |
jQuery("#empty-table-submit").attr("disabled", "disabled");
|
79 |
-
jQuery("#empty-status").html("<img src='<?php echo plugins_url(
|
80 |
jQuery.ajax({
|
81 |
url: ajaxurl,
|
82 |
type: 'post',
|
83 |
data: {
|
84 |
'action': 'wp_statistics_empty_table',
|
85 |
'table-name': action,
|
86 |
-
'wps_nonce': '<?php echo wp_create_nonce(
|
87 |
},
|
88 |
datatype: 'json',
|
89 |
})
|
@@ -101,20 +101,20 @@
|
|
101 |
if (action == 0)
|
102 |
return false;
|
103 |
|
104 |
-
var agree = confirm('<?php _e(
|
105 |
|
106 |
if (!agree)
|
107 |
return false;
|
108 |
|
109 |
jQuery("#delete-agents-submit").attr("disabled", "disabled");
|
110 |
-
jQuery("#delete-agents-status").html("<img src='<?php echo plugins_url(
|
111 |
jQuery.ajax({
|
112 |
url: ajaxurl,
|
113 |
type: 'post',
|
114 |
data: {
|
115 |
'action': 'wp_statistics_delete_agents',
|
116 |
'agent-name': action,
|
117 |
-
'wps_nonce': '<?php echo wp_create_nonce(
|
118 |
},
|
119 |
datatype: 'json',
|
120 |
})
|
@@ -134,20 +134,20 @@
|
|
134 |
if (action == 0)
|
135 |
return false;
|
136 |
|
137 |
-
var agree = confirm('<?php _e(
|
138 |
|
139 |
if (!agree)
|
140 |
return false;
|
141 |
|
142 |
jQuery("#delete-platforms-submit").attr("disabled", "disabled");
|
143 |
-
jQuery("#delete-platforms-status").html("<img src='<?php echo plugins_url(
|
144 |
jQuery.ajax({
|
145 |
url: ajaxurl,
|
146 |
type: 'post',
|
147 |
data: {
|
148 |
'action': 'wp_statistics_delete_platforms',
|
149 |
'platform-name': action,
|
150 |
-
'wps_nonce': '<?php echo wp_create_nonce(
|
151 |
},
|
152 |
datatype: 'json',
|
153 |
})
|
@@ -167,20 +167,20 @@
|
|
167 |
if (value == 0)
|
168 |
return false;
|
169 |
|
170 |
-
var agree = confirm('<?php _e(
|
171 |
|
172 |
if (!agree)
|
173 |
return false;
|
174 |
|
175 |
jQuery("#delete-ip-submit").attr("disabled", "disabled");
|
176 |
-
jQuery("#delete-ip-status").html("<img src='<?php echo plugins_url(
|
177 |
jQuery.ajax({
|
178 |
url: ajaxurl,
|
179 |
type: 'post',
|
180 |
data: {
|
181 |
'action': 'wp_statistics_delete_ip',
|
182 |
'ip-address': value,
|
183 |
-
'wps_nonce': '<?php echo wp_create_nonce(
|
184 |
},
|
185 |
datatype: 'json',
|
186 |
})
|
@@ -198,28 +198,28 @@
|
|
198 |
<table class="form-table">
|
199 |
<tbody>
|
200 |
<tr valign="top">
|
201 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
202 |
</tr>
|
203 |
|
204 |
<tr valign="top">
|
205 |
<th scope="row">
|
206 |
-
<label for="empty-table"><?php _e(
|
207 |
</th>
|
208 |
|
209 |
<td>
|
210 |
-
<select dir="<?php echo(
|
211 |
-
<option value="0"><?php _e(
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
<option value="all"><?php echo __(
|
218 |
</select>
|
219 |
|
220 |
-
<p class="description"><?php _e(
|
221 |
-
<input id="empty-table-submit" class="button button-primary" type="submit" value="<?php _e(
|
222 |
-
|
223 |
<span id="empty-status"></span>
|
224 |
<div id="empty-result"></div>
|
225 |
</td>
|
@@ -227,17 +227,17 @@
|
|
227 |
|
228 |
<tr>
|
229 |
<th scope="row">
|
230 |
-
<label for="purge-data"><?php _e(
|
231 |
</th>
|
232 |
|
233 |
<td>
|
234 |
<input type="text" class="small-text code" id="purge-data" name="wps_purge_data" value="365"/>
|
235 |
-
<label for="purge-data"><?php _e(
|
236 |
|
237 |
-
<p class="description"><?php echo __(
|
238 |
-
|
239 |
-
<input id="purge-data-submit" class="button button-primary" type="submit" value="<?php _e(
|
240 |
-
|
241 |
<span id="purge-data-status"></span>
|
242 |
<div id="purge-data-result"></div>
|
243 |
</td>
|
@@ -245,20 +245,20 @@
|
|
245 |
|
246 |
<tr>
|
247 |
<th scope="row">
|
248 |
-
<label for="purge-visitor-hits"><?php _e(
|
249 |
-
|
250 |
</th>
|
251 |
|
252 |
<td>
|
253 |
<input type="text" class="small-text code" id="purge-visitor-hits" name="wps_purge_visitor_hits" value="10"/>
|
254 |
-
<label for="purge-visitor-hits"><?php _e(
|
255 |
-
|
256 |
-
<p class="description"><?php echo __(
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
<input id="purge-visitor-hits-submit" class="button button-primary" type="submit" value="<?php _e(
|
261 |
-
|
262 |
<span id="purge-visitor-hits-status"></span>
|
263 |
<div id="purge-visitor-hits-result"></div>
|
264 |
</td>
|
@@ -270,30 +270,30 @@
|
|
270 |
<table class="form-table">
|
271 |
<tbody>
|
272 |
<tr valign="top">
|
273 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
274 |
</tr>
|
275 |
|
276 |
<tr valign="top">
|
277 |
<th scope="row">
|
278 |
-
<label for="delete-agent"><?php _e(
|
279 |
</th>
|
280 |
|
281 |
<td>
|
282 |
<select dir="ltr" id="delete-agent" name="delete-agent">
|
283 |
-
<option value="0"><?php _e(
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
</select>
|
292 |
|
293 |
-
<p class="description"><?php _e(
|
294 |
-
|
295 |
-
<input id="delete-agents-submit" class="button button-primary" type="submit" value="<?php _e(
|
296 |
-
|
297 |
<span id="delete-agents-status"></span>
|
298 |
<div id="delete-agents-result"></div>
|
299 |
</td>
|
@@ -301,27 +301,27 @@
|
|
301 |
|
302 |
<tr valign="top">
|
303 |
<th scope="row">
|
304 |
-
<label for="delete-platform"><?php _e(
|
305 |
</th>
|
306 |
|
307 |
<td>
|
308 |
<select dir="ltr" id="delete-platform" name="delete-platform">
|
309 |
-
<option value="0"><?php _e(
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
</select>
|
320 |
|
321 |
-
<p class="description"><?php _e(
|
322 |
-
|
323 |
-
<input id="delete-platforms-submit" class="button button-primary" type="submit" value="<?php _e(
|
324 |
-
|
325 |
<span id="delete-platforms-status"></span>
|
326 |
<div id="delete-platforms-result"></div>
|
327 |
</td>
|
@@ -329,16 +329,16 @@
|
|
329 |
|
330 |
<tr valign="top">
|
331 |
<th scope="row">
|
332 |
-
<label for="delete-ip"><?php _e(
|
333 |
</th>
|
334 |
|
335 |
<td>
|
336 |
<input dir="ltr" id="delete-ip" type="text" name="delete-ip"/>
|
337 |
|
338 |
-
<p class="description"><?php _e(
|
339 |
-
|
340 |
-
<input id="delete-ip-submit" class="button button-primary" type="submit" value="<?php _e(
|
341 |
-
|
342 |
<span id="delete-ip-status"></span>
|
343 |
<div id="delete-ip-result"></div>
|
344 |
</td>
|
7 |
if (action == 0)
|
8 |
return false;
|
9 |
|
10 |
+
var agree = confirm('<?php _e('Are you sure?', 'wp-statistics'); ?>');
|
11 |
|
12 |
if (!agree)
|
13 |
return false;
|
14 |
|
15 |
jQuery("#purge-data-submit").attr("disabled", "disabled");
|
16 |
+
jQuery("#purge-data-status").html("<img src='<?php echo plugins_url('wp-statistics'); ?>/assets/images/loading.gif'/>");
|
17 |
jQuery.ajax({
|
18 |
url: ajaxurl,
|
19 |
type: 'post',
|
20 |
data: {
|
21 |
'action': 'wp_statistics_purge_data',
|
22 |
'purge-days': action,
|
23 |
+
'wps_nonce': '<?php echo wp_create_nonce('wp_rest'); ?>'
|
24 |
},
|
25 |
datatype: 'json',
|
26 |
})
|
39 |
if (action == 0)
|
40 |
return false;
|
41 |
|
42 |
+
var agree = confirm('<?php _e('Are you sure?', 'wp-statistics'); ?>');
|
43 |
|
44 |
if (!agree)
|
45 |
return false;
|
46 |
|
47 |
jQuery("#purge-visitor-hits-submit").attr("disabled", "disabled");
|
48 |
+
jQuery("#purge-visitor-hits-status").html("<img src='<?php echo plugins_url('wp-statistics'); ?>/assets/images/loading.gif'/>");
|
49 |
jQuery.ajax({
|
50 |
url: ajaxurl,
|
51 |
type: 'post',
|
52 |
data: {
|
53 |
'action': 'wp_statistics_purge_visitor_hits',
|
54 |
'purge-hits': action,
|
55 |
+
'wps_nonce': '<?php echo wp_create_nonce('wp_rest'); ?>'
|
56 |
},
|
57 |
datatype: 'json',
|
58 |
})
|
70 |
if (action == 0)
|
71 |
return false;
|
72 |
|
73 |
+
var agree = confirm('<?php _e('Are you sure?', 'wp-statistics'); ?>');
|
74 |
|
75 |
if (!agree)
|
76 |
return false;
|
77 |
|
78 |
jQuery("#empty-table-submit").attr("disabled", "disabled");
|
79 |
+
jQuery("#empty-status").html("<img src='<?php echo plugins_url('wp-statistics'); ?>/assets/images/loading.gif'/>");
|
80 |
jQuery.ajax({
|
81 |
url: ajaxurl,
|
82 |
type: 'post',
|
83 |
data: {
|
84 |
'action': 'wp_statistics_empty_table',
|
85 |
'table-name': action,
|
86 |
+
'wps_nonce': '<?php echo wp_create_nonce('wp_rest'); ?>'
|
87 |
},
|
88 |
datatype: 'json',
|
89 |
})
|
101 |
if (action == 0)
|
102 |
return false;
|
103 |
|
104 |
+
var agree = confirm('<?php _e('Are you sure?', 'wp-statistics'); ?>');
|
105 |
|
106 |
if (!agree)
|
107 |
return false;
|
108 |
|
109 |
jQuery("#delete-agents-submit").attr("disabled", "disabled");
|
110 |
+
jQuery("#delete-agents-status").html("<img src='<?php echo plugins_url('wp-statistics'); ?>/assets/images/loading.gif'/>");
|
111 |
jQuery.ajax({
|
112 |
url: ajaxurl,
|
113 |
type: 'post',
|
114 |
data: {
|
115 |
'action': 'wp_statistics_delete_agents',
|
116 |
'agent-name': action,
|
117 |
+
'wps_nonce': '<?php echo wp_create_nonce('wp_rest'); ?>'
|
118 |
},
|
119 |
datatype: 'json',
|
120 |
})
|
134 |
if (action == 0)
|
135 |
return false;
|
136 |
|
137 |
+
var agree = confirm('<?php _e('Are you sure?', 'wp-statistics'); ?>');
|
138 |
|
139 |
if (!agree)
|
140 |
return false;
|
141 |
|
142 |
jQuery("#delete-platforms-submit").attr("disabled", "disabled");
|
143 |
+
jQuery("#delete-platforms-status").html("<img src='<?php echo plugins_url('wp-statistics'); ?>/assets/images/loading.gif'/>");
|
144 |
jQuery.ajax({
|
145 |
url: ajaxurl,
|
146 |
type: 'post',
|
147 |
data: {
|
148 |
'action': 'wp_statistics_delete_platforms',
|
149 |
'platform-name': action,
|
150 |
+
'wps_nonce': '<?php echo wp_create_nonce('wp_rest'); ?>'
|
151 |
},
|
152 |
datatype: 'json',
|
153 |
})
|
167 |
if (value == 0)
|
168 |
return false;
|
169 |
|
170 |
+
var agree = confirm('<?php _e('Are you sure?', 'wp-statistics'); ?>');
|
171 |
|
172 |
if (!agree)
|
173 |
return false;
|
174 |
|
175 |
jQuery("#delete-ip-submit").attr("disabled", "disabled");
|
176 |
+
jQuery("#delete-ip-status").html("<img src='<?php echo plugins_url('wp-statistics'); ?>/assets/images/loading.gif'/>");
|
177 |
jQuery.ajax({
|
178 |
url: ajaxurl,
|
179 |
type: 'post',
|
180 |
data: {
|
181 |
'action': 'wp_statistics_delete_ip',
|
182 |
'ip-address': value,
|
183 |
+
'wps_nonce': '<?php echo wp_create_nonce('wp_rest'); ?>'
|
184 |
},
|
185 |
datatype: 'json',
|
186 |
})
|
198 |
<table class="form-table">
|
199 |
<tbody>
|
200 |
<tr valign="top">
|
201 |
+
<th scope="row" colspan="2"><h3><?php _e('Data', 'wp-statistics'); ?></h3></th>
|
202 |
</tr>
|
203 |
|
204 |
<tr valign="top">
|
205 |
<th scope="row">
|
206 |
+
<label for="empty-table"><?php _e('Empty Table:', 'wp-statistics'); ?></label>
|
207 |
</th>
|
208 |
|
209 |
<td>
|
210 |
+
<select dir="<?php echo(is_rtl() ? 'rtl' : 'ltr'); ?>" id="empty-table" name="empty-table">
|
211 |
+
<option value="0"><?php _e('Please select', 'wp-statistics'); ?></option>
|
212 |
+
<?php
|
213 |
+
foreach (WP_STATISTICS\DB::table('all', 'historical') as $tbl_key => $tbl_name) {
|
214 |
+
echo '<option value="' . $tbl_key . '">' . $tbl_name . '</option>';
|
215 |
+
}
|
216 |
+
?>
|
217 |
+
<option value="all"><?php echo __('All', 'wp-statistics'); ?></option>
|
218 |
</select>
|
219 |
|
220 |
+
<p class="description"><?php _e('All data table will be lost.', 'wp-statistics'); ?></p>
|
221 |
+
<input id="empty-table-submit" class="button button-primary" type="submit" value="<?php _e('Clear now!',
|
222 |
+
'wp-statistics'); ?>" name="empty-table-submit" Onclick="return false;"/>
|
223 |
<span id="empty-status"></span>
|
224 |
<div id="empty-result"></div>
|
225 |
</td>
|
227 |
|
228 |
<tr>
|
229 |
<th scope="row">
|
230 |
+
<label for="purge-data"><?php _e('Purge records older than:', 'wp-statistics'); ?></label>
|
231 |
</th>
|
232 |
|
233 |
<td>
|
234 |
<input type="text" class="small-text code" id="purge-data" name="wps_purge_data" value="365"/>
|
235 |
+
<label for="purge-data"><?php _e('Days', 'wp-statistics'); ?></label>
|
236 |
|
237 |
+
<p class="description"><?php echo __('Delete user statistics data older than the selected number of days.',
|
238 |
+
'wp-statistics') . ' ' . __('Minimum value is 30 days.', 'wp-statistics'); ?></p>
|
239 |
+
<input id="purge-data-submit" class="button button-primary" type="submit" value="<?php _e('Purge now!',
|
240 |
+
'wp-statistics'); ?>" name="purge-data-submit" Onclick="return false;"/>
|
241 |
<span id="purge-data-status"></span>
|
242 |
<div id="purge-data-result"></div>
|
243 |
</td>
|
245 |
|
246 |
<tr>
|
247 |
<th scope="row">
|
248 |
+
<label for="purge-visitor-hits"><?php _e('Purge visitors with more than:',
|
249 |
+
'wp-statistics'); ?></label>
|
250 |
</th>
|
251 |
|
252 |
<td>
|
253 |
<input type="text" class="small-text code" id="purge-visitor-hits" name="wps_purge_visitor_hits" value="10"/>
|
254 |
+
<label for="purge-visitor-hits"><?php _e('Hits', 'wp-statistics'); ?></label>
|
255 |
+
|
256 |
+
<p class="description"><?php echo __('Delete user statistics data where the user has more than the defined number of hits in a day.',
|
257 |
+
'wp-statistics') . ' ' . __('This can be useful to clear up old data when your site has been hit by a bot.',
|
258 |
+
'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.',
|
259 |
+
'wp-statistics') . ' ' . __('Minimum value is 10 hits.', 'wp-statistics'); ?></p>
|
260 |
+
<input id="purge-visitor-hits-submit" class="button button-primary" type="submit" value="<?php _e('Purge now!',
|
261 |
+
'wp-statistics'); ?>" name="purge-visitor-hits-submit" Onclick="return false;"/>
|
262 |
<span id="purge-visitor-hits-status"></span>
|
263 |
<div id="purge-visitor-hits-result"></div>
|
264 |
</td>
|
270 |
<table class="form-table">
|
271 |
<tbody>
|
272 |
<tr valign="top">
|
273 |
+
<th scope="row" colspan="2"><h3><?php _e('Delete User Agent Types', 'wp-statistics'); ?></h3></th>
|
274 |
</tr>
|
275 |
|
276 |
<tr valign="top">
|
277 |
<th scope="row">
|
278 |
+
<label for="delete-agent"><?php _e('Delete Agents:', 'wp-statistics'); ?></label>
|
279 |
</th>
|
280 |
|
281 |
<td>
|
282 |
<select dir="ltr" id="delete-agent" name="delete-agent">
|
283 |
+
<option value="0"><?php _e('Please select', 'wp-statistics'); ?></option>
|
284 |
+
<?php
|
285 |
+
$agents = wp_statistics_ua_list();
|
286 |
+
foreach ($agents as $agent) {
|
287 |
+
$aid = preg_replace("/[^a-zA-Z]/", "", $agent);
|
288 |
+
echo "<option value='$agent' id='agent-" . $aid . "-id'>" . $agent . "</option>";
|
289 |
+
}
|
290 |
+
?>
|
291 |
</select>
|
292 |
|
293 |
+
<p class="description"><?php _e('All visitor data will be lost for this agent type.',
|
294 |
+
'wp-statistics'); ?></p>
|
295 |
+
<input id="delete-agents-submit" class="button button-primary" type="submit" value="<?php _e('Delete now!',
|
296 |
+
'wp-statistics'); ?>" name="delete-agents-submit" Onclick="return false;">
|
297 |
<span id="delete-agents-status"></span>
|
298 |
<div id="delete-agents-result"></div>
|
299 |
</td>
|
301 |
|
302 |
<tr valign="top">
|
303 |
<th scope="row">
|
304 |
+
<label for="delete-platform"><?php _e('Delete Platforms:', 'wp-statistics'); ?></label>
|
305 |
</th>
|
306 |
|
307 |
<td>
|
308 |
<select dir="ltr" id="delete-platform" name="delete-platform">
|
309 |
+
<option value="0"><?php _e('Please select', 'wp-statistics'); ?></option>
|
310 |
+
<?php
|
311 |
+
$platforms = wp_statistics_platform_list();
|
312 |
+
foreach ($platforms as $platform) {
|
313 |
+
if (!empty($platform)) {
|
314 |
+
$pid = preg_replace("/[^a-zA-Z]/", "", $platform);
|
315 |
+
echo "<option value='$platform' id='platform-" . $pid . "-id'>" . $platform . "</option>";
|
316 |
+
}
|
317 |
+
}
|
318 |
+
?>
|
319 |
</select>
|
320 |
|
321 |
+
<p class="description"><?php _e('All visitor data will be lost for this platform type.',
|
322 |
+
'wp-statistics'); ?></p>
|
323 |
+
<input id="delete-platforms-submit" class="button button-primary" type="submit" value="<?php _e('Delete now!',
|
324 |
+
'wp-statistics'); ?>" name="delete-platforms-submit" Onclick="return false;">
|
325 |
<span id="delete-platforms-status"></span>
|
326 |
<div id="delete-platforms-result"></div>
|
327 |
</td>
|
329 |
|
330 |
<tr valign="top">
|
331 |
<th scope="row">
|
332 |
+
<label for="delete-ip"><?php _e('Delete IP:', 'wp-statistics'); ?></label>
|
333 |
</th>
|
334 |
|
335 |
<td>
|
336 |
<input dir="ltr" id="delete-ip" type="text" name="delete-ip"/>
|
337 |
|
338 |
+
<p class="description"><?php _e('All visitor data will be lost for this IP.',
|
339 |
+
'wp-statistics'); ?></p>
|
340 |
+
<input id="delete-ip-submit" class="button button-primary" type="submit" value="<?php _e('Delete now!',
|
341 |
+
'wp-statistics'); ?>" name="delete-ip-submit" Onclick="return false;">
|
342 |
<span id="delete-ip-status"></span>
|
343 |
<div id="delete-ip-result"></div>
|
344 |
</td>
|
includes/admin/templates/optimization/resources.php
CHANGED
@@ -3,50 +3,50 @@
|
|
3 |
<table class="form-table">
|
4 |
<tbody>
|
5 |
<tr valign="top">
|
6 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
7 |
</tr>
|
8 |
|
9 |
<tr valign="top">
|
10 |
<th scope="row">
|
11 |
-
|
12 |
</th>
|
13 |
<td>
|
14 |
-
<strong><?php echo size_format(
|
15 |
-
<p class="description"><?php _e(
|
16 |
</td>
|
17 |
</tr>
|
18 |
|
19 |
<tr valign="top">
|
20 |
<th scope="row">
|
21 |
-
|
22 |
</th>
|
23 |
|
24 |
<td>
|
25 |
-
<strong><?php echo ini_get(
|
26 |
-
<p class="description"><?php _e(
|
27 |
-
|
28 |
</td>
|
29 |
</tr>
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
<tr valign="top">
|
35 |
<th scope="row">
|
36 |
-
|
37 |
-
|
38 |
</th>
|
39 |
<td>
|
40 |
-
<strong><?php echo number_format_i18n(
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
<p class="description"><?php _e(
|
45 |
</td>
|
46 |
</tr>
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
</tbody>
|
51 |
</table>
|
52 |
</div>
|
@@ -54,68 +54,68 @@
|
|
54 |
<table class="form-table">
|
55 |
<tbody>
|
56 |
<tr valign="top">
|
57 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
58 |
</tr>
|
59 |
|
60 |
<tr valign="top">
|
61 |
<th scope="row">
|
62 |
-
|
63 |
</th>
|
64 |
|
65 |
<td>
|
66 |
<strong><?php echo WP_STATISTICS_VERSION; ?></strong>
|
67 |
-
<p class="description"><?php _e(
|
68 |
-
|
69 |
</td>
|
70 |
</tr>
|
71 |
|
72 |
<tr valign="top">
|
73 |
<th scope="row">
|
74 |
-
|
75 |
</th>
|
76 |
|
77 |
<td>
|
78 |
<strong><?php echo phpversion(); ?></strong>
|
79 |
-
<p class="description"><?php _e(
|
80 |
</td>
|
81 |
</tr>
|
82 |
|
83 |
<tr valign="top">
|
84 |
<th scope="row">
|
85 |
-
|
86 |
</th>
|
87 |
|
88 |
<td>
|
89 |
-
<strong><?php if (
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
<p class="description"><?php _e(
|
96 |
-
|
97 |
</td>
|
98 |
</tr>
|
99 |
|
100 |
<tr valign="top">
|
101 |
<th scope="row">
|
102 |
-
|
103 |
</th>
|
104 |
|
105 |
<td>
|
106 |
-
<strong><?php if (
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
<p class="description"><?php _e(
|
112 |
-
|
113 |
</td>
|
114 |
</tr>
|
115 |
|
116 |
<tr valign="top">
|
117 |
<th scope="row">
|
118 |
-
|
119 |
</th>
|
120 |
|
121 |
<td>
|
@@ -123,78 +123,78 @@
|
|
123 |
<script type="text/javascript">document.write(jQuery().jquery);</script>
|
124 |
</strong>
|
125 |
|
126 |
-
<p class="description"><?php _e(
|
127 |
</td>
|
128 |
</tr>
|
129 |
|
130 |
<tr valign="top">
|
131 |
<th scope="row">
|
132 |
-
|
133 |
</th>
|
134 |
|
135 |
<td>
|
136 |
-
<strong><?php if (
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
|
143 |
<p class="description"><?php _e(
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
</td>
|
148 |
</tr>
|
149 |
|
150 |
<tr valign="top">
|
151 |
<th scope="row">
|
152 |
-
|
153 |
</th>
|
154 |
|
155 |
<td>
|
156 |
-
<strong><?php if (
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
<p class="description"><?php _e(
|
163 |
-
|
164 |
</td>
|
165 |
</tr>
|
166 |
|
167 |
<tr valign="top">
|
168 |
<th scope="row">
|
169 |
-
|
170 |
</th>
|
171 |
|
172 |
<td>
|
173 |
-
<strong><?php if (
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
<p class="description"><?php _e(
|
180 |
-
|
181 |
</td>
|
182 |
</tr>
|
183 |
|
184 |
<tr valign="top">
|
185 |
<th scope="row">
|
186 |
-
|
187 |
</th>
|
188 |
|
189 |
<td>
|
190 |
-
<strong><?php if (
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
<p class="description"><?php _e(
|
197 |
-
|
198 |
</td>
|
199 |
</tr>
|
200 |
</tbody>
|
@@ -204,29 +204,29 @@
|
|
204 |
<table class="form-table">
|
205 |
<tbody>
|
206 |
<tr valign="top">
|
207 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
208 |
</tr>
|
209 |
|
210 |
<tr valign="top">
|
211 |
<th scope="row">
|
212 |
-
|
213 |
</th>
|
214 |
|
215 |
<td>
|
216 |
<strong><?php
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
<p class="description"><?php _e(
|
229 |
-
|
230 |
</td>
|
231 |
</tr>
|
232 |
</tbody>
|
@@ -236,65 +236,65 @@
|
|
236 |
<table class="form-table">
|
237 |
<tbody>
|
238 |
<tr valign="top">
|
239 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
240 |
</tr>
|
241 |
|
242 |
<tr valign="top">
|
243 |
<th scope="row">
|
244 |
-
|
245 |
</th>
|
246 |
|
247 |
<td>
|
248 |
<strong><?php echo \WP_STATISTICS\IP::getIP(); ?></strong>
|
249 |
-
<p class="description"><?php _e(
|
250 |
</td>
|
251 |
</tr>
|
252 |
|
253 |
<tr valign="top">
|
254 |
<th scope="row">
|
255 |
-
|
256 |
</th>
|
257 |
|
258 |
<td>
|
259 |
-
<strong><?php echo htmlentities(
|
260 |
-
|
261 |
-
<p class="description"><?php _e(
|
262 |
</td>
|
263 |
</tr>
|
264 |
|
265 |
<tr valign="top">
|
266 |
<th scope="row">
|
267 |
-
|
268 |
</th>
|
269 |
|
270 |
<td>
|
271 |
<strong><?php $agent = \WP_STATISTICS\UserAgent::getUserAgent();
|
272 |
-
|
273 |
-
|
274 |
|
275 |
-
<p class="description"><?php _e(
|
276 |
</td>
|
277 |
</tr>
|
278 |
|
279 |
<tr valign="top">
|
280 |
<th scope="row">
|
281 |
-
|
282 |
</th>
|
283 |
|
284 |
<td>
|
285 |
<strong><?php echo $agent['version']; ?></strong>
|
286 |
-
<p class="description"><?php _e(
|
287 |
</td>
|
288 |
</tr>
|
289 |
|
290 |
<tr valign="top">
|
291 |
<th scope="row">
|
292 |
-
|
293 |
</th>
|
294 |
|
295 |
<td>
|
296 |
<strong><?php echo $agent['platform']; ?></strong>
|
297 |
-
<p class="description"><?php _e(
|
298 |
</td>
|
299 |
</tr>
|
300 |
</tbody>
|
@@ -304,34 +304,34 @@
|
|
304 |
<table class="form-table">
|
305 |
<tbody>
|
306 |
<tr valign="top">
|
307 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
308 |
</tr>
|
309 |
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
<th scope="row">
|
326 |
' . $server . '
|
327 |
</th>
|
328 |
<td>
|
329 |
-
<strong>' . $_SERVER[
|
330 |
</td>
|
331 |
</tr>';
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
</tbody>
|
336 |
</table>
|
337 |
</div>
|
3 |
<table class="form-table">
|
4 |
<tbody>
|
5 |
<tr valign="top">
|
6 |
+
<th scope="row" colspan="2"><h3><?php _e('Resources', 'wp-statistics'); ?></h3></th>
|
7 |
</tr>
|
8 |
|
9 |
<tr valign="top">
|
10 |
<th scope="row">
|
11 |
+
<?php _e('Memory usage in PHP', 'wp-statistics'); ?>:
|
12 |
</th>
|
13 |
<td>
|
14 |
+
<strong><?php echo size_format(memory_get_usage(), 3); ?></strong>
|
15 |
+
<p class="description"><?php _e('Memory usage in PHP', 'wp-statistics'); ?></p>
|
16 |
</td>
|
17 |
</tr>
|
18 |
|
19 |
<tr valign="top">
|
20 |
<th scope="row">
|
21 |
+
<?php _e('PHP Memory Limit', 'wp-statistics'); ?>:
|
22 |
</th>
|
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.',
|
27 |
+
'wp-statistics'); ?></p>
|
28 |
</td>
|
29 |
</tr>
|
30 |
|
31 |
+
<?php
|
32 |
+
foreach ($result as $table_name => $number_row) {
|
33 |
+
?>
|
34 |
<tr valign="top">
|
35 |
<th scope="row">
|
36 |
+
<?php echo sprintf(__('Number of rows in the %s table', 'wp-statistics'),
|
37 |
+
'<code>' . $table_name . '</code>'); ?>:
|
38 |
</th>
|
39 |
<td>
|
40 |
+
<strong><?php echo number_format_i18n($number_row); ?></strong> <?php echo _n('Row',
|
41 |
+
'Rows',
|
42 |
+
number_format_i18n($number_row),
|
43 |
+
'wp-statistics'); ?>
|
44 |
+
<p class="description"><?php _e('Number of rows', 'wp-statistics'); ?></p>
|
45 |
</td>
|
46 |
</tr>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
?>
|
50 |
</tbody>
|
51 |
</table>
|
52 |
</div>
|
54 |
<table class="form-table">
|
55 |
<tbody>
|
56 |
<tr valign="top">
|
57 |
+
<th scope="row" colspan="2"><h3><?php _e('Version Info', 'wp-statistics'); ?></h3></th>
|
58 |
</tr>
|
59 |
|
60 |
<tr valign="top">
|
61 |
<th scope="row">
|
62 |
+
<?php _e('WP Statistics Version', 'wp-statistics'); ?>:
|
63 |
</th>
|
64 |
|
65 |
<td>
|
66 |
<strong><?php echo WP_STATISTICS_VERSION; ?></strong>
|
67 |
+
<p class="description"><?php _e('The WP Statistics version you are running.',
|
68 |
+
'wp-statistics'); ?></p>
|
69 |
</td>
|
70 |
</tr>
|
71 |
|
72 |
<tr valign="top">
|
73 |
<th scope="row">
|
74 |
+
<?php _e('PHP Version', 'wp-statistics'); ?>:
|
75 |
</th>
|
76 |
|
77 |
<td>
|
78 |
<strong><?php echo phpversion(); ?></strong>
|
79 |
+
<p class="description"><?php _e('The PHP version you are running.', 'wp-statistics'); ?></p>
|
80 |
</td>
|
81 |
</tr>
|
82 |
|
83 |
<tr valign="top">
|
84 |
<th scope="row">
|
85 |
+
<?php _e('PHP Safe Mode', 'wp-statistics'); ?>:
|
86 |
</th>
|
87 |
|
88 |
<td>
|
89 |
+
<strong><?php if (ini_get('safe_mode')) {
|
90 |
+
_e('Yes', 'wp-statistics');
|
91 |
+
} else {
|
92 |
+
_e('No', 'wp-statistics');
|
93 |
+
} ?></strong>
|
94 |
+
|
95 |
+
<p class="description"><?php _e('Is PHP Safe Mode active. The GeoIP code is not supported in Safe Mode.',
|
96 |
+
'wp-statistics'); ?></p>
|
97 |
</td>
|
98 |
</tr>
|
99 |
|
100 |
<tr valign="top">
|
101 |
<th scope="row">
|
102 |
+
<?php _e('PHP IPv6 Enabled', 'wp-statistics'); ?>:
|
103 |
</th>
|
104 |
|
105 |
<td>
|
106 |
+
<strong><?php if (defined('AF_INET6')) {
|
107 |
+
_e('Yes', 'wp-statistics');
|
108 |
+
} else {
|
109 |
+
_e('No', 'wp-statistics');
|
110 |
+
} ?></strong>
|
111 |
+
<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.',
|
112 |
+
'wp-statistics'); ?></p>
|
113 |
</td>
|
114 |
</tr>
|
115 |
|
116 |
<tr valign="top">
|
117 |
<th scope="row">
|
118 |
+
<?php _e('jQuery Version', 'wp-statistics'); ?>:
|
119 |
</th>
|
120 |
|
121 |
<td>
|
123 |
<script type="text/javascript">document.write(jQuery().jquery);</script>
|
124 |
</strong>
|
125 |
|
126 |
+
<p class="description"><?php _e('The jQuery version you are running.', 'wp-statistics'); ?></p>
|
127 |
</td>
|
128 |
</tr>
|
129 |
|
130 |
<tr valign="top">
|
131 |
<th scope="row">
|
132 |
+
<?php _e('cURL Version', 'wp-statistics'); ?>:
|
133 |
</th>
|
134 |
|
135 |
<td>
|
136 |
+
<strong><?php if (function_exists('curl_version')) {
|
137 |
+
$curl_ver = curl_version();
|
138 |
+
echo $curl_ver['version'];
|
139 |
+
} else {
|
140 |
+
_e('cURL not installed', 'wp-statistics');
|
141 |
+
} ?></strong>
|
142 |
|
143 |
<p class="description"><?php _e(
|
144 |
+
'The PHP cURL Extension version you are running. cURL is required for the GeoIP code, if it is not installed GeoIP will be disabled.',
|
145 |
+
'wp-statistics'
|
146 |
+
); ?></p>
|
147 |
</td>
|
148 |
</tr>
|
149 |
|
150 |
<tr valign="top">
|
151 |
<th scope="row">
|
152 |
+
<?php _e('Zlib gzopen()', 'wp-statistics'); ?>:
|
153 |
</th>
|
154 |
|
155 |
<td>
|
156 |
+
<strong><?php if (function_exists('gzopen')) {
|
157 |
+
_e('Installed', 'wp-statistics');
|
158 |
+
} else {
|
159 |
+
_e('Not installed', 'wp-statistics');
|
160 |
+
} ?></strong>
|
161 |
+
|
162 |
+
<p class="description"><?php _e('If the gzopen() function is installed. The gzopen() function is required for the GeoIP database to be downloaded successfully.',
|
163 |
+
'wp-statistics'); ?></p>
|
164 |
</td>
|
165 |
</tr>
|
166 |
|
167 |
<tr valign="top">
|
168 |
<th scope="row">
|
169 |
+
<?php _e('GMP PHP extension', 'wp-statistics'); ?>:
|
170 |
</th>
|
171 |
|
172 |
<td>
|
173 |
+
<strong><?php if (extension_loaded('gmp')) {
|
174 |
+
_e('Installed', 'wp-statistics');
|
175 |
+
} else {
|
176 |
+
_e('Not installed', 'wp-statistics');
|
177 |
+
} ?></strong>
|
178 |
+
|
179 |
+
<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.',
|
180 |
+
'wp-statistics'); ?></p>
|
181 |
</td>
|
182 |
</tr>
|
183 |
|
184 |
<tr valign="top">
|
185 |
<th scope="row">
|
186 |
+
<?php _e('BCMath PHP extension', 'wp-statistics'); ?>:
|
187 |
</th>
|
188 |
|
189 |
<td>
|
190 |
+
<strong><?php if (extension_loaded('bcmath')) {
|
191 |
+
_e('Installed', 'wp-statistics');
|
192 |
+
} else {
|
193 |
+
_e('Not installed', 'wp-statistics');
|
194 |
+
} ?></strong>
|
195 |
+
|
196 |
+
<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.',
|
197 |
+
'wp-statistics'); ?></p>
|
198 |
</td>
|
199 |
</tr>
|
200 |
</tbody>
|
204 |
<table class="form-table">
|
205 |
<tbody>
|
206 |
<tr valign="top">
|
207 |
+
<th scope="row" colspan="2"><h3><?php _e('File Info', 'wp-statistics'); ?></h3></th>
|
208 |
</tr>
|
209 |
|
210 |
<tr valign="top">
|
211 |
<th scope="row">
|
212 |
+
<?php _e('GeoIP Database', 'wp-statistics'); ?>:
|
213 |
</th>
|
214 |
|
215 |
<td>
|
216 |
<strong><?php
|
217 |
+
$GeoIP_filename = \WP_STATISTICS\GeoIP::get_geo_ip_path('country');
|
218 |
+
$GeoIP_filedate = @filemtime($GeoIP_filename);
|
219 |
+
|
220 |
+
if ($GeoIP_filedate === false) {
|
221 |
+
_e('Database file does not exist.', 'wp-statistics');
|
222 |
+
} else {
|
223 |
+
echo size_format(@filesize($GeoIP_filename), 2) . __(', created on ',
|
224 |
+
'wp-statistics') . date_i18n(get_option('date_format') . ' @ ' . get_option('time_format'),
|
225 |
+
$GeoIP_filedate);
|
226 |
+
} ?></strong>
|
227 |
+
|
228 |
+
<p class="description"><?php _e('The file size and date of the GeoIP database.',
|
229 |
+
'wp-statistics'); ?></p>
|
230 |
</td>
|
231 |
</tr>
|
232 |
</tbody>
|
236 |
<table class="form-table">
|
237 |
<tbody>
|
238 |
<tr valign="top">
|
239 |
+
<th scope="row" colspan="2"><h3><?php _e('Client Info', 'wp-statistics'); ?></h3></th>
|
240 |
</tr>
|
241 |
|
242 |
<tr valign="top">
|
243 |
<th scope="row">
|
244 |
+
<?php _e('Client IP', 'wp-statistics'); ?>:
|
245 |
</th>
|
246 |
|
247 |
<td>
|
248 |
<strong><?php echo \WP_STATISTICS\IP::getIP(); ?></strong>
|
249 |
+
<p class="description"><?php _e('The client IP address.', 'wp-statistics'); ?></p>
|
250 |
</td>
|
251 |
</tr>
|
252 |
|
253 |
<tr valign="top">
|
254 |
<th scope="row">
|
255 |
+
<?php _e('User Agent', 'wp-statistics'); ?>:
|
256 |
</th>
|
257 |
|
258 |
<td>
|
259 |
+
<strong><?php echo htmlentities(\WP_STATISTICS\UserAgent::getHttpUserAgent(),
|
260 |
+
ENT_QUOTES); ?></strong>
|
261 |
+
<p class="description"><?php _e('The client user agent string.', 'wp-statistics'); ?></p>
|
262 |
</td>
|
263 |
</tr>
|
264 |
|
265 |
<tr valign="top">
|
266 |
<th scope="row">
|
267 |
+
<?php _e('Browser', 'wp-statistics'); ?>:
|
268 |
</th>
|
269 |
|
270 |
<td>
|
271 |
<strong><?php $agent = \WP_STATISTICS\UserAgent::getUserAgent();
|
272 |
+
echo $agent['browser'];
|
273 |
+
?></strong>
|
274 |
|
275 |
+
<p class="description"><?php _e('The detected client browser.', 'wp-statistics'); ?></p>
|
276 |
</td>
|
277 |
</tr>
|
278 |
|
279 |
<tr valign="top">
|
280 |
<th scope="row">
|
281 |
+
<?php _e('Version', 'wp-statistics'); ?>:
|
282 |
</th>
|
283 |
|
284 |
<td>
|
285 |
<strong><?php echo $agent['version']; ?></strong>
|
286 |
+
<p class="description"><?php _e('The detected client browser version.', 'wp-statistics'); ?></p>
|
287 |
</td>
|
288 |
</tr>
|
289 |
|
290 |
<tr valign="top">
|
291 |
<th scope="row">
|
292 |
+
<?php _e('Platform', 'wp-statistics'); ?>:
|
293 |
</th>
|
294 |
|
295 |
<td>
|
296 |
<strong><?php echo $agent['platform']; ?></strong>
|
297 |
+
<p class="description"><?php _e('The detected client platform.', 'wp-statistics'); ?></p>
|
298 |
</td>
|
299 |
</tr>
|
300 |
</tbody>
|
304 |
<table class="form-table">
|
305 |
<tbody>
|
306 |
<tr valign="top">
|
307 |
+
<th scope="row" colspan="2"><h3><?php _e('Server Info', 'wp-statistics'); ?></h3></th>
|
308 |
</tr>
|
309 |
|
310 |
+
<?php
|
311 |
+
$list = array(
|
312 |
+
'SERVER_SOFTWARE',
|
313 |
+
'HTTP_HOST',
|
314 |
+
'REMOTE_ADDR',
|
315 |
+
'HTTP_CLIENT_IP',
|
316 |
+
'HTTP_X_FORWARDED_FOR',
|
317 |
+
'HTTP_X_FORWARDED',
|
318 |
+
'HTTP_FORWARDED_FOR',
|
319 |
+
'HTTP_FORWARDED',
|
320 |
+
'HTTP_X_REAL_IP',
|
321 |
+
);
|
322 |
+
foreach ($list as $server) {
|
323 |
+
if (isset($_SERVER[$server])) {
|
324 |
+
echo '<tr valign="top">
|
325 |
<th scope="row">
|
326 |
' . $server . '
|
327 |
</th>
|
328 |
<td>
|
329 |
+
<strong>' . $_SERVER[$server] . '</strong>
|
330 |
</td>
|
331 |
</tr>';
|
332 |
+
}
|
333 |
+
}
|
334 |
+
?>
|
335 |
</tbody>
|
336 |
</table>
|
337 |
</div>
|
includes/admin/templates/optimization/updates.php
CHANGED
@@ -12,40 +12,40 @@
|
|
12 |
<div class="wrap wps-wrap">
|
13 |
<div class="postbox">
|
14 |
<table class="form-table">
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<tr valign="top">
|
18 |
-
<th scope="row" colspan="2"><h3><?php _e('
|
19 |
</tr>
|
20 |
|
21 |
<tr valign="top">
|
22 |
<th scope="row">
|
23 |
-
<label for="populate-submit"><?php _e('
|
24 |
</th>
|
25 |
|
26 |
<td>
|
27 |
-
<input id="
|
28 |
-
<p class="description"><?php _e('
|
29 |
</td>
|
30 |
</tr>
|
31 |
-
<?php } ?>
|
32 |
-
|
33 |
-
<tr valign="top">
|
34 |
-
<th scope="row" colspan="2"><h3><?php _e('IP Addresses', 'wp-statistics'); ?></h3></th>
|
35 |
-
</tr>
|
36 |
-
|
37 |
-
<tr valign="top">
|
38 |
-
<th scope="row">
|
39 |
-
<label for="populate-submit"><?php _e('Hash IP Addresses:', 'wp-statistics'); ?></label>
|
40 |
-
</th>
|
41 |
-
|
42 |
-
<td>
|
43 |
-
<input id="hash-ips-submit" class="button button-primary" type="button" value="<?php _e('Update Now!', 'wp-statistics'); ?>" name="hash-ips-submit">
|
44 |
-
<p class="description"><?php _e('Replace IP addresses in the database with hash values, you will not be able to recover the IP addresses in the future to populate location information afterwards and this may take a while', 'wp-statistics'); ?></p>
|
45 |
-
</td>
|
46 |
-
</tr>
|
47 |
|
48 |
-
|
49 |
-
|
50 |
</div>
|
51 |
</div>
|
12 |
<div class="wrap wps-wrap">
|
13 |
<div class="postbox">
|
14 |
<table class="form-table">
|
15 |
+
<tbody>
|
16 |
+
<?php if (\WP_STATISTICS\GeoIP::active()) { ?>
|
17 |
+
<tr valign="top">
|
18 |
+
<th scope="row" colspan="2"><h3><?php _e('GeoIP Options', 'wp-statistics'); ?></h3></th>
|
19 |
+
</tr>
|
20 |
+
|
21 |
+
<tr valign="top">
|
22 |
+
<th scope="row">
|
23 |
+
<label for="populate-submit"><?php _e('Countries:', 'wp-statistics'); ?></label>
|
24 |
+
</th>
|
25 |
+
|
26 |
+
<td>
|
27 |
+
<input id="populate-submit" class="button button-primary" type="button" value="<?php _e('Update Now!', 'wp-statistics'); ?>" name="populate-submit" onclick="location.href=document.URL+'&tab=updates&populate=1'">
|
28 |
+
<p class="description"><?php _e('Updates any unknown location data in the database, this may take a while', 'wp-statistics'); ?></p>
|
29 |
+
</td>
|
30 |
+
</tr>
|
31 |
+
<?php } ?>
|
32 |
+
|
33 |
<tr valign="top">
|
34 |
+
<th scope="row" colspan="2"><h3><?php _e('IP Addresses', 'wp-statistics'); ?></h3></th>
|
35 |
</tr>
|
36 |
|
37 |
<tr valign="top">
|
38 |
<th scope="row">
|
39 |
+
<label for="populate-submit"><?php _e('Hash IP Addresses:', 'wp-statistics'); ?></label>
|
40 |
</th>
|
41 |
|
42 |
<td>
|
43 |
+
<input id="hash-ips-submit" class="button button-primary" type="button" value="<?php _e('Update Now!', 'wp-statistics'); ?>" name="hash-ips-submit">
|
44 |
+
<p class="description"><?php _e('Replace IP addresses in the database with hash values, you will not be able to recover the IP addresses in the future to populate location information afterwards and this may take a while', 'wp-statistics'); ?></p>
|
45 |
</td>
|
46 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
</tbody>
|
49 |
+
</table>
|
50 |
</div>
|
51 |
</div>
|
includes/admin/templates/pages/online.php
CHANGED
@@ -41,8 +41,9 @@
|
|
41 |
<td style='text-align: left'><?php echo ($item['page']['link'] != '' ? '<a href="' . $item['page']['link'] . '" target="_blank" class="wps-text-danger">' : '') . $item['page']['title'] . ($item['page']['link'] != '' ? '</a>' : ''); ?></td>
|
42 |
<td style='text-align: left'><?php echo $item['referred']; ?></td>
|
43 |
<td style='text-align: left'>
|
44 |
-
<?php if (isset($item['user']) and isset($item['user']['ID']) and $item['user']['ID'] > 0) {
|
45 |
-
|
|
|
46 |
</td>
|
47 |
<td style='text-align: center'><?php echo(isset($item['map']) ? "<a class='wps-text-muted' href='" . $item['ip']['link'] . "'>" . WP_STATISTICS\Admin_Template::icons('dashicons-visibility') . "</a><a class='show-map wps-text-muted' href='" . $item['map'] . "' target='_blank' title='" . __('Map', 'wp-statistics') . "'>" . WP_STATISTICS\Admin_Template::icons('dashicons-location-alt') . "</a>" : ""); ?></td>
|
48 |
</tr>
|
41 |
<td style='text-align: left'><?php echo ($item['page']['link'] != '' ? '<a href="' . $item['page']['link'] . '" target="_blank" class="wps-text-danger">' : '') . $item['page']['title'] . ($item['page']['link'] != '' ? '</a>' : ''); ?></td>
|
42 |
<td style='text-align: left'><?php echo $item['referred']; ?></td>
|
43 |
<td style='text-align: left'>
|
44 |
+
<?php if (isset($item['user']) and isset($item['user']['ID']) and $item['user']['ID'] > 0) { ?>
|
45 |
+
<p><?php _e('ID', 'wp-statistics'); ?>: <a href="<?php echo get_edit_user_link($item['user']['ID']); ?>" target="_blank" class="wps-text-success">#<?php echo $item['user']['ID']; ?></a></p><p><?php _e('Email', 'wp-statistics'); ?>: <?php echo $item['user']['user_email']; ?></p><p><?php echo sprintf('Role: %s', implode(',', get_userdata($item['user']['ID'])->roles)) ?></p>
|
46 |
+
<?php } else { ?><?php echo \WP_STATISTICS\Admin_Template::UnknownColumn(); ?><?php } ?>
|
47 |
</td>
|
48 |
<td style='text-align: center'><?php echo(isset($item['map']) ? "<a class='wps-text-muted' href='" . $item['ip']['link'] . "'>" . WP_STATISTICS\Admin_Template::icons('dashicons-visibility') . "</a><a class='show-map wps-text-muted' href='" . $item['map'] . "' target='_blank' title='" . __('Map', 'wp-statistics') . "'>" . WP_STATISTICS\Admin_Template::icons('dashicons-location-alt') . "</a>" : ""); ?></td>
|
49 |
</tr>
|
includes/admin/templates/pages/pages.php
CHANGED
@@ -49,14 +49,12 @@
|
|
49 |
<tr>
|
50 |
<td style='text-align: left;'><?php echo $i; ?></td>
|
51 |
<td style='text-align: left;'>
|
52 |
-
<span title='<?php echo $li['title']; ?>'
|
53 |
-
class='wps-cursor-default wps-text-wrap'>
|
54 |
<?php echo $li['title']; ?>
|
55 |
</span>
|
56 |
</td>
|
57 |
<td style='text-align: left;'>
|
58 |
-
<a href="<?php echo $li['link']; ?>" title="<?php echo $li['title']; ?>"
|
59 |
-
target="_blank"><?php echo $li['str_url']; ?>
|
60 |
</a>
|
61 |
</td>
|
62 |
<td style="text-align: left">
|
49 |
<tr>
|
50 |
<td style='text-align: left;'><?php echo $i; ?></td>
|
51 |
<td style='text-align: left;'>
|
52 |
+
<span title='<?php echo $li['title']; ?>' class='wps-cursor-default wps-text-wrap'>
|
|
|
53 |
<?php echo $li['title']; ?>
|
54 |
</span>
|
55 |
</td>
|
56 |
<td style='text-align: left;'>
|
57 |
+
<a href="<?php echo $li['link']; ?>" title="<?php echo $li['title']; ?>" target="_blank"><?php echo $li['str_url']; ?>
|
|
|
58 |
</a>
|
59 |
</td>
|
60 |
<td style="text-align: left">
|
includes/admin/templates/plugins.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php require_once WP_STATISTICS_DIR . "/includes/admin/templates/header.php";
|
2 |
<div class="wps-wrap__main">
|
3 |
-
<div class="wrap wps-wrap">
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
</div>
|
9 |
</div>
|
1 |
+
<?php require_once WP_STATISTICS_DIR . "/includes/admin/templates/header.php"; ?>
|
2 |
<div class="wps-wrap__main">
|
3 |
+
<div class="wrap wps-wrap">
|
4 |
+
<?php _e('Extensions for WP-Statistics', 'wp-statistics'); ?>
|
5 |
+
<p>
|
6 |
+
<p><?php _e('These extensions add functionality to your WP-Statistics.', 'wp-statistics'); ?></p><br/></p>
|
7 |
+
<?php include(WP_STATISTICS_DIR . "includes/admin/templates/add-ons.php"); ?>
|
8 |
+
</div>
|
9 |
</div>
|
includes/admin/templates/settings/about.php
CHANGED
@@ -1,167 +1,167 @@
|
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
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 |
'wp-statistics'
|
57 |
-
)
|
58 |
-
|
59 |
-
|
60 |
-
); ?></td>
|
61 |
-
</tr>
|
62 |
|
63 |
-
|
64 |
-
<td scope="row" colspan="2"><h2><?php _e('Rate and Review at WordPress.org', 'wp-statistics'); ?></h2></td>
|
65 |
-
</tr>
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
'
|
71 |
'wp-statistics'
|
72 |
-
)
|
73 |
-
|
74 |
-
|
75 |
-
);
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
-
|
84 |
-
<td scope="row" colspan="2"><?php echo sprintf(
|
85 |
__(
|
86 |
-
'
|
87 |
'wp-statistics'
|
88 |
),
|
89 |
-
'<a href="
|
90 |
'</a>'
|
91 |
-
); ?></
|
92 |
-
</
|
93 |
-
|
94 |
-
<tr valign="top">
|
95 |
-
<td scope="row" colspan="2"><h2><?php _e('Support', 'wp-statistics'); ?></h2></td>
|
96 |
-
</tr>
|
97 |
-
|
98 |
-
<tr valign="top">
|
99 |
-
<td scope="row" colspan="2">
|
100 |
-
<p><?php _e(
|
101 |
-
"We're sorry you're having problem with WP Statistics and we're happy to help out. Here are a few things to do before contacting us:",
|
102 |
-
'wp-statistics'
|
103 |
-
); ?></p>
|
104 |
-
|
105 |
-
<ul style="list-style-type: disc; list-style-position: inside; padding-left: 25px;">
|
106 |
-
<li><?php echo sprintf(
|
107 |
-
__('Have you read the %sFAQs%s?', 'wp-statistics'),
|
108 |
-
'<a title="' .
|
109 |
-
__('FAQs', 'wp-statistics') .
|
110 |
-
'" href="https://wp-statistics.com/category/faq/" target="_blank">',
|
111 |
-
'</a>'
|
112 |
-
); ?></li>
|
113 |
-
<li><?php echo sprintf(
|
114 |
-
__('Have you read the %sdocumentation%s?', 'wp-statistics'),
|
115 |
-
'<a title="' .
|
116 |
-
__('Documentation', 'wp-statistics') .
|
117 |
-
'" href="https://wp-statistics.com/category/documentation/">',
|
118 |
-
'</a>'
|
119 |
-
); ?></li>
|
120 |
-
<li><?php echo sprintf(
|
121 |
-
__('Have you search the %ssupport forum%s for a similar issue?', 'wp-statistics'),
|
122 |
-
'<a href="http://wordpress.org/support/plugin/wp-statistics" target="_blank">',
|
123 |
-
'</a>'
|
124 |
-
); ?></li>
|
125 |
-
<li><?php _e(
|
126 |
-
'Have you search the Internet for any error messages you are receiving?',
|
127 |
-
'wp-statistics'
|
128 |
-
); ?></li>
|
129 |
-
<li><?php _e('Make sure you have access to your PHP error logs.', 'wp-statistics'); ?></li>
|
130 |
-
</ul>
|
131 |
-
|
132 |
-
<p><?php _e('And a few things to double-check:', 'wp-statistics'); ?></p>
|
133 |
-
|
134 |
-
<ul style="list-style-type: disc; list-style-position: inside; padding-left: 25px;">
|
135 |
-
<li><?php _e('How\'s your memory_limit in php.ini?', 'wp-statistics'); ?></li>
|
136 |
-
<li><?php _e(
|
137 |
-
'Have you tried disabling any other plugins you may have installed?',
|
138 |
-
'wp-statistics'
|
139 |
-
); ?></li>
|
140 |
-
<li><?php _e('Have you tried using the default WordPress theme?', 'wp-statistics'); ?></li>
|
141 |
-
<li><?php _e('Have you double checked the plugin settings?', 'wp-statistics'); ?></li>
|
142 |
-
<li><?php _e('Do you have all the required PHP extensions installed?', 'wp-statistics'); ?></li>
|
143 |
-
<li><?php echo __(
|
144 |
-
'Are you getting a blank or incomplete page displayed in your browser?',
|
145 |
-
'wp-statistics'
|
146 |
-
) .
|
147 |
-
' ' .
|
148 |
-
__(
|
149 |
-
'Did you view the source for the page and check for any fatal errors?',
|
150 |
-
'wp-statistics'
|
151 |
-
); ?></li>
|
152 |
-
<li><?php _e('Have you checked your PHP and web server error logs?', 'wp-statistics'); ?></li>
|
153 |
-
</ul>
|
154 |
-
|
155 |
-
<p><?php _e('Still not having any luck?', 'wp-statistics'); ?><?php echo sprintf(
|
156 |
-
__(
|
157 |
-
'Then please open a new thread on the %sWordPress.org support forum%s and we\'ll respond as soon as possible.',
|
158 |
-
'wp-statistics'
|
159 |
-
),
|
160 |
-
'<a href="http://wordpress.org/support/plugin/wp-statistics" target="_blank">',
|
161 |
-
'</a>'
|
162 |
-
); ?></p>
|
163 |
-
</td>
|
164 |
-
</tr>
|
165 |
</tbody>
|
166 |
</table>
|
167 |
</div>
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
+
<tr valign="top">
|
5 |
+
<td scope="row" align="center">
|
6 |
+
<a href="https://wp-statistics.com" target="_blank">
|
7 |
+
<img src="<?php echo WP_STATISTICS_URL . 'assets/images/logo-250.png'; ?>">
|
8 |
+
</a>
|
9 |
+
</td>
|
10 |
+
</tr>
|
11 |
+
|
12 |
+
<tr valign="top">
|
13 |
+
<td scope="row" align="center">
|
14 |
+
<h2><?php echo sprintf(__('WP Statistics V%s', 'wp-statistics'), WP_STATISTICS_VERSION); ?></h2>
|
15 |
+
</td>
|
16 |
+
</tr>
|
17 |
+
|
18 |
+
<tr valign="top">
|
19 |
+
<td scope="row" align="center">
|
20 |
+
<?php echo sprintf(
|
21 |
+
__('This product includes GeoLite2 data created by %s.', 'wp-statistics'),
|
22 |
+
'<a href="http://www.maxmind.com" target=_blank>MaxMind</a>'
|
23 |
+
); ?>
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
|
27 |
+
<tr valign="top">
|
28 |
+
<td scope="row" align="center">
|
29 |
+
<hr/>
|
30 |
+
</td>
|
31 |
+
</tr>
|
32 |
+
|
33 |
+
<tr valign="top">
|
34 |
+
<td scope="row" colspan="2"><h2><?php _e('Donate', 'wp-statistics'); ?></h2></td>
|
35 |
+
</tr>
|
36 |
+
|
37 |
+
<tr valign="top">
|
38 |
+
<td scope="row" colspan="2"><?php echo sprintf(
|
39 |
+
__(
|
40 |
+
'Feel like showing us how much you enjoy WP Statistics? Drop by our %sdonation%s page and show us some love!',
|
41 |
+
'wp-statistics'
|
42 |
+
),
|
43 |
+
'<a href="https://wp-statistics.com/donate" target="_blank">',
|
44 |
+
'</a>'
|
45 |
+
); ?></td>
|
46 |
+
</tr>
|
47 |
+
|
48 |
+
<tr valign="top">
|
49 |
+
<td scope="row" colspan="2"><h2><?php _e('Visit Us Online', 'wp-statistics'); ?></h2></td>
|
50 |
+
</tr>
|
51 |
+
|
52 |
+
<tr valign="top">
|
53 |
+
<td scope="row" colspan="2"><?php echo sprintf(
|
54 |
+
__(
|
55 |
+
'Come visit our great new %swebsite%s and keep up to date on the latest news about WP Statistics.',
|
56 |
+
'wp-statistics'
|
57 |
+
),
|
58 |
+
'<a href="https://wp-statistics.com" target="_blank">',
|
59 |
+
'</a>'
|
60 |
+
); ?></td>
|
61 |
+
</tr>
|
62 |
+
|
63 |
+
<tr valign="top">
|
64 |
+
<td scope="row" colspan="2"><h2><?php _e('Rate and Review at WordPress.org', 'wp-statistics'); ?></h2></td>
|
65 |
+
</tr>
|
66 |
+
|
67 |
+
<tr valign="top">
|
68 |
+
<td scope="row" colspan="2"><?php printf(
|
69 |
+
__(
|
70 |
+
'Thanks for installing WP Statistics, we encourage you to submit a %srating and review%s over at WordPress.org. Your feedback is greatly appreciated!',
|
71 |
+
'wp-statistics'
|
72 |
+
),
|
73 |
+
'<a href="https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post" target="_blank">',
|
74 |
+
'</a>'
|
75 |
+
); ?>
|
76 |
+
</td>
|
77 |
+
</tr>
|
78 |
+
|
79 |
+
<tr valign="top">
|
80 |
+
<td scope="row" colspan="2"><h2><?php _e('Translations', 'wp-statistics'); ?></h2></td>
|
81 |
+
</tr>
|
82 |
+
|
83 |
+
<tr valign="top">
|
84 |
+
<td scope="row" colspan="2"><?php echo sprintf(
|
85 |
+
__(
|
86 |
+
'WP Statistics supports internationalization. Please visit %sWP Statistics translations page%s to help translation.',
|
87 |
+
'wp-statistics'
|
88 |
+
),
|
89 |
+
'<a href="https://wp-statistics.com/translations/" target="_blank">',
|
90 |
+
'</a>'
|
91 |
+
); ?></td>
|
92 |
+
</tr>
|
93 |
+
|
94 |
+
<tr valign="top">
|
95 |
+
<td scope="row" colspan="2"><h2><?php _e('Support', 'wp-statistics'); ?></h2></td>
|
96 |
+
</tr>
|
97 |
+
|
98 |
+
<tr valign="top">
|
99 |
+
<td scope="row" colspan="2">
|
100 |
+
<p><?php _e(
|
101 |
+
"We're sorry you're having problem with WP Statistics and we're happy to help out. Here are a few things to do before contacting us:",
|
102 |
+
'wp-statistics'
|
103 |
+
); ?></p>
|
104 |
+
|
105 |
+
<ul style="list-style-type: disc; list-style-position: inside; padding-left: 25px;">
|
106 |
+
<li><?php echo sprintf(
|
107 |
+
__('Have you read the %sFAQs%s?', 'wp-statistics'),
|
108 |
+
'<a title="' .
|
109 |
+
__('FAQs', 'wp-statistics') .
|
110 |
+
'" href="https://wp-statistics.com/category/faq/" target="_blank">',
|
111 |
+
'</a>'
|
112 |
+
); ?></li>
|
113 |
+
<li><?php echo sprintf(
|
114 |
+
__('Have you read the %sdocumentation%s?', 'wp-statistics'),
|
115 |
+
'<a title="' .
|
116 |
+
__('Documentation', 'wp-statistics') .
|
117 |
+
'" href="https://wp-statistics.com/category/documentation/">',
|
118 |
+
'</a>'
|
119 |
+
); ?></li>
|
120 |
+
<li><?php echo sprintf(
|
121 |
+
__('Have you search the %ssupport forum%s for a similar issue?', 'wp-statistics'),
|
122 |
+
'<a href="http://wordpress.org/support/plugin/wp-statistics" target="_blank">',
|
123 |
+
'</a>'
|
124 |
+
); ?></li>
|
125 |
+
<li><?php _e(
|
126 |
+
'Have you search the Internet for any error messages you are receiving?',
|
127 |
'wp-statistics'
|
128 |
+
); ?></li>
|
129 |
+
<li><?php _e('Make sure you have access to your PHP error logs.', 'wp-statistics'); ?></li>
|
130 |
+
</ul>
|
|
|
|
|
131 |
|
132 |
+
<p><?php _e('And a few things to double-check:', 'wp-statistics'); ?></p>
|
|
|
|
|
133 |
|
134 |
+
<ul style="list-style-type: disc; list-style-position: inside; padding-left: 25px;">
|
135 |
+
<li><?php _e('How\'s your memory_limit in php.ini?', 'wp-statistics'); ?></li>
|
136 |
+
<li><?php _e(
|
137 |
+
'Have you tried disabling any other plugins you may have installed?',
|
138 |
'wp-statistics'
|
139 |
+
); ?></li>
|
140 |
+
<li><?php _e('Have you tried using the default WordPress theme?', 'wp-statistics'); ?></li>
|
141 |
+
<li><?php _e('Have you double checked the plugin settings?', 'wp-statistics'); ?></li>
|
142 |
+
<li><?php _e('Do you have all the required PHP extensions installed?', 'wp-statistics'); ?></li>
|
143 |
+
<li><?php echo __(
|
144 |
+
'Are you getting a blank or incomplete page displayed in your browser?',
|
145 |
+
'wp-statistics'
|
146 |
+
) .
|
147 |
+
' ' .
|
148 |
+
__(
|
149 |
+
'Did you view the source for the page and check for any fatal errors?',
|
150 |
+
'wp-statistics'
|
151 |
+
); ?></li>
|
152 |
+
<li><?php _e('Have you checked your PHP and web server error logs?', 'wp-statistics'); ?></li>
|
153 |
+
</ul>
|
154 |
|
155 |
+
<p><?php _e('Still not having any luck?', 'wp-statistics'); ?><?php echo sprintf(
|
|
|
156 |
__(
|
157 |
+
'Then please open a new thread on the %sWordPress.org support forum%s and we\'ll respond as soon as possible.',
|
158 |
'wp-statistics'
|
159 |
),
|
160 |
+
'<a href="http://wordpress.org/support/plugin/wp-statistics" target="_blank">',
|
161 |
'</a>'
|
162 |
+
); ?></p>
|
163 |
+
</td>
|
164 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
</tbody>
|
166 |
</table>
|
167 |
</div>
|
includes/admin/templates/settings/exclusions.php
CHANGED
@@ -1,59 +1,59 @@
|
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
</tbody>
|
17 |
</table>
|
18 |
</div>
|
19 |
<div class="postbox">
|
20 |
<table class="form-table">
|
21 |
<tbody>
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
</tbody>
|
45 |
</table>
|
46 |
</div>
|
47 |
<div class="postbox">
|
48 |
<table class="form-table">
|
49 |
<tbody>
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
<textarea name="wps_robotlist" class="code textarea-input-reset" dir="ltr" rows="10" cols="60" id="wps_robotlist"><?php
|
58 |
$robotlist = WP_STATISTICS\Option::get('robotlist');
|
59 |
if ($robotlist == '') {
|
@@ -63,158 +63,158 @@
|
|
63 |
echo htmlentities($robotlist, ENT_QUOTES);
|
64 |
?>
|
65 |
</textarea>
|
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 |
-
<a onclick="var wps_exclude_ip = getElementById('wps_exclude_ip'); if( wps_exclude_ip != null ) { wps_exclude_ip.value = jQuery.trim( wps_exclude_ip.value + '\n<?php echo $ip; ?>' ); }" class="button"><?php _e('Add', 'wp-statistics'); ?><?php echo $ip; ?></a>
|
102 |
-
<?php
|
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 |
</tbody>
|
135 |
</table>
|
136 |
</div>
|
137 |
<div class="postbox">
|
138 |
<table class="form-table">
|
139 |
<tbody>
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
</tbody>
|
160 |
</table>
|
161 |
</div>
|
162 |
<div class="postbox">
|
163 |
<table class="form-table">
|
164 |
<tbody>
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
</tbody>
|
178 |
</table>
|
179 |
</div>
|
180 |
<div class="postbox">
|
181 |
<table class="form-table">
|
182 |
<tbody>
|
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 |
-
</table>
|
218 |
</div>
|
219 |
|
220 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='exclusions-settings'")); ?>
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
+
<tr valign="top">
|
5 |
+
<th scope="row" colspan="2"><h3><?php _e('Exclusions', 'wp-statistics'); ?></h3></th>
|
6 |
+
</tr>
|
7 |
|
8 |
+
<tr valign="top">
|
9 |
+
<th scope="row"><label for="wps-exclusions"><?php _e('Record Exclusions:', 'wp-statistics'); ?></label>
|
10 |
+
</th>
|
11 |
+
<td>
|
12 |
+
<input id="wps-exclusions" type="checkbox" value="1" name="wps_record_exclusions" <?php echo WP_STATISTICS\Option::get('record_exclusions') == true ? "checked='checked'" : ''; ?>><label for="wps-exclusions"><?php _e('Enable', 'wp-statistics'); ?></label>
|
13 |
+
<p class="description"><?php echo __('This option will record all the excluded hits in a separate table with the reasons for excluding (but no other information).', 'wp-statistics') . ' ' . __('It generates a lot of data, not only actual user visits but also shows the total number of your site’s hits.', 'wp-statistics'); ?></p>
|
14 |
+
</td>
|
15 |
+
</tr>
|
16 |
</tbody>
|
17 |
</table>
|
18 |
</div>
|
19 |
<div class="postbox">
|
20 |
<table class="form-table">
|
21 |
<tbody>
|
22 |
+
<tr valign="top">
|
23 |
+
<th scope="row" colspan="2"><h3><?php _e('Exclude User Roles', 'wp-statistics'); ?></h3></th>
|
24 |
+
</tr>
|
25 |
+
<?php
|
26 |
+
$role_option_list = '';
|
27 |
+
foreach (\WP_STATISTICS\User::get_role_list() as $role) {
|
28 |
+
$store_name = 'exclude_' . str_replace(" ", "_", strtolower($role));
|
29 |
+
$option_name = 'wps_' . $store_name;
|
30 |
+
$role_option_list .= $option_name . ',';
|
31 |
|
32 |
+
$translated_role_name = translate_user_role($role);
|
33 |
+
?>
|
34 |
|
35 |
+
<tr valign="top">
|
36 |
+
<th scope="row"><label for="<?php echo $option_name; ?>"><?php echo $translated_role_name; ?>:</label>
|
37 |
+
</th>
|
38 |
+
<td>
|
39 |
+
<input id="<?php echo $option_name; ?>" type="checkbox" value="1" name="<?php echo $option_name; ?>" <?php echo WP_STATISTICS\Option::get($store_name) == true ? "checked='checked'" : ''; ?>><label for="<?php echo $option_name; ?>"><?php _e('Exclude', 'wp-statistics'); ?></label>
|
40 |
+
<p class="description"><?php echo sprintf(__('Exclude %s role from data collection.', 'wp-statistics'), $translated_role_name); ?></p>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<?php } ?>
|
44 |
</tbody>
|
45 |
</table>
|
46 |
</div>
|
47 |
<div class="postbox">
|
48 |
<table class="form-table">
|
49 |
<tbody>
|
50 |
+
<tr valign="top">
|
51 |
+
<th scope="row" colspan="2"><h3><?php _e('IP/Robot Exclusions', 'wp-statistics'); ?></h3></th>
|
52 |
+
</tr>
|
53 |
|
54 |
+
<tr valign="top">
|
55 |
+
<th scope="row"><?php _e('Robot List:', 'wp-statistics'); ?></th>
|
56 |
+
<td>
|
57 |
<textarea name="wps_robotlist" class="code textarea-input-reset" dir="ltr" rows="10" cols="60" id="wps_robotlist"><?php
|
58 |
$robotlist = WP_STATISTICS\Option::get('robotlist');
|
59 |
if ($robotlist == '') {
|
63 |
echo htmlentities($robotlist, ENT_QUOTES);
|
64 |
?>
|
65 |
</textarea>
|
66 |
+
<p class="description"><?php echo __('It is a list of words (one per line) to match against to detect robots. Entries must be at least four characters long, or they will be ignored.', 'wp-statistics'); ?></p>
|
67 |
+
<a onclick="var wps_robotlist = getElementById('wps_robotlist'); wps_robotlist.value = '<?php echo str_replace(array("\r\n", "\n", "\r"), '\n', esc_html(\WP_STATISTICS\Helper::get_robots_list())); ?>';" class="button"><?php _e('Reset to Default', 'wp-statistics'); ?></a>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
|
71 |
+
<tr valign="top">
|
72 |
+
<th scope="row">
|
73 |
+
<label for="force_robot_update"><?php _e('Force Robot List Update After Upgrades:', 'wp-statistics'); ?></label>
|
74 |
+
</th>
|
75 |
+
<td>
|
76 |
+
<input id="force_robot_update" type="checkbox" value="1" name="wps_force_robot_update" <?php echo WP_STATISTICS\Option::get('force_robot_update') == true ? "checked='checked'" : ''; ?>><label for="force_robot_update"><?php _e('Enable', 'wp-statistics'); ?></label>
|
77 |
+
<p class="description"><?php echo sprintf(__('Force the robot list to reset itself to the default after WP-Statistics updated. Note that any custom robots added to the list will be lost if this option is enabled.', 'wp-statistics'), $role); ?></p>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
|
81 |
+
<tr valign="top">
|
82 |
+
<th scope="row">
|
83 |
+
<label for="wps_robot_threshold"><?php _e('Robot Visit Threshold:', 'wp-statistics'); ?></label>
|
84 |
+
</th>
|
85 |
+
<td>
|
86 |
+
<input id="wps_robot_threshold" type="text" size="5" name="wps_robot_threshold" value="<?php echo esc_attr(WP_STATISTICS\Option::get('robot_threshold')); ?>">
|
87 |
+
<p class="description"><?php echo __('Treat visitors with more than this number of visits per day as robots. 0 = disabled.', 'wp-statistics'); ?></p>
|
88 |
+
</td>
|
89 |
+
</tr>
|
90 |
|
91 |
+
<tr valign="top">
|
92 |
+
<th scope="row"><?php _e('Excluded IP Address List:', 'wp-statistics'); ?></th>
|
93 |
+
<td>
|
94 |
+
<textarea id="wps_exclude_ip" name="wps_exclude_ip" rows="5" cols="60" class="code" dir="ltr"><?php echo htmlentities(WP_STATISTICS\Option::get('exclude_ip'), ENT_QUOTES); ?></textarea>
|
95 |
+
<p class="description"><?php echo __('You can add a list of IP addresses and subnet masks (one per line) to exclude from the statistics collection.', 'wp-statistics'); ?></p>
|
96 |
+
<p class="description"><?php echo __('For IPv4 addresses, both 192.168.0.0/24 and 192.168.0.0/255.255.255.0 formats are acceptable. To specify an IP address, use a subnet value of 32 or 255.255.255.255.', 'wp-statistics'); ?></p>
|
97 |
+
<p class="description"><?php echo __('For IPv6 addresses, use the fc00::/7 format.', 'wp-statistics'); ?></p>
|
98 |
+
<?php
|
99 |
+
foreach (\WP_STATISTICS\IP::$private_SubNets as $ip) {
|
|
|
|
|
|
|
|
|
100 |
?>
|
101 |
+
<a onclick="var wps_exclude_ip = getElementById('wps_exclude_ip'); if( wps_exclude_ip != null ) { wps_exclude_ip.value = jQuery.trim( wps_exclude_ip.value + '\n<?php echo $ip; ?>' ); }" class="button"><?php _e('Add', 'wp-statistics'); ?><?php echo $ip; ?></a>
|
102 |
+
<?php
|
103 |
+
}
|
104 |
+
?>
|
105 |
+
</td>
|
106 |
+
</tr>
|
107 |
|
108 |
+
<tr valign="top">
|
109 |
+
<th scope="row"><label for="use_honeypot"><?php _e('Use Honey Pot:', 'wp-statistics'); ?></label></th>
|
110 |
+
<td>
|
111 |
+
<input id="use_honeypot" type="checkbox" value="1" name="wps_use_honeypot" <?php echo WP_STATISTICS\Option::get('use_honeypot') == true ? "checked='checked'" : ''; ?>><label for="wps_use_honeypot"><?php _e('Enable', 'wp-statistics'); ?></label>
|
112 |
+
<p class="description"><?php echo __('Enable this option for identifying robots by the Honey Pot page.', 'wp-statistics'); ?></p>
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
|
116 |
+
<tr valign="top">
|
117 |
+
<th scope="row"><label for="honeypot_postid"><?php _e('Honey Pot Page', 'wp-statistics'); ?></label></th>
|
118 |
+
<td>
|
119 |
+
<?php wp_dropdown_pages(array('show_option_none' => __('Please select', 'wp-statistics'), 'id' => 'honeypot_postid', 'name' => 'wps_honeypot_postid', 'selected' => WP_STATISTICS\Option::get('honeypot_postid'))); ?>
|
120 |
+
<p class="description"><?php echo __('Select the page for the Honey Pot page or create a new one.', 'wp-statistics'); ?></p>
|
121 |
+
<p><input id="wps_create_honeypot" type="checkbox" value="1" name="wps_create_honeypot"> <label for="wps_create_honeypot"><?php _e('Create a new Honey Pot page', 'wp-statistics'); ?></label></p>
|
122 |
+
</td>
|
123 |
+
</tr>
|
124 |
|
125 |
+
<tr valign="top">
|
126 |
+
<th scope="row">
|
127 |
+
<label for="corrupt_browser_info"><?php _e('Treat Corrupt Browser Info as a Bot:', 'wp-statistics'); ?></label>
|
128 |
+
</th>
|
129 |
+
<td>
|
130 |
+
<input id="corrupt_browser_info" type="checkbox" value="1" name="wps_corrupt_browser_info" <?php echo WP_STATISTICS\Option::get('corrupt_browser_info') == true ? "checked='checked'" : ''; ?>><label for="corrupt_browser_info"><?php _e('Enable', 'wp-statistics'); ?></label>
|
131 |
+
<p class="description"><?php echo __('Treat any visitor with corrupt browser info (missing IP address or empty user agent string) as a robot.', 'wp-statistics'); ?></p>
|
132 |
+
</td>
|
133 |
+
</tr>
|
134 |
</tbody>
|
135 |
</table>
|
136 |
</div>
|
137 |
<div class="postbox">
|
138 |
<table class="form-table">
|
139 |
<tbody>
|
140 |
+
<tr valign="top">
|
141 |
+
<th scope="row" colspan="2"><h3><?php _e('GeoIP Exclusions', 'wp-statistics'); ?></h3></th>
|
142 |
+
</tr>
|
143 |
|
144 |
+
<tr valign="top">
|
145 |
+
<th scope="row"><?php _e('Excluded Countries:', 'wp-statistics'); ?></th>
|
146 |
+
<td>
|
147 |
+
<textarea id="wps_excluded_countries" name="wps_excluded_countries" rows="5" cols="50" class="code" dir="ltr"><?php echo htmlentities(WP_STATISTICS\Option::get('excluded_countries'), ENT_QUOTES); ?></textarea>
|
148 |
+
<p class="description"><?php echo __('Add the country codes (one per line, two letters each) to exclude them from statistics collection.', 'wp-statistics') . ' ' . __('Use "000" (three zeros) to exclude unknown countries.', 'wp-statistics') . ' ' . sprintf(__('(%1$sISO 3166 Country Codes%2$s)', 'wp-statistics'), '<a href="' . esc_url('https://dev.maxmind.com/geoip/legacy/codes/iso3166/') . '" target="_blank">', '</a>'); ?></p>
|
149 |
+
</td>
|
150 |
+
</tr>
|
151 |
|
152 |
+
<tr valign="top">
|
153 |
+
<th scope="row"><?php _e('Included Countries:', 'wp-statistics'); ?></th>
|
154 |
+
<td>
|
155 |
+
<textarea id="wps_included_countries" name="wps_included_countries" rows="5" cols="50" class="code" dir="ltr"><?php echo htmlentities(WP_STATISTICS\Option::get('included_countries'), ENT_QUOTES); ?></textarea>
|
156 |
+
<p class="description"><?php echo __('Add the country codes (one per line, two letters each) to include them in statistics collection.', 'wp-statistics') . ' ' . __('Use "000" (three zeros) to exclude unknown countries.', 'wp-statistics') . ' ' . sprintf(__('(%1$sISO 3166 Country Codes%2$s)', 'wp-statistics'), '<a href="' . esc_url('https://dev.maxmind.com/geoip/legacy/codes/iso3166/') . '" target="_blank">', '</a>'); ?></p>
|
157 |
+
</td>
|
158 |
+
</tr>
|
159 |
</tbody>
|
160 |
</table>
|
161 |
</div>
|
162 |
<div class="postbox">
|
163 |
<table class="form-table">
|
164 |
<tbody>
|
165 |
+
<tr valign="top">
|
166 |
+
<th scope="row" colspan="2"><h3><?php _e('Host Exclusions', 'wp-statistics'); ?></h3></th>
|
167 |
+
</tr>
|
168 |
|
169 |
+
<tr valign="top">
|
170 |
+
<th scope="row"><?php _e('Excluded Hosts:', 'wp-statistics'); ?></th>
|
171 |
+
<td>
|
172 |
+
<textarea id="wps_excluded_hosts" name="wps_excluded_hosts" rows="5" cols="80" class="code" dir="ltr"><?php echo htmlentities(WP_STATISTICS\Option::get('excluded_hosts'), ENT_QUOTES); ?></textarea>
|
173 |
+
<p class="description"><?php echo __('You can add a list of fully qualified host names (i.e. server.example.com, one per line) to exclude from statistics collection.', 'wp-statistics'); ?></p><br>
|
174 |
+
<p class="description"><?php echo __('Note: This option will NOT perform a reverse DNS lookup on each page load but instead cache the provided hostnames’ IP address for one hour. If you exclude dynamically assigned hosts, you may find some overlap when the host changes its IP address and when the cache is updated, resulting in some hits recorded.', 'wp-statistics'); ?></p>
|
175 |
+
</td>
|
176 |
+
</tr>
|
177 |
</tbody>
|
178 |
</table>
|
179 |
</div>
|
180 |
<div class="postbox">
|
181 |
<table class="form-table">
|
182 |
<tbody>
|
183 |
+
<tr valign="top">
|
184 |
+
<th scope="row" colspan="2"><h3><?php _e('Site URL Exclusions', 'wp-statistics'); ?></h3></th>
|
185 |
+
</tr>
|
186 |
|
187 |
+
<tr valign="top">
|
188 |
+
<th scope="row"><?php _e('Excluded Login Page:', 'wp-statistics'); ?></th>
|
189 |
+
<td>
|
190 |
+
<input id="wps-exclude-loginpage" type="checkbox" value="1" name="wps_exclude_loginpage" <?php echo WP_STATISTICS\Option::get('exclude_loginpage') == true ? "checked='checked'" : ''; ?>><label for="wps-exclude-loginpage"><?php _e('Exclude', 'wp-statistics'); ?></label>
|
191 |
+
<p class="description"><?php _e('Exclude the login page for registering as a hit.', 'wp-statistics'); ?></p>
|
192 |
+
</td>
|
193 |
+
</tr>
|
194 |
+
<tr valign="top">
|
195 |
+
<th scope="row"><?php _e('Excluded RSS Feeds:', 'wp-statistics'); ?></th>
|
196 |
+
<td>
|
197 |
+
<input id="wps-exclude-feeds" type="checkbox" value="1" name="wps_exclude_feeds" <?php echo WP_STATISTICS\Option::get('exclude_feeds') == true ? "checked='checked'" : ''; ?>><label for="wps-exclude-feeds"><?php _e('Exclude', 'wp-statistics'); ?></label>
|
198 |
+
<p class="description"><?php _e('Exclude the RSS feeds for registering as a hit.', 'wp-statistics'); ?></p>
|
199 |
+
</td>
|
200 |
+
</tr>
|
201 |
+
<tr valign="top">
|
202 |
+
<th scope="row"><?php _e('Excluded 404 Pages:', 'wp-statistics'); ?></th>
|
203 |
+
<td>
|
204 |
+
<input id="wps-exclude-404s" type="checkbox" value="1" name="wps_exclude_404s" <?php echo WP_STATISTICS\Option::get('exclude_404s') == true ? "checked='checked'" : ''; ?>><label for="wps-exclude-404s"><?php _e('Exclude', 'wp-statistics'); ?></label>
|
205 |
+
<p class="description"><?php _e('Exclude any URL that returns a "404 - Not Found" message.', 'wp-statistics'); ?></p>
|
206 |
+
</td>
|
207 |
+
</tr>
|
208 |
+
<tr valign="top">
|
209 |
+
<th scope="row"><?php _e('Excluded URLs:', 'wp-statistics'); ?></th>
|
210 |
+
<td>
|
211 |
+
<textarea id="wps_excluded_urls" name="wps_excluded_urls" rows="5" cols="80" class="code" dir="ltr"><?php echo htmlentities(WP_STATISTICS\Option::get('excluded_urls'), ENT_QUOTES); ?></textarea>
|
212 |
+
<p class="description"><?php echo __('You can add a list of local URLs (i.e. /wordpress/about, one per line) to exclude from statistics collection.', 'wp-statistics'); ?></p><br>
|
213 |
+
<p class="description"><?php echo __('Note: This option will NOT handle URL parameters (anything after the ?), only to the script name. Entries less than two characters will be ignored.', 'wp-statistics'); ?></p>
|
214 |
+
</td>
|
215 |
+
</tr>
|
216 |
+
</tbody>
|
217 |
+
</table>
|
218 |
</div>
|
219 |
|
220 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='exclusions-settings'")); ?>
|
includes/admin/templates/settings/externals.php
CHANGED
@@ -1,228 +1,219 @@
|
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
<tr valign="top">
|
5 |
-
<th scope="row"
|
6 |
-
|
7 |
-
|
8 |
-
<tr valign="top">
|
9 |
-
<th scope="row" colspan="2">
|
10 |
-
<?php echo sprintf(__('IP location services are provided by data created by %s.', 'wp-statistics'), '<a href="http://www.maxmind.com" target=_blank>MaxMind</a>'); ?>
|
11 |
</th>
|
12 |
-
</tr>
|
13 |
-
<?php
|
14 |
-
if (WP_STATISTICS\GeoIP::IsSupport()) {
|
15 |
-
?>
|
16 |
-
<tr valign="top">
|
17 |
-
<th scope="row">
|
18 |
-
<label for="geoip-enable"><?php _e('GeoIP Collection:', 'wp-statistics'); ?></label>
|
19 |
-
</th>
|
20 |
-
|
21 |
-
<td>
|
22 |
-
<input id="geoip-enable" type="checkbox" name="wps_geoip" <?php echo(WP_STATISTICS\Option::get('geoip') === 'on' ? "checked='checked'" : ''); ?>>
|
23 |
-
<label for="geoip-enable">
|
24 |
-
<?php _e('Enable', 'wp-statistics'); ?>
|
25 |
-
<form action="" method="post" style="display: inline;">
|
26 |
-
<input type="hidden" name="geoip_name" value="country">
|
27 |
-
<?php submit_button(__("Update Database", 'wp-statistics'), "secondary", "update_geoip", false); ?>
|
28 |
-
</form>
|
29 |
-
</label>
|
30 |
-
|
31 |
-
<p class="description"><?php _e('Enable this option to get more information and location (country) from a visitor.', 'wp-statistics'); ?></p>
|
32 |
-
</td>
|
33 |
-
</tr>
|
34 |
-
|
35 |
-
<tr valign="top">
|
36 |
-
<th scope="row">
|
37 |
-
<label for="geoip-city"><?php _e('GeoIP City:', 'wp-statistics'); ?></label>
|
38 |
-
</th>
|
39 |
-
|
40 |
-
<td>
|
41 |
-
<input id="geoip-city" type="checkbox" name="wps_geoip_city" <?php echo(WP_STATISTICS\Option::get('geoip_city') == 'on' ? "checked='checked'" : ''); ?>>
|
42 |
-
<label for="geoip-city">
|
43 |
-
<?php _e('Enable', 'wp-statistics'); ?>
|
44 |
-
<form action="" method="post" style="display: inline;">
|
45 |
-
<input type="hidden" name="geoip_name" value="city">
|
46 |
-
<?php submit_button(__("Update Database", 'wp-statistics'), "secondary", "update_geoip", false); ?>
|
47 |
-
</form>
|
48 |
-
</label>
|
49 |
-
<p class="description"><?php _e('Enable this option to see visitors\'city name', 'wp-statistics'); ?></p>
|
50 |
-
</td>
|
51 |
-
</tr>
|
52 |
-
|
53 |
-
<tr valign="top">
|
54 |
-
<th scope="row">
|
55 |
-
<label for="geoip-schedule"><?php _e('Schedule Monthly Update of GeoIP DB:', 'wp-statistics'); ?></label>
|
56 |
-
</th>
|
57 |
-
|
58 |
-
<td>
|
59 |
-
<input id="geoip-schedule" type="checkbox" name="wps_schedule_geoip" <?php echo WP_STATISTICS\Option::get('schedule_geoip') == true ? "checked='checked'" : ''; ?>>
|
60 |
-
<label for="geoip-schedule"><?php _e('Enable', 'wp-statistics'); ?></label>
|
61 |
-
<?php
|
62 |
-
if (WP_STATISTICS\Option::get('schedule_geoip')) {
|
63 |
-
echo '<p class="description">' . __('Next update will be', 'wp-statistics') . ': <code>';
|
64 |
-
$last_update = WP_STATISTICS\Option::get('last_geoip_dl');
|
65 |
-
$this_month = strtotime(__('First Tuesday of this month', 'wp-statistics'));
|
66 |
-
|
67 |
-
if ($last_update > $this_month) {
|
68 |
-
$next_update = strtotime(__('First Tuesday of next month', 'wp-statistics')) + (86400 * 2);
|
69 |
-
} else {
|
70 |
-
$next_update = $this_month + (86400 * 2);
|
71 |
-
}
|
72 |
-
|
73 |
-
$next_schedule = wp_next_scheduled('wp_statistics_geoip_hook');
|
74 |
-
if ($next_schedule) {
|
75 |
-
echo \WP_STATISTICS\TimeZone::getLocalDate(get_option('date_format'), $next_update) .
|
76 |
-
' @ ' .
|
77 |
-
\WP_STATISTICS\TimeZone::getLocalDate(get_option('time_format'), $next_schedule);
|
78 |
-
} else {
|
79 |
-
echo \WP_STATISTICS\TimeZone::getLocalDate(get_option('date_format'), $next_update) .
|
80 |
-
' @ ' .
|
81 |
-
\WP_STATISTICS\TimeZone::getLocalDate(get_option('time_format'), time());
|
82 |
-
}
|
83 |
-
|
84 |
-
echo '</code></p>';
|
85 |
-
}
|
86 |
-
?>
|
87 |
-
<p class="description"><?php _e('Download of the GeoIP database will be scheduled for 2 days after the first Tuesday of the month.', 'wp-statistics'); ?></p>
|
88 |
-
<p class="description"><?php _e('This option will also download the database if the local filesize is less than 1k (which usually means the stub that comes with the plugin is still in place).', 'wp-statistics'); ?></p>
|
89 |
-
</td>
|
90 |
-
</tr>
|
91 |
-
|
92 |
-
<tr valign="top">
|
93 |
-
<th scope="row">
|
94 |
-
<label for="geoip-schedule"><?php _e('Populate Missing GeoIP After Updating GeoIP DB:', 'wp-statistics'); ?></label>
|
95 |
-
</th>
|
96 |
-
|
97 |
-
<td>
|
98 |
-
<input id="geoip-auto-pop" type="checkbox" name="wps_auto_pop" <?php echo WP_STATISTICS\Option::get('auto_pop') == true ? "checked='checked'" : ''; ?>>
|
99 |
-
<label for="geoip-auto-pop"><?php _e('Enable', 'wp-statistics'); ?></label>
|
100 |
-
<p class="description"><?php _e('Enable this option to update any missing GeoIP data after downloading a new database.', 'wp-statistics'); ?></p>
|
101 |
-
</td>
|
102 |
-
</tr>
|
103 |
-
|
104 |
-
<tr valign="top">
|
105 |
-
<th scope="row">
|
106 |
-
<label for="geoip-schedule"><?php _e('Country Code for Private IP Addresses:', 'wp-statistics'); ?></label>
|
107 |
-
</th>
|
108 |
-
|
109 |
-
<td>
|
110 |
-
<input type="text" size="3" id="geoip-private-country-code" name="wps_private_country_code" value="<?php echo htmlentities(WP_STATISTICS\Option::get('private_country_code', \WP_STATISTICS\GeoIP::$private_country), ENT_QUOTES); ?>">
|
111 |
-
<p class="description"><?php echo __('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.).', 'wp-statistics') . ' ' . __('Use "000" (three zeros) to use "Unknown" as the country code.', 'wp-statistics'); ?></p>
|
112 |
-
</td>
|
113 |
-
</tr>
|
114 |
-
<?php
|
115 |
-
} else {
|
116 |
-
?>
|
117 |
-
<tr valign="top">
|
118 |
-
<th scope="row" colspan="2">
|
119 |
-
<?php
|
120 |
-
echo __('GeoIP collection is disabled due to the following reasons:', 'wp-statistics') . '<br><br>';
|
121 |
-
|
122 |
-
if (!function_exists('curl_init')) {
|
123 |
-
echo '<br> * ';
|
124 |
-
_e('GeoIP collection requires the cURL PHP extension and it is not loaded on your version of PHP!', 'wp-statistics');
|
125 |
-
echo '<br>';
|
126 |
-
}
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
</th>
|
141 |
-
</tr>
|
142 |
-
<?php
|
143 |
-
} ?>
|
144 |
-
</tbody>
|
145 |
-
</table>
|
146 |
-
</div>
|
147 |
-
<div class="postbox">
|
148 |
-
<table class="form-table">
|
149 |
-
<tbody>
|
150 |
-
<tr valign="top">
|
151 |
-
<th scope="row" colspan="2">
|
152 |
-
<h3><?php _e('Matomo Referrer Spam Blacklist Settings', 'wp-statistics'); ?></h3>
|
153 |
-
</th>
|
154 |
</tr>
|
155 |
|
156 |
<tr valign="top">
|
157 |
-
<th scope="row"
|
158 |
-
|
159 |
</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
</tr>
|
161 |
|
162 |
<tr valign="top">
|
163 |
<th scope="row">
|
164 |
-
<label for="
|
165 |
</th>
|
166 |
|
167 |
<td>
|
168 |
-
<input id="
|
169 |
-
<label for="
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
</td>
|
172 |
</tr>
|
173 |
|
174 |
-
<tr valign="top"
|
175 |
-
echo ' style="display:none;"';
|
176 |
-
} ?>>
|
177 |
<th scope="row">
|
178 |
-
<label for="geoip-
|
179 |
</th>
|
180 |
|
181 |
<td>
|
182 |
-
<
|
183 |
-
<
|
|
|
184 |
</td>
|
185 |
</tr>
|
186 |
|
187 |
-
<tr valign="top"
|
188 |
-
echo ' style="display:none;"';
|
189 |
-
} ?>>
|
190 |
<th scope="row">
|
191 |
-
<label for="
|
192 |
</th>
|
193 |
|
194 |
<td>
|
195 |
-
<input
|
196 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
<?php
|
198 |
-
|
199 |
-
echo '<p class="description">' . __('Next update will be', 'wp-statistics') . ': <code>';
|
200 |
-
$last_update = WP_STATISTICS\Option::get('schedule_referrerspam');
|
201 |
-
if ($last_update == 0) {
|
202 |
-
$last_update = time();
|
203 |
-
}
|
204 |
-
$next_update = $last_update + (86400 * 7);
|
205 |
|
206 |
-
|
|
|
|
|
|
|
|
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
echo date(get_option('date_format'), $next_update) .
|
214 |
-
' @ ' .
|
215 |
-
date(get_option('time_format'), time());
|
216 |
-
}
|
217 |
|
218 |
-
|
|
|
|
|
|
|
219 |
}
|
220 |
?>
|
221 |
-
|
222 |
-
</td>
|
223 |
</tr>
|
224 |
-
|
225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
</div>
|
227 |
|
228 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='externals-settings'")); ?>
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
+
<tr valign="top">
|
5 |
+
<th scope="row" colspan="2"><h3><?php _e('GeoIP Settings', 'wp-statistics'); ?></h3></th>
|
6 |
+
</tr>
|
7 |
+
|
8 |
+
<tr valign="top">
|
9 |
+
<th scope="row" colspan="2">
|
10 |
+
<?php echo sprintf(__('IP location services are provided by data created by %s.', 'wp-statistics'), '<a href="http://www.maxmind.com" target=_blank>MaxMind</a>'); ?>
|
11 |
+
</th>
|
12 |
+
</tr>
|
13 |
+
<?php
|
14 |
+
if (WP_STATISTICS\GeoIP::IsSupport()) {
|
15 |
+
?>
|
16 |
<tr valign="top">
|
17 |
+
<th scope="row">
|
18 |
+
<label for="geoip-enable"><?php _e('GeoIP Collection:', 'wp-statistics'); ?></label>
|
|
|
|
|
|
|
|
|
19 |
</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
<td>
|
22 |
+
<input id="geoip-enable" type="checkbox" name="wps_geoip" <?php echo(WP_STATISTICS\Option::get('geoip') === 'on' ? "checked='checked'" : ''); ?>>
|
23 |
+
<label for="geoip-enable">
|
24 |
+
<?php _e('Enable', 'wp-statistics'); ?>
|
25 |
+
<form action="" method="post" style="display: inline;">
|
26 |
+
<input type="hidden" name="geoip_name" value="country">
|
27 |
+
<?php submit_button(__("Update Database", 'wp-statistics'), "secondary", "update_geoip", false); ?>
|
28 |
+
</form>
|
29 |
+
</label>
|
30 |
+
|
31 |
+
<p class="description"><?php _e('Enable this option to get more information and location (country) from a visitor.', 'wp-statistics'); ?></p>
|
32 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
</tr>
|
34 |
|
35 |
<tr valign="top">
|
36 |
+
<th scope="row">
|
37 |
+
<label for="geoip-city"><?php _e('GeoIP City:', 'wp-statistics'); ?></label>
|
38 |
</th>
|
39 |
+
|
40 |
+
<td>
|
41 |
+
<input id="geoip-city" type="checkbox" name="wps_geoip_city" <?php echo(WP_STATISTICS\Option::get('geoip_city') == 'on' ? "checked='checked'" : ''); ?>>
|
42 |
+
<label for="geoip-city">
|
43 |
+
<?php _e('Enable', 'wp-statistics'); ?>
|
44 |
+
<form action="" method="post" style="display: inline;">
|
45 |
+
<input type="hidden" name="geoip_name" value="city">
|
46 |
+
<?php submit_button(__("Update Database", 'wp-statistics'), "secondary", "update_geoip", false); ?>
|
47 |
+
</form>
|
48 |
+
</label>
|
49 |
+
<p class="description"><?php _e('Enable this option to see visitors\'city name', 'wp-statistics'); ?></p>
|
50 |
+
</td>
|
51 |
</tr>
|
52 |
|
53 |
<tr valign="top">
|
54 |
<th scope="row">
|
55 |
+
<label for="geoip-schedule"><?php _e('Schedule Monthly Update of GeoIP DB:', 'wp-statistics'); ?></label>
|
56 |
</th>
|
57 |
|
58 |
<td>
|
59 |
+
<input id="geoip-schedule" type="checkbox" name="wps_schedule_geoip" <?php echo WP_STATISTICS\Option::get('schedule_geoip') == true ? "checked='checked'" : ''; ?>>
|
60 |
+
<label for="geoip-schedule"><?php _e('Enable', 'wp-statistics'); ?></label>
|
61 |
+
<?php
|
62 |
+
if (WP_STATISTICS\Option::get('schedule_geoip')) {
|
63 |
+
echo '<p class="description">' . __('Next update will be', 'wp-statistics') . ': <code>';
|
64 |
+
$last_update = WP_STATISTICS\Option::get('last_geoip_dl');
|
65 |
+
$this_month = strtotime(__('First Tuesday of this month', 'wp-statistics'));
|
66 |
+
|
67 |
+
if ($last_update > $this_month) {
|
68 |
+
$next_update = strtotime(__('First Tuesday of next month', 'wp-statistics')) + (86400 * 2);
|
69 |
+
} else {
|
70 |
+
$next_update = $this_month + (86400 * 2);
|
71 |
+
}
|
72 |
+
|
73 |
+
$next_schedule = wp_next_scheduled('wp_statistics_geoip_hook');
|
74 |
+
if ($next_schedule) {
|
75 |
+
echo \WP_STATISTICS\TimeZone::getLocalDate(get_option('date_format'), $next_update) .
|
76 |
+
' @ ' .
|
77 |
+
\WP_STATISTICS\TimeZone::getLocalDate(get_option('time_format'), $next_schedule);
|
78 |
+
} else {
|
79 |
+
echo \WP_STATISTICS\TimeZone::getLocalDate(get_option('date_format'), $next_update) .
|
80 |
+
' @ ' .
|
81 |
+
\WP_STATISTICS\TimeZone::getLocalDate(get_option('time_format'), time());
|
82 |
+
}
|
83 |
+
|
84 |
+
echo '</code></p>';
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
<p class="description"><?php _e('Download of the GeoIP database will be scheduled for 2 days after the first Tuesday of the month.', 'wp-statistics'); ?></p>
|
88 |
+
<p class="description"><?php _e('This option will also download the database if the local filesize is less than 1k (which usually means the stub that comes with the plugin is still in place).', 'wp-statistics'); ?></p>
|
89 |
</td>
|
90 |
</tr>
|
91 |
|
92 |
+
<tr valign="top">
|
|
|
|
|
93 |
<th scope="row">
|
94 |
+
<label for="geoip-schedule"><?php _e('Populate Missing GeoIP After Updating GeoIP DB:', 'wp-statistics'); ?></label>
|
95 |
</th>
|
96 |
|
97 |
<td>
|
98 |
+
<input id="geoip-auto-pop" type="checkbox" name="wps_auto_pop" <?php echo WP_STATISTICS\Option::get('auto_pop') == true ? "checked='checked'" : ''; ?>>
|
99 |
+
<label for="geoip-auto-pop"><?php _e('Enable', 'wp-statistics'); ?></label>
|
100 |
+
<p class="description"><?php _e('Enable this option to update any missing GeoIP data after downloading a new database.', 'wp-statistics'); ?></p>
|
101 |
</td>
|
102 |
</tr>
|
103 |
|
104 |
+
<tr valign="top">
|
|
|
|
|
105 |
<th scope="row">
|
106 |
+
<label for="geoip-schedule"><?php _e('Country Code for Private IP Addresses:', 'wp-statistics'); ?></label>
|
107 |
</th>
|
108 |
|
109 |
<td>
|
110 |
+
<input type="text" size="3" id="geoip-private-country-code" name="wps_private_country_code" value="<?php echo htmlentities(WP_STATISTICS\Option::get('private_country_code', \WP_STATISTICS\GeoIP::$private_country), ENT_QUOTES); ?>">
|
111 |
+
<p class="description"><?php echo __('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.).', 'wp-statistics') . ' ' . __('Use "000" (three zeros) to use "Unknown" as the country code.', 'wp-statistics'); ?></p>
|
112 |
+
</td>
|
113 |
+
</tr>
|
114 |
+
<?php
|
115 |
+
} else {
|
116 |
+
?>
|
117 |
+
<tr valign="top">
|
118 |
+
<th scope="row" colspan="2">
|
119 |
<?php
|
120 |
+
echo __('GeoIP collection is disabled due to the following reasons:', 'wp-statistics') . '<br><br>';
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
+
if (!function_exists('curl_init')) {
|
123 |
+
echo '<br> * ';
|
124 |
+
_e('GeoIP collection requires the cURL PHP extension and it is not loaded on your version of PHP!', 'wp-statistics');
|
125 |
+
echo '<br>';
|
126 |
+
}
|
127 |
|
128 |
+
if (!function_exists('bcadd')) {
|
129 |
+
echo '<br> * ';
|
130 |
+
_e('GeoIP collection requires the BC Math PHP extension and it is not loaded on your version of PHP!', 'wp-statistics');
|
131 |
+
echo '<br>';
|
132 |
+
}
|
|
|
|
|
|
|
|
|
133 |
|
134 |
+
if (ini_get('safe_mode')) {
|
135 |
+
echo '<br> * ';
|
136 |
+
_e('PHP safe mode detected! GeoIP collection is not supported with PHP\'s safe mode enabled!', 'wp-statistics');
|
137 |
+
echo '<br>';
|
138 |
}
|
139 |
?>
|
140 |
+
</th>
|
|
|
141 |
</tr>
|
142 |
+
<?php
|
143 |
+
} ?>
|
144 |
+
</tbody>
|
145 |
+
</table>
|
146 |
+
</div>
|
147 |
+
<div class="postbox">
|
148 |
+
<table class="form-table">
|
149 |
+
<tbody>
|
150 |
+
<tr valign="top">
|
151 |
+
<th scope="row" colspan="2">
|
152 |
+
<h3><?php _e('Matomo Referrer Spam Blacklist Settings', 'wp-statistics'); ?></h3>
|
153 |
+
</th>
|
154 |
+
</tr>
|
155 |
+
|
156 |
+
<tr valign="top">
|
157 |
+
<th scope="row" colspan="2">
|
158 |
+
<?php echo sprintf(__('Referrer spam blacklist is provided by Matomo, available from %s.', 'wp-statistics'), '<a href="https://github.com/matomo-org/referrer-spam-blacklist" target=_blank>https://github.com/matomo-org/referrer-spam-blacklist</a>'); ?>
|
159 |
+
</th>
|
160 |
+
</tr>
|
161 |
+
|
162 |
+
<tr valign="top">
|
163 |
+
<th scope="row">
|
164 |
+
<label for="referrerspam-enable"><?php _e('Matomo Referrer Spam Blacklist Usage:', 'wp-statistics'); ?></label>
|
165 |
+
</th>
|
166 |
+
|
167 |
+
<td>
|
168 |
+
<input id="referrerspam-enable" type="checkbox" name="wps_referrerspam" <?php echo WP_STATISTICS\Option::get('referrerspam') == true ? "checked='checked'" : ''; ?>>
|
169 |
+
<label for="referrerspam-enable"><?php _e('Enable', 'wp-statistics'); ?></label>
|
170 |
+
<p class="description"><?php _e('Enable this option to download The Matomo Referrer Spam Blacklist database and detect referrer spam.', 'wp-statistics'); ?></p>
|
171 |
+
</td>
|
172 |
+
</tr>
|
173 |
+
|
174 |
+
<tr valign="top" class="referrerspam_field"<?php if (!WP_STATISTICS\Option::get('referrerspam')) {
|
175 |
+
echo ' style="display:none;"';
|
176 |
+
} ?>>
|
177 |
+
<th scope="row">
|
178 |
+
<label for="geoip-update"><?php _e('Update Matomo Referrer Spam Blacklist Info:', 'wp-statistics'); ?></label>
|
179 |
+
</th>
|
180 |
+
|
181 |
+
<td>
|
182 |
+
<a href="<?php echo WP_STATISTICS\Menus::admin_url('settings', array('tab' => 'externals-settings', 'update-referrer-spam' => 'yes')) ?>" class="button"><?php _e('Update', 'wp-staitsitcs'); ?></a>
|
183 |
+
<p class="description"><?php _e('Click button to download the update.', 'wp-statistics'); ?></p>
|
184 |
+
</td>
|
185 |
+
</tr>
|
186 |
+
|
187 |
+
<tr valign="top" class="referrerspam_field"<?php if (!WP_STATISTICS\Option::get('referrerspam')) {
|
188 |
+
echo ' style="display:none;"';
|
189 |
+
} ?>>
|
190 |
+
<th scope="row">
|
191 |
+
<label for="referrerspam-schedule"><?php _e('Schedule weekly update of Matomo Referrer Spam Blacklist DB:', 'wp-statistics'); ?></label>
|
192 |
+
</th>
|
193 |
+
|
194 |
+
<td>
|
195 |
+
<input id="referrerspam-schedule" type="checkbox" name="wps_schedule_referrerspam" <?php echo WP_STATISTICS\Option::get('schedule_referrerspam') == true ? "checked='checked'" : ''; ?>>
|
196 |
+
<label for="referrerspam-schedule"><?php _e('Enable', 'wp-statistics'); ?></label>
|
197 |
+
<?php
|
198 |
+
if (WP_STATISTICS\Option::get('schedule_referrerspam')) {
|
199 |
+
echo '<p class="description">' . __('Next update will be', 'wp-statistics') . ': <code>';
|
200 |
+
$next_schedule = wp_next_scheduled('wp_statistics_referrerspam_hook');
|
201 |
+
|
202 |
+
if ($next_schedule) {
|
203 |
+
echo date(get_option('date_format'), $next_schedule) . ' @ ' . date(get_option('time_format'), $next_schedule);
|
204 |
+
} else {
|
205 |
+
$next_update = time() + (86400 * 7);
|
206 |
+
echo date(get_option('date_format'), $next_update) . ' @ ' . date(get_option('time_format'), time());
|
207 |
+
}
|
208 |
+
|
209 |
+
echo '</code></p>';
|
210 |
+
}
|
211 |
+
?>
|
212 |
+
<p class="description"><?php _e('Download of the Matomo Referrer Spam Blacklist database will be scheduled for once a week.', 'wp-statistics'); ?></p>
|
213 |
+
</td>
|
214 |
+
</tr>
|
215 |
+
</tbody>
|
216 |
+
</table>
|
217 |
</div>
|
218 |
|
219 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='externals-settings'")); ?>
|
includes/admin/templates/settings/general.php
CHANGED
@@ -8,46 +8,46 @@
|
|
8 |
<table class="form-table">
|
9 |
<tbody>
|
10 |
<tr valign="top">
|
11 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
12 |
</tr>
|
13 |
|
14 |
<tr valign="top">
|
15 |
<th scope="row">
|
16 |
-
<label for="useronline"><?php _e(
|
17 |
</th>
|
18 |
|
19 |
<td>
|
20 |
-
<input id="useronline" type="checkbox" value="1" name="wps_useronline" <?php echo WP_STATISTICS\Option::get(
|
21 |
-
<label for="useronline"><?php _e(
|
22 |
-
<p class="description"><?php _e(
|
23 |
</td>
|
24 |
</tr>
|
25 |
|
26 |
<tr valign="top">
|
27 |
<th scope="row">
|
28 |
-
<label for="check_online"><?php _e(
|
29 |
</th>
|
30 |
|
31 |
<td>
|
32 |
-
<input type="text" class="small-text code" id="check_online" name="wps_check_online" value="<?php echo htmlentities(
|
33 |
-
|
34 |
-
|
35 |
-
<p class="description"><?php echo sprintf(
|
36 |
-
|
37 |
-
|
38 |
</td>
|
39 |
</tr>
|
40 |
|
41 |
<tr valign="top">
|
42 |
<th scope="row">
|
43 |
-
<label for="allonline"><?php _e(
|
44 |
</th>
|
45 |
|
46 |
<td>
|
47 |
-
<input id="allonline" type="checkbox" value="1" name="wps_all_online" <?php echo WP_STATISTICS\Option::get(
|
48 |
-
<label for="allonline"><?php _e(
|
49 |
-
<p class="description"><?php _e(
|
50 |
-
|
51 |
</td>
|
52 |
</tr>
|
53 |
</tbody>
|
@@ -57,18 +57,18 @@
|
|
57 |
<table class="form-table">
|
58 |
<tbody>
|
59 |
<tr valign="top">
|
60 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
61 |
</tr>
|
62 |
|
63 |
<tr valign="top">
|
64 |
<th scope="row">
|
65 |
-
<label for="visits"><?php _e(
|
66 |
</th>
|
67 |
|
68 |
<td>
|
69 |
-
<input id="visits" type="checkbox" value="1" name="wps_visits" <?php echo WP_STATISTICS\Option::get(
|
70 |
-
<label for="visits"><?php _e(
|
71 |
-
<p class="description"><?php _e(
|
72 |
</td>
|
73 |
</tr>
|
74 |
</tbody>
|
@@ -78,49 +78,49 @@
|
|
78 |
<table class="form-table">
|
79 |
<tbody>
|
80 |
<tr valign="top">
|
81 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
82 |
</tr>
|
83 |
|
84 |
<tr valign="top" id="visitors_tr">
|
85 |
<th scope="row">
|
86 |
-
<label for="visitors"><?php _e(
|
87 |
</th>
|
88 |
<td>
|
89 |
-
<input id="visitors" type="checkbox" value="1" name="wps_visitors" <?php echo WP_STATISTICS\Option::get(
|
90 |
-
<label for="visitors"><?php _e(
|
91 |
-
<p class="description"><?php _e(
|
92 |
</td>
|
93 |
</tr>
|
94 |
|
95 |
-
<tr valign="top" data-view="visitors_log_tr" <?php echo(
|
96 |
<th scope="row">
|
97 |
-
<label for="visitors_log"><?php _e(
|
98 |
</th>
|
99 |
<td>
|
100 |
-
<input id="visitors_log" type="checkbox" value="1" name="wps_visitors_log" <?php echo WP_STATISTICS\Option::get(
|
101 |
-
<label for="visitors_log"><?php _e(
|
102 |
-
<p class="description"><?php _e(
|
103 |
</td>
|
104 |
</tr>
|
105 |
|
106 |
-
<tr valign="top" data-view="visitors_log_tr" <?php echo(
|
107 |
<th scope="row">
|
108 |
-
<label for="enable_user_column"><?php _e(
|
109 |
</th>
|
110 |
<td>
|
111 |
-
<input id="enable_user_column" type="checkbox" value="1" name="wps_enable_user_column" <?php echo WP_STATISTICS\Option::get(
|
112 |
-
<label for="enable_user_column"><?php _e(
|
113 |
-
<p class="description"><?php _e(
|
114 |
</td>
|
115 |
</tr>
|
116 |
|
117 |
-
<tr valign="top" data-view="visitors_log_tr" <?php echo(
|
118 |
<th scope="row">
|
119 |
-
<label for="coefficient"><?php _e(
|
120 |
</th>
|
121 |
<td>
|
122 |
-
<input type="text" class="small-text code" id="coefficient" name="wps_coefficient" value="<?php echo htmlentities(
|
123 |
-
<p class="description"><?php echo sprintf(
|
124 |
</td>
|
125 |
</tr>
|
126 |
</tbody>
|
@@ -130,114 +130,114 @@
|
|
130 |
<table class="form-table">
|
131 |
<tbody>
|
132 |
<tr valign="top">
|
133 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
134 |
</tr>
|
135 |
|
136 |
<tr valign="top">
|
137 |
<th scope="row">
|
138 |
-
<label for="pages"><?php _e(
|
139 |
</th>
|
140 |
<td>
|
141 |
-
<input id="pages" type="checkbox" value="1" name="wps_pages" <?php echo WP_STATISTICS\Option::get(
|
142 |
-
<label for="pages"><?php _e(
|
143 |
-
<p class="description"><?php _e(
|
144 |
</td>
|
145 |
</tr>
|
146 |
|
147 |
<tr valign="top">
|
148 |
<th scope="row">
|
149 |
-
<label for="all_pages"><?php _e(
|
150 |
</th>
|
151 |
<td>
|
152 |
-
<input id="all_pages" type="checkbox" value="1" name="wps_track_all_pages" <?php echo WP_STATISTICS\Option::get(
|
153 |
-
<label for="all_pages"><?php _e(
|
154 |
-
<p class="description"><?php _e(
|
155 |
-
<p class="description"><?php echo sprintf(
|
156 |
</td>
|
157 |
</tr>
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
<tr valign="top">
|
163 |
<th scope="row">
|
164 |
-
<label for="strip_uri_parameters"><?php _e(
|
165 |
</th>
|
166 |
|
167 |
<td>
|
168 |
-
<input id="strip_uri_parameters" type="checkbox" value="1" name="wps_strip_uri_parameters" <?php echo WP_STATISTICS\Option::get(
|
169 |
-
<label for="strip_uri_parameters"><?php _e(
|
170 |
-
<p class="description"><?php _e(
|
171 |
</td>
|
172 |
</tr>
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
|
177 |
<tr valign="top">
|
178 |
<th scope="row">
|
179 |
-
<label for="disable-editor"><?php _e(
|
180 |
</th>
|
181 |
|
182 |
<td>
|
183 |
-
<input id="disable-editor" type="checkbox" value="1" name="wps_disable_editor" <?php echo WP_STATISTICS\Option::get(
|
184 |
-
<label for="disable-editor"><?php _e(
|
185 |
-
<p class="description"><?php _e(
|
186 |
</td>
|
187 |
</tr>
|
188 |
|
189 |
<tr valign="top">
|
190 |
<th scope="row">
|
191 |
-
<label for="disable_column"><?php _e(
|
192 |
</th>
|
193 |
<td>
|
194 |
-
<input id="disable_column" type="checkbox" value="1" name="wps_disable_column" <?php echo WP_STATISTICS\Option::get(
|
195 |
-
<label for="disable_column"><?php _e(
|
196 |
-
<p class="description"><?php _e(
|
197 |
</td>
|
198 |
</tr>
|
199 |
|
200 |
<tr valign="top">
|
201 |
<th scope="row">
|
202 |
-
<label for="hit_post_metabox"><?php _e(
|
203 |
</th>
|
204 |
|
205 |
<td>
|
206 |
-
<input id="hit_post_metabox" type="checkbox" value="1" name="wps_hit_post_metabox" <?php echo WP_STATISTICS\Option::get(
|
207 |
-
<label for="hit_post_metabox"><?php _e(
|
208 |
-
<p class="description"><?php _e(
|
209 |
</td>
|
210 |
</tr>
|
211 |
|
212 |
<tr valign="top">
|
213 |
<th scope="row">
|
214 |
-
<label for="show_hits"><?php _e(
|
215 |
</th>
|
216 |
|
217 |
<td>
|
218 |
-
<input id="show_hits" type="checkbox" value="1" name="wps_show_hits" <?php echo WP_STATISTICS\Option::get(
|
219 |
-
<label for="show_hits"><?php _e(
|
220 |
-
<p class="description"><?php _e(
|
221 |
</td>
|
222 |
</tr>
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
<tr valign="top"<?php echo $hidden; ?> id='wps_show_hits_option'>
|
230 |
<td scope="row" style="vertical-align: top;">
|
231 |
-
<label for="display_hits_position"><?php _e(
|
232 |
</td>
|
233 |
|
234 |
<td>
|
235 |
<select name="wps_display_hits_position" id="display_hits_position">
|
236 |
-
<option value="0" <?php selected(
|
237 |
-
<option value="before_content" <?php selected(
|
238 |
-
<option value="after_content" <?php selected(
|
239 |
</select>
|
240 |
-
<p class="description"><?php _e(
|
241 |
</td>
|
242 |
</tr>
|
243 |
</tbody>
|
@@ -247,19 +247,19 @@
|
|
247 |
<table class="form-table">
|
248 |
<tbody>
|
249 |
<tr valign="top">
|
250 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
251 |
</tr>
|
252 |
|
253 |
<tr valign="top">
|
254 |
<th scope="row">
|
255 |
-
<label for="use_cache_plugin"><?php _e(
|
256 |
</th>
|
257 |
|
258 |
<td>
|
259 |
-
<input id="use_cache_plugin" type="checkbox" value="1" name="wps_use_cache_plugin" <?php echo WP_STATISTICS\Option::get(
|
260 |
-
<label for="use_cache_plugin"><?php _e(
|
261 |
-
<p class="description"><?php _e(
|
262 |
-
<p class="description"><?php echo sprintf(
|
263 |
</td>
|
264 |
</tr>
|
265 |
</tbody>
|
@@ -269,32 +269,32 @@
|
|
269 |
<table class="form-table">
|
270 |
<tbody>
|
271 |
<tr valign="top">
|
272 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
273 |
</tr>
|
274 |
|
275 |
<tr valign="top">
|
276 |
<th scope="row">
|
277 |
-
<label for="menu-bar"><?php _e(
|
278 |
</th>
|
279 |
|
280 |
<td>
|
281 |
<select name="wps_menu_bar" id="menu-bar">
|
282 |
-
<option value="0" <?php selected(
|
283 |
-
<option value="1" <?php selected(
|
284 |
</select>
|
285 |
-
<p class="description"><?php _e(
|
286 |
</td>
|
287 |
</tr>
|
288 |
|
289 |
<tr valign="top">
|
290 |
<th scope="row">
|
291 |
-
<label for="hide_notices"><?php _e(
|
292 |
</th>
|
293 |
|
294 |
<td>
|
295 |
-
<input id="hide_notices" type="checkbox" value="1" name="wps_hide_notices" <?php echo WP_STATISTICS\Option::get(
|
296 |
-
<label for="hide_notices"><?php _e(
|
297 |
-
<p class="description"><?php _e(
|
298 |
</td>
|
299 |
</tr>
|
300 |
</tbody>
|
@@ -304,46 +304,46 @@
|
|
304 |
<table class="form-table">
|
305 |
<tbody>
|
306 |
<tr valign="top">
|
307 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
308 |
</tr>
|
309 |
|
310 |
<tr valign="top">
|
311 |
<th scope="row">
|
312 |
-
<label for="addsearchwords"><?php _e(
|
313 |
</th>
|
314 |
|
315 |
<td>
|
316 |
-
<input id="addsearchwords" type="checkbox" value="1" name="wps_addsearchwords" <?php echo WP_STATISTICS\Option::get(
|
317 |
-
<label for="addsearchwords"><?php _e(
|
318 |
-
<p class="description"><?php _e(
|
319 |
</td>
|
320 |
</tr>
|
321 |
|
322 |
<tr valign="top">
|
323 |
<th scope="row" colspan="2">
|
324 |
-
<p class="description"><?php _e(
|
325 |
</th>
|
326 |
</tr>
|
327 |
-
|
328 |
-
|
329 |
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
|
336 |
<tr valign="top">
|
337 |
<th scope="row">
|
338 |
-
<label for="<?php echo $option_name; ?>"><?php _e(
|
339 |
</th>
|
340 |
<td>
|
341 |
-
<input id="<?php echo $option_name; ?>" type="checkbox" value="1" name="<?php echo $option_name; ?>" <?php echo WP_STATISTICS\Option::get(
|
342 |
-
|
343 |
-
<p class="description"><?php echo sprintf(
|
344 |
</td>
|
345 |
</tr>
|
346 |
-
|
347 |
</tbody>
|
348 |
</table>
|
349 |
</div>
|
@@ -351,17 +351,17 @@
|
|
351 |
<table class="form-table">
|
352 |
<tbody>
|
353 |
<tr valign="top">
|
354 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
355 |
</tr>
|
356 |
|
357 |
<tr valign="top">
|
358 |
<th scope="row">
|
359 |
-
<label for="chart-totals"><?php _e(
|
360 |
</th>
|
361 |
<td>
|
362 |
-
<input id="chart-totals" type="checkbox" value="1" name="wps_chart_totals" <?php echo WP_STATISTICS\Option::get(
|
363 |
-
<label for="chart-totals"><?php _e(
|
364 |
-
<p class="description"><?php _e(
|
365 |
</td>
|
366 |
</tr>
|
367 |
|
8 |
<table class="form-table">
|
9 |
<tbody>
|
10 |
<tr valign="top">
|
11 |
+
<th scope="row" colspan="2"><h3><?php _e('Online Users', 'wp-statistics'); ?></h3></th>
|
12 |
</tr>
|
13 |
|
14 |
<tr valign="top">
|
15 |
<th scope="row">
|
16 |
+
<label for="useronline"><?php _e('Online User:', 'wp-statistics'); ?></label>
|
17 |
</th>
|
18 |
|
19 |
<td>
|
20 |
+
<input id="useronline" type="checkbox" value="1" name="wps_useronline" <?php echo WP_STATISTICS\Option::get('useronline') == true ? "checked='checked'" : ''; ?>>
|
21 |
+
<label for="useronline"><?php _e('Enable', 'wp-statistics'); ?></label>
|
22 |
+
<p class="description"><?php _e('Enable this feature to show online users', 'wp-statistics'); ?></p>
|
23 |
</td>
|
24 |
</tr>
|
25 |
|
26 |
<tr valign="top">
|
27 |
<th scope="row">
|
28 |
+
<label for="check_online"><?php _e('Check for Online Users Every:', 'wp-statistics'); ?></label>
|
29 |
</th>
|
30 |
|
31 |
<td>
|
32 |
+
<input type="text" class="small-text code" id="check_online" name="wps_check_online" value="<?php echo htmlentities(WP_STATISTICS\Option::get('check_online'),
|
33 |
+
ENT_QUOTES); ?>"/>
|
34 |
+
<?php _e('Seconds', 'wp-statistics'); ?>
|
35 |
+
<p class="description"><?php echo sprintf(__('Time for checking out accurate online users on the site. Now: %s Seconds',
|
36 |
+
'wp-statistics'),
|
37 |
+
WP_STATISTICS\Option::get('check_online')); ?></p>
|
38 |
</td>
|
39 |
</tr>
|
40 |
|
41 |
<tr valign="top">
|
42 |
<th scope="row">
|
43 |
+
<label for="allonline"><?php _e('Record All Users:', 'wp-statistics'); ?></label>
|
44 |
</th>
|
45 |
|
46 |
<td>
|
47 |
+
<input id="allonline" type="checkbox" value="1" name="wps_all_online" <?php echo WP_STATISTICS\Option::get('all_online') == true ? "checked='checked'" : ''; ?>>
|
48 |
+
<label for="allonline"><?php _e('Enable', 'wp-statistics'); ?></label>
|
49 |
+
<p class="description"><?php _e('Enable this option to ignore the exclusion settings and record all online users (including self referrals and robots). Should only be used for troubleshooting.',
|
50 |
+
'wp-statistics'); ?></p>
|
51 |
</td>
|
52 |
</tr>
|
53 |
</tbody>
|
57 |
<table class="form-table">
|
58 |
<tbody>
|
59 |
<tr valign="top">
|
60 |
+
<th scope="row" colspan="2"><h3><?php _e('Visits', 'wp-statistics'); ?></h3></th>
|
61 |
</tr>
|
62 |
|
63 |
<tr valign="top">
|
64 |
<th scope="row">
|
65 |
+
<label for="visits"><?php _e('Visits:', 'wp-statistics'); ?></label>
|
66 |
</th>
|
67 |
|
68 |
<td>
|
69 |
+
<input id="visits" type="checkbox" value="1" name="wps_visits" <?php echo WP_STATISTICS\Option::get('visits') == true ? "checked='checked'" : ''; ?>>
|
70 |
+
<label for="visits"><?php _e('Enable', 'wp-statistics'); ?></label>
|
71 |
+
<p class="description"><?php _e('Enable this option to show the number of Page Views', 'wp-statistics'); ?></p>
|
72 |
</td>
|
73 |
</tr>
|
74 |
</tbody>
|
78 |
<table class="form-table">
|
79 |
<tbody>
|
80 |
<tr valign="top">
|
81 |
+
<th scope="row" colspan="2"><h3><?php _e('Visitors', 'wp-statistics'); ?></h3></th>
|
82 |
</tr>
|
83 |
|
84 |
<tr valign="top" id="visitors_tr">
|
85 |
<th scope="row">
|
86 |
+
<label for="visitors"><?php _e('Visitors:', 'wp-statistics'); ?></label>
|
87 |
</th>
|
88 |
<td>
|
89 |
+
<input id="visitors" type="checkbox" value="1" name="wps_visitors" <?php echo WP_STATISTICS\Option::get('visitors') == true ? "checked='checked'" : ''; ?>>
|
90 |
+
<label for="visitors"><?php _e('Enable', 'wp-statistics'); ?></label>
|
91 |
+
<p class="description"><?php _e('Enable this option to show the number of Page Hits (It is the number of unique users which have visited your site)', 'wp-statistics'); ?></p>
|
92 |
</td>
|
93 |
</tr>
|
94 |
|
95 |
+
<tr valign="top" data-view="visitors_log_tr" <?php echo(WP_STATISTICS\Option::get('visitors') == false ? 'style="display:none;"' : '') ?>>
|
96 |
<th scope="row">
|
97 |
+
<label for="visitors_log"><?php _e('Log Visitors Pages:', 'wp-statistics'); ?></label>
|
98 |
</th>
|
99 |
<td>
|
100 |
+
<input id="visitors_log" type="checkbox" value="1" name="wps_visitors_log" <?php echo WP_STATISTICS\Option::get('visitors_log') == true ? "checked='checked'" : ''; ?>>
|
101 |
+
<label for="visitors_log"><?php _e('Enable', 'wp-statistics'); ?></label>
|
102 |
+
<p class="description"><?php _e('Enable this option to receive a report of each user’s visits to the pages', 'wp-statistics'); ?></p>
|
103 |
</td>
|
104 |
</tr>
|
105 |
|
106 |
+
<tr valign="top" data-view="visitors_log_tr" <?php echo(WP_STATISTICS\Option::get('visitors') == false ? 'style="display:none;"' : '') ?>>
|
107 |
<th scope="row">
|
108 |
+
<label for="enable_user_column"><?php _e('User Visits Column', 'wp-statistics'); ?></label>
|
109 |
</th>
|
110 |
<td>
|
111 |
+
<input id="enable_user_column" type="checkbox" value="1" name="wps_enable_user_column" <?php echo WP_STATISTICS\Option::get('enable_user_column') == true ? "checked='checked'" : ''; ?>>
|
112 |
+
<label for="enable_user_column"><?php _e('Enable', 'wp-statistics'); ?></label>
|
113 |
+
<p class="description"><?php _e('Enable this option to show the list of user visits, link in the WordPress admin user list page.', 'wp-statistics'); ?></p>
|
114 |
</td>
|
115 |
</tr>
|
116 |
|
117 |
+
<tr valign="top" data-view="visitors_log_tr" <?php echo(WP_STATISTICS\Option::get('visitors') == false ? 'style="display:none;"' : '') ?>>
|
118 |
<th scope="row">
|
119 |
+
<label for="coefficient"><?php _e('Coefficient per Visitor:', 'wp-statistics'); ?></label>
|
120 |
</th>
|
121 |
<td>
|
122 |
+
<input type="text" class="small-text code" id="coefficient" name="wps_coefficient" value="<?php echo htmlentities(WP_STATISTICS\Option::get('coefficient'), ENT_QUOTES); ?>"/>
|
123 |
+
<p class="description"><?php echo sprintf(__('This feature multiplies the number of each visitor. Currently %s.', 'wp-statistics'), WP_STATISTICS\Option::get('coefficient')); ?></p>
|
124 |
</td>
|
125 |
</tr>
|
126 |
</tbody>
|
130 |
<table class="form-table">
|
131 |
<tbody>
|
132 |
<tr valign="top">
|
133 |
+
<th scope="row" colspan="2"><h3><?php _e('Pages and Posts', 'wp-statistics'); ?></h3></th>
|
134 |
</tr>
|
135 |
|
136 |
<tr valign="top">
|
137 |
<th scope="row">
|
138 |
+
<label for="pages"><?php _e('Pages:', 'wp-statistics'); ?></label>
|
139 |
</th>
|
140 |
<td>
|
141 |
+
<input id="pages" type="checkbox" value="1" name="wps_pages" <?php echo WP_STATISTICS\Option::get('pages') == true ? "checked='checked'" : ''; ?>>
|
142 |
+
<label for="pages"><?php _e('Enable', 'wp-statistics'); ?></label>
|
143 |
+
<p class="description"><?php _e('Enable this option to count the Pages visits', 'wp-statistics'); ?></p>
|
144 |
</td>
|
145 |
</tr>
|
146 |
|
147 |
<tr valign="top">
|
148 |
<th scope="row">
|
149 |
+
<label for="all_pages"><?php _e('Track All Pages:', 'wp-statistics'); ?></label>
|
150 |
</th>
|
151 |
<td>
|
152 |
+
<input id="all_pages" type="checkbox" value="1" name="wps_track_all_pages" <?php echo WP_STATISTICS\Option::get('track_all_pages') == true ? "checked='checked'" : ''; ?>>
|
153 |
+
<label for="all_pages"><?php _e('Enable', 'wp-statistics'); ?></label>
|
154 |
+
<p class="description"><?php _e('Enable or disable this feature', 'wp-statistics'); ?></p>
|
155 |
+
<p class="description"><?php echo sprintf(__('Track all WordPress pages, contains Category, Post Tags, Author, Custom Taxonomy, etc.', 'wp-statistics'), admin_url('options-permalink.php')); ?></p>
|
156 |
</td>
|
157 |
</tr>
|
158 |
|
159 |
+
<?php
|
160 |
+
if (!$disable_strip_uri_parameters) {
|
161 |
+
?>
|
162 |
<tr valign="top">
|
163 |
<th scope="row">
|
164 |
+
<label for="strip_uri_parameters"><?php _e('Strip URL Parameters:', 'wp-statistics'); ?></label>
|
165 |
</th>
|
166 |
|
167 |
<td>
|
168 |
+
<input id="strip_uri_parameters" type="checkbox" value="1" name="wps_strip_uri_parameters" <?php echo WP_STATISTICS\Option::get('strip_uri_parameters') == true ? "checked='checked'" : ''; ?>>
|
169 |
+
<label for="strip_uri_parameters"><?php _e('Enable', 'wp-statistics'); ?></label>
|
170 |
+
<p class="description"><?php _e('Enable this option to remove everything after the “?” in a URL', 'wp-statistics'); ?></p>
|
171 |
</td>
|
172 |
</tr>
|
173 |
+
<?php
|
174 |
+
}
|
175 |
+
?>
|
176 |
|
177 |
<tr valign="top">
|
178 |
<th scope="row">
|
179 |
+
<label for="disable-editor"><?php _e('Hits Chart', 'wp-statistics'); ?></label>
|
180 |
</th>
|
181 |
|
182 |
<td>
|
183 |
+
<input id="disable-editor" type="checkbox" value="1" name="wps_disable_editor" <?php echo WP_STATISTICS\Option::get('disable_editor') == true ? "checked='checked'" : ''; ?>>
|
184 |
+
<label for="disable-editor"><?php _e('Disable', 'wp-statistics'); ?></label>
|
185 |
+
<p class="description"><?php _e('Show Hits Chart in the WordPress page/post editor.', 'wp-statistics'); ?></p>
|
186 |
</td>
|
187 |
</tr>
|
188 |
|
189 |
<tr valign="top">
|
190 |
<th scope="row">
|
191 |
+
<label for="disable_column"><?php _e('Hits Column', 'wp-statistics'); ?></label>
|
192 |
</th>
|
193 |
<td>
|
194 |
+
<input id="disable_column" type="checkbox" value="1" name="wps_disable_column" <?php echo WP_STATISTICS\Option::get('disable_column') == true ? "checked='checked'" : ''; ?>>
|
195 |
+
<label for="disable_column"><?php _e('Disable', 'wp-statistics'); ?></label>
|
196 |
+
<p class="description"><?php _e('Enable this option to add Hits Column', 'wp-statistics'); ?></p>
|
197 |
</td>
|
198 |
</tr>
|
199 |
|
200 |
<tr valign="top">
|
201 |
<th scope="row">
|
202 |
+
<label for="hit_post_metabox"><?php _e('Hits Metabox Chart:', 'wp-statistics'); ?></label>
|
203 |
</th>
|
204 |
|
205 |
<td>
|
206 |
+
<input id="hit_post_metabox" type="checkbox" value="1" name="wps_hit_post_metabox" <?php echo WP_STATISTICS\Option::get('hit_post_metabox') == true ? "checked='checked'" : ''; ?>>
|
207 |
+
<label for="hit_post_metabox"><?php _e('Enable', 'wp-statistics'); ?></label>
|
208 |
+
<p class="description"><?php _e('Enable this option to show hits metabox chart on the edit page of all post types', 'wp-statistics'); ?></p>
|
209 |
</td>
|
210 |
</tr>
|
211 |
|
212 |
<tr valign="top">
|
213 |
<th scope="row">
|
214 |
+
<label for="show_hits"><?php _e('Hits in Single Page:', 'wp-statistics'); ?></label>
|
215 |
</th>
|
216 |
|
217 |
<td>
|
218 |
+
<input id="show_hits" type="checkbox" value="1" name="wps_show_hits" <?php echo WP_STATISTICS\Option::get('show_hits') == true ? "checked='checked'" : ''; ?> onClick='ToggleShowHitsOptions();'>
|
219 |
+
<label for="show_hits"><?php _e('Enable', 'wp-statistics'); ?></label>
|
220 |
+
<p class="description"><?php _e('Enable it to show hits in content', 'wp-statistics'); ?></p>
|
221 |
</td>
|
222 |
</tr>
|
223 |
|
224 |
+
<?php if (WP_STATISTICS\Option::get('show_hits')) {
|
225 |
+
$hidden = "";
|
226 |
+
} else {
|
227 |
+
$hidden = " style='display: none;'";
|
228 |
+
} ?>
|
229 |
<tr valign="top"<?php echo $hidden; ?> id='wps_show_hits_option'>
|
230 |
<td scope="row" style="vertical-align: top;">
|
231 |
+
<label for="display_hits_position"><?php _e('Display position:', 'wp-statistics'); ?></label>
|
232 |
</td>
|
233 |
|
234 |
<td>
|
235 |
<select name="wps_display_hits_position" id="display_hits_position">
|
236 |
+
<option value="0" <?php selected(WP_STATISTICS\Option::get('display_hits_position'), '0'); ?>><?php _e('Please select', 'wp-statistics'); ?></option>
|
237 |
+
<option value="before_content" <?php selected(WP_STATISTICS\Option::get('display_hits_position'), 'before_content'); ?>><?php _e('Before Content', 'wp-statistics'); ?></option>
|
238 |
+
<option value="after_content" <?php selected(WP_STATISTICS\Option::get('display_hits_position'), 'after_content'); ?>><?php _e('After Content', 'wp-statistics'); ?></option>
|
239 |
</select>
|
240 |
+
<p class="description"><?php _e('Choose the position to show Hits.', 'wp-statistics'); ?></p>
|
241 |
</td>
|
242 |
</tr>
|
243 |
</tbody>
|
247 |
<table class="form-table">
|
248 |
<tbody>
|
249 |
<tr valign="top">
|
250 |
+
<th scope="row" colspan="2"><h3><?php _e('Cache Compatibility', 'wp-statistics'); ?></h3></th>
|
251 |
</tr>
|
252 |
|
253 |
<tr valign="top">
|
254 |
<th scope="row">
|
255 |
+
<label for="use_cache_plugin"><?php _e('Status:', 'wp-statistics'); ?></label>
|
256 |
</th>
|
257 |
|
258 |
<td>
|
259 |
+
<input id="use_cache_plugin" type="checkbox" value="1" name="wps_use_cache_plugin" <?php echo WP_STATISTICS\Option::get('use_cache_plugin') == true ? "checked='checked'" : ''; ?>>
|
260 |
+
<label for="use_cache_plugin"><?php _e('Enable', 'wp-statistics'); ?></label>
|
261 |
+
<p class="description"><?php _e('Enable this option if the Cache is enabled in your WordPress', 'wp-statistics'); ?></p>
|
262 |
+
<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 by pressing Save Changes and then clear the cache.', 'wp-statistics'), WP_STATISTICS\RestAPI::$namespace, admin_url('options-permalink.php')); ?></p>
|
263 |
</td>
|
264 |
</tr>
|
265 |
</tbody>
|
269 |
<table class="form-table">
|
270 |
<tbody>
|
271 |
<tr valign="top">
|
272 |
+
<th scope="row" colspan="2"><h3><?php _e('Miscellaneous', 'wp-statistics'); ?></h3></th>
|
273 |
</tr>
|
274 |
|
275 |
<tr valign="top">
|
276 |
<th scope="row">
|
277 |
+
<label for="menu-bar"><?php _e('Show Stats in Menu Bar:', 'wp-statistics'); ?></label>
|
278 |
</th>
|
279 |
|
280 |
<td>
|
281 |
<select name="wps_menu_bar" id="menu-bar">
|
282 |
+
<option value="0" <?php selected(WP_STATISTICS\Option::get('menu_bar'), '0'); ?>><?php _e('No', 'wp-statistics'); ?></option>
|
283 |
+
<option value="1" <?php selected(WP_STATISTICS\Option::get('menu_bar'), '1'); ?>><?php _e('Yes', 'wp-statistics'); ?></option>
|
284 |
</select>
|
285 |
+
<p class="description"><?php _e('Select Yes to show stats in the admin menu bar', 'wp-statistics'); ?></p>
|
286 |
</td>
|
287 |
</tr>
|
288 |
|
289 |
<tr valign="top">
|
290 |
<th scope="row">
|
291 |
+
<label for="hide_notices"><?php _e('Hide Admin Notices About Non-active Features:', 'wp-statistics'); ?></label>
|
292 |
</th>
|
293 |
|
294 |
<td>
|
295 |
+
<input id="hide_notices" type="checkbox" value="1" name="wps_hide_notices" <?php echo WP_STATISTICS\Option::get('hide_notices') == true ? "checked='checked'" : ''; ?>>
|
296 |
+
<label for="hide_notices"><?php _e('Enable', 'wp-statistics'); ?></label>
|
297 |
+
<p class="description"><?php _e('WP-Statistics displays an alert if any of the core features are disabled. To hide these notices, enable this option.', 'wp-statistics'); ?></p>
|
298 |
</td>
|
299 |
</tr>
|
300 |
</tbody>
|
304 |
<table class="form-table">
|
305 |
<tbody>
|
306 |
<tr valign="top">
|
307 |
+
<th scope="row" colspan="2"><h3><?php _e('Search Engines', 'wp-statistics'); ?></h3></th>
|
308 |
</tr>
|
309 |
|
310 |
<tr valign="top">
|
311 |
<th scope="row">
|
312 |
+
<label for="addsearchwords"><?php _e('Add Page Title to Empty Search Words:', 'wp-statistics'); ?></label>
|
313 |
</th>
|
314 |
|
315 |
<td>
|
316 |
+
<input id="addsearchwords" type="checkbox" value="1" name="wps_addsearchwords" <?php echo WP_STATISTICS\Option::get('addsearchwords') == true ? "checked='checked'" : ''; ?>>
|
317 |
+
<label for="addsearchwords"><?php _e('Enable', 'wp-statistics'); ?></label>
|
318 |
+
<p class="description"><?php _e('If a search engine is identified as the referrer but it does not include the search query this option will substitute the page title in quotes preceded by "~:" as the search query to help identify what the user may have been searching for.', 'wp-statistics'); ?></p>
|
319 |
</td>
|
320 |
</tr>
|
321 |
|
322 |
<tr valign="top">
|
323 |
<th scope="row" colspan="2">
|
324 |
+
<p class="description"><?php _e('Disabling all search engines is not allowed. Doing so will result in all search engines being active.', 'wp-statistics'); ?></p>
|
325 |
</th>
|
326 |
</tr>
|
327 |
+
<?php
|
328 |
+
$se_option_list = '';
|
329 |
|
330 |
+
foreach ($selist as $se) {
|
331 |
+
$option_name = 'wps_disable_se_' . $se['tag'];
|
332 |
+
$store_name = 'disable_se_' . $se['tag'];
|
333 |
+
$se_option_list .= $option_name . ',';
|
334 |
+
?>
|
335 |
|
336 |
<tr valign="top">
|
337 |
<th scope="row">
|
338 |
+
<label for="<?php echo $option_name; ?>"><?php _e($se['name'], 'wp-statistics'); ?>:</label>
|
339 |
</th>
|
340 |
<td>
|
341 |
+
<input id="<?php echo $option_name; ?>" type="checkbox" value="1" name="<?php echo $option_name; ?>" <?php echo WP_STATISTICS\Option::get($store_name) == true ? "checked='checked'" : ''; ?>><label for="<?php echo $option_name; ?>"><?php _e('Disable',
|
342 |
+
'wp-statistics'); ?></label>
|
343 |
+
<p class="description"><?php echo sprintf(__('Disable %s from data collection and reporting.', 'wp-statistics'), $se['name']); ?></p>
|
344 |
</td>
|
345 |
</tr>
|
346 |
+
<?php } ?>
|
347 |
</tbody>
|
348 |
</table>
|
349 |
</div>
|
351 |
<table class="form-table">
|
352 |
<tbody>
|
353 |
<tr valign="top">
|
354 |
+
<th scope="row" colspan="2"><h3><?php _e('Charts', 'wp-statistics'); ?></h3></th>
|
355 |
</tr>
|
356 |
|
357 |
<tr valign="top">
|
358 |
<th scope="row">
|
359 |
+
<label for="chart-totals"><?php _e('Include Totals:', 'wp-statistics'); ?></label>
|
360 |
</th>
|
361 |
<td>
|
362 |
+
<input id="chart-totals" type="checkbox" value="1" name="wps_chart_totals" <?php echo WP_STATISTICS\Option::get('chart_totals') == true ? "checked='checked'" : ''; ?>>
|
363 |
+
<label for="chart-totals"><?php _e('Enable', 'wp-statistics'); ?></label>
|
364 |
+
<p class="description"><?php _e('Add a total line to charts with multiple values, like the search engine referrals', 'wp-statistics'); ?></p>
|
365 |
</td>
|
366 |
</tr>
|
367 |
|
includes/admin/templates/settings/maintenance.php
CHANGED
@@ -10,69 +10,69 @@
|
|
10 |
<div class="postbox">
|
11 |
<table class="form-table">
|
12 |
<tbody>
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
</tbody>
|
41 |
</table>
|
42 |
</div>
|
43 |
<div class="postbox">
|
44 |
<table class="form-table">
|
45 |
<tbody>
|
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 |
-
</table>
|
76 |
</div>
|
77 |
|
78 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='maintenance-settings'")); ?>
|
10 |
<div class="postbox">
|
11 |
<table class="form-table">
|
12 |
<tbody>
|
13 |
+
<tr valign="top">
|
14 |
+
<th scope="row" colspan="2"><h3><?php _e('Purge Old Data Daily', 'wp-statistics'); ?></h3></th>
|
15 |
+
</tr>
|
16 |
|
17 |
+
<tr valign="top">
|
18 |
+
<th scope="row">
|
19 |
+
<label for="wps_schedule_dbmaint"><?php _e('Enabled:', 'wp-statistics'); ?></label>
|
20 |
+
</th>
|
21 |
|
22 |
+
<td>
|
23 |
+
<input id="wps_schedule_dbmaint" type="checkbox" name="wps_schedule_dbmaint" <?php echo WP_STATISTICS\Option::get('schedule_dbmaint') == true ? "checked='checked'" : ''; ?> onclick='DBMaintWarning();'>
|
24 |
+
<label for="wps_schedule_dbmaint"><?php _e('Enable', 'wp-statistics'); ?></label>
|
25 |
+
<p class="description"><?php _e('A WP Cron job will be run daily to purge any data older than a set number of days.', 'wp-statistics'); ?></p>
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
|
29 |
+
<tr valign="top">
|
30 |
+
<th scope="row">
|
31 |
+
<label for="wps_schedule_dbmaint_days"><?php _e('Purge Data Older Than:', 'wp-statistics'); ?></label>
|
32 |
+
</th>
|
33 |
|
34 |
+
<td>
|
35 |
+
<input type="text" class="small-text code" id="wps_schedule_dbmaint_days" name="wps_schedule_dbmaint_days" value="<?php echo htmlentities(WP_STATISTICS\Option::get('schedule_dbmaint_days', "365"), ENT_QUOTES); ?>"/>
|
36 |
+
<?php _e('Days', 'wp-statistics'); ?>
|
37 |
+
<p class="description"><?php echo __('The number of days to keep statistics for.', 'wp-statistics') . ' ' . __('The minimum value is 30 days.', 'wp-statistics') . ' ' . __('Invalid values will disable the daily maintenance.', 'wp-statistics'); ?></p>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
</tbody>
|
41 |
</table>
|
42 |
</div>
|
43 |
<div class="postbox">
|
44 |
<table class="form-table">
|
45 |
<tbody>
|
46 |
+
<tr valign="top">
|
47 |
+
<th scope="row" colspan="2"><h3><?php _e('Purge High Hit Count Visitors Daily', 'wp-statistics'); ?></h3>
|
48 |
+
</th>
|
49 |
+
</tr>
|
50 |
|
51 |
+
<tr valign="top">
|
52 |
+
<th scope="row">
|
53 |
+
<label for="wps_schedule_dbmaint_visitor"><?php _e('Enabled:', 'wp-statistics'); ?></label>
|
54 |
+
</th>
|
55 |
|
56 |
+
<td>
|
57 |
+
<input id="wps_schedule_dbmaint_visitor" type="checkbox" name="wps_schedule_dbmaint_visitor" <?php echo WP_STATISTICS\Option::get('schedule_dbmaint_visitor') == true ? "checked='checked'" : ''; ?> onclick='DBMaintWarning();'>
|
58 |
+
<label for="wps_schedule_dbmaint_visitor"><?php _e('Enable', 'wp-statistics'); ?></label>
|
59 |
+
<p class="description"><?php _e('A WP Cron job will be run daily to purge any users statistics data where the user has more than the defined number of hits in a day (aka they are probably a bot).', 'wp-statistics'); ?></p>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
|
63 |
+
<tr valign="top">
|
64 |
+
<th scope="row">
|
65 |
+
<label for="wps_schedule_dbmaint_visitor_hits"><?php _e('Purge Visitors More Than:', 'wp-statistics'); ?></label>
|
66 |
+
</th>
|
67 |
|
68 |
+
<td>
|
69 |
+
<input type="text" class="small-text code" id="wps_schedule_dbmaint_visitor_hits" name="wps_schedule_dbmaint_visitor_hits" value="<?php echo htmlentities(WP_STATISTICS\Option::get('schedule_dbmaint_visitor_hits', '50'), ENT_QUOTES); ?>"/>
|
70 |
+
<?php _e('Hits', 'wp-statistics'); ?>
|
71 |
+
<p class="description"><?php echo __('The number of hits required to delete the visitor.', 'wp-statistics') . ' ' . __('Minimum value is 10 hits.', 'wp-statistics') . ' ' . __('Invalid values will disable the daily maintenance.', 'wp-statistics'); ?></p>
|
72 |
+
</td>
|
73 |
+
</tr>
|
74 |
+
</tbody>
|
75 |
+
</table>
|
76 |
</div>
|
77 |
|
78 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='maintenance-settings'")); ?>
|
includes/admin/templates/settings/notifications.php
CHANGED
@@ -6,191 +6,191 @@
|
|
6 |
<div class="postbox">
|
7 |
<table class="form-table">
|
8 |
<tbody>
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
</tbody>
|
27 |
</table>
|
28 |
</div>
|
29 |
<div class="postbox">
|
30 |
<table class="form-table">
|
31 |
<tbody>
|
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 |
</tbody>
|
60 |
</table>
|
61 |
</div>
|
62 |
<div class="postbox">
|
63 |
<table class="form-table">
|
64 |
<tbody>
|
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 |
-
return ($a['interval'] < $b['interval']) ? -1 : 1;
|
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 |
-
<?php
|
133 |
-
</select>
|
134 |
-
|
135 |
-
<p class="description"><?php _e('Select delivery method for statistical report.', 'wp-statistics'); ?></p>
|
136 |
-
<?php if (!is_plugin_active('wp-sms/wp-sms.php')) { ?>
|
137 |
-
<p class="description note"><?php echo sprintf(__('Note: To send SMS text messages please install the %s plugin.', 'wp-statistics'), '<a href="http://wordpress.org/extend/plugins/wp-sms/" target="_blank">' . __('WordPress SMS', 'wp-statistics') . '</a>'); ?></p>
|
138 |
<?php } ?>
|
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 |
</tbody>
|
174 |
</table>
|
175 |
</div>
|
176 |
<div class="postbox">
|
177 |
<table class="form-table">
|
178 |
<tbody>
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
</tbody>
|
195 |
</table>
|
196 |
</div>
|
6 |
<div class="postbox">
|
7 |
<table class="form-table">
|
8 |
<tbody>
|
9 |
+
<tr valign="top">
|
10 |
+
<th scope="row" colspan="2"><h3><?php _e('Common Report Options', 'wp-statistics'); ?></h3></th>
|
11 |
+
</tr>
|
12 |
+
|
13 |
+
<tr valign="top">
|
14 |
+
<td scope="row" style="vertical-align: top;">
|
15 |
+
<label for="email-report"><?php _e('Email Addresses:', 'wp-statistics'); ?></label>
|
16 |
+
</td>
|
17 |
+
|
18 |
+
<td>
|
19 |
+
<input dir="ltr" type="text" id="email_list" name="wps_email_list" size="30" value="<?php if (WP_STATISTICS\Option::get('email_list') == '') {
|
20 |
+
$wp_statistics_options['email_list'] = get_bloginfo('admin_email');
|
21 |
+
}
|
22 |
+
echo htmlentities(WP_STATISTICS\Option::get('email_list'), ENT_QUOTES); ?>"/>
|
23 |
+
<p class="description"><?php _e('Add email addresses you want to receive reports and separate them with a comma.', 'wp-statistics'); ?></p>
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
</tbody>
|
27 |
</table>
|
28 |
</div>
|
29 |
<div class="postbox">
|
30 |
<table class="form-table">
|
31 |
<tbody>
|
32 |
+
<tr valign="top">
|
33 |
+
<th scope="row" colspan="2"><h3><?php _e('Update Reports', 'wp-statistics'); ?></h3></th>
|
34 |
+
</tr>
|
35 |
+
|
36 |
+
<tr valign="top">
|
37 |
+
<td scope="row">
|
38 |
+
<label for="geoip-report"><?php _e('GeoIP:', 'wp-statistics'); ?></label>
|
39 |
+
</td>
|
40 |
+
|
41 |
+
<td>
|
42 |
+
<input id="geoip-report" type="checkbox" value="1" name="wps_geoip_report" <?php echo WP_STATISTICS\Option::get('geoip_report') == true ? "checked='checked'" : ''; ?>>
|
43 |
+
<label for="geoip-report"><?php _e('Enable', 'wp-statistics'); ?></label>
|
44 |
+
<p class="description"><?php _e('Enable it to send a report whenever the GeoIP database is updated.', 'wp-statistics'); ?></p>
|
45 |
+
</td>
|
46 |
+
</tr>
|
47 |
+
|
48 |
+
<tr valign="top">
|
49 |
+
<td scope="row">
|
50 |
+
<label for="prune-report"><?php _e('Pruning:', 'wp-statistics'); ?></label>
|
51 |
+
</td>
|
52 |
+
|
53 |
+
<td>
|
54 |
+
<input id="prune-report" type="checkbox" value="1" name="wps_prune_report" <?php echo WP_STATISTICS\Option::get('prune_report') == true ? "checked='checked'" : ''; ?>>
|
55 |
+
<label for="prune-report"><?php _e('Enable', 'wp-statistics'); ?></label>
|
56 |
+
<p class="description"><?php _e('Enable it to send a report whenever the pruning of the database is run.', 'wp-statistics'); ?></p>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
</tbody>
|
60 |
</table>
|
61 |
</div>
|
62 |
<div class="postbox">
|
63 |
<table class="form-table">
|
64 |
<tbody>
|
65 |
+
<tr valign="top">
|
66 |
+
<th scope="row" colspan="2"><h3><?php _e('Statistical reporting', 'wp-statistics'); ?></h3></th>
|
67 |
+
</tr>
|
68 |
+
|
69 |
+
<tr valign="top">
|
70 |
+
<th scope="row">
|
71 |
+
<label for="stats-report"><?php _e('Statistical Reports:', 'wp-statistics'); ?></label>
|
72 |
+
</th>
|
73 |
+
|
74 |
+
<td>
|
75 |
+
<input id="stats-report" type="checkbox" value="1" name="wps_stats_report" <?php echo WP_STATISTICS\Option::get('stats_report') == true ? "checked='checked'" : ''; ?> onClick='ToggleStatOptions();'>
|
76 |
+
<label for="stats-report"><?php _e('Enable', 'wp-statistics'); ?></label>
|
77 |
+
<p class="description"><?php _e('Enable this option to receive stats report via email', 'wp-statistics'); ?></p>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
<?php if (WP_STATISTICS\Option::get('stats_report')) {
|
82 |
+
$hidden = "";
|
83 |
+
} else {
|
84 |
+
$hidden = " style='display: none;'";
|
85 |
+
} ?>
|
86 |
+
<tr valign="top"<?php echo $hidden; ?> id='wps_stats_report_option'>
|
87 |
+
<td scope="row" style="vertical-align: top;">
|
88 |
+
<label for="time-report"><?php _e('Schedule:', 'wp-statistics'); ?></label>
|
89 |
+
</td>
|
90 |
+
|
91 |
+
<td>
|
92 |
+
<select name="wps_time_report" id="time-report">
|
93 |
+
<option value="0" <?php selected(WP_STATISTICS\Option::get('time_report'), '0'); ?>><?php _e('Please select', 'wp-statistics'); ?></option>
|
94 |
+
<?php
|
95 |
+
function wp_statistics_schedule_sort($a, $b)
|
96 |
+
{
|
97 |
+
if ($a['interval'] == $b['interval']) {
|
98 |
+
return 0;
|
|
|
|
|
99 |
}
|
100 |
+
return ($a['interval'] < $b['interval']) ? -1 : 1;
|
101 |
+
}
|
102 |
|
103 |
+
//Get List Of Schedules Wordpress
|
104 |
+
$schedules = wp_get_schedules();
|
105 |
+
uasort($schedules, 'wp_statistics_schedule_sort');
|
106 |
+
$schedules_item = array();
|
107 |
|
108 |
+
foreach ($schedules as $key => $value) {
|
109 |
+
if (!in_array($value, $schedules_item)) {
|
110 |
+
echo '<option value="' . $key . '" ' . selected(WP_STATISTICS\Option::get('time_report'), $key) . '>' . $value['display'] . '</option>';
|
111 |
+
$schedules_item[] = $value;
|
|
|
112 |
}
|
113 |
+
}
|
114 |
+
?>
|
115 |
+
</select>
|
116 |
+
<p class="description"><?php _e('Select how often to receive statistical report.', 'wp-statistics'); ?></p>
|
117 |
+
<p class="description"><?php echo sprintf(__('To set your own schedule, check out <a href="%s" target="_blank">this doc</a>.', 'wp-statistics'), 'https://wp-statistics.com/resources/schedule-statistical-reports/'); ?></p>
|
118 |
+
</td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr valign="top"<?php echo $hidden; ?> id='wps_stats_report_option'>
|
122 |
+
<td scope="row" style="vertical-align: top;">
|
123 |
+
<label for="send-report"><?php _e('Send reports via:', 'wp-statistics'); ?></label>
|
124 |
+
</td>
|
125 |
+
|
126 |
+
<td>
|
127 |
+
<select name="wps_send_report" id="send-report">
|
128 |
+
<option value="0" <?php selected(WP_STATISTICS\Option::get('send_report'), '0'); ?>><?php _e('Please select', 'wp-statistics'); ?></option>
|
129 |
+
<option value="mail" <?php selected(WP_STATISTICS\Option::get('send_report'), 'mail'); ?>><?php _e('Email', 'wp-statistics'); ?></option>
|
130 |
+
<?php if (is_plugin_active('wp-sms/wp-sms.php') || is_plugin_active('wp-sms-pro/wp-sms.php')) { ?>
|
131 |
+
<option value="sms" <?php selected(WP_STATISTICS\Option::get('send_report'), 'sms'); ?>><?php _e('SMS', 'wp-statistics'); ?></option>
|
|
|
|
|
|
|
|
|
|
|
132 |
<?php } ?>
|
133 |
+
</select>
|
134 |
+
|
135 |
+
<p class="description"><?php _e('Select delivery method for statistical report.', 'wp-statistics'); ?></p>
|
136 |
+
<?php if (!is_plugin_active('wp-sms/wp-sms.php')) { ?>
|
137 |
+
<p class="description note"><?php echo sprintf(__('Note: To send SMS text messages please install the %s plugin.', 'wp-statistics'), '<a href="http://wordpress.org/extend/plugins/wp-sms/" target="_blank">' . __('WordPress SMS', 'wp-statistics') . '</a>'); ?></p>
|
138 |
+
<?php } ?>
|
139 |
+
</td>
|
140 |
+
</tr>
|
141 |
+
|
142 |
+
<tr valign="top"<?php echo $hidden; ?> id='wps_stats_report_option'>
|
143 |
+
<td scope="row" style="vertical-align: top;">
|
144 |
+
<label for="content-report"><?php _e('Message body:', 'wp-statistics'); ?></label>
|
145 |
+
</td>
|
146 |
+
|
147 |
+
<td>
|
148 |
+
<?php wp_editor(WP_STATISTICS\Option::get('content_report'), 'content-report', array('media_buttons' => false, 'textarea_name' => 'wps_content_report', 'textarea_rows' => 5,)); ?>
|
149 |
+
<p class="description"><?php _e('Enter the contents of the report.', 'wp-statistics'); ?></p>
|
150 |
+
|
151 |
+
<p class="description data">
|
152 |
+
<?php _e('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:', 'wp-statistics'); ?>
|
153 |
+
<br><br>
|
154 |
+
<?php _e('Online User', 'wp-statistics'); ?>:
|
155 |
+
<code>[wpstatistics stat=usersonline]</code><br>
|
156 |
+
<?php _e('Today\'s Visitors', 'wp-statistics'); ?>:
|
157 |
+
<code>[wpstatistics stat=visitors time=today]</code><br>
|
158 |
+
<?php _e('Today\'s Visits', 'wp-statistics'); ?>:
|
159 |
+
<code>[wpstatistics stat=visits time=today]</code><br>
|
160 |
+
<?php _e('Yesterday\'s Visitors', 'wp-statistics'); ?>:
|
161 |
+
<code>[wpstatistics stat=visitors time=yesterday]</code><br>
|
162 |
+
<?php _e('Yesterday\'s Visits', 'wp-statistics'); ?>:
|
163 |
+
<code>[wpstatistics stat=visits time=yesterday]</code><br>
|
164 |
+
<?php _e('Total Visitors', 'wp-statistics'); ?>:
|
165 |
+
<code>[wpstatistics stat=visitors time=total]</code><br>
|
166 |
+
<?php _e('Total Visits', 'wp-statistics'); ?>:
|
167 |
+
<code>[wpstatistics stat=visits time=total]</code><br>
|
168 |
+
</p>
|
169 |
+
|
170 |
+
<h4>Looking for chart reporting? check out <a target="_blank" href="https://wp-statistics.com/product/wp-statistics-advanced-reporting/">Advanced Reporting</a>. </h4>
|
171 |
+
</td>
|
172 |
+
</tr>
|
173 |
</tbody>
|
174 |
</table>
|
175 |
</div>
|
176 |
<div class="postbox">
|
177 |
<table class="form-table">
|
178 |
<tbody>
|
179 |
+
<tr valign="top">
|
180 |
+
<th scope="row" colspan="2"><h3><?php _e('Admin Notices', 'wp-statistics'); ?></h3></th>
|
181 |
+
</tr>
|
182 |
+
|
183 |
+
<tr valign="top">
|
184 |
+
<td scope="row">
|
185 |
+
<label for="admin-notices"><?php _e('All Notices:', 'wp-statistics'); ?></label>
|
186 |
+
</td>
|
187 |
+
|
188 |
+
<td>
|
189 |
+
<input id="admin-notices" type="checkbox" value="1" name="wps_admin_notices" <?php echo WP_STATISTICS\Option::get('admin_notices') == true ? "checked='checked'" : ''; ?>>
|
190 |
+
<label for="admin-notices"><?php _e('Enable', 'wp-statistics'); ?></label>
|
191 |
+
<p class="description"><?php _e('Enable this option to show all notices and suggestions from WP-Statistics in the admin.', 'wp-statistics'); ?></p>
|
192 |
+
</td>
|
193 |
+
</tr>
|
194 |
</tbody>
|
195 |
</table>
|
196 |
</div>
|
includes/admin/templates/settings/overview-display.php
CHANGED
@@ -1,54 +1,54 @@
|
|
1 |
<?php
|
2 |
// Only display the global options if the user is an administrator.
|
3 |
-
if (
|
4 |
-
|
5 |
<div class="postbox">
|
6 |
<table class="form-table">
|
7 |
<tbody>
|
8 |
|
9 |
<tr valign="top">
|
10 |
-
<td scope="row" colspan="2"><?php _e(
|
11 |
-
|
12 |
</tr>
|
13 |
|
14 |
<tr valign="top">
|
15 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
16 |
</tr>
|
17 |
|
18 |
<tr valign="top">
|
19 |
<th scope="row">
|
20 |
-
<label for="disable-map"><?php _e(
|
21 |
</th>
|
22 |
|
23 |
<td>
|
24 |
-
<input id="disable-dashboard" type="checkbox" value="1" name="wps_disable_dashboard" <?php echo WP_STATISTICS\Option::get(
|
25 |
-
<label for="disable-dashboard"><?php _e(
|
26 |
-
<p class="description"><?php _e(
|
27 |
-
|
28 |
</td>
|
29 |
</tr>
|
30 |
|
31 |
<tr valign="top">
|
32 |
-
<th scope="row" colspan="2"><h3><?php _e(
|
33 |
</tr>
|
34 |
|
35 |
<tr valign="top">
|
36 |
<th scope="row">
|
37 |
-
<label for="disable-map"><?php _e(
|
38 |
</th>
|
39 |
|
40 |
<td>
|
41 |
-
<input id="disable-map" type="checkbox" value="1" name="wps_disable_map" <?php echo WP_STATISTICS\Option::get(
|
42 |
-
<label for="disable-map"><?php _e(
|
43 |
-
<p class="description"><?php _e(
|
44 |
-
|
45 |
</td>
|
46 |
</tr>
|
47 |
|
48 |
</tbody>
|
49 |
</table>
|
50 |
</div>
|
51 |
-
|
52 |
}
|
53 |
|
54 |
submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='overview-display-settings'")); ?>
|
1 |
<?php
|
2 |
// Only display the global options if the user is an administrator.
|
3 |
+
if ($wps_admin) {
|
4 |
+
?>
|
5 |
<div class="postbox">
|
6 |
<table class="form-table">
|
7 |
<tbody>
|
8 |
|
9 |
<tr valign="top">
|
10 |
+
<td scope="row" colspan="2"><?php _e('The following items are global to all users.',
|
11 |
+
'wp-statistics'); ?></td>
|
12 |
</tr>
|
13 |
|
14 |
<tr valign="top">
|
15 |
+
<th scope="row" colspan="2"><h3><?php _e('Dashboard', 'wp-statistics'); ?></h3></th>
|
16 |
</tr>
|
17 |
|
18 |
<tr valign="top">
|
19 |
<th scope="row">
|
20 |
+
<label for="disable-map"><?php _e('Dashboard Widgets:', 'wp-statistics'); ?></label>
|
21 |
</th>
|
22 |
|
23 |
<td>
|
24 |
+
<input id="disable-dashboard" type="checkbox" value="1" name="wps_disable_dashboard" <?php echo WP_STATISTICS\Option::get('disable_dashboard') == true ? "checked='checked'" : ''; ?>>
|
25 |
+
<label for="disable-dashboard"><?php _e('Disable', 'wp-statistics'); ?></label>
|
26 |
+
<p class="description"><?php _e('This option will disable dashboard widgets.',
|
27 |
+
'wp-statistics'); ?></p>
|
28 |
</td>
|
29 |
</tr>
|
30 |
|
31 |
<tr valign="top">
|
32 |
+
<th scope="row" colspan="2"><h3><?php _e('Map', 'wp-statistics'); ?></h3></th>
|
33 |
</tr>
|
34 |
|
35 |
<tr valign="top">
|
36 |
<th scope="row">
|
37 |
+
<label for="disable-map"><?php _e('Map Display:', 'wp-statistics'); ?></label>
|
38 |
</th>
|
39 |
|
40 |
<td>
|
41 |
+
<input id="disable-map" type="checkbox" value="1" name="wps_disable_map" <?php echo WP_STATISTICS\Option::get('disable_map') == true ? "checked='checked'" : ''; ?>>
|
42 |
+
<label for="disable-map"><?php _e('Disable', 'wp-statistics'); ?></label>
|
43 |
+
<p class="description"><?php _e('This option will disable the map display.',
|
44 |
+
'wp-statistics'); ?></p>
|
45 |
</td>
|
46 |
</tr>
|
47 |
|
48 |
</tbody>
|
49 |
</table>
|
50 |
</div>
|
51 |
+
<?php
|
52 |
}
|
53 |
|
54 |
submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='overview-display-settings'")); ?>
|
includes/admin/templates/settings/reset.php
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
</tbody>
|
20 |
</table>
|
21 |
</div>
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
+
<tr valign="top">
|
5 |
+
<th scope="row" colspan="2"><h3><?php _e('WP Statistics Reset Options', 'wp-statistics'); ?></h3></th>
|
6 |
+
</tr>
|
7 |
|
8 |
+
<tr valign="top">
|
9 |
+
<th scope="row">
|
10 |
+
<label for="reset-plugin"><?php _e('Reset Options:', 'wp-statistics'); ?></label>
|
11 |
+
</th>
|
12 |
|
13 |
+
<td>
|
14 |
+
<input id="reset-plugin" type="checkbox" name="wps_reset_plugin">
|
15 |
+
<label for="reset-plugin"><?php _e('Reset', 'wp-statistics'); ?></label>
|
16 |
+
<p class="description"><?php _e('Reset all the options to default. Resetting the options will remove all user and global settings but will keep all other data. This action cannot be undone. Note: For multisite installs, this will reset all sites to the default settings.', 'wp-statistics'); ?></p>
|
17 |
+
</td>
|
18 |
+
</tr>
|
19 |
</tbody>
|
20 |
</table>
|
21 |
</div>
|
includes/admin/templates/settings/visitor-ip.php
CHANGED
@@ -5,147 +5,147 @@ $ip_method = \WP_STATISTICS\IP::getIPMethod();
|
|
5 |
// Add TickBox
|
6 |
add_thickbox();
|
7 |
?>
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
<tr>
|
17 |
-
<td width="330" style="
|
18 |
-
<b><?php
|
19 |
-
<td style="
|
20 |
</tr>
|
21 |
<?php
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
}
|
27 |
-
?>
|
28 |
-
<tr>
|
29 |
-
<td width="330" style="padding-top:10px;padding-bottom:10px;">
|
30 |
-
<b><?php echo $key; ?></b></td>
|
31 |
-
<td style="padding-top:10px;padding-bottom:10px;"> <?php echo ($value == "" ? "-" : substr(str_replace(array("\n", "\r"), '', trim($value)), 0, 200)) . (strlen($value) > 200 ? '..' : ''); ?></td>
|
32 |
-
</tr>
|
33 |
-
<?php
|
34 |
-
}
|
35 |
-
?>
|
36 |
-
</table>
|
37 |
-
</div>
|
38 |
<div class="postbox">
|
39 |
<table class="form-table">
|
40 |
<tbody>
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
}
|
59 |
-
},
|
60 |
-
success: function (json) {
|
61 |
-
jQuery("code#user_real_ip").html(json['ip']);
|
62 |
}
|
63 |
-
}
|
|
|
|
|
|
|
64 |
});
|
65 |
-
|
66 |
-
</
|
67 |
-
|
|
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
?>
|
78 |
-
<tr valign="top">
|
79 |
-
<th scope="row" colspan="2" style="padding-top: 8px;padding-bottom: 8px;">
|
80 |
-
<table>
|
81 |
-
<tr>
|
82 |
-
<td style="width: 10px; padding: 0px;">
|
83 |
-
<input type="radio" name="ip_method" style="vertical-align: -3px;" value="<?php echo $method; ?>"<?php if ($ip_method == $method) {
|
84 |
-
echo " checked=\"checked\"";
|
85 |
-
} ?>>
|
86 |
-
</td>
|
87 |
-
<td style="width: 250px;"> <?php printf(__('Use %1$s', 'wp-statistics'), $method); ?></td>
|
88 |
-
<td><code><?php
|
89 |
-
if (isset($_SERVER[$method]) and !empty($_SERVER[$method])) {
|
90 |
-
echo $_SERVER[$method];
|
91 |
-
} else {
|
92 |
-
_e('No available data.', 'wp-statistics');
|
93 |
-
} ?>
|
94 |
-
</code>
|
95 |
-
<?php
|
96 |
-
if (isset($_SERVER[$method]) and !empty($_SERVER[$method]) and \WP_STATISTICS\IP::check_sanitize_ip($_SERVER[$method]) === false) {
|
97 |
-
echo ' <a href="https://wp-statistics.com/sanitize-user-ip/" style="color: #d04f4f;" target="_blank" title="' . __('Your value required to sanitize user IP', 'wp-statistics') . '"><span class="dashicons dashicons-warning"></span></a>';
|
98 |
-
}
|
99 |
-
?>
|
100 |
-
</td>
|
101 |
-
</tr>
|
102 |
-
</table>
|
103 |
-
</th>
|
104 |
-
</tr>
|
105 |
-
<?php
|
106 |
-
}
|
107 |
?>
|
108 |
-
|
109 |
-
<!-- Custom Header -->
|
110 |
<tr valign="top">
|
111 |
-
<th scope="row" colspan="2" style="padding-top:
|
112 |
<table>
|
113 |
<tr>
|
114 |
<td style="width: 10px; padding: 0px;">
|
115 |
-
<input type="radio" name="ip_method" style="vertical-align: -3px;" value="
|
116 |
-
|
117 |
} ?>>
|
118 |
</td>
|
119 |
-
<td style="width: 250px;"> <?php
|
120 |
-
<td
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
}
|
133 |
-
}
|
134 |
-
echo '</code>';
|
135 |
-
if (!in_array($ip_method, \WP_STATISTICS\IP::$ip_methods_server) and isset($_SERVER[$ip_method]) and !empty($_SERVER[$ip_method]) and \WP_STATISTICS\IP::check_sanitize_ip($_SERVER[$ip_method]) === false) {
|
136 |
-
echo ' <a href="https://wp-statistics.com/sanitize-user-ip/" style="color: #d04f4f;" target="_blank" title="' . __('Your value required to sanitize user IP', 'wp-statistics') . '"><span class="dashicons dashicons-warning"></span></a>';
|
137 |
-
}
|
138 |
-
?></p>
|
139 |
-
<p class="description"><?php _e('Fill out this field if your server uses the custom key in <code>$_SERVER</code> for getting the IP.', 'wp-statistics'); ?></p>
|
140 |
-
<p class="description"><?php _e('e.g. <code>HTTP_CF_CONNECTING_IP</code> in CloudFlare.', 'wp-statistics'); ?></p>
|
141 |
-
<p class="description">
|
142 |
-
<a href="#TB_inline?&width=850&height=600&inlineId=list-of-php-server" class="thickbox"><?php _e('Show all <code>$_SERVER</code> in your server.', 'wp-statistics'); ?></a>
|
143 |
-
</p>
|
144 |
</td>
|
145 |
</tr>
|
146 |
</table>
|
147 |
</th>
|
148 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
</tbody>
|
151 |
</table>
|
5 |
// Add TickBox
|
6 |
add_thickbox();
|
7 |
?>
|
8 |
+
<!-- Show Help $_SERVER -->
|
9 |
+
<style>
|
10 |
+
#TB_window {
|
11 |
+
direction: ltr;
|
12 |
+
}
|
13 |
+
</style>
|
14 |
+
<div id="list-of-php-server" style="display:none;">
|
15 |
+
<table style="direction: ltr;">
|
16 |
+
<tr>
|
17 |
+
<td width="330" style="border-bottom: 1px solid #ccc;padding-top:10px;padding-bottom:10px;">
|
18 |
+
<b><?php _e('$_SERVER', 'wp-statistics'); ?></b></td>
|
19 |
+
<td style="border-bottom: 1px solid #ccc;padding-top:10px;padding-bottom:10px;"><b><?php _e('Value', 'wp-statistics'); ?></b></td>
|
20 |
+
</tr>
|
21 |
+
<?php
|
22 |
+
foreach ($_SERVER as $key => $value) {
|
23 |
+
// Check Value is Array
|
24 |
+
if (is_array($value)) {
|
25 |
+
$value = json_encode($value);
|
26 |
+
}
|
27 |
+
?>
|
28 |
<tr>
|
29 |
+
<td width="330" style="padding-top:10px;padding-bottom:10px;">
|
30 |
+
<b><?php echo $key; ?></b></td>
|
31 |
+
<td style="padding-top:10px;padding-bottom:10px;"> <?php echo ($value == "" ? "-" : substr(str_replace(array("\n", "\r"), '', trim($value)), 0, 200)) . (strlen($value) > 200 ? '..' : ''); ?></td>
|
32 |
</tr>
|
33 |
<?php
|
34 |
+
}
|
35 |
+
?>
|
36 |
+
</table>
|
37 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
<div class="postbox">
|
39 |
<table class="form-table">
|
40 |
<tbody>
|
41 |
+
<tr valign="top">
|
42 |
+
<th scope="row" colspan="2" style="padding-bottom: 10px; font-weight: normal;line-height: 25px;">
|
43 |
+
<?php _e('Your real IP detected by ipify.org service:', 'wp-statistics'); ?>
|
44 |
+
</th>
|
45 |
+
</tr>
|
46 |
|
47 |
+
<tr valign="top">
|
48 |
+
<th scope="row" colspan="2">
|
49 |
+
<code id="user_real_ip" style="padding: 15px;font-size: 30px;font-weight: 200; letter-spacing: 2px;font-family: 'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;">
|
50 |
+
<script type="application/javascript">
|
51 |
+
jQuery(document).ready(function () {
|
52 |
+
jQuery.ajax({
|
53 |
+
url: "https://api.ipify.org?format=json",
|
54 |
+
dataType: 'json',
|
55 |
+
error: function (jqXHR) {
|
56 |
+
if (jqXHR.status == 0) {
|
57 |
+
jQuery("code#user_real_ip").html("<?php _e('Please check your internet connection and try again.', 'wp-statistics'); ?>");
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
+
},
|
60 |
+
success: function (json) {
|
61 |
+
jQuery("code#user_real_ip").html(json['ip']);
|
62 |
+
}
|
63 |
});
|
64 |
+
});
|
65 |
+
</script>
|
66 |
+
</code></th>
|
67 |
+
</tr>
|
68 |
|
69 |
+
<tr>
|
70 |
+
<td colspan="3">
|
71 |
+
<p><?php _e('The items below return the IP address that is different on each server. Is the best way that you choose.', 'wp-statistics'); ?></p>
|
72 |
+
</td>
|
73 |
+
</tr>
|
74 |
|
75 |
+
<?php
|
76 |
+
foreach (\WP_STATISTICS\IP::$ip_methods_server as $method) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
?>
|
|
|
|
|
78 |
<tr valign="top">
|
79 |
+
<th scope="row" colspan="2" style="padding-top: 8px;padding-bottom: 8px;">
|
80 |
<table>
|
81 |
<tr>
|
82 |
<td style="width: 10px; padding: 0px;">
|
83 |
+
<input type="radio" name="ip_method" style="vertical-align: -3px;" value="<?php echo $method; ?>"<?php if ($ip_method == $method) {
|
84 |
+
echo " checked=\"checked\"";
|
85 |
} ?>>
|
86 |
</td>
|
87 |
+
<td style="width: 250px;"> <?php printf(__('Use %1$s', 'wp-statistics'), $method); ?></td>
|
88 |
+
<td><code><?php
|
89 |
+
if (isset($_SERVER[$method]) and !empty($_SERVER[$method])) {
|
90 |
+
echo $_SERVER[$method];
|
91 |
+
} else {
|
92 |
+
_e('No available data.', 'wp-statistics');
|
93 |
+
} ?>
|
94 |
+
</code>
|
95 |
+
<?php
|
96 |
+
if (isset($_SERVER[$method]) and !empty($_SERVER[$method]) and \WP_STATISTICS\IP::check_sanitize_ip($_SERVER[$method]) === false) {
|
97 |
+
echo ' <a href="https://wp-statistics.com/sanitize-user-ip/" style="color: #d04f4f;" target="_blank" title="' . __('Your value required to sanitize user IP', 'wp-statistics') . '"><span class="dashicons dashicons-warning"></span></a>';
|
98 |
+
}
|
99 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
</td>
|
101 |
</tr>
|
102 |
</table>
|
103 |
</th>
|
104 |
</tr>
|
105 |
+
<?php
|
106 |
+
}
|
107 |
+
?>
|
108 |
+
|
109 |
+
<!-- Custom Header -->
|
110 |
+
<tr valign="top">
|
111 |
+
<th scope="row" colspan="2" style="padding-top: 0px;padding-bottom: 0px;">
|
112 |
+
<table>
|
113 |
+
<tr>
|
114 |
+
<td style="width: 10px; padding: 0px;">
|
115 |
+
<input type="radio" name="ip_method" style="vertical-align: -3px;" value="CUSTOM_HEADER" <?php if (!in_array($ip_method, \WP_STATISTICS\IP::$ip_methods_server)) {
|
116 |
+
echo " checked=\"checked\"";
|
117 |
+
} ?>>
|
118 |
+
</td>
|
119 |
+
<td style="width: 250px;"> <?php echo __('Use Custom Header', 'wp-statistics'); ?></td>
|
120 |
+
<td style="padding-left: 0px;">
|
121 |
+
<input type="text" name="user_custom_header_ip_method" autocomplete="off" style="padding: 5px; width: 250px;height: 35px;" value="<?php if (!in_array($ip_method, \WP_STATISTICS\IP::$ip_methods_server)) {
|
122 |
+
echo esc_attr($ip_method);
|
123 |
+
} ?>">
|
124 |
+
|
125 |
+
<p class="description">
|
126 |
+
<?php if (!in_array($ip_method, \WP_STATISTICS\IP::$ip_methods_server)) {
|
127 |
+
echo '<code>';
|
128 |
+
if (isset($_SERVER[$ip_method]) and !empty($_SERVER[$ip_method])) {
|
129 |
+
echo $_SERVER[$ip_method];
|
130 |
+
} else {
|
131 |
+
_e('No available data.', 'wp-statistics');
|
132 |
+
}
|
133 |
+
}
|
134 |
+
echo '</code>';
|
135 |
+
if (!in_array($ip_method, \WP_STATISTICS\IP::$ip_methods_server) and isset($_SERVER[$ip_method]) and !empty($_SERVER[$ip_method]) and \WP_STATISTICS\IP::check_sanitize_ip($_SERVER[$ip_method]) === false) {
|
136 |
+
echo ' <a href="https://wp-statistics.com/sanitize-user-ip/" style="color: #d04f4f;" target="_blank" title="' . __('Your value required to sanitize user IP', 'wp-statistics') . '"><span class="dashicons dashicons-warning"></span></a>';
|
137 |
+
}
|
138 |
+
?></p>
|
139 |
+
<p class="description"><?php _e('Fill out this field if your server uses the custom key in <code>$_SERVER</code> for getting the IP.', 'wp-statistics'); ?></p>
|
140 |
+
<p class="description"><?php _e('e.g. <code>HTTP_CF_CONNECTING_IP</code> in CloudFlare.', 'wp-statistics'); ?></p>
|
141 |
+
<p class="description">
|
142 |
+
<a href="#TB_inline?&width=850&height=600&inlineId=list-of-php-server" class="thickbox"><?php _e('Show all <code>$_SERVER</code> in your server.', 'wp-statistics'); ?></a>
|
143 |
+
</p>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
</table>
|
147 |
+
</th>
|
148 |
+
</tr>
|
149 |
|
150 |
</tbody>
|
151 |
</table>
|
includes/admin/templates/settings/wp-cli.php
CHANGED
@@ -1,64 +1,64 @@
|
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
</tbody>
|
18 |
</table>
|
19 |
</div>
|
20 |
<div class="postbox">
|
21 |
<table class="form-table">
|
22 |
<tbody>
|
23 |
-
|
24 |
-
|
25 |
-
|
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 |
-
</table>
|
62 |
</div>
|
63 |
|
64 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='wp-cli-settings'")); ?>
|
1 |
<div class="postbox">
|
2 |
<table class="form-table">
|
3 |
<tbody>
|
4 |
+
<tr valign="top">
|
5 |
+
<th scope="row" colspan="2"><h3><?php _e('WP-CLI', 'wp-statistics'); ?></h3></th>
|
6 |
+
</tr>
|
7 |
|
8 |
+
<tr valign="top">
|
9 |
+
<th scope="row"><label for="wps-wp_cli"><?php _e('Enable WP-CLI:', 'wp-statistics'); ?></label>
|
10 |
+
</th>
|
11 |
+
<td>
|
12 |
+
<input id="wps-wp_cli" type="checkbox" value="1" name="wps_wp_cli" <?php echo WP_STATISTICS\Option::get('wp_cli') == true ? "checked='checked'" : ''; ?>>
|
13 |
+
<label for="wps-wp_cli"><?php _e('Enable', 'wp-statistics'); ?></label>
|
14 |
+
<p class="description"><?php echo __('This feature enables you to get WP-Statistics reporting in the WP-CLI.', 'wp-statistics'); ?></p>
|
15 |
+
</td>
|
16 |
+
</tr>
|
17 |
</tbody>
|
18 |
</table>
|
19 |
</div>
|
20 |
<div class="postbox">
|
21 |
<table class="form-table">
|
22 |
<tbody>
|
23 |
+
<tr valign="top">
|
24 |
+
<th scope="row" colspan="2"><h3><?php _e('Commands', 'wp-statistics'); ?></h3></th>
|
25 |
+
</tr>
|
26 |
|
27 |
+
<tr valign="top">
|
28 |
+
<th scope="row"><label for="wps-wp_cli_summary"><?php _e('Summary:', 'wp-statistics'); ?></label></th>
|
29 |
+
<td>
|
30 |
+
<input id="wps-wp_cli_summary" type="checkbox" value="1" name="wps_wp_cli_summary" <?php echo WP_STATISTICS\Option::get('wp_cli_summary') == true ? "checked='checked'" : ''; ?>>
|
31 |
+
<label for="wps-wp_cli_summary"><?php _e('Enable', 'wp-statistics'); ?></label>
|
32 |
+
<p class="description">
|
33 |
+
<?php echo __('Show a summary of statistics.', 'wp-statistics'); ?><br/>
|
34 |
+
<?php echo __('Usage: ', 'wp-statistics'); ?> <span dir="ltr"> wp statistics summary </span></p>
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
|
38 |
+
<tr valign="top">
|
39 |
+
<th scope="row"><label for="wps-wp_cli_user_online"><?php _e('User Online:', 'wp-statistics'); ?></label>
|
40 |
+
</th>
|
41 |
+
<td>
|
42 |
+
<input id="wps-wp_cli_user_online" type="checkbox" value="1" name="wps_wp_cli_user_online" <?php echo WP_STATISTICS\Option::get('wp_cli_user_online') == true ? "checked='checked'" : ''; ?>>
|
43 |
+
<label for="wps-wp_cli_user_online"><?php _e('Enable', 'wp-statistics'); ?></label>
|
44 |
+
<p class="description"><?php echo __('Show Users Online List.', 'wp-statistics'); ?><br/>
|
45 |
+
<?php echo __('Usage: ', 'wp-statistics'); ?> <span dir="ltr"> wp statistics online --number=[integer] </span></p>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
|
49 |
+
<tr valign="top">
|
50 |
+
<th scope="row"><label for="wps-wp_cli_visitors"><?php _e('Visitors:', 'wp-statistics'); ?></label>
|
51 |
+
</th>
|
52 |
+
<td>
|
53 |
+
<input id="wps-wp_cli_visitors" type="checkbox" value="1" name="wps_wp_cli_visitors" <?php echo WP_STATISTICS\Option::get('wp_cli_visitors') == true ? "checked='checked'" : ''; ?>>
|
54 |
+
<label for="wps-wp_cli_visitors"><?php _e('Enable', 'wp-statistics'); ?></label>
|
55 |
+
<p class="description"><?php echo __('Show list of Visitors.', 'wp-statistics'); ?><br/>
|
56 |
+
<?php echo __('Usage: ', 'wp-statistics'); ?> <span dir="ltr"> wp statistics visitors --number=[integer] </span></p>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
|
60 |
+
</tbody>
|
61 |
+
</table>
|
62 |
</div>
|
63 |
|
64 |
<?php submit_button(__('Update', 'wp-statistics'), 'primary', 'submit', '', array('OnClick' => "var wpsCurrentTab = getElementById('wps_current_tab'); wpsCurrentTab.value='wp-cli-settings'")); ?>
|
includes/api/v2/class-wp-statistics-api-hit.php
CHANGED
@@ -66,9 +66,9 @@ class Hit extends \WP_STATISTICS\RestAPI
|
|
66 |
// Record WP-Statistics when Cache is enable
|
67 |
register_rest_route(self::$namespace, '/' . self::$endpoint, array(
|
68 |
array(
|
69 |
-
'methods'
|
70 |
-
'callback'
|
71 |
-
'args'
|
72 |
'permission_callback' => function (\WP_REST_Request $request) {
|
73 |
return true;
|
74 |
}
|
@@ -78,8 +78,8 @@ class Hit extends \WP_STATISTICS\RestAPI
|
|
78 |
// Check WP-Statistics Rest API Not disabled
|
79 |
register_rest_route(self::$namespace, '/check', array(
|
80 |
array(
|
81 |
-
'methods'
|
82 |
-
'callback'
|
83 |
'permission_callback' => function () {
|
84 |
return true;
|
85 |
}
|
66 |
// Record WP-Statistics when Cache is enable
|
67 |
register_rest_route(self::$namespace, '/' . self::$endpoint, array(
|
68 |
array(
|
69 |
+
'methods' => \WP_REST_Server::READABLE,
|
70 |
+
'callback' => array($this, 'hit_callback'),
|
71 |
+
'args' => $params,
|
72 |
'permission_callback' => function (\WP_REST_Request $request) {
|
73 |
return true;
|
74 |
}
|
78 |
// Check WP-Statistics Rest API Not disabled
|
79 |
register_rest_route(self::$namespace, '/check', array(
|
80 |
array(
|
81 |
+
'methods' => \WP_REST_Server::READABLE,
|
82 |
+
'callback' => array($this, 'check_enable_callback'),
|
83 |
'permission_callback' => function () {
|
84 |
return true;
|
85 |
}
|
includes/api/v2/class-wp-statistics-api-meta-box.php
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
namespace WP_STATISTICS\Api\v2;
|
4 |
|
5 |
-
use WP_STATISTICS\User;
|
6 |
-
|
7 |
class Meta_Box extends \WP_STATISTICS\RestAPI
|
8 |
{
|
9 |
/**
|
@@ -31,9 +29,9 @@ class Meta_Box extends \WP_STATISTICS\RestAPI
|
|
31 |
// Get Admin Meta Box
|
32 |
register_rest_route(self::$namespace, '/metabox', array(
|
33 |
array(
|
34 |
-
'methods'
|
35 |
-
'callback'
|
36 |
-
'args'
|
37 |
'name' => array(
|
38 |
'required' => true
|
39 |
)
|
@@ -58,7 +56,7 @@ class Meta_Box extends \WP_STATISTICS\RestAPI
|
|
58 |
$user = wp_get_current_user();
|
59 |
if ($user->ID == 0) {
|
60 |
return new \WP_REST_Response(array('code' => 'user_auth', 'message' => __('You do not have enough access privileges for checking out information. Please check the accessibility of the information display in the settings section of WP-Statistics.', 'wp-statistics')), 400);
|
61 |
-
|
62 |
|
63 |
// Check Exist MetaBox Name
|
64 |
if (in_array($request->get_param('name'), array_keys(\WP_STATISTICS\Meta_Box::getList())) and \WP_STATISTICS\Meta_Box::IsExistMetaBoxClass($request->get_param('name'))) {
|
2 |
|
3 |
namespace WP_STATISTICS\Api\v2;
|
4 |
|
|
|
|
|
5 |
class Meta_Box extends \WP_STATISTICS\RestAPI
|
6 |
{
|
7 |
/**
|
29 |
// Get Admin Meta Box
|
30 |
register_rest_route(self::$namespace, '/metabox', array(
|
31 |
array(
|
32 |
+
'methods' => \WP_REST_Server::READABLE,
|
33 |
+
'callback' => array($this, 'meta_box_callback'),
|
34 |
+
'args' => array(
|
35 |
'name' => array(
|
36 |
'required' => true
|
37 |
)
|
56 |
$user = wp_get_current_user();
|
57 |
if ($user->ID == 0) {
|
58 |
return new \WP_REST_Response(array('code' => 'user_auth', 'message' => __('You do not have enough access privileges for checking out information. Please check the accessibility of the information display in the settings section of WP-Statistics.', 'wp-statistics')), 400);
|
59 |
+
}
|
60 |
|
61 |
// Check Exist MetaBox Name
|
62 |
if (in_array($request->get_param('name'), array_keys(\WP_STATISTICS\Meta_Box::getList())) and \WP_STATISTICS\Meta_Box::IsExistMetaBoxClass($request->get_param('name'))) {
|
includes/class-wp-statistics-db.php
CHANGED
@@ -199,4 +199,35 @@ class DB
|
|
199 |
global $wpdb;
|
200 |
$wpdb->query("REPAIR TABLE `{$table_name}`");
|
201 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
199 |
global $wpdb;
|
200 |
$wpdb->query("REPAIR TABLE `{$table_name}`");
|
201 |
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* @return array|object|void|null
|
205 |
+
*/
|
206 |
+
public static function getColumnType($tableName, $column)
|
207 |
+
{
|
208 |
+
global $wpdb;
|
209 |
+
|
210 |
+
$queryResult = $wpdb->get_results("DESCRIBE " . self::table($tableName));
|
211 |
+
|
212 |
+
foreach ($queryResult as $item) {
|
213 |
+
if ($item->Field == $column) {
|
214 |
+
return $item;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* @param $tableName
|
221 |
+
* @param $column
|
222 |
+
* @param $type
|
223 |
+
* @return bool
|
224 |
+
*/
|
225 |
+
public static function isColumnType($tableName, $column, $type)
|
226 |
+
{
|
227 |
+
$column = self::getColumnType($tableName, $column);
|
228 |
+
|
229 |
+
if (isset($column->Type) and strtolower($column->Type) == $type) {
|
230 |
+
return true;
|
231 |
+
}
|
232 |
+
}
|
233 |
}
|
includes/class-wp-statistics-exclusion.php
CHANGED
@@ -90,9 +90,9 @@ class Exclusion
|
|
90 |
$insert = $wpdb->insert(
|
91 |
DB::table('exclusions'),
|
92 |
array(
|
93 |
-
'date'
|
94 |
'reason' => $exclusion['exclusion_reason'],
|
95 |
-
'count'
|
96 |
)
|
97 |
);
|
98 |
if (!$insert) {
|
90 |
$insert = $wpdb->insert(
|
91 |
DB::table('exclusions'),
|
92 |
array(
|
93 |
+
'date' => TimeZone::getCurrentDate('Y-m-d'),
|
94 |
'reason' => $exclusion['exclusion_reason'],
|
95 |
+
'count' => 1,
|
96 |
)
|
97 |
);
|
98 |
if (!$insert) {
|
includes/class-wp-statistics-frontend.php
CHANGED
@@ -103,8 +103,8 @@ class Frontend
|
|
103 |
$params['ip'] = esc_html(IP::getIP());
|
104 |
|
105 |
//exclude
|
106 |
-
$exclude
|
107 |
-
$params['exclusion_match']
|
108 |
$params['exclusion_reason'] = (string)$exclude['exclusion_reason'];
|
109 |
|
110 |
//User Agent String
|
103 |
$params['ip'] = esc_html(IP::getIP());
|
104 |
|
105 |
//exclude
|
106 |
+
$exclude = Exclusion::check();
|
107 |
+
$params['exclusion_match'] = ($exclude['exclusion_match'] === true ? 'yes' : 'no');
|
108 |
$params['exclusion_reason'] = (string)$exclude['exclusion_reason'];
|
109 |
|
110 |
//User Agent String
|
includes/class-wp-statistics-geoip.php
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
namespace WP_STATISTICS;
|
4 |
|
5 |
use GeoIp2\Exception\AddressNotFoundException;
|
6 |
-
use MaxMind\Db\Reader\InvalidDatabaseException;
|
7 |
|
8 |
class GeoIP
|
9 |
{
|
@@ -266,8 +265,8 @@ class GeoIP
|
|
266 |
|
267 |
// This is the location of the file to download.
|
268 |
$download_url = GeoIP::$library[$pack]['source'];
|
269 |
-
$response
|
270 |
-
'timeout'
|
271 |
'sslverify' => false
|
272 |
));
|
273 |
|
@@ -505,9 +504,9 @@ class GeoIP
|
|
505 |
if ($return == "all") {
|
506 |
$location = $record->city;
|
507 |
} elseif ($return == "name") {
|
508 |
-
$subdiv
|
509 |
-
$city
|
510 |
-
$location = ($city
|
511 |
} else {
|
512 |
$location = $record->city->{$return};
|
513 |
}
|
3 |
namespace WP_STATISTICS;
|
4 |
|
5 |
use GeoIp2\Exception\AddressNotFoundException;
|
|
|
6 |
|
7 |
class GeoIP
|
8 |
{
|
265 |
|
266 |
// This is the location of the file to download.
|
267 |
$download_url = GeoIP::$library[$pack]['source'];
|
268 |
+
$response = wp_remote_get($download_url, array(
|
269 |
+
'timeout' => 60,
|
270 |
'sslverify' => false
|
271 |
));
|
272 |
|
504 |
if ($return == "all") {
|
505 |
$location = $record->city;
|
506 |
} elseif ($return == "name") {
|
507 |
+
$subdiv = $record->mostSpecificSubdivision->name;
|
508 |
+
$city = $record->city->name;
|
509 |
+
$location = ($city ? $city : "(Unknown)") . ($subdiv ? (", ") : "") . $subdiv;
|
510 |
} else {
|
511 |
$location = $record->city->{$return};
|
512 |
}
|
includes/class-wp-statistics-hits.php
CHANGED
@@ -124,7 +124,7 @@ class Hits
|
|
124 |
|
125 |
if (isset($this->rest_hits->exclusion_match) and isset($this->rest_hits->exclusion_reason)) {
|
126 |
return array(
|
127 |
-
'exclusion_match'
|
128 |
'exclusion_reason' => $this->rest_hits->exclusion_reason,
|
129 |
);
|
130 |
}
|
124 |
|
125 |
if (isset($this->rest_hits->exclusion_match) and isset($this->rest_hits->exclusion_reason)) {
|
126 |
return array(
|
127 |
+
'exclusion_match' => $this->rest_hits->exclusion_match == 'yes',
|
128 |
'exclusion_reason' => $this->rest_hits->exclusion_reason,
|
129 |
);
|
130 |
}
|
includes/class-wp-statistics-install.php
CHANGED
@@ -313,9 +313,9 @@ class Install
|
|
313 |
if ($file == plugin_basename(WP_STATISTICS_MAIN_FILE)) {
|
314 |
$plugin_url = 'http://wordpress.org/plugins/wp-statistics/';
|
315 |
|
316 |
-
$links[]
|
317 |
$rate_url = 'https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post';
|
318 |
-
$links[]
|
319 |
}
|
320 |
|
321 |
return $links;
|
@@ -339,10 +339,21 @@ class Install
|
|
339 |
*
|
340 |
* @version 13.0.0
|
341 |
*/
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
|
347 |
/**
|
348 |
* Create Visitor and pages Relationship Table
|
@@ -379,7 +390,7 @@ class Install
|
|
379 |
*
|
380 |
* @version 12.6.1
|
381 |
*/
|
382 |
-
if(DB::ExistTable('useronline')) {
|
383 |
$result = $wpdb->query("SHOW COLUMNS FROM " . DB::table('useronline') . " LIKE 'user_id'");
|
384 |
if ($result == 0) {
|
385 |
$wpdb->query("ALTER TABLE `" . DB::table('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`;");
|
@@ -391,7 +402,7 @@ class Install
|
|
391 |
*
|
392 |
* @version 12.5.3
|
393 |
*/
|
394 |
-
if(DB::ExistTable('pages')) {
|
395 |
$result = $wpdb->query("SHOW COLUMNS FROM " . DB::table('pages') . " LIKE 'page_id'");
|
396 |
if ($result == 0) {
|
397 |
$wpdb->query("ALTER TABLE `" . DB::table('pages') . "` ADD `page_id` BIGINT(20) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`page_id`);");
|
@@ -404,7 +415,7 @@ class Install
|
|
404 |
*
|
405 |
* @version 6.0
|
406 |
*/
|
407 |
-
if(DB::ExistTable('visitor')) {
|
408 |
$result = $wpdb->query("SHOW INDEX FROM " . DB::table('visitor') . " WHERE Key_name = 'date_ip'");
|
409 |
if ($result > 1) {
|
410 |
$wpdb->query("DROP INDEX `date_ip` ON " . DB::table('visitor'));
|
@@ -569,7 +580,7 @@ class Install
|
|
569 |
|
570 |
# Check Number Process
|
571 |
$number_process = self::get_require_number_update();
|
572 |
-
$i
|
573 |
if ($number_process > 0) {
|
574 |
|
575 |
# Start Query
|
@@ -604,7 +615,7 @@ class Install
|
|
604 |
} else {
|
605 |
|
606 |
$return['number_process'] = $_GET['number_all'];
|
607 |
-
$return['percentage']
|
608 |
update_option('wp_statistics_update_page_type', 'yes');
|
609 |
}
|
610 |
}
|
313 |
if ($file == plugin_basename(WP_STATISTICS_MAIN_FILE)) {
|
314 |
$plugin_url = 'http://wordpress.org/plugins/wp-statistics/';
|
315 |
|
316 |
+
$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>';
|
317 |
$rate_url = 'https://wordpress.org/support/plugin/wp-statistics/reviews/?rate=5#new-post';
|
318 |
+
$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>';
|
319 |
}
|
320 |
|
321 |
return $links;
|
339 |
*
|
340 |
* @version 13.0.0
|
341 |
*/
|
342 |
+
if (!DB::isColumnType('visitor', 'ID', 'bigint(20)')) {
|
343 |
+
$wpdb->query("ALTER TABLE `" . DB::table('visitor') . "` CHANGE `ID` `ID` BIGINT(20) NOT NULL AUTO_INCREMENT;");
|
344 |
+
}
|
345 |
+
|
346 |
+
if (!DB::isColumnType('exclusions', 'ID', 'bigint(20)')) {
|
347 |
+
$wpdb->query("ALTER TABLE `" . DB::table('exclusions') . "` CHANGE `ID` `ID` BIGINT(20) NOT NULL AUTO_INCREMENT;");
|
348 |
+
}
|
349 |
+
|
350 |
+
if (!DB::isColumnType('useronline', 'ID', 'bigint(20)')) {
|
351 |
+
$wpdb->query("ALTER TABLE `" . DB::table('useronline') . "` CHANGE `ID` `ID` BIGINT(20) NOT NULL AUTO_INCREMENT;");
|
352 |
+
}
|
353 |
+
|
354 |
+
if (!DB::isColumnType('visit', 'ID', 'bigint(20)')) {
|
355 |
+
$wpdb->query("ALTER TABLE `" . DB::table('visit') . "` CHANGE `ID` `ID` BIGINT(20) NOT NULL AUTO_INCREMENT;");
|
356 |
+
}
|
357 |
|
358 |
/**
|
359 |
* Create Visitor and pages Relationship Table
|
390 |
*
|
391 |
* @version 12.6.1
|
392 |
*/
|
393 |
+
if (DB::ExistTable('useronline')) {
|
394 |
$result = $wpdb->query("SHOW COLUMNS FROM " . DB::table('useronline') . " LIKE 'user_id'");
|
395 |
if ($result == 0) {
|
396 |
$wpdb->query("ALTER TABLE `" . DB::table('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`;");
|
402 |
*
|
403 |
* @version 12.5.3
|
404 |
*/
|
405 |
+
if (DB::ExistTable('pages')) {
|
406 |
$result = $wpdb->query("SHOW COLUMNS FROM " . DB::table('pages') . " LIKE 'page_id'");
|
407 |
if ($result == 0) {
|
408 |
$wpdb->query("ALTER TABLE `" . DB::table('pages') . "` ADD `page_id` BIGINT(20) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`page_id`);");
|
415 |
*
|
416 |
* @version 6.0
|
417 |
*/
|
418 |
+
if (DB::ExistTable('visitor')) {
|
419 |
$result = $wpdb->query("SHOW INDEX FROM " . DB::table('visitor') . " WHERE Key_name = 'date_ip'");
|
420 |
if ($result > 1) {
|
421 |
$wpdb->query("DROP INDEX `date_ip` ON " . DB::table('visitor'));
|
580 |
|
581 |
# Check Number Process
|
582 |
$number_process = self::get_require_number_update();
|
583 |
+
$i = 0;
|
584 |
if ($number_process > 0) {
|
585 |
|
586 |
# Start Query
|
615 |
} else {
|
616 |
|
617 |
$return['number_process'] = $_GET['number_all'];
|
618 |
+
$return['percentage'] = 100;
|
619 |
update_option('wp_statistics_update_page_type', 'yes');
|
620 |
}
|
621 |
}
|
includes/class-wp-statistics-pages.php
CHANGED
@@ -124,11 +124,11 @@ class Pages
|
|
124 |
{
|
125 |
|
126 |
// Get the site's path from the URL.
|
127 |
-
$site_uri
|
128 |
$site_uri_len = strlen($site_uri);
|
129 |
|
130 |
// Get the site's path from the URL.
|
131 |
-
$home_uri
|
132 |
$home_uri_len = strlen($home_uri);
|
133 |
|
134 |
// Get the current page URI.
|
@@ -234,11 +234,11 @@ class Pages
|
|
234 |
|
235 |
// Prepare Pages Data
|
236 |
$pages = array(
|
237 |
-
'uri'
|
238 |
-
'date'
|
239 |
'count' => 1,
|
240 |
-
'id'
|
241 |
-
'type'
|
242 |
);
|
243 |
$pages = apply_filters('wp_statistics_pages_information', $pages);
|
244 |
|
@@ -296,13 +296,13 @@ class Pages
|
|
296 |
{
|
297 |
|
298 |
//Create Empty Object
|
299 |
-
$arg
|
300 |
$defaults = array(
|
301 |
-
'link'
|
302 |
'edit_link' => '',
|
303 |
'object_id' => $page_id,
|
304 |
-
'title'
|
305 |
-
'meta'
|
306 |
);
|
307 |
|
308 |
if (!empty($type)) {
|
@@ -312,10 +312,10 @@ class Pages
|
|
312 |
case "post":
|
313 |
case "page":
|
314 |
$arg = array(
|
315 |
-
'title'
|
316 |
-
'link'
|
317 |
'edit_link' => get_edit_post_link($page_id),
|
318 |
-
'meta'
|
319 |
'post_type' => get_post_type($page_id)
|
320 |
)
|
321 |
);
|
@@ -326,13 +326,13 @@ class Pages
|
|
326 |
$term = get_term($page_id);
|
327 |
if (!is_wp_error($term) and $term !== null) {
|
328 |
$arg = array(
|
329 |
-
'title'
|
330 |
-
'link'
|
331 |
'edit_link' => get_edit_term_link($page_id),
|
332 |
-
'meta'
|
333 |
-
'taxonomy'
|
334 |
'term_taxonomy_id' => $term->term_taxonomy_id,
|
335 |
-
'count'
|
336 |
)
|
337 |
);
|
338 |
}
|
@@ -340,14 +340,14 @@ class Pages
|
|
340 |
case "home":
|
341 |
$arg = array(
|
342 |
'title' => __('Home Page', 'wp-statistics'),
|
343 |
-
'link'
|
344 |
);
|
345 |
break;
|
346 |
case "author":
|
347 |
$user_info = get_userdata($page_id);
|
348 |
-
$arg
|
349 |
-
'title'
|
350 |
-
'link'
|
351 |
'edit_link' => get_edit_user_link($page_id),
|
352 |
);
|
353 |
break;
|
@@ -385,9 +385,9 @@ class Pages
|
|
385 |
// Define the array of defaults
|
386 |
$defaults = array(
|
387 |
'per_page' => 10,
|
388 |
-
'paged'
|
389 |
-
'from'
|
390 |
-
'to'
|
391 |
);
|
392 |
|
393 |
$args = wp_parse_args($args, $defaults);
|
@@ -402,7 +402,7 @@ class Pages
|
|
402 |
$sql = "SELECT `pages`.`date`,`pages`.`uri`,`pages`.`id`,`pages`.`type`, SUM(`pages`.`count`) + IFNULL(`historical`.`value`, 0) AS `count_sum` FROM `" . DB::table('pages') . "` `pages` LEFT JOIN `" . DB::table('historical') . "` `historical` ON `pages`.`uri`=`historical`.`uri` AND `historical`.`category`='uri' {$DateTimeSql} GROUP BY `uri` ORDER BY `count_sum` DESC";
|
403 |
|
404 |
// Get List Of Pages
|
405 |
-
$list
|
406 |
$result = $wpdb->get_results($sql . " LIMIT " . ($args['paged'] - 1) * $args['per_page'] . "," . $args['per_page']);
|
407 |
foreach ($result as $item) {
|
408 |
|
@@ -411,11 +411,11 @@ class Pages
|
|
411 |
|
412 |
// Push to list
|
413 |
$list[] = array(
|
414 |
-
'title'
|
415 |
-
'link'
|
416 |
-
'str_url'
|
417 |
'hits_page' => Menus::admin_url('pages', array('ID' => $item->id, 'type' => $item->type)),
|
418 |
-
'number'
|
419 |
);
|
420 |
}
|
421 |
|
@@ -464,7 +464,7 @@ class Pages
|
|
464 |
public static function uri_to_id($uri)
|
465 |
{
|
466 |
global $wpdb;
|
467 |
-
$sql
|
468 |
$result = $wpdb->get_var($sql);
|
469 |
if ($result == 0) {
|
470 |
$result = 0;
|
124 |
{
|
125 |
|
126 |
// Get the site's path from the URL.
|
127 |
+
$site_uri = parse_url(site_url(), PHP_URL_PATH);
|
128 |
$site_uri_len = strlen($site_uri);
|
129 |
|
130 |
// Get the site's path from the URL.
|
131 |
+
$home_uri = parse_url(home_url(), PHP_URL_PATH);
|
132 |
$home_uri_len = strlen($home_uri);
|
133 |
|
134 |
// Get the current page URI.
|
234 |
|
235 |
// Prepare Pages Data
|
236 |
$pages = array(
|
237 |
+
'uri' => $page_uri,
|
238 |
+
'date' => TimeZone::getCurrentDate('Y-m-d'),
|
239 |
'count' => 1,
|
240 |
+
'id' => $current_page['id'],
|
241 |
+
'type' => $current_page['type']
|
242 |
);
|
243 |
$pages = apply_filters('wp_statistics_pages_information', $pages);
|
244 |
|
296 |
{
|
297 |
|
298 |
//Create Empty Object
|
299 |
+
$arg = array();
|
300 |
$defaults = array(
|
301 |
+
'link' => '',
|
302 |
'edit_link' => '',
|
303 |
'object_id' => $page_id,
|
304 |
+
'title' => '-',
|
305 |
+
'meta' => array()
|
306 |
);
|
307 |
|
308 |
if (!empty($type)) {
|
312 |
case "post":
|
313 |
case "page":
|
314 |
$arg = array(
|
315 |
+
'title' => esc_html(get_the_title($page_id)),
|
316 |
+
'link' => get_the_permalink($page_id),
|
317 |
'edit_link' => get_edit_post_link($page_id),
|
318 |
+
'meta' => array(
|
319 |
'post_type' => get_post_type($page_id)
|
320 |
)
|
321 |
);
|
326 |
$term = get_term($page_id);
|
327 |
if (!is_wp_error($term) and $term !== null) {
|
328 |
$arg = array(
|
329 |
+
'title' => esc_html($term->name),
|
330 |
+
'link' => (is_wp_error(get_term_link($page_id)) === true ? '' : get_term_link($page_id)),
|
331 |
'edit_link' => get_edit_term_link($page_id),
|
332 |
+
'meta' => array(
|
333 |
+
'taxonomy' => $term->taxonomy,
|
334 |
'term_taxonomy_id' => $term->term_taxonomy_id,
|
335 |
+
'count' => $term->count
|
336 |
)
|
337 |
);
|
338 |
}
|
340 |
case "home":
|
341 |
$arg = array(
|
342 |
'title' => __('Home Page', 'wp-statistics'),
|
343 |
+
'link' => get_site_url()
|
344 |
);
|
345 |
break;
|
346 |
case "author":
|
347 |
$user_info = get_userdata($page_id);
|
348 |
+
$arg = array(
|
349 |
+
'title' => ($user_info->display_name != "" ? esc_html($user_info->display_name) : esc_html($user_info->first_name . ' ' . $user_info->last_name)),
|
350 |
+
'link' => get_author_posts_url($page_id),
|
351 |
'edit_link' => get_edit_user_link($page_id),
|
352 |
);
|
353 |
break;
|
385 |
// Define the array of defaults
|
386 |
$defaults = array(
|
387 |
'per_page' => 10,
|
388 |
+
'paged' => 1,
|
389 |
+
'from' => '',
|
390 |
+
'to' => ''
|
391 |
);
|
392 |
|
393 |
$args = wp_parse_args($args, $defaults);
|
402 |
$sql = "SELECT `pages`.`date`,`pages`.`uri`,`pages`.`id`,`pages`.`type`, SUM(`pages`.`count`) + IFNULL(`historical`.`value`, 0) AS `count_sum` FROM `" . DB::table('pages') . "` `pages` LEFT JOIN `" . DB::table('historical') . "` `historical` ON `pages`.`uri`=`historical`.`uri` AND `historical`.`category`='uri' {$DateTimeSql} GROUP BY `uri` ORDER BY `count_sum` DESC";
|
403 |
|
404 |
// Get List Of Pages
|
405 |
+
$list = array();
|
406 |
$result = $wpdb->get_results($sql . " LIMIT " . ($args['paged'] - 1) * $args['per_page'] . "," . $args['per_page']);
|
407 |
foreach ($result as $item) {
|
408 |
|
411 |
|
412 |
// Push to list
|
413 |
$list[] = array(
|
414 |
+
'title' => $page_info['title'],
|
415 |
+
'link' => $page_info['link'],
|
416 |
+
'str_url' => htmlentities(urldecode($item->uri), ENT_QUOTES),
|
417 |
'hits_page' => Menus::admin_url('pages', array('ID' => $item->id, 'type' => $item->type)),
|
418 |
+
'number' => number_format_i18n($item->count_sum)
|
419 |
);
|
420 |
}
|
421 |
|
464 |
public static function uri_to_id($uri)
|
465 |
{
|
466 |
global $wpdb;
|
467 |
+
$sql = $wpdb->prepare("SELECT id FROM `" . DB::table('pages') . "` WHERE `uri` = %s and id > 0 ORDER BY date DESC", $uri);
|
468 |
$result = $wpdb->get_var($sql);
|
469 |
if ($result == 0) {
|
470 |
$result = 0;
|
includes/class-wp-statistics-purge.php
CHANGED
@@ -16,7 +16,7 @@ class Purge
|
|
16 |
if ($purge_days > 30) {
|
17 |
|
18 |
// Purge the visit data.
|
19 |
-
$table_name
|
20 |
$date_string = TimeZone::getCurrentDate('Y-m-d', '-' . $purge_days);
|
21 |
|
22 |
$result = $wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE `last_counter` < %s", $date_string));
|
@@ -30,10 +30,10 @@ class Purge
|
|
30 |
$insert = $wpdb->insert(
|
31 |
DB::table('historical'),
|
32 |
array(
|
33 |
-
'value'
|
34 |
'category' => 'visits',
|
35 |
-
'page_id'
|
36 |
-
'uri'
|
37 |
)
|
38 |
);
|
39 |
if (!$insert) {
|
@@ -60,10 +60,10 @@ class Purge
|
|
60 |
$insert = $wpdb->insert(
|
61 |
DB::table('historical'),
|
62 |
array(
|
63 |
-
'value'
|
64 |
'category' => 'visitors',
|
65 |
-
'page_id'
|
66 |
-
'uri'
|
67 |
)
|
68 |
);
|
69 |
if (!$insert) {
|
@@ -91,7 +91,7 @@ class Purge
|
|
91 |
|
92 |
// Purge the search data.
|
93 |
$table_name = DB::table('search');
|
94 |
-
$result
|
95 |
|
96 |
if ($result) {
|
97 |
$result_string .= '<br>' . sprintf(__('%s data older than %s days purged successfully.', 'wp-statistics'), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>');
|
@@ -138,10 +138,10 @@ class Purge
|
|
138 |
$insert = $wpdb->insert(
|
139 |
DB::table('historical'),
|
140 |
array(
|
141 |
-
'value'
|
142 |
'category' => 'uri',
|
143 |
-
'uri'
|
144 |
-
'page_id'
|
145 |
)
|
146 |
);
|
147 |
if (!$insert) {
|
@@ -177,7 +177,7 @@ class Purge
|
|
177 |
{
|
178 |
global $wpdb;
|
179 |
$visitor_table = DB::table('visitor');
|
180 |
-
$visit_table
|
181 |
|
182 |
// If it's less than 10 hits, don't do anything.
|
183 |
if ($purge_hits > 9) {
|
16 |
if ($purge_days > 30) {
|
17 |
|
18 |
// Purge the visit data.
|
19 |
+
$table_name = DB::table('visit');
|
20 |
$date_string = TimeZone::getCurrentDate('Y-m-d', '-' . $purge_days);
|
21 |
|
22 |
$result = $wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE `last_counter` < %s", $date_string));
|
30 |
$insert = $wpdb->insert(
|
31 |
DB::table('historical'),
|
32 |
array(
|
33 |
+
'value' => $result,
|
34 |
'category' => 'visits',
|
35 |
+
'page_id' => -2,
|
36 |
+
'uri' => '-2',
|
37 |
)
|
38 |
);
|
39 |
if (!$insert) {
|
60 |
$insert = $wpdb->insert(
|
61 |
DB::table('historical'),
|
62 |
array(
|
63 |
+
'value' => $result,
|
64 |
'category' => 'visitors',
|
65 |
+
'page_id' => -1,
|
66 |
+
'uri' => '-1',
|
67 |
)
|
68 |
);
|
69 |
if (!$insert) {
|
91 |
|
92 |
// Purge the search data.
|
93 |
$table_name = DB::table('search');
|
94 |
+
$result = $wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE `last_counter` < %s", $date_string));
|
95 |
|
96 |
if ($result) {
|
97 |
$result_string .= '<br>' . sprintf(__('%s data older than %s days purged successfully.', 'wp-statistics'), '<code>' . $table_name . '</code>', '<code>' . $purge_days . '</code>');
|
138 |
$insert = $wpdb->insert(
|
139 |
DB::table('historical'),
|
140 |
array(
|
141 |
+
'value' => $historical,
|
142 |
'category' => 'uri',
|
143 |
+
'uri' => $row->uri,
|
144 |
+
'page_id' => Pages::uri_to_id($row->uri),
|
145 |
)
|
146 |
);
|
147 |
if (!$insert) {
|
177 |
{
|
178 |
global $wpdb;
|
179 |
$visitor_table = DB::table('visitor');
|
180 |
+
$visit_table = DB::table('visit');
|
181 |
|
182 |
// If it's less than 10 hits, don't do anything.
|
183 |
if ($purge_hits > 9) {
|
includes/class-wp-statistics-referred.php
CHANGED
@@ -222,7 +222,7 @@ class Referred
|
|
222 |
|
223 |
// Check Validate IP
|
224 |
if (filter_var($ip, FILTER_VALIDATE_IP)) {
|
225 |
-
$result['ip']
|
226 |
$result['country'] = GeoIP::getCountry($ip);
|
227 |
}
|
228 |
}
|
@@ -274,7 +274,7 @@ class Referred
|
|
274 |
$ISOCountryCode = Country::getList();
|
275 |
|
276 |
//Get Refer Site Detail
|
277 |
-
$refer_opt
|
278 |
$referrer_list = (empty($refer_opt) ? array() : $refer_opt);
|
279 |
|
280 |
if (!$get_urls) {
|
@@ -289,24 +289,24 @@ class Referred
|
|
289 |
|
290 |
//Get Site information if Not Exist
|
291 |
if (!array_key_exists($domain, $referrer_list)) {
|
292 |
-
$get_site_inf
|
293 |
-
$get_site_title
|
294 |
$referrer_list[$domain] = array(
|
295 |
-
'ip'
|
296 |
'country' => $get_site_inf['country'],
|
297 |
-
'title'
|
298 |
);
|
299 |
}
|
300 |
|
301 |
// Push to list
|
302 |
$list[] = array(
|
303 |
-
'domain'
|
304 |
-
'title'
|
305 |
-
'ip'
|
306 |
-
'country'
|
307 |
-
'flag'
|
308 |
'page_link' => Menus::admin_url('referrers', array('referrer' => $referrer_html)),
|
309 |
-
'number'
|
310 |
);
|
311 |
}
|
312 |
|
222 |
|
223 |
// Check Validate IP
|
224 |
if (filter_var($ip, FILTER_VALIDATE_IP)) {
|
225 |
+
$result['ip'] = $ip;
|
226 |
$result['country'] = GeoIP::getCountry($ip);
|
227 |
}
|
228 |
}
|
274 |
$ISOCountryCode = Country::getList();
|
275 |
|
276 |
//Get Refer Site Detail
|
277 |
+
$refer_opt = get_option(self::$referral_detail_opt);
|
278 |
$referrer_list = (empty($refer_opt) ? array() : $refer_opt);
|
279 |
|
280 |
if (!$get_urls) {
|
289 |
|
290 |
//Get Site information if Not Exist
|
291 |
if (!array_key_exists($domain, $referrer_list)) {
|
292 |
+
$get_site_inf = Referred::get_domain_server($domain);
|
293 |
+
$get_site_title = Helper::get_site_title_by_url($domain);
|
294 |
$referrer_list[$domain] = array(
|
295 |
+
'ip' => $get_site_inf['ip'],
|
296 |
'country' => $get_site_inf['country'],
|
297 |
+
'title' => ($get_site_title === false ? '' : $get_site_title),
|
298 |
);
|
299 |
}
|
300 |
|
301 |
// Push to list
|
302 |
$list[] = array(
|
303 |
+
'domain' => $domain,
|
304 |
+
'title' => $referrer_list[$domain]['title'],
|
305 |
+
'ip' => ($referrer_list[$domain]['ip'] != "" ? $referrer_list[$domain]['ip'] : '-'),
|
306 |
+
'country' => ($referrer_list[$domain]['country'] != "" ? $ISOCountryCode[$referrer_list[$domain]['country']] : ''),
|
307 |
+
'flag' => ($referrer_list[$domain]['country'] != "" ? Country::flag($referrer_list[$domain]['country']) : ''),
|
308 |
'page_link' => Menus::admin_url('referrers', array('referrer' => $referrer_html)),
|
309 |
+
'number' => number_format_i18n($number)
|
310 |
);
|
311 |
}
|
312 |
|
includes/class-wp-statistics-schedule.php
CHANGED
@@ -103,17 +103,17 @@ class Schedule
|
|
103 |
|
104 |
// Adds once weekly to the existing schedules.
|
105 |
$WP_Statistics_schedules = array(
|
106 |
-
'weekly'
|
107 |
'interval' => 604800,
|
108 |
-
'display'
|
109 |
),
|
110 |
'biweekly' => array(
|
111 |
'interval' => 1209600,
|
112 |
-
'display'
|
113 |
),
|
114 |
-
'4weeks'
|
115 |
'interval' => 2419200,
|
116 |
-
'display'
|
117 |
)
|
118 |
);
|
119 |
foreach ($WP_Statistics_schedules as $key => $val) {
|
@@ -135,9 +135,9 @@ class Schedule
|
|
135 |
$insert = $wpdb->insert(
|
136 |
DB::table('visit'),
|
137 |
array(
|
138 |
-
'last_visit'
|
139 |
'last_counter' => TimeZone::getCurrentDate('Y-m-d', '+1'),
|
140 |
-
'visit'
|
141 |
)
|
142 |
);
|
143 |
if (!$insert) {
|
103 |
|
104 |
// Adds once weekly to the existing schedules.
|
105 |
$WP_Statistics_schedules = array(
|
106 |
+
'weekly' => array(
|
107 |
'interval' => 604800,
|
108 |
+
'display' => __('Once Weekly'),
|
109 |
),
|
110 |
'biweekly' => array(
|
111 |
'interval' => 1209600,
|
112 |
+
'display' => __('Once Every 2 Weeks'),
|
113 |
),
|
114 |
+
'4weeks' => array(
|
115 |
'interval' => 2419200,
|
116 |
+
'display' => __('Once Every 4 Weeks'),
|
117 |
)
|
118 |
);
|
119 |
foreach ($WP_Statistics_schedules as $key => $val) {
|
135 |
$insert = $wpdb->insert(
|
136 |
DB::table('visit'),
|
137 |
array(
|
138 |
+
'last_visit' => TimeZone::getCurrentDate('Y-m-d H:i:s', '+1'),
|
139 |
'last_counter' => TimeZone::getCurrentDate('Y-m-d', '+1'),
|
140 |
+
'visit' => 0,
|
141 |
)
|
142 |
);
|
143 |
if (!$insert) {
|
includes/class-wp-statistics-widget.php
CHANGED
@@ -31,7 +31,7 @@ class WP_Statistics_Widget extends \WP_Widget
|
|
31 |
if (!is_array($widget_options)) {
|
32 |
return;
|
33 |
}
|
34 |
-
|
35 |
echo $before_widget;
|
36 |
echo $before_title . $widget_options['name_widget'] . $after_title;
|
37 |
echo '<ul>';
|
31 |
if (!is_array($widget_options)) {
|
32 |
return;
|
33 |
}
|
34 |
+
|
35 |
echo $before_widget;
|
36 |
echo $before_title . $widget_options['name_widget'] . $after_title;
|
37 |
echo '<ul>';
|
includes/template-functions.php
CHANGED
@@ -520,53 +520,53 @@ function wp_statistics_get_top_pages($rangestartdate = null, $rangeenddate = nul
|
|
520 |
|
521 |
// Now get the total page visit count for each unique URI.
|
522 |
foreach ($result as $out) {
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
} else {
|
544 |
-
if ($out[0] == '/') {
|
545 |
-
$title = get_bloginfo();
|
546 |
} else {
|
547 |
-
$
|
|
|
|
|
|
|
|
|
548 |
}
|
549 |
}
|
550 |
-
}
|
551 |
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
|
|
568 |
}
|
569 |
-
}
|
570 |
}
|
571 |
|
572 |
// If we have more than one result, let's sort them using usort.
|
520 |
|
521 |
// Now get the total page visit count for each unique URI.
|
522 |
foreach ($result as $out) {
|
523 |
+
//Prepare item
|
524 |
+
list($url, $page_id, $page_type) = $out;
|
525 |
+
|
526 |
+
// Check if item is of specific post type (string or part of an array) or if post type is set to null
|
527 |
+
if (is_null($post_type) || get_post_type($page_id) == $post_type || (is_array($post_type) && in_array(get_post_type($page_id), $post_type))) {
|
528 |
+
// Increment the total number of results.
|
529 |
+
$total++;
|
530 |
+
|
531 |
+
//Get Page Title
|
532 |
+
$page_info = Pages::get_page_info($page_id, $page_type);
|
533 |
+
$title = mb_substr($page_info['title'], 0, 200, "utf-8");
|
534 |
+
$page_url = $page_info['link'];
|
535 |
+
|
536 |
+
// Check age Title if page id or type not exist
|
537 |
+
if ($page_info['link'] == "") {
|
538 |
+
$page_url = htmlentities(path_join(get_site_url(), $url), ENT_QUOTES);
|
539 |
+
$id = WP_STATISTICS\Pages::uri_to_id($out[0]);
|
540 |
+
$post = get_post($id);
|
541 |
+
if (is_object($post)) {
|
542 |
+
$title = esc_html($post->post_title);
|
|
|
|
|
|
|
543 |
} else {
|
544 |
+
if ($out[0] == '/') {
|
545 |
+
$title = get_bloginfo();
|
546 |
+
} else {
|
547 |
+
$title = '';
|
548 |
+
}
|
549 |
}
|
550 |
}
|
|
|
551 |
|
552 |
+
//Check Title is empty
|
553 |
+
if (empty($title)) {
|
554 |
+
$title = '-';
|
555 |
+
}
|
556 |
|
557 |
+
// Add the current post to the array.
|
558 |
+
if ($rangestartdate != null && $rangeenddate != null) {
|
559 |
+
$uris[] = array(
|
560 |
+
urldecode_deep($out[0]),
|
561 |
+
wp_statistics_pages('range', $out[0], -1, $rangestartdate, $rangeenddate),
|
562 |
+
$page_id,
|
563 |
+
$title,
|
564 |
+
$page_url,
|
565 |
+
);
|
566 |
+
} else {
|
567 |
+
$uris[] = array(urldecode_deep($out[0]), wp_statistics_pages('total', $out[0]), $page_id, $title, $page_url);
|
568 |
+
}
|
569 |
}
|
|
|
570 |
}
|
571 |
|
572 |
// If we have more than one result, let's sort them using usort.
|
package.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"devDependencies": {
|
3 |
+
"@babel/core": "^7.4.3",
|
4 |
+
"@babel/preset-env": "^7.4.3",
|
5 |
+
"gulp": "4.0.0",
|
6 |
+
"gulp-babel": "^8.0.0",
|
7 |
+
"gulp-clean-css": "^4.2.0",
|
8 |
+
"gulp-concat": "^2.6.1",
|
9 |
+
"gulp-insert": "^0.5.0",
|
10 |
+
"gulp-rename": "^1.4.0",
|
11 |
+
"gulp-replace": "^1.0.0",
|
12 |
+
"gulp-sass": "^4.0.2",
|
13 |
+
"gulp-sourcemaps": "^2.6.5",
|
14 |
+
"gulp-uglify": "^3.0.2",
|
15 |
+
"node-sass": "^4.11.0",
|
16 |
+
"readable-stream": "3.3.0"
|
17 |
+
}
|
18 |
+
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ 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.8
|
7 |
-
Stable tag: 13.1.
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -124,6 +124,13 @@ Before updating, make sure you disabled all your add-ons, then after that, try t
|
|
124 |
If you encounter any bug, please create an issue on [Github](https://github.com/wp-statistics/wp-statistics/issues/new) where we can act upon them more efficiently. Since [Github](https://github.com/wp-statistics/wp-statistics) is not a support forum, just bugs are welcomed, and any other request will be closed.
|
125 |
|
126 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
= 13.1.1 =
|
128 |
- Fixed exclusions setting page and storing properly data in option page and keep lines in the input data
|
129 |
- Fixed some tweak issues and improved setting pages
|
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.8
|
7 |
+
Stable tag: 13.1.2
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
124 |
If you encounter any bug, please create an issue on [Github](https://github.com/wp-statistics/wp-statistics/issues/new) where we can act upon them more efficiently. Since [Github](https://github.com/wp-statistics/wp-statistics) is not a support forum, just bugs are welcomed, and any other request will be closed.
|
125 |
|
126 |
== Changelog ==
|
127 |
+
= v13.1.2 - 09.11.2021 =
|
128 |
+
* Enhancement: Avoiding altering some tables after every upgrade
|
129 |
+
* Enhancement: Pages widget table clutter issue fixed when URLs are long
|
130 |
+
* Bugfix: The variable types bug in Matomo Referrer schedule weekly update fixed
|
131 |
+
* Bugfix: the Nonce check to active/deactivate add-ons added
|
132 |
+
* Update: User roles added in online page
|
133 |
+
|
134 |
= 13.1.1 =
|
135 |
- Fixed exclusions setting page and storing properly data in option page and keep lines in the input data
|
136 |
- Fixed some tweak issues and improved setting pages
|
wp-statistics.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP Statistics
|
4 |
* Plugin URI: https://wp-statistics.com/
|
5 |
* Description: This plugin gives you the complete information on your website's visitors.
|
6 |
-
* Version: 13.1.
|
7 |
* Author: VeronaLabs
|
8 |
* Author URI: https://veronalabs.com/
|
9 |
* Text Domain: wp-statistics
|
@@ -16,7 +16,7 @@ if (!defined('ABSPATH')) exit;
|
|
16 |
# Load Plugin Defines
|
17 |
require_once 'includes/defines.php';
|
18 |
|
19 |
-
# Include some empty class to make sure they are
|
20 |
require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-updates.php';
|
21 |
require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-welcome.php';
|
22 |
|
3 |
* Plugin Name: WP Statistics
|
4 |
* Plugin URI: https://wp-statistics.com/
|
5 |
* Description: This plugin gives you the complete information on your website's visitors.
|
6 |
+
* Version: 13.1.2
|
7 |
* Author: VeronaLabs
|
8 |
* Author URI: https://veronalabs.com/
|
9 |
* Text Domain: wp-statistics
|
16 |
# Load Plugin Defines
|
17 |
require_once 'includes/defines.php';
|
18 |
|
19 |
+
# Include some empty class to make sure they are existed while upgrading plugin.
|
20 |
require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-updates.php';
|
21 |
require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-welcome.php';
|
22 |
|