Version Description
- Bugfix: PHP API causes plain text output issue, see http://wordpress.org/support/topic/bug-cant-access-to-tabs-in-setting-after-configuration
- Bugfix: PHP API causes WordPress multisite login issue, see http://wordpress.org/support/topic/causes-multisite-superadmin-subsite-login-problem
- Bugfix: Removed PHP warning if annotations are enabled and annotations will work again, see http://wordpress.org/support/topic/warning-message-everywhere-in-the-backend-call_user_func_array-expects
- Feature: "Track visitors across all subdomains" script changes are done by Piwik now, see http://wordpress.org/support/topic/track-across-subdomains-wp-on-subdomain?replies=2
- Update: Flattr API update
Download this release
Release Info
Developer | Braekling |
Plugin | WP-Matomo (WP-Piwik) |
Version | 0.9.9.11 |
Comparing to | |
See all releases |
Code changes from version 0.9.9.10 to 0.9.9.11
- readme.txt +10 -3
- update/91007.php +1 -1
- wp-piwik.php +39 -17
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
|
3 |
Contributors: Braekling
|
4 |
Requires at least: 3.8
|
5 |
-
Tested up to: 3.9
|
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 |
|
@@ -125,9 +125,16 @@ Please update Piwik if not done yet (Piwik 2.0 or higher is recommended)!
|
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
= 0.9.9.10 =
|
129 |
* Bugfix: Multisite login issue, see http://wordpress.org/support/topic/0999-multisite-frontend-not-logged-in
|
130 |
-
* Bugfix:
|
131 |
* Feature: Show page views (actions) in "visitors last 30"
|
132 |
|
133 |
= 0.9.9.9 =
|
2 |
|
3 |
Contributors: Braekling
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 3.9.1
|
6 |
+
Stable tag: 0.9.9.11
|
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 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 0.9.9.11 =
|
129 |
+
* Bugfix: PHP API causes plain text output issue, see http://wordpress.org/support/topic/bug-cant-access-to-tabs-in-setting-after-configuration
|
130 |
+
* Bugfix: PHP API causes WordPress multisite login issue, see http://wordpress.org/support/topic/causes-multisite-superadmin-subsite-login-problem
|
131 |
+
* Bugfix: Removed PHP warning if annotations are enabled and annotations will work again, see http://wordpress.org/support/topic/warning-message-everywhere-in-the-backend-call_user_func_array-expects
|
132 |
+
* Feature: "Track visitors across all subdomains" script changes are done by Piwik now, see http://wordpress.org/support/topic/track-across-subdomains-wp-on-subdomain?replies=2
|
133 |
+
* Update: Flattr API update
|
134 |
+
|
135 |
= 0.9.9.10 =
|
136 |
* Bugfix: Multisite login issue, see http://wordpress.org/support/topic/0999-multisite-frontend-not-logged-in
|
137 |
+
* Bugfix: wpMandrill compatibility, see http://wordpress.org/support/topic/version-0999-conflicts-with-wpmandrill
|
138 |
* Feature: Show page views (actions) in "visitors last 30"
|
139 |
|
140 |
= 0.9.9.9 =
|
update/91007.php
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?php
|
2 |
-
self::$settings->setGlobalOption('track_codeposition', footer);
|
1 |
<?php
|
2 |
+
self::$settings->setGlobalOption('track_codeposition', 'footer');
|
wp-piwik.php
CHANGED
@@ -6,7 +6,7 @@ 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 |
|
@@ -40,7 +40,7 @@ class wp_piwik {
|
|
40 |
|
41 |
private static
|
42 |
$intRevisionId = 92000,
|
43 |
-
$strVersion = '0.9.9.
|
44 |
$blog_id,
|
45 |
$intDashboardID = 30,
|
46 |
$strPluginBasename = NULL,
|
@@ -672,6 +672,7 @@ class wp_piwik {
|
|
672 |
*/
|
673 |
function addAdminHeaderSettings() {
|
674 |
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
|
|
|
675 |
}
|
676 |
|
677 |
/**
|
@@ -741,6 +742,11 @@ class wp_piwik {
|
|
741 |
return;
|
742 |
if (PIWIK_INCLUDE_PATH === FALSE)
|
743 |
return serialize(array('result' => 'error', 'message' => __('Could not resolve','wp-piwik').' "'.htmlentities(self::$settings->getGlobalOption('piwik_path')).'": '.__('realpath() returns false','wp-piwik').'.'));
|
|
|
|
|
|
|
|
|
|
|
744 |
if (file_exists(PIWIK_INCLUDE_PATH . "/index.php"))
|
745 |
require_once PIWIK_INCLUDE_PATH . "/index.php";
|
746 |
if (file_exists(PIWIK_INCLUDE_PATH . "/core/API/Request.php"))
|
@@ -751,6 +757,11 @@ class wp_piwik {
|
|
751 |
if (class_exists('Piwik\API\Request'))
|
752 |
$objRequest = new Piwik\API\Request($strParams);
|
753 |
else serialize(array('result' => 'error', 'message' => __('Class Piwik\API\Request does not exists.','wp-piwik')));
|
|
|
|
|
|
|
|
|
|
|
754 |
return $objRequest->process();
|
755 |
}
|
756 |
|
@@ -857,10 +868,6 @@ class wp_piwik {
|
|
857 |
// Change code if POST is forced to be used
|
858 |
if (self::$settings->getGlobalOption('track_post') && self::$settings->getGlobalOption('track_mode') != 2) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setRequestMethod', 'POST']);\n_paq.push(['trackPageView']);", $strCode);
|
859 |
// Change code if cookies are disabled
|
860 |
-
if (self::$settings->getGlobalOption('track_across')) {
|
861 |
-
$referrerParsed = parse_url(get_bloginfo('url'));
|
862 |
-
$strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setCookieDomain', '*.".$referrerParsed['host']."']);\n_paq.push(['trackPageView']);", $strCode);
|
863 |
-
}
|
864 |
if (self::$settings->getGlobalOption('disable_cookies')) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['disableCookies']);\n_paq.push(['trackPageView']);", $strCode);
|
865 |
if (self::$settings->getGlobalOption('limit_cookies')) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setVisitorCookieTimeout', '".self::$settings->getGlobalOption('limit_cookies_visitor')."']);\n_paq.push(['setSessionCookieTimeout', '".self::$settings->getGlobalOption('limit_cookies_session')."']);\n_paq.push(['trackPageView']);", $strCode);
|
866 |
// Store <noscript> code
|
@@ -945,8 +952,11 @@ class wp_piwik {
|
|
945 |
$strURL .= '&format='.$strFormat;
|
946 |
$strURL .= ($strPageURL?'&pageUrl='.urlencode($strPageURL):'');
|
947 |
$strURL .= ($strNote?'¬e='.urlencode($strNote):'');
|
|
|
|
|
|
|
948 |
// Fetch data if site exists
|
949 |
-
if (!empty($intSite) || $strMethod
|
950 |
self::$logger->log('API method: '.$strMethod.' API call: '.$strURL);
|
951 |
$strResult = (string) $this->getRemoteFile($strURL, get_bloginfo('url'));
|
952 |
$result = ($strFormat == 'PHP'?unserialize($strResult):$strResult);
|
@@ -1275,11 +1285,20 @@ class wp_piwik {
|
|
1275 |
<div class="wp-piwik-donate">
|
1276 |
<p><strong><?php _e('Donate','wp-piwik'); ?></strong></p>
|
1277 |
<p><?php _e('If you like WP-Piwik, you can support its development by a donation:', 'wp-piwik'); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1278 |
<div>
|
1279 |
-
<
|
1280 |
-
var flattr_url = 'http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress';
|
1281 |
-
</script>
|
1282 |
-
<script src="http<?php echo (self::isSSL()?'s':''); ?>://api.flattr.com/button/load.js" type="text/javascript"></script>
|
1283 |
</div>
|
1284 |
<div>Paypal
|
1285 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
@@ -1427,11 +1446,14 @@ class wp_piwik {
|
|
1427 |
}
|
1428 |
|
1429 |
private static function definePiwikConstants() {
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
|
|
|
|
|
|
1435 |
}
|
1436 |
|
1437 |
private function openLogger() {
|
@@ -1490,7 +1512,7 @@ class wp_piwik {
|
|
1490 |
$this->addNoscriptCode();
|
1491 |
}
|
1492 |
|
1493 |
-
|
1494 |
if ($newStatus == 'publish' && $oldStatus != 'publish' ) {
|
1495 |
add_action('publish_post', array($this, 'addPiwikAnnotation'));
|
1496 |
}
|
6 |
|
7 |
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress header.
|
8 |
|
9 |
+
Version: 0.9.9.11
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
40 |
|
41 |
private static
|
42 |
$intRevisionId = 92000,
|
43 |
+
$strVersion = '0.9.9.11',
|
44 |
$blog_id,
|
45 |
$intDashboardID = 30,
|
46 |
$strPluginBasename = NULL,
|
672 |
*/
|
673 |
function addAdminHeaderSettings() {
|
674 |
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
|
675 |
+
echo '<script type="text/javascript">/* <![CDATA[ */(function() {var s = document.createElement(\'script\');var t = document.getElementsByTagName(\'script\')[0];s.type = \'text/javascript\';s.async = true;s.src = \'//api.flattr.com/js/0.6/load.js?mode=auto\';t.parentNode.insertBefore(s, t);})();/* ]]> */</script>';
|
676 |
}
|
677 |
|
678 |
/**
|
742 |
return;
|
743 |
if (PIWIK_INCLUDE_PATH === FALSE)
|
744 |
return serialize(array('result' => 'error', 'message' => __('Could not resolve','wp-piwik').' "'.htmlentities(self::$settings->getGlobalOption('piwik_path')).'": '.__('realpath() returns false','wp-piwik').'.'));
|
745 |
+
if (!headers_sent()) {
|
746 |
+
$current = ob_get_contents();
|
747 |
+
ob_end_clean();
|
748 |
+
ob_start();
|
749 |
+
}
|
750 |
if (file_exists(PIWIK_INCLUDE_PATH . "/index.php"))
|
751 |
require_once PIWIK_INCLUDE_PATH . "/index.php";
|
752 |
if (file_exists(PIWIK_INCLUDE_PATH . "/core/API/Request.php"))
|
757 |
if (class_exists('Piwik\API\Request'))
|
758 |
$objRequest = new Piwik\API\Request($strParams);
|
759 |
else serialize(array('result' => 'error', 'message' => __('Class Piwik\API\Request does not exists.','wp-piwik')));
|
760 |
+
if (!headers_sent()) {
|
761 |
+
ob_end_clean();
|
762 |
+
ob_start;
|
763 |
+
echo $current;
|
764 |
+
}
|
765 |
return $objRequest->process();
|
766 |
}
|
767 |
|
868 |
// Change code if POST is forced to be used
|
869 |
if (self::$settings->getGlobalOption('track_post') && self::$settings->getGlobalOption('track_mode') != 2) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setRequestMethod', 'POST']);\n_paq.push(['trackPageView']);", $strCode);
|
870 |
// Change code if cookies are disabled
|
|
|
|
|
|
|
|
|
871 |
if (self::$settings->getGlobalOption('disable_cookies')) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['disableCookies']);\n_paq.push(['trackPageView']);", $strCode);
|
872 |
if (self::$settings->getGlobalOption('limit_cookies')) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setVisitorCookieTimeout', '".self::$settings->getGlobalOption('limit_cookies_visitor')."']);\n_paq.push(['setSessionCookieTimeout', '".self::$settings->getGlobalOption('limit_cookies_session')."']);\n_paq.push(['trackPageView']);", $strCode);
|
873 |
// Store <noscript> code
|
952 |
$strURL .= '&format='.$strFormat;
|
953 |
$strURL .= ($strPageURL?'&pageUrl='.urlencode($strPageURL):'');
|
954 |
$strURL .= ($strNote?'¬e='.urlencode($strNote):'');
|
955 |
+
if (self::$settings->getGlobalOption('track_across') && $strMethod == 'SitesManager.getJavascriptTag') {
|
956 |
+
$strURL .= '&mergeAliasUrls=1';
|
957 |
+
}
|
958 |
// Fetch data if site exists
|
959 |
+
if (!empty($intSite) || $strMethod=='SitesManager.getSitesWithAtLeastViewAccess') {
|
960 |
self::$logger->log('API method: '.$strMethod.' API call: '.$strURL);
|
961 |
$strResult = (string) $this->getRemoteFile($strURL, get_bloginfo('url'));
|
962 |
$result = ($strFormat == 'PHP'?unserialize($strResult):$strResult);
|
1285 |
<div class="wp-piwik-donate">
|
1286 |
<p><strong><?php _e('Donate','wp-piwik'); ?></strong></p>
|
1287 |
<p><?php _e('If you like WP-Piwik, you can support its development by a donation:', 'wp-piwik'); ?></p>
|
1288 |
+
<script type="text/javascript">
|
1289 |
+
/* <![CDATA[ */
|
1290 |
+
window.onload = function() {
|
1291 |
+
FlattrLoader.render({
|
1292 |
+
'uid': 'flattr',
|
1293 |
+
'url': 'http://wp.local',
|
1294 |
+
'title': 'Title of the thing',
|
1295 |
+
'description': 'Description of the thing'
|
1296 |
+
}, 'element_id', 'replace');
|
1297 |
+
}
|
1298 |
+
/* ]]> */
|
1299 |
+
</script>
|
1300 |
<div>
|
1301 |
+
<a class="FlattrButton" style="display:none;" title="WordPress Plugin WP-Piwik" rel="flattr;uid:braekling;category:software;tags:wordpress,piwik,plugin,statistics;" href="https://www.braekling.de/wp-piwik-wpmu-piwik-wordpress">This WordPress 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. You need a running Piwik installation and at least view access to your stats.</a>
|
|
|
|
|
|
|
1302 |
</div>
|
1303 |
<div>Paypal
|
1304 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
1446 |
}
|
1447 |
|
1448 |
private static function definePiwikConstants() {
|
1449 |
+
if (!defined('PIWIK_INCLUDE_PATH')) {
|
1450 |
+
@header('Content-type: text/xml');
|
1451 |
+
define('PIWIK_INCLUDE_PATH', self::$settings->getGlobalOption('piwik_path'));
|
1452 |
+
define('PIWIK_USER_PATH', self::$settings->getGlobalOption('piwik_path'));
|
1453 |
+
define('PIWIK_ENABLE_DISPATCH', false);
|
1454 |
+
define('PIWIK_ENABLE_ERROR_HANDLER', false);
|
1455 |
+
define('PIWIK_ENABLE_SESSION_START', false);
|
1456 |
+
}
|
1457 |
}
|
1458 |
|
1459 |
private function openLogger() {
|
1512 |
$this->addNoscriptCode();
|
1513 |
}
|
1514 |
|
1515 |
+
public function onPostStatusTransition($newStatus, $oldStatus = 'false', $post = null) {
|
1516 |
if ($newStatus == 'publish' && $oldStatus != 'publish' ) {
|
1517 |
add_action('publish_post', array($this, 'addPiwikAnnotation'));
|
1518 |
}
|