Skip to content

Commit e484f9a

Browse files
svfcodealexandergullGlombergAntonV1211
authored
Beta (#693)
* Fix. Integration. Fluentbook. Added public scripts echoing on author landing visit. https://doboard.com/1/task/34803 * Code. PHPCS. * Fix. Integrations. JS. Run dynamic forms catching on interval. * Update version * Update version * Upd. Integrations. JS. Dynamic rendered form interval clearance on window load custom events. * Upd. EmailEncoder. Added new format to encode phone numbers. https://doboard.com/1/task/36719 * Fix. Woocommerce. Exclusion for WC Stripe Apple Pay frontend request. https://doboard.com/1/task/36147 * Fix. Integration. Brick theme ajax response fixed. https://doboard.com/1/task/36432 * Fix. Integration. FunnelKit. Funnel builder action added. https://doboard.com/1/task/36747 * Fix. Integration. Ninja Forms refactored - no using `force_alt_cookies`. * Fix. WPMS. Getting and recreating personal tables on WPMS. https://doboard.com/1/task/34848 * Upd. Code. ContactsEncoder module refactoring. (#679) * New. Code. Contacts Encoder included by composer. * New. Code. Contacts Encoder included by composer #2. * Fic. Code. Contacts Encoder refactoring - start. * Fic. Code. Contacts Encoder refactoring - continue. * Fix. Code. Contacts Encoder refactoring - continue #2. * Fix. Code. Contacts Encoder refactoring - complete. * Fix. Code. Contacts Encoder refactoring - WP based code replaced. * Fix. Code. Contacts Encoder refactoring - ContactsEncoder package updated. * Fix. Code. Contacts Encoder refactoring - `byAccessKeyFail` method fixed. * Fix. Code. Contacts Encoder refactoring - Unit tests and Psalm fixed. * Fix. Code. Contact encoder commit 40e479f alternative implementation. * Fix. Contacts Encoder. Restore forgotten fix #681. * Fix. Contacts Encoder. Decoder init process replaced. * Fix. Bot detector. Set `event_token` for the different cookies types fixed. Fix. Bot detector. Set `event_token` for the different cookies types fixed. * Fix. Code. ES-Lint notice fixed. * Fix. Settings. TRP enabled by default. * New. WPRecipeMaker. Integration with WP Recipe Maker * Mod. WPRecipeMaker. Editing the blocking message * Ninja forms check email exist av (#675) * Mod. CheckEmailExist. Integration of Check Email Exist with Ninja Forms * Fix eslint * New. CheckEmailExist. Integration of Check Email Exist with Ninja Forms * Fix eslint * Upd. CheckEmailExist. Search for ::after styles to calculate the indentation --------- Co-authored-by: SVFCode <svfcode@mail.ru> * Fix. OptiPress. Editing the integration in passing the message parameter * Remove coverage.xml * Fix. WPRecipeMaker. Combining logic under one condition * Fix. SFW update. Flush expected networks count before files processing. https://doboard.com/1/task/36234 * Fix. SFW update. Tables prefix updated. * Code. SFW update. PHP Unit. * Upd. WCAddToCart. Processing and adding event_token to the request wh… (#682) * Upd. WCAddToCart. Processing and adding event_token to the request when adding the product * Fix eslint * Fix. WCAddToCart. Removed the unnecessary event_token receipt, added a condition for mixing event_token if the add_to_cart option is enabled * Upd property name. --------- Co-authored-by: svfcode <svfcode@mail.ru> * Github. New action to create assets from dev/fix on push event. * Github. New action to create assets from dev/fix on push event. * Github. New action to create assets from dev/fix on push event. * Upd. TRP. Restart show badge on woo review page. (#690) * Fix. SFW update. Flush expected networks count before files processing. https://doboard.com/1/task/36234 * Test commit for code coverage #1 * Fix. SFW update. Tables prefix updated. * Code. SFW update. PHP Unit. * Code. SFW update. PHP Unit #2. * Code. SFW update. PHP Unit #3. * Upd. WCAddToCart. Processing and adding event_token to the request wh… (#682) * Upd. WCAddToCart. Processing and adding event_token to the request when adding the product * Fix eslint * Fix. WCAddToCart. Removed the unnecessary event_token receipt, added a condition for mixing event_token if the add_to_cart option is enabled * Upd property name. --------- Co-authored-by: svfcode <svfcode@mail.ru> * Upd. TRP. Restart show badge on woo review page. * remove debug --------- Co-authored-by: alexandergull <alex.g@cleantalk.org> Co-authored-by: Alex <galyshev@cleantalk.org> Co-authored-by: AntonV1211 <39616556+AntonV1211@users.noreply.github.com> * Upd. ContactEncoder. Improve UX. (#688) * Upd. ContactEncoder. Improve UX. * Fix. Contacts encoder. Mailto links handle fixed. --------- Co-authored-by: Glomberg <bazz@bk.ru> * Fix. Helper. Correcting the error of using 'static' in string callables inside array_map since version 8.2 * Remove comment * Fix. FluentForm. The verification depends on the data__protect_logged_in and is_user_logged_in() options * Update version * Code. Github. Run tests on beta branch pushes. * Fix. FluenForm. Edit the condition depending on the data__protect_logged_in option * update common * fix psalm * Fix. Integrations. Update Woo rest checkout. * fix psalm * Fix. Integrations. Update Woo add to cart check. * Update stable tag --------- Co-authored-by: alexandergull <alex.g@cleantalk.org> Co-authored-by: Glomberg <bazz@bk.ru> Co-authored-by: AntonV1211 <antonV1211@yandex.ru> Co-authored-by: AntonV1211 <39616556+AntonV1211@users.noreply.github.com> Co-authored-by: Alex <galyshev@cleantalk.org>
1 parent 9076ff3 commit e484f9a

File tree

75 files changed

+3125
-960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3125
-960
lines changed

.github/workflows/dev-fix-zip.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Auto Release Zip on dev/fix push (Linux)
2+
3+
on:
4+
push:
5+
branches: [dev, fix, beta]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install p7zip
21+
run: sudo apt-get update && sudo apt-get install -y p7zip-full
22+
23+
- name: Set plugin name
24+
run: echo "PLUGIN_NAME=cleantalk-spam-protect" >> $GITHUB_ENV
25+
26+
- name: Create .7zignore
27+
run: |
28+
echo "node_modules" > .7zignore
29+
echo "package.json" >> .7zignore
30+
echo "package-lock.json" >> .7zignore
31+
echo "gulpfile.js" >> .7zignore
32+
echo "tests" >> .7zignore
33+
echo "README.md" >> .7zignore
34+
echo "LICENSE" >> .7zignore
35+
echo "psalm.xml" >> .7zignore
36+
echo "composer.json" >> .7zignore
37+
echo "composer.lock" >> .7zignore
38+
echo "vendor" >> .7zignore
39+
echo "js/prebuild" >> .7zignore
40+
echo "js/src" >> .7zignore
41+
echo "css/src" >> .7zignore
42+
echo ".*" >> .7zignore
43+
44+
- name: Create ZIP archive with 7z
45+
run: 7z a -tzip "${PLUGIN_NAME}.zip" . -xr@.7zignore
46+
47+
- name: Create / update GitHub Release and upload asset
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
tag_name: ${{ github.ref_name }}-version
51+
name: ${{ github.ref_name }} version
52+
body: "Prebuil version from ${{ github.ref_name }} branch"
53+
draft: false
54+
prerelease: true
55+
files: |
56+
${{ env.PLUGIN_NAME }}.zip
57+
overwrite_files: true
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Clean up
62+
run: rm -f "${PLUGIN_NAME}.zip" .7zignore

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: # event list
55
branches:
66
- dev
77
- fix
8+
- beta
89
- master
910
pull_request:
1011
branches:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ package-lock.json
99
checkstyle.xml
1010
/fw_files*
1111
/cleantalk-spam-protect.bat
12+
.github/
13+
/lib/Cleantalk/Common/ContactsEncoder/.github/
14+
/lib/Cleantalk/Common/ContactsEncoder/tests/
1215
/coverage.xml

cleantalk.php

Lines changed: 72 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Anti-Spam by CleanTalk
55
Plugin URI: https://cleantalk.org
66
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
7-
Version: 6.68
7+
Version: 6.69
88
Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org>
99
Author URI: https://cleantalk.org
1010
Text Domain: cleantalk-spam-protect
@@ -14,7 +14,7 @@
1414
use Cleantalk\Antispam\ProtectByShortcode;
1515
use Cleantalk\ApbctWP\Activator;
1616
use Cleantalk\ApbctWP\AdminNotices;
17-
use Cleantalk\ApbctWP\Antispam\EmailEncoder;
17+
use Cleantalk\ApbctWP\ContactsEncoder\ContactsEncoder;
1818
use Cleantalk\ApbctWP\Antispam\ForceProtection;
1919
use Cleantalk\ApbctWP\API;
2020
use Cleantalk\ApbctWP\CleantalkRealPerson;
@@ -42,6 +42,7 @@
4242
use Cleantalk\ApbctWP\Variables\Post;
4343
use Cleantalk\ApbctWP\Variables\Request;
4444
use Cleantalk\ApbctWP\Variables\Server;
45+
use Cleantalk\Common\ContactsEncoder\Dto\Params;
4546
use Cleantalk\Common\DNS;
4647
use Cleantalk\Common\Firewall;
4748
use Cleantalk\Common\Schema;
@@ -222,11 +223,13 @@ function apbct_wp_login_actions($_user_login, $wp_user)
222223
}
223224
}
224225

