Skip to content

Commit

Permalink
Remove plugins check on WPCOM environment (#37416)
Browse files Browse the repository at this point in the history
* Remove plugins check on WPCOM environment

* changelog
  • Loading branch information
zaerl authored May 16, 2024
1 parent fcb0fed commit 324f05a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Remove plugins check on WPCOM environment
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );

Expand Down

0 comments on commit 324f05a

Please sign in to comment.