Fails WP CLI HPOS compatibility test
-
Hi, this is a minor bug: The plugin fails the WooCommerce HPOS compatibility test when run with WP CLI, as the compatibility statement is located inside a file that only runs in WP Admin.
What happens: If I try to enable HPOS with WP CLI, I’m getting:
Warning: [Failed] Some installed plugins are incompatible. Please review the plugins by going to WooCommerce > Settings > Advanced > Features and see the “Order data storage” section.
Error: HPOS pre-checks failed, please see the errors aboveIn WP Admin however I can enable HPOS.
Request: Please position the compatibility statement in a file that runs globally in WP. See for a similar issue, this bug report: https://github.com/woocommerce/woocommerce/issues/59036
The statement is currently located in wp-content/plugins/users-customers-import-export-for-wp-woocommerce/users-customers-import-export-for-wp-woocommerce.php
if (!defined('ABSPATH') || !is_admin()) {
return;
}
[...]
// HPOS compatibility decleration
add_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
} );
You must be logged in to reply to this topic.