n\API\ProductReviews', 'Automattic\WooCommerce\Admin\API\ProductVariations', 'Automattic\WooCommerce\Admin\API\ProductsLowInStock', 'Automattic\WooCommerce\Admin\API\SettingOptions', 'Automattic\WooCommerce\Admin\API\Taxes', ); if ( Features::is_enabled( 'analytics' ) ) { $analytics_controllers = array( 'Automattic\WooCommerce\Admin\API\Customers', 'Automattic\WooCommerce\Admin\API\Leaderboards', 'Automattic\WooCommerce\Admin\API\Reports\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Import\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Export\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Products\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Variations\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Products\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Orders\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Categories\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Stock\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Customers\Controller', 'Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\Controller', ); // The performance indicators controllerq must be registered last, after other /stats endpoints have been registered. $analytics_controllers[] = 'Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators\Controller'; $analytics_controllers = array_merge( $analytics_controllers, $analytic_mu_controllers ); } $controllers = array_merge( $controllers, $analytics_controllers, $analytic_mu_controllers ); } /** * Filter for the WooCommerce Admin REST controllers. * * @since 3.5.0 * @param array $controllers List of rest API controllers. */ $controllers = apply_filters( 'woocommerce_admin_rest_controllers', $controllers ); foreach ( $controllers as $controller ) { $this->$controller = new $controller(); $this->$controller->register_routes(); } } /** * Adds data stores. * * @internal * @param array $data_stores List of data stores. * @return array */ public static function add_data_stores( $data_stores ) { return array_merge( $data_stores, array( 'report-revenue-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore', 'report-orders' => 'Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore', 'report-orders-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore', 'report-products' => 'Automattic\WooCommerce\Admin\API\Reports\Products\DataStore', 'report-variations' => 'Automattic\WooCommerce\Admin\API\Reports\Variations\DataStore', 'report-products-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Products\Stats\DataStore', 'report-variations-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\DataStore', 'report-categories' => 'Automattic\WooCommerce\Admin\API\Reports\Categories\DataStore', 'report-taxes' => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\DataStore', 'report-taxes-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore', 'report-coupons' => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore', 'report-coupons-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\DataStore', 'report-downloads' => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\DataStore', 'report-downloads-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\DataStore', 'admin-note' => 'Automattic\WooCommerce\Admin\Notes\DataStore', 'report-customers' => 'Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore', 'report-customers-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\DataStore', 'report-stock-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\DataStore', ) ); } /** * Add the currency symbol (in addition to currency code) to each Order * object in REST API responses. For use in formatAmount(). * * @internal * @param WP_REST_Response $response REST response object. * @returns WP_REST_Response */ public static function add_currency_symbol_to_order_response( $response ) { $response_data = $response->get_data(); $currency_code = $response_data['currency']; $currency_symbol = get_woocommerce_currency_symbol( $currency_code ); $response_data['currency_symbol'] = html_entity_decode( $currency_symbol ); $response->set_data( $response_data ); return $response; } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Admin\API\Init" not found in /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php:157 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(275): call_user_func(Array) #5 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(85): 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(94): 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 157