query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_pingpush\_%' OR option_name LIKE '\_transient\_timeout\_pingpush\_%'" ); $table = $wpdb->prefix . 'pingpush_log'; $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $table ) ); // WooCommerce "already notified" flags (classic and HPOS order storage). $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_pingpush_new_order_sent' ) ); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- One-time cleanup on uninstall. $hpos = $wpdb->prefix . 'wc_orders_meta'; if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $hpos ) ) === $hpos ) { $wpdb->delete( $hpos, array( 'meta_key' => '_pingpush_new_order_sent' ) ); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key } // phpcs:enable wp_clear_scheduled_hook( 'pingpush_check_updates' ); wp_unschedule_hook( 'pingpush_send' ); if ( function_exists( 'as_unschedule_all_actions' ) ) { as_unschedule_all_actions( 'pingpush_send' ); } } if ( is_multisite() ) { $pingpush_site_ids = get_sites( array( 'fields' => 'ids', 'number' => 0, ) ); foreach ( $pingpush_site_ids as $pingpush_site_id ) { switch_to_blog( $pingpush_site_id ); pingpush_uninstall_site(); restore_current_blog(); } } else { pingpush_uninstall_site(); }