Google Analytics for WordPress by MonsterInsights - Version 6.2.1

Version Description

= 6.0.0 =

This is a major release. Please back up your site before upgrading.

Download this release

Release Info

Developer chriscct7
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 6.2.1
Comparing to
See all releases

Code changes from version 6.2.0 to 6.2.1

assets/css/admin-common.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ #toplevel_page_monsterinsights_dashboard .wp-menu-image img,
2
+ #toplevel_page_monsterinsights_settings .wp-menu-image img,
3
+ #toplevel_page_monsterinsights_network .wp-menu-image img {
4
+ width: 18px;
5
+ height: 18px;
6
+ padding-top: 7px;
7
+ }
assets/css/admin-common.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #toplevel_page_monsterinsights_dashboard .wp-menu-image img,#toplevel_page_monsterinsights_settings .wp-menu-image img,#toplevel_page_monsterinsights_network .wp-menu-image img{width:18px;height:18px;padding-top:7px}
assets/js/admin-common.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function( $ ) {
2
+ /**
3
+ * Dismissable Notices
4
+ * - Sends an AJAX request to mark the notice as dismissed
5
+ */
6
+ $( 'div.monsterinsights-notice' ).on( 'click', 'button.notice-dismiss', function( e ) {
7
+ e.preventDefault();
8
+ $( this ).closest( 'div.monsterinsights-notice' ).fadeOut();
9
+
10
+ // If this is a dismissible notice, it means we need to send an AJAX request
11
+ if ( $( this ).parent().hasClass( 'is-dismissible' ) ) {
12
+ $.post(
13
+ monsterinsights_admin_common.ajax,
14
+ {
15
+ action: 'monsterinsights_ajax_dismiss_notice',
16
+ nonce: monsterinsights_admin_common.dismiss_notice_nonce,
17
+ notice: $( this ).parent().data( 'notice' )
18
+ },
19
+ function( response ) {},
20
+ 'json'
21
+ );
22
+ }
23
+
24
+ } );
25
+ });
assets/js/admin-common.min.js ADDED
@@ -0,0 +1 @@
 
1
+ ;jQuery(document).ready(function(i){i('div.monsterinsights-notice').on('click','button.notice-dismiss',function(n){n.preventDefault();i(this).closest('div.monsterinsights-notice').fadeOut();if(i(this).parent().hasClass('is-dismissible')){i.post(monsterinsights_admin_common.ajax,{action:'monsterinsights_ajax_dismiss_notice',nonce:monsterinsights_admin_common.dismiss_notice_nonce,notice:i(this).parent().data('notice')},function(i){},'json')}})});
assets/js/admin.js CHANGED
@@ -106,31 +106,6 @@ jQuery( document ).ready( function( $ ) {
106
  });
107
  }
108
 
