were dropped from the list. Windowed * imports must not reset the counter. * * @internal * @since 11.0.0 * @return void */ public static function reset_failed_order_imports_overflow(): void { $failed = self::get_failed_order_imports(); if ( 0 === $failed['overflow'] ) { return; } $failed['overflow'] = 0; if ( empty( $failed['ids'] ) ) { delete_option( self::FAILED_ORDER_IMPORTS_OPTION ); return; } update_option( self::FAILED_ORDER_IMPORTS_OPTION, $failed, false ); } /** * Delete a batch of orders. * * @internal * @param int $batch_size Number of items to delete. * @return void */ public static function delete( $batch_size ) { global $wpdb; $order_ids = $wpdb->get_col( $wpdb->prepare( "SELECT order_id FROM {$wpdb->prefix}wc_order_stats ORDER BY order_id ASC LIMIT %d", $batch_size ) ); foreach ( $order_ids as $order_id ) { OrdersStatsDataStore::delete_order( $order_id ); } } /** * Check whether scheduled import is enabled. * * Checks the scheduled import option value. * * @internal * @since 10.5.0 Introduced as a private method. * @since 11.0.0 Made public. * @return bool */ public static function is_scheduled_import_enabled(): bool { $value = get_option( self::SCHEDULED_IMPORT_OPTION, false ); if ( false !== $value ) { return 'yes' === $value; } // Fall back to the legacy option (pre-10.5.0) which used inverted semantics: // 'yes' meant immediate import (= not scheduled), 'no' meant scheduled. $legacy_value = get_option( self::LEGACY_IMMEDIATE_IMPORT_OPTION, false ); if ( false !== $legacy_value ) { return 'no' === $legacy_value; } // Neither option exists — use the default (not scheduled). return false; } }