heduler::IMPORT_STATS_OPTION, $import_stats ); } /** * Get stats for current import. * * @return array */ public static function get_import_stats() { $import_stats = get_option( ImportScheduler::IMPORT_STATS_OPTION, array() ); $import_stats['is_importing'] = self::is_importing(); return $import_stats; } /** * Get the import totals for all syncs. * * @param int|bool $days Number of days to import. * @param bool $skip_existing Skip existing records. * @return array */ public static function get_import_totals( $days, $skip_existing ) { $totals = array(); foreach ( self::get_schedulers() as $scheduler ) { $items = $scheduler::get_items( 1, 1, $days, $skip_existing ); $totals[ $scheduler::$name ] = $items->total; } return $totals; } /** * Clears all queued actions. */ public static function clear_queued_actions() { foreach ( self::get_schedulers() as $scheduler ) { $scheduler::clear_queued_actions(); } } /** * Delete all data for reports. * * @return string */ public static function delete_report_data() { // Cancel all pending import jobs. self::clear_queued_actions(); foreach ( self::get_schedulers() as $scheduler ) { $scheduler::schedule_action( 'delete_batch_init', array() ); } // Delete import options. delete_option( ImportScheduler::IMPORT_STATS_OPTION ); return __( 'Report table data is being deleted.', 'woocommerce' ); } /** * Clear the count cache when products are added or updated, or when * the no/low stock options are changed. * * @param int $id Post/product ID. */ public static function clear_stock_count_cache( $id ) { delete_transient( 'wc_admin_stock_count_lowstock' ); delete_transient( 'wc_admin_product_count' ); $status_options = wc_get_product_stock_status_options(); foreach ( $status_options as $status => $label ) { delete_transient( 'wc_admin_stock_count_' . $status ); } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Admin\ReportsSync" not found in /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php:165 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(98): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->includes() #1 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(81): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->on_plugins_loaded() #2 /htdocs/wp-content/plugins/woocommerce/src/Admin/Composer/Package.php(65): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->init() #3 [internal function]: Automattic\WooCommerce\Admin\Composer\Package::init() #4 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(128): call_user_func(Array) #5 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(64): Automattic\WooCommerce\Packages::initialize_packages() #6 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Packages::on_init('') #7 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #8 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #10 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php on line 165