query( $wpdb->prepare( 'DELETE FROM %i WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s', $wpdb->options, $wpdb->esc_like( 'pxsync_' ) . '%', $wpdb->esc_like( '_transient_pxsync_' ) . '%', $wpdb->esc_like( '_transient_timeout_pxsync_' ) . '%' ) ); // 2. Drop the Live Log table. $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $wpdb->prefix . 'pxsync_logs' ) ); // 3. Remove scheduled jobs. wp_clear_scheduled_hook( 'pxsync_generate_feed_cron' ); wp_clear_scheduled_hook( 'pxsync_retry_capi_event' ); // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange // 4. Remove the catalogue feed folder (wp-content/uploads/pixelsync/). $pxsync_upload = wp_upload_dir(); $pxsync_dir = trailingslashit( $pxsync_upload['basedir'] ) . 'pixelsync'; if ( is_dir( $pxsync_dir ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; if ( WP_Filesystem() ) { global $wp_filesystem; $wp_filesystem->delete( $pxsync_dir, true ); } } // Order notes on existing orders (_pxsync_* flags and _pys_utm_* values) are left alone: they are order history.