't want any output here. ob_start(); // No cache headers. wc_nocache_headers(); // Clean the API request. $api_request = strtolower( wc_clean( $wp->query_vars['wc-api'] ) ); // Make sure gateways are available for request. WC()->payment_gateways(); // phpcs:disable WooCommerce.Commenting.CommentHooks.HookCommentWrongStyle // Trigger generic action before request hook. do_action( 'woocommerce_api_request', $api_request ); // Is there actually something hooked into this API request? If not trigger 400 - Bad request. status_header( has_action( 'woocommerce_api_' . $api_request ) ? 200 : 400 ); // Trigger an action which plugins can hook into to fulfill the request. do_action( 'woocommerce_api_' . $api_request ); // phpcs:enable WooCommerce.Commenting.CommentHooks.HookCommentWrongStyle // Done, clear buffer and exit. ob_end_clean(); die( '-1' ); } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Internal\Utilities\LegacyRestApiStub" not found in /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php:691 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(199): WooCommerce->includes() #1 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(158): WooCommerce->__construct() #2 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(47): WooCommerce::instance() #3 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(62): WC() #4 /htdocs/wp-settings.php(473): include_once('/htdocs/wp-cont...') #5 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php on line 691