HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bt667/public_html/wp-content/plugins/speculation-rules/uninstall.php
<?php
/**
 * Plugin uninstaller logic.
 *
 * @package speculation-rules
 * @since 1.2.0
 */

// If uninstall.php is not called by WordPress, bail.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;// @codeCoverageIgnore
}

// 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).
if ( is_multisite() ) {
	$site_ids = get_sites(
		array(
			'fields'                 => 'ids',
			'number'                 => 100,
			'update_site_cache'      => false,
			'update_site_meta_cache' => false,
		)
	);

	foreach ( $site_ids as $site_id ) {
		switch_to_blog( $site_id );
		plsr_delete_plugin_option();
		restore_current_blog();
	}
}

plsr_delete_plugin_option();

/**
 * Delete the current site's option.
 *
 * @since 1.2.0
 */
function plsr_delete_plugin_option(): void {
	delete_option( 'plsr_speculation_rules' );
}