Add SureForms integration - #293
Open
closetechbot wants to merge 1 commit into
Open
Conversation
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
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FORMSCRM_SureFormsintegration class that registers a FormsCRM metabox on the SureForms form editor (sureforms_formpost type) with CRM type, credentials, module selection and field mapping.srfm_form_submitaction fired after a successful SureForms submission, and callscreate_entry()on the configured CRM._formscrm_sureforms_settings); mapped fields are matched by label, since that's how SureForms keys the submission data passed tosrfm_form_submit.formscrm_alert_error()— form submissions are never blocked.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_formpost type slug, and the label-keyed shape of the data passed tosrfm_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 forget_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 phpstancomposer test(PHPUnit, including the newSureFormsTest)Note: I could not run
composer lint/composer phpstan/composer testlocally in my sandbox —composer installfails there due to network restrictions reaching the GitHub API (no token configured), unrelated to this change. I verified syntax withphp -land manually checked indentation/alignment/Yoda-conditions against the existingclass-contactform7.phpconvention. CI should confirm.Generated by Claude Code