Skip to content

Commit

Permalink
Upd. Code. Remove unused flags. (#527)
Browse files Browse the repository at this point in the history
* Upd. Code. Remove unused flags.

* fix psalm
  • Loading branch information
svfcode authored Dec 19, 2024
1 parent a0cacdd commit 4e6cc34
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
4 changes: 0 additions & 4 deletions cleantalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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', '');
Expand Down
14 changes: 0 additions & 14 deletions inc/cleantalk-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -1814,15 +1813,6 @@ function apbct_settings__field__state()
'cleantalk-spam-protect'
) . '</a>';
}
// Autoupdate status
if ( $apbct->notice_auto_update && ( ! $apbct->white_label || is_main_site()) ) {
echo '<img class="apbct_status_icon" src="' . ($apbct->auto_update == 1 ? Escape::escUrl($img) : ($apbct->auto_update == -1 ? Escape::escUrl($img_no) : Escape::escUrl($img_no_gray))) . '"/>' . __(
'Auto update',
'cleantalk-spam-protect'
)
//HANDLE LINK
. ' <sup><a href="https://cleantalk.org/help/cleantalk-auto-update" target="_blank">?</a></sup>';
}

// WooCommerce
if ( class_exists('WooCommerce') ) {
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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;
Expand All @@ -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'] = '';
Expand Down
2 changes: 0 additions & 2 deletions inc/cleantalk-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'] : '';
Expand Down
5 changes: 1 addition & 4 deletions lib/Cleantalk/ApbctWP/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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,

Expand Down Expand Up @@ -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,
);

/**
Expand Down

0 comments on commit 4e6cc34

Please sign in to comment.