query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $wpdb->prefix . $advc_table ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange -- Removing this plugin's own tables on uninstall. } $options = array( 'advc_db_version', 'advc_page_id', 'advc_page_title', 'advc_page_slug', 'advc_page_content', 'advc_default_country_code', 'advc_per_page', 'advc_notify_email', 'advc_notify_enabled', 'advc_form_title', 'advc_form_intro', 'advc_success_message', 'advc_theme', 'advc_share_enabled', 'advc_autoreply_enabled', 'advc_autoreply_subject', 'advc_autoreply_body', ); foreach ( $options as $option ) { delete_option( $option ); } // Leftover from older versions; the other transients expire on their own within an hour. delete_transient( 'advc_page_checked' ); } if ( is_multisite() ) { $advc_site_ids = get_sites( array( 'fields' => 'ids' ) ); foreach ( $advc_site_ids as $advc_site_id ) { switch_to_blog( (int) $advc_site_id ); advc_uninstall_current_site(); restore_current_blog(); } } else { advc_uninstall_current_site(); }