|
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.55.99-dev |
| 7 | + Version: 6.56.99-dev |
8 | 8 | Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org> |
9 | 9 | Author URI: https://cleantalk.org |
10 | 10 | Text Domain: cleantalk-spam-protect |
|
166 | 166 | $apbct->setConnectionReports(); |
167 | 167 | // SFW update sentinel |
168 | 168 | $apbct->setSFWUpdateSentinel(); |
| 169 | +// User IP Keeper - used for checkers |
| 170 | +$apbct->setLoginIPKeeper(); |
| 171 | + |
| 172 | +add_action('wp_login', 'apbct_wp_login_actions', 10, 2); |
| 173 | + |
| 174 | +/** |
| 175 | + * Actions for hook 'wp-login'. |
| 176 | + * @param $user_login |
| 177 | + * @param $wp_user |
| 178 | + * |
| 179 | + * @return void |
| 180 | + */ |
| 181 | +function apbct_wp_login_actions($_user_login, $wp_user) |
| 182 | +{ |
| 183 | + global $apbct; |
| 184 | + $apbct->login_ip_keeper->addUserIP($wp_user); |
| 185 | + apbct_add_admin_ip_to_swf_whitelist($wp_user); |
| 186 | +} |
169 | 187 |
|
170 | 188 | // Disabling comments |
171 | 189 | if ( $apbct->settings['comments__disable_comments__all'] || $apbct->settings['comments__disable_comments__posts'] || $apbct->settings['comments__disable_comments__pages'] || $apbct->settings['comments__disable_comments__media'] ) { |
@@ -269,7 +287,7 @@ function apbct_register_my_rest_routes() |
269 | 287 | global $apbct; |
270 | 288 |
|
271 | 289 | // Self cron |
272 | | - $ct_cron = new Cron(); |
| 290 | + $ct_cron = Cron::getInstance(); |
273 | 291 | $tasks_to_run = $ct_cron->checkTasks(); // Check for current tasks. Drop tasks inner counters. |
274 | 292 | if ( |
275 | 293 | $tasks_to_run && // There are tasks to run |
@@ -577,14 +595,6 @@ function apbct_write_js_errors($data) |
577 | 595 | add_filter('happyforms_validate_submission', 'apbct_form_happyforms_test_spam', 1, 3); |
578 | 596 | add_filter('happyforms_use_hash_protection', '__return_false'); |
579 | 597 |
|
580 | | -// WPForms |
581 | | -// Adding fields |
582 | | -add_action('wpforms_frontend_output', 'apbct_form__WPForms__addField', 1000, 5); |
583 | | -// Gathering data to validate |
584 | | -add_filter('wpforms_process_before_filter', 'apbct_from__WPForms__gatherData', 100, 2); |
585 | | -// Do spam check |
586 | | -add_filter('wpforms_process_initial_errors', 'apbct_form__WPForms__showResponse', 100, 2); |
587 | | - |
588 | 598 | // Formidable |
589 | 599 | add_filter('frm_entries_before_create', 'apbct_form__formidable__testSpam', 999999, 2); |
590 | 600 | add_action('frm_entries_footer_scripts', 'apbct_form__formidable__footerScripts', 20, 2); |
@@ -2742,6 +2752,22 @@ function ct_account_status_check($api_key = null, $process_errors = true) |
2742 | 2752 | $apbct->data['notice_trial'] = TT::getArrayValueAsInt($result, 'trial', 0); |
2743 | 2753 | $apbct->data['notice_review'] = TT::getArrayValueAsInt($result, 'show_review', 0); |
2744 | 2754 |
|
| 2755 | + if ($apbct->data['notice_show']) { |
| 2756 | + $notice_banners = API::getNoticeBanners($api_key); |
| 2757 | + |
| 2758 | + if (isset($notice_banners['operation_status'], $notice_banners['banners']) && $notice_banners['operation_status'] === 'SUCCESS') { |
| 2759 | + if (isset($notice_banners['banners']['TRIAL']['level'])) { |
| 2760 | + $apbct->data['notice_trial_level'] = strtolower($notice_banners['banners']['TRIAL']['level']); |
| 2761 | + } |
| 2762 | + if (isset($notice_banners['banners']['RENEW']['level'])) { |
| 2763 | + $apbct->data['notice_renew_level'] = strtolower($notice_banners['banners']['RENEW']['level']); |
| 2764 | + } |
| 2765 | + if (isset($notice_banners['banners']['REVIEW']['level'])) { |
| 2766 | + $apbct->data['notice_review_level'] = strtolower($notice_banners['banners']['REVIEW']['level']); |
| 2767 | + } |
| 2768 | + } |
| 2769 | + } |
| 2770 | + |
2745 | 2771 | // Other |
2746 | 2772 | $apbct->data['service_id'] = TT::getArrayValueAsInt($result, 'service_id', 0); |
2747 | 2773 | $apbct->data['user_id'] = TT::getArrayValueAsInt($result, 'user_id', 0); |
|
0 commit comments