src/Modules/Recommendation.php
private function get_plugins( $plugins_list, $preferences ) {
		$list = array();
		foreach ( $plugins_list as $plugin => $nicename ) {
			$current_plugin = $this->call_plugin_api( $plugin );

			$name = empty( $nicename ) ? $current_plugin->name : $nicename;

			$image = $current_plugin->banners['low'];
			if ( isset( $preferences['image'] ) && 'icon' === $preferences['image'] ) {
				$image = $current_plugin->icons['1x'];
			}

			$url = add_query_arg(
				array(
					'tab'       => 'plugin-information',
					'plugin'    => $current_plugin->slug,
					'TB_iframe' => true,
					'width'     => 800,
					'height'    => 800,
				),
				network_admin_url( 'plugin-install.php' )
			);

			$current_plugin->custom_url   = $url;
			$current_plugin->custom_name  = $name;
			$current_plugin->custom_image = $image;

			$list[] = $current_plugin;
		}

		return $list;
	}
private function get_plugins( $plugins_list, $preferences ) {
		$list = array();
		foreach ( $plugins_list as $plugin => $nicename ) {
			$current_plugin = $this->call_plugin_api( $plugin );

			$name = empty( $nicename ) ? $current_plugin->name : $nicename;

			$image = $current_plugin->banners['low'];
			if ( isset( $preferences['image'] ) && 'icon' === $preferences['image'] ) {
				$image = $current_plugin->icons['1x'];
			}

			$url = add_query_arg(
				array(
					'tab'       => 'plugin-information',
					'plugin'    => $current_plugin->slug,
					'TB_iframe' => true,
					'width'     => 800,
					'height'    => 800,
				),
				network_admin_url( 'plugin-install.php' )
			);

			$current_plugin->custom_url   = $url;
			$current_plugin->custom_name  = $name;
			$current_plugin->custom_image = $image;

			$list[] = $current_plugin;
		}

		return $list;
	}
private function get_plugins ( $ plugins_list , $ preferences ) { $ list = array ( ) ; foreach ( $ plugins_list as $ plugin => $ nicename ) { $ current_plugin = $ this -> call_plugin_api ( $ plugin ) ; $ name = empty ( $ nicename ) ? $ current_plugin -> name : $ nicename ; $ image = $ current_plugin -> banners [ 'low' ] ; if ( isset ( $ preferences [ 'image' ] ) && 'icon' === $ preferences [ 'image' ] ) { $ image = $ current_plugin -> icons [ '1x' ] ; } $ url = add_query_arg ( array ( 'tab' => 'plugin-information' , 'plugin' => $ current_plugin -> slug , 'TB_iframe' => true , 'width' => 800 , 'height' => 800 , ) , network_admin_url ( 'plugin-install.php' ) ) ; $ current_plugin -> custom_url = $ url ; $ current_plugin -> custom_name = $ name ; $ current_plugin -> custom_image = $ image ; $ list [ ] = $ current_plugin ; } return $ list ; }
Collect all the information for the plugins list.

@param array $plugins_list - list of useful plugins (in slug => nicename format).
@param array $preferences - list of preferences.

@return array
Collect all the information for the plugins list .