Skip to content

New.Proxy - #814

Merged
alexander-b-clean merged 8 commits into
devfrom
proxy.ab
Jul 2, 2026
Merged

New.Proxy#814
alexander-b-clean merged 8 commits into
devfrom
proxy.ab

Conversation

@alexander-b-clean

Copy link
Copy Markdown
Contributor

@alexander-b-clean
alexander-b-clean changed the base branch from master to dev June 17, 2026 17:23
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.70%. Comparing base (80253e6) to head (cb3286e).
⚠️ Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
lib/Cleantalk/ApbctWP/API.php 30.00% 7 Missing ⚠️

❌ Your patch check has failed because the patch coverage (30.00%) 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     #814      +/-   ##
============================================
+ Coverage     26.70%   27.70%   +1.00%     
- Complexity     5800     5811      +11     
============================================
  Files           278      278              
  Lines         24561    24568       +7     
============================================
+ Hits           6558     6807     +249     
+ Misses        18003    17761     -242     

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

Comment thread lib/Cleantalk/ApbctWP/API.php Outdated
@Glomberg

Copy link
Copy Markdown
Member

Please rename the PR according to the standard.

@alexander-b-clean alexander-b-clean changed the title Proxy New.Proxy Jul 1, 2026
@alexander-b-clean

Copy link
Copy Markdown
Contributor Author

Done

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.

Pull request overview

Adds support for routing CleanTalk API requests through a proxy configured via standard WordPress WP_PROXY_* constants, so outbound requests can work in proxied/locked-down hosting environments.

Changes:

  • Build a request $options array in Cleantalk\ApbctWP\API::sendRequest() instead of passing only ['timeout' => ...].
  • Add proxy host/port (and optional credentials) into request options.

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

Comment on lines +87 to +95
// Proxy settings from wp-config.php constants.
if ( defined('WP_PROXY_HOST') && WP_PROXY_HOST !== '' && defined('WP_PROXY_PORT') && WP_PROXY_PORT !== '' ) {
$options['proxy'] = WP_PROXY_HOST . ':' . WP_PROXY_PORT; // WP HTTP API branch
$options[CURLOPT_PROXY] = WP_PROXY_HOST; // cURL branch
$options[CURLOPT_PROXYPORT] = WP_PROXY_PORT;
if ( defined('WP_PROXY_USERNAME') && WP_PROXY_USERNAME !== '' ) {
$options[CURLOPT_PROXYUSERPWD] = WP_PROXY_USERNAME . ':' . (defined('WP_PROXY_PASSWORD') ? WP_PROXY_PASSWORD : '');
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

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.

Pull request overview

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

Comment on lines +86 to +96
$options = ['timeout' => $timeout];
// Proxy settings from wp-config.php constants.
$options['proxy'] = WP_PROXY_HOST . ':' . WP_PROXY_PORT; // WP HTTP API branch
// cURL branch (avoid referencing CURLOPT_* when ext-curl is not available)
if ( function_exists('curl_init') && defined('CURLOPT_PROXY') && defined('CURLOPT_PROXYPORT') ) {
$options[CURLOPT_PROXY] = WP_PROXY_HOST;
$options[CURLOPT_PROXYPORT] = WP_PROXY_PORT;
if ( defined('WP_PROXY_USERNAME') && WP_PROXY_USERNAME !== '' && defined('CURLOPT_PROXYUSERPWD') ) {
$options[CURLOPT_PROXYUSERPWD] = WP_PROXY_USERNAME . ':' . (defined('WP_PROXY_PASSWORD') ? WP_PROXY_PASSWORD : '');
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

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.

Pull request overview

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

Comment thread lib/Cleantalk/ApbctWP/API.php
@alexander-b-clean
alexander-b-clean merged commit 900bb97 into dev Jul 2, 2026
8 of 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.

5 participants