e' => __( 'Clear analytics cache', 'woocommerce' ), 'button' => __( 'Clear', 'woocommerce' ), 'desc' => sprintf( /* translators: 1: opening link tag, 2: closing tag */ __( 'This tool will reset the cached values used in WooCommerce Analytics. If numbers still look off, try %1$sReimporting Historical Data%2$s.', 'woocommerce' ), '', '' ), 'callback' => array( $this, 'run_clear_cache_tool' ), ); return $debug_tools; } /** * Registers report pages. */ public function register_pages() { $report_pages = self::get_report_pages(); foreach ( $report_pages as $report_page ) { if ( ! is_null( $report_page ) ) { wc_admin_register_page( $report_page ); } } } /** * Get report pages. */ public static function get_report_pages() { $overview_page = array( 'id' => 'woocommerce-analytics', 'title' => __( 'Analytics', 'woocommerce' ), 'path' => '/analytics/overview', 'icon' => 'dashicons-chart-bar', 'position' => 57, // After WooCommerce & Product menu items. ); $report_pages = array( $overview_page, array( 'id' => 'woocommerce-analytics-overview', 'title' => __( 'Overview', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/overview', 'nav_args' => array( 'order' => 10, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-products', 'title' => __( 'Products', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/products', 'nav_args' => array( 'order' => 20, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-revenue', 'title' => __( 'Revenue', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/revenue', 'nav_args' => array( 'order' => 30, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-orders', 'title' => __( 'Orders', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/orders', 'nav_args' => array( 'order' => 40, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-variations', 'title' => __( 'Variations', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/variations', 'nav_args' => array( 'order' => 50, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-categories', 'title' => __( 'Categories', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/categories', 'nav_args' => array( 'order' => 60, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-coupons', 'title' => __( 'Coupons', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/coupons', 'nav_args' => array( 'order' => 70, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-taxes', 'title' => __( 'Taxes', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/taxes', 'nav_args' => array( 'order' => 80, 'parent' => 'woocommerce-analytics', ), ), array( 'id' => 'woocommerce-analytics-downloads', 'title' => __( 'Downloads', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/downloads', 'nav_args' => array( 'order' => 90, 'parent' => 'woocommerce-analytics', ), ), 'yes' === get_option( 'woocommerce_manage_stock' ) ? array( 'id' => 'woocommerce-analytics-stock', 'title' => __( 'Stock', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/stock', 'nav_args' => array( 'order' => 100, 'parent' => 'woocommerce-analytics', ), ) : null, array( 'id' => 'woocommerce-analytics-customers', 'title' => __( 'Customers', 'woocommerce' ), 'parent' => 'woocommerce', 'path' => '/customers', ), array( 'id' => 'woocommerce-analytics-settings', 'title' => __( 'Settings', 'woocommerce' ), 'parent' => 'woocommerce-analytics', 'path' => '/analytics/settings', 'nav_args' => array( 'title' => __( 'Analytics', 'woocommerce' ), 'parent' => 'woocommerce-settings', ), ), ); /** * The analytics report items used in the menu. * * @since 6.4.0 */ return apply_filters( 'woocommerce_analytics_report_menu_items', $report_pages ); } /** * "Clear" analytics cache by invalidating it. */ public function run_clear_cache_tool() { Cache::invalidate(); return __( 'Analytics cache cleared.', 'woocommerce' ); } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Internal\Admin\Analytics" not found in /htdocs/wp-content/plugins/woocommerce/src/Internal/Features/FeaturesController.php:168 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Internal/Features/FeaturesController.php(432): Automattic\WooCommerce\Internal\Features\FeaturesController->get_feature_definitions() #1 /htdocs/wp-content/plugins/woocommerce/src/Internal/Features/FeaturesController.php(332): Automattic\WooCommerce\Internal\Features\FeaturesController->feature_exists('marketplace') #2 /htdocs/wp-content/plugins/woocommerce/src/Utilities/FeaturesUtil.php(42): Automattic\WooCommerce\Internal\Features\FeaturesController->feature_is_enabled('marketplace') #3 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/Marketplace.php(26): Automattic\WooCommerce\Utilities\FeaturesUtil::feature_is_enabled('marketplace') #4 [internal function]: Automattic\WooCommerce\Internal\Admin\Marketplace->init() #5 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/Definition.php(59): call_user_func_array(Array, Array) #6 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/Definition.php(29): Automattic\WooCommerce\Internal\DependencyManagement\Definition->invokeInit(Object(Automattic\WooCommerce\Internal\Admin\Marketplace)) #7 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/Definition/Definition.php(212): Automattic\WooCommerce\Internal\DependencyManagement\Definition->resolveClass('Automattic\\WooC...') #8 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregate.php(94): Automattic\WooCommerce\Vendor\League\Container\Definition\Definition->resolve(false) #9 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/Container.php(157): Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionAggregate->resolve('Automattic\\WooC...', false) #10 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/ExtendedContainer.php(176): Automattic\WooCommerce\Vendor\League\Container\Container->get('Automattic\\WooC...', false) #11 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/Container.php(178): Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer->get('Automattic\\WooC...', false) #12 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/ExtendedContainer.php(176): Automattic\WooCommerce\Vendor\League\Container\Container->get('Automattic\\WooC...', false) #13 /htdocs/wp-content/plugins/woocommerce/src/Container.php(120): Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer->get('Automattic\\WooC...') #14 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(285): Automattic\WooCommerce\Container->get('Automattic\\WooC...') #15 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(200): WooCommerce->init_hooks() #16 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(158): WooCommerce->__construct() #17 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(51): WooCommerce::instance() #18 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(66): WC() #19 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #20 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #21 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #22 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #23 /htdocs/index.php(17): require('/htdocs/wp-blog...') #24 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Internal/Features/FeaturesController.php on line 168