Skip to content
Snippets Groups Projects
Commit 7d0a47a9 authored by ale's avatar ale
Browse files

Remove obsolete piwik-related functionality

parent f7ce09e7
No related branches found
No related tags found
No related merge requests found
Pipeline #90554 passed
...@@ -70,9 +70,6 @@ Known commands: ...@@ -70,9 +70,6 @@ Known commands:
uninstall-plugin PLUGIN BLOG uninstall-plugin PLUGIN BLOG
Runs unistall action for PLUGIN. Runs unistall action for PLUGIN.
wp-piwik-clear-config BLOG
Clear the configuration for wp-piwik plugin.
copy-custom-css BLOG copy-custom-css BLOG
Copies the Custom CSS config to the standard Wordpress Customizer config, Copies the Custom CSS config to the standard Wordpress Customizer config,
then removes the old (options). then removes the old (options).
......
...@@ -9,7 +9,6 @@ define('AI_CRON_SCRIPT', true); ...@@ -9,7 +9,6 @@ define('AI_CRON_SCRIPT', true);
require_once(dirname(__FILE__) . '/blogs.php'); require_once(dirname(__FILE__) . '/blogs.php');
require_once(dirname(__FILE__) . '/cron.php'); require_once(dirname(__FILE__) . '/cron.php');
require_once(dirname(__FILE__) . '/editfiles.php'); require_once(dirname(__FILE__) . '/editfiles.php');
require_once(dirname(__FILE__) . '/wp-piwik.php');
// Load the Wordpress api. // Load the Wordpress api.
define('WP_CACHE',false); define('WP_CACHE',false);
......
<?php
function do_wp_piwik_clear_config($args){
$wp_piwik_options_to_delete = array(
'wp-piwik_displayto',
'wp-piwik_revision',
'wp-piwik-track_404'
);
$wp_piwik_options_to_blank = array(
'wp-piwik-name',
'wp-piwik-noscript_code',
'wp-piwik-site_id',
'wp-piwik-tracking_code'
);
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
echo "Blog {$arg} not found.\n";
continue;
}
switch_to_blog($blog->blog_id);
echo "Clearing options for wp-piwik for blog {$arg}\n";
foreach ($wp_piwik_options_to_delete as $opt) {
if (get_option($opt)){
echo "Deleting option {$opt}\n";
delete_option($opt);
}
}
foreach ($wp_piwik_options_to_blank as $opt) {
echo "Clearing option {$opt}\n";
update_option($opt,'');
}
restore_current_blog();
}
}
// [*] functioning site
// * wp-piwik-dashboard_revision
// wp-piwik_displayto
// * wp-piwik-last_tracking_code_update
// * wp-piwik-name
// * wp-piwik-noscript_code
// wp-piwik_revision
// * wp-piwik-site_id
// wp-piwik-track_404
// * wp-piwik-tracking_code
// +------------------------------------+--------------+
// | option_name | option_value |
// +------------------------------------+--------------+
// | wp-piwik-dashboard_revision | 0 |
// | wp-piwik-last_tracking_code_update | 1541989337 |
// | wp-piwik-name | |
// | wp-piwik-noscript_code | |
// | wp-piwik-site_id | |
// | wp-piwik-tracking_code | |
// +------------------------------------+--------------+
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment