The Unique Headers WordPress plugin has been on my conscience for years. I first built it back in 2012, and the code had been gathering dust ever since. With over 20,000 active sites still running it, I couldn’t just leave it to die. So today I blocked out the whole day and gutted the code, rebuilding it to modern standards.

Unique Headers on GitHub

What changed

  • PSR-4 autoloading via Composer. The old classmap approach is dead and buried.
  • Inpsyde Modularity — the plugin is now split into an AdminModule, a DisplayModule, and an AttachmentHelper service instead of one big monolithic class.
  • TypeScript. The admin JavaScript was rewritten from spaghetti jQuery into an ES6 class and then ported to TypeScript with an esbuild build pipeline.
  • PHPStan at level 6 for static analysis.
  • PHP_CodeSniffer and PHP-CS-Fixer with PSR-12.
  • PHPUnit tests with WordPress function stubs.
  • GitHub Actions CI running all of the above on every push across PHP 8.2 through 8.5.
  • Security fixes — proper capability checks on savePost and storeTaxonomyData, plus proper sanitization with absint instead of sanitize_text_field.
  • Performance improvements — admin assets only enqueue on post and term edit screens now.
  • Bug fixes — including a crash with the Shortcode UI plugin and a broken URL check in the media uploader.

When I first made it, I never thought I would be rebuilding it fourteen years later, but here we are. I wonder if it will be in use in another fourteen.