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