109
- /**
110
- * Dismissable Notices
111
- * - Sends an AJAX request to mark the notice as dismissed
112
- */
113
- $( 'div.monsterinsights-notice' ).on( 'click', '.notice-dismiss', function( e ) {
114
- e.preventDefault();
115
- $( this ).closest( 'div.monsterinsights-notice' ).fadeOut();
116
-
117
- // If this is a dismissible notice, it means we need to send an AJAX request
118
- if ( $( this ).hasClass( 'is-dismissible' ) ) {
119
- $.post(
120
- monsterinsights_admin.ajax,
121
- {
122
- action: 'monsterinsights_ajax_dismiss_notice',
123
- nonce: monsterinsights_admin.dismiss_notice_nonce,
124
- notice: $( this ).parent().data( 'notice' )
125
- },
126
- function( response ) {
127
- },
128
- 'json'
129
- );
130
- }
131
-
132
- } );
133
-
134
  function modelMatcher(params, data) {
135
  data.parentText = data.parentText || "";
136
 
@@ -891,7 +866,7 @@ function monsterinsights_popupwindow(url, w, h) {
891
  monsterinsights_closepopupwindow();
892
  var left = (screen.width/2)-(w/2);
893
  var top = (screen.height/8);
894
- monsterinsights_authwindow = window.open(url, 'monsterinsights_ga_auth_window', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
895
  }
896
 
897
  function monsterinsights_closepopupwindow() {
106
  });
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  function modelMatcher(params, data) {
110
  data.parentText = data.parentText || "";
111
 
866
  monsterinsights_closepopupwindow();
867
  var left = (screen.width/2)-(w/2);
868
  var top = (screen.height/8);
869
+ monsterinsights_authwindow = window.open(url, 'monsterinsights_ga_auth_window', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
870
  }
871
 
872
  function monsterinsights_closepopupwindow() {
assets/js/admin.min.js CHANGED
@@ -1,6 +1,6 @@
1
  (function(){var n,s,t=[];window.onerror=function(n,i,e){if(!document.getElementById('monsterinsights-ublock-origin-error'))t[t.length]=[n,i,e];else s(n,i,e)};jQuery(document).ready(function(){for(err in t)s(t[err][0],t[err][1],t[err][2])});s=function(t,s,i){var e,o,r,a;if(!n)n=document.getElementById('monsterinsights-ublock-origin-error');if(!n)return;e=document.createElement('li');e.className='debug-bar-js-error';e.textContent=t+' on ';o=document.createElement('span');o.textContent=s+' line '+i;e.appendChild(o);n.appendChild(e)}})();jQuery(document).ready(function(t){t('#screen-meta-links').prependTo('#monsterinsights-header-temp');t('#screen-meta').prependTo('#monsterinsights-header-temp');t('.monsterinsights-help-tip').tooltip({content:function(){return t(this).prop('title')},tooltipClass:'monsterinsights-ui-tooltip',position:{my:'center top',at:'center bottom+10',collision:'flipfit',},hide:{duration:200,},show:{duration:200,},});if(typeof Clipboard!=='undefined'){var o=new Clipboard('.monsterinsights-copy-to-clipboard');t(document).on('click','.monsterinsights-copy-to-clipboard',function(t){t.preventDefault()});function l(t){var n='',s=(t==='cut'?'X':'C');if(/iPhone|iPad/i.test(navigator.userAgent)){n='No support :('}
2
  else if(/Mac/i.test(navigator.userAgent)){n='Press ⌘-'+s+' to '+t}
3
- else{n='Press Ctrl-'+s+' to '+t};return n};o.on('success',function(t){t.trigger.textContent=monsterinsights_admin.copied;window.setTimeout(function(){t.trigger.textContent=monsterinsights_admin.copytoclip},2000)});o.on('error',function(t){t.trigger.textContent=l(t.action)})};t('div.monsterinsights-notice').on('click','.notice-dismiss',function(n){n.preventDefault();t(this).closest('div.monsterinsights-notice').fadeOut();if(t(this).hasClass('is-dismissible')){t.post(monsterinsights_admin.ajax,{action:'monsterinsights_ajax_dismiss_notice',nonce:monsterinsights_admin.dismiss_notice_nonce,notice:t(this).parent().data('notice')},function(t){},'json')}});function s(n,i){i.parentText=i.parentText||'';if(t.trim(n.term)===''){return i};if(i.children&&i.children.length>0){var o=t.extend(!0,{},i);for(var e=i.children.length-1;e>=0;e--){var r=i.children[e];r.parentText+=i.parentText+' '+i.text;var l=s(n,r);if(l==null){o.children.splice(e,1)}};if(o.children.length>0){return o};return s(n,o)};var a=(i.parentText+' '+i.text).toUpperCase(),d=n.term.toUpperCase();if(a.indexOf(d)>-1){return i};return null};t('.monsterinsights-select300').select300();var n=!1;t(document).on('change','#monsterinsights-settings :input',function(){n=!0});t(document).on('click','a:not(.monsterinsights-settings-click-excluded)',function(t){if(n){var s=confirm(monsterinsights_admin.settings_changed_confirm);if(s){n=!1;return!0}
4
  else{t.preventDefault();return!1}}});t('#monsterinsights-google-authenticate-submit').on('click',function(n){n.preventDefault();t('<div id="monsterinsights_google_auth_view" class="monsterinsights-hideme"></div>').prependTo('body');t('<div id="monsterinsights_google_auth_block_view" class="monsterinsights-hideme"></div>').prependTo('body');var s={'action':'monsterinsights_google_view','view':'prestart','reauth':!1};jQuery.post(ajaxurl,s,function(n){t('#monsterinsights_google_auth_view').html(n);t('#monsterinsights_google_auth_view').removeClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').removeClass('monsterinsights-hideme');t('#wpadminbar').addClass('monsterinsights-hideme');document.body.style.overflowY='hidden';document.body.style.overflowX='hidden';window.scrollTo(0,0);t('#adminmenumain').addClass('monsterinsights_opacity_60')}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t('#monsterinsights-google-reauthenticate-submit').on('click',function(n){n.preventDefault();t('<div id="monsterinsights_google_auth_view" class="monsterinsights_google_auth_reauth monsterinsights-hideme"></div>').prependTo('body');t('<div id="monsterinsights_google_auth_block_view" class="monsterinsights-hideme"></div>').prependTo('body');var s={'action':'monsterinsights_google_view','view':'prestart','reauth':!0};jQuery.post(ajaxurl,s,function(n){t('#monsterinsights_google_auth_view').html(n);t('#monsterinsights_google_auth_view').removeClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').removeClass('monsterinsights-hideme');t('#wpadminbar').addClass('monsterinsights-hideme');document.body.style.overflowY='hidden';document.body.style.overflowX='hidden';window.scrollTo(0,0);t('#adminmenumain').addClass('monsterinsights_opacity_60')}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t(document).on('click','#monsterinsights_google_auth_box_next',function(n){n.preventDefault();var i='';if(document.getElementById('monsterinsights_step_data')!=null){i=document.getElementById('monsterinsights_step_data').value};var e={'action':'monsterinsights_google_view','view':document.getElementById('monsterinsightsview').value,'reauth':document.getElementById('monsterinsightsreauth').value,'stepdata':i,};t('#monsterinsights_google_auth_box_footer').html('<div class="monsterinsights-google-loading">'+monsterinsights_admin.loadingtext+'</div>');t('.monsterinsights_google_auth_box_cancel').hide();jQuery.post(ajaxurl,e,function(n){t('#monsterinsights_google_auth_view').html(n);t('#monsterinsights_google_auth_view').removeClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').removeClass('monsterinsights-hideme');var i=document.getElementById('monsterinsightsview').value;if(i=='selectprofile'){t('.monsterinsights_select_ga_profile').select300({matcher:s});monsterinsights_closepopupwindow()}}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t(document).on('click','.monsterinsights_google_auth_box_done',function(t){t.preventDefault();location.reload()});t(document).on('click','.monsterinsights_google_auth_box_cancel_error',function(t){t.preventDefault();location.reload()});t(document).on('click','.monsterinsights_google_auth_box_cancel',function(n){n.preventDefault();var s='';if(document.getElementById('monsterinsights_step_data')!=null){s=document.getElementById('monsterinsights_step_data').value};var i={'action':'monsterinsights_google_cancel','view':document.getElementById('monsterinsightsview').value,'reauth':document.getElementById('monsterinsightsreauth').value,'stepdata':s,};jQuery.post(ajaxurl,i,function(n){document.body.style.overflowY='visible';document.body.style.overflowX='visible';t('#monsterinsights_google_auth_view').html('');t('#monsterinsights_google_auth_view').addClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').addClass('monsterinsights-hideme');t('#adminmenumain').removeClass('monsterinsights_opacity_60');t('#wpadminbar').removeClass('monsterinsights-hideme')}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t('#monsterinsights-url-builder input').keyup(r);t('#monsterinsights-url-builder input').click(r);function r(){var i=t('#monsterinsights-url-builer-domain').val().trim(),o=t('#monsterinsights-url-builer-source').val().trim(),r=t('#monsterinsights-url-builer-medium').val().trim(),a=t('#monsterinsights-url-builer-term').val().trim(),d=t('#monsterinsights-url-builer-content').val().trim(),l=t('#monsterinsights-url-builer-name').val().trim(),s=t('#monsterinsights-url-builer-fragment').is(':checked'),e=i.substring(i.lastIndexOf('/')+1);if(s&&e.length>0&&e.indexOf('#')>-1){s='&'}
5
  else if(!s&&e.length>0&&e.indexOf('?')>-1){s='&'}
6
  else{s=s?'#':'?'};var n=i+s+'utm_source='+encodeURIComponent(o);if(r){var n=n+'&utm_medium='+encodeURIComponent(r)};if(l){var n=n+'&utm_campaign='+encodeURIComponent(l)};if(a){var n=n+'&utm_term='+encodeURIComponent(a)};if(d){var n=n+'&utm_content='+encodeURIComponent(d)};if(i&&o){t('#monsterinsights-url-builer-url').html(n.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'))}
@@ -12,4 +12,4 @@ else{t(s).text(monsterinsights_admin.activate).removeClass('monsterinsights-inst
12
  else{t(s).html('<i class="monsterinsights-toggle-on"></i> '+monsterinsights_admin.activate).removeClass('monsterinsights-install-addon').addClass('monsterinsights-activate-addon')};t(s).attr('rel',n.plugin);t(o).text(monsterinsights_admin.inactive);var d=t(o),a,l,m;a=d.html().split(/\s+/);l=a.pop();m=a.join(' ');d.html([m,' <span>',l,'</span>'].join(''));t(e).removeClass('monsterinsights-addon-not-installed').addClass('monsterinsights-addon-inactive');i.next().hide()},error:function(t,n,s){i.next().hide();return}};t.ajax(a)});function m(n){if(t(n).attr('disabled')){t(n).removeAttr('disabled')};if(t(n).parent().parent().hasClass('monsterinsights-addon-not-installed')){t(n).text(monsterinsights_admin.install)}};t(function(){a(!0)});t(window).on('hashchange',function(t){t.preventDefault();a(!1)});function a(n){var e=window.location.hash,o='',m='.monsterinsights-main-nav-container',h='.monsterinsights-main-nav-tabs',a='',i='.monsterinsights-sub-nav-container',d='.monsterinsights-sub-nav-tabs',r='';if(e.indexOf('#')>-1){if(e.indexOf('?')<1){o=e;var s=t(i);if('0' in s&&'firstElementChild' in s[0]&&'hash' in s[0].firstElementChild){a=s[0].firstElementChild.hash;r='#'+(s[0].firstElementChild.hash).split('?')[1]}}
13
  else{var l=e.split('?');o=l[0];a=e;r='#'+l[1]};t(m).find('.monsterinsights-active').removeClass('monsterinsights-active');t(h).find('.monsterinsights-active').removeClass('monsterinsights-active');t(i).find('.monsterinsights-active').removeClass('monsterinsights-active');t(d).find('.monsterinsights-active').removeClass('monsterinsights-active');t(m).find('a[href="'+o+'"]').addClass('monsterinsights-active');t(h).find(o).addClass('monsterinsights-active');if(t(i).find('a[href="'+a+'"]').length==1){t(i).find('a[href="'+a+'"]').addClass('monsterinsights-active');t(d).find(r).addClass('monsterinsights-active')}
14
  else{var s=t(i);if('0' in s&&'firstElementChild' in s[0]&&'hash' in s[0].firstElementChild){t(i).find('a[href="#'+(s[0].firstElementChild.hash).split('?')[1]+'"]').addClass('monsterinsights-active');t(d).find('#'+(s[0].firstElementChild.hash).split('?')[1]).addClass('monsterinsights-active')}};if(t('.monsterinsights-main-nav-tabs .monsterinsights-main-nav-tab:not(".monsterinsights-active") .monsterinsights-tab-settings-notices .monsterinsights-notice').length>0){t('.monsterinsights-main-nav-tabs .monsterinsights-main-nav-tab:not(".monsterinsights-active") .monsterinsights-tab-settings-notices .monsterinsights-notice').remove()};if(t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab:not("'+r+'") .monsterinsights-subtab-settings-notices .monsterinsights-notice').length>0){t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab:not("'+r+'") .monsterinsights-subtab-settings-notices .monsterinsights-notice').remove()};if(o!=='#monsterinsights-main-tab-tracking'){if(t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab .monsterinsights-subtab-settings-notices .monsterinsights-notice').length>0){t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab .monsterinsights-subtab-settings-notices .monsterinsights-notice').remove()}};if(t(window).height()>t('#adminmenuwrap').height()){t('#adminmenuwrap').css('position','fixed')}
15
- else{t('#adminmenuwrap').css('position','relative')}}}});function monsterinsights_popupwindow(t,n,s){'use strict';monsterinsights_closepopupwindow();var i=(screen.width/2)-(n/2),e=(screen.height/8);monsterinsights_authwindow=window.open(t,'monsterinsights_ga_auth_window','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+n+', height='+s+', top='+e+', left='+i)};function monsterinsights_closepopupwindow(){if(monsterinsights_authwindow){monsterinsights_authwindow.close()}};function monsterinsights_show_manual(){document.getElementById('monsterinsights-google-ua-box').className=''};var uorigindetected='no',monsterinsights_authwindow;
1
  (function(){var n,s,t=[];window.onerror=function(n,i,e){if(!document.getElementById('monsterinsights-ublock-origin-error'))t[t.length]=[n,i,e];else s(n,i,e)};jQuery(document).ready(function(){for(err in t)s(t[err][0],t[err][1],t[err][2])});s=function(t,s,i){var e,o,r,a;if(!n)n=document.getElementById('monsterinsights-ublock-origin-error');if(!n)return;e=document.createElement('li');e.className='debug-bar-js-error';e.textContent=t+' on ';o=document.createElement('span');o.textContent=s+' line '+i;e.appendChild(o);n.appendChild(e)}})();jQuery(document).ready(function(t){t('#screen-meta-links').prependTo('#monsterinsights-header-temp');t('#screen-meta').prependTo('#monsterinsights-header-temp');t('.monsterinsights-help-tip').tooltip({content:function(){return t(this).prop('title')},tooltipClass:'monsterinsights-ui-tooltip',position:{my:'center top',at:'center bottom+10',collision:'flipfit',},hide:{duration:200,},show:{duration:200,},});if(typeof Clipboard!=='undefined'){var o=new Clipboard('.monsterinsights-copy-to-clipboard');t(document).on('click','.monsterinsights-copy-to-clipboard',function(t){t.preventDefault()});function l(t){var n='',s=(t==='cut'?'X':'C');if(/iPhone|iPad/i.test(navigator.userAgent)){n='No support :('}
2
  else if(/Mac/i.test(navigator.userAgent)){n='Press ⌘-'+s+' to '+t}
3
+ else{n='Press Ctrl-'+s+' to '+t};return n};o.on('success',function(t){t.trigger.textContent=monsterinsights_admin.copied;window.setTimeout(function(){t.trigger.textContent=monsterinsights_admin.copytoclip},2000)});o.on('error',function(t){t.trigger.textContent=l(t.action)})};function s(n,i){i.parentText=i.parentText||'';if(t.trim(n.term)===''){return i};if(i.children&&i.children.length>0){var o=t.extend(!0,{},i);for(var e=i.children.length-1;e>=0;e--){var r=i.children[e];r.parentText+=i.parentText+' '+i.text;var l=s(n,r);if(l==null){o.children.splice(e,1)}};if(o.children.length>0){return o};return s(n,o)};var a=(i.parentText+' '+i.text).toUpperCase(),d=n.term.toUpperCase();if(a.indexOf(d)>-1){return i};return null};t('.monsterinsights-select300').select300();var n=!1;t(document).on('change','#monsterinsights-settings :input',function(){n=!0});t(document).on('click','a:not(.monsterinsights-settings-click-excluded)',function(t){if(n){var s=confirm(monsterinsights_admin.settings_changed_confirm);if(s){n=!1;return!0}
4
  else{t.preventDefault();return!1}}});t('#monsterinsights-google-authenticate-submit').on('click',function(n){n.preventDefault();t('<div id="monsterinsights_google_auth_view" class="monsterinsights-hideme"></div>').prependTo('body');t('<div id="monsterinsights_google_auth_block_view" class="monsterinsights-hideme"></div>').prependTo('body');var s={'action':'monsterinsights_google_view','view':'prestart','reauth':!1};jQuery.post(ajaxurl,s,function(n){t('#monsterinsights_google_auth_view').html(n);t('#monsterinsights_google_auth_view').removeClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').removeClass('monsterinsights-hideme');t('#wpadminbar').addClass('monsterinsights-hideme');document.body.style.overflowY='hidden';document.body.style.overflowX='hidden';window.scrollTo(0,0);t('#adminmenumain').addClass('monsterinsights_opacity_60')}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t('#monsterinsights-google-reauthenticate-submit').on('click',function(n){n.preventDefault();t('<div id="monsterinsights_google_auth_view" class="monsterinsights_google_auth_reauth monsterinsights-hideme"></div>').prependTo('body');t('<div id="monsterinsights_google_auth_block_view" class="monsterinsights-hideme"></div>').prependTo('body');var s={'action':'monsterinsights_google_view','view':'prestart','reauth':!0};jQuery.post(ajaxurl,s,function(n){t('#monsterinsights_google_auth_view').html(n);t('#monsterinsights_google_auth_view').removeClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').removeClass('monsterinsights-hideme');t('#wpadminbar').addClass('monsterinsights-hideme');document.body.style.overflowY='hidden';document.body.style.overflowX='hidden';window.scrollTo(0,0);t('#adminmenumain').addClass('monsterinsights_opacity_60')}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t(document).on('click','#monsterinsights_google_auth_box_next',function(n){n.preventDefault();var i='';if(document.getElementById('monsterinsights_step_data')!=null){i=document.getElementById('monsterinsights_step_data').value};var e={'action':'monsterinsights_google_view','view':document.getElementById('monsterinsightsview').value,'reauth':document.getElementById('monsterinsightsreauth').value,'stepdata':i,};t('#monsterinsights_google_auth_box_footer').html('<div class="monsterinsights-google-loading">'+monsterinsights_admin.loadingtext+'</div>');t('.monsterinsights_google_auth_box_cancel').hide();jQuery.post(ajaxurl,e,function(n){t('#monsterinsights_google_auth_view').html(n);t('#monsterinsights_google_auth_view').removeClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').removeClass('monsterinsights-hideme');var i=document.getElementById('monsterinsightsview').value;if(i=='selectprofile'){t('.monsterinsights_select_ga_profile').select300({matcher:s});monsterinsights_closepopupwindow()}}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t(document).on('click','.monsterinsights_google_auth_box_done',function(t){t.preventDefault();location.reload()});t(document).on('click','.monsterinsights_google_auth_box_cancel_error',function(t){t.preventDefault();location.reload()});t(document).on('click','.monsterinsights_google_auth_box_cancel',function(n){n.preventDefault();var s='';if(document.getElementById('monsterinsights_step_data')!=null){s=document.getElementById('monsterinsights_step_data').value};var i={'action':'monsterinsights_google_cancel','view':document.getElementById('monsterinsightsview').value,'reauth':document.getElementById('monsterinsightsreauth').value,'stepdata':s,};jQuery.post(ajaxurl,i,function(n){document.body.style.overflowY='visible';document.body.style.overflowX='visible';t('#monsterinsights_google_auth_view').html('');t('#monsterinsights_google_auth_view').addClass('monsterinsights-hideme');t('#monsterinsights_google_auth_block_view').addClass('monsterinsights-hideme');t('#adminmenumain').removeClass('monsterinsights_opacity_60');t('#wpadminbar').removeClass('monsterinsights-hideme')}).fail(function(n,s,i){var e=t(n.responseText).text();e=e.substring(0,e.indexOf('Call Stack'));console.log(e)})});t('#monsterinsights-url-builder input').keyup(r);t('#monsterinsights-url-builder input').click(r);function r(){var i=t('#monsterinsights-url-builer-domain').val().trim(),o=t('#monsterinsights-url-builer-source').val().trim(),r=t('#monsterinsights-url-builer-medium').val().trim(),a=t('#monsterinsights-url-builer-term').val().trim(),d=t('#monsterinsights-url-builer-content').val().trim(),l=t('#monsterinsights-url-builer-name').val().trim(),s=t('#monsterinsights-url-builer-fragment').is(':checked'),e=i.substring(i.lastIndexOf('/')+1);if(s&&e.length>0&&e.indexOf('#')>-1){s='&'}
5
  else if(!s&&e.length>0&&e.indexOf('?')>-1){s='&'}
6
  else{s=s?'#':'?'};var n=i+s+'utm_source='+encodeURIComponent(o);if(r){var n=n+'&utm_medium='+encodeURIComponent(r)};if(l){var n=n+'&utm_campaign='+encodeURIComponent(l)};if(a){var n=n+'&utm_term='+encodeURIComponent(a)};if(d){var n=n+'&utm_content='+encodeURIComponent(d)};if(i&&o){t('#monsterinsights-url-builer-url').html(n.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'))}
12
  else{t(s).html('<i class="monsterinsights-toggle-on"></i> '+monsterinsights_admin.activate).removeClass('monsterinsights-install-addon').addClass('monsterinsights-activate-addon')};t(s).attr('rel',n.plugin);t(o).text(monsterinsights_admin.inactive);var d=t(o),a,l,m;a=d.html().split(/\s+/);l=a.pop();m=a.join(' ');d.html([m,' <span>',l,'</span>'].join(''));t(e).removeClass('monsterinsights-addon-not-installed').addClass('monsterinsights-addon-inactive');i.next().hide()},error:function(t,n,s){i.next().hide();return}};t.ajax(a)});function m(n){if(t(n).attr('disabled')){t(n).removeAttr('disabled')};if(t(n).parent().parent().hasClass('monsterinsights-addon-not-installed')){t(n).text(monsterinsights_admin.install)}};t(function(){a(!0)});t(window).on('hashchange',function(t){t.preventDefault();a(!1)});function a(n){var e=window.location.hash,o='',m='.monsterinsights-main-nav-container',h='.monsterinsights-main-nav-tabs',a='',i='.monsterinsights-sub-nav-container',d='.monsterinsights-sub-nav-tabs',r='';if(e.indexOf('#')>-1){if(e.indexOf('?')<1){o=e;var s=t(i);if('0' in s&&'firstElementChild' in s[0]&&'hash' in s[0].firstElementChild){a=s[0].firstElementChild.hash;r='#'+(s[0].firstElementChild.hash).split('?')[1]}}
13
  else{var l=e.split('?');o=l[0];a=e;r='#'+l[1]};t(m).find('.monsterinsights-active').removeClass('monsterinsights-active');t(h).find('.monsterinsights-active').removeClass('monsterinsights-active');t(i).find('.monsterinsights-active').removeClass('monsterinsights-active');t(d).find('.monsterinsights-active').removeClass('monsterinsights-active');t(m).find('a[href="'+o+'"]').addClass('monsterinsights-active');t(h).find(o).addClass('monsterinsights-active');if(t(i).find('a[href="'+a+'"]').length==1){t(i).find('a[href="'+a+'"]').addClass('monsterinsights-active');t(d).find(r).addClass('monsterinsights-active')}
14
  else{var s=t(i);if('0' in s&&'firstElementChild' in s[0]&&'hash' in s[0].firstElementChild){t(i).find('a[href="#'+(s[0].firstElementChild.hash).split('?')[1]+'"]').addClass('monsterinsights-active');t(d).find('#'+(s[0].firstElementChild.hash).split('?')[1]).addClass('monsterinsights-active')}};if(t('.monsterinsights-main-nav-tabs .monsterinsights-main-nav-tab:not(".monsterinsights-active") .monsterinsights-tab-settings-notices .monsterinsights-notice').length>0){t('.monsterinsights-main-nav-tabs .monsterinsights-main-nav-tab:not(".monsterinsights-active") .monsterinsights-tab-settings-notices .monsterinsights-notice').remove()};if(t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab:not("'+r+'") .monsterinsights-subtab-settings-notices .monsterinsights-notice').length>0){t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab:not("'+r+'") .monsterinsights-subtab-settings-notices .monsterinsights-notice').remove()};if(o!=='#monsterinsights-main-tab-tracking'){if(t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab .monsterinsights-subtab-settings-notices .monsterinsights-notice').length>0){t('.monsterinsights-sub-nav-tabs .monsterinsights-sub-nav-tab .monsterinsights-subtab-settings-notices .monsterinsights-notice').remove()}};if(t(window).height()>t('#adminmenuwrap').height()){t('#adminmenuwrap').css('position','fixed')}
15
+ else{t('#adminmenuwrap').css('position','relative')}}}});function monsterinsights_popupwindow(t,n,s){'use strict';monsterinsights_closepopupwindow();var i=(screen.width/2)-(n/2),e=(screen.height/8);monsterinsights_authwindow=window.open(t,'monsterinsights_ga_auth_window','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+n+', height='+s+', top='+e+', left='+i)};function monsterinsights_closepopupwindow(){if(monsterinsights_authwindow){monsterinsights_authwindow.close()}};function monsterinsights_show_manual(){document.getElementById('monsterinsights-google-ua-box').className=''};var uorigindetected='no',monsterinsights_authwindow;
assets/lib/pandora/class-am-deactivation-survey.php ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'AM_Deactivation_Survey' ) ) {
3
+ /**
4
+ * Awesome Motive Deactivation Survey.
5
+ *
6
+ * This prompts the user for more details when they deactivate the plugin.
7
+ *
8
+ * @version 1.1.0
9
+ * @package AwesomeMotive
10
+ * @author Jared Atchison
11
+ * @license GPL-2.0+
12
+ * @copyright Copyright (c) 2017
13
+ */
14
+ class AM_Deactivation_Survey {
15
+
16
+ /**
17
+ * The API URL we are calling.
18
+ *
19
+ * @since 1.0.0
20
+ * @var string
21
+ */
22
+ public $api_url = 'https://api.awesomemotive.com/v1/deactivation-survey/';
23
+
24
+ /**
25
+ * Name for this plugin.
26
+ *
27
+ * @since 1.0.0
28
+ * @var string
29
+ */
30
+ public $name;
31
+
32
+ /**
33
+ * Unique slug for this plugin.
34
+ *
35
+ * @since 1.0.0
36
+ * @var string
37
+ */
38
+ public $plugin;
39
+
40
+ /**
41
+ * Primary class constructor.
42
+ *
43
+ * @since 1.0.0
44
+ * @param string $name Plugin name.
45
+ * @param string $plugin Plugin slug.
46
+ */
47
+ public function __construct( $name = '', $plugin = '' ) {
48
+
49
+ $this->name = $name;
50
+ $this->plugin = $plugin;
51
+
52
+ add_action( 'admin_print_scripts', array( $this, 'js' ), 20 );
53
+ add_action( 'admin_print_scripts', array( $this, 'css' ) );
54
+ add_action( 'admin_footer', array( $this, 'modal' ) );
55
+ }
56
+
57
+ /**
58
+ * Checks if current admin screen is the plugins page.
59
+ *
60
+ * @since 1.0.0
61
+ * @return bool
62
+ */
63
+ public function is_plugin_page() {
64
+
65
+ return ( in_array( get_current_screen()->id, array( 'plugins', 'plugins-network' ), true ) );
66
+ }
67
+
68
+ /**
69
+ * Survey javascript.
70
+ *
71
+ * @since 1.0.0
72
+ */
73
+ public function js() {
74
+
75
+ if ( ! $this->is_plugin_page() ) {
76
+ return;
77
+ }
78
+ ?>
79
+ <script type="text/javascript">
80
+ jQuery(function($){
81
+ var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
82
+ $overlay = $('#am-deactivate-survey-<?php echo $this->plugin; ?>'),
83
+ $form = $overlay.find('form'),
84
+ formOpen = false;
85
+ // Plugin listing table deactivate link.
86
+ $deactivateLink.on('click', function(event) {
87
+ event.preventDefault();
88
+ $overlay.css('display', 'table');
89
+ formOpen = true;
90
+ $form.find('.am-deactivate-survey-option:first-of-type input[type=radio]').focus();
91
+ });
92
+ // Survey radio option selected.
93
+ $form.on('change', 'input[type=radio]', function(event) {
94
+ event.preventDefault();
95
+ $form.find('input[type=text], .error').hide();
96
+ $form.find('.am-deactivate-survey-option').removeClass('selected');
97
+ $(this).closest('.am-deactivate-survey-option').addClass('selected').find('input[type=text]').show();
98
+ });
99
+ // Survey Skip & Deactivate.
100
+ $form.on('click', '.am-deactivate-survey-deactivate', function(event) {
101
+ event.preventDefault();
102
+ location.href = $deactivateLink.attr('href');
103
+ });
104
+ // Survey submit.
105
+ $form.submit(function(event) {
106
+ event.preventDefault();
107
+ if (! $form.find('input[type=radio]:checked').val()) {
108
+ $form.find('.am-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option', 'google-analytics-for-wordpress' ) ); ?></span>');
109
+ return;
110
+ }
111
+ var data = {
112
+ code: $form.find('.selected input[type=radio]').val(),
113
+ reason: $form.find('.selected .am-deactivate-survey-option-reason').text(),
114
+ details: $form.find('.selected input[type=text]').val(),
115
+ site: '<?php echo esc_url( home_url() ); ?>',
116
+ plugin: '<?php echo sanitize_key( $this->name ); ?>'
117
+ }
118
+ var submitSurvey = $.post('<?php echo $this->api_url; ?>', data);
119
+ submitSurvey.always(function() {
120
+ location.href = $deactivateLink.attr('href');
121
+ });
122
+ });
123
+ // Exit key closes survey when open.
124
+ $(document).keyup(function(event) {
125
+ if (27 === event.keyCode && formOpen) {
126
+ $overlay.hide();
127
+ formOpen = false;
128
+ $deactivateLink.focus();
129
+ }
130
+ });
131
+ });
132
+ </script>
133
+ <?php
134
+ }
135
+
136
+ /**
137
+ * Survey CSS.
138
+ *
139
+ * @since 1.0.0
140
+ */
141
+ public function css() {
142
+
143
+ if ( ! $this->is_plugin_page() ) {
144
+ return;
145
+ }
146
+ ?>
147
+ <style type="text/css">
148
+ .am-deactivate-survey-modal {
149
+ display: none;
150
+ table-layout: fixed;
151
+ position: fixed;
152
+ z-index: 9999;
153
+ width: 100%;
154
+ height: 100%;
155
+ text-align: center;
156
+ font-size: 14px;
157
+ top: 0;
158
+ left: 0;
159
+ background: rgba(0,0,0,0.8);
160
+ }
161
+ .am-deactivate-survey-wrap {
162
+ display: table-cell;
163
+ vertical-align: middle;
164
+ }
165
+ .am-deactivate-survey {
166
+ background-color: #fff;
167
+ max-width: 550px;
168
+ margin: 0 auto;
169
+ padding: 30px;
170
+ text-align: left;
171
+ }
172
+ .am-deactivate-survey .error {
173
+ display: block;
174
+ color: red;
175
+ margin: 0 0 10px 0;
176
+ }
177
+ .am-deactivate-survey-title {
178
+ display: block;
179
+ font-size: 18px;
180
+ font-weight: 700;
181
+ text-transform: uppercase;
182
+ border-bottom: 1px solid #ddd;
183
+ padding: 0 0 18px 0;
184
+ margin: 0 0 18px 0;
185
+ }
186
+ .am-deactivate-survey-title span {
187
+ color: #999;
188
+ margin-right: 10px;
189
+ }
190
+ .am-deactivate-survey-desc {
191
+ display: block;
192
+ font-weight: 600;
193
+ margin: 0 0 18px 0;
194
+ }
195
+ .am-deactivate-survey-option {
196
+ margin: 0 0 10px 0;
197
+ }
198
+ .am-deactivate-survey-option-input {
199
+ margin-right: 10px !important;
200
+ }
201
+ .am-deactivate-survey-option-details {
202
+ display: none;
203
+ width: 90%;
204
+ margin: 10px 0 0 30px;
205
+ }
206
+ .am-deactivate-survey-footer {
207
+ margin-top: 18px;
208
+ }
209
+ .am-deactivate-survey-deactivate {
210
+ float: right;
211
+ font-size: 13px;
212
+ color: #ccc;
213
+ text-decoration: none;
214
+ padding-top: 7px;
215
+ }
216
+ </style>
217
+ <?php
218
+ }
219
+
220
+ /**
221
+ * Survey modal.
222
+ *
223
+ * @since 1.0.0
224
+ */
225
+ public function modal() {
226
+
227
+ if ( ! $this->is_plugin_page() ) {
228
+ return;
229
+ }
230
+
231
+ $options = array(
232
+ 1 => array(
233
+ 'title' => esc_html__( 'I no longer need the plugin', 'google-analytics-for-wordpress' ),
234
+ ),
235
+ 2 => array(
236
+ 'title' => esc_html__( 'I\'m switching to a different plugin', 'google-analytics-for-wordpress' ),
237
+ 'details' => esc_html__( 'Please share which plugin', 'google-analytics-for-wordpress' ),
238
+ ),
239
+ 3 => array(
240
+ 'title' => esc_html__( 'I couldn\'t get the plugin to work', 'google-analytics-for-wordpress' ),
241
+ ),
242
+ 4 => array(
243
+ 'title' => esc_html__( 'It\'s a temporary deactivation', 'google-analytics-for-wordpress' ),
244
+ ),
245
+ 5 => array(
246
+ 'title' => esc_html__( 'Other', 'google-analytics-for-wordpress' ),
247
+ 'details' => esc_html__( 'Please share the reason', 'google-analytics-for-wordpress' ),
248
+ ),
249
+ );
250
+ ?>
251
+ <div class="am-deactivate-survey-modal" id="am-deactivate-survey-<?php echo $this->plugin; ?>">
252
+ <div class="am-deactivate-survey-wrap">
253
+ <form class="am-deactivate-survey" method="post">
254
+ <span class="am-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . esc_html__( 'Quick Feedback', 'google-analytics-for-wordpress' ); ?></span>
255
+ <span class="am-deactivate-survey-desc"><?php echo sprintf( esc_html__('If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name ); ?></span>
256
+ <div class="am-deactivate-survey-options">
257
+ <?php foreach ( $options as $id => $option ) : ?>
258
+ <div class="am-deactivate-survey-option">
259
+ <label for="am-deactivate-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>" class="am-deactivate-survey-option-label">
260
+ <input id="am-deactivate-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>" class="am-deactivate-survey-option-input" type="radio" name="code" value="<?php echo $id; ?>" />
261
+ <span class="am-deactivate-survey-option-reason"><?php echo $option['title']; ?></span>
262
+ </label>
263
+ <?php if ( ! empty( $option['details'] ) ) : ?>
264
+ <input class="am-deactivate-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
265
+ <?php endif; ?>
266
+ </div>
267
+ <?php endforeach; ?>
268
+ </div>
269
+ <div class="am-deactivate-survey-footer">
270
+ <button type="submit" class="am-deactivate-survey-submit button button-primary button-large"><?php echo sprintf( esc_html__('Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' ); ?></button>
271
+ <a href="#" class="am-deactivate-survey-deactivate"><?php echo sprintf( esc_html__('Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' ); ?></a>
272
+ </div>
273
+ </form>
274
+ </div>
275
+ </div>
276
+ <?php
277
+ }
278
+ }
279
+ } // End if().
assets/lib/pandora/class-am-notification.php ADDED
@@ -0,0 +1,353 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'AM_Notification' ) ) {
3
+ /**
4
+ * Awesome Motive Notifications
5
+ *
6
+ * This creates a custom post type (if it doesn't exist) and calls the API to
7
+ * retrieve notifications for this product.
8
+ *
9
+ * @package AwesomeMotive
10
+ * @author Benjamin Rojas
11
+ * @license GPL-2.0+
12
+ * @copyright Copyright (c) 2017, Retyp LLC
13
+ * @version 1.0.0
14
+ */
15
+ class AM_Notification {
16
+ /**
17
+ * The api url we are calling.
18
+ *
19
+ * @since 1.0.0
20
+ *
21
+ * @var string
22
+ */
23
+ public $api_url = 'https://api.awesomemotive.com/v1/notification/';
24
+
25
+ /**
26
+ * A unique slug for this plugin.
27
+ * (Not the WordPress plugin slug)
28
+ *
29
+ * @since 1.0.0
30
+ *
31
+ * @var string
32
+ */
33
+ public $plugin;
34
+
35
+ /**
36
+ * The current plugin version.
37
+ *
38
+ * @since 1.0.0
39
+ *
40
+ * @var string
41
+ */
42
+ public $plugin_version;
43
+
44
+ /**
45
+ * The list of installed plugins.
46
+ *
47
+ * @since 1.0.0
48
+ *
49
+ * @var array
50
+ */
51
+ public $plugin_list = array();
52
+
53
+ /**
54
+ * The list of installed themes.
55
+ *
56
+ * @since 1.0.0
57
+ *
58
+ * @var string
59
+ */
60
+ public $theme_list = array();
61
+
62
+ /**
63
+ * Construct.
64
+ *
65
+ * @since 1.0.0
66
+ *
67
+ * @param string $plugin The plugin slug.
68
+ * @param string $version The version of the plugin.
69
+ */
70
+ public function __construct( $plugin = '', $version = 0 ) {
71
+ $this->plugin = $plugin;
72
+ $this->plugin_version = $version;
73
+
74
+ add_action( 'init', array( $this, 'custom_post_type' ) );
75
+ add_action( 'init', array( $this, 'get_remote_notifications' ), 100 );
76
+ add_action( 'admin_notices', array( $this, 'display_notifications' ) );
77
+ add_action( 'wp_ajax_am_notification_dismiss', array( $this, 'dismiss_notification' ) );
78
+ }
79
+
80
+ /**
81
+ * Registers a custom post type.
82
+ *
83
+ * @since 1.0.0
84
+ */
85
+ public function custom_post_type() {
86
+ register_post_type( 'amn_' . $this->plugin, array(
87
+ 'supports' => false
88
+ ) );
89
+ }
90
+
91
+ /**
92
+ * Retrieve the remote notifications if the time has expired.
93
+ *
94
+ * @since 1.0.0
95
+ */
96
+ public function get_remote_notifications() {
97
+ $last_checked = get_option( '_amn_' . $this->plugin . '_last_checked', strtotime( '-1 week' ) );
98
+
99
+ if ( $last_checked < strtotime( 'today midnight' ) ) {
100
+
101
+ $plugin_notifications = $this->get_plugin_notifications( 1 );
102
+
103
+ $notification_id = null;
104
+ if ( ! empty( $plugin_notifications) ) {
105
+ // Unset it from the array.
106
+ $notification = $plugin_notifications[0];
107
+ $notification_id = get_post_meta( $notification->ID, 'notification_id', true );
108
+ }
109
+
110
+ $response = wp_remote_retrieve_body( wp_remote_post( $this->api_url, array(
111
+ 'sslverify' => false,
112
+ 'body' => array(
113
+ 'slug' => $this->plugin,
114
+ 'version' => $this->plugin_version,
115
+ 'last_notification' => $notification_id,
116
+ 'plugins' => $this->get_plugins_list(),
117
+ 'themes' => $this->get_themes_list()
118
+ )
119
+ ) ) );
120
+
121
+ $data = json_decode( $response );
122
+
123
+ if ( ! empty( $data->id ) ) {
124
+
125
+ $notifications = array();
126
+ foreach ( (array) $data->slugs as $slug ) {
127
+ $notifications = array_merge( $notifications, (array) get_posts( array(
128
+ 'post_type' => 'amn_' . $slug,
129
+ 'post_status' => 'all',
130
+ 'meta_key' => 'notification_id',
131
+ 'meta_value' => $data->id
132
+ ) ) );
133
+ }
134
+
135
+ if ( empty( $notifications ) ) {
136
+
137
+ $new_notification_id = wp_insert_post( array(
138
+ 'post_content' => $data->content,
139
+ 'post_type' => 'amn_' . $this->plugin
140
+ ) );
141
+
142
+ update_post_meta( $new_notification_id, 'notification_id', $data->id );
143
+ update_post_meta( $new_notification_id, 'type', $data->type );
144
+ update_post_meta( $new_notification_id, 'dismissable', (bool) $data->dismissible ? 1 : 0 );
145
+ update_post_meta( $new_notification_id, 'location', wp_json_encode( $data->location ) );
146
+ update_post_meta( $new_notification_id, 'plugins', wp_json_encode( $data->plugins ) );
147
+ update_post_meta( $new_notification_id, 'theme', $data->theme );
148
+ update_post_meta( $new_notification_id, 'version', $data->version );
149
+ update_post_meta( $new_notification_id, 'viewed', 0 );
150
+ }
151
+
152
+ }
153
+
154
+ // Set the option now so we can't run this again until after 24 hours.
155
+ update_option( '_amn_' . $this->plugin . '_last_checked', strtotime( 'today midnight' ) );
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Get local plugin notifications that have already been set.
161
+ *
162
+ * @since 1.0.0
163
+ *
164
+ * @param integer $limit Set the limit for how many posts to retrieve.
165
+ * @param array $args Any top-level arguments to add to the array.
166
+ * @return object WP_Posts that match the query.
167
+ */
168
+ public function get_plugin_notifications( $limit = -1, $args = array() ) {
169
+ return get_posts( array(
170
+ 'showposts' => $limit,
171
+ 'post_type' => 'amn_' . $this->plugin
172
+ ) + $args );
173
+ }
174
+
175
+ /**
176
+ * Retrieve a list of plugins that are currently installed.
177
+ *
178
+ * @since 1.0.0
179
+ *
180
+ * @return array An array of plugins that are currently installed.
181
+ */
182
+ public function get_plugins_list() {
183
+ if ( ! empty( $this->plugin_list ) ) {
184
+ return $this->plugin_list;
185
+ }
186
+
187
+ if ( ! function_exists( 'get_plugins' ) ) {
188
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
189
+ }
190
+
191
+ $plugins = get_plugins();
192
+
193
+ foreach ( $plugins as $slug => $plugin ) {
194
+ $this->plugin_list[ $slug ] = array(
195
+ 'slug' => $slug,
196
+ 'name' => $plugin['Name'],
197
+ 'version' => $plugin['Version'],
198
+ 'active' => is_plugin_active( $slug )
199
+ );
200
+ }
201
+
202
+ return $this->plugin_list;
203
+ }
204
+
205
+ /**
206
+ * Retrieve a list of themes that are currently installed.
207
+ *
208
+ * @since 1.0.0
209
+ *
210
+ * @return array An array of themes that are currently installed.
211
+ */
212
+ public function get_themes_list() {
213
+ if ( ! empty( $this->theme_list ) ) {
214
+ return $this->theme_list;
215
+ }
216
+
217
+ $themes = wp_get_themes();
218
+
219
+ foreach ( $themes as $slug => $theme ) {
220
+ $this->theme_list[ $slug ] = array(
221
+ 'slug' => $slug,
222
+ 'name' => $theme->Name,
223
+ 'version' => $theme->Version,
224
+ 'active' => (string) wp_get_theme() == $theme->Name
225
+ );
226
+ }
227
+
228
+ return $this->theme_list;
229
+ }
230
+
231
+ /**
232
+ * Display any notifications that should be displayed.
233
+ *
234
+ * @since 1.0.0
235
+ */
236
+ public function display_notifications() {
237
+
238
+ if ( ! current_user_can( apply_filters( 'am_notifications_display', 'manage_options' ) ) ) {
239
+ return;
240
+ }
241
+
242
+ $plugin_notifications = $this->get_plugin_notifications( -1, array(
243
+ 'post_status' => 'all',
244
+ 'meta_key' => 'viewed',
245
+ 'meta_value' => '0'
246
+ ) );
247
+
248
+ $plugin_notifications = $this->validate_notifications( $plugin_notifications );
249
+
250
+ if ( ! empty( $plugin_notifications ) ) {
251
+ foreach ( $plugin_notifications as $notification ) {
252
+ $dismissable = get_post_meta( $notification->ID, 'dismissable', true );
253
+ $type = get_post_meta( $notification->ID, 'type', true );
254
+ ?>
255
+ <div class="am-notification am-notification-<?php echo $notification->ID; ?> notice notice-<?php echo $type; ?><?php echo $dismissable ? ' is-dismissible' : ''; ?>">
256
+ <?php echo $notification->post_content; ?>
257
+ </div>
258
+ <script type="text/javascript">
259
+ jQuery(document).ready( function($) {
260
+ $(document).on('click', '.am-notification-<?php echo $notification->ID; ?> button.notice-dismiss', function( event ) {
261
+ $.post( ajaxurl, {
262
+ action: 'am_notification_dismiss',
263
+ notification_id: '<?php echo $notification->ID; ?>'
264
+ });
265
+ });
266
+ });
267
+ </script>
268
+ <?php }
269
+ }
270
+ }
271
+
272
+ /**
273
+ * Validate the notifications before displaying them.
274
+ *
275
+ * @since 1.0.0
276
+ *
277
+ * @param array $plugin_notifications An array of plugin notifications.
278
+ * @return array A filtered array of plugin notifications.
279
+ */
280
+ public function validate_notifications( $plugin_notifications ) {
281
+ global $pagenow;
282
+ foreach ( $plugin_notifications as $key => $notification ) {
283
+ // Location validation.
284
+ $location = (array) json_decode( get_post_meta( $notification->ID, 'location', true ) );
285
+ $continue = false;
286
+ if ( ! in_array( 'everywhere', $location ) ) {
287
+ if ( in_array( 'index.php', $location ) && 'index.php' == $pagenow ) {
288
+ $continue = true;
289
+ }
290
+
291
+ if ( in_array( 'plugins.php', $location ) && 'plugins.php' == $pagenow ) {
292
+ $continue = true;
293
+ }
294
+
295
+ if ( ! $continue ) {
296
+ unset( $plugin_notifications[ $key ] );
297
+ }
298
+ }
299
+
300
+ // Plugin validation (OR conditional)
301
+ $plugins = (array) json_decode( get_post_meta( $notification->ID, 'plugins', true ) );
302
+ $continue = false;
303
+ if ( ! empty( $plugins ) ) {
304
+ foreach ( $plugins as $plugin ) {
305
+ if ( is_plugin_active( $plugin ) ) {
306
+ $continue = true;
307
+ }
308
+ }
309
+
310
+ if ( ! $continue ) {
311
+ unset( $plugin_notifications[ $key ] );
312
+ }
313
+ }
314
+
315
+ // Theme validation.
316
+ $theme = get_post_meta( $notification->ID, 'theme', true );
317
+ $continue = (string) wp_get_theme() == $theme;
318
+
319
+ if ( ! empty( $theme ) && ! $continue ) {
320
+ unset( $plugin_notifications[ $key ] );
321
+ }
322
+
323
+ // Version validation.
324
+ $version = get_post_meta( $notification->ID, 'version', true );
325
+ $continue = false;
326
+ if ( ! empty( $version ) ) {
327
+ if ( version_compare( $this->plugin_version, $version, '<=' ) ) {
328
+ $continue = true;
329
+ }
330
+
331
+ if ( ! $continue ) {
332
+ unset( $plugin_notifications[ $key ] );
333
+ }
334
+ }
335
+
336
+ }
337
+
338
+ return $plugin_notifications;
339
+ }
340
+
341
+ /**
342
+ * Dismiss the notification via AJAX.
343
+ *
344
+ * @since 1.0.0
345
+ */
346
+ public function dismiss_notification() {
347
+ $notification_id = intval( $_POST['notification_id'] );
348
+ update_post_meta( $notification_id, 'viewed', 1 );
349
+ die;
350
+ }
351
+
352
+ }
353
+ }
googleanalytics.php CHANGED
@@ -6,9 +6,9 @@
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
- * Version: 6.2.0
10
  * Requires at least: 3.9.0
11
- * Tested up to: 4.8.0
12
  *
13
  * License: GPL v3
14
  *
@@ -69,7 +69,7 @@ final class MonsterInsights_Lite {
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
- public $version = '6.2.0';
73
 
74
  /**
75
  * Plugin file.
@@ -181,6 +181,11 @@ final class MonsterInsights_Lite {
181
  monsterinsights_lite_call_install_and_upgrade();
182
  }
183
 
 
 
 
 
 
184
  // Load the plugin textdomain.
185
  add_action( 'plugins_loaded', array( self::$instance, 'load_plugin_textdomain' ) );
186
 
@@ -194,7 +199,11 @@ final class MonsterInsights_Lite {
194
  self::$instance->notices = new MonsterInsights_Notice_Admin();
195
  self::$instance->license = new MonsterInsights_License();
196
  self::$instance->reports = new MonsterInsights_Reporting();
197
- add_action( 'admin_init', array( self::$instance, 'require_updater' ) );
 
 
 
 
198
  }
199
 
200
  // Run hook to load MonsterInsights addons.
@@ -452,12 +461,15 @@ final class MonsterInsights_Lite {
452
  if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
453
 
454
  // Lite and Pro files
 
 
455
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/ajax.php';
456
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/admin.php';
457
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/common.php';
458
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notice.php';
459
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/capabilities.php';
460
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/license.php';
 
461
 
462
  // Pages
463
  // Multisite
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
+ * Version: 6.2.1
10
  * Requires at least: 3.9.0
11
+ * Tested up to: 4.8.1
12
  *
13
  * License: GPL v3
14
  *
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
+ public $version = '6.2.1';
73
 
74
  /**
75
  * Plugin file.
181
  monsterinsights_lite_call_install_and_upgrade();
182
  }
183
 
184
+ if ( is_admin() ) {
185
+ new AM_Notification( 'mi-lite', self::$instance->version );
186
+ new AM_Deactivation_Survey( 'MonsterInsights', basename( __DIR__ ) );
187
+ }
188
+
189
  // Load the plugin textdomain.
190
  add_action( 'plugins_loaded', array( self::$instance, 'load_plugin_textdomain' ) );
191
 
199
  self::$instance->notices = new MonsterInsights_Notice_Admin();
200
  self::$instance->license = new MonsterInsights_License();
201
  self::$instance->reports = new MonsterInsights_Reporting();
202
+ if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
203
+ self::$instance->require_updater();
204
+ } else {
205
+ add_action( 'admin_init', array( self::$instance, 'require_updater' ) );
206
+ }
207
  }
208
 
209
  // Run hook to load MonsterInsights addons.
461
  if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
462
 
463
  // Lite and Pro files
464
+ require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/pandora/class-am-notification.php';
465
+ require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/pandora/class-am-deactivation-survey.php';
466
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/ajax.php';
467
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/admin.php';
468
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/common.php';
469
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notice.php';
470
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/capabilities.php';
471
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/license.php';
472
+ require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/autoupdate.php';
473
 
474
  // Pages
475
  // Multisite
includes/admin/admin.php CHANGED
@@ -108,23 +108,6 @@ function monsterinsights_add_admin_body_class( $classes ) {
108
  }
109
  add_filter( 'admin_body_class', 'monsterinsights_add_admin_body_class', 10, 1 );
110
 
111
-
112
- function monsterinsights_menu_icon_css() {
113
- // Force correct sizing for retina vs non-retina display
114
- ?>
115
- <style type="text/css">
116
- #toplevel_page_monsterinsights_dashboard .wp-menu-image img,
117
- #toplevel_page_monsterinsights_settings .wp-menu-image img,
118
- #toplevel_page_monsterinsights_network .wp-menu-image img {
119
- width: 18px;
120
- height: 18px;
121
- padding-top: 7px;
122
- }
123
- </style>
124
- <?php
125
- }
126
- add_action( 'admin_head', 'monsterinsights_menu_icon_css' );
127
-
128
  /**
129
  * Add a link to the settings page to the plugins list
130
  *
@@ -266,4 +249,43 @@ function monsterinsights_admin_footer( $text ) {
266
  }
267
  return $text;
268
  }
269
- add_filter( 'admin_footer_text', 'monsterinsights_admin_footer', 1, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
109
  add_filter( 'admin_body_class', 'monsterinsights_add_admin_body_class', 10, 1 );
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * Add a link to the settings page to the plugins list
113
  *
249
  }
250
  return $text;
251
  }
252
+ add_filter( 'admin_footer_text', 'monsterinsights_admin_footer', 1, 2 );
253
+
254
+ function monsterinsights_deprecated_notices() {
255
+ // Don't show on MonsterInsights pages
256
+ $screen = get_current_screen();
257
+ if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
258
+ return;
259
+ }
260
+
261
+ $analytics = monsterinsights_get_option( 'tracking_mode', 'analytics' );
262
+ $events = monsterinsights_get_option( 'events_mode', false );
263
+ $updates = monsterinsights_get_option( 'automatic_updates', false );
264
+ $url = admin_url( 'admin.php?page=monsterinsights_settings' );
265
+ $notices = get_option( 'monsterinsights_notices' );
266
+
267
+ if ( ! is_array( $notices ) ) {
268
+ $notices = array();
269
+ }
270
+
271
+ if ( $analytics === 'ga' && ! isset( $notices ['monsterinsights_deprecated_ga' ] ) ){
272
+ echo '<div class="notice notice-error is-dismissible monsterinsights-notice" data-notice="monsterinsights_deprecated_ga">';
273
+ echo '<p>';
274
+ echo sprintf( esc_html__( 'Warning: You\'re currently using deprecated ga.js tracking which we will be removing support for in an upcoming release. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s. Users who do not manually switch over will be automatically switched over in an upcoming release.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
275
+ echo '</p>';
276
+ echo '</div>';
277
+ } else if ( $events === 'php' && ! isset( $notices ['monsterinsights_deprecated_php' ] ) ){
278
+ echo '<div class="notice notice-error is-dismissible monsterinsights-notice" data-notice="monsterinsights_deprecated_php">';
279
+ echo '<p>';
280
+ echo sprintf( esc_html__( 'Warning: You\'re currently using deprecated PHP based events tracking which we will be removing support for in an upcoming release. We recommend switching to JS events tracking, as it is significantly more accurate than PHP based events tracking. To switch %1$sclick here%2$s. Users who do not manually switch over will be automatically switched over in an upcoming release.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
281
+ echo '</p>';
282
+ echo '</div>';
283
+ } else if ( empty( $updates) && ! isset( $notices ['monsterinsights_automatic_updates' ] ) ){
284
+ echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
285
+ echo '<p>';
286
+ echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
287
+ echo '</p>';
288
+ echo '</div>';
289
+ }
290
+ }
291
+ add_action( 'admin_notices', 'monsterinsights_deprecated_notices' );
includes/admin/common.php CHANGED
@@ -24,6 +24,14 @@ if ( ! defined( 'ABSPATH' ) ) {
24
  */
25
  function monsterinsights_admin_styles() {
26
 
 
 
 
 
 
 
 
 
27
  // Get current screen.
28
  $screen = get_current_screen();
29
 
@@ -72,6 +80,23 @@ add_action( 'admin_enqueue_scripts', 'monsterinsights_admin_styles' );
72
  */
73
  function monsterinsights_admin_scripts() {
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  // Get current screen.
76
  $screen = get_current_screen();
77
 
@@ -254,6 +279,13 @@ function hide_non_monsterinsights_warnings () {
254
  if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
255
  foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
256
  foreach ( $hooks as $name => $arr ) {
 
 
 
 
 
 
 
257
  if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
258
  unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
259
  }
@@ -264,6 +296,13 @@ function hide_non_monsterinsights_warnings () {
264
  if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
265
  foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
266
  foreach ( $hooks as $name => $arr ) {
 
 
 
 
 
 
 
267
  if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
268
  unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
269
  }
@@ -274,6 +313,13 @@ function hide_non_monsterinsights_warnings () {
274
  if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
275
  foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
276
  foreach ( $hooks as $name => $arr ) {
 
 
 
 
 
 
 
277
  if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
278
  unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
279
  }
24
  */
25
  function monsterinsights_admin_styles() {
26
 
27
+ // Load Common admin styles.
28
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
29
+ if ( ! file_exists( MONSTERINSIGHTS_PLUGIN_DIR . 'assets/css/admin-common.min.css' ) ) {
30
+ $suffix = '';
31
+ }
32
+ wp_register_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-common-style', plugins_url( 'assets/css/admin-common' . $suffix . '.css', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version() );
33
+ wp_enqueue_style( MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-common-style' );
34
+
35
  // Get current screen.
36
  $screen = get_current_screen();
37
 
80
  */
81
  function monsterinsights_admin_scripts() {
82
 
83
+ // Our Common Admin JS
84
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
85
+ if ( ! file_exists( MONSTERINSIGHTS_PLUGIN_DIR . 'assets/js/admin-common.min.js' ) ) {
86
+ $suffix = '';
87
+ }
88
+
89
+ wp_register_script( MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-common-script', plugins_url( 'assets/js/admin-common' . $suffix . '.js', MONSTERINSIGHTS_PLUGIN_FILE ), array( 'jquery' ), monsterinsights_get_asset_version() );
90
+ wp_enqueue_script( MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-common-script' );
91
+ wp_localize_script(
92
+ MONSTERINSIGHTS_PLUGIN_SLUG . '-admin-common-script',
93
+ 'monsterinsights_admin_common',
94
+ array(
95
+ 'ajax' => admin_url( 'admin-ajax.php' ),
96
+ 'dismiss_notice_nonce' => wp_create_nonce( 'monsterinsights-dismiss-notice' ),
97
+ )
98
+ );
99
+
100
  // Get current screen.
101
  $screen = get_current_screen();
102
 
279
  if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
280
  foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
281
  foreach ( $hooks as $name => $arr ) {
282
+ if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
283
+ unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
284
+ continue;
285
+ }
286
+ if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
287
+ continue;
288
+ }
289
  if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
290
  unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
291
  }
296
  if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
297
  foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
298
  foreach ( $hooks as $name => $arr ) {
299
+ if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
300
+ unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
301
+ continue;
302
+ }
303
+ if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
304
+ continue;
305
+ }
306
  if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
307
  unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
308
  }
313
  if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
314
  foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
315
  foreach ( $hooks as $name => $arr ) {
316
+ if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
317
+ unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
318
+ continue;
319
+ }
320
+ if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
321
+ continue;
322
+ }
323
  if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
324
  unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
325
  }
includes/admin/licensing/autoupdate.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Filters the auto update plugin routine to allow MonsterInsights to be
4
+ * automatically updated.
5
+ *
6
+ * @since 6.3.0
7
+ *
8
+ * @param bool $update Flag to update the plugin or not.
9
+ * @param array $item Update data about a specific plugin.
10
+ * @return bool $update The new update state.
11
+ */
12
+ function monsterinsights_automatic_updates( $update, $item ) {
13
+
14
+ // If this is multisite and is not on the main site, return early.
15
+ if ( is_multisite() && ! is_main_site() ) {
16
+ return $update;
17
+ }
18
+
19
+ // If we don't have everything we need, return early.
20
+ $item = (array) $item;
21
+ if ( ! isset( $item['new_version'] ) || ! isset( $item['slug'] ) ) {
22
+ return $update;
23
+ }
24
+
25
+ // If the plugin isn't ours, return early.
26
+ $is_free = 'google-analytics-for-wordpress' === $item['slug'];
27
+ $is_paid = isset( $item['monsterinsights_plugin'] ); // see updater class
28
+ if ( ! $is_free && ! $is_paid ) {
29
+ return $update;
30
+ }
31
+
32
+ $version = $is_free ? MONSTERINSIGHTS_LITE_VERSION : $item['old_version'];
33
+ $automatic_updates = monsterinsights_get_option( 'automatic_updates', false );
34
+ $current_major = monsterinsights_get_major_version( $version );
35
+ $new_major = monsterinsights_get_major_version( $item['new_version'] );
36
+
37
+ // If the opt in update allows major updates but there is no major version update, return early.
38
+ if ( $current_major < $new_major ) {
39
+ if ( $automatic_updates === 'all' ) {
40
+ return true;
41
+ } else {
42
+ return $update;
43
+ }
44
+ }
45
+
46
+ // If the opt in update allows minor updates but there is no minor version update, return early.
47
+ if ( $current_major == $new_major ) {
48
+ if ( $automatic_updates === 'all' || $automatic_updates === 'minor' ) {
49
+ return true;
50
+ } else {
51
+ return $update;
52
+ }
53
+ }
54
+
55
+ // All our checks have passed - this plugin can be updated!
56
+ return true;
57
+ }
58
+
59
+ add_filter( 'auto_update_plugin', 'monsterinsights_automatic_updates', 10, 2 );
60
+ /**
61
+ * Notes about autoupdater:
62
+ * This runs on the normal WordPress auto-update sequence:
63
+ * 1. In wp-includes/update.php, wp_version_check() is called by the WordPress update cron (every 8 or 12 hours; can be overriden to be faster/long or turned off by plugins)
64
+ * 2. In wp-includes/update.php, wp_version_check() ends with a action call to do_action( 'wp_maybe_auto_update' ) if cron is running
65
+ * 3. In wp-includes/update.php, wp_maybe_auto_update() hooks into wp_maybe_auto_update action, creates a new WP_Automatic_Updater instance and calls WP_Automatic_Updater->run
66
+ * 4. In wp-admin/includes/class-wp-automatic-updater.php $this->run() checks to make sure we're on the main site if on a network, and also if the autoupdates are disabled (by plugin, by being on a version controlled site, etc )
67
+ * 5. In wp-admin/includes/class-wp-automatic-updater.php $this->run() then checks to see which plugins have new versions (version/update check)
68
+ * 6. In wp-admin/includes/class-wp-automatic-updater.php $this->run() then calls $this->update() for each plugin installed who has an upgrade.
69
+ * 7 In wp-admin/includes/class-wp-automatic-updater.php $this->update() double checks filesystem access and then installs the plugin if able
70
+ *
71
+ * Notes:
72
+ * - This autoupdater only works if WordPress core detects no version control. If you want to test this, do it on a new WP site without any .git folders anywhere.
73
+ * - This autoupdater only works if the file access is able to be written to
74
+ * - This autoupdater only works if a new version has been detected, and will run not the second the update is released, but whenever the cron for wp_version_check is next released. This is generally run every 8-12 hours.
75
+ * - However, that cron can be disabled, the autoupdater can be turned off via constant or filter, version control or file lock can be detected, and other plugins can be installed (incl in functions of theme) that turn off all
76
+ * all automatic plugin updates.
77
+ * - If you want to test this is working, you have to manually run the wp_version_check cron. Install the WP Crontrol plugin or Core Control plugin, and run the cron manually using it.
78
+ * - Again, because you skimmed over it the first time, if you want to test this manually you need to test this on a new WP install without version control for core, plugins, etc, without file lock, with license key entered (for pro only)
79
+ * and use the WP Crontrol or Core Control plugin to run wp_version_check
80
+ * - You may have to manually remove an option called "auto_update.lock" from the WP options table
81
+ * - You may need to run wp_version_check multiple times (note though that they must be spaced at least 60 seconds apart)
82
+ * - Because WP's updater asks the OS if the file is writable, make sure you do not have any files/folders for the plugin you are trying to autoupdate open when testing.
83
+ * - You may need to delete the plugin info transient to get it to hard refresh the plugin info.
84
+ */
85
+
86
+
87
+ function monsterinsights_get_major_version( $version ) {
88
+ $exploded_version = explode( '.', $version );
89
+ if ( isset( $exploded_version[2] ) ) {
90
+ return $exploded_version[0] . '.' . $exploded_version[1] . '.' . $exploded_version[2];
91
+ } else {
92
+ return $exploded_version[0] . '.' . $exploded_version[1] . '.0';
93
+ }
94
+ }
includes/admin/licensing/license.php CHANGED
@@ -454,6 +454,10 @@ final class MonsterInsights_License {
454
  $option = get_option( 'monsterinsights_license' );
455
  }
456
 
 
 
 
 
457
  if ( is_multisite() && is_network_admin() ) {
458
  // If a key has expired, output nag about renewing the key.
459
  if ( isset( $option['is_expired'] ) && $option['is_expired'] ) :
454
  $option = get_option( 'monsterinsights_license' );
455
  }
456
 
457
+ if ( ! monsterinsights_is_pro_version() ) {
458
+ return;
459
+ }
460
+
461
  if ( is_multisite() && is_network_admin() ) {
462
  // If a key has expired, output nag about renewing the key.
463
  if ( isset( $option['is_expired'] ) && $option['is_expired'] ) :
includes/admin/licensing/updater.php CHANGED
@@ -133,17 +133,19 @@ class MonsterInsights_Updater {
133
  }
134
 
135
  // If the user cannot update plugins, stop processing here.
136
- if ( ! current_user_can( 'update_plugins' ) ) {
137
  return;
138
  }
139
 
140
  // Load the updater hooks and filters.
141
  add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_plugins_filter' ) );
142
- //add_filter( 'set_site_transient_update_plugins', array( $this, 'set_site_transient_update_plugins' ) );
143
- //add_filter( 'transient_update_plugins', array( $this, 'transient_update_plugins' ) );
144
  add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
145
  add_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 );
146
 
 
 
 
147
  }
148
 
149
  /**
@@ -173,7 +175,12 @@ class MonsterInsights_Updater {
173
  // Infuse the update object with our data if the version from the remote API is newer.
174
  if ( isset( $this->update->new_version ) && version_compare( $this->version, $this->update->new_version, '<' ) ) {
175
  // The $plugin_update object contains new_version, package, slug and last_update keys.
176
- $value->response[$this->plugin_path] = $this->update;
 
 
 
 
 
177
  }
178
 
179
  // Return the update object.
@@ -279,6 +286,40 @@ class MonsterInsights_Updater {
279
 
280
  }
281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  /**
283
  * Queries the remote URL via wp_remote_post and returns a json decoded response.
284
  *
133
  }
134
 
135
  // If the user cannot update plugins, stop processing here.
136
+ if ( ! current_user_can( 'update_plugins' ) && ( ! defined( 'DOING_CRON' ) || ! DOING_CRON ) ) {
137
  return;
138
  }
139
 
140
  // Load the updater hooks and filters.
141
  add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_plugins_filter' ) );
142
+
 
143
  add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
144
  add_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 );
145
 
146
+ // ManageWP premium update filters
147
+ //add_filter( 'mwp_premium_update_notification', array( $this, 'premium_update_push' ) );
148
+ //add_filter( 'mwp_premium_perform_update', array( $this, 'premium_update' ) );
149
  }
150
 
151
  /**
175
  // Infuse the update object with our data if the version from the remote API is newer.
176
  if ( isset( $this->update->new_version ) && version_compare( $this->version, $this->update->new_version, '<' ) ) {
177
  // The $plugin_update object contains new_version, package, slug and last_update keys.
178
+ //$this->update->full_slug = $this->plugin_slug;
179
+ //$this->update->name = $this->plugin_name;
180
+ $this->update->monsterinsights_plugin = true;
181
+ $this->update->old_version = $this->version;
182
+ $this->update->plugin = $this->plugin_path;
183
+ $value->response[$this->plugin_path] = $this->update;
184
  }
185
 
186
  // Return the update object.
286
 
287
  }
288
 
289
+ // Integration with ManageWP
290
+ public function premium_update_push( $premium_update ) {
291
+ if ( ! function_exists( 'get_plugin_data' ) ) {
292
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
293
+ }
294
+
295
+ $update = $this->set_plugins_api( array() );
296
+ if ( ! empty( $update ) && version_compare( MONSTERINSIGHTS_VERSION, $update->version, '<' ) ) {
297
+ $plugin_data = get_plugin_data( $update->slug );
298
+ $plugin_data['type'] = 'plugin';
299
+ $plugin_data['slug'] = $update->slug;
300
+ $plugin_data['new_version'] = $update->version;
301
+ $premium_update[] = $plugin_data;
302
+ }
303
+ return $premium_update;
304
+ }
305
+
306
+ // Integration with ManageWP
307
+ public function premium_update( $premium_update ) {
308
+ if ( ! function_exists( 'get_plugin_data' ) ) {
309
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
310
+ }
311
+
312
+ $update = $this->set_plugins_api( array() );
313
+ if ( ! empty( $update ) && version_compare( MONSTERINSIGHTS_VERSION, $update->version, '<' ) ) {
314
+ $plugin_data = get_plugin_data( $update->slug );
315
+ $plugin_data['type'] = 'plugin';
316
+ $plugin_data['slug'] = $update->slug;
317
+ $plugin_data['url'] = $update->download_link; // OR provide your own callback function for managing the update
318
+ array_push( $premium_update, $plugin_data );
319
+ }
320
+ return $premium_update;
321
+ }
322
+
323
  /**
324
  * Queries the remote URL via wp_remote_post and returns a json decoded response.
325
  *
includes/admin/notice.php CHANGED
@@ -140,17 +140,6 @@ final class MonsterInsights_Notice_Admin {
140
  ?>
141
  <div class="monsterinsights-notice <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice' . $dismissible; ?>" data-notice="<?php echo esc_attr( $name ); ?>">
142
  <div class="monsterinsights-notice-icon <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice-icon'?>">
143
- <?php
144
- if ( $type === 'success' ) {
145
- echo '<i class="fa fa-check" aria-hidden="true"></i>';
146
- } else if ( $type === 'alert' ){
147
- echo '<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>';
148
- } else if ( $type === 'info' ){
149
- echo '<i class="fa fa-info" aria-hidden="true"></i>';
150
- } else {
151
- echo'<i class="fa fa-times" aria-hidden="true"></i>';
152
- }
153
- ?>
154
  </div>
155
  <div class="monsterinsights-notice-text <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice-text'?>">
156
  <?php
140
  ?>
141
  <div class="monsterinsights-notice <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice' . $dismissible; ?>" data-notice="<?php echo esc_attr( $name ); ?>">
142
  <div class="monsterinsights-notice-icon <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice-icon'?>">
 
 
 
 
 
 
 
 
 
 
 
143
  </div>
144
  <div class="monsterinsights-notice-text <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice-text'?>">
145
  <?php
includes/admin/settings/register-settings.php CHANGED
@@ -50,7 +50,7 @@ function monsterinsights_get_settings_tabs() {
50
  ),
51
  'forms' => array(
52
  'title' => esc_html__( 'Forms', 'google-analytics-for-wordpress' ),
53
- 'level' => 'plus',
54
  ),
55
  'ecommerce' => array(
56
  'title' => esc_html__( 'eCommerce', 'google-analytics-for-wordpress' ),
@@ -80,7 +80,7 @@ function monsterinsights_get_settings_tabs() {
80
  ),
81
  'goptimize' => array(
82
  'title' => esc_html__( 'Google Optimize', 'google-analytics-for-wordpress' ),
83
- 'level' => 'plus'
84
  ),
85
  'fbia' => array(
86
  'title' => esc_html__( 'FB Instant Articles', 'google-analytics-for-wordpress' ),
@@ -367,6 +367,17 @@ function monsterinsights_get_registered_settings() {
367
  'multiple' => true,
368
  'allowclear' => true
369
  ),
 
 
 
 
 
 
 
 
 
 
 
370
  'anonymous_data' => array(
371
  'id' => 'anonymous_data',
372
  'name' => __( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ),
@@ -377,4 +388,4 @@ function monsterinsights_get_registered_settings() {
377
  ),
378
  );
379
  return apply_filters( 'monsterinsights_registered_settings', $monsterinsights_settings );
380
- }
50
  ),
51
  'forms' => array(
52
  'title' => esc_html__( 'Forms', 'google-analytics-for-wordpress' ),
53
+ 'level' => 'pro',
54
  ),
55
  'ecommerce' => array(
56
  'title' => esc_html__( 'eCommerce', 'google-analytics-for-wordpress' ),
80
  ),
81
  'goptimize' => array(
82
  'title' => esc_html__( 'Google Optimize', 'google-analytics-for-wordpress' ),
83
+ 'level' => 'pro'
84
  ),
85
  'fbia' => array(
86
  'title' => esc_html__( 'FB Instant Articles', 'google-analytics-for-wordpress' ),
367
  'multiple' => true,
368
  'allowclear' => true
369
  ),
370
+ 'automatic_updates' => array(
371
+ 'id' => 'automatic_updates',
372
+ 'name' => __( 'Automatic Updates', 'google-analytics-for-wordpress' ),
373
+ 'type' => 'radio',
374
+ 'std' => 'none',
375
+ 'options' => array(
376
+ 'all' => __( 'Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress' ),
377
+ 'minor' => __( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress' ),
378
+ 'none' => __( 'None - Manually update everything.', 'google-analytics-for-wordpress' ),
379
+ ),
380
+ ),
381
  'anonymous_data' => array(
382
  'id' => 'anonymous_data',
383
  'name' => __( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ),
388
  ),
389
  );
390
  return apply_filters( 'monsterinsights_registered_settings', $monsterinsights_settings );
391
+ }
includes/admin/settings/tab-general.php CHANGED
@@ -41,6 +41,7 @@ function monsterinsights_settings_general_tab() {
41
  $profile_id = monsterinsights_get_option( 'analytics_profile', '' );
42
  $tracking_mode = monsterinsights_get_option( 'tracking_mode', 'analytics' );
43
  $events_mode = monsterinsights_get_option( 'events_mode', 'js' );
 
44
  $anon_tracking = monsterinsights_get_option( 'anonymous_data', false );
45
  ?>
46
  <div id="monsterinsights-settings-general">
@@ -178,6 +179,20 @@ function monsterinsights_settings_general_tab() {
178
  </tr>
179
  <?php } ?>
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  <!-- Tracking -->
182
  <?php
183
  $title = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
@@ -262,6 +277,11 @@ function monsterinsights_settings_save_general() {
262
  monsterinsights_update_option( 'tracking_mode', $tracking_mode );
263
  }
264
 
 
 
 
 
 
265
  $anonymous_data = isset( $_POST['anonymous_data'] ) ? 1 : 0;
266
  if ( $anonymous_data ) {
267
  monsterinsights_update_option( 'anonymous_data', $anonymous_data );
41
  $profile_id = monsterinsights_get_option( 'analytics_profile', '' );
42
  $tracking_mode = monsterinsights_get_option( 'tracking_mode', 'analytics' );
43
  $events_mode = monsterinsights_get_option( 'events_mode', 'js' );
44
+ $automatic_updates = monsterinsights_get_option( 'automatic_updates', false );
45
  $anon_tracking = monsterinsights_get_option( 'anonymous_data', false );
46
  ?>
47
  <div id="monsterinsights-settings-general">
179
  </tr>
180
  <?php } ?>
181
 
182
+ <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){ ?>
183
+ <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?>
184
+ <tr id="monsterinsights-automatic-updates-mode">
185
+ <th scope="row">
186
+ <label for="monsterinsights-tracking-mode"><?php esc_html_e( 'Automatic Updates', 'google-analytics-for-wordpress' ); ?></label>
187
+ </th>
188
+ <td>
189
+ <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e('Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress'); ?> </label>
190
+ <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress'); ?> </label>
191
+ <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress'); ?> </label>
192
+ </td>
193
+ </tr>
194
+ <?php } ?>
195
+
196
  <!-- Tracking -->
197
  <?php
198
  $title = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
277
  monsterinsights_update_option( 'tracking_mode', $tracking_mode );
278
  }
279
 
280
+ $automatic_updates = isset( $_POST['automatic_updates'] ) && in_array( $_POST['automatic_updates'], array( 'all', 'minor', 'none' ) ) ? $_POST['automatic_updates'] : false;
281
+ if ( $automatic_updates ) {
282
+ monsterinsights_update_option( 'automatic_updates', $automatic_updates );
283
+ }
284
+
285
  $anonymous_data = isset( $_POST['anonymous_data'] ) ? 1 : 0;
286
  if ( $anonymous_data ) {
287
  monsterinsights_update_option( 'anonymous_data', $anonymous_data );
includes/frontend/frontend.php CHANGED
@@ -29,6 +29,7 @@ if ( ! defined( 'ABSPATH' ) ) {
29
  function monsterinsights_tracking_script( ) {
30
 
31
  $tracking_mode = monsterinsights_get_option( 'tracking_mode', 'analytics' );
 
32
  require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/class-tracking-abstract.php';
33
  $mode = '';
34
 
@@ -80,8 +81,8 @@ function monsterinsights_tracking_script( ) {
80
  do_action( 'monsterinsights_tracking_after_' . $mode );
81
  do_action( 'monsterinsights_tracking_after', $mode );
82
  }
83
- add_action( 'wp_head', 'monsterinsights_tracking_script', 8 );
84
- //add_action( 'login_head', 'monsterinsights_tracking_script', 8 );
85
 
86
  /**
87
  * Get frontend tracking options.
29
  function monsterinsights_tracking_script( ) {
30
 
31
  $tracking_mode = monsterinsights_get_option( 'tracking_mode', 'analytics' );
32
+
33
  require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/class-tracking-abstract.php';
34
  $mode = '';
35
 
81
  do_action( 'monsterinsights_tracking_after_' . $mode );
82
  do_action( 'monsterinsights_tracking_after', $mode );
83
  }
84
+ add_action( 'wp_head', 'monsterinsights_tracking_script', 6 );
85
+ //add_action( 'login_head', 'monsterinsights_tracking_script', 6 );
86
 
87
  /**
88
  * Get frontend tracking options.
includes/frontend/tracking/class-tracking-analytics.php CHANGED
@@ -188,13 +188,15 @@ class MonsterInsights_Tracking_Analytics extends MonsterInsights_Tracking_Abstra
188
  <!-- This site uses the Google Analytics by MonsterInsights plugin v<?php echo MONSTERINSIGHTS_VERSION; ?> - Using Analytics tracking - https://www.monsterinsights.com/ -->
189
  <?php if ( monsterinsights_get_ua() ) { ?>
190
  <script type="text/javascript" data-cfasync="false">
 
 
 
191
  /* Function to detect opted out users */
192
  function __gaTrackerIsOptedOut() {
193
  return document.cookie.indexOf(disableStr + '=true') > -1;
194
  }
195
 
196
  /* Disable tracking if the opt-out cookie exists. */
197
- var disableStr = 'ga-disable-<?php echo monsterinsights_get_ua(); ?>';
198
  if ( __gaTrackerIsOptedOut() ) {
199
  window[disableStr] = true;
200
  }
@@ -204,7 +206,7 @@ class MonsterInsights_Tracking_Analytics extends MonsterInsights_Tracking_Abstra
204
  document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
205
  window[disableStr] = true;
206
  }
207
-
208
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
209
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
210
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -235,4 +237,8 @@ if ( count( $options ) >= 1 ) {
235
  ob_end_clean();
236
  return $output;
237
  }
 
 
 
 
238
  }
188
  <!-- This site uses the Google Analytics by MonsterInsights plugin v<?php echo MONSTERINSIGHTS_VERSION; ?> - Using Analytics tracking - https://www.monsterinsights.com/ -->
189
  <?php if ( monsterinsights_get_ua() ) { ?>
190
  <script type="text/javascript" data-cfasync="false">
191
+ <?php if ( $this->should_do_optout() ) { ?>
192
+ var disableStr = 'ga-disable-<?php echo monsterinsights_get_ua(); ?>';
193
+
194
  /* Function to detect opted out users */
195
  function __gaTrackerIsOptedOut() {
196
  return document.cookie.indexOf(disableStr + '=true') > -1;
197
  }
198
 
199
  /* Disable tracking if the opt-out cookie exists. */
 
200
  if ( __gaTrackerIsOptedOut() ) {
201
  window[disableStr] = true;
202
  }
206
  document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
207
  window[disableStr] = true;
208
  }
209
+ <?php } ?>
210
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
211
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
212
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
237
  ob_end_clean();
238
  return $output;
239
  }
240
+
241
+ public function should_do_optout() {
242
+ return ! ( defined( 'MI_NO_TRACKING_OPTOUT' ) && MI_NO_TRACKING_OPTOUT );
243
+ }
244
  }
languages/google-analytics-for-wordpress.pot CHANGED
@@ -5,14 +5,14 @@ msgstr ""
5
  "Project-Id-Version: MonsterInsights Lite\n"
6
  "Report-Msgid-Bugs-To: https://github.com/awesomemotive/monsterinsights/"
7
  "issues\n"
8
- "POT-Creation-Date: 2017-06-05 17:21-0400\n"
9
  "PO-Revision-Date: 2016-07-21 17:01-0400\n"
10
  "Last-Translator: Chris Christoff <support@monsterinsights.com>\n"
11
  "Language-Team: Chris Christoff <support@monsterinsights.com>\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 2.0.2\n"
16
  "X-Poedit-Basepath: ..\n"
17
  "X-Poedit-WPHeader: googleanalytics.php\n"
18
  "X-Poedit-SourceCharset: UTF-8\n"
@@ -35,18 +35,18 @@ msgstr ""
35
  "X-Poedit-SearchPathExcluded-12: *.css\n"
36
  "X-Poedit-SearchPathExcluded-13: googleanalytics-premium.php\n"
37
 
38
- #: googleanalytics.php:220 googleanalytics.php:234
39
  msgid "Cheatin&#8217; huh?"
40
  msgstr ""
41
 
42
- #: googleanalytics.php:375
43
  msgid ""
44
  "The version of MonsterInsights eCommerce addon you have is not compatible "
45
  "with the version of MonsterInsights installed. Please update the eCommerce "
46
  "addon as soon as possible"
47
  msgstr ""
48
 
49
- #: googleanalytics.php:397
50
  #, php-format
51
  msgid ""
52
  "Sorry, but your version of WordPress does not meet MonsterInsights's "
@@ -54,7 +54,7 @@ msgid ""
54
  "activated. %3$sClick here to return to the Dashboard%4$s."
55
  msgstr ""
56
 
57
- #: googleanalytics.php:418
58
  #, php-format
59
  msgid ""
60
  "Please %1$uninstall%2$s the MonsterInsights Lite Plugin. Your Pro version of "
@@ -62,7 +62,7 @@ msgid ""
62
  "uninstalled."
63
  msgstr ""
64
 
65
- #: googleanalytics.php:565
66
  #, php-format
67
  msgid ""
68
  "Sorry, but your version of WordPress does not meet MonsterInsight's required "
@@ -70,7 +70,7 @@ msgid ""
70
  "%3$sClick here to return to the Dashboard%4$s."
71
  msgstr ""
72
 
73
- #: googleanalytics.php:570
74
  #, php-format
75
  msgid ""
76
  "Please uninstall and remove MonsterInsights Pro before activating "
@@ -89,7 +89,7 @@ msgid "Insights"
89
  msgstr ""
90
 
91
  #: includes/admin/admin.php:39 includes/admin/admin.php:49
92
- #: includes/admin/admin.php:154
93
  msgid "Settings"
94
  msgstr ""
95
 
@@ -130,122 +130,154 @@ msgstr ""
130
  msgid "Network Settings"
131
  msgstr ""
132
 
133
- #: includes/admin/admin.php:136
134
  msgid "Documentation"
135
  msgstr ""
136
 
137
- #: includes/admin/admin.php:141
138
  msgid "Get MonsterInsights Pro"
139
  msgstr ""
140
 
141
- #: includes/admin/admin.php:147 includes/admin/admin.php:150
142
  msgid "Support"
143
  msgstr ""
144
 
145
- #: includes/admin/admin.php:265
146
  #, php-format
147
  msgid ""
148
  "Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread "
149
  "the word. Thank you from the MonsterInsights team!"
150
  msgstr ""
151
 
152
- #: includes/admin/common.php:131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  msgid "Loading..."
154
  msgstr ""
155
 
156
- #: includes/admin/common.php:132
157
  msgid ""
158
  "Warning: You have unsaved setting changes. If you leave the settings page "
159
  "without saving your changes will be lost. Did you still want to leave the "
160
  "page?"
161
  msgstr ""
162
 
163
- #: includes/admin/common.php:134
164
  msgid "Status: Active"
165
  msgstr ""
166
 
167
- #: includes/admin/common.php:135 includes/admin/pages/addons.php:492
168
  msgid "Activate"
169
  msgstr ""
170
 
171
- #: includes/admin/common.php:136
172
  msgid "Status: Network Activated"
173
  msgstr ""
174
 
175
- #: includes/admin/common.php:137 includes/admin/pages/addons.php:490
176
  msgid "Network activate"
177
  msgstr ""
178
 
179
- #: includes/admin/common.php:139
180
  msgid "Activating..."
181
  msgstr ""
182
 
183
- #: includes/admin/common.php:140 includes/admin/pages/addons.php:465
184
  #: includes/admin/pages/addons.php:467
185
  msgid "Deactivate"
186
  msgstr ""
187
 
188
- #: includes/admin/common.php:141 includes/admin/pages/addons.php:463
189
  msgid "Network deactivate"
190
  msgstr ""
191
 
192
- #: includes/admin/common.php:143
193
  msgid "Deactivating..."
194
  msgstr ""
195
 
196
- #: includes/admin/common.php:144
197
  msgid "Status: Inactive"
198
  msgstr ""
199
 
200
- #: includes/admin/common.php:145
201
  msgid "Status: Network inactive"
202
  msgstr ""
203
 
204
- #: includes/admin/common.php:146 includes/admin/pages/addons.php:422
205
  msgid "Install"
206
  msgstr ""
207
 
208
- #: includes/admin/common.php:148
209
  msgid "Installing..."
210
  msgstr ""
211
 
212
- #: includes/admin/common.php:149
213
  msgid "Proceed"
214
  msgstr ""
215
 
216
- #: includes/admin/common.php:151
217
  msgid "Copied!"
218
  msgstr ""
219
 
220
- #: includes/admin/common.php:152
221
  msgid "Copy to Clipboard"
222
  msgstr ""
223
 
224
- #: includes/admin/common.php:153
225
  msgid "Failed!"
226
  msgstr ""
227
 
228
- #: includes/admin/common.php:155
229
  msgid "Shorten URL"
230
  msgstr ""
231
 
232
- #: includes/admin/common.php:156
233
  msgid "Shortened!"
234
  msgstr ""
235
 
236
- #: includes/admin/common.php:157
237
  msgid "Working..."
238
  msgstr ""
239
 
240
- #: includes/admin/common.php:158 includes/admin/pages/tools.php:87
241
  msgid "Import"
242
  msgstr ""
243
 
244
- #: includes/admin/common.php:159
245
  msgid "Imported!"
246
  msgstr ""
247
 
248
- #: includes/admin/common.php:363
249
  #, php-format
250
  msgid ""
251
  "MonsterInsights has detected that it's files are being blocked. This is "
@@ -497,30 +529,30 @@ msgid ""
497
  "Congratulations! You have deactivated the key from this site successfully."
498
  msgstr ""
499
 
500
- #: includes/admin/licensing/license.php:462
501
- #: includes/admin/licensing/license.php:523
502
  #, php-format
503
  msgid ""
504
  "Your license key for MonsterInsights has expired. %1$sPlease click here to "
505
  "renew your license key and continue receiving automatic updates.%2$s"
506
  msgstr ""
507
 
508
- #: includes/admin/licensing/license.php:471
509
- #: includes/admin/licensing/license.php:532
510
  msgid ""
511
  "Your license key for MonsterInsights has been disabled. Please use a "
512
  "different key to continue receiving automatic updates."
513
  msgstr ""
514
 
515
- #: includes/admin/licensing/license.php:480
516
- #: includes/admin/licensing/license.php:541
517
  msgid ""
518
  "Your license key for MonsterInsights is invalid. The key no longer exists or "
519
  "the user associated with the key has been deleted. Please use a different "
520
  "key to continue receiving automatic updates."
521
  msgstr ""
522
 
523
- #: includes/admin/licensing/license.php:514
524
  #, php-format
525
  msgid ""
526
  "No valid license key has been entered, so automatic updates for "
@@ -532,7 +564,7 @@ msgstr ""
532
  msgid "There was an error installing the addon. Please try again."
533
  msgstr ""
534
 
535
- #: includes/admin/notice.php:236
536
  msgid "Dismiss this notice"
537
  msgstr ""
538
 
@@ -655,45 +687,45 @@ msgid ""
655
  msgstr ""
656
 
657
  #: includes/admin/pages/network-settings.php:62
658
- #: includes/admin/settings/tab-general.php:65
659
  msgid "License Key"
660
  msgstr ""
661
 
662
  #: includes/admin/pages/network-settings.php:68
663
- #: includes/admin/settings/tab-general.php:71
664
  msgid "Verify Key"
665
  msgstr ""
666
 
667
  #: includes/admin/pages/network-settings.php:69
668
- #: includes/admin/settings/tab-general.php:72
669
  msgid "Deactivate Key"
670
  msgstr ""
671
 
672
  #: includes/admin/pages/network-settings.php:70
673
- #: includes/admin/settings/tab-general.php:73
674
  msgid ""
675
  "License key to enable automatic updates for MonsterInsights Pro & addons. "
676
  "Deactivate your license if you want to use it on another WordPress site."
677
  msgstr ""
678
 
679
  #: includes/admin/pages/network-settings.php:78
680
- #: includes/admin/settings/tab-general.php:80
681
  msgid "License Key Type"
682
  msgstr ""
683
 
684
  #: includes/admin/pages/network-settings.php:82
685
- #: includes/admin/settings/tab-general.php:84
686
  #, php-format
687
  msgid "Your license key type for this site is %s."
688
  msgstr ""
689
 
690
  #: includes/admin/pages/network-settings.php:85
691
- #: includes/admin/settings/tab-general.php:87
692
  msgid "Refresh Key"
693
  msgstr ""
694
 
695
  #: includes/admin/pages/network-settings.php:86
696
- #: includes/admin/settings/tab-general.php:88
697
  msgid ""
698
  "Your license key type (handles updates and Addons). Click refresh if your "
699
  "license has been upgraded or the type is incorrect."
@@ -1181,12 +1213,35 @@ msgid ""
1181
  msgstr ""
1182
 
1183
  #: includes/admin/settings/register-settings.php:372
1184
- #: includes/admin/settings/tab-general.php:183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1185
  msgid "Allow Usage Tracking"
1186
  msgstr ""
1187
 
1188
- #: includes/admin/settings/register-settings.php:373
1189
- #: includes/admin/settings/tab-general.php:184
1190
  msgid ""
1191
  "By allowing us to track usage data we can better help you, because we know "
1192
  "with which WordPress configurations, themes and plugins we should test."
@@ -1209,72 +1264,72 @@ msgid "The callback function used for the %s setting is missing."
1209
  msgstr ""
1210
 
1211
  #: includes/admin/settings/settings-api.php:969
1212
- #: includes/admin/settings/tab-general.php:204
1213
  msgid "Save Changes"
1214
  msgstr ""
1215
 
1216
- #: includes/admin/settings/tab-general.php:98
1217
  msgid "Analytics Profile"
1218
  msgstr ""
1219
 
1220
- #: includes/admin/settings/tab-general.php:100
1221
  msgid "Google Authentication"
1222
  msgstr ""
1223
 
1224
- #: includes/admin/settings/tab-general.php:106
1225
  msgid "Profile Active: "
1226
  msgstr ""
1227
 
1228
- #: includes/admin/settings/tab-general.php:108
1229
  msgid "Re-Authenticate with your Google account"
1230
  msgstr ""
1231
 
1232
- #: includes/admin/settings/tab-general.php:109
1233
  msgid "Deauthenticate"
1234
  msgstr ""
1235
 
1236
- #: includes/admin/settings/tab-general.php:112
1237
  msgid "Authenticate with your Google account"
1238
  msgstr ""
1239
 
1240
- #: includes/admin/settings/tab-general.php:113
1241
  #, php-format
1242
  msgid ""
1243
  "Having issues automatically authenticating? %s Click here to authenticate "
1244
  "manually %s."
1245
  msgstr ""
1246
 
1247
- #: includes/admin/settings/tab-general.php:131
1248
  msgid "Manually enter your UA code"
1249
  msgstr ""
1250
 
1251
- #: includes/admin/settings/tab-general.php:135
1252
  msgid ""
1253
  "Warning: If you use a manual UA code, you won't be able to use the dashboard "
1254
  "or reports."
1255
  msgstr ""
1256
 
1257
- #: includes/admin/settings/tab-general.php:142
1258
  msgid "Disable Dashboard"
1259
  msgstr ""
1260
 
1261
- #: includes/admin/settings/tab-general.php:143
1262
  msgid "Hide the dashboard and reports pages."
1263
  msgstr ""
1264
 
1265
- #: includes/admin/settings/tab-general.php:150
1266
  msgid "Pick Tracking Mode"
1267
  msgstr ""
1268
 
1269
- #: includes/admin/settings/tab-general.php:156
1270
  msgid "GA.js (Deprecated)"
1271
  msgstr ""
1272
 
1273
- #: includes/admin/settings/tab-general.php:157
1274
  msgid "Analytics.js (Universal Analytics)"
1275
  msgstr ""
1276
 
1277
- #: includes/admin/settings/tab-general.php:159
1278
  #, php-format
1279
  msgid ""
1280
  "Warning: You're currently using deprecated ga.js tracking. We recommend "
@@ -1286,11 +1341,11 @@ msgid ""
1286
  "(analytics.js) %1$sclick here%2$s."
1287
  msgstr ""
1288
 
1289
- #: includes/admin/settings/tab-general.php:169
1290
  msgid "Switch to JS events tracking"
1291
  msgstr ""
1292
 
1293
- #: includes/admin/settings/tab-general.php:175
1294
  #, php-format
1295
  msgid ""
1296
  "Warning: You're currently using deprecated PHP based events tracking. We "
5
  "Project-Id-Version: MonsterInsights Lite\n"
6
  "Report-Msgid-Bugs-To: https://github.com/awesomemotive/monsterinsights/"
7
  "issues\n"
8
+ "POT-Creation-Date: 2017-08-09 13:08-0400\n"
9
  "PO-Revision-Date: 2016-07-21 17:01-0400\n"
10
  "Last-Translator: Chris Christoff <support@monsterinsights.com>\n"
11
  "Language-Team: Chris Christoff <support@monsterinsights.com>\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 2.0.3\n"
16
  "X-Poedit-Basepath: ..\n"
17
  "X-Poedit-WPHeader: googleanalytics.php\n"
18
  "X-Poedit-SourceCharset: UTF-8\n"
35
  "X-Poedit-SearchPathExcluded-12: *.css\n"
36
  "X-Poedit-SearchPathExcluded-13: googleanalytics-premium.php\n"
37
 
38
+ #: googleanalytics.php:229 googleanalytics.php:243
39
  msgid "Cheatin&#8217; huh?"
40
  msgstr ""
41
 
42
+ #: googleanalytics.php:384
43
  msgid ""
44
  "The version of MonsterInsights eCommerce addon you have is not compatible "
45
  "with the version of MonsterInsights installed. Please update the eCommerce "
46
  "addon as soon as possible"
47
  msgstr ""
48
 
49
+ #: googleanalytics.php:406
50
  #, php-format
51
  msgid ""
52
  "Sorry, but your version of WordPress does not meet MonsterInsights's "
54
  "activated. %3$sClick here to return to the Dashboard%4$s."
55
  msgstr ""
56
 
57
+ #: googleanalytics.php:427
58
  #, php-format
59
  msgid ""
60
  "Please %1$uninstall%2$s the MonsterInsights Lite Plugin. Your Pro version of "
62
  "uninstalled."
63
  msgstr ""
64
 
65
+ #: googleanalytics.php:577
66
  #, php-format
67
  msgid ""
68
  "Sorry, but your version of WordPress does not meet MonsterInsight's required "
70
  "%3$sClick here to return to the Dashboard%4$s."
71
  msgstr ""
72
 
73
+ #: googleanalytics.php:582
74
  #, php-format
75
  msgid ""
76
  "Please uninstall and remove MonsterInsights Pro before activating "
89
  msgstr ""
90
 
91
  #: includes/admin/admin.php:39 includes/admin/admin.php:49
92
+ #: includes/admin/admin.php:137
93
  msgid "Settings"
94
  msgstr ""
95
 
130
  msgid "Network Settings"
131
  msgstr ""
132
 
133
+ #: includes/admin/admin.php:119
134
  msgid "Documentation"
135
  msgstr ""
136
 
137
+ #: includes/admin/admin.php:124
138
  msgid "Get MonsterInsights Pro"
139
  msgstr ""
140
 
141
+ #: includes/admin/admin.php:130 includes/admin/admin.php:133
142
  msgid "Support"
143
  msgstr ""
144
 
145
+ #: includes/admin/admin.php:248
146
  #, php-format
147
  msgid ""
148
  "Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread "
149
  "the word. Thank you from the MonsterInsights team!"
150
  msgstr ""
151
 
152
+ #: includes/admin/admin.php:274
153
+ #, php-format
154
+ msgid ""
155
+ "Warning: You're currently using deprecated ga.js tracking which we will be "
156
+ "removing support for in an upcoming release. We recommend switching to "
157
+ "analytics.js, as it is significantly more accurate than ga.js, and allows "
158
+ "for functionality (like the more accurate Javascript based events tracking "
159
+ "we offer). Further Google Analytics has deprecated support for ga.js, and it "
160
+ "may stop working at any time when Google decides to disable it from their "
161
+ "server. To switch to using the newer Universal Analytics (analytics.js) "
162
+ "%1$sclick here%2$s. Users who do not manually switch over will be "
163
+ "automatically switched over in an upcoming release."
164
+ msgstr ""
165
+
166
+ #: includes/admin/admin.php:280
167
+ #, php-format
168
+ msgid ""
169
+ "Warning: You're currently using deprecated PHP based events tracking which "
170
+ "we will be removing support for in an upcoming release. We recommend "
171
+ "switching to JS events tracking, as it is significantly more accurate than "
172
+ "PHP based events tracking. To switch %1$sclick here%2$s. Users who do not "
173
+ "manually switch over will be automatically switched over in an upcoming "
174
+ "release."
175
+ msgstr ""
176
+
177
+ #: includes/admin/admin.php:286
178
+ #, php-format
179
+ msgid ""
180
+ "Important: Please %1$sconfigure the Automatic Updates Settings%2$s in "
181
+ "MonsterInsights."
182
+ msgstr ""
183
+
184
+ #: includes/admin/common.php:156
185
  msgid "Loading..."
186
  msgstr ""
187
 
188
+ #: includes/admin/common.php:157
189
  msgid ""
190
  "Warning: You have unsaved setting changes. If you leave the settings page "
191
  "without saving your changes will be lost. Did you still want to leave the "
192
  "page?"
193
  msgstr ""
194
 
195
+ #: includes/admin/common.php:159
196
  msgid "Status: Active"
197
  msgstr ""
198
 
199
+ #: includes/admin/common.php:160 includes/admin/pages/addons.php:492
200
  msgid "Activate"
201
  msgstr ""
202
 
203
+ #: includes/admin/common.php:161
204
  msgid "Status: Network Activated"
205
  msgstr ""
206
 
207
+ #: includes/admin/common.php:162 includes/admin/pages/addons.php:490
208
  msgid "Network activate"
209
  msgstr ""
210
 
211
+ #: includes/admin/common.php:164
212
  msgid "Activating..."
213
  msgstr ""
214
 
215
+ #: includes/admin/common.php:165 includes/admin/pages/addons.php:465
216
  #: includes/admin/pages/addons.php:467
217
  msgid "Deactivate"
218
  msgstr ""
219
 
220
+ #: includes/admin/common.php:166 includes/admin/pages/addons.php:463
221
  msgid "Network deactivate"
222
  msgstr ""
223
 
224
+ #: includes/admin/common.php:168
225
  msgid "Deactivating..."
226
  msgstr ""
227
 
228
+ #: includes/admin/common.php:169
229
  msgid "Status: Inactive"
230
  msgstr ""
231
 
232
+ #: includes/admin/common.php:170
233
  msgid "Status: Network inactive"
234
  msgstr ""
235
 
236
+ #: includes/admin/common.php:171 includes/admin/pages/addons.php:422
237
  msgid "Install"
238
  msgstr ""
239
 
240
+ #: includes/admin/common.php:173
241
  msgid "Installing..."
242
  msgstr ""
243
 
244
+ #: includes/admin/common.php:174
245
  msgid "Proceed"
246
  msgstr ""
247
 
248
+ #: includes/admin/common.php:176
249
  msgid "Copied!"
250
  msgstr ""
251
 
252
+ #: includes/admin/common.php:177
253
  msgid "Copy to Clipboard"
254
  msgstr ""
255
 
256
+ #: includes/admin/common.php:178
257
  msgid "Failed!"
258
  msgstr ""
259
 
260
+ #: includes/admin/common.php:180
261
  msgid "Shorten URL"
262
  msgstr ""
263
 
264
+ #: includes/admin/common.php:181
265
  msgid "Shortened!"
266
  msgstr ""
267
 
268
+ #: includes/admin/common.php:182
269
  msgid "Working..."
270
  msgstr ""
271
 
272
+ #: includes/admin/common.php:183 includes/admin/pages/tools.php:87
273
  msgid "Import"
274
  msgstr ""
275
 
276
+ #: includes/admin/common.php:184
277
  msgid "Imported!"
278
  msgstr ""
279
 
280
+ #: includes/admin/common.php:409
281
  #, php-format
282
  msgid ""
283
  "MonsterInsights has detected that it's files are being blocked. This is "
529
  "Congratulations! You have deactivated the key from this site successfully."
530
  msgstr ""
531
 
532
+ #: includes/admin/licensing/license.php:466
533
+ #: includes/admin/licensing/license.php:527
534
  #, php-format
535
  msgid ""
536
  "Your license key for MonsterInsights has expired. %1$sPlease click here to "
537
  "renew your license key and continue receiving automatic updates.%2$s"
538
  msgstr ""
539
 
540
+ #: includes/admin/licensing/license.php:475
541
+ #: includes/admin/licensing/license.php:536
542
  msgid ""
543
  "Your license key for MonsterInsights has been disabled. Please use a "
544
  "different key to continue receiving automatic updates."
545
  msgstr ""
546
 
547
+ #: includes/admin/licensing/license.php:484
548
+ #: includes/admin/licensing/license.php:545
549
  msgid ""
550
  "Your license key for MonsterInsights is invalid. The key no longer exists or "
551
  "the user associated with the key has been deleted. Please use a different "
552
  "key to continue receiving automatic updates."
553
  msgstr ""
554
 
555
+ #: includes/admin/licensing/license.php:518
556
  #, php-format
557
  msgid ""
558
  "No valid license key has been entered, so automatic updates for "
564
  msgid "There was an error installing the addon. Please try again."
565
  msgstr ""
566
 
567
+ #: includes/admin/notice.php:225
568
  msgid "Dismiss this notice"
569
  msgstr ""
570
 
687
  msgstr ""
688
 
689
  #: includes/admin/pages/network-settings.php:62
690
+ #: includes/admin/settings/tab-general.php:66
691
  msgid "License Key"
692
  msgstr ""
693
 
694
  #: includes/admin/pages/network-settings.php:68
695
+ #: includes/admin/settings/tab-general.php:72
696
  msgid "Verify Key"
697
  msgstr ""
698
 
699
  #: includes/admin/pages/network-settings.php:69
700
+ #: includes/admin/settings/tab-general.php:73
701
  msgid "Deactivate Key"
702
  msgstr ""
703
 
704
  #: includes/admin/pages/network-settings.php:70
705
+ #: includes/admin/settings/tab-general.php:74
706
  msgid ""
707
  "License key to enable automatic updates for MonsterInsights Pro & addons. "
708
  "Deactivate your license if you want to use it on another WordPress site."
709
  msgstr ""
710
 
711
  #: includes/admin/pages/network-settings.php:78
712
+ #: includes/admin/settings/tab-general.php:81
713
  msgid "License Key Type"
714
  msgstr ""
715
 
716
  #: includes/admin/pages/network-settings.php:82
717
+ #: includes/admin/settings/tab-general.php:85
718
  #, php-format
719
  msgid "Your license key type for this site is %s."
720
  msgstr ""
721
 
722
  #: includes/admin/pages/network-settings.php:85
723
+ #: includes/admin/settings/tab-general.php:88
724
  msgid "Refresh Key"
725
  msgstr ""
726
 
727
  #: includes/admin/pages/network-settings.php:86
728
+ #: includes/admin/settings/tab-general.php:89
729
  msgid ""
730
  "Your license key type (handles updates and Addons). Click refresh if your "
731
  "license has been upgraded or the type is incorrect."
1213
  msgstr ""
1214
 
1215
  #: includes/admin/settings/register-settings.php:372
1216
+ #: includes/admin/settings/tab-general.php:186
1217
+ msgid "Automatic Updates"
1218
+ msgstr ""
1219
+
1220
+ #: includes/admin/settings/register-settings.php:376
1221
+ #: includes/admin/settings/tab-general.php:189
1222
+ msgid ""
1223
+ "Yes (Recommended) - Get the latest features, bugfixes, and security updates "
1224
+ "as they are released."
1225
+ msgstr ""
1226
+
1227
+ #: includes/admin/settings/register-settings.php:377
1228
+ #: includes/admin/settings/tab-general.php:190
1229
+ msgid ""
1230
+ "Minor Only - Only get bugfixes and security updates, but not major features."
1231
+ msgstr ""
1232
+
1233
+ #: includes/admin/settings/register-settings.php:378
1234
+ #: includes/admin/settings/tab-general.php:191
1235
+ msgid "None - Manually update everything."
1236
+ msgstr ""
1237
+
1238
+ #: includes/admin/settings/register-settings.php:383
1239
+ #: includes/admin/settings/tab-general.php:198
1240
  msgid "Allow Usage Tracking"
1241
  msgstr ""
1242
 
1243
+ #: includes/admin/settings/register-settings.php:384
1244
+ #: includes/admin/settings/tab-general.php:199
1245
  msgid ""
1246
  "By allowing us to track usage data we can better help you, because we know "
1247
  "with which WordPress configurations, themes and plugins we should test."
1264
  msgstr ""
1265
 
1266
  #: includes/admin/settings/settings-api.php:969
1267
+ #: includes/admin/settings/tab-general.php:219
1268
  msgid "Save Changes"
1269
  msgstr ""
1270
 
1271
+ #: includes/admin/settings/tab-general.php:99
1272
  msgid "Analytics Profile"
1273
  msgstr ""
1274
 
1275
+ #: includes/admin/settings/tab-general.php:101
1276
  msgid "Google Authentication"
1277
  msgstr ""
1278
 
1279
+ #: includes/admin/settings/tab-general.php:107
1280
  msgid "Profile Active: "
1281
  msgstr ""
1282
 
1283
+ #: includes/admin/settings/tab-general.php:109
1284
  msgid "Re-Authenticate with your Google account"
1285
  msgstr ""
1286
 
1287
+ #: includes/admin/settings/tab-general.php:110
1288
  msgid "Deauthenticate"
1289
  msgstr ""
1290
 
1291
+ #: includes/admin/settings/tab-general.php:113
1292
  msgid "Authenticate with your Google account"
1293
  msgstr ""
1294
 
1295
+ #: includes/admin/settings/tab-general.php:114
1296
  #, php-format
1297
  msgid ""
1298
  "Having issues automatically authenticating? %s Click here to authenticate "
1299
  "manually %s."
1300
  msgstr ""
1301
 
1302
+ #: includes/admin/settings/tab-general.php:132
1303
  msgid "Manually enter your UA code"
1304
  msgstr ""
1305
 
1306
+ #: includes/admin/settings/tab-general.php:136
1307
  msgid ""
1308
  "Warning: If you use a manual UA code, you won't be able to use the dashboard "
1309
  "or reports."
1310
  msgstr ""
1311
 
1312
+ #: includes/admin/settings/tab-general.php:143
1313
  msgid "Disable Dashboard"
1314
  msgstr ""
1315
 
1316
+ #: includes/admin/settings/tab-general.php:144
1317
  msgid "Hide the dashboard and reports pages."
1318
  msgstr ""
1319
 
1320
+ #: includes/admin/settings/tab-general.php:151
1321
  msgid "Pick Tracking Mode"
1322
  msgstr ""
1323
 
1324
+ #: includes/admin/settings/tab-general.php:157
1325
  msgid "GA.js (Deprecated)"
1326
  msgstr ""
1327
 
1328
+ #: includes/admin/settings/tab-general.php:158
1329
  msgid "Analytics.js (Universal Analytics)"
1330
  msgstr ""
1331
 
1332
+ #: includes/admin/settings/tab-general.php:160
1333
  #, php-format
1334
  msgid ""
1335
  "Warning: You're currently using deprecated ga.js tracking. We recommend "
1341
  "(analytics.js) %1$sclick here%2$s."
1342
  msgstr ""
1343
 
1344
+ #: includes/admin/settings/tab-general.php:170
1345
  msgid "Switch to JS events tracking"
1346
  msgstr ""
1347
 
1348
+ #: includes/admin/settings/tab-general.php:176
1349
  #, php-format
1350
  msgid ""
1351
  "Warning: You're currently using deprecated PHP based events tracking. We "
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: chriscct7, smub
3
  Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, google analytics widget, universal google analytics, statistics, tracking, stats, google, yoast, google analytics by yoast, ga, monster insights, monsterinsights, universal analytics, web stats, ecommerce, ecommerce tracking
5
  Requires at least: 3.9
6
- Tested up to: 4.8.0
7
- Stable tag: 6.2.0
8
  License: GPL v3
9
 
10
  The best Google Analytics plugin for WordPress. See how visitors find and use your website, so you can keep them coming back.
@@ -136,6 +136,16 @@ You can also learn about other <a href="http://www.wpbeginner.com/category/plugi
136
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
137
 
138
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
139
  = 6.2.0: June 6, 2017 =
140
  * New: Form Tracking addon
141
  * New: Google Optimize addon
3
  Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, google analytics widget, universal google analytics, statistics, tracking, stats, google, yoast, google analytics by yoast, ga, monster insights, monsterinsights, universal analytics, web stats, ecommerce, ecommerce tracking
5
  Requires at least: 3.9
6
+ Tested up to: 4.8.1
7
+ Stable tag: 6.2.1
8
  License: GPL v3
9
 
10
  The best Google Analytics plugin for WordPress. See how visitors find and use your website, so you can keep them coming back.
136
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
137
 
138
  == Changelog ==
139
+ = 6.2.1: August 9, 2017 =
140
+ * New: MonsterInsights now has the ability to automatically update itself and it's addons. You can set MonsterInsights to automatically update minor versions only or all new versions inside the MonsterInsights settings panel in Tracking -> Permissions.
141
+ * Tweak: Introduce scrollbars on GA auth screen for users with many Google accounts
142
+ * Tweak: Added notice to users still on deprecated GA.js tracking and PHP-based events tracking.
143
+ * Fix: Issue with notices having multiple icons has been resolved.
144
+ * Fix: Facebook Instant Articles can now properly handle the Automattic Facebook plugin transformation changes (requires FB IA addon version 1.0.1 or newer)
145
+ * Fix: Conflict with wp_head output for some themes.
146
+ * Fix: Correct level for Forms and Google Optimize addons.
147
+ * Fix: License key errors will no longer show to lite users.
148
+
149
  = 6.2.0: June 6, 2017 =
150
  * New: Form Tracking addon
151
  * New: Google Optimize addon