Sandi Verdev

Case study

Securing and modernizing a 2010 WordPress plugin with 170k+ downloads

Own open-source plugin · WordPress.org ↗ · GitHub ↗ · Dec 2025

Problem

Watermark RELOADED has been on WordPress.org since 2010 and was last tested with WordPress 4.1.

Its settings page saved raw form input with no nonce or capability check, a plain GET request could change options, and output wasn't escaped: cross-site request forgery (CSRF) and cross-site scripting (XSS) risks on every site still running it.

What I did

  • Added nonce and capability checks to everything that changes something: saving settings, the preview and removing the plugin's data.
  • Sanitized input per field (keys, integers, a whitelist of image sizes) and escaped all output.
  • Split one 986-line file into a loader, the core, the admin screens and an uninstall routine, with PHPDoc, checked with PHPCS against the WordPress Coding Standards.
  • Replaced a bundled jQuery color picker with WordPress's own, and removed the old donation nags and the GET endpoint.
  • Made it translatable while keeping the old minimum PHP and WordPress versions, so existing users can update safely.

Result

Watermark RELOADED before and afterVersion 1.3.5 had no nonce or capability checks, no output escaping, one 986-line file, no translation support and was tested up to WordPress 4.1.1. Version 1.4.0 checks every change, escapes all output, is split into 4 files, is translatable and is tested up to 6.9.1.3.5until 20151.4.0Dec 2025Nonce + capability checksnoneevery changeOutput escapingnoneall outputStructure1 file, 986 lines4 filesTranslatablenoyes (.pot)Tested up to WordPress4.1.16.9
Version 1.3.5 compared with 1.4.0.

Stack

  • PHP
  • WordPress
  • GD
  • PHPCS (WordPress Coding Standards)