Musings on Customizer as Future Admin Interface

There has been a lot of (well-deserved) excitement over Automattic’s Calypso project which largely re-implements the WP admin on WordPress.com as a JavaScript-driven REST API-powered single page application. (Reminder: WordPress.com is a service of Automattic that is built on the WordPress project, which I’ll call “WordPress.org” to differentiate here.) It is great to see what … Continue reading Musings on Customizer as Future Admin Interface

Use meta_input and tax_input with wp_insert_post() & wp_update_post()

We were recently in a situation in a project where we wanted to rebuild/invalidate a cache when a particular post was updated. Some of the key data for the post is stored in postmeta. So we have code that looks like: The problem here is that we can’t reliably use the save_post action to flush the cache because … Continue reading Use meta_input and tax_input with wp_insert_post() & wp_update_post()

Contributing to WordPress Core via GitHub

As announced at the beginning of last year (2014), there are official Git mirrors of WordPress core development SVN repo. This was a huge win because SVN is painful. Unfortunately, however, this Git repo mirror at develop.git.wordpress.org is not the same one that appears as the (apparent) official WordPress repo on GitHub. This GitHub repo is actually a mirror (ish) of the (legacy) core.svn.wordpress.org SVN repo which does not include the unit tests or other tools needed for development: it is a build repo. For more information, see A New Frontier for Core Development.

Continue reading Contributing to WordPress Core via GitHub

Automatically finding code reviewer candidates

Let’s say you’ve made a change to functions.php and config.php in some theme. Who do you assign to code review the changes? One handy way is to use git shortlog -sn. Here’s how to get the top 5 candidates for reviewing a change: $ git shortlog -sn functions.php config.php | head -n5 15 Piotr Delawski … Continue reading Automatically finding code reviewer candidates

Isolating PHPUnit tests to run

PHPUnit tests can be really slow, especially for large plugins that integrate with external APIs. It can be tempting thus to bypass the pre-commit hook via git commit –no-verify, but then Travis CI (or Bamboo) will eventually complain and the issue will come back to you, or worse the issue will get ignored. So we … Continue reading Isolating PHPUnit tests to run

PHP now upgraded to 5.6 in Quickstart

VIP just merged a PR which upgraded PHP to 5.6 in Quickstart. This is an upgrade from 5.4. With Quickstart being upgraded to 5.6, this should be a signal that we’re now in the clear to use any PHP 5.6 features (and 5.5 features) in our plugins. The first useful feature that comes to mind for us … Continue reading PHP now upgraded to 5.6 in Quickstart

PHP Code Beautifier and Fixer (phpcbf)

All of us PHP developers should be very well familiar with WordPress Coding Standards for PHP_CodeSniffer (phpcs). It automatically finds problems in WordPress code, both in terms of code style but also in terms of performance and security. It should be configured in your IDE and called in your repos’ pre-commit hooks. Did you also … Continue reading PHP Code Beautifier and Fixer (phpcbf)

Best Practices for Pantheon Project Setup

Pantheon has an amazing developer experience, including things like: using Git for deployments (no SVN in sight) having dev, test (staging), and live (production) environments for each site being able to push a new feature branch to Pantheon and spin up a new multidev environment or testing syncing database and files from production down to test … Continue reading Best Practices for Pantheon Project Setup

Bookmarklet to permalink all JIRA issues in current query

For our VIP client workflows, once VIP has done a deployment the process is to transition all issues from “In VIP Review” over to “To Verify In Production”. To do this, I query for all issues in In VIP Review [status = “In VIP Review”] and do a bulk edit to transition them to “To Verify … Continue reading Bookmarklet to permalink all JIRA issues in current query

Maybe restart memcached if dev environment slow

Sometimes I notice that my dev environment is starts responding slowly, like 10× slower. When you notice this, try firing up vagrant ssh and try something like wp cache set food bard. If you get an error message about it not being able to be set, Memcached may be on the rejecting cache additions (for … Continue reading Maybe restart memcached if dev environment slow