Skip to content

Remove deprecated Contact Form 7 and Ninja Forms popup actions - #1427

Open
marklchaves wants to merge 1 commit into
developfrom
fix/remove-deprecated-cf7-ninja-forms-popup-actions
Open

marklchaves wants to merge 1 commit into
developfrom
fix/remove-deprecated-cf7-ninja-forms-popup-actions

Conversation

@marklchaves

@marklchaves marklchaves commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Removes Contact Form 7's deprecated "Popup Settings" editor tab (Close/Open Popup checkboxes + delay), its hidden-field settings injector, and its option-based save handler. CF7's own UI already flags this tab as "Deprecated," and it currently renders with a layout bug.
  • Removes Ninja Forms' "Open Popup" / "Close Popup" add-on actions (action classes + registration).
  • Trims the now-dead settings-parsing code out of the CF7/Ninja Forms frontend JS, while preserving the separate (still-supported, also-deprecated) cf7_form_success / ninja_form_success cookie-trigger event path — those keep working.
  • Updates Form_Integration_Query_Test.php to drop coverage for the removed CF7/Ninja Forms popup-list helpers, keeping the Gravity Forms assertions intact (Gravity Forms ships the equivalent feature and is intentionally out of scope here).

CF7
pm-cf7-open-close-popup-deprecated

Ninja Forms
pm-ninja-forms-open-close-popup-deprecated

Priority

Low–medium. This is cleanup of dead/already-broken UI, not a behavioral fix for an active workflow. It doesn't touch any currently-recommended trigger/cookie flow, and Gravity Forms' equivalent (still active) feature isn't touched. The real risk surface is sites with existing forms that already have the legacy settings/actions saved — see below.

Testing done

  • ✅ CF7 form editor — confirmed the "Popup Settings" tab no longer appears, no PHP notices on the form edit screen.
  • ✅ Ninja Forms action list — confirmed "Open Popup" / "Close Popup" no longer appear under Installed Add-on Actions.
  • ✅ Cookie-trigger popups (cf7_form_success / ninja_form_success) — confirmed these still fire correctly, since the JS still calls window.PUM.forms.success() on submission.
  • ✅ Generic "close popup on form submission" popup setting — confirmed CF7 and Ninja Forms submissions inside a popup still close/redirect per that separate, unrelated setting.

Testing NOT done — please run before this goes live

  • ⚠️ Ninja Forms form with a pre-existing "Open Popup" or "Close Popup" action already attached (built before this change). Need to confirm submitting it doesn't throw a PHP fatal/warning now that NF_PUM_Actions_OpenPopup/ClosePopup no longer exist and aren't registered in Ninja_Forms()->actions.
  • ⚠️ CF7 form with the legacy Close/Open Popup checkboxes previously checked (its orphaned cf7_pum_{id} option still exists in wp_options). Need to confirm submitting it from inside a popup degrades silently — no error, just without the removed open/close side effect.

These two are the actual regression risk in this change; everything else is additive UI removal with no stored state to contend with.

Suggested migration plan for the above

If either case above turns up a problem (or even as a straightforward cleanup pass regardless), consider a one-time upgrade routine:

  • Ninja Forms: iterate existing forms' saved actions for type of closepopup/openpopup and strip those entries so stale references stop being processed/serialized at all. Log affected form IDs for site-owner visibility.
  • Contact Form 7: bulk-delete orphaned cf7_pum_% options (DELETE FROM {$wpdb->options} WHERE option_name LIKE 'cf7_pum_%') — nothing reads them anymore, so it's pure dead data.

This would fit the existing upgrade-routine pattern so it runs once per site on update, rather than needing per-site manual cleanup.

Remaining regression checks suggested before release

Next reviewer: please also exercise, in addition to the two ⚠️ items above:

  • Modern "Form Submission" conversion tracking still increments for CF7/NF submissions tied to a CTA/popup (unrelated code path, but shares the touched files — worth a sanity pass).
  • Gravity Forms' own Open/Close Popup feature (untouched, but shares the same pum-forms.js runtime) — confirm no collateral damage.
  • Browser console on pages with CF7/NF forms — no JS errors from the trimmed contactform7.js/ninjaforms.js.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Integration Changes
    • Contact Form 7 no longer provides form-level popup settings in its editor.
    • Ninja Forms no longer offers actions to open or close popups after submission.
    • Successful submissions in both integrations now use the standard form-success behavior rather than legacy popup settings.

Both integrations shipped a per-form "open/close popup on submit"
feature (CF7's Popup Settings editor tab; Ninja Forms' Open/Close
Popup actions) that is deprecated and, per CF7, broken in current
versions. Removes the admin UI, the settings persistence, and the
Ninja Forms action classes.

The separate (also deprecated but still functional) cf7_form_success
and ninja_form_success cookie-trigger events are left intact, so
JS still calls window.PUM.forms.success() on submission to preserve
that trigger path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between acd2dcc and 921f9e8.

Files selected for processing: 7
  • assets/js/src/integration/contactform7.js
  • assets/js/src/integration/ninjaforms.js
  • includes/integrations/class-pum-cf7.php
  • includes/integrations/class-pum-ninja-forms.php
  • includes/integrations/ninja-forms/Actions/ClosePopup.php
  • includes/integrations/ninja-forms/Actions/OpenPopup.php
  • tests/php/tests/Form_Integration_Query_Test.php
Files with no reviewable changes: 4
  • includes/integrations/class-pum-ninja-forms.php
  • includes/integrations/ninja-forms/Actions/ClosePopup.php
  • includes/integrations/class-pum-cf7.php
  • includes/integrations/ninja-forms/Actions/OpenPopup.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

Contact Form 7 and Ninja Forms no longer use their removed popup settings and actions. Their JavaScript success handlers now pass false. Popup-list tests now check the Gravity Forms provider.

Changes

Form integration popup handling

Layer / File(s) Summary
Remove Contact Form 7 popup settings
includes/integrations/class-pum-cf7.php, assets/js/src/integration/contactform7.js
The integration no longer registers or implements popup editor settings. Its success handler now calls window.PUM.forms.success($form, false).
Remove Ninja Forms popup actions
includes/integrations/class-pum-ninja-forms.php, includes/integrations/ninja-forms/Actions/*, assets/js/src/integration/ninjaforms.js, tests/php/tests/Form_Integration_Query_Test.php
The integration no longer registers its open and close actions. Its JavaScript handler no longer uses legacy action settings and calls window.PUM.forms.success($form, false). The popup-list tests now check Gravity Forms.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: danieliser

Merge Risk: Minimal · up to 921f9

No actionable merge-blocking risk remains after the source and release-path review.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removal of deprecated Contact Form 7 and Ninja Forms popup actions.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

assets/js/src/integration/contactform7.js

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

assets/js/src/integration/ninjaforms.js

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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