Skip to content

Commit c2537b0

Browse files
Copilotswissspidy
andcommitted
Fix potential infinite recursion and improve API error visibility
Co-authored-by: swissspidy <[email protected]>
1 parent 80278a0 commit c2537b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Plugin_Command.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ private function get_plugin_dependencies( $slug ) {
11741174
$api = plugins_api( 'plugin_information', array( 'slug' => $slug ) );
11751175

11761176
if ( is_wp_error( $api ) ) {
1177-
WP_CLI::debug( "Could not fetch information for plugin '$slug': " . $api->get_error_message() );
1177+
WP_CLI::warning( "Could not fetch information for plugin '$slug': " . $api->get_error_message() );
11781178
return [];
11791179
}
11801180

@@ -1529,6 +1529,9 @@ public function install_dependencies( $args, $assoc_args ) {
15291529

15301530
WP_CLI::log( sprintf( "Installing %d %s for '%s'...", count( $dependencies ), Utils\pluralize( 'dependency', count( $dependencies ) ), $args[0] ) );
15311531

1532+
// Remove with-dependencies flag to avoid recursive dependency resolution
1533+
unset( $assoc_args['with-dependencies'] );
1534+
15321535
// Install dependencies
15331536
$this->chained_command = true;
15341537
$this->install( $dependencies, $assoc_args );

0 commit comments

Comments
 (0)