|
4 | 4 | Plugin Name: Anti-Spam by CleanTalk |
5 | 5 | Plugin URI: https://cleantalk.org |
6 | 6 | 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.74 |
| 7 | + Version: 6.75 |
8 | 8 | Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org> |
9 | 9 | Author URI: https://cleantalk.org |
10 | 10 | Text Domain: cleantalk-spam-protect |
@@ -476,10 +476,11 @@ function apbct_write_js_errors($data) |
476 | 476 | } |
477 | 477 |
|
478 | 478 | // Memberpress integration |
| 479 | +// MemberPress sends mepr_process_signup_form='Y' or '1' — both must trigger the check |
479 | 480 | if ( |
480 | 481 | !empty($_POST) && |
481 | 482 | apbct_is_plugin_active('memberpress/memberpress.php') && |
482 | | - Post::hasString('mepr_process_signup_form', '1') && |
| 483 | + Post::getString('mepr_process_signup_form') && |
483 | 484 | (int)$apbct->settings['forms__registrations_test'] === 1 |
484 | 485 | ) { |
485 | 486 | apbct_memberpress_signup_request_test(); |
@@ -614,10 +615,12 @@ function apbct_write_js_errors($data) |
614 | 615 | . '/js/apbct-public-bundle.min.js' |
615 | 616 | . '?ver=' . APBCT_VERSION . '" id="ct_public_functions-js"></script>'; |
616 | 617 | echo '<script src="' . APBCT_BOT_DETECTOR_SCRIPT_URL . '?ver=' |
617 | | - . APBCT_VERSION . '" id="ct_bot_detector-js"></script>'; |
| 618 | + . APBCT_VERSION . '" async id="ct_bot_detector-js" data-wp-strategy="async"></script>'; |
618 | 619 | }, 100); |
619 | 620 | } |
620 | 621 |
|
| 622 | + SFWUpdateHelper::processSFWOutdatedError($apbct); |
| 623 | + |
621 | 624 | // SpamFireWall check |
622 | 625 | if ( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start |
623 | 626 | $apbct->settings['sfw__enabled'] == 1 && |
@@ -910,25 +913,12 @@ function apbct_sfw__check() |
910 | 913 | } |
911 | 914 |
|
912 | 915 | // update mode - skip checking |
913 | | - if ( isset($apbct->fw_stats['update_mode']) && $apbct->fw_stats['update_mode'] === 1 ) { |
| 916 | + if ( SFWUpdateHelper::SFWUpdateModeEnabled($apbct)) { |
914 | 917 | return; |
915 | 918 | } |
916 | 919 |
|
917 | | - // Checking if database was outdated |
918 | | - $is_sfw_outdated = $apbct->stats['sfw']['last_update_time'] + $apbct->stats['sfw']['update_period'] * 3 < time(); |
919 | | - |
920 | | - add_action('init', function () use ($apbct, $is_sfw_outdated) { |
921 | | - $apbct->errorToggle( |
922 | | - $is_sfw_outdated, |
923 | | - 'sfw_outdated', |
924 | | - esc_html__( |
925 | | - 'SpamFireWall database is outdated. Please, try to synchronize with the cloud.', |
926 | | - 'cleantalk-spam-protect' |
927 | | - ) |
928 | | - ); |
929 | | - }); |
930 | | - |
931 | | - if ( $is_sfw_outdated ) { |
| 920 | + // sfw is outdated - skip checking |
| 921 | + if ( SFWUpdateHelper::SFWDataOutdated($apbct) ) { |
932 | 922 | return; |
933 | 923 | } |
934 | 924 |
|
|
0 commit comments