I build a lot of websites with WordPress, and my initial setup is basically always the same :

  • Latest version of WP
  • Latest versions of about 5 plugins
  • My naked development theme

Instead of downloading/uploading these things separately and do that by hand each time I start a new project, I’d like to create a bash script that would do this :

  • Download the latest version of WordPress
  • Unzip
  • Download the latest version of plugin X
  • Unzip to WP plugins folder
  • Download my naked theme
  • Unzip to themes folder

Now downloading the latest WP is easy (http://wordpress.org/latest.tar.gz), downloading my naked theme too, but I’m having trouble getting the latest version of a plugin, as they are not called latest.tar.gz but specifict names with the version (ex: wptouch.1.9.26.zip)

EDIT : So I’m wonderning now if it’s possible to use cURL in my bash script to find the exact URL of the Current version of a plugin. The idea would be to fetch the page, and then find the value of the href that is in the paragraph just after the <h3>Current Version</h3>.

Here’s an example, all plugin download pages on WP are like this :

<h3>Current Version</h3>
<p class="unmarked-list">
    <a href="http://downloads.wordpress.org/plugin/jetpack.1.1.2.zip">1.1.2</a>
</p>

5 s
5

To always get latest plugin take for example my plugin:

http://wordpress.org/extend/plugins/wordpress-file-monitor-plus/

the download link for the latest is:

http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.1.1.zip

but if you remove the version from the download link you always get the latest version:

http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.zip

EDIT: Have you considered keeping a folder of the latest wordpress and plugins unpacked? Then as soon as a new plugin or wordpress comes out you simply unpack that over what you have. Then your bash script just packages the whole lot to be used on an install.

Leave a Reply

Your email address will not be published. Required fields are marked *