Support » Plugin: Connect Matomo (WP-Matomo, WP-Piwik) » [Plugin: WP-Piwik] Tracking code fetched from piwik each time

  • Resolved M66B

    (@m66b)


    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/

Viewing 1 replies (of 1 total)
  • Plugin Author braekling

    (@braekling)

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

    Just some multisite testcases have to be done before releasing.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-Piwik] Tracking code fetched from piwik each time’ is closed to new replies.