Skip to content

Mod. Integrations. Opting out of force alt cookies for SmartForms.#808

Open
svfcode wants to merge 7 commits into
devfrom
force-alt-12
Open

Mod. Integrations. Opting out of force alt cookies for SmartForms.#808
svfcode wants to merge 7 commits into
devfrom
force-alt-12

Conversation

@svfcode
Copy link
Copy Markdown
Member

@svfcode svfcode commented Jun 7, 2026

Copilot AI review requested due to automatic review settings June 7, 2026 13:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SmartForms integration to stop forcing “alternative cookies” globally, and instead relies on targeted request parameter injection for SmartForms submissions while keeping existing behavior for other integrations.

Changes:

  • Updated PHP SmartForms integration to avoid forcing alt cookies and to extract the email from formString before building the ct_gfa_dto() payload.
  • Updated frontend JS to stop treating SmartForms as a reason to enable ctPublic.force_alt_cookies, and added SmartForms-specific handling for AJAX payload injection (unwrapped keys).
  • Added PHPUnit coverage for SmartForms getDataForChecking() behavior across multiple formString formats; rebuilt bundled/prebuilt JS artifacts.

Reviewed changes

Copilot reviewed 11 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Antispam/IntegrationsByHook/TestSmartForms.php Adds unit tests for SmartForms request parsing and action-gating behavior.
lib/Cleantalk/Antispam/Integrations/SmartForms.php Removes cookie-forcing side effect and parses formString to reliably extract email.
js/src/public-1-main.js Removes SmartForms from forced-alt-cookie detection and injects CT fields into SmartForms AJAX with unwrapped keys.
js/prebuild/apbct-public-bundle.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_int-protection.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_int-protection_gathering.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_gathering.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_full-protection.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_full-protection_gathering.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_ext-protection.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/prebuild/apbct-public-bundle_ext-protection_gathering.js Rebuilt bundle reflecting the SmartForms alt-cookie and injection changes.
js/cleantalk-users-editscreen.min.js.map Regenerated sourcemap (unrelated minification output change).
js/cleantalk-users-editscreen.min.js Regenerated minified admin JS (unrelated minification output change).
js/cleantalk-comments-editscreen.min.js.map Regenerated sourcemap (unrelated minification output change).
js/cleantalk-comments-editscreen.min.js Regenerated minified admin JS (unrelated minification output change).
js/apbct-public-bundle.min.js Regenerated minified public bundle containing the updated SmartForms logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread js/src/public-1-main.js
Comment thread js/src/public-1-main.js
Copilot AI review requested due to automatic review settings June 7, 2026 13:13
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.16%. Comparing base (1df40e6) to head (7aa52d7).

Files with missing lines Patch % Lines
lib/Cleantalk/Antispam/Integrations/SmartForms.php 86.36% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #808      +/-   ##
============================================
+ Coverage     26.09%   26.16%   +0.06%     
- Complexity     5631     5642      +11     
============================================
  Files           265      265              
  Lines         24157    24172      +15     
============================================
+ Hits           6304     6324      +20     
+ Misses        17853    17848       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 23 changed files in this pull request and generated 1 comment.

Comment thread js/src/public-1-main.js
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 23 changed files in this pull request and generated 1 comment.

Comment thread lib/Cleantalk/Antispam/Integrations/SmartForms.php Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 7, 2026 13:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 23 changed files in this pull request and generated 2 comments.

Comment thread js/src/public-1-main.js
Comment thread js/src/public-1-main.js
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 23 changed files in this pull request and generated no new comments.

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.

4 participants