Skip to content

Upd. Code. Editing the definition of an authorized user - #915

Merged
AntonV1211 merged 5 commits into
devfrom
bug_cookie_av
Oct 27, 2026
Merged

AntonV1211 merged 5 commits into
devfrom
bug_cookie_av

Conversation

@AntonV1211

Copy link
Copy Markdown
Contributor

@AntonV1211
AntonV1211 requested a balanced review from Copilot October 22, 2026 09:18
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.43137% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.73%. Comparing base (71e481d) to head (11c717b).

Files with missing lines Patch % Lines
lib/Cleantalk/ApbctWP/Antispam/ForceProtection.php 77.27% 5 Missing ⚠️
cleantalk.php 0.00% 3 Missing ⚠️
...antalk/ApbctWP/ContactsEncoder/ContactsEncoder.php 81.81% 2 Missing ⚠️
inc/cleantalk-pluggable.php 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #915      +/-   ##
============================================
+ Coverage     34.54%   34.73%   +0.18%     
- Complexity     7071     7085      +14     
============================================
  Files           298      298              
  Lines         27468    27500      +32     
============================================
+ Hits           9488     9551      +63     
+ Misses        17980    17949      -31     

☔ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Security-sensitive lifecycle and token-binding changes need human validation, including resolution of the IPv6 visitor-ID mismatch.

1 open issue
What changed in this PR

This PR strengthens how the plugin recognizes authenticated users and validates successful iframe-protection challenges.

Changes:

  • Replaces login-cookie presence checks with WordPress authentication validation.
  • Defers AJAX authentication checks and synchronizes contact encoding with user-state changes.
  • Adds signed, expiring challenge tokens bound to the site and visitor.
File Description
tests/​StandaloneFunctions/​AuthenticationTest.php Adds authentication tests; excluded from review per repository guidance.
tests/​ApbctWP/​Antispam/​ForceProtectionTest.php Adds protection-token tests; excluded from review per repository guidance.
lib/​Cleantalk/​ApbctWP/​ContactsEncoder/​ContactsEncoder.php Synchronizes encoder state when the current user changes.
lib/​Cleantalk/​ApbctWP/​Antispam/​ForceProtection.php Generates and validates signed challenge tokens.
inc/​cleantalk-pluggable.php Checks verified WordPress authentication.
cleantalk.php Defers AJAX authentication checks until plugins load.

Review effort: Balanced

Comment thread lib/Cleantalk/ApbctWP/Antispam/ForceProtection.php
@AntonV1211
AntonV1211 requested review from Glomberg and svedge October 22, 2026 09:54
Comment thread lib/Cleantalk/Common/Helper.php Outdated
@AntonV1211
AntonV1211 requested a review from Glomberg October 26, 2026 13:19

@Glomberg Glomberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@AntonV1211
AntonV1211 requested a review from Glomberg October 27, 2026 08:53
@AntonV1211
AntonV1211 merged commit 899f33b into dev Oct 27, 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.

4 participants