client/lib/wporg/index.js
function( pluginSlug ) {
		const query = {
			fields: 'icons,banners,compatibility,ratings,-contributors',
			locale: getWporgLocaleCode(),
		};

		pluginSlug = pluginSlug.replace( new RegExp( '.php$' ), '' );

		const baseUrl = 'https://api.wordpress.org/plugins/info/1.0/' + pluginSlug + '.jsonp';

		return new Promise( ( resolve, reject ) => {
			jsonp( baseUrl, query, function( error, data ) {
				if ( error ) {
					debug( 'error downloading plugin details from .org: %s', error );
					reject( error );
					return;
				}

				if ( ! data || ! data.slug ) {
					debug( 'unrecognized format fetching plugin details from .org: %s', data );
					reject( new Error( 'Unrecognized response format' ) );
					return;
				}

				resolve( data );
			} );
		} );
	}
function( pluginSlug ) {
		const query = {
			fields: 'icons,banners,compatibility,ratings,-contributors',
			locale: getWporgLocaleCode(),
		};

		pluginSlug = pluginSlug.replace( new RegExp( '.php$' ), '' );

		const baseUrl = 'https://api.wordpress.org/plugins/info/1.0/' + pluginSlug + '.jsonp';

		return new Promise( ( resolve, reject ) => {
			jsonp( baseUrl, query, function( error, data ) {
				if ( error ) {
					debug( 'error downloading plugin details from .org: %s', error );
					reject( error );
					return;
				}

				if ( ! data || ! data.slug ) {
					debug( 'unrecognized format fetching plugin details from .org: %s', data );
					reject( new Error( 'Unrecognized response format' ) );
					return;
				}

				resolve( data );
			} );
		} );
	}
Fetches details for a particular plugin.
@param {string} pluginSlug The plugin identifier.
@returns {Promise} Promise with the plugins details.