PluginProbe
Simple Analytics / 1.110
Simple Analytics v1.110
1.110 1.109 1.108 1.107 1.106 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.8 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.9 1.90 All 99 releases
simpleanalytics / uninstall.php

uninstall.php in Simple Analytics 1.110, at uninstall.php

30 lines 739 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('WP_UNINSTALL_PLUGIN') || exit;
4
5 require_once __DIR__ . '/src/SettingName.php';
6
7 $deleteOptions = static function (): void {
8 foreach (SimpleAnalytics\SettingName::cases() as $key) {
9 delete_option($key);
10 }
11 };
12
13 if (is_multisite()) {
14 $offset = 0;
15 do {
16 $siteIds = get_sites(['fields' => 'ids', 'number' => 100, 'offset' => $offset, 'orderby' => 'id', 'order' => 'ASC']);
17 foreach ($siteIds as $siteId) {
18 switch_to_blog($siteId);
19 try {
20 $deleteOptions();
21 } finally {
22 restore_current_blog();
23 }
24 }
25 $offset += count($siteIds);
26 } while (count($siteIds) === 100);
27 } else {
28 $deleteOptions();
29 }
30