PluginProbe
Simple Matomo Tracking Code / trunk
Simple Matomo Tracking Code vtrunk
trunk 0.5.1 0.5.2 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1
simple-matomo-tracking-code / uninstall.php

uninstall.php in Simple Matomo Tracking Code trunk, at uninstall.php

31 lines 700 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Delete options upon uninstall to prevent issues with other plugins and leaving trash behind.
4 */
5
6 // Exit, if uninstall.php was not called from WordPress.
7 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
8 die();
9 }
10
11 $option_name = 'MatomoAnalyticsPP';
12 $plugin_name = "simple-matomo-tracking-code/simple-matomo-tracking-code.php";
13
14 if( !is_multisite()) {
15 delete_option( $option_name );
16 }
17 else {
18 $sites = get_sites( [ 'number' => 99999 ] );
19
20 foreach ( $sites as $site ) {
21 switch_to_blog( intval( $site->blog_id ) );
22
23 deactivate_plugins( $plugin_name );
24 delete_option( $option_name );
25
26 restore_current_blog();
27 }
28
29 delete_site_option( $option_name );
30 }
31 ?>