diff --git a/projects/packages/scheduled-updates/changelog/fix-wpcom-installed-plugins b/projects/packages/scheduled-updates/changelog/fix-wpcom-installed-plugins new file mode 100644 index 0000000000000..4b0e43cb137f0 --- /dev/null +++ b/projects/packages/scheduled-updates/changelog/fix-wpcom-installed-plugins @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Remove plugins check on WPCOM environment diff --git a/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php b/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php index 1dd482e203974..b78edf63ffe75 100644 --- a/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php +++ b/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php @@ -399,7 +399,9 @@ public function validate_plugins_param( $plugins, $request, $param ) { return $result; } - $installed_plugins = array_filter( $plugins, array( $this, 'is_plugin_installed' ) ); + // We don't need to check if plugins are installed if we're on WPCOM. + $installed_plugins = defined( 'IS_WPCOM' ) && IS_WPCOM ? $plugins : array_filter( $plugins, array( $this, 'is_plugin_installed' ) ); + if ( empty( $installed_plugins ) ) { add_filter( 'rest_request_after_callbacks', array( $this, 'transform_error_response' ) );