Validating WordPress 01

Thinking about the validation plugin I’d use.

The problem

I have toward validation the same approach I have about code coverage: I’m not maniacal about it but think it’s something to keep in mind.
It’s good to know the rules to break them, should this be needed, consciously.
I’d like to validate what client themes and plugins produce on the page in an easy way; this is the base idea.
In UI terms I’d like to have a button, in the admin bar, sporting a label like “Validate this page”.


Having played around with both a little I’m not an expert in any but two main alternatives to this come to my mind:

  1. WordPress Theme Check plugin that will make sure a theme files stick to WordPress standards and make some validation checks.
  2. WP Validate that does what I’d like this ideal plugin to do but in a different way: it will check the markup of pages in the site against the W3C Markup Validator Service and report on the results.

Why re-invent the wheel?

The first reason is that this is my free code time and I will do it to test my skills and knowledge.
The second reason is that I’d like to expand on the features and UI of the latter plugin to have things work in a way that suits my workflow and taste.

First iteration

The first iteration of the plugin will take care of adding a “Validate this page” button in the admin bar, send the current page to the validator for HTML 5 validation and save the results somewhere in the database.

Scaffold code and first commit

The first step is scaffolding the plugin code.
I’ve used grunt-init with a customized WordPress plugin boilerplate template to do it.
The resulting code is on GitHub.