src/Checksum_Plugin_Command.php
private function get_plugin_checksums( $plugin, $version ) {
		$url = str_replace(
			array(
				'{slug}',
				'{version}',
			),
			array(
				$plugin,
				$version,
			),
			$this->url_template
		);

		$options = array(
			'timeout' => 30,
		);

		$headers  = array(
			'Accept' => 'application/json',
		);
		$response = Utils\http_request( 'GET', $url, null, $headers, $options );

		if ( ! $response->success || 200 !== $response->status_code ) {
			return false;
		}

		$body = trim( $response->body );
		$body = json_decode( $body, true );

		if ( ! is_array( $body ) || ! isset( $body['files'] ) || ! is_array( $body['files'] ) ) {
			return false;
		}

		return $body['files'];
	}
private function get_plugin_checksums( $plugin, $version ) {
		$url = str_replace(
			array(
				'{slug}',
				'{version}',
			),
			array(
				$plugin,
				$version,
			),
			$this->url_template
		);

		$options = array(
			'timeout' => 30,
		);

		$headers  = array(
			'Accept' => 'application/json',
		);
		$response = Utils\http_request( 'GET', $url, null, $headers, $options );

		if ( ! $response->success || 200 !== $response->status_code ) {
			return false;
		}

		$body = trim( $response->body );
		$body = json_decode( $body, true );

		if ( ! is_array( $body ) || ! isset( $body['files'] ) || ! is_array( $body['files'] ) ) {
			return false;
		}

		return $body['files'];
	}
private function get_plugin_checksums ( $ plugin , $ version ) { $ url = str_replace ( array ( '{slug}' , '{version}' , ) , array ( $ plugin , $ version , ) , $ this -> url_template ) ; $ options = array ( 'timeout' => 30 , ) ; $ headers = array ( 'Accept' => 'application/json' , ) ; $ response = Utils \ http_request ( 'GET' , $ url , null , $ headers , $ options ) ; if ( ! $ response -> success || 200 !== $ response -> status_code ) { return false ; } $ body = trim ( $ response -> body ) ; $ body = json_decode ( $ body , true ) ; if ( ! is_array ( $ body ) || ! isset ( $ body [ 'files' ] ) || ! is_array ( $ body [ 'files' ] ) ) { return false ; } return $ body [ 'files' ] ; }
Gets the checksums for the given version of plugin.

@param string $version Version string to query.
@param string $plugin  plugin string to query.

@return bool|array False on failure. An array of checksums on success.
Gets the checksums for the given version of plugin .