Slimstat Analytics - Version 4.7.8.3

Version Description

  • [Fix] The opt-out message was being displayed even if the corresponding setting was turned off. Apologies for the inconvenience.
Download this release

Release Info

Developer coolmann
Plugin Icon 128x128 Slimstat Analytics
Version 4.7.8.3
Comparing to
See all releases

Code changes from version 4.7.8.2 to 4.7.8.3

Files changed (4) hide show
  1. readme.txt +4 -1
  2. wp-slimstat.js +1 -1
  3. wp-slimstat.min.js +1 -1
  4. wp-slimstat.php +13 -10
readme.txt CHANGED
@@ -6,7 +6,7 @@ Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Requires PHP: 5.2
8
  Tested up to: 4.9
9
- Stable tag: 4.7.8.2
10
 
11
  == Description ==
12
  The leading web analytics plugin for WordPress. Track returning customers and registered users, monitor Javascript events, detect intrusions, analyze email campaigns. Thousands of WordPress sites are already using it.
@@ -78,6 +78,9 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
78
  5. **Responsive layout** - Keep an eye on your reports on the go
79
 
80
  == Changelog ==
 
 
 
81
  = 4.7.8.2 =
82
  * [New] The IP to hostname conversion feature now stores in the database the information it calculates, to avoid querying the DNS server over and over again.
