Skip to content

New. Integration. Integration with Email Subscribers#809

Merged
AntonV1211 merged 8 commits into
devfrom
new_integ_email_sub_av
Jun 17, 2026
Merged

New. Integration. Integration with Email Subscribers#809
AntonV1211 merged 8 commits into
devfrom
new_integ_email_sub_av

Conversation

@AntonV1211

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings June 9, 2026 06:18
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.46%. Comparing base (a1cd3fa) to head (4ccdfb6).
⚠️ Report is 31 commits behind head on dev.

Files with missing lines Patch % Lines
...eantalk/Antispam/Integrations/EmailSubscribers.php 68.18% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #809      +/-   ##
============================================
+ Coverage     26.25%   26.46%   +0.21%     
- Complexity     5632     5667      +35     
============================================
  Files           265      269       +4     
  Lines         24160    24240      +80     
============================================
+ Hits           6344     6416      +72     
- Misses        17816    17824       +8     

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

Pull request overview

Adds a dedicated CleanTalk integration for the Email Subscribers by Icegram Express plugin, moving handling from the generic AJAX hook into the integrations-by-hook framework.

Changes:

  • Introduces Cleantalk\Antispam\Integrations\EmailSubscribers to collect subscription POST data and return a standardized block JSON payload.
  • Registers the new integration in inc/cleantalk-integrations-by-hook.php for the es_add_subscriber AJAX action.
  • Removes the legacy es_add_subscriber special-case from ct_ajax_hook().

Reviewed changes

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

File Description
lib/Cleantalk/Antispam/Integrations/EmailSubscribers.php New integration implementation: data extraction + AJAX block response.
inc/cleantalk-pluggable.php Adds a skip rule for es_add_subscriber when Email Subscribers is active.
inc/cleantalk-integrations-by-hook.php Registers EmailSubscribers integration on es_add_subscriber (AJAX).
inc/cleantalk-ajax.php Removes legacy hardcoded handling for es_add_subscriber.

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

Comment thread lib/Cleantalk/Antispam/Integrations/EmailSubscribers.php Outdated
Comment thread lib/Cleantalk/Antispam/Integrations/EmailSubscribers.php
Copilot AI review requested due to automatic review settings June 9, 2026 06:50

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 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread inc/cleantalk-pluggable.php
Copilot AI review requested due to automatic review settings June 17, 2026 09:48

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 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread tests/Antispam/IntegrationsByHook/TestEmailSubscribers.php
Comment on lines +197 to +216
/**
* Test doBlock returns ES-compatible error array in non-AJAX mode (filter path)
*/
public function testDoBlockReturnsErrorArrayNonAjax()
{
// DOING_AJAX is not defined or false in non-AJAX context
// In test env DOING_AJAX may already be defined, so we test the return format
// by reading the source
$source = file_get_contents(
dirname(__FILE__, 4) . '/lib/Cleantalk/Antispam/Integrations/EmailSubscribers.php'
);
// Must return array with 'status' => 'ERROR' for the filter path
$this->assertStringContainsString("'status' => 'ERROR'", $source);
$this->assertStringContainsString("'message_text' => \$message", $source);
// Must have DOING_AJAX check to differentiate AJAX vs filter path
$this->assertStringContainsString("defined('DOING_AJAX') && DOING_AJAX", $source);
// Must use wp_send_json for AJAX path (not wp_send_json_error)
$this->assertStringContainsString('wp_send_json(', $source);
$this->assertStringNotContainsString('wp_send_json_error', $source);
}
Comment thread lib/Cleantalk/Antispam/Integrations/EmailSubscribers.php
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 17, 2026 11:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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 5 out of 5 changed files in this pull request and generated 1 comment.

Comment on lines +200 to +216
public function testDoBlockReturnsErrorArrayNonAjax()
{
// DOING_AJAX is not defined or false in non-AJAX context
// In test env DOING_AJAX may already be defined, so we test the return format
// by reading the source
$source = file_get_contents(
dirname(__FILE__, 4) . '/lib/Cleantalk/Antispam/Integrations/EmailSubscribers.php'
);
// Must return array with 'status' => 'ERROR' for the filter path
$this->assertStringContainsString("'status' => 'ERROR'", $source);
$this->assertStringContainsString("'message_text' => \$message", $source);
// Must have DOING_AJAX check to differentiate AJAX vs filter path
$this->assertStringContainsString("defined('DOING_AJAX') && DOING_AJAX", $source);
// Must use wp_send_json for AJAX path (not wp_send_json_error)
$this->assertStringContainsString('wp_send_json(', $source);
$this->assertStringNotContainsString('wp_send_json_error', $source);
}
@AntonV1211 AntonV1211 merged commit 6b7aa59 into dev Jun 17, 2026
8 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.

6 participants