Commit e39d10606d2 for woocommerce
commit e39d10606d213b23edc137a7df45b8298d66d55e
Author: Chris Lilitsas <1105590+xristos3490@users.noreply.github.com>
Date: Mon Sep 28 11:49:30 2026 +0300
Skip front-end stock notification services on admin requests (#69021)
* perf: skip front-end stock notification services on admin requests
* refactor: drop redundant comment on the My Account endpoint wiring
* refactor: shorten the frontend-only wiring comment
* fix: keep stock notification sign-up form on admin-ajax requests
* refactor: shorten the frontend-only services comment
diff --git a/plugins/woocommerce/changelog/fix-WOOPLUG-5228-frontend-services b/plugins/woocommerce/changelog/fix-WOOPLUG-5228-frontend-services
new file mode 100644
index 00000000000..36f4675ea61
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-WOOPLUG-5228-frontend-services
@@ -0,0 +1,4 @@
+Significance: patch
+Type: performance
+
+Skip wiring the front-end stock notification services on admin requests.
diff --git a/plugins/woocommerce/src/Internal/StockNotifications/StockNotifications.php b/plugins/woocommerce/src/Internal/StockNotifications/StockNotifications.php
index 7509274cf85..0e27f93eeb0 100644
--- a/plugins/woocommerce/src/Internal/StockNotifications/StockNotifications.php
+++ b/plugins/woocommerce/src/Internal/StockNotifications/StockNotifications.php
@@ -119,11 +119,8 @@ class StockNotifications implements RegisterHooksInterface {
$container->get( NotificationsProcessor::class );
$container->get( PrivacyEraser::class );
$container->get( DataRetentionController::class );
- $container->get( EmailActionController::class );
$container->get( Telemetry::class );
- $container->get( ProductPageIntegration::class );
- $container->get( FormHandlerService::class );
$container->get( NotificationManagementService::class );
$container->get( MyAccountEndpoint::class );
@@ -134,6 +131,13 @@ class StockNotifications implements RegisterHooksInterface {
if ( is_admin() ) {
$container->get( AdminManager::class );
}
+
+ // Frontend only.
+ if ( ! is_admin() || wp_doing_ajax() ) {
+ $container->get( EmailActionController::class );
+ $container->get( ProductPageIntegration::class );
+ $container->get( FormHandlerService::class );
+ }
}
/**