225-
if (!$skip_email_encode && !apbct_is_amp_request()) {
226-
EmailEncoder::getInstance();
226+
$contacts_encoder = apbctGetContactsEncoder();
227+
if ($apbct->settings['data__email_decoder'] && !$skip_email_encode && !apbct_is_amp_request()) {
228+
// Encode content
229+
$contacts_encoder->runEncoding();
227230

228-
// Email Encoder ajax handlers
229-
EmailEncoder::getInstance()->registerAjaxRoute();
231+
// Email Encoder ajax handlers for decoding
232+
$contacts_encoder->registerAjaxRoute();
230233
}
231234

232235
// Force protection to avoid spam from bots without javascript
@@ -931,7 +934,10 @@ function apbct_sfw__check()
931934

932935
$sfw_tables_names = SFW::getSFWTablesNames();
933936

934-
if (!$sfw_tables_names) {
937+
if (
938+
!$sfw_tables_names ||
939+
!isset($sfw_tables_names['sfw_personal_table_name'], $sfw_tables_names['sfw_common_table_name'])
940+
) {
935941
add_action('init', function () use ($apbct) {
936942
$apbct->errorAdd(
937943
'sfw',
@@ -1139,29 +1145,28 @@ function apbct_sfw_update__init($delay = 0)
11391145

11401146
$wp_upload_dir = wp_upload_dir();
11411147
$base_dir = TT::getArrayValueAsString($wp_upload_dir, 'basedir');
1142-
$apbct->fw_stats['updating_folder'] = $base_dir . DIRECTORY_SEPARATOR . 'cleantalk_fw_files_for_blog_' . get_current_blog_id() . DIRECTORY_SEPARATOR;
11431148
//update only common tables if moderate 0
11441149
if ( ! $apbct->moderate ) {
11451150
$apbct->data['sfw_load_type'] = 'common';
11461151
}
11471152

1148-
if ( $apbct->network_settings['multisite__work_mode'] == 3) {
1153+
if ( $apbct->network_settings['multisite__work_mode'] !== 2) {
11491154
$apbct->data['sfw_load_type'] = 'all';
11501155
$apbct->save('data');
11511156
}
11521157

1153-
if (apbct_sfw_update__switch_to_direct()) {
1154-
return SFWUpdateHelper::directUpdate();
1155-
}
1156-
1157-
// Set a new update ID and an update time start
1158+
// Flush fw stats data
1159+
$apbct->fw_stats = $apbct->default_fw_stats;
11581160
$apbct->fw_stats['calls'] = 0;
11591161
$apbct->fw_stats['firewall_updating_id'] = md5((string)rand(0, 100000));
11601162
$apbct->fw_stats['firewall_updating_last_start'] = time();
1161-
$apbct->fw_stats['common_lists_url_id'] = '';
1162-
$apbct->fw_stats['personal_lists_url_id'] = '';
1163+
$apbct->fw_stats['updating_folder'] = $base_dir . DIRECTORY_SEPARATOR . 'cleantalk_fw_files_for_blog_' . get_current_blog_id() . DIRECTORY_SEPARATOR;
11631164
$apbct->save('fw_stats');
11641165

1166+
if (apbct_sfw_update__switch_to_direct()) {
1167+
return SFWUpdateHelper::directUpdate();
1168+
}
1169+
11651170
$apbct->sfw_update_sentinel->seekId($apbct->fw_stats['firewall_updating_id']);
11661171

11671172
// Delete update errors
@@ -1572,11 +1577,11 @@ function apbct_sfw_update__create_tables($direct_update = false, $return_new_tab
15721577
$db_tables_creator->createTable($common_table_name);
15731578
$apbct->data['sfw_common_table_name'] = $common_table_name;
15741579
//personal table
1575-
$table_name_personal = $apbct->db_prefix . Schema::getSchemaTablePrefix() . 'sfw_personal';
1580+
$table_name_personal = $wpdb->prefix . Schema::getSchemaTablePrefix() . 'sfw_personal';
15761581
$db_tables_creator->createTable($table_name_personal);
15771582
$apbct->data['sfw_personal_table_name'] = $table_name_personal;
15781583
//ua table
1579-
$personal_ua_bl_table_name = $apbct->db_prefix . Schema::getSchemaTablePrefix() . 'ua_bl';
1584+
$personal_ua_bl_table_name = $wpdb->prefix . Schema::getSchemaTablePrefix() . 'ua_bl';
15801585
$db_tables_creator->createTable($personal_ua_bl_table_name);
15811586
$apbct->data['sfw_personal_ua_bl_table_name'] = $personal_ua_bl_table_name;
15821587

@@ -1712,14 +1717,27 @@ function apbct_sfw_update__process_exclusions($direct_update = false)
17121717
{
17131718
global $apbct;
17141719

1715-
$db__table__data = APBCT_TBL_FIREWALL_DATA_PERSONAL . '_temp';
1716-
if ($apbct->data['sfw_load_type'] === 'all') {
1717-
$db__table__data = $apbct->data['sfw_personal_table_name'] . '_temp';
1720+
$table_names = SFW::getSFWTablesNames();
1721+
$origin_personal_table_name = $table_names && isset($table_names['sfw_personal_table_name']) && is_string($table_names['sfw_personal_table_name'])
1722+
? $table_names['sfw_personal_table_name']
1723+
: null;
1724+
1725+
if ($origin_personal_table_name) {
1726+
$temp_table_name = $origin_personal_table_name . '_temp';
1727+
} else {
1728+
return array('error' => 'EXCLUSIONS: CAN NOT GET SFW TABLES NAMES');
1729+
}
1730+
1731+
if (!DB::getInstance()->isTableExists($temp_table_name)) {
1732+
SFW::createTempTables(DB::getInstance(), $origin_personal_table_name);
1733+
if (!DB::getInstance()->isTableExists($temp_table_name)) {
1734+
return array('error' => 'EXCLUSIONS: CAN NOT RECREATE TEMP PERSONAL TABLE ' . $temp_table_name);
1735+
}
17181736
}
17191737

17201738
$result = SFW::updateWriteToDbExclusions(
17211739
DB::getInstance(),
1722-
$db__table__data
1740+
$temp_table_name
17231741
);
17241742

17251743
if ( ! empty($result['error']) ) {
@@ -1818,8 +1836,8 @@ function apbct_sfw_update__end_of_update__checking_data($direct_update = false)
18181836
}
18191837

18201838
if ( in_array($apbct->data['sfw_load_type'], array('all','personal'))
1821-
&& isset($apbct->stats['sfw']['entries_personal'])
1822-
&& ( $apbct->stats['sfw']['entries_personal'] != $apbct->fw_stats['expected_networks_count_personal'] ) ) {
1839+
&& isset($apbct->stats['sfw']['entries_personal'])
1840+
&& ( $apbct->stats['sfw']['entries_personal'] != $apbct->fw_stats['expected_networks_count_personal'] ) ) {
18231841
return array(
18241842
'error' =>
18251843
'The discrepancy between the amount of data received for the update and in the final table: '
@@ -2026,17 +2044,26 @@ function apbct_sfw_private_records_handler($action, $test_data = null)
20262044
}
20272045
unset($row);
20282046

2047+
$table_names = SFW::getSFWTablesNames();
2048+
$table_name = $table_names && isset($table_names['sfw_personal_table_name']) && is_string($table_names['sfw_personal_table_name'])
2049+
? $table_names['sfw_personal_table_name']
2050+
: false;
2051+
2052+
if (!$table_name || !DB::getInstance()->isTableExists($table_name)) {
2053+
throw new InvalidArgumentException('internal error: sfw table does not exist');
2054+
}
2055+
20292056
//method selection
20302057
if ( $action === 'add' ) {
20312058
$handler_output = SFW::privateRecordsAdd(
20322059
DB::getInstance(),
2033-
SFW::getSFWTablesNames()['sfw_personal_table_name'],
2060+
$table_name,
20342061
$metadata
20352062
);
20362063
} elseif ( $action === 'delete' ) {
20372064
$handler_output = SFW::privateRecordsDelete(
20382065
DB::getInstance(),
2039-
SFW::getSFWTablesNames()['sfw_personal_table_name'],
2066+
$table_name,
20402067
$metadata
20412068
);
20422069
} else {
@@ -3083,3 +3110,22 @@ function apbct_cron_remove_support_user()
30833110
$temp_user_service = new \Cleantalk\ApbctWP\SupportUser();
30843111
$temp_user_service->performCronDeleteUser();
30853112
}
3113+
3114+
/**
3115+
* This is a helper function to avoid code duplication on build ContactsEncoder object
3116+
* @return ContactsEncoder
3117+
*/
3118+
function apbctGetContactsEncoder()
3119+
{
3120+
global $apbct;
3121+
3122+
$contacts_encoder_params = new Params();
3123+
$contacts_encoder_params->api_key = $apbct->api_key;
3124+
$contacts_encoder_params->is_logged_in = apbct_is_user_logged_in();
3125+
$contacts_encoder_params->obfuscation_mode = $apbct->settings['data__email_decoder_obfuscation_mode'];
3126+
$contacts_encoder_params->obfuscation_text = $apbct->settings['data__email_decoder_obfuscation_custom_text'];
3127+
$contacts_encoder_params->do_encode_emails = (int)$apbct->settings['data__email_decoder_encode_email_addresses'];
3128+
$contacts_encoder_params->do_encode_phones = (int)$apbct->settings['data__email_decoder_encode_phone_numbers'];
3129+
3130+
return ContactsEncoder::getInstance($contacts_encoder_params);
3131+
}

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"yoast/phpunit-polyfills": "^1.0",
1717
"ext-dom": "*",
1818
"wp-cli/wp-cli-bundle": "*",
19-
"mockery/mockery": "*"
19+
"mockery/mockery": "*",
20+
"cleantalk/contacts-encoder": "*"
2021
},
2122
"scripts": {
2223
"test": [
@@ -38,7 +39,8 @@
3839
},
3940
"config": {
4041
"allow-plugins": {
41-
"dealerdirect/phpcodesniffer-composer-installer": true
42+
"dealerdirect/phpcodesniffer-composer-installer": true,
43+
"cleantalk/apbct-installer": true
4244
}
4345
}
4446
}

inc/cleantalk-admin.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
use Cleantalk\Antispam\Cleantalk;
4-
use Cleantalk\Antispam\CleantalkRequest;
53
use Cleantalk\ApbctWP\AdjustToEnvironmentModule\AdjustToEnvironmentHandler;
64
use Cleantalk\ApbctWP\AJAXService;
7-
use Cleantalk\ApbctWP\Antispam\EmailEncoder;
85
use Cleantalk\ApbctWP\ApbctEnqueue;
96
use Cleantalk\ApbctWP\CleantalkSettingsTemplates;
7+
use Cleantalk\ApbctWP\ContactsEncoder\ContactsEncoder;
108
use Cleantalk\ApbctWP\Escape;
119
use Cleantalk\ApbctWP\Variables\Get;
1210
use Cleantalk\ApbctWP\Variables\Post;
@@ -544,7 +542,7 @@ function apbct_admin__enqueue_scripts($hook)
544542
'apbctNoticeDismissSuccess' => esc_html__('Thank you for the review! We strive to make our Anti-Spam plugin better every day.', 'cleantalk-spam-protect'),
545543
'apbctNoticeForceProtectionOn' => esc_html__('This option affects the reflection of the page by checking the user and adds a cookie "apbct_force_protection_check", which serves as an indicator of successful or unsuccessful verification. If the check is successful, it will no longer run.', 'cleantalk-spam-protect'),
546544
);
547-
$data = array_merge($data, EmailEncoder::getLocalizationText());
545+
$data = array_merge($data, ContactsEncoder::getLocalizationText());
548546
wp_localize_script('cleantalk-admin-js', 'ctAdminCommon', $data);
549547

550548
/**

inc/cleantalk-ajax.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,12 @@ function ct_ajax_hook($message_obj = null)
876876
);
877877
}
878878

879-
// bricksextras/bricksextras.php
879+
// brick plugin or theme
880880
if (
881-
apbct_is_plugin_active('bricksextras/bricksextras.php') &&
881+
(
882+
apbct_is_plugin_active('bricksextras/bricksextras.php') ||
883+
apbct_is_theme_active('bricks')
884+
) &&
882885
Post::hasString('action', 'bricks_form_submit')
883886
) {
884887
die(

inc/cleantalk-common.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,16 +1761,19 @@ function apbct_is_amp_request()
17611761
*/
17621762
function apbct_get_event_token($params)
17631763
{
1764-
$event_token_from_request = ! empty(Post::get('ct_bot_detector_event_token'))
1765-
? Post::get('ct_bot_detector_event_token')
1766-
: Cookie::get('ct_bot_detector_event_token');
1767-
$event_token_from_params = ! empty($params['event_token'])
1768-
? $params['event_token']
1769-
: '';
1770-
1771-
return $event_token_from_params
1772-
? TT::toString($event_token_from_params)
1773-
: TT::toString($event_token_from_request);
1764+
global $ct_rest_middleware_event_token;
1765+
1766+
if (!empty($params['event_token'])) {
1767+
return TT::toString($params['event_token']);
1768+
}
1769+
1770+
if (isset($ct_rest_middleware_event_token) && !empty($ct_rest_middleware_event_token)) {
1771+
return TT::toString($ct_rest_middleware_event_token);
1772+
}
1773+
1774+
return !empty(Post::getString('ct_bot_detector_event_token'))
1775+
? Post::getString('ct_bot_detector_event_token')
1776+
: Cookie::getString('ct_bot_detector_event_token');
17741777
}
17751778

17761779
/**

inc/cleantalk-integrations-by-hook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
'ajax' => false
450450
),
451451
'WPFunnels' => array(
452-
'hook' => 'wpfnl_gutenberg_optin_submission',
452+
'hook' => ['wpfnl_gutenberg_optin_submission','wffn_submit_custom_optin_form'],
453453
'setting' => 'forms__contact_forms_test',
454454
'ajax' => true
455455
),

inc/cleantalk-integrations-by-route.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55
'rest_route' => '/sureforms/v1/submit-form',
66
'setting' => 'forms__contact_forms_test',
77
'rest' => true,
8+
),
9+
'WPRecipeMaker' => array(
10+
'rest_route' => '/wp-recipe-maker/v1/user-rating/',
11+
'setting' => 'forms__contact_forms_test',
12+
'rest' => true,
813
)
914
);
1015

1116
add_filter('rest_pre_dispatch', function ($result, $_, $request) use ($apbct_active_rest_integrations) {
1217
global $apbct;
1318
$route = $request->get_route();
1419
foreach ($apbct_active_rest_integrations as $integration_name => $rest_data) {
15-
if (isset($rest_data['rest_route']) && $rest_data['rest_route'] === $route) {
20+
if (isset($rest_data['rest_route']) && strpos($route, $rest_data['rest_route']) === 0) {
1621
$apbct_settings = isset($apbct->settings) && is_array($apbct->settings) ? $apbct->settings : array();
1722
$integrations = new \Cleantalk\Antispam\Integrations($apbct_active_rest_integrations, $apbct_settings);
1823
$params = $request->get_params();

0 commit comments

Comments
 (0)