Commit 23e0e275519 for woocommerce
commit 23e0e2755197b4d6dc865f36fdbcfa98de18b62a
Author: Jorge A. Torres <jorge.torres@automattic.com>
Date: Tue Sep 1 12:10:24 2026 +0100
Do not rely on `FeaturesUtil` for analytics check in `Features::is_enabled()` (#68218)
diff --git a/plugins/woocommerce/src/Admin/Features/Features.php b/plugins/woocommerce/src/Admin/Features/Features.php
index 9fcd94314a6..32c101a6246 100644
--- a/plugins/woocommerce/src/Admin/Features/Features.php
+++ b/plugins/woocommerce/src/Admin/Features/Features.php
@@ -332,7 +332,7 @@ class Features {
if (
in_array( 'analytics', $features, true ) &&
- ! FeaturesUtil::feature_is_enabled( 'analytics' )
+ ! self::is_analytics_enabled()
) {
$unavailable_features[] = 'analytics';
}
@@ -489,7 +489,7 @@ class Features {
$compatibility_values = array_merge(
array_fill_keys( array_keys( self::$retired_feature_compatibility_versions ), true ),
array(
- 'analytics' => FeaturesUtil::feature_is_enabled( 'analytics' ),
+ 'analytics' => self::is_analytics_enabled(),
'remote-inbox-notifications' => 'yes' === get_option( RemoteInboxNotifications::TOGGLE_OPTION_NAME, 'yes' ),
)
);
@@ -549,6 +549,16 @@ class Features {
return ! in_array( 'analytics', self::get_features_with_legacy_compatibility_defaults(), true );
}
+ /**
+ * Checks if analytics is enabled, without going through FeaturesController.
+ *
+ * @return bool
+ */
+ private static function is_analytics_enabled() {
+ return ! self::is_analytics_disabled_by_legacy_filters()
+ && 'yes' === get_option( Analytics::TOGGLE_OPTION_NAME, 'yes' );
+ }
+
/**
* Checks if a feature slug is supported only by the legacy compatibility shim.
*