Forums

WP-Piwik
[resolved] Tracking code fetched from piwik each time (2 posts)

  1. Marcel
    Member
    Posted 4 months ago #

    On my VPS I have limited memory and thus limited worker PHP processes. WP-Piwik did regularly hang my VPS and this is because there is a bug in version 0.8.10, which causes the tracking code to be fetched from the Piwik server each time time and thus creating a new unneeded PHP worker process.

    BTW, I was confused, because the readme.txt says 0.8.9 instead of 0.8.10.

    Although this seems to be fixed in the next version (trunk), here is the fix:

    Index: tags/0.8.10/wp-piwik.php
    ===================================================================
    --- tags/0.8.10/wp-piwik.php	(revision 486471)
    +++ tags/0.8.10/wp-piwik.php	(working copy)
    @@ -286,9 +286,12 @@
     				self::saveSettings();
     			}
     		// Get code if not known
    -		} elseif (empty($strJSCode)) {
    -			$strJSCode = $this->call_API('SitesManager.getJavascriptTag');
    -			self::$arySettings['tracking_code'] = html_entity_decode((is_string($strJSCode)?$strJSCode:'<!-- WP-Piwik ERROR: Tracking code not availbale -->'."\n"));
    +		} else {
    +			$strJSCode = self::$arySettings['tracking_code'];
    +			if (empty($strJSCode)) {
    +				$strJSCode = $this->call_API('SitesManager.getJavascriptTag');
    +				self::$arySettings['tracking_code'] = html_entity_decode((is_string($strJSCode)?$strJSCode:'<!-- WP-Piwik ERROR: Tracking code not availbale -->'."\n"));
    +			}
                 self::saveSettings();
     		}
     		// Change code if 404

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Posted 4 months ago #

    Yes, it's a known issue and it's fixed in 0.9.0.

    Just some multisite testcases have to be done before releasing.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags