You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Uninstall handler: removes all plugin options and transients.
*
* WordPress calls this file directly (not through the normal plugin
* bootstrap) when the plugin is deleted from the Plugins screen.
*
* @package IPDataInfo
*/
// If uninstall is not called from WordPress, bail.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
/**
* Delete the plugin's settings option.
*/
delete_option( 'ipdatainfo_settings' );
delete_site_option( 'ipdatainfo_settings' );
/**
* Delete every cached per-IP lookup transient created by the plugin.
*
* Transients are stored with keys like `ipdatainfo_<md5>` (and their
* paired `_transient_timeout_` rows), so a direct `$wpdb` query is the
* only practical way to clean them all up without knowing every IP hash.
*/
global $wpdb;
// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- required for a full bulk cleanup on uninstall.
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",