Categories
guides wordpress

SVN Export / Download Old Version WordPress Plugin or Theme

Check if the version you want is easily accessible from the WP plugin directory

  • Find the plugin
  • Click Advanced View
  • Scroll to the bottom, and see if the version you want is available

If the version you want isn’t available, you can build it from the SVN repo

Install a command line svn client like SlikSVN

Find the SVN URL of the WordPress plugin
Typically, it is http://plugins.svn.wordpress.org/[wp-slug]/, you may also be able to find the URL on wpvulndb.com, and searching for the plugin

Quick Steps w/ Shortcut

Reference long way if you need more info or this doesn’t work, but this is the most efficient “steps only” approach that should work most of the time.

  • Find [url] as specified above
  • svn log [url]
  • svn export -r [revision] [url]/trunk path/to/desired/export-folder
  • ?

Long way w/ Full Steps

run svn co [url] to checkout (download) a local copy of the entire SVN repo

From the directory the repo downloads to, run svn log, it will take several seconds, but should start returning a list of “revisions” (similar to git “commits”?) with comments – these will come down in chunks, so give it some time between each chunk, until you see the revision you want. Each revision should be shown in this format:

------------------------------------------------------------------------
r2004989 | codename065 | 2019-01-01 23:11:04 -0800 (Tue, 01 Jan 2019) | 4 lines

= 2.9.85 =
* Fixed the conflict with the wordpress plugin/theme editor
* Moved cache directory outside of plugins dir
* Added new option to customize download button styles easily
------------------------------------------------------------------------

Once you see enough of the log to know the version you want, you can use Ctrl-C to interrupt the log, and return to the command prompt

Note the revision number you want (from above example, would be 2004989, and then from the parent folder of the repo, run svn export -r [revision number] [repo folder]/trunk [destination folder], ie svn export -r 2004989 download-manager my-revision-export-r2004989

When that completes, the destination folder should contain the version you’re looking for.

PowerShell Shortcuts

# For Themes
$wpThemeUrl = 'https://themes.svn.wordpress.org'
$slug = '' # you set this
svn log $wpThemeUrl/$slug
$rev = '' # you set this based on log output
svn export -r $rev $wpThemeUrl/$slug/ $slug-$rev

# For Plugins
$wpPluginUrl = 'http://plugins.svn.wordpress.org'
$slug = '' # you set this
svn log $wpPluginUrl/$slug
$rev = '' # you set this based on log output
svn export -r $rev $wpPluginUrl/$slug/trunk $slug-$rev

By bo.

I'm @boyEatsSteak in a lot of places. I have been wanting 🍕 for weeks. I like gadgets and technology and keeping notes and tips for my future self since all I can remember is that I forget things.