83
  * [Update] The opt-out banner is now loaded dynamically, to address HTML caching issues. Thank you, [fuchsws](https://wordpress.org/support/topic/opt-out-message-vs-html-cache).
6
  Requires at least: 3.8
7
  Requires PHP: 5.2
8
  Tested up to: 4.9
9
+ Stable tag: 4.7.8.3
10
 
11
  == Description ==
12
  The leading web analytics plugin for WordPress. Track returning customers and registered users, monitor Javascript events, detect intrusions, analyze email campaigns. Thousands of WordPress sites are already using it.
78
  5. **Responsive layout** - Keep an eye on your reports on the go
79
 
80
  == Changelog ==
81
+ = 4.7.8.3 =
82
+ * [Fix] The opt-out message was being displayed even if the corresponding setting was turned off. Apologies for the inconvenience.
83
+
84
  = 4.7.8.2 =
85
  * [New] The IP to hostname conversion feature now stores in the database the information it calculates, to avoid querying the DNS server over and over again.
86
  * [Update] The opt-out banner is now loaded dynamically, to address HTML caching issues. Thank you, [fuchsws](https://wordpress.org/support/topic/opt-out-message-vs-html-cache).
wp-slimstat.js CHANGED
@@ -172,8 +172,8 @@ var SlimStat = {
172
 
173
  show_optout_message : function() {
174
  var opt_out_cookies = ( "undefined" != typeof SlimStatParams.opt_out_cookies && SlimStatParams.opt_out_cookies ) ? SlimStatParams.opt_out_cookies.split( ',' ) : [];
 
175
 
176
- var show_optout = true;
177
  for ( var i = 0; i < opt_out_cookies.length; i++ ) {
178
  if ( SlimStat.get_cookie( opt_out_cookies[ i ] ) != "" ) {
179
  show_optout = false;
172
 
173
  show_optout_message : function() {
174
  var opt_out_cookies = ( "undefined" != typeof SlimStatParams.opt_out_cookies && SlimStatParams.opt_out_cookies ) ? SlimStatParams.opt_out_cookies.split( ',' ) : [];
175
+ var show_optout = ( opt_out_cookies.length > 0 );
176
 
 
177
  for ( var i = 0; i < opt_out_cookies.length; i++ ) {
178
  if ( SlimStat.get_cookie( opt_out_cookies[ i ] ) != "" ) {
179
  show_optout = false;
wp-slimstat.min.js CHANGED
@@ -1 +1 @@
1
- var SlimStat={_id:void 0!==SlimStatParams.id?SlimStatParams.id:"-1.0",_base64_key_str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_plugins:{acrobat:{substrings:["Adobe","Acrobat"],active_x_strings:["AcroPDF.PDF","PDF.PDFCtrl.5"]},pdfviewer:{substrings:["PDF"],active_x_strings:["AcroPDF.PDF"]},flash:{substrings:["Shockwave","Flash"],active_x_strings:["ShockwaveFlash.ShockwaveFlash"]},mediaplayer:{substrings:["Windows Media"],active_x_strings:["WMPlayer.OCX"]},quicktime:{substrings:["QuickTime"],active_x_strings:["QuickTime.QuickTime"]},silverlight:{substrings:["Silverlight"],active_x_strings:["AgControl.AgControl"]}},_utf8_encode:function(t){var e,n,i="";for(t=t.replace(/\r\n/g,"\n"),e=0;e<t.length;e++)(n=t.charCodeAt(e))<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(63&n|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(63&n|128));return i},_base64_encode:function(t){var e,n,i,r,a,o,s,l="",d=0;for(t=SlimStat._utf8_encode(t);d<t.length;)r=(e=t.charCodeAt(d++))>>2,a=(3&e)<<4|(n=t.charCodeAt(d++))>>4,o=(15&n)<<2|(i=t.charCodeAt(d++))>>6,s=63&i,isNaN(n)?o=s=64:isNaN(i)&&(s=64),l=l+SlimStat._base64_key_str.charAt(r)+SlimStat._base64_key_str.charAt(a)+SlimStat._base64_key_str.charAt(o)+SlimStat._base64_key_str.charAt(s);return l},_detect_single_plugin_not_ie:function(t){var e,n,i,r;for(i in navigator.plugins){for(r in e=""+navigator.plugins[i].name+navigator.plugins[i].description,n=0,SlimStat._plugins[t].substrings)-1!=e.indexOf(SlimStat._plugins[t].substrings[r])&&n++;if(n==SlimStat._plugins[t].substrings.length)return!0}return!1},_detect_single_plugin_ie:function(t){var e="",n=!1;for(e in SlimStat._plugins[t].active_x_strings)try{new ActiveXObject(SlimStat._plugins[t].active_x_strings[e]),n=!0}catch(t){}return n},_detect_single_plugin:function(t){return navigator.plugins.length?this.detect=SlimStat._detect_single_plugin_not_ie:this.detect=SlimStat._detect_single_plugin_ie,this.detect(t)},detect_plugins:function(){var t,e=[];for(t in SlimStat._plugins)SlimStat._detect_single_plugin(t)&&e.push(t);return"function"==typeof navigator.javaEnabled&&navigator.javaEnabled()&&e.push("java"),e.join(",")},get_page_performance:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},void 0===slim_performance.timing?0:slim_performance.timing.loadEventEnd-slim_performance.timing.responseEnd},get_server_latency:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},void 0===slim_performance.timing?0:slim_performance.timing.responseEnd-slim_performance.timing.connectEnd},optout:function(t,e){t.preventDefault(),expiration=new Date,expiration.setTime(expiration.getTime()+31536e6),document.cookie="slimstat_optout_tracking="+e+";expires="+expiration.toGMTString(),t.target.parentNode.parentNode.removeChild(t.target.parentNode)},show_optout_message:function(){for(var t=void 0!==SlimStatParams.opt_out_cookies&&SlimStatParams.opt_out_cookies?SlimStatParams.opt_out_cookies.split(","):[],e=!0,n=0;n<t.length;n++)""!=SlimStat.get_cookie(t[n])&&(e=!1);if(e&&(xhr=new XMLHttpRequest,xhr))return xhr.open("POST",SlimStatParams.ajaxurl,!0),xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.withCredentials=!0,xhr.send("action=slimstat_optout_html"),xhr.onreadystatechange=function(){4==xhr.readyState&&document.body.insertAdjacentHTML("beforeend",xhr.responseText)},!0},add_event:function(t,e,n){t&&t.addEventListener?t.addEventListener(e,n,!1):t&&t.attachEvent?(t["e"+e+n]=n,t[e+n]=function(){t["e"+e+n](window.event)},t.attachEvent("on"+e,t[e+n])):t["on"+e]=t["e"+e+n]},in_array:function(t,e){for(var n=0;n<e.length;n++)if(e[n].trim()==t)return!0;return!1},in_array_substring:function(t,e){for(var n=0;n<e.length;n++)if(-1!=t.indexOf(e[n].trim()))return!0;return!1},get_cookie:function(t){var e=("; "+document.cookie).split("; "+t+"=");return 2==e.length?e.pop().split(";").shift():""},send_to_server:function(t,e){if(void 0===SlimStatParams.ajaxurl||void 0===t)return!1;if(void 0===e&&(e=!0),slimstat_data_with_client_info=t+"&sw="+screen.width+"&sh="+screen.height+"&bw="+window.innerWidth+"&bh="+window.innerHeight+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins(),e&&navigator.sendBeacon)navigator.sendBeacon(SlimStatParams.ajaxurl,slimstat_data_with_client_info);else{try{window.XMLHttpRequest?request=new XMLHttpRequest:window.ActiveXObject&&(request=new ActiveXObject("Microsoft.XMLHTTP"))}catch(t){return!1}if(request)return request.open("POST",SlimStatParams.ajaxurl,!0),request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),request.setRequestHeader("X-Requested-With","XMLHttpRequest"),request.withCredentials=!0,request.send(slimstat_data_with_client_info),request.onreadystatechange=function(){4==request.readyState&&(parsed_id=parseInt(request.responseText),!isNaN(parsed_id)&&parsed_id>0&&(SlimStat._id=request.responseText))},!0}return!1},ss_track:function(t,e,n,i){if(t=t||window.event,e=void 0===e?0:parseInt(e),note_array=[],void 0===i&&(i=!0),parsed_id=parseInt(SlimStat._id),isNaN(parsed_id)||parsed_id<=0)return!1;if(node=void 0!==t.target?t.target:void 0!==t.srcElement&&t.srcElement,!node)return!1;switch(3==node.nodeType&&(node=node.parentNode),parent_node=node.parentNode,resource_url="",node.nodeName){case"FORM":void 0!==node.action&&node.action&&(resource_url=node.action);break;case"INPUT":for(;"undefined"!=typeof parent_node&&"FORM"!=parent_node.nodeName&&"BODY"!=parent_node.nodeName;)parent_node=parent_node.parentNode;if(void 0!==parent_node.action&&parent_node.action){resource_url=parent_node.action;break}default:if("A"!=node.nodeName)for(;void 0!==node.parentNode&&null!=node.parentNode&&"A"!=node.nodeName&&"BODY"!=node.nodeName;)node=node.parentNode;void 0!==node.hash&&node.hash&&node.hostname==location.hostname?resource_url=node.hash:void 0!==node.href&&-1==node.href.indexOf("javascript:")&&(resource_url=node.href),"function"==typeof node.getAttribute&&(void 0!==node.getAttribute("title")&&node.getAttribute("title")&&note_array.push("Title:"+node.getAttribute("title")),void 0!==node.getAttribute("id")&&node.getAttribute("id")&&note_array.push("ID:"+node.getAttribute("id")))}return pos_x=-1,pos_y=-1,position="",void 0!==t.pageX&&void 0!==t.pageY?(pos_x=t.pageX,pos_y=t.pageY):void 0!==t.clientX&&void 0!==t.clientY&&void 0!==document.body.scrollLeft&&void 0!==document.documentElement.scrollLeft&&void 0!==document.body.scrollTop&&void 0!==document.documentElement.scrollTop&&(pos_x=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,pos_y=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),pos_x>0&&pos_y>0&&(position=pos_x+","+pos_y),void 0!==t.type&&(event_description=t.type,"keypress"==t.type?event_description+="; keypress:"+String.fromCharCode(parseInt(t.which)):"click"==t.type&&(event_description+="; which:"+t.which)),void 0!==n&&n&&note_array.push(n),note_string=SlimStat._base64_encode(note_array.join(", ")),requested_op="add",1==e?resource_url=resource_url.substring(resource_url.indexOf(location.hostname)+location.hostname.length):requested_op=0==e||2==e?"update":"event",SlimStat.send_to_server("action=slimtrack&op="+requested_op+"&id="+SlimStat._id+"&ty="+e+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(resource_url)+"&pos="+position+"&des="+SlimStat._base64_encode(event_description)+"&no="+note_string,i),!0},attach_tracker:function(){all_links=document.getElementsByTagName("a");for(var t=void 0!==SlimStatParams.extensions_to_track&&SlimStatParams.extensions_to_track?SlimStatParams.extensions_to_track.split(","):[],e=void 0!==SlimStatParams.outbound_classes_rel_href_to_not_track&&SlimStatParams.outbound_classes_rel_href_to_not_track?SlimStatParams.outbound_classes_rel_href_to_not_track.split(","):[],n=0;n<all_links.length;n++){if(linktype=all_links[n].href&&(all_links[n].hostname==location.hostname||-1==all_links[n].href.indexOf("://"))||-1==all_links[n].href.indexOf("javascript:")?2:0,tracking=1,e.length>0){if(1==tracking){classes_current_link=void 0!==all_links[n].className&&all_links[n].className?all_links[n].className.split(" "):[];for(var i=0;i<classes_current_link.length;i++)if(SlimStat.in_array_substring(classes_current_link[i],e)){tracking=0;break}}1==tracking&&void 0!==all_links[n].attributes.rel&&all_links[n].attributes.rel.value&&SlimStat.in_array_substring(all_links[n].attributes.rel.value,e)&&(tracking=0),1==tracking&&void 0!==all_links[n].href&&all_links[n].href&&SlimStat.in_array_substring(all_links[n].href,e)&&(tracking=0)}extension_current_link=all_links[n].pathname.split(/[?#]/)[0].split(".").pop().replace(/[\/\-]/g,""),2==linktype&&t.length>0&&SlimStat.in_array(extension_current_link,t)&&(tracking=1,linktype=1),all_links[n].setAttribute("data-slimstat",(linktype<<1)+tracking),SlimStat.add_event(all_links[n],"click",function(t){link_info=parseInt(this.getAttribute("data-slimstat")),isNaN(link_info)&&(link_info=0),!0&link_info&&SlimStat.ss_track(t,link_info>>1,"")})}}};"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),SlimStat.add_event(window,"load",function(){SlimStat.attach_tracker(),SlimStat.show_optout_message()});var slimstat_data="",use_beacon=!0;void 0!==SlimStatParams.id&&parseInt(SlimStatParams.id)>0?slimstat_data="action=slimtrack&op=update&id="+SlimStatParams.id:void 0!==SlimStatParams.ci&&(slimstat_data="action=slimtrack&op=add&id="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href),use_beacon=!1),slimstat_data.length>0&&SlimStat.add_event(window,"load",function(){setTimeout(function(){SlimStat.send_to_server(slimstat_data,"")},0)});
1
+ var SlimStat={_id:void 0!==SlimStatParams.id?SlimStatParams.id:"-1.0",_base64_key_str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_plugins:{acrobat:{substrings:["Adobe","Acrobat"],active_x_strings:["AcroPDF.PDF","PDF.PDFCtrl.5"]},pdfviewer:{substrings:["PDF"],active_x_strings:["AcroPDF.PDF"]},flash:{substrings:["Shockwave","Flash"],active_x_strings:["ShockwaveFlash.ShockwaveFlash"]},mediaplayer:{substrings:["Windows Media"],active_x_strings:["WMPlayer.OCX"]},quicktime:{substrings:["QuickTime"],active_x_strings:["QuickTime.QuickTime"]},silverlight:{substrings:["Silverlight"],active_x_strings:["AgControl.AgControl"]}},_utf8_encode:function(t){var e,n,i="";for(t=t.replace(/\r\n/g,"\n"),e=0;e<t.length;e++)(n=t.charCodeAt(e))<128?i+=String.fromCharCode(n):(127<n&&n<2048?i+=String.fromCharCode(n>>6|192):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128)),i+=String.fromCharCode(63&n|128));return i},_base64_encode:function(t){var e,n,i,a,r,o,s,l="",d=0;for(t=SlimStat._utf8_encode(t);d<t.length;)a=(e=t.charCodeAt(d++))>>2,r=(3&e)<<4|(n=t.charCodeAt(d++))>>4,o=(15&n)<<2|(i=t.charCodeAt(d++))>>6,s=63&i,isNaN(n)?o=s=64:isNaN(i)&&(s=64),l=l+SlimStat._base64_key_str.charAt(a)+SlimStat._base64_key_str.charAt(r)+SlimStat._base64_key_str.charAt(o)+SlimStat._base64_key_str.charAt(s);return l},_detect_single_plugin_not_ie:function(t){var e,n,i,a;for(i in navigator.plugins){for(a in e=""+navigator.plugins[i].name+navigator.plugins[i].description,n=0,SlimStat._plugins[t].substrings)-1!=e.indexOf(SlimStat._plugins[t].substrings[a])&&n++;if(n==SlimStat._plugins[t].substrings.length)return!0}return!1},_detect_single_plugin_ie:function(t){var e="",n=!1;for(e in SlimStat._plugins[t].active_x_strings)try{new ActiveXObject(SlimStat._plugins[t].active_x_strings[e]),n=!0}catch(t){}return n},_detect_single_plugin:function(t){return navigator.plugins.length?this.detect=SlimStat._detect_single_plugin_not_ie:this.detect=SlimStat._detect_single_plugin_ie,this.detect(t)},detect_plugins:function(){var t,e=[];for(t in SlimStat._plugins)SlimStat._detect_single_plugin(t)&&e.push(t);return"function"==typeof navigator.javaEnabled&&navigator.javaEnabled()&&e.push("java"),e.join(",")},get_page_performance:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},void 0===slim_performance.timing?0:slim_performance.timing.loadEventEnd-slim_performance.timing.responseEnd},get_server_latency:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},void 0===slim_performance.timing?0:slim_performance.timing.responseEnd-slim_performance.timing.connectEnd},optout:function(t,e){t.preventDefault(),expiration=new Date,expiration.setTime(expiration.getTime()+31536e6),document.cookie="slimstat_optout_tracking="+e+";expires="+expiration.toGMTString(),t.target.parentNode.parentNode.removeChild(t.target.parentNode)},show_optout_message:function(){for(var t=void 0!==SlimStatParams.opt_out_cookies&&SlimStatParams.opt_out_cookies?SlimStatParams.opt_out_cookies.split(","):[],e=0<t.length,n=0;n<t.length;n++)""!=SlimStat.get_cookie(t[n])&&(e=!1);if(e&&(xhr=new XMLHttpRequest,xhr))return xhr.open("POST",SlimStatParams.ajaxurl,!0),xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.withCredentials=!0,xhr.send("action=slimstat_optout_html"),xhr.onreadystatechange=function(){4==xhr.readyState&&document.body.insertAdjacentHTML("beforeend",xhr.responseText)},!0},add_event:function(t,e,n){t&&t.addEventListener?t.addEventListener(e,n,!1):t&&t.attachEvent?(t["e"+e+n]=n,t[e+n]=function(){t["e"+e+n](window.event)},t.attachEvent("on"+e,t[e+n])):t["on"+e]=t["e"+e+n]},in_array:function(t,e){for(var n=0;n<e.length;n++)if(e[n].trim()==t)return!0;return!1},in_array_substring:function(t,e){for(var n=0;n<e.length;n++)if(-1!=t.indexOf(e[n].trim()))return!0;return!1},get_cookie:function(t){var e=("; "+document.cookie).split("; "+t+"=");return 2==e.length?e.pop().split(";").shift():""},send_to_server:function(t,e){if(void 0===SlimStatParams.ajaxurl||void 0===t)return!1;if(void 0===e&&(e=!0),slimstat_data_with_client_info=t+"&sw="+screen.width+"&sh="+screen.height+"&bw="+window.innerWidth+"&bh="+window.innerHeight+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins(),e&&navigator.sendBeacon)navigator.sendBeacon(SlimStatParams.ajaxurl,slimstat_data_with_client_info);else{try{window.XMLHttpRequest?request=new XMLHttpRequest:window.ActiveXObject&&(request=new ActiveXObject("Microsoft.XMLHTTP"))}catch(t){return!1}if(request)return request.open("POST",SlimStatParams.ajaxurl,!0),request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),request.setRequestHeader("X-Requested-With","XMLHttpRequest"),request.withCredentials=!0,request.send(slimstat_data_with_client_info),request.onreadystatechange=function(){4==request.readyState&&(parsed_id=parseInt(request.responseText),!isNaN(parsed_id)&&0<parsed_id&&(SlimStat._id=request.responseText))},!0}return!1},ss_track:function(t,e,n,i){if(t=t||window.event,e=void 0===e?0:parseInt(e),note_array=[],void 0===i&&(i=!0),parsed_id=parseInt(SlimStat._id),isNaN(parsed_id)||parsed_id<=0)return!1;if(node=void 0!==t.target?t.target:void 0!==t.srcElement&&t.srcElement,!node)return!1;switch(3==node.nodeType&&(node=node.parentNode),parent_node=node.parentNode,resource_url="",node.nodeName){case"FORM":void 0!==node.action&&node.action&&(resource_url=node.action);break;case"INPUT":for(;"undefined"!=typeof parent_node&&"FORM"!=parent_node.nodeName&&"BODY"!=parent_node.nodeName;)parent_node=parent_node.parentNode;if(void 0!==parent_node.action&&parent_node.action){resource_url=parent_node.action;break}default:if("A"!=node.nodeName)for(;void 0!==node.parentNode&&null!=node.parentNode&&"A"!=node.nodeName&&"BODY"!=node.nodeName;)node=node.parentNode;void 0!==node.hash&&node.hash&&node.hostname==location.hostname?resource_url=node.hash:void 0!==node.href&&-1==node.href.indexOf("javascript:")&&(resource_url=node.href),"function"==typeof node.getAttribute&&(void 0!==node.getAttribute("title")&&node.getAttribute("title")&&note_array.push("Title:"+node.getAttribute("title")),void 0!==node.getAttribute("id")&&node.getAttribute("id")&&note_array.push("ID:"+node.getAttribute("id")))}return pos_x=-1,pos_y=-1,position="",void 0!==t.pageX&&void 0!==t.pageY?(pos_x=t.pageX,pos_y=t.pageY):void 0!==t.clientX&&void 0!==t.clientY&&void 0!==document.body.scrollLeft&&void 0!==document.documentElement.scrollLeft&&void 0!==document.body.scrollTop&&void 0!==document.documentElement.scrollTop&&(pos_x=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,pos_y=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),0<pos_x&&0<pos_y&&(position=pos_x+","+pos_y),void 0!==t.type&&(event_description=t.type,"keypress"==t.type?event_description+="; keypress:"+String.fromCharCode(parseInt(t.which)):"click"==t.type&&(event_description+="; which:"+t.which)),void 0!==n&&n&&note_array.push(n),note_string=SlimStat._base64_encode(note_array.join(", ")),requested_op="add",1==e?resource_url=resource_url.substring(resource_url.indexOf(location.hostname)+location.hostname.length):requested_op=0==e||2==e?"update":"event",SlimStat.send_to_server("action=slimtrack&op="+requested_op+"&id="+SlimStat._id+"&ty="+e+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(resource_url)+"&pos="+position+"&des="+SlimStat._base64_encode(event_description)+"&no="+note_string,i),!0},attach_tracker:function(){all_links=document.getElementsByTagName("a");for(var t=void 0!==SlimStatParams.extensions_to_track&&SlimStatParams.extensions_to_track?SlimStatParams.extensions_to_track.split(","):[],e=void 0!==SlimStatParams.outbound_classes_rel_href_to_not_track&&SlimStatParams.outbound_classes_rel_href_to_not_track?SlimStatParams.outbound_classes_rel_href_to_not_track.split(","):[],n=0;n<all_links.length;n++){if(linktype=all_links[n].href&&(all_links[n].hostname==location.hostname||-1==all_links[n].href.indexOf("://"))||-1==all_links[n].href.indexOf("javascript:")?2:0,tracking=1,0<e.length){if(1==tracking){classes_current_link=void 0!==all_links[n].className&&all_links[n].className?all_links[n].className.split(" "):[];for(var i=0;i<classes_current_link.length;i++)if(SlimStat.in_array_substring(classes_current_link[i],e)){tracking=0;break}}1==tracking&&void 0!==all_links[n].attributes.rel&&all_links[n].attributes.rel.value&&SlimStat.in_array_substring(all_links[n].attributes.rel.value,e)&&(tracking=0),1==tracking&&void 0!==all_links[n].href&&all_links[n].href&&SlimStat.in_array_substring(all_links[n].href,e)&&(tracking=0)}extension_current_link=all_links[n].pathname.split(/[?#]/)[0].split(".").pop().replace(/[\/\-]/g,""),2==linktype&&0<t.length&&SlimStat.in_array(extension_current_link,t)&&(tracking=1,linktype=1),all_links[n].setAttribute("data-slimstat",(linktype<<1)+tracking),SlimStat.add_event(all_links[n],"click",function(t){link_info=parseInt(this.getAttribute("data-slimstat")),isNaN(link_info)&&(link_info=0),!0&link_info&&SlimStat.ss_track(t,link_info>>1,"")})}}};"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),SlimStat.add_event(window,"load",function(){SlimStat.attach_tracker(),SlimStat.show_optout_message()});var slimstat_data="",use_beacon=!0;void 0!==SlimStatParams.id&&0<parseInt(SlimStatParams.id)?slimstat_data="action=slimtrack&op=update&id="+SlimStatParams.id:void 0!==SlimStatParams.ci&&(slimstat_data="action=slimtrack&op=add&id="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href),use_beacon=!1),0<slimstat_data.length&&SlimStat.add_event(window,"load",function(){setTimeout(function(){SlimStat.send_to_server(slimstat_data,"")},0)});
wp-slimstat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
- Version: 4.7.8.2
7
  Author: Jason Crouse
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
@@ -15,7 +15,7 @@ if ( !empty( wp_slimstat::$settings ) ) {
15
  }
16
 
17
  class wp_slimstat {
18
- public static $version = '4.7.8.2';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
@@ -286,9 +286,9 @@ class wp_slimstat {
286
  $opt_out_cookie_names = self::string_to_array( self::$settings[ 'opt_out_cookie_names' ] );
287
 
288
  foreach ( $opt_out_cookie_names as $a_cookie_pair ) {
289
- list( $name, $value ) = explode( '=', $a_cookie_pair );
290
 
291
- if ( !empty( $name ) && !empty( $value ) ) {
292
  $cookie_names[ $name ] = $value;
293
  }
294
  }
@@ -1659,7 +1659,7 @@ class wp_slimstat {
1659
 
1660
  // Tracker
1661
  'anonymize_ip' => 'no',
1662
- 'honor_dnt_header' => 'yes',
1663
  'set_tracker_cookie' => 'on',
1664
  'display_opt_out' => 'no',
1665
  'opt_out_message' => '<p style="display:block;position:fixed;left:0;bottom:0;margin:0;padding:1em 2em;background-color:#eee;width:100%;z-index:99999;">This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.<br><br><a href="#" onclick="javascript:SlimStat.optout(event, false);">Accept</a> or <a href="#" onclick="javascript:SlimStat.optout(event, true);">Deny</a></p>',
@@ -1796,13 +1796,16 @@ class wp_slimstat {
1796
  }
1797
 
1798
  // GDPR Compliance: test for third-party cookies to see if we need to display the opt-out message
1799
- $params[ 'opt_out_cookies' ] = array( 'slimstat_optout_tracking' );
1800
- if ( !empty( self::$settings[ 'opt_out_cookie_names' ] ) ) {
1801
- foreach( self::string_to_array( self::$settings[ 'opt_out_cookie_names' ] ) as $a_cookie_pair ) {
1802
- $params[ 'opt_out_cookies' ][] = substr( $a_cookie_pair, 0, strpos( $a_cookie_pair, '=' ) );
 
 
1803
  }
 
 
1804
  }
1805
- $params[ 'opt_out_cookies' ] = implode( ',', $params[ 'opt_out_cookies' ] );
1806
 
1807
  if ( !empty( self::$settings[ 'opt_in_cookie_names' ] ) ) {
1808
  $params[ 'opt_in_cookies' ] = array();
3
  Plugin Name: Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
+ Version: 4.7.8.3
7
  Author: Jason Crouse
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
15
  }
16
 
17
  class wp_slimstat {
18
+ public static $version = '4.7.8.3';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
286
  $opt_out_cookie_names = self::string_to_array( self::$settings[ 'opt_out_cookie_names' ] );
287
 
288
  foreach ( $opt_out_cookie_names as $a_cookie_pair ) {
289
+ $pair = explode( '=', $a_cookie_pair );
290
 
291
+ if ( !empty( $pair[ 0 ] ) && !empty( $pair[ 1 ] ) ) {
292
  $cookie_names[ $name ] = $value;
293
  }
294
  }
1659
 
1660
  // Tracker
1661
  'anonymize_ip' => 'no',
1662
+ 'honor_dnt_header' => 'on',
1663
  'set_tracker_cookie' => 'on',
1664
  'display_opt_out' => 'no',
1665
  'opt_out_message' => '<p style="display:block;position:fixed;left:0;bottom:0;margin:0;padding:1em 2em;background-color:#eee;width:100%;z-index:99999;">This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.<br><br><a href="#" onclick="javascript:SlimStat.optout(event, false);">Accept</a> or <a href="#" onclick="javascript:SlimStat.optout(event, true);">Deny</a></p>',
1796
  }
1797
 
1798
  // GDPR Compliance: test for third-party cookies to see if we need to display the opt-out message
1799
+ if ( self::$settings[ 'display_opt_out' ] == 'on' ) {
1800
+ $params[ 'opt_out_cookies' ] = array( 'slimstat_optout_tracking' );
1801
+ if ( !empty( self::$settings[ 'opt_out_cookie_names' ] ) ) {
1802
+ foreach( self::string_to_array( self::$settings[ 'opt_out_cookie_names' ] ) as $a_cookie_pair ) {
1803
+ $params[ 'opt_out_cookies' ][] = substr( $a_cookie_pair, 0, strpos( $a_cookie_pair, '=' ) );
1804
+ }
1805
  }
1806
+
1807
+ $params[ 'opt_out_cookies' ] = implode( ',', $params[ 'opt_out_cookies' ] );
1808
  }
 
1809
 
1810
  if ( !empty( self::$settings[ 'opt_in_cookie_names' ] ) ) {
1811
  $params[ 'opt_in_cookies' ] = array();