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
Swipe sideways to see the whole chart →
Stack
- PHP
- WordPress
- GD
- PHPCS (WordPress Coding Standards)