NON standard dirty SET of custom modifications to optimize baseline load times on WordPress sites with WooCommerce
- Disable weird cart sessions init on API calls ( maybe_init_cart_session )
<?php | |
// woocommerce/packages/woocommerce-blocks/src/RestApi.php | |
/** | |
* Initialize class features. | |
*/ | |
public static function init() { | |
add_action( 'rest_api_init', array( __CLASS__, 'register_rest_routes' ), 10 ); | |
// START OF MODIFICATION | |
// add_filter( 'rest_authentication_errors', array( __CLASS__, 'maybe_init_cart_session' ), 1 ); // This may break stuff for you | |
// END OF MODIFICATION | |
} |