Skip to content

Mod. Integration. Opting out of force alt cookies for UserRegistrationPro members#801

Merged
AntonV1211 merged 2 commits into
devfrom
force_alt_11_av
May 26, 2026
Merged

Mod. Integration. Opting out of force alt cookies for UserRegistrationPro members#801
AntonV1211 merged 2 commits into
devfrom
force_alt_11_av

Conversation

@AntonV1211
Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings May 25, 2026 09:58
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.94%. Comparing base (a027892) to head (50e5007).
⚠️ Report is 16 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #801      +/-   ##
============================================
+ Coverage     25.87%   25.94%   +0.06%     
- Complexity     5602     5608       +6     
============================================
  Files           264      264              
  Lines         24116    24109       -7     
============================================
+ Hits           6241     6255      +14     
+ Misses        17875    17854      -21     

☔ View full report in Codecov by Sentry.
📢 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

This PR updates the CleanTalk integration for the User Registration & Membership (UserRegistrationPro) plugin to avoid forcing alternative cookies, while ensuring required request data is still captured for spam checks.

Changes:

  • Updated UserRegistrationPro integration to decode form_data, extract user_email / user_login, and build the spam-check payload via ct_gfa_dto(...).
  • Adjusted frontend JS to stop forcing alt cookies for UserRegistrationPro forms and to recognize/inject CleanTalk data for the action=user_registration_user_form_submit AJAX request.
  • Added PHPUnit coverage for UserRegistrationPro::getDataForChecking() across multiple form_data shapes (JSON, escaped JSON, arrays, invalid input).

Reviewed changes

Copilot reviewed 12 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/Antispam/IntegrationsByHook/TestUserRegistrationPro.php Adds unit tests for UserRegistrationPro data extraction/decoding behavior.
lib/Cleantalk/Antispam/Integrations/UserRegistrationPro.php Switches to ct_gfa_dto(...) and parses form_data for email/nickname.
inc/cleantalk-ajax.php Removes a plugin-specific blocked-response format for user_registration_user_form_submit.
js/src/public-1-main.js Stops forcing alt cookies for URP forms; adds AJAX signature handling for user_registration_user_form_submit.
js/prebuild/apbct-public-bundle.js Prebuilt bundle updated to reflect JS source changes (includes new AJAX sign logic).
js/prebuild/apbct-public-bundle_gathering.js Prebuilt “gathering” variant updated with the same JS behavior.
js/prebuild/apbct-public-bundle_int-protection.js Prebuilt “int-protection” variant updated with the same JS behavior.
js/prebuild/apbct-public-bundle_int-protection_gathering.js Prebuilt “int-protection + gathering” variant updated with the same JS behavior.
js/prebuild/apbct-public-bundle_full-protection.js Prebuilt “full-protection” variant updated with the same JS behavior.
js/prebuild/apbct-public-bundle_full-protection_gathering.js Prebuilt “full-protection + gathering” variant updated with the same JS behavior.
js/prebuild/apbct-public-bundle_ext-protection.js Prebuilt “ext-protection” variant updated with the same JS behavior.
js/prebuild/apbct-public-bundle_ext-protection_gathering.js Prebuilt “ext-protection + gathering” variant updated with the same JS behavior.
js/apbct-public-bundle.min.js Minified bundle updated to reflect the new JS behavior.

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

Comment thread lib/Cleantalk/Antispam/Integrations/UserRegistrationPro.php Outdated
Comment thread js/src/public-1-main.js
Comment thread inc/cleantalk-ajax.php
Comment thread js/prebuild/apbct-public-bundle.js
@AntonV1211 AntonV1211 merged commit 764ff5a into dev May 26, 2026
9 checks passed
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.

3 participants