Skip to content

Add SureForms integration - #293

Open
closetechbot wants to merge 1 commit into
trunkfrom
claude/sureforms-plugin-support-qzi853
Open

Add SureForms integration#293
closetechbot wants to merge 1 commit into
trunkfrom
claude/sureforms-plugin-support-qzi853

Conversation

@closetechbot

@closetechbot closetechbot commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • Adds a FORMSCRM_SureForms integration class that registers a FormsCRM metabox on the SureForms form editor (sureforms_form post type) with CRM type, credentials, module selection and field mapping.
  • Processes entries by hooking into the srfm_form_submit action fired after a successful SureForms submission, and calls create_entry() on the configured CRM.
  • Settings are stored per-form as post meta (_formscrm_sureforms_settings); mapped fields are matched by label, since that's how SureForms keys the submission data passed to srfm_form_submit.
  • CRM failures are caught and logged via formscrm_alert_error() — form submissions are never blocked.
  • The integration only loads when SureForms is active (is_plugin_active( 'sureforms/sureforms.php' )), following the same conditional-loading pattern as the other form integrations (CF7, JetFormBuilder, WPForms, etc.).

To confirm the exact hook name, the sureforms_form post type slug, and the label-keyed shape of the data passed to srfm_form_submit, I cloned and read the public SureForms source (brainstormforce/sureforms-public) rather than guessing.

Changes

  • includes/formscrm-library/class-sureforms.php (new): the integration class.
  • includes/formscrm-library/loader.php: conditionally requires the new class.
  • tests/Forms/test-sureforms.php (new) + tests/bootstrap.php: unit tests for get_merge_vars() (field mapping, literal fallback, array values).
  • readme.txt / formscrm.php: SureForms added to the supported plugins list, version bumped 4.4.3 → 4.5.0, changelog entry added.

Closes #292

Test plan

  • composer lint (WordPress Coding Standards via PHPCS)
  • composer phpstan
  • composer test (PHPUnit, including the new SureFormsTest)
  • Manual: install SureForms, build a form, configure the FormsCRM metabox (CRM type, credentials, module, field mapping), submit the form, and confirm the entry is created in the CRM.
  • Manual: submit with invalid CRM credentials and confirm the error is logged in FormsCRM's Error Log without blocking the form submission.

Note: I could not run composer lint / composer phpstan / composer test locally in my sandbox — composer install fails there due to network restrictions reaching the GitHub API (no token configured), unrelated to this change. I verified syntax with php -l and manually checked indentation/alignment/Yoda-conditions against the existing class-contactform7.php convention. CI should confirm.


Generated by Claude Code

Open WordPress Playground Preview

Registers a FormsCRM metabox on the sureforms_form post type for
per-form CRM credentials, module selection and field mapping, and
processes entries via the srfm_form_submit action after a successful
submission. Fields are mapped by label, matching how SureForms keys
the data it passes to that hook. Integration only loads when SureForms
is active, following the same conditional-loading pattern as the other
form integrations.

Closes #292

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012giGY35dPxEjk2VAXDLXcg
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

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.

Add SureForms integration

2 participants