Repository navigation
Upd. AJAX/REST transport refactored. - #926
alexandergull wants to merge 17 commits into
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (51.17%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #926 +/- ##
============================================
+ Coverage 36.90% 37.57% +0.66%
- Complexity 7434 7486 +52
============================================
Files 301 301
Lines 28115 28189 +74
============================================
+ Hits 10377 10591 +214
+ Misses 17738 17598 -140 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Active issues leave adjacent phone numbers exposed when the sign budget is exceeded and allow email encoding to insert literal markup into unparsed-text content, changing submitted data.
2 open issues
What changed in this PR
This PR separates AJAX output from shared processing and REST responses in the CleanTalk WordPress plugin. It also updates contact encoding safeguards and frontend form recovery.
Changes:
- Introduces shared result methods, explicit REST responses, and JSON error handling.
- Updates decoding-cookie permissions, transport selection, and restored-form handling.
- Adds contact-processing limits and markup indexing, with corresponding bundled assets.
| File | Description |
|---|---|
| tests/ApbctWP/TestRestResponses.php | Adds transport-response tests; excluded from review. |
| tests/ApbctWP/HelperTest.php | Adds JSON-helper tests; excluded from review. |
| lib/Cleantalk/Common/ContactsEncoder/Helper/ContactsEncoderHelper.php | Introduces markup scanning and offset indexes. |
| lib/Cleantalk/Common/ContactsEncoder/ContactsEncoder.php | Adds processing limits, fallback masking, and markup safeguards. |
| lib/Cleantalk/ApbctWP/Variables/AltSessions.php | Separates cookie processing from AJAX output. |
| lib/Cleantalk/ApbctWP/RestController.php | Routes requests through explicit REST response methods. |
| lib/Cleantalk/ApbctWP/Helper.php | Adds JSON encoding and decoding helpers. |
| lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php | Shares decoding results across transports and controls cookie permission. |
| lib/Cleantalk/ApbctWP/Antispam/ForceProtection.php | Separates bot-check results from AJAX serialization. |
| lib/Cleantalk/ApbctWP/AJAXService.php | Extracts reusable JavaScript-key response data. |
| js/src/public-3-check-email.js | Preserves the configured transport. |
| js/src/public-2-internal-forms.js | Protects restored forms without repeated wrapping. |
| js/src/public-2-force-protection.js | Restores forms on transport errors and emits a restoration event. |
| js/src/common-decoder.js | Requires backend permission before setting the pass cookie. |
| js/prebuild/apbct-public-bundle.js | Synchronizes decoder and transport changes. |
| js/prebuild/apbct-public-bundle_int-protection.js | Includes updated internal-form handling. |
| js/prebuild/apbct-public-bundle_int-protection_gathering.js | Synchronizes internal-protection and gathering variant. |
| js/prebuild/apbct-public-bundle_gathering.js | Synchronizes decoder and transport changes. |
| js/prebuild/apbct-public-bundle_full-protection.js | Includes form recovery and protection updates. |
| js/prebuild/apbct-public-bundle_full-protection_gathering.js | Synchronizes full-protection and gathering variant. |
| js/prebuild/apbct-public-bundle_ext-protection.js | Synchronizes decoder and transport changes. |
| js/prebuild/apbct-public-bundle_ext-protection_gathering.js | Synchronizes external-protection and gathering variant. |
| js/cleantalk-admin.min.js.map | Updates the admin bundle source map. |
| js/cleantalk-admin.min.js | Includes the updated shared decoder. |
| inc/cleantalk-pluggable.php | Returns whether the server-side pass mark was saved. |
| inc/cleantalk-common.php | Extracts shared email-check results and updates AJAX delegation. |
Review effort: Balanced

https://app.doboard.com/1/task/48102