How to look at code in WordPress repositories without downloading?

A lot of questions are about plugins and themes, that you don’t necessarily have installed. Downloading zip archive, unpacking and opening in editor seems like a too much hassle.

If only there was a way to just browse source of WordPress and all of plugins and themes in its repository…

1
1

Good news and more good news!

First – all of the code related to WordPress itself and its repositories resides in version control system (Subversion). Among other things that makes publicly available sites with all code in plain sight:

  • http://core.svn.wordpress.org/
  • http://themes.svn.wordpress.org/
  • http://plugins.svn.wordpress.org/

One not so obvious result of that – if you can see it, so can our overlord Google. Basically you can google through that code quite successfully by adding modifier like site:http://core.svn.wordpress.org/ to your query.

But that is not all. WordPress project also uses Trac. That is actually piece of software, not just mythical place for WP demigods to hang out.

Among other things trac has browser feature that interfaces with SVN and provides prettified, ajaxified and in other ways glorious human-friendly way to browse through code:

  • http://core.trac.wordpress.org/browser
  • http://plugins.trac.wordpress.org/browser
  • http://themes.trac.wordpress.org/browser

Note that it can take a long time to open root of browser for plugins and themes, because there are tons of either. It is usually faster to type in name of specific plugin/theme at end of URL (it will be same as in repository), for example http://themes.trac.wordpress.org/browser/hybrid

Also note that trac browser gives nice way to link to specific lines of code for reference, with number of line for an anchor http://themes.trac.wordpress.org/browser/hybrid/0.8/index.php#L13

In addition to wordpress.org theme repository, free themes for wordpress.com are available as public SVN repository at:

  • https://wpcom-themes.svn.automattic.com/

While development of WordPress is happening via SVN so far, GitHub mirror was created (first maintained by Mark Jaquith and later promoted to official status):

  • https://github.com/WordPress/WordPress

Leave a Comment