Here’s a list of the developer-oriented plugins for WordPress that I use on a regular basis. (Alternative title: 10 WordPress Plugins You Can’t Live Without. You’ll Never Believe What Number 4 Does!)
Update August 2018: I use Code now.
Blog posts like these (the latest of which is Dominik Schilling’s) have helped me find packages in the past, so I thought it was time I published my own.
I use Sublime Text 3 for the same reason as Dominik. It’s exceptionally fast. One day I will inevitably switch to the free and open source Atom editor, but it’s got a long way to go until it can match ST3’s performance.
Here are the packages I use:
Update: Forget about SublimeCodeIntel and use the new CodeComplice package instead.
There is now a Sublime Text 3 compatible version of SublimeCodeIntel, thanks to the hard work of Germán M. Bravo (aka Kronuz). I had a job getting it to correctly index my project files though. I’m posting here what I did, in the hopes it’ll help someone else out.
As a fun data visualisation experiment – and as a way to practice my new found interest in Node.js – I decided to plot on a map of the world all the people who contributed to the recent release of WordPress 3.6. The map can be seen further down, but first a brief description of how I went about it.
I decided to generate a GeoJSON file of the contributor’s locations so it can be displayed wherever and however the open GeoJSON format is supported, not least on GitHub which recently added support for automatic rendering of GeoJSON files.
I thought I’d run some stats on WordPress contributors over the years. The only contributor stats I have are the ones published in each release announcement on wordpress.org, so I’ve put these stats together myself from those lists.
Unfortunately the release announcements have only listed the contributors since version 2.9 (June 2009). If anyone wants to get me the list of contributors for earlier versions I’ll happily update this post. It’d be interesting to see the numbers over the years.
Latest version: 1.0– Released 15/06/2012:
- Initial release.
This plugin allows you to display Pocket ‘Read It Later’ links next to each post on your blog. You can see an example on the Pocket blog. You can automatically insert the links adjacent to your blog posts or you can use the template tag to insert the links wherever you like.
If your plugin or theme uses custom post meta fields then you may want to store revisions to these fields when a post revision is saved. It’s easy to do.
For each of our meta fields, we’ll need to do three things:
- Store a revision of the meta field when a post is saved
- Revert to the correct revision of the meta field when a post is reverted
- Optionally, display the meta field on the revisions screen
Update: This functionality now exists in WordPress itself. There’s no longer any need for this plugin.
I’ve just published a small plugin which makes the Media screen in WordPress prettier using just CSS. You can download/pull/fork it on GitHub.
It’s possible to get an iPhone, iPad, or Android device to access a local web server running on your development machine. All you need is an HTTP proxy such as Charles Proxy running on your development machine. Once that’s running:
Make sure your device is connected to the same network as your development machine. Go into the Settings -> Wi-Fi menu and find the HTTP proxy settings. On Android, this means a long-press on your Wi-Fi network (Modify Settings, then Show advanced settings). On iOS this means pressing the (i) icon next to your Wi-Fi network.
Switch your proxy over to ‘Manual’ and enter your development environment machine’s network IP address (eg. 192.168.0.4) as the server, and 8888 as the port (Charles’ default port unless you’ve changed it).
Voila. All your HTTP traffic from your device will now route through your host machine (Charles will prompt you to allow access first) and you’ll have access to your local development server. Awesome!
Pro Tip: Are you still editing your hosts file in order to manage the host name mapping for sites on your development environment? Stop it. Just use the Tools -> DNS Spoofing menu in Charles and make life easier for yourself.
Basic Authentication (or BasicAuth) is not natively handled with the WordPress HTTP API. This means when you’re using functions such as
wp_remote_post() there’s no immediately obvious way to send Basic Authentication headers with your request. It would be great to pass username and password parameters to these functions, but it’s not there.
Fear not though, it’s really easy. Here’s how:
$args = array( 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( YOUR_USERNAME . ':' . YOUR_PASSWORD ) ) ); wp_remote_request( $url, $args );
That’s it. The correct authentication headers will then be sent with your request (after you’ve replaced YOUR_USERNAME and YOUR_PASSWORD with the obvious).
I’d like to give a quick shout out to my favourite HTTP monitor Charles Proxy. I use Charles almost daily when dealing with server-side HTTP requests and AJAX requests and it makes life much easier. I love it.