All case studies

DEV3 Technologies · own product

DEV3 AI Form Autofill & Spam Shield: paste-to-fill and AI spam screening for CF7, WPForms and Gravity Forms

Our own WordPress plugin: visitors paste a signature or a long message and AI fills the empty form fields, while every submission is scored for spam and abuse before the notification email goes out.

Industry
WordPress plugins

Live project preview

Client systems are private — screenshots shown where permitted.

DEV3 Technologies · own product — screenshots
A messy pasted message fills 6 empty fields, including the phone number in E.164 format, with an Undo button. The form is never submitted automatically.

A messy pasted message fills 6 empty fields, including the phone number in E.164 format, with an Undo button. The form is never submitted automatically.

The challenge

Contact forms have two problems that pull in opposite directions. Genuine visitors, often on a phone, have to retype details they already have in an email signature or a message, and they make typos in email domains and phone numbers. Meanwhile the same form attracts link-building pitches, crypto scams and abusive messages that CAPTCHAs and keyword filters only partly stop. An AI can help with both, but a public endpoint that calls a paid AI API is also an attack surface: bots can point it at arbitrary forms, burn the site's API budget, or try to make it fill hidden fields. And the plugin has to work inside three very different form builders (Contact Form 7, WPForms and Gravity Forms), each with its own field model, spam handling and settings UI.

Our solution

We built one plugin with a builder-neutral core and one adapter per form builder. The browser never tells the server what the form looks like: the server rebuilds the field schema from the stored form every time.

Key design decisions

  • One normalized field schema. Each adapter turns its builder's form definition (CF7 form-tags, WPForms form JSON, Gravity Forms field objects) into the same shape: { id, name, label, type, required, options[], role }. Paste-to-fill, corrections and the spam gate only ever see that shape.
  • Server-built schema, never trusted from the browser. The public /parse route takes only a form key, a token and the pasted text. Target fields, labels and choice options come from get_fields() on the server, and the AI's answer is constrained by a response schema whose id is an enum of those fields.
  • Layered public endpoint. Same-origin check, a per-IP rate limit, a signed per-form token (an HMAC over form key and expiry, valid 12 hours, so it survives full-page caches), the form must exist and have the feature enabled, and a site-wide daily AI cap.
  • Fill only what is empty. The frontend writes only into empty fields, highlights them, offers a one-click Undo and never submits the form. Choice answers must match an existing option or they are dropped.
  • Corrections without AI. Email domain typos (gmial.com → gmail.com), E.164 phone formatting for 70+ countries and name casing run locally in the browser, with no network call.
  • Spam gate in each builder's own mechanism. One Spam_Gate returns allow, block, spam or flag; the adapters translate that into wpcf7_spam / wpcf7_before_send_mail, WPForms' wpforms_process errors and spam_reason, or Gravity Forms' gform_validation / gform_entry_is_spam.
  • Privacy by construction. The classifier sees "Label: value" lines only; email addresses are reduced to their domain and phone numbers are never sent. The spam log stores salted SHA-256 hashes and a 140-character redacted excerpt, and rows expire after 90 days by default.
  • Explicit failure policy. If the AI is unreachable or the daily cap is hit, the site owner chooses fail-open (deliver and log the outage) or fail-closed (block with a message).

Architecture

The plugin is PHP 7.4+ with a React admin built with @wordpress/scripts. A shared core used across DEV3's plugins provides the Google Gemini API client (structured output with maxLength caps, gemini-2.5-flash by default), encrypted key storage, rate limiting, usage logs and licensing. On top of it sit the three adapters, the paste-to-fill extractor, the classifier, the spam gate and the log repository. Each builder gets a native settings panel: a CF7 editor tab, a WPForms Settings section with a per-field "Smart paste source" toggle, and a Gravity Forms Form Settings section.

Results

The plugin is complete and is being prepared for release on CodeCanyon and the DEV3 marketplace. What was built and verified:

  • 56 Jest tests for the frontend fill, undo and correction logic.
  • 62 PHPUnit tests (387 assertions) running against real Contact Form 7 6.2.3 and WPForms Lite 2.0.3. Gravity Forms is covered through stubs of its documented hooks and GFAPI only, because it is a commercial plugin we did not run in the test environment.
  • Browser end-to-end runs with Puppeteer: 16/16 frontend checks and 17/17 admin checks passed.
  • Live AI checks: a messy, lowercase paragraph filled 6 fields, including a phone number normalized to E.164; a link-building pitch scored 0.95 spam probability against 0.10 for a genuine enquiry; a German message was detected as German.
  • A test proves the server ignores a client-supplied field list: a fake admin_password field never reaches the prompt or the response.

Related case studies