From 4e6cc34d09a83a16264e630565630377c85feb5b Mon Sep 17 00:00:00 2001 From: SVFCode Date: Thu, 19 Dec 2024 15:42:06 +0300 Subject: [PATCH] Upd. Code. Remove unused flags. (#527) * Upd. Code. Remove unused flags. * fix psalm --- cleantalk.php | 4 ---- inc/cleantalk-settings.php | 14 -------------- inc/cleantalk-updater.php | 2 -- lib/Cleantalk/ApbctWP/State.php | 5 +---- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/cleantalk.php b/cleantalk.php index d478a6ac5..d51abdf41 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -2291,11 +2291,9 @@ function apbct_rc__insert_auth_key($key, $plugin) $data['notice_show'] = TT::getArrayValueAsInt($result, 'show_notice'); $data['notice_renew'] = TT::getArrayValueAsInt($result, 'renew'); $data['notice_trial'] = TT::getArrayValueAsInt($result, 'trial'); - $data['auto_update_app'] = TT::getArrayValueAsInt($result, 'show_auto_update_notice'); $data['service_id'] = TT::getArrayValueAsInt($result, 'service_id'); $data['user_id'] = TT::getArrayValueAsInt($result, 'user_id'); $data['moderate'] = TT::getArrayValueAsInt($result, 'moderate'); - $data['auto_update_app '] = TT::getArrayValueAsInt($result, 'auto_update_app'); $data['license_trial'] = TT::getArrayValueAsInt($result, 'license_trial'); $data['account_name_ob'] = TT::getArrayValueAsString($result, 'account_name_ob'); $data['key_is_ok'] = true; @@ -2677,7 +2675,6 @@ function ct_account_status_check($api_key = null, $process_errors = true) $apbct->data['notice_renew'] = TT::getArrayValueAsInt($result, 'renew', 0); $apbct->data['notice_trial'] = TT::getArrayValueAsInt($result, 'trial', 0); $apbct->data['notice_review'] = TT::getArrayValueAsInt($result, 'show_review', 0); - $apbct->data['notice_auto_update'] = TT::getArrayValueAsInt($result, 'show_auto_update_notice', 0); // Other $apbct->data['service_id'] = TT::getArrayValueAsInt($result, 'service_id', 0); @@ -2686,7 +2683,6 @@ function ct_account_status_check($api_key = null, $process_errors = true) $apbct->data['moderate'] = TT::getArrayValueAsInt($result, 'moderate', 0); $apbct->data['ip_license'] = TT::getArrayValueAsInt($result, 'ip_license', 0); $apbct->data['spam_count'] = TT::getArrayValueAsInt($result, 'spam_count', 0); - $apbct->data['auto_update'] = TT::getArrayValueAsInt($result, 'auto_update_app', 0); $apbct->data['user_token'] = TT::getArrayValueAsString($result, 'user_token', ''); $apbct->data['license_trial'] = TT::getArrayValueAsInt($result, 'license_trial', 0); $apbct->data['account_name_ob'] = TT::getArrayValueAsString($result, 'account_name_ob', ''); diff --git a/inc/cleantalk-settings.php b/inc/cleantalk-settings.php index de71279e5..4ebb8a0e5 100644 --- a/inc/cleantalk-settings.php +++ b/inc/cleantalk-settings.php @@ -1759,7 +1759,6 @@ function apbct_settings__field__state() $img = $path_to_img . "yes.png"; $img_no = $path_to_img . "no.png"; - $img_no_gray = $path_to_img . "no_gray.png"; $color = "black"; if ( ! $apbct->key_is_ok ) { @@ -1814,15 +1813,6 @@ function apbct_settings__field__state() 'cleantalk-spam-protect' ) . ''; } - // Autoupdate status - if ( $apbct->notice_auto_update && ( ! $apbct->white_label || is_main_site()) ) { - echo '' . __( - 'Auto update', - 'cleantalk-spam-protect' - ) - //HANDLE LINK - . ' ?'; - } // WooCommerce if ( class_exists('WooCommerce') ) { @@ -2527,7 +2517,6 @@ function apbct_settings__validate($settings) 'key_is_ok' => $apbct->data['key_is_ok'], 'moderate' => $apbct->data['moderate'], 'valid' => isset($apbct->data['valid']) ? $apbct->data['valid'] : 0, - 'auto_update' => $apbct->data['auto_update'], 'user_token' => $apbct->data['user_token'], 'service_id' => $apbct->data['service_id'], 'user_id' => $apbct->data['user_id'], @@ -2628,7 +2617,6 @@ function apbct_settings__sync($direct_call = false) 'key_is_ok' => $apbct->data['key_is_ok'], 'moderate' => $apbct->data['moderate'], 'valid' => $apbct->data['valid'], - 'auto_update' => $apbct->data['auto_update'], 'user_token' => $apbct->data['user_token'], 'service_id' => $apbct->data['service_id'], 'user_id' => $apbct->data['user_id'], @@ -2656,7 +2644,6 @@ function apbct_settings__sync($direct_call = false) $apbct->data['notice_renew'] = 0; $apbct->data['notice_trial'] = 0; $apbct->data['notice_review'] = 0; - $apbct->data['notice_auto_update'] = 0; // Other $apbct->data['service_id'] = 0; @@ -2666,7 +2653,6 @@ function apbct_settings__sync($direct_call = false) $apbct->data['ip_license'] = 0; $apbct->data['moderate_ip'] = 0; $apbct->data['spam_count'] = 0; - $apbct->data['auto_update'] = 0; $apbct->data['user_token'] = ''; $apbct->data['license_trial'] = 0; $apbct->data['account_name_ob'] = ''; diff --git a/inc/cleantalk-updater.php b/inc/cleantalk-updater.php index 82fc21764..804e41314 100644 --- a/inc/cleantalk-updater.php +++ b/inc/cleantalk-updater.php @@ -489,7 +489,6 @@ function apbct_update_to_5_138_0() $data['notice_renew'] = isset($result['renew']) ? (int)$result['renew'] : 0; $data['notice_trial'] = isset($result['trial']) ? (int)$result['trial'] : 0; $data['notice_review'] = isset($result['show_review']) ? (int)$result['show_review'] : 0; - $data['notice_auto_update'] = isset($result['show_auto_update_notice']) ? (int)$result['show_auto_update_notice'] : 0; // Other $data['service_id'] = isset($result['service_id']) ? (int)$result['service_id'] : 0; @@ -498,7 +497,6 @@ function apbct_update_to_5_138_0() $data['ip_license'] = isset($result['ip_license']) ? (int)$result['ip_license'] : 0; $data['moderate_ip'] = isset($result['moderate_ip'], $result['ip_license']) ? (int)$result['moderate_ip'] : 0; $data['spam_count'] = isset($result['spam_count']) ? (int)$result['spam_count'] : 0; - $data['auto_update'] = isset($result['auto_update_app']) ? (int)$result['auto_update_app'] : 0; $data['user_token'] = isset($result['user_token']) ? (string)$result['user_token'] : ''; $data['license_trial'] = isset($result['license_trial']) ? (int)$result['license_trial'] : 0; $data['account_name_ob'] = isset($result['account_name_ob']) ? (string)$result['account_name_ob'] : ''; diff --git a/lib/Cleantalk/ApbctWP/State.php b/lib/Cleantalk/ApbctWP/State.php index 227234836..fc19d1b80 100644 --- a/lib/Cleantalk/ApbctWP/State.php +++ b/lib/Cleantalk/ApbctWP/State.php @@ -162,7 +162,6 @@ class State extends \Cleantalk\Common\State 'moderate_ip' => 0, 'ip_license' => 0, 'spam_count' => 0, - 'auto_update' => 0, 'user_token' => '', // User token for auto login into spam statistics 'license_trial' => 0, @@ -171,7 +170,6 @@ class State extends \Cleantalk\Common\State 'notice_trial' => 0, 'notice_renew' => 0, 'notice_review' => 0, - 'notice_auto_update' => 0, 'notice_incompatibility' => array(), 'notice_email_decoder_changed' => 0, @@ -268,8 +266,7 @@ class State extends \Cleantalk\Common\State 'valid' => 0, 'user_token' => '', 'service_id' => 0, - 'user_id' => 0, - 'auto_update' => 0, + 'user_id' => 0, ); /**