Version Description
- Fixes some commit errors in 0.9.9.13.
Download this release
Release Info
Developer | Braekling |
Plugin | WP-Matomo (WP-Piwik) |
Version | 0.9.9.14 |
Comparing to | |
See all releases |
Code changes from version 0.9.9.12 to 0.9.9.14
- config.php +2 -2
- dashboard/overview.php +2 -2
- {cache → js/jqplot}/index.php +0 -0
- {languages → js/sparkline}/index.php +0 -0
- languages/wp-piwik-de_DE.mo +0 -0
- languages/wp-piwik-de_DE.po +5 -2
- logs/index.php +0 -2
- readme.txt +15 -6
- shortcodes/.htaccess +1 -0
- shortcodes/index.php +0 -2
- shortcodes/overview.php +9 -12
- shortcodes/post.php +1 -4
- wp-piwik.php +49 -37
config.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
Configure WP-Piwik Logger
|
5 |
0: Logger disabled
|
6 |
-
1: Log to screen
|
7 |
2: Log to file (logs/YYYYMMDD_wp-piwik.log)
|
8 |
*/
|
9 |
-
define('WP_PIWIK_ACTIVATE_LOGGER', 0);
|
3 |
/*
|
4 |
Configure WP-Piwik Logger
|
5 |
0: Logger disabled
|
6 |
+
1: Log to screen
|
7 |
2: Log to file (logs/YYYYMMDD_wp-piwik.log)
|
8 |
*/
|
9 |
+
define('WP_PIWIK_ACTIVATE_LOGGER', 0);
|
dashboard/overview.php
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
foreach ($aryDay as $strKey => $strValue) {
|
33 |
$intValCnt++;
|
34 |
if (!in_array($strKey, array('max_actions','bounce_rate','nb_actions_per_visit','avg_time_on_site')))
|
35 |
-
$aryTmp[$strKey] += $strValue;
|
36 |
elseif ($aryTmp[$strKey] < $strValue)
|
37 |
$aryTmp[$strKey] = $strValue;
|
38 |
}
|
@@ -67,4 +67,4 @@
|
|
67 |
</table>
|
68 |
</div>
|
69 |
<?php /************************************************************************/
|
70 |
-
}
|
32 |
foreach ($aryDay as $strKey => $strValue) {
|
33 |
$intValCnt++;
|
34 |
if (!in_array($strKey, array('max_actions','bounce_rate','nb_actions_per_visit','avg_time_on_site')))
|
35 |
+
if (isset($aryTmp[$strKey])) $aryTmp[$strKey] += $strValue;
|
36 |
elseif ($aryTmp[$strKey] < $strValue)
|
37 |
$aryTmp[$strKey] = $strValue;
|
38 |
}
|
67 |
</table>
|
68 |
</div>
|
69 |
<?php /************************************************************************/
|
70 |
+
}
|
{cache → js/jqplot}/index.php
RENAMED
File without changes
|
{languages → js/sparkline}/index.php
RENAMED
File without changes
|
languages/wp-piwik-de_DE.mo
CHANGED
Binary file
|
languages/wp-piwik-de_DE.po
CHANGED
@@ -364,8 +364,8 @@ msgstr "Vielen Dank an <strong>Dich</strong> für die Nutzung meines Plugins
|
|
364 |
msgid "Changes saved"
|
365 |
msgstr "Änderungen gespeichert"
|
366 |
|
367 |
-
msgid "installed"
|
368 |
-
msgstr "installiert"
|
369 |
|
370 |
msgid "Next you should connect to Piwik"
|
371 |
msgstr "Als nächstes solltest Du eine Verbindung zu Piwik herstellen"
|
@@ -757,6 +757,9 @@ msgstr "Besucher über alle Subdomains aufzeichnen"
|
|
757 |
msgid "Adds *.-prefix to cookie domain."
|
758 |
msgstr "Fügt ein *.-Präfix zur Cookie Domain hinzu."
|
759 |
|
|
|
|
|
|
|
760 |
msgid "Track visitors across all alias URLs"
|
761 |
msgstr "Besucher über alle alternative URLs aufzeichnen"
|
762 |
|
364 |
msgid "Changes saved"
|
365 |
msgstr "Änderungen gespeichert"
|
366 |
|
367 |
+
msgid "%s %s installed."
|
368 |
+
msgstr "%s %s installiert."
|
369 |
|
370 |
msgid "Next you should connect to Piwik"
|
371 |
msgstr "Als nächstes solltest Du eine Verbindung zu Piwik herstellen"
|
757 |
msgid "Adds *.-prefix to cookie domain."
|
758 |
msgstr "Fügt ein *.-Präfix zur Cookie Domain hinzu."
|
759 |
|
760 |
+
msgid "WP-Piwik requires at least PHP 5.3. You are using the deprecated version %s. Please update PHP to use WP-Piwik."
|
761 |
+
msgstr "WP-Piwik benötigt zumindest PHP 5.3. Du verwendest die veraltete Version %s. Bitte aktualisiere PHP um WP-Piwik zu nutzen."
|
762 |
+
|
763 |
msgid "Track visitors across all alias URLs"
|
764 |
msgstr "Besucher über alle alternative URLs aufzeichnen"
|
765 |
|
logs/index.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Nothing to see...
|
|
|
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== WP-Piwik ===
|
2 |
|
3 |
Contributors: Braekling
|
4 |
-
Requires at least: 3.
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 0.9.9.
|
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 |
|
@@ -121,10 +121,19 @@ Add WP-Piwik to your /wp-content/plugins folder and enable it as [Network Plugin
|
|
121 |
|
122 |
== Upgrade Notice ==
|
123 |
|
124 |
-
Please update Piwik if not done yet (Piwik 2.
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
= 0.9.9.12 =
|
129 |
* Bugfix: Avoid forced relogin on site change (WP network)
|
130 |
* Bugfix: Avoid multiple annotations on post updates
|
@@ -144,7 +153,7 @@ Please update Piwik if not done yet (Piwik 2.0 or higher is recommended)!
|
|
144 |
* Feature: Show page views (actions) in "visitors last 30"
|
145 |
|
146 |
= 0.9.9.9 =
|
147 |
-
* Update: PHP API will use namespaces (Piwik 2.x compatibility
|
148 |
* Update: Piwik URL isn't necessary to use PHP API anymore.
|
149 |
* Feature: Limit cookie lifetime
|
150 |
* Feature: Track visitors across all subdomains
|
@@ -402,4 +411,4 @@ Please update Piwik if not done yet (Piwik 2.0 or higher is recommended)!
|
|
402 |
* Browser stats and bounced visitors
|
403 |
|
404 |
= 0.2.0 =
|
405 |
-
* First public version.
|
1 |
=== WP-Piwik ===
|
2 |
|
3 |
Contributors: Braekling
|
4 |
+
Requires at least: 3.0
|
5 |
+
Tested up to: 4.1.1
|
6 |
+
Stable tag: 0.9.9.14
|
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 |
|
121 |
|
122 |
== Upgrade Notice ==
|
123 |
|
124 |
+
Please update Piwik if not done yet (Piwik 2.7 or higher is recommended). If you update Piwik and use the "add tracking code" feature, please also update your WP-Piwik tracking code: Just open the WP-Piwik tracking code settings and save them again.
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 0.9.9.14 =
|
129 |
+
* Fixes some commit errors in 0.9.9.13.
|
130 |
+
|
131 |
+
= 0.9.9.13 =
|
132 |
+
* Improvement: Only activate/ load admin components if an admin page is actually loaded. Thanks to Michael!
|
133 |
+
* Bugfix: Proxy tracking will work again. Piwik 2.7 or higher is recommended.
|
134 |
+
* Bugfix: Avoid a PHP notice in dashboard.
|
135 |
+
* NOTE: If you update Piwik and use the "add tracking code" feature, please also update your WP-Piwik tracking code: Just open the WP-Piwik tracking code settings and save them again.
|
136 |
+
|
137 |
= 0.9.9.12 =
|
138 |
* Bugfix: Avoid forced relogin on site change (WP network)
|
139 |
* Bugfix: Avoid multiple annotations on post updates
|
153 |
* Feature: Show page views (actions) in "visitors last 30"
|
154 |
|
155 |
= 0.9.9.9 =
|
156 |
+
* Update: PHP API will use namespaces (Piwik 2.x compatibility)
|
157 |
* Update: Piwik URL isn't necessary to use PHP API anymore.
|
158 |
* Feature: Limit cookie lifetime
|
159 |
* Feature: Track visitors across all subdomains
|
411 |
* Browser stats and bounced visitors
|
412 |
|
413 |
= 0.2.0 =
|
414 |
+
* First public version.
|
shortcodes/.htaccess
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Deny from all
|
shortcodes/index.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Nothing to see...
|
|
|
|
shortcodes/overview.php
CHANGED
@@ -10,22 +10,19 @@ $aryData = $this->callPiwikAPI('VisitsSummary.get',
|
|
10 |
|
11 |
$this->strResult = '<table><tr><th colspan="2">'.__('Overview', 'wp-piwik').($this->aryAttributes['title']?' '.$this->aryAttributes['title']:'').'</th></tr>';
|
12 |
|
13 |
-
function summize($aryData) {
|
14 |
-
$aryTmp = array();
|
15 |
-
foreach ($aryData as $aryValues)
|
16 |
-
foreach($aryValues as $strKey => $intValue)
|
17 |
-
if (isset($aryTmp[$strKey])) $aryTmp[$strKey] += $intValue;
|
18 |
-
else $aryTmp[$strKey] = $intValue;
|
19 |
-
$aryTmp['bounce_rate'] = ($aryTmp['nb_uniq_visitors']==0?0:round($aryTmp['bounce_count']/$aryTmp['nb_visits']*100,2)).'%';
|
20 |
-
|
21 |
-
return $aryTmp;
|
22 |
-
}
|
23 |
-
|
24 |
if (is_array($aryData)) {
|
25 |
if (isset($aryData['result']) && $aryData['result'] == 'error')
|
26 |
$this->strResult .= '<tr><td>'.__('Error', 'wp-piwik').':'.'</td><td>'.$aryData['message'].'</td></tr>';
|
27 |
else {
|
28 |
-
if (is_array(current($aryData)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
$aryData = summize($aryData);
|
30 |
$strTime =
|
31 |
floor($aryData['sum_visit_length']/3600).'h '.
|
10 |
|
11 |
$this->strResult = '<table><tr><th colspan="2">'.__('Overview', 'wp-piwik').($this->aryAttributes['title']?' '.$this->aryAttributes['title']:'').'</th></tr>';
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
if (is_array($aryData)) {
|
14 |
if (isset($aryData['result']) && $aryData['result'] == 'error')
|
15 |
$this->strResult .= '<tr><td>'.__('Error', 'wp-piwik').':'.'</td><td>'.$aryData['message'].'</td></tr>';
|
16 |
else {
|
17 |
+
if (is_array(current($aryData))) {
|
18 |
+
$aryTmp = array();
|
19 |
+
foreach ($aryData as $aryValues)
|
20 |
+
foreach($aryValues as $strKey => $intValue)
|
21 |
+
if (isset($aryTmp[$strKey])) $aryTmp[$strKey] += $intValue;
|
22 |
+
else $aryTmp[$strKey] = $intValue;
|
23 |
+
$aryTmp['bounce_rate'] = ($aryTmp['nb_uniq_visitors']==0?0:round($aryTmp['bounce_count']/$aryTmp['nb_visits']*100,2)).'%';
|
24 |
+
$aryData = $aryTmp;
|
25 |
+
}
|
26 |
$aryData = summize($aryData);
|
27 |
$strTime =
|
28 |
floor($aryData['sum_visit_length']/3600).'h '.
|
shortcodes/post.php
CHANGED
@@ -2,8 +2,5 @@
|
|
2 |
/*********************************
|
3 |
WP-Piwik::Short:Post
|
4 |
**********************************/
|
5 |
-
|
6 |
-
$this->includeFile('classes/WP_Piwik_MetaBox_PerPost_Stats');
|
7 |
-
|
8 |
-
$perPostClass = new WP_Piwik_MetaBox_PerPost_Stats($this->subClassConfig());
|
9 |
$this->strResult = $perPostClass->getValue($this->aryAttributes['range'], $this->aryAttributes['key']);
|
2 |
/*********************************
|
3 |
WP-Piwik::Short:Post
|
4 |
**********************************/
|
5 |
+
$perPostClass = new WP_Piwik_Template_MetaBoxPerPostStats($this->subClassConfig());
|
|
|
|
|
|
|
6 |
$this->strResult = $perPostClass->getValue($this->aryAttributes['range'], $this->aryAttributes['key']);
|
wp-piwik.php
CHANGED
@@ -6,12 +6,12 @@ Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
|
|
6 |
|
7 |
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress header.
|
8 |
|
9 |
-
Version: 0.9.9.
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
13 |
******************************************************************************************
|
14 |
-
Copyright (C) 2009-
|
15 |
|
16 |
This program is free software: you can redistribute it and/or modify
|
17 |
it under the terms of the GNU General Public License as published by
|
@@ -39,8 +39,8 @@ if (!class_exists('wp_piwik')) {
|
|
39 |
class wp_piwik {
|
40 |
|
41 |
private static
|
42 |
-
$intRevisionId =
|
43 |
-
$strVersion = '0.9.9.
|
44 |
$blog_id,
|
45 |
$intDashboardID = 30,
|
46 |
$strPluginBasename = NULL,
|
@@ -79,46 +79,58 @@ class wp_piwik {
|
|
79 |
$this->applySettings();
|
80 |
if ($this->isPHPMode())
|
81 |
self::definePiwikConstants();
|
82 |
-
|
|
|
83 |
}
|
84 |
|
85 |
private function addActions() {
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
94 |
if ($this->isToolbarActive()) {
|
|
|
95 |
add_action(is_admin()?'admin_head':'wp_head', array($this, 'loadToolbarRequirements'));
|
96 |
add_action('admin_bar_menu', array(&$this, 'extendWordPressToolbar'), 1000);
|
97 |
}
|
98 |
if ($this->isTrackingActive()) {
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
-
if (self::$settings->getGlobalOption('add_post_annotations'))
|
106 |
-
add_action('transition_post_status', array($this, 'onPostStatusTransition'),10,3);
|
107 |
}
|
108 |
|
109 |
private function addFilters() {
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
-
if ($this->isAddFeedCampaign())
|
118 |
-
add_filter('post_link', array(&$this, 'addFeedCampaign'));
|
119 |
}
|
120 |
}
|
121 |
-
|
122 |
private function addShortcodes() {
|
123 |
if ($this->isAddShortcode())
|
124 |
add_shortcode('wp-piwik', array(&$this, 'shortcode'));
|
@@ -164,7 +176,7 @@ class wp_piwik {
|
|
164 |
__('Next you should connect to Piwik','wp-piwik'):
|
165 |
__('Please validate your configuration','wp-piwik')
|
166 |
);
|
167 |
-
$link = sprintf('<a href="'
|
168 |
printf('<div class="updated fade"><p>%s<strong>%s:</strong> %s: %s</p></div>', $text, __('Important', 'wp-piwik'), $notice, $link);
|
169 |
}
|
170 |
|
@@ -849,14 +861,14 @@ class wp_piwik {
|
|
849 |
$strCode = html_entity_decode($strCode);
|
850 |
// Change code if js/index.php should be used
|
851 |
if (self::$settings->getGlobalOption('track_mode') == 1) {
|
852 |
-
$strCode = str_replace('piwik.js', 'js/', $strCode);
|
853 |
-
$strCode = str_replace('piwik.php', 'js/', $strCode);
|
854 |
} elseif (self::$settings->getGlobalOption('track_mode') == 2) {
|
855 |
$strCode = str_replace('piwik.js', 'piwik.php', $strCode);
|
856 |
-
$strURL = str_replace('https://', '
|
857 |
-
$strURL = str_replace('http://', '
|
858 |
-
$strProxy = str_replace('https://', '
|
859 |
-
$strProxy = str_replace('http://', '
|
860 |
$strProxy .= '/';
|
861 |
$strCode = str_replace($strURL, $strProxy, $strCode);
|
862 |
}
|
@@ -1530,4 +1542,4 @@ require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');
|
|
1530 |
if (class_exists('wp_piwik'))
|
1531 |
$GLOBALS['wp_piwik'] = new wp_piwik();
|
1532 |
|
1533 |
-
/* EOF */
|
6 |
|
7 |
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress header.
|
8 |
|
9 |
+
Version: 0.9.9.14
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
13 |
******************************************************************************************
|
14 |
+
Copyright (C) 2009-2015 Andre Braekling (email: webmaster@braekling.de)
|
15 |
|
16 |
This program is free software: you can redistribute it and/or modify
|
17 |
it under the terms of the GNU General Public License as published by
|
39 |
class wp_piwik {
|
40 |
|
41 |
private static
|
42 |
+
$intRevisionId = 94000,
|
43 |
+
$strVersion = '0.9.9.13',
|
44 |
$blog_id,
|
45 |
$intDashboardID = 30,
|
46 |
$strPluginBasename = NULL,
|
79 |
$this->applySettings();
|
80 |
if ($this->isPHPMode())
|
81 |
self::definePiwikConstants();
|
82 |
+
if (is_admin())
|
83 |
+
$this->loadLanguage();
|
84 |
}
|
85 |
|
86 |
private function addActions() {
|
87 |
+
if (is_admin()) {
|
88 |
+
add_action('admin_menu', array($this, 'buildAdminMenu'));
|
89 |
+
add_action('admin_post_save_wp-piwik_stats', array(&$this, 'onStatsPageSaveChanges'));
|
90 |
+
add_action('load-post.php', array(&$this, 'postMetaboxes'));
|
91 |
+
add_action('load-post-new.php', array(&$this, 'postMetaboxes'));
|
92 |
+
if ($this->isNetworkMode())
|
93 |
+
add_action('network_admin_menu', array($this, 'buildNetworkAdminMenu'));
|
94 |
+
if ($this->isDashboardActive())
|
95 |
+
add_action('wp_dashboard_setup', array($this, 'extendWordPressDashboard'));
|
96 |
+
if (self::$settings->getGlobalOption('add_post_annotations'))
|
97 |
+
add_action('transition_post_status', array($this, 'onPostStatusTransition'),10,3);
|
98 |
+
}
|
99 |
if ($this->isToolbarActive()) {
|
100 |
+
// is_admin_bar_showing() would be great to use, but it will break P3 Plugin Performance Profiler (https://wordpress.org/plugins/p3-profiler/)
|
101 |
add_action(is_admin()?'admin_head':'wp_head', array($this, 'loadToolbarRequirements'));
|
102 |
add_action('admin_bar_menu', array(&$this, 'extendWordPressToolbar'), 1000);
|
103 |
}
|
104 |
if ($this->isTrackingActive()) {
|
105 |
+
if (!is_admin()) {
|
106 |
+
add_action(self::$settings->getGlobalOption('track_codeposition') == 'footer'?'wp_footer':'wp_head', array($this, 'addJavascriptCode'));
|
107 |
+
if ($this->isAddNoScriptCode())
|
108 |
+
add_action('wp_footer', array($this, 'addNoscriptCode'));
|
109 |
+
}
|
110 |
+
else {
|
111 |
+
if ($this->isAdminTrackingActive())
|
112 |
+
add_action('admin_head', array($this, 'addAdminHeaderTracking'));
|
113 |
+
}
|
114 |
}
|
|
|
|
|
115 |
}
|
116 |
|
117 |
private function addFilters() {
|
118 |
+
if (is_admin()) {
|
119 |
+
add_filter('plugin_row_meta', array($this, 'setPluginMeta'), 10, 2);
|
120 |
+
add_filter('screen_layout_columns', array(&$this, 'onScreenLayoutColumns'), 10, 2);
|
121 |
+
}
|
122 |
+
else {
|
123 |
+
if ($this->isTrackingActive()) {
|
124 |
+
if ($this->isTrackFeed()) {
|
125 |
+
add_filter('the_excerpt_rss', array(&$this, 'addFeedTracking'));
|
126 |
+
add_filter('the_content', array(&$this, 'addFeedTracking'));
|
127 |
+
}
|
128 |
+
if ($this->isAddFeedCampaign())
|
129 |
+
add_filter('post_link', array(&$this, 'addFeedCampaign'));
|
130 |
}
|
|
|
|
|
131 |
}
|
132 |
}
|
133 |
+
|
134 |
private function addShortcodes() {
|
135 |
if ($this->isAddShortcode())
|
136 |
add_shortcode('wp-piwik', array(&$this, 'shortcode'));
|
176 |
__('Next you should connect to Piwik','wp-piwik'):
|
177 |
__('Please validate your configuration','wp-piwik')
|
178 |
);
|
179 |
+
$link = sprintf('<a href="'.$this->getSettingsURL().'?page=%s">%s</a>', self::$strPluginBasename, __('Settings', 'wp-piwik'));
|
180 |
printf('<div class="updated fade"><p>%s<strong>%s:</strong> %s: %s</p></div>', $text, __('Important', 'wp-piwik'), $notice, $link);
|
181 |
}
|
182 |
|
861 |
$strCode = html_entity_decode($strCode);
|
862 |
// Change code if js/index.php should be used
|
863 |
if (self::$settings->getGlobalOption('track_mode') == 1) {
|
864 |
+
$strCode = str_replace('piwik.js', 'js/index.php', $strCode);
|
865 |
+
$strCode = str_replace('piwik.php', 'js/index.php', $strCode);
|
866 |
} elseif (self::$settings->getGlobalOption('track_mode') == 2) {
|
867 |
$strCode = str_replace('piwik.js', 'piwik.php', $strCode);
|
868 |
+
$strURL = str_replace('https://', '//', self::$settings->getGlobalOption('piwik_url'));
|
869 |
+
$strURL = str_replace('http://', '//', $strURL);
|
870 |
+
$strProxy = str_replace('https://', '//', plugins_url('wp-piwik'));
|
871 |
+
$strProxy = str_replace('http://', '//', $strProxy);
|
872 |
$strProxy .= '/';
|
873 |
$strCode = str_replace($strURL, $strProxy, $strCode);
|
874 |
}
|
1542 |
if (class_exists('wp_piwik'))
|
1543 |
$GLOBALS['wp_piwik'] = new wp_piwik();
|
1544 |
|
1545 |
+
/* EOF */
|