This website uses cookies to ensure you get the best possible experience. See our Cookies Policy.

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

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.

Insights meet inbox

Sign up for weekly articles & resources.

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.


Posted by Christopher Davis

Related Content

thumbnail image

Get Informed

PMG Innovation Challenge Inspires New Alli Technology Solutions

4 MINUTES READ | November 2, 2021

Get Informed

Applying Function Options to Domain Entities in Go

11 MINUTES READ | October 21, 2019

thumbnail image

Get Informed

My Experience Teaching Through Jupyter Notebooks

4 MINUTES READ | September 21, 2019

Get Informed

Trading Symfony’s Form Component for Data Transfer Objects

8 MINUTES READ | September 3, 2019

Get Inspired

Working with an Automation Mindset

5 MINUTES READ | August 22, 2019

Get Informed

Parsing Redshift Logs to Understand Data Usage

7 MINUTES READ | May 6, 2019

Get Inspired

3 Tips for Showing Value in the Tech You Build

5 MINUTES READ | April 24, 2019

thumbnail image

Get Informed

Testing React

13 MINUTES READ | March 12, 2019

Get Inspired

Tips for Designing & Testing Software Without a UX Specialist

4 MINUTES READ | March 6, 2019

Get Informed

A Beginner’s Experience with Terraform

4 MINUTES READ | December 20, 2018

ALL POSTS