Review of WP Test
April 4, 2016
While we do not force our clients into WordPress, we do build a lot of WordPress sites. To that end we are always looking for ways to improve our process. One of our awesome dev’s James recently took a few minutes to try out the WP Test plugin. Here is what he found.
WP Test is a plugin for testing basic WordPress builtin features within your theme. It is a way to see if your theme can handle core WordPress functionalities, and also see how these functionalities affect your layout. The tests focus heavily on posts and comments, so they apply mostly to blog based themes. However there are some tests focused on pages as well.
WP Test is implemented using the WordPress import tool or via WPCLI. For this test I used the import method.
My first attempt to install the dummy content was on a site hosted on Godaddy using Cpanel. The import method failed, and I was unable to retry. The import method failed due to a server error on Godaddy, which prevented me from retrying the import method.
My second attempt to install the dummy content was done on a local WordPress install running on MAMP. This time the xml file import was very fast and easy.
Once imported, the dummy content shows up as follows: 6 new users 37 new posts 15 new pages.
The “tests” are performed by simply viewing the posts and pages to determine if the prebuilt functions are executing properly. Every post or page will have a specific test, such as showing paginated comments, or the WordPress built in video shortcode. You can determine if your theme is executing it properly and how it is affecting your layout. A few of the posts contain basic formatting tags, such as heading tags, subscript tags, and code tags. Some posts also contain image formatting css. One of the pages is an entire Amazon store iframe. The point is, there is a wide variety of basic functions that help you determine if your theme is executing properly.
WP Test is easy to setup and easy to use. The tests include many basic functions that can easily be overlooked, and they are organized in a very easy to navigate way by posts and pages. The authors of the tests included lots of humor to make them fun to view. It takes very little time out of your dev process.
The tests included within WP Test are very basic and limited. They focus almost exclusively on WordPress built-in functions, branching out only to a couple features of the Jetpack plugin and some basic html tags and css, and most of this within posts and post comments. The devs themselves admit the tests are not very expansive, and they are relying on their users to bring new tests to their attention. There are no solutions offered by the tests, they are there simply to point things out to the developer.
WP Test teeters on the edge of so simple why not use it and so simple there’s no point. Its tests seem best suited for themes that are very post driven. For sites that are dynamic, relying on posts, user comments, trackbacks, and pings the tests can prove useful. They may point things out that the developer didn’t think of. For sites that are static, or have very little dynamic content, they have less use, with only a few tests focused on layout elements. For sites that have no posts or comments, the tests might prove useless. Maybe down the road there will be more dynamic tests for more advanced processes.
- More advanced tests (e.g. actual test functions that can help the developer, such as testing for functionality in custom taxonomies)
- Testing for popular plugins (e.g. contact form 7, akismet, tests that make sure these are working properly)
- Code functions rather than just dummy content
We are exited for the future of WP Test and look forward to contributing and seeing what the community can create.