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

Linting JavaScript with JSCS

Our wp-dev-lib provides a common set of configs and scripts for facilitating theme and plugin development, including a pre-commit hook, and integrations for Travis CI, JSHint, PHP_CodeSniffer, and more. As of today, the “more” now includes a new JavaScript linter called JSCS. This tool augments the basic linting that JSHint does, but JSCS goes much … Continue reading Linting JavaScript with JSCS

Installing PHP_CodeSniffer

You can install it on your host machine and then install the WordPress Coding Standards. See the instructions here. This will ensure that it will be run as part of the pre-commit hook. In short: And then add this …phpcs/scripts directory to your PATH environment variable. You should then see WordPress-VIP listed when you run … Continue reading Installing PHP_CodeSniffer