Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,31 @@
exit;
}

delete_option( 'perflab_modules_settings' );
// 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 );
perflab_delete_plugin_option();
restore_current_blog();
}
}

perflab_delete_plugin_option();

/**
* Delete the current site's option.
*
* @since n.e.x.t
*/
function perflab_delete_plugin_option() {
delete_option( 'perflab_modules_settings' );
}