diff --git a/inc/cleantalk-integrations-by-hook.php b/inc/cleantalk-integrations-by-hook.php index 6f19f7e15..997b73472 100755 --- a/inc/cleantalk-integrations-by-hook.php +++ b/inc/cleantalk-integrations-by-hook.php @@ -399,6 +399,11 @@ 'setting' => 'forms__contact_forms_test', 'ajax' => true ), + 'Newsletter' => array( + 'hook' => 'newsletter_action', + 'setting' => 'forms__contact_forms_test', + 'ajax' => false + ), ); add_action('plugins_loaded', function () use ($apbct_active_integrations) { diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index af19e6c63..c9f2fd408 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1521,6 +1521,14 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') ) { return 'fusion_form/avada_theme skip'; } + + // skip Newsletter - have direct integration + if ( + apbct_is_plugin_active('newsletter/plugin.php') && + Request::getString('action') === 'tnp' + ) { + return 'Newsletter'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ diff --git a/lib/Cleantalk/Antispam/Integrations/Newsletter.php b/lib/Cleantalk/Antispam/Integrations/Newsletter.php new file mode 100644 index 000000000..afe960ec7 --- /dev/null +++ b/lib/Cleantalk/Antispam/Integrations/Newsletter.php @@ -0,0 +1,55 @@ +getArray(); + if ( Post::getString('ct_bot_detector_event_token') ) { + $data['event_token'] = Post::get('ct_bot_detector_event_token'); + } + return $data; + } + return null; + } + + /** + * @inheritDoc + */ + public function doBlock($message) + { + global $ct_comment; + $ct_comment = $message; + ct_die($message, 403); + } +}