When I build a WordPress plugin, I use several methods to structure things that help me greatly, all of which stem from root composition. I’m going to expand on what that is and how I use it. Every plugin has a root file that contains the plugin header comment, and gets loaded by WordPress. This […]

Part of my job at WordPress VIP is review. It takes up a lot of my time, and it’s critical work. Before code reaches our servers it needs to be vetted and peer reviewed to vouch that it’s fast, safe, and secure. Every developer makes mistakes ( even VIP developers ), so we peer review […]

I’ve built two Admin Colour schemes for WordPress. Both are based initially off of the themergency theme generator, but with extensive changes. Notably the split colours of the admin menu and the admin bar. I’ve also accounted for form highlights, selection, checkboxes, and the progress bar on videos. The first is called Tangerine: The second […]

For a long time, theme frameworks have been the primary alternative to building things from scratch in WordPress, and to a lesser extent, starter themes. There is a better way. Starter Themes & Frameworks Starter themes work on the paradigm of adding and replacing. You’re given a theme that represents the ‘halfway’ mark and add […]

I’ve been doing a lot of bash scripting with WordPress, especially with WP CLI. Here are some snippets I found useful. All my scripts assume a standard wp-config.php with DEFINE() statements and no unusual logic structures. A rogue constant with the name DB_NAME may throw things off without some modification. Getting the Database table prefix If you […]

Take a look at this code, found inside the Jetpack Post Views plugin: function Jetpack_Post_Views() { $this->__construct(); } Here an object is calling its own constructor. But what’s wrong with it? The General rule for calling __construct: The only occasion it is okay to call a constructor method directly, is in a child class that […]

Take a look at this code, found inside a PHP class or object: add_action( &$this, ‘functionname’ ); This looks familiar, and can be found in many themes and plugins. But what’s wrong with it? It’s PHP4 code in a PHP5 world. General PHP rule for add_action: When creating a callable, never use &$this, use $this instead […]