Skip to content

Import forms from WPForms - #6

Merged
AllTerrainDeveloper merged 1 commit into
mainfrom
importer/wpforms
Aug 16, 2026
Merged

AllTerrainDeveloper merged 1 commit into
mainfrom
importer/wpforms

Conversation

@AllTerrainDeveloper

Copy link
Copy Markdown
Owner

The second importer: WPForms — the second-largest install base among form plugins, and the one whose users lose the most when they switch, because conditional logic and payment fields are exactly what its paid tiers sell.

What it does

Forms → Import now shows a WPForms section beside the Contact Form 7 one, listing every wpforms post on the site. WPForms keeps each form as one JSON document in post_content, so the importer decodes the post directly — no WPForms classes, which means it works whether the plugin is active, deactivated, or already deleted. Each import creates a new AllTerrain form and never touches the original.

What converts

  • Every Lite field, and the Pro ones too — the Lite/Pro line doesn't exist in the stored JSON, so it doesn't exist here: text, textarea, email, name (simple becomes a single text box; first-last and first-middle-last become the composite name field with the right parts), select/radio/checkbox with choices, number and number-slider (bounds included), phone, address, date-time (splitting into date, time or datetime by format), URL, password, hidden, file-upload (extensions → allowed filetypes), rating (scale → max), signature, page breaks, section dividers (→ heading), HTML blocks, GDPR checkbox (→ consent field, with its choice label as the consent line and required kept mandatory — GDPR consent must not become optional by import), Likert grids (rows + shared answer choices), and NPS (→ opinion scale 0–10 with its end labels).
  • Payment fields keep their prices. payment-multiple/payment-checkbox/payment-select become choice fields whose choices carry a price, and payment-total becomes a real calculated total whose formula sums the payment fields — the running order total keeps running after the switch, through this plugin's own calculation engine. There's a test that submits VIP + Parking through the real engine and asserts 110.00 comes out.
  • Conditional logic converts — on fields, notifications and confirmations. WPForms nests rules as groups-of-rules (groups OR, rules within a group AND); this plugin's logic is one flat group with a match mode. The two shapes that translate exactly are translated: one group → match: all, several single-rule groups → match: any. Anything mixed keeps its first group — deliberately narrowing the condition rather than widening it, because a field that shows too rarely is caught in testing and a field that shows to everybody is a leak. Operators map one for one (==, !=, c, !c, ^, ~, e, !e, >, <).
  • Smart tags rewrite onto merge tags — {field_id="1"} (and field_value_id/field_html_id) become {field:…}; {all_fields}, {admin_email}, {site_name}, {site_url}, {page_url}, {user_ip} and the date stamps become their equivalents; anything unknown is left visible in the editor rather than silently deleted.
  • Notifications and confirmations carry over whole: to/subject/message, sender name and address, reply-to, per-notification logic; message, redirect and page confirmations with their logic.
  • Dropped or downgraded, on purpose — captcha and entry-preview have no meaning here and are dropped; an unrecognised add-on field becomes a visible plain-text field, because reviewable beats vanished.

Verification

  • 6 new PHPUnit tests (suite: 550 green): the Lite contact template field for field; simple-vs-composite name; payment prices and the total formula computed through the real calculation engine; both conditional-logic shapes plus the operator table; the Pro/add-on mapping sweep including the GDPR-stays-required rule; and an end-to-end import from a real wpforms post, including a broken-JSON post failing cleanly.
  • Live QA in wp-env: seeded an "Event tickets" form (name, email, attending?, conditionally-shown priced ticket choice, payment total) and imported it through the actual admin page. The result: logic rule show when f3 is Yes, prices [25, 100], total formula {f4}, {field:…} tags in subject and reply-to — all verified in the stored schema.
  • PHPCS: 0 errors.

One more to go: Gravity Forms.

🤖 Generated with Claude Code

https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp

WPForms keeps each form as one JSON document in post_content, so the
importer decodes the post directly and works whether the plugin is
active, deactivated or deleted. The Lite/Pro line does not exist here:
phone, address, date-time, uploads, signatures, Likert grids and NPS
convert alongside the Lite fields, conditional logic comes across in the
two shapes that translate exactly (one AND group, or several single-rule
groups as ANY), payment choices keep their prices, and a payment total
becomes a real calculated total over the payment fields — the running
order total keeps running after the switch.

Smart tags rewrite onto merge tags ({field_id="1"} to {field:…},
{all_fields} and friends to their equivalents), notifications and
confirmations carry over with their own conditional logic, and an
unrecognised add-on field becomes a visible text field rather than
silently vanishing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
@AllTerrainDeveloper
AllTerrainDeveloper merged commit b07f31e into main Aug 16, 2026
3 checks passed
@AllTerrainDeveloper
AllTerrainDeveloper deleted the importer/wpforms branch August 16, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant