WP_CLI

WpOrgApi::get_plugin_checksums()publicWP-CLI 1.0

Gets the checksums for the given version of plugin.

Method of the class: WpOrgApi{}

No Hooks.

Return

true|false|Array. False on failure. An array of checksums on success.

Usage

$WpOrgApi = new WpOrgApi();
$WpOrgApi->get_plugin_checksums( $plugin, $version );
$plugin(string) (required)
Plugin slug to query.
$version(string) (required)
Version string to query.

WpOrgApi::get_plugin_checksums() code WP-CLI 2.8.0-alpha

public function get_plugin_checksums( $plugin, $version ) {
	$url = sprintf(
		'%s%s/%s.json',
		self::PLUGIN_CHECKSUMS_ENDPOINT,
		$plugin,
		$version
	);

	$response = $this->json_get_request( $url );

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

	return $response['files'];
}