WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#1198 closed enhancement (worksforme)

Plugins/themes API should report available tags

Reported by: boonebgorges Owned by:
Milestone: Priority: normal
Component: API Keywords:
Cc:

Description

I have a number of wp-cli scripts that I use to help me maintain client installations. One common task is to compare installed plugin/theme versions against available updates, and only to update if the available updates match a version whitelist (eg, 3.5.6 can be updated to 3.5.8 but not 3.6.1). Currently, the API doesn't return info about available versions - just the latest/stable. My workaround is to scrape plugins.svn.wordpress.org/plugin-name/tags using svn_ls() (ugh) or DOMDocument (double ugh).

Could we include an array of tags in API requests? Perhaps it'd be turned off by default, to preserve bandwidth, but available when sending a specific flag?

Change History (4)

#1 @Otto42
2 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

It's already there. Add "versions"=>true to the fields that you request in the info request. You'll get back a versions array in the response, with all the current tagged versions and links to their ZIP files.

#2 @Otto42
2 years ago

Example code:

$response = plugins_api( 'plugin_information', array(
	'slug' => 'jetpack',
	'fields' => array(
		'versions' => true,
	)
) );

#3 @boonebgorges
2 years ago

!!! Thanks, Otto42.

#4 @Otto42
2 years ago

Note: This only works for plugins that use /tags. Plugins that only use trunk will only return the current version.

Note: See TracTickets for help on using tickets.