Using Unit Tests to Find WordPress Plugin Bugs

This is an unedited video of me fixing a bug reported by a user on the WordPress support forum for my Widget Context plugin. Here is the pull request on GitHub if you want to follow along.

I start out by writing a unit test for the part of code that is responsible for the specific functionality and the new test actually fails so I’m able to find the bug and fix it while looking at related issues.

At the end I do the release dance — update the plugin version number, write the changelog, tag a release on GitHub and deploy to WP.org.

Let me know on Twitter or in the comments below if you would like to see more of this kind of content.

Leave a Reply