PluginProbe
Speculative Loading / 1.3.1
Speculative Loading v1.3.1
1.7.0 1.1.0 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.4.0 1.5.0 1.6.0 trunk 1.0.0 1.0.1
speculation-rules / uninstall.php

uninstall.php in Speculative Loading 1.3.1, at uninstall.php

42 lines 882 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin uninstaller logic.
4 *
5 * @package speculation-rules
6 * @since 1.2.0
7 */
8
9 // If uninstall.php is not called by WordPress, bail.
10 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
11 exit;
12 }
13
14 // For a multisite, delete the option for all sites (however limited to 100 sites to avoid memory limit or timeout problems in large scale networks).
15 if ( is_multisite() ) {
16 $site_ids = get_sites(
17 array(
18 'fields' => 'ids',
19 'number' => 100,
20 'update_site_cache' => false,
21 'update_site_meta_cache' => false,
22 )
23 );
24
25 foreach ( $site_ids as $site_id ) {
26 switch_to_blog( $site_id );
27 plsr_delete_plugin_option();
28 restore_current_blog();
29 }
30 }
31
32 plsr_delete_plugin_option();
33
34 /**
35 * Delete the current site's option.
36 *
37 * @since 1.2.0
38 */
39 function plsr_delete_plugin_option(): void {
40 delete_option( 'plsr_speculation_rules' );
41 }
42