get_col( "SELECT blog_id FROM {$wpdb->blogs}" ); foreach ( $mlpicks_blog_ids as $mlpicks_blog_id ) { switch_to_blog( (int) $mlpicks_blog_id ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_related" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_clicks" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_views" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_vectors" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_transitions" ); wp_unschedule_hook( 'mlpicks_process_backfill_batch' ); wp_unschedule_hook( 'mlpicks_process_vector_backfill_batch' ); wp_unschedule_hook( 'mlpicks_compute_related' ); wp_unschedule_hook( 'mlpicks_compute_vector' ); wp_unschedule_hook( 'mlpicks_nightly_views_rollup' ); delete_transient( 'mlpicks_click_ratelimit_bucket' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_rl_%' OR option_name LIKE '_transient_timeout_mlpicks_rl_%'" ); delete_option( 'mlpicks_backfill_state' ); delete_option( 'mlpicks_vector_backfill_state' ); delete_option( 'mlpicks_global_idf_cache' ); delete_option( 'mlpicks_idf_last_post_count' ); delete_option( 'mlpicks_settings' ); delete_option( 'mlpicks_db_version' ); delete_option( 'mlpicks_discovery_cache_salt' ); delete_option( 'mlpicks_ml_model' ); delete_option( 'mlpicks_ml_model_meta' ); wp_unschedule_hook( 'mlpicks_train_ml_model' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_rec_%' OR option_name LIKE '_transient_timeout_mlpicks_rec_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_mr_%' OR option_name LIKE '_transient_timeout_mlpicks_mr_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_vw_%' OR option_name LIKE '_transient_timeout_mlpicks_vw_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Bulk meta cleanup on uninstall. $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_mlpicks_hand_picked' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Bulk meta cleanup on uninstall. $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_mlpicks_hide' ) ); restore_current_blog(); } } else { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_related" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_clicks" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_views" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_vectors" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Drops plugin custom table on uninstall. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}mlpicks_transitions" ); wp_unschedule_hook( 'mlpicks_process_backfill_batch' ); wp_unschedule_hook( 'mlpicks_process_vector_backfill_batch' ); wp_unschedule_hook( 'mlpicks_compute_related' ); wp_unschedule_hook( 'mlpicks_compute_vector' ); wp_unschedule_hook( 'mlpicks_nightly_views_rollup' ); delete_transient( 'mlpicks_click_ratelimit_bucket' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_rl_%' OR option_name LIKE '_transient_timeout_mlpicks_rl_%'" ); delete_option( 'mlpicks_backfill_state' ); delete_option( 'mlpicks_vector_backfill_state' ); delete_option( 'mlpicks_global_idf_cache' ); delete_option( 'mlpicks_idf_last_post_count' ); delete_option( 'mlpicks_settings' ); delete_option( 'mlpicks_db_version' ); delete_option( 'mlpicks_discovery_cache_salt' ); delete_option( 'mlpicks_ml_model' ); delete_option( 'mlpicks_ml_model_meta' ); wp_unschedule_hook( 'mlpicks_train_ml_model' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_rec_%' OR option_name LIKE '_transient_timeout_mlpicks_rec_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_mr_%' OR option_name LIKE '_transient_timeout_mlpicks_mr_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Transient cleanup on uninstall. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_mlpicks_vw_%' OR option_name LIKE '_transient_timeout_mlpicks_vw_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Bulk meta cleanup on uninstall. $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_mlpicks_hand_picked' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Bulk meta cleanup on uninstall. $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_mlpicks_hide' ) ); }