Repository navigation
Fix. Cleantalk. New curlopt_resolve way implemented, rotateModerate logic refactored. - #903
Open
alexandergull wants to merge 1 commit into
Open
alexandergull wants to merge 1 commit into
alexandergull wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #903 +/- ##
============================================
+ Coverage 32.45% 32.80% +0.35%
- Complexity 6948 6968 +20
============================================
Files 296 297 +1
Lines 27216 27236 +20
============================================
+ Hits 8833 8935 +102
+ Misses 18383 18301 -82 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Copilot review overview
🟡 Changes recommended
DNS recovery can retry rejected targets, and several migrated callers fail to persist server-state changes.
Review effort: Balanced
Findings: 5
Open (5)
What changed in this PR
Refactors moderate-server rotation and adds cURL DNS overrides while preserving hostname-based TLS verification.
Changes:
- Adds centralized moderate-server configuration and persistence.
- Implements
CURLOPT_RESOLVErecovery for DNS failures. - Migrates request paths and update handling to the new configuration.
| File | Description |
|---|---|
lib/Cleantalk/Common/HTTP/Request.php |
Adds the resolve cURL option alias. |
lib/Cleantalk/ApbctWP/ModerateServerConfig.php |
Centralizes cached server state. |
lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php |
Uses centralized configuration. |
lib/Cleantalk/ApbctWP/Antispam/ForceProtection.php |
Uses centralized configuration. |
lib/Cleantalk/Antispam/IntegrationsByClass/Woocommerce.php |
Uses centralized configuration. |
lib/Cleantalk/Antispam/Cleantalk.php |
Refactors rotation and DNS recovery. |
inc/cleantalk-updater.php |
Resets cache during upgrade. |
inc/cleantalk-common.php |
Integrates configuration lifecycle. |
tests/ApbctWP/TestModerateServerConfig.php |
Excluded from review by policy. |
tests/Antispam/CleantalkDnsOverrideTest.php |
Excluded from review by policy. |
tests/StandaloneFunctions/TestGetServerUrl.php |
Excluded from review by policy. |
tests/Common/HTTP/TestRequestResolveOption.php |
Excluded from review by policy. |
Files excluded by content exclusion policy (4)
- tests/Antispam/CleantalkDnsOverrideTest.php
- tests/ApbctWP/TestModerateServerConfig.php
- tests/Common/HTTP/TestRequestResolveOption.php
- tests/StandaloneFunctions/TestGetServerUrl.php
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+316
to
+320
| if ( $type_error === 'getaddrinfo_error' ) { | ||
| $this->rotateModerateWithDnsOverride(); | ||
| } else { | ||
| $this->rotateModerate(); | ||
| //try change server again if next sendRequest failed | ||
| $attempt = $attempt + 1; | ||
| } |
Comment on lines
+491
to
498
| // Hostname stays intact - only the resolution step is overridden. | ||
| $this->work_url = $url_protocol . $url_host . $url_suffix; | ||
| $this->dns_resolve_ip = $server['ip']; | ||
| $this->server_state_dirty = true; | ||
|
|
||
| // Do not checking previous down server | ||
| if ( ! empty($this->downServers) && in_array($this->work_url, $this->downServers) ) { | ||
| if ( ! empty($this->downServers) && in_array($this->getCurrentTargetKey(), $this->downServers) ) { | ||
| continue; |
Comment on lines
+1457
to
1459
| ModerateServerConfig::set($ct); | ||
|
|
||
| $ct->sendFeedback($ct_request); |
Comment on lines
+89
to
90
| ModerateServerConfig::set($ct); | ||
| $api_response = $ct->checkBot($ct_request); |
Comment on lines
+382
to
383
| ModerateServerConfig::set($ct); | ||
| $api_response = $ct->checkBot($ct_request); |
This branch has not been deployed
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.

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