WP-Matomo (WP-Piwik) - Version 0.8.2

Version Description

  • Bugfix: WPMU URL update bug
Download this release

Release Info

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

Code changes from version 0.8.1 to 0.8.2

Files changed (2) hide show
  1. readme.txt +11 -5
  2. wp-piwik.php +13 -3
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP-Piwik ===
2
 
3
  Contributors: Braekling
4
- Requires at least: 3.0.0
5
  Tested up to: 3.0.1
6
- Stable tag: 0.8.1
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
 
@@ -13,7 +13,8 @@ This plugin adds a piwik stats site to your WordPress or WordPress multisite das
13
 
14
  This plugin adds a Piwik stats site to your WordPress dashboard. It's also able to add the Piwik tracking code to your blog using wp_footer.
15
 
16
- You need a running Piwik installation and at least view access to your stats.
 
17
 
18
  Look at the [Piwik website](http://piwik.org/) to get further information about Piwik.
19
 
@@ -21,9 +22,11 @@ Look at the [Piwik website](http://piwik.org/) to get further information about
21
 
22
  Languages: English, Albanian, Belorussian, Dutch, French, German, Swedish, Norwegian
23
 
 
 
24
  = WP multisite =
25
 
26
- Version 0.6.0 includes experimental WP multisite support.
27
 
28
  **Experimental**
29
 
@@ -49,7 +52,7 @@ Just add WP-Piwik to your /wp-content/plugins folder. So each user can enable WP
49
  * Dutch [nl_NL] language file by [Rene](http://www.pamukkaleturkey.com/).
50
  * French [fr_FR] language file by Fab.
51
  * Swedish [sv_SE] language file by [EzBizNiz](http://ezbizniz.com/).
52
- * Norwegian [no_NO] language file by Gormer.
53
 
54
  Thank you, guys!
55
 
@@ -72,6 +75,9 @@ Thank you, guys!
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 0.8.1 =
76
  * Use load_plugin_textdomain instead of load_textdomain
77
  * Fixed js/css links if symbolic links are used
1
  === WP-Piwik ===
2
 
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
 
13
 
14
  This plugin adds a Piwik stats site to your WordPress dashboard. It's also able to add the Piwik tracking code to your blog using wp_footer.
15
 
16
+ You need a running Piwik installation and at least view access to your stats. Also PHP 5 or higher is strictly required.
17
+
18
 
19
  Look at the [Piwik website](http://piwik.org/) to get further information about Piwik.
20
 
22
 
23
  Languages: English, Albanian, Belorussian, Dutch, French, German, Swedish, Norwegian
24
 
25
+ *Note: If you vote "It's broken", please tell me about your problem. It's hard to fix a bug I don't know about! ;)*
26
+
27
  = WP multisite =
28
 
29
+ Version 0.6.0+ includes experimental WP multisite support.
30
 
31
  **Experimental**
32
 
52
  * Dutch [nl_NL] language file by [Rene](http://www.pamukkaleturkey.com/).
53
  * French [fr_FR] language file by Fab.
54
  * Swedish [sv_SE] language file by [EzBizNiz](http://ezbizniz.com/).
55
+ * Norwegian [nb_NO] language file by Gormer.
56
 
57
  Thank you, guys!
58
 
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
+
81
  = 0.8.1 =
82
  * Use load_plugin_textdomain instead of load_textdomain
83
  * Fixed js/css links if symbolic links are used
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.1
10
  Author: André Bräkling
11
  Author URI: http://www.braekling.de
12
 
@@ -42,8 +42,8 @@ class wp_piwik {
42
  $intCurrentRevision = get_site_option('wpmu-piwik_revision', 0);
43
  } else $intCurrentRevision = get_option('wp-piwik_revision',0);
44
  if ($intCurrentRevision < self::$intRevisionId) $this->install();
45
- load_plugin_textdomain('wp-piwik', false, dirname(plugin_basename(__FILE__))."/languages/");
46
-
47
  register_activation_hook(__FILE__, array($this, 'install'));
48
 
49
  if (!self::$bolWPMU)
@@ -84,6 +84,14 @@ class wp_piwik {
84
  if (self::$bolWPMU && empty($strJSCode)) {
85
  $aryReturn = $this->create_wpmu_site();
86
  $strJSCode = $aryReturn['js'];
 
 
 
 
 
 
 
 
87
  }
88
  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);
89
  if ($bolDisplay) echo $strJSCode;
@@ -273,6 +281,7 @@ class wp_piwik {
273
  $strResult = unserialize($this->get_remote_file($strURL));
274
  if (!empty($strResult)) {
275
  update_option('wp-piwik_siteid', $strResult);
 
276
  $strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
277
  }
278
  } else $strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
@@ -594,6 +603,7 @@ class wp_piwik {
594
  update_site_option('wpmu-piwik_token', $_POST['wp-piwik_token'],'');
595
  update_site_option('wpmu-piwik_url', $_POST['wp-piwik_url'],'');
596
  update_site_option('wpmu-piwik_filter', $_POST['wp-piwik_filter'],'');
 
597
  }
598
 
599
  function show_mu_settings() {
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&eacute; Br&auml;kling
11
  Author URI: http://www.braekling.de
12
 
42
  $intCurrentRevision = get_site_option('wpmu-piwik_revision', 0);
43
  } else $intCurrentRevision = get_option('wp-piwik_revision',0);
44
  if ($intCurrentRevision < self::$intRevisionId) $this->install();
45
+ load_plugin_textdomain('wp-piwik', false, dirname(plugin_basename(__FILE__))."/languages/");
46
+
47
  register_activation_hook(__FILE__, array($this, 'install'));
48
 
49
  if (!self::$bolWPMU)
84
  if (self::$bolWPMU && empty($strJSCode)) {
85
  $aryReturn = $this->create_wpmu_site();
86
  $strJSCode = $aryReturn['js'];
87
+ } elseif (self::$bolWPMU) {
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;
281
  $strResult = unserialize($this->get_remote_file($strURL));
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');
603
  update_site_option('wpmu-piwik_token', $_POST['wp-piwik_token'],'');
604
  update_site_option('wpmu-piwik_url', $_POST['wp-piwik_url'],'');
605
  update_site_option('wpmu-piwik_filter', $_POST['wp-piwik_filter'],'');
606
+ update_site_option('wpmu-piwik_settingsupdate', time(),0);
607
  }
608
 
609
  function show_mu_settings() {