WordPress.org

Forums

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

  1. M66B
    Member
    Posted 3 years 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
    Plugin Author

    Posted 3 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Piwik
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags