Skip to content

Commit 191517e

Browse files
chihsuanclaude
andauthored
Add filter to control proxy speed module auto-installation (#46719)
* Add filter to control proxy speed module auto-installation This adds a `woocommerce_analytics_auto_install_proxy_speed_module` filter that allows environments to opt out of automatic mu-plugin file creation. This is the first step toward addressing concerns about the proxy speed module causing issues on certain environments (e.g., CIAB garden sites). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add @SInCE tag --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5cd1b3b commit 191517e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: added
3+
4+
Add woocommerce_analytics_auto_install_proxy_speed_module filter to control auto-installation of proxy speed module mu-plugin.

projects/packages/woocommerce-analytics/src/class-woocommerce-analytics.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,19 @@ public static function register_rest_routes() {
174174
* Maybe add proxy speed module.
175175
*/
176176
public static function maybe_add_proxy_speed_module() {
177+
/**
178+
* Filter to control auto-installation of the proxy speed module mu-plugin.
179+
*
180+
* When this filter returns false, the mu-plugin file can't be added automatically.
181+
*
182+
* @since 0.15.0
183+
*
184+
* @param bool $auto_install Whether to auto-install the mu-plugin. Default true.
185+
*/
186+
if ( ! apply_filters( 'woocommerce_analytics_auto_install_proxy_speed_module', true ) ) {
187+
return;
188+
}
189+
177190
if ( ! self::init_filesystem() ) {
178191
return;
179192
}

0 commit comments

Comments
 (0)