Skip to content

Commit

Permalink
Upd. Scanner. Landing banners fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glomberg committed Dec 5, 2023
1 parent d242085 commit 1170817
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
7 changes: 7 additions & 0 deletions inc/spbc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,12 @@ function spbc_set_malware_scan_warns()
OR STATUS = "DENIED_BY_CLOUD"';
$critical_count = (int)$wpdb->get_var($query) > 0;

$query = 'SELECT COUNT(*)
FROM ' . SPBC_TBL_SCAN_FILES . '
WHERE (weak_spots LIKE "%SIGNATURES%" AND analysis_status IS NULL)
OR STATUS = "DENIED_BY_CLOUD"';
$signatures_count = (int)$wpdb->get_var($query) > 0;

$query = 'SELECT COUNT(*)
FROM ' . SPBC_TBL_SCAN_FRONTEND . '
WHERE approved IS NULL OR approved = 0';
Expand All @@ -825,6 +831,7 @@ function spbc_set_malware_scan_warns()

$spbc->data['display_scanner_warnings'] = array(
'critical' => $critical_count,
'signatures' => $signatures_count,
'frontend' => $frontend_count,
'analysis' => $analysis_has_dangerous,
'analysis_all_safe' => !$analysis_has_uncheked && !$analysis_has_dangerous,
Expand Down
10 changes: 5 additions & 5 deletions inc/spbc-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3037,12 +3037,12 @@ function spbc_field_scanner__show_accordion($direct_call = false)
'</div>' .
'</div>';
if ($spbc->data['display_scanner_warnings']['analysis'] && !$spbc->data['wl_mode_enabled']) {
$analysis_log_description .= spbc__manual_cure_service_suggest_html('critical');
$analysis_log_description .= spbc__manual_cure_service_suggest_html('analysis');
}

//critical description
$critical_description = __('These files may not contain malicious code but they use very dangerous PHP functions and constructions! PHP developers don\'t recommend to use it and it looks very suspicious.', 'security-malware-firewall');
if (($spbc->data['display_scanner_warnings']['analysis'] || $spbc->data['scanner']['signatures_found']) && !$spbc->data['wl_mode_enabled']) {
if ($spbc->data['display_scanner_warnings']['signatures'] && !$spbc->data['wl_mode_enabled']) {
$critical_description .= spbc__manual_cure_service_suggest_html('critical');
}
if ($spbc->settings['scanner__schedule_send_heuristic_critical_files'] ) {
Expand Down Expand Up @@ -5261,12 +5261,12 @@ function spbc__manual_cure_service_suggest_html($for)
if ($for === 'critical') {
$text = __('With a high degree of probability, your site has been infected. If you need professional help
from security specialists, feel free to order', 'security-malware-firewall');
$text .= ' ' . __('Security Audit', 'security-malware-firewall') . '.';
$text .= ' ' . __('Malware removal service', 'security-malware-firewall') . '.';
$classes = 'notice notice-warning';
$show_exclaim_triangle = true;
$button_text = __('Request Manual Cure', 'security-malware-firewall');
$button_text = __('Request Malware removal', 'security-malware-firewall');
$landing_page_link = 'https://l.cleantalk.org/website-manual-cure?email=' . esc_attr($email) . '&website=' . esc_attr($website);
} elseif ($for === 'unknown' || $for === 'suspicious') {
} elseif ($for === 'unknown' || $for === 'suspicious' || $for === 'analysis') {
$text = __('If you are not sure about the results or looking for professional help from security specialists,
feel free to order', 'security-malware-firewall');
$text .= ' ' . __('Security Audit', 'security-malware-firewall') . '.';
Expand Down
1 change: 1 addition & 0 deletions lib/CleantalkSP/SpbctWP/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class State extends \CleantalkSP\Common\State
'secfw_data_files_info' => array(),
'display_scanner_warnings' => array(
'critical' => false,
'signatures' => false,
'frontend' => false,
'analysis' => false,
'warn_on_admin_bar' => false
Expand Down
10 changes: 10 additions & 0 deletions lib/CleantalkSP/Updater/UpdaterScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -1163,4 +1163,14 @@ public static function updateTo_2_121_1() //phpcs:ignore PSR1.Methods.CamelCapsM
$spbc->settings['waf_blocker__enabled'] = 0;
$spbc->save('settings');
}

public static function updateTo_2_124_0() //phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
{
global $spbc;

if ( ! isset($spbc->data['display_scanner_warnings']['signatures']) ) {
$spbc->settings['display_scanner_warnings']['signatures'] = false;
$spbc->save('data');
}
}
}

0 comments on commit 1170817

Please sign in to comment.