diff --git a/classes/WP_Piwik.php b/classes/WP_Piwik.php index affbeea..9404f27 100644 --- a/classes/WP_Piwik.php +++ b/classes/WP_Piwik.php @@ -12,7 +12,7 @@ class WP_Piwik { * * @var Runtime environment variables */ - private static $revisionId = 2015051801, $version = '0.10.0.8', $blog_id, $pluginBasename = NULL, $logger, $settings, $request; + private static $revisionId = 2015051901, $version = '0.10.0.9', $blog_id, $pluginBasename = NULL, $logger, $settings, $request; /** * Constructor class to configure and register all WP-Piwik components @@ -933,7 +933,8 @@ public function request($id, $debug = false) { * Reset request object */ public function resetRequest() { - self::$request->reset(); + if (is_object(self::$request)) + self::$request->reset(); self::$request = NULL; } diff --git a/classes/WP_Piwik/Admin/Settings.php b/classes/WP_Piwik/Admin/Settings.php index 21cda47..a749654 100644 --- a/classes/WP_Piwik/Admin/Settings.php +++ b/classes/WP_Piwik/Admin/Settings.php @@ -18,12 +18,17 @@ public function show() { new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik); return; } - global $wp_roles; + if (isset($_GET['clear']) && $_GET['clear']) { + $this->clear($_GET['clear'] == 2); + self::$wpPiwik->resetRequest(); + self::$wpPiwik->updateTrackingCode(); + } if (isset ( $_POST ) && isset ( $_POST ['wp-piwik'] )) { $this->showBox ( 'updated', 'yes', __ ( 'Changes saved.' ) ); self::$wpPiwik->resetRequest(); self::$wpPiwik->updateTrackingCode(); } + global $wp_roles; ?>