← Back to solutions
PluginPHPFree

WP Captcha Guard

WordPress plugin exposing checkbox and invisible scoring captcha behind one interface, so any form renders and verifies the same way and switching version is a setting. Assets load per page and bundled dependencies are namespaced at build time, so it cannot collide with other plugins.

WP Captcha Guard

Stack

PHPWordPressreCAPTCHAPHP-Scoper

The problem

Public forms on a WordPress site, contact, registration, anything that hands work to a backend, collect bot traffic the moment they are indexed. The usual answer is a captcha plugin per form, and that answer has a cost: several plugins each load their own copy of the vendor script, each renders in its own way, and moving from checkbox captcha to the invisible scoring version means replacing the lot.

There is a subtler failure too. Captcha libraries ship their own dependencies, and when two plugins bundle different versions of the same library, PHP loads whichever came first and the other one breaks: a class of bug that surfaces only in production, on someone else's plugin.

Before → After

BeforeAfter
A separate captcha plugin per formOne component any form renders and verifies against
Switching v2 → v3 meant replacing the integrationVersion is a setting; both implement the same interface
Each plugin loading its own vendor scriptScript and styles registered once, enqueued only where needed
Bundled dependencies colliding with other pluginsDependencies namespaced at build time: no collisions possible
Verification logic copy-pasted between formsOne verification path, one place to fix

How it works

  1. One interface, two implementations. Checkbox and invisible scoring captcha both sit behind the same contract, so calling code renders a field and verifies a response without knowing which version is configured.
  2. The version is configuration. Switching between them is a settings change, not an integration rewrite: the field name and verification call stay the same on both sides.
  3. Assets load where they are used. Scripts and styles are registered centrally and enqueued only on pages that actually render a captcha, so a protected contact page does not tax every other page on the site.
  4. Dependencies are namespaced at build time.The build prefixes bundled library namespaces, so this plugin's copy of a shared library can never collide with a different version bundled by another plugin : the failure mode that makes captcha plugins fight each other.
  5. Forms opt in. Any form, core, WooCommerce or custom, renders the field and asks for a verdict at submit; nothing is patched into forms the site owner did not choose.

Key features

  • Checkbox and invisible scoring captcha behind one interface
  • Version switchable from settings without touching integration code
  • Centralised script and style registration, enqueued per page
  • Build-time namespacing of bundled dependencies: no plugin conflicts
  • Single verification path reusable from any form
  • Typed options object rather than scattered constants

Installation

  1. Upload the plugin folder to /wp-content/plugins/ and activate it
  2. Enter the site key and secret from the captcha provider console
  3. Choose the captcha version: checkbox or invisible scoring
  4. Render the field in your form and call the verification helper on submit
  5. Submit the form once as a real user to confirm the verdict comes back positive

Open for contract collaboration

I am available for contract-based collaboration. If you have an interesting project idea, schedule a call via Calendly.

Schedule a 30-min call