As far as I understood, When you enter the code manually the data should be saved on sitemeta table on row with meta_key wp-piwik-manually. But with wp-piwik 1.0.13 the data is saved in first site options table on tracking code.
Can anyone else confirm this behavior? I tested on fresh setup also and the result is the same.
I investigated the problem and it's here :
private function prepareTrackingCode($value, $in) { if ($in ['track_mode'] == 'manually' || $in ['track_mode'] == 'disabled') { $value = stripslashes ( $value ); if ($this->checkNetworkActivation ()) add_site_option ( 'wp-piwik-manually', $value ); return $value; } /*$result = self::$wpPiwik->updateTrackingCode (); echo '<pre>'; print_r($result); echo '</pre>'; $this->setOption ( 'noscript_code', $result ['noscript'] );*/ return; // $result ['script']; }
add_site_option would not update the option is it's already exist. So, First it should check and the update or add.
Hello,
As far as I understood, When you enter the code manually the data should be saved on sitemeta table on row with meta_key wp-piwik-manually. But with wp-piwik 1.0.13 the data is saved in first site options table on tracking code. Can anyone else confirm this behavior? I tested on fresh setup also and the result is the same.
I investigated the problem and it's here :
private function prepareTrackingCode($value, $in) { if ($in ['track_mode'] == 'manually' || $in ['track_mode'] == 'disabled') { $value = stripslashes ( $value ); if ($this->checkNetworkActivation ()) add_site_option ( 'wp-piwik-manually', $value ); return $value; } /*$result = self::$wpPiwik->updateTrackingCode (); echo '<pre>'; print_r($result); echo '</pre>'; $this->setOption ( 'noscript_code', $result ['noscript'] );*/ return; // $result ['script']; }
add_site_option would not update the option is it's already exist. So, First it should check and the update or add.