Version Description
- Bugfix: Will also work with index.php in Piwik path
- Bugfix: last30 dashboard widget - show correct bounce rate
Download this release
Release Info
Developer | Braekling |
Plugin | WP-Matomo (WP-Piwik) |
Version | 0.8.8 |
Comparing to | |
See all releases |
Code changes from version 0.8.7 to 0.8.8
- dashboard/overview.php +5 -1
- languages/wp-piwik-de_DE.po +0 -0
- readme.txt +6 -2
- wp-piwik.php +14 -6
dashboard/overview.php
CHANGED
@@ -25,13 +25,17 @@
|
|
25 |
'nb_actions_per_visit' => 0,
|
26 |
'avg_time_on_site' => 0
|
27 |
);
|
|
|
28 |
foreach ($aryConf['data'] as $aryDay)
|
29 |
-
foreach ($aryDay as $strKey => $strValue)
|
|
|
30 |
if (!in_array($strKey, array('max_actions','bounce_rate','nb_actions_per_visit','avg_time_on_site')))
|
31 |
$aryTmp[$strKey] += $strValue;
|
32 |
elseif ($aryTmp[$strKey] < $strValue)
|
33 |
$aryTmp[$strKey] = $strValue;
|
|
|
34 |
$aryConf['data'] = $aryTmp;
|
|
|
35 |
}
|
36 |
/***************************************************************************/ ?>
|
37 |
<div class="table">
|
25 |
'nb_actions_per_visit' => 0,
|
26 |
'avg_time_on_site' => 0
|
27 |
);
|
28 |
+
$intValCnt = 0;
|
29 |
foreach ($aryConf['data'] as $aryDay)
|
30 |
+
foreach ($aryDay as $strKey => $strValue) {
|
31 |
+
$intValCnt++;
|
32 |
if (!in_array($strKey, array('max_actions','bounce_rate','nb_actions_per_visit','avg_time_on_site')))
|
33 |
$aryTmp[$strKey] += $strValue;
|
34 |
elseif ($aryTmp[$strKey] < $strValue)
|
35 |
$aryTmp[$strKey] = $strValue;
|
36 |
+
}
|
37 |
$aryConf['data'] = $aryTmp;
|
38 |
+
if ($intValCnt > 1 && $aryConf['data']['nb_visits'] >0) $aryConf['data']['bounce_rate'] = round($aryConf['data']['bounce_count']/$aryConf['data']['nb_visits']*100).'%';
|
39 |
}
|
40 |
/***************************************************************************/ ?>
|
41 |
<div class="table">
|
languages/wp-piwik-de_DE.po
CHANGED
File without changes
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== WP-Piwik ===
|
2 |
|
3 |
Contributors: Braekling
|
4 |
-
Requires at least: 3.
|
5 |
Tested up to: 3.1.3
|
6 |
-
Stable tag: 0.8.
|
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 |
|
@@ -78,6 +78,10 @@ Thank you, guys!
|
|
78 |
|
79 |
== Changelog ==
|
80 |
|
|
|
|
|
|
|
|
|
81 |
= 0.8.7 =
|
82 |
* New language files (Azerbaijani, Greek, Russian)
|
83 |
* Fixed hardcoded database prefix (WPMU-Piwik)
|
1 |
=== WP-Piwik ===
|
2 |
|
3 |
Contributors: Braekling
|
4 |
+
Requires at least: 3.1
|
5 |
Tested up to: 3.1.3
|
6 |
+
Stable tag: 0.8.8
|
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 |
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 0.8.8 =
|
82 |
+
* Bugfix: Will also work with index.php in Piwik path
|
83 |
+
* Bugfix: last30 dashboard widget - show correct bounce rate
|
84 |
+
|
85 |
= 0.8.7 =
|
86 |
* New language files (Azerbaijani, Greek, Russian)
|
87 |
* Fixed hardcoded database prefix (WPMU-Piwik)
|
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.
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
@@ -33,8 +33,8 @@ $GLOBALS['wp-piwik_wpmu'] = false;
|
|
33 |
class wp_piwik {
|
34 |
|
35 |
private static
|
36 |
-
$intRevisionId =
|
37 |
-
$strVersion = '0.8.
|
38 |
$intDashboardID = 6,
|
39 |
$bolWPMU = false,
|
40 |
$bolOverall = false,
|
@@ -193,6 +193,9 @@ class wp_piwik {
|
|
193 |
if (self::$aryGlobalSettings['revision'] < 80602) {
|
194 |
self::$aryGlobalSettings['dashboard_chart'] = false;
|
195 |
}
|
|
|
|
|
|
|
196 |
add_action('admin_footer', array($this, 'updateMessage'));
|
197 |
// Set current revision ID
|
198 |
self::$aryGlobalSettings['revision'] = self::$intRevisionId;
|
@@ -488,8 +491,7 @@ class wp_piwik {
|
|
488 |
'message' => 'Piwik base URL or auth token not set.'
|
489 |
);
|
490 |
return $this->aryCache[$strKey];
|
491 |
-
}
|
492 |
-
if (substr($strURL, -1, 1) != '/') $strURL .= '/';
|
493 |
$strURL .= '?module=API&method='.$strMethod;
|
494 |
$strURL .= '&idSite='.$intSite.'&period='.$strPeriod.'&date='.$strDate;
|
495 |
$strURL .= '&format=PHP&filter_limit='.$intLimit;
|
@@ -672,13 +674,19 @@ class wp_piwik {
|
|
672 |
self::$aryGlobalSettings['default_date'] = (isset($_POST['wp-piwik_default_date'])?$_POST['wp-piwik_default_date']:'yesterday');
|
673 |
}
|
674 |
self::$aryGlobalSettings['piwik_token'] = (isset($_POST['wp-piwik_token'])?$_POST['wp-piwik_token']:'');
|
675 |
-
self::$aryGlobalSettings['piwik_url']
|
676 |
self::$aryGlobalSettings['capability_stealth'] = (isset($_POST['wp-piwik_filter'])?$_POST['wp-piwik_filter']:array());
|
677 |
self::$aryGlobalSettings['capability_read_stats'] = (isset($_POST['wp-piwik_displayto'])?$_POST['wp-piwik_displayto']:array());
|
678 |
self::$aryGlobalSettings['last_settings_update'] = time();
|
679 |
self::saveSettings();
|
680 |
}
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
function show_settings() {
|
683 |
$strToken = self::$aryGlobalSettings['piwik_token'];
|
684 |
$strURL = self::$aryGlobalSettings['piwik_url'];
|
6 |
|
7 |
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
|
8 |
|
9 |
+
Version: 0.8.8
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
33 |
class wp_piwik {
|
34 |
|
35 |
private static
|
36 |
+
$intRevisionId = 80800,
|
37 |
+
$strVersion = '0.8.8',
|
38 |
$intDashboardID = 6,
|
39 |
$bolWPMU = false,
|
40 |
$bolOverall = false,
|
193 |
if (self::$aryGlobalSettings['revision'] < 80602) {
|
194 |
self::$aryGlobalSettings['dashboard_chart'] = false;
|
195 |
}
|
196 |
+
if (self::$aryGlobalSettings['revision'] < 80800) {
|
197 |
+
self::$aryGlobalSettings['piwik_url'] = self::check_url(self::$aryGlobalSettings['piwik_url']);
|
198 |
+
}
|
199 |
add_action('admin_footer', array($this, 'updateMessage'));
|
200 |
// Set current revision ID
|
201 |
self::$aryGlobalSettings['revision'] = self::$intRevisionId;
|
491 |
'message' => 'Piwik base URL or auth token not set.'
|
492 |
);
|
493 |
return $this->aryCache[$strKey];
|
494 |
+
}
|
|
|
495 |
$strURL .= '?module=API&method='.$strMethod;
|
496 |
$strURL .= '&idSite='.$intSite.'&period='.$strPeriod.'&date='.$strDate;
|
497 |
$strURL .= '&format=PHP&filter_limit='.$intLimit;
|
674 |
self::$aryGlobalSettings['default_date'] = (isset($_POST['wp-piwik_default_date'])?$_POST['wp-piwik_default_date']:'yesterday');
|
675 |
}
|
676 |
self::$aryGlobalSettings['piwik_token'] = (isset($_POST['wp-piwik_token'])?$_POST['wp-piwik_token']:'');
|
677 |
+
self::$aryGlobalSettings['piwik_url'] = self::check_url((isset($_POST['wp-piwik_url'])?$_POST['wp-piwik_url']:''));
|
678 |
self::$aryGlobalSettings['capability_stealth'] = (isset($_POST['wp-piwik_filter'])?$_POST['wp-piwik_filter']:array());
|
679 |
self::$aryGlobalSettings['capability_read_stats'] = (isset($_POST['wp-piwik_displayto'])?$_POST['wp-piwik_displayto']:array());
|
680 |
self::$aryGlobalSettings['last_settings_update'] = time();
|
681 |
self::saveSettings();
|
682 |
}
|
683 |
|
684 |
+
static function check_url($strURL) {
|
685 |
+
if (substr($strURL, -1, 1) != '/' && substr($strURL, -10, 10) != '/index.php')
|
686 |
+
$strURL .= '/';
|
687 |
+
return $strURL;
|
688 |
+
}
|
689 |
+
|
690 |
function show_settings() {
|
691 |
$strToken = self::$aryGlobalSettings['piwik_token'];
|
692 |
$strURL = self::$aryGlobalSettings['piwik_url'];
|