PMG Digital Made for Humans

Theme Unit Tests for WordPress Plugin Developers

2 MINUTE READ | March 16, 2012

Theme Unit Tests for WordPress Plugin Developers

Author's headshot

Christopher Davis

Christopher Davis has written this article. More details coming soon.

At it’s core, WordPress is a software designed to make it easy to write content for the web. A plugin developer might add some fancy new features, but often those features come back to the central focus of any website: the content.

If you write a plugin that deals with content in any way, do yourself a favor and have a look at the Theme Unit Test.

In a nutshell, the theme unit test is a bunch of dummy content, in the form of a WordPress XML export file, that can be loaded into a WordPress installation. It’s purpose is to give theme developers exposure to (1) a bunch of typographical and stylistic elements and (2) all the WordPress generated CSS classes.

Developing a theme is hard work because the end users might not make use of the theme in a way that you envisioned. Maybe you like short post titles, but your users end up using really long titles. Does your theme work okay with long titles? Maybe you never paginate posts, but your users do. Does your theme work with pagination? The theme unit test is meant to help theme developers answer those questions.

PMG has a WordPress plugin called SEO Auto Linker. As the name implies, the plugin automatically links certain words and phrases in your content to URIs you specify.

Yesterday a new version was released. And it was broken (it’s fixed now! don’t worry). Why? Because I did not test the plugin thoroughly with all types of content. Testing it with the theme unit test data installed on a WP install later on allowed me to identify the issue and fix it; with a few minutes a new, working version was up on the WP.org repo.

Stay in touch

Bringing news to you

Subscribe to our newsletter

By clicking and subscribing, you agree to our Terms of Service and Privacy Policy

Plugin developers often don’t have to worry about the impact their work will have on an end user’s site’s look. If your plugin deals with changing anything on the front end of a WordPress install at all, do your self a favor and install the Theme Unit Test data. Make sure your plugin works with a wide variety of content.


Related Content

thumbnail image

AlliPMG CultureCampaigns & Client WorkCompany NewsDigital MarketingData & Technology

PMG Innovation Challenge Inspires New Alli Technology Solutions

4 MINUTES READ | November 2, 2021

thumbnail image

Applying Function Options to Domain Entities in Go

11 MINUTES READ | October 21, 2019

thumbnail image

My Experience Teaching Through Jupyter Notebooks

4 MINUTES READ | September 21, 2019

thumbnail image

Working with an Automation Mindset

5 MINUTES READ | August 22, 2019

thumbnail image

3 Tips for Showing Value in the Tech You Build

5 MINUTES READ | April 24, 2019

thumbnail image

Testing React

13 MINUTES READ | March 12, 2019

thumbnail image

A Beginner’s Experience with Terraform

4 MINUTES READ | December 20, 2018

ALL POSTS