Is there a way to take a plugin slug (e.g. 'akismet') of a plugin that is NOT currently installed and somehow retrieve the download URL of the current version (e.g. 'http://downloads.wordpress.org/plugin/akismet.2.5.3.zip')?

This is for a command line script I am trying to develop that will enable plugin installation from the command line.

link|improve this question

78% accept rate
feedback

1 Answer

I forget exactly if the plugin slug is a reliable method to get the url, it might be in most cases but not all due to how plugins are named.

You can query the api @wordpress.org for the plugins xml file which also contains the download link.

For example:

$plugin_slug = 'akismet'; 
$return_plugin_info = "http://api.wordpress.org/plugins/info/1.0/$plugin_slug.xml"

It will return an XML file you can parse for the download link, which is in <download_link type="string">the link...akismet.zip</download>

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.