WP-Matomo (WP-Piwik) - Version 0.8.3

Version Description

  • Piwik 1.1+ compatibility fix
Download this release

Release Info

Developer Braekling
Plugin Icon 128x128 WP-Matomo (WP-Piwik)
Version 0.8.3
Comparing to
See all releases

Code changes from version 0.8.2 to 0.8.3

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-piwik.php +10 -6
readme.txt CHANGED
@@ -3,7 +3,7 @@
3
  Contributors: Braekling
4
  Requires at least: 3.0
5
  Tested up to: 3.0.1
6
- Stable tag: 0.8.2
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
8
  Tags: statistics, stats, analytics, piwik, wpmu
9
 
@@ -75,6 +75,9 @@ Thank you, guys!
75
 
76
  == Changelog ==
77
 
 
 
 
78
  = 0.8.2 =
79
  * Bugfix: [WPMU URL update bug](http://wordpress.org/support/topic/plugin-wp-piwik-jscode-not-updated-when-saving-new-url-in-wpmu-mode)
80
 
3
  Contributors: Braekling
4
  Requires at least: 3.0
5
  Tested up to: 3.0.1
6
+ Stable tag: 0.8.3
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
8
  Tags: statistics, stats, analytics, piwik, wpmu
9
 
75
 
76
  == Changelog ==
77
 
78
+ = 0.8.3 =
79
+ * Piwik 1.1+ compatibility fix
80
+
81
  = 0.8.2 =
82
  * Bugfix: [WPMU URL update bug](http://wordpress.org/support/topic/plugin-wp-piwik-jscode-not-updated-when-saving-new-url-in-wpmu-mode)
83
 
wp-piwik.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/
6
 
7
  Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
8
 
9
- Version: 0.8.2
10
  Author: André Bräkling
11
  Author URI: http://www.braekling.de
12
 
@@ -31,7 +31,7 @@ $GLOBALS['wp-piwik_wpmu'] = false;
31
 
32
  class wp_piwik {
33
 
34
- public static $intRevisionId = 19;
35
  public static $intDashboardID = 6;
36
  public static $bolWPMU = false;
37
  public static $bolOverall = false;
@@ -67,6 +67,7 @@ class wp_piwik {
67
  delete_option('wp-piwik_disable_gapi');
68
  $intDisplayTo = get_option('wp-piwik_displayto', 8);
69
  update_option('wp-piwik_displayto', 'level_'.$intDisplayTo);
 
70
  }
71
 
72
  function footer() {
@@ -88,10 +89,13 @@ class wp_piwik {
88
  $intSettingsUp = get_site_option('wpmu-piwik_settingsupdate', time());
89
  $intJavaScriptUp = get_option('wp-piwik_scriptupdate', 0);
90
  if ($intJavaScriptUp < $intSettingsUp) {
91
- $strJSCode = $this->call_API('SitesManager.getJavascriptTag');
92
  update_option('wp-piwik_jscode', $strJSCode);
93
  update_option('wp-piwik_scriptupdate', time());
94
  }
 
 
 
95
  }
96
  if (is_404() and $int404) $strJSCode = str_replace('piwikTracker.trackPageView();', 'piwikTracker.setDocumentTitle(\'404/URL = \'+encodeURIComponent(document.location.pathname+document.location.search) + \'/From = \' + encodeURIComponent(document.referrer));piwikTracker.trackPageView();', $strJSCode);
97
  if ($bolDisplay) echo $strJSCode;
@@ -282,9 +286,9 @@ class wp_piwik {
282
  if (!empty($strResult)) {
283
  update_option('wp-piwik_siteid', $strResult);
284
  update_option('wp-piwik_scriptupdate', time());
285
- $strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
286
  }
287
- } else $strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
288
  update_option('wp-piwik_jscode', $strJavaScript);
289
  }
290
  return array('js' => $strJavaScript, 'id' => $intSite);
@@ -509,7 +513,7 @@ class wp_piwik {
509
  $intAddJS = get_option('wp-piwik_addjs');
510
  $intDashboardWidget = get_option('wp-piwik_dbwidget');
511
  $intShowLink = get_option('wp-piwik_piwiklink');
512
- $strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
513
  if ($intAddJS)
514
  update_option('wp-piwik_jscode', $strJavaScript);
515
  /***************************************************************************/ ?>
6
 
7
  Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
8
 
9
+ Version: 0.8.3
10
  Author: Andr&eacute; Br&auml;kling
11
  Author URI: http://www.braekling.de
12
 
31
 
32
  class wp_piwik {
33
 
34
+ public static $intRevisionId = 25;
35
  public static $intDashboardID = 6;
36
  public static $bolWPMU = false;
37
  public static $bolOverall = false;
67
  delete_option('wp-piwik_disable_gapi');
68
  $intDisplayTo = get_option('wp-piwik_displayto', 8);
69
  update_option('wp-piwik_displayto', 'level_'.$intDisplayTo);
70
+ update_option('wp-piwik_jscode', '');
71
  }
72
 
73
  function footer() {
89
  $intSettingsUp = get_site_option('wpmu-piwik_settingsupdate', time());
90
  $intJavaScriptUp = get_option('wp-piwik_scriptupdate', 0);
91
  if ($intJavaScriptUp < $intSettingsUp) {
92
+ $strJSCode = html_entity_decode($this->call_API('SitesManager.getJavascriptTag'));
93
  update_option('wp-piwik_jscode', $strJSCode);
94
  update_option('wp-piwik_scriptupdate', time());
95
  }
96
+ } elseif (empty($strJSCode)) {
97
+ $strJSCode = html_entity_decode($this->call_API('SitesManager.getJavascriptTag'));
98
+ update_option('wp-piwik_jscode', $strJSCode);
99
  }
100
  if (is_404() and $int404) $strJSCode = str_replace('piwikTracker.trackPageView();', 'piwikTracker.setDocumentTitle(\'404/URL = \'+encodeURIComponent(document.location.pathname+document.location.search) + \'/From = \' + encodeURIComponent(document.referrer));piwikTracker.trackPageView();', $strJSCode);
101
  if ($bolDisplay) echo $strJSCode;
286
  if (!empty($strResult)) {
287
  update_option('wp-piwik_siteid', $strResult);
288
  update_option('wp-piwik_scriptupdate', time());
289
+ $strJavaScript = html_entity_decode($this->call_API('SitesManager.getJavascriptTag'));
290
  }
291
+ } else $strJavaScript = html_entity_decode($this->call_API('SitesManager.getJavascriptTag'));
292
  update_option('wp-piwik_jscode', $strJavaScript);
293
  }
294
  return array('js' => $strJavaScript, 'id' => $intSite);
513
  $intAddJS = get_option('wp-piwik_addjs');
514
  $intDashboardWidget = get_option('wp-piwik_dbwidget');
515
  $intShowLink = get_option('wp-piwik_piwiklink');
516
+ $strJavaScript = html_entity_decode($this->call_API('SitesManager.getJavascriptTag'));
517
  if ($intAddJS)
518
  update_option('wp-piwik_jscode', $strJavaScript);
519
  /***************************************************************************/ ?>