From dc31a37816a6e10cb89e4f2402649d6f8b8ab479 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 24 May 2024 15:29:27 +0500 Subject: [PATCH] Upd. Restrict functionality for expired licenses (#346) * Ref. New FeatureRestriction service is used to on/off features. * Fix. Code. FeatureRestrictionState. Renamed method. * Upd. Functionality. Code review notices fixed. * Upd. Functionality. Functions restriction for outdated licenses fixed. * Upd. Settings. FS Watcher tab logic fixed. * Fix: Settings. Upgrading license link fixed. --------- Co-authored-by: Glomberg --- inc/admin-bar.php | 4 +- inc/spbc-admin.php | 9 +- inc/spbc-auth.php | 6 +- inc/spbc-settings.php | 750 +++++++----------- js/spbc-react-bundle.js | 2 +- js/src/react/components/SpbctPageTabs.js | 4 +- .../AdminBanners/AdminBannerRenew.php | 9 +- .../AdminBanners/AdminBannerTrial.php | 10 +- lib/CleantalkSP/SpbctWP/Escape.php | 35 +- .../FeatureRestriction/FeatureRestriction.php | 32 + .../FeatureRestrictionService.php | 91 +++ .../FeatureRestrictionState.php | 53 ++ .../FeatureRestrictionView.php | 99 +++ lib/CleantalkSP/SpbctWP/State.php | 9 + lib/CleantalkSP/SpbctWP/Views/Settings.php | 9 +- security-malware-firewall.php | 4 +- .../FeatureRestrictionServiceTest.php | 105 +++ 17 files changed, 766 insertions(+), 465 deletions(-) create mode 100644 lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestriction.php create mode 100644 lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionService.php create mode 100644 lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionState.php create mode 100644 lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionView.php create mode 100644 tests/Tests/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionServiceTest.php diff --git a/inc/admin-bar.php b/inc/admin-bar.php index 368f300fc..4df9dcdc6 100644 --- a/inc/admin-bar.php +++ b/inc/admin-bar.php @@ -24,8 +24,10 @@ function spbc_admin__admin_bar__add_structure($wp_admin_bar) 'meta' => array('class' => 'cleantalk-admin_bar--list_wrapper'), )); + $utm_marks = '&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security&cp_mode=security'; + $link = 'https://p.cleantalk.org/?account=undefined¤cy=USD&domains=&extra=true&featured=&fua=true&period=Year&period_interval=3&product_id=4&renew=true&tariff_id=191&user_token=' . $spbc->user_token . $utm_marks; $title_link = $spbc->data["wl_mode_enabled"] ? $spbc->data["wl_support_url"] : - ""; + ""; // Security $title = $spbc->notice_trial diff --git a/inc/spbc-admin.php b/inc/spbc-admin.php index 7e498cb57..4a13dbeac 100644 --- a/inc/spbc-admin.php +++ b/inc/spbc-admin.php @@ -25,7 +25,10 @@ function spbc_admin_init() global $spbc, $apbct; //Logging admin actions - if (! defined('DOING_AJAX')) { + if ( + $spbc->feature_restrictions->getState($spbc, 'security_log')->is_active && + ! defined('DOING_AJAX') + ) { spbc_admin_log_action(); } @@ -710,11 +713,13 @@ function spbc_badge__get_premium($print = true, $make_it_right = false, $out = ' global $spbc; if ($spbc->data['license_trial'] == 1 && ! empty($spbc->user_token) && ! $spbc->data["wl_mode_enabled"] ) { + $utm_marks = '&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security'; + $link = 'https://p.cleantalk.org/?account=undefined¤cy=USD&domains=&extra=true&featured=&fua=true&period=Year&period_interval=3&product_id=4&renew=true&tariff_id=191&user_token=' . $spbc->user_token . $utm_marks; $out = '' . ($make_it_right ? __('Make it right!', 'cleantalk') . ' ' : '') . sprintf( __('%sGet premium%s', 'cleantalk'), - $spbc->data["wl_mode_enabled"] ? $spbc->data["wl_support_url"] : '', + $spbc->data["wl_mode_enabled"] ? $spbc->data["wl_support_url"] : '', '' ) . ''; diff --git a/inc/spbc-auth.php b/inc/spbc-auth.php index a5ebe4a8e..96671355e 100644 --- a/inc/spbc-auth.php +++ b/inc/spbc-auth.php @@ -667,7 +667,11 @@ function spbc_is_user_logged_in() */ function spbc_auth_log($params) { - global $wpdb; + global $wpdb, $spbc; + + if ($spbc->feature_restrictions->getState($spbc, 'security_log')->is_active) { + return 0; + } SecurityCounter::increment($params['event']); diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php index 84334a722..0f57db06c 100644 --- a/inc/spbc-settings.php +++ b/inc/spbc-settings.php @@ -79,51 +79,6 @@ function spbc_settings__register() $spbc->settings__elements = spbc_settings__register_sections_and_fields( array( - // STATUS. Security status. - // 'status' => array( - // 'type' => 'plain', - // 'callback' => 'spbc_field_security_status', - // ), - // BUTTONS - // Dashboard - // 'cp_button' => array( - // 'type' => 'plain', - // 'display' => $spbc->key_is_ok && !$spbc->data["wl_mode_enabled"], - // 'html' => '', - // ), - // // Support - // 'support_button' => array( - // 'type' => 'plain', - // 'html' => '' - // . '' - // . '', - // 'display' => $spbc->key_is_ok && !$spbc->data["wl_mode_enabled"], - // ), - // // Synchronize button - // 'sync_button' => array( - // 'type' => 'plain', - // 'display' => spbc_api_key__is_correct(), - // 'html' => '  ' - // ), - // TABS // Firewall 'traffic_control' => array( @@ -862,20 +817,7 @@ function spbc_settings__register() 'children_enable' => 1, ), ), - // 'children' => array( 'data__set_cookies__alt_sessions_type' ) ), - // 'data__set_cookies__alt_sessions_type' => array( - // 'type' => 'field', - // 'title' => __( 'Alternative cookies handler type', 'security-malware-firewall' ), - // 'description' => __( 'This could be helpful if you are using alternative mechanism for cookies and have REST API disabled. REST works faster.', 'security-malware-firewall' ), - // 'input_type' => 'radio', - // 'options' => array( - // array( 'val' => 1, 'label' => __( 'REST API', 'security-malware-firewall' ), ), - // array( 'val' => 2, 'label' => __( 'AJAX handler', 'security-malware-firewall' ), ), - // ), - // 'parent' => 'data__set_cookies', - // 'disabled' => $spbc->settings['data__set_cookies'] != 2, - // ), 'misc__forbid_to_show_in_iframes' => array( 'type' => 'field', 'title' => __('Forbid to show your website in iFrame tags on third-party websites', 'security-malware-firewall'), @@ -977,7 +919,17 @@ function spbc_settings__register() 'icon' => 'spbc-icon-info', 'class_prefix' => 'spbc', 'ajax' => true, - 'callback' => 'spbc_tab__fswatcher', + 'sections' => array( + 'fsw' => array( + 'type' => 'section', + 'fields' => array( + 'scanner' => array( + 'type' => 'field', + 'callback' => 'spbc_tab__fswatcher' + ), + ), + ), + ), 'display' => $spbc->settings['scanner__fs_watcher'] ), // Debug @@ -1507,67 +1459,9 @@ function spbc_settings__error__output() $errors_html .= '

' . sprintf(__('You can get support any time here: %s.', 'security-malware-firewall'), '' . $link_to_support . '') . '

'; } } - return str_replace("'", '’', $errors_html); } -/** - * Admin callback function - Displays field of security status - */ -function spbc_field_security_status() -{ - global $spbc; - - // Setting img's paths - $status_marker_green = 'green'; - $status_marker_yellow = 'yellow'; - $status_marker_red = 'red'; - - // Setting statuses - $scanner_status = - $spbc->key_is_ok && - $spbc->moderate && - $spbc->settings['scanner__auto_start']; - - // Output statuses - echo '
'; - echo '
'; - - echo '
'; - - echo '' - . __('Brute-Force Protection & Security log', 'security-malware-firewall') - . ''; - - echo '' - . __('FireWall & Web Application FireWall', 'security-malware-firewall') - . ''; - - if ($spbc->scaner_enabled) { - $status_malware_scanner_text = __('Malware Scanner', 'security-malware-firewall'); - if ($spbc->settings['scanner__auto_start'] && $spbc->settings['scanner__auto_start__set_period'] === '86400') { - $status_malware_scanner_text = __('Daily Automatic Malware Scanner', 'security-malware-firewall'); - } - echo '' - . $status_malware_scanner_text - . ''; - } - - // Security license status - echo spbc__get_security_status_license_html(); - - // Auto update status - if ($spbc->notice_auto_update) { - echo '' - . __('Auto update', 'security-malware-firewall') - . ''; - } - - echo '
'; - echo '
'; - // echo '
'; -} - function spbc_tab__summary() { global $spbc; @@ -1593,9 +1487,25 @@ function spbc_tab__summary() echo ''; } +/** + * @throws Exception + */ function spbc_tab__fswatcher() { + global $spbc; + echo "
"; + + /** + * Check if tab is restricted by license, layout according HTML if so. + */ + $feature_state = $spbc->feature_restrictions->getState($spbc, 'fswatcher'); + if (false === $feature_state->is_active) { + echo $feature_state->sanitizedReasonOutput(); + echo '
'; + return; + } + echo \CleantalkSP\SpbctWP\FSWatcher\View\View::renderSelectors(new \CleantalkSP\SpbctWP\FSWatcher\View\Phrases()); echo ''; } @@ -2127,6 +2037,7 @@ function spbc_field_security_logs__prepare_data(&$table) /** * Admin callback function - Displays description of 'main' plugin parameters section + * @throws Exception */ function spbc_field_security_logs() @@ -2135,9 +2046,13 @@ function spbc_field_security_logs() echo '
'; - if ( ! $spbc->key_is_ok) { - echo spbc__key_not_valid_tab_html(); - + /** + * Check if tab is restricted by license, layout according HTML if so. + */ + $feature_state = $spbc->feature_restrictions->getState($spbc, 'security_log'); + if (false === $feature_state->is_active) { + echo $feature_state->sanitizedReasonOutput(); + echo '
'; return; } @@ -2306,118 +2221,108 @@ function spbc_field_traffic_control_logs__prepare_data(&$table) } } +/** + * @throws Exception + */ function spbc_field_traffic_control_log() { global $spbc; echo '
'; - // Bad key - if ( ! $spbc->key_is_ok) { - echo spbc__key_not_valid_tab_html(); - - // Subscription should be renewed - } elseif ( ! $spbc->moderate) { - if ($spbc->notice_show && $spbc->notice_trial) { - $button = ''; - $link = sprintf('%s', $spbc->user_token, $button); - echo '
' - . '

' - . __('Please renew your security license.', 'security-malware-firewall') - . '

' - . $link - . '
'; - } else { - echo '
' - . '

' . __('Please give us a few seconds to pull account data from the cloud.', 'security-malware-firewall') . '

' . - '
'; - } + /** + * Check if tab is restricted by license, layout according HTML if so. + */ + $feature_state = $spbc->feature_restrictions->getState($spbc, 'firewall_log'); + if (false === $feature_state->is_active) { + echo $feature_state->sanitizedReasonOutput(); + echo '
'; + return; + } - // Subscription is ok - } else { - $table = new ListTable(spbc_list_table__get_args_by_type('traffic_control')); + $table = new ListTable(spbc_list_table__get_args_by_type('traffic_control')); - $table->getData(); + $table->getData(); - echo '

'; - printf( - __('This list contains details of access attempts for the past hour and shows only last %d records.', 'security-malware-firewall'), - SPBC_LAST_ACTIONS_TO_VIEW - ); - echo " "; - printf(__('The list updates itself every %d seconds automatically.', 'security-malware-firewall'), 60); - echo sprintf( - __('Traffic Control blocks visitors who opened more than %s website pages within %s minutes.', 'security-malware-firewall'), - '' . (isset($spbc->settings['traffic_control__autoblock_amount']) ? $spbc->settings['traffic_control__autoblock_amount'] : 1000) . '', - '' . (isset($spbc->settings['traffic_control__autoblock_timeframe']) ? (int)$spbc->settings['traffic_control__autoblock_timeframe'] / 60 : 5) . '' - ) - . ' '; - echo sprintf( - __('You can adjust it %shere%s.', 'security-malware-firewall'), - '', - '' - ); - echo ' '; - echo sprintf( - __('Traffic Control is %s.', 'security-malware-firewall'), - '' . ( - ! empty($spbc->settings['traffic_control__enabled']) - ? __('active', 'security-malware-firewall') - : __('inactive', 'security-malware-firewall') - ) . '' - ) . (! empty($spbc->settings['traffic_control__enabled']) - ? '' - : ' ' . sprintf( - __('You can activate it %shere%s.', 'security-malware-firewall'), - '', - '' - )); - echo ' '; - echo sprintf( - __('Web Application Firewall (WAF) is %s.', 'security-malware-firewall'), - '' . (! empty($spbc->settings['waf__enabled']) - ? __('active', 'security-malware-firewall') - : __('inactive', 'security-malware-firewall') - ) . '' - ) - . (! empty($spbc->settings['waf__enabled']) + echo '

'; + printf( + __('This list contains details of access attempts for the past hour and shows only last %d records.', 'security-malware-firewall'), + SPBC_LAST_ACTIONS_TO_VIEW + ); + echo " "; + printf(__('The list updates itself every %d seconds automatically.', 'security-malware-firewall'), 60); + echo sprintf( + __('Traffic Control blocks visitors who opened more than %s website pages within %s minutes.', 'security-malware-firewall'), + '' . (isset($spbc->settings['traffic_control__autoblock_amount']) ? $spbc->settings['traffic_control__autoblock_amount'] : 1000) . '', + '' . (isset($spbc->settings['traffic_control__autoblock_timeframe']) ? (int)$spbc->settings['traffic_control__autoblock_timeframe'] / 60 : 5) . '' + ) + . ' '; + echo sprintf( + __('You can adjust it %shere%s.', 'security-malware-firewall'), + '', + '' + ); + echo ' '; + echo sprintf( + __('Traffic Control is %s.', 'security-malware-firewall'), + '' . ( + ! empty($spbc->settings['traffic_control__enabled']) + ? __('active', 'security-malware-firewall') + : __('inactive', 'security-malware-firewall') + ) . '' + ) . (! empty($spbc->settings['traffic_control__enabled']) ? '' : ' ' . sprintf( __('You can activate it %shere%s.', 'security-malware-firewall'), - '', + '', '' - ) - ); - echo ' '; - if ($table->items_total) { - echo "Send logs"; // Send logs button - } - echo '

'; + )); + echo ' '; + echo sprintf( + __('Web Application Firewall (WAF) is %s.', 'security-malware-firewall'), + '' . (! empty($spbc->settings['waf__enabled']) + ? __('active', 'security-malware-firewall') + : __('inactive', 'security-malware-firewall') + ) . '' + ) + . (! empty($spbc->settings['waf__enabled']) + ? '' + : ' ' . sprintf( + __('You can activate it %shere%s.', 'security-malware-firewall'), + '', + '' + ) + ); + echo ' '; + if ($table->items_total) { + echo "Send logs"; // Send logs button + } + echo '

'; - $table->display(); + $table->display(); - if ($table->items_total > SPBC_LAST_ACTIONS_TO_VIEW) { - echo "
"; - if ($spbc->user_token) { - echo '
' - . '

' - . __('Proceed to:', 'security-malware-firewall') . ' ' - . '

' - . '' - . __('Security Control Panel', 'security-malware-firewall') - . '' - . '

 ' - . __('to see more.', 'security-malware-firewall') - . '

' - . '
'; - } - echo "" - . '' - . "
"; + if ($table->items_total > SPBC_LAST_ACTIONS_TO_VIEW) { + echo "
"; + if ($spbc->user_token) { + echo '
' + . '

' + . __('Proceed to:', 'security-malware-firewall') . ' ' + . '

' + . '' + . __('Security Control Panel', 'security-malware-firewall') + . '' + . '

 ' + . __('to see more.', 'security-malware-firewall') + . '

' + . '
'; } + echo "" + . '' + . "
"; } + echo ''; } @@ -2918,188 +2823,190 @@ function spbc_field_scanner__log() return $out; } +/** + * @throws Exception + */ function spbc_field_scanner() { global $spbc, $wp_version; echo '
'; - // Key is bad - if ( ! $spbc->key_is_ok) { - echo spbc__key_not_valid_tab_html(); - - // Subscription bad - } elseif ( ! $spbc->moderate) { - $button = ''; - $link = sprintf('%s', $spbc->user_token, $button); - echo '

' . __('Please renew your security license.', 'security-malware-firewall') . '

' . $link . '
'; - // All is ok - } else { - if (preg_match('/^[\d\.]*$/', $wp_version) !== 1) { - echo '

'; - printf(__('Your WordPress version %s is not supported', 'security-malware-firewall'), $wp_version); - echo '

'; - // return; - } + /** + * Check if tab is restricted by license, layout according HTML if so. + */ + $feature_state = $spbc->feature_restrictions->getState($spbc, 'scanner'); + if (false === $feature_state->is_active) { + echo $feature_state->sanitizedReasonOutput(); + echo '
'; + return; + } + if (preg_match('/^[\d\.]*$/', $wp_version) !== 1) { echo '

'; - echo ''; - if (empty($spbc->data['scanner']['last_scan'])) { - _e('System hasn\'t been scanned yet. Please, perform the scan to secure the website.', 'security-malware-firewall'); - //should be offset because last_scan is offset - } elseif ($spbc->data['scanner']['last_scan'] < current_time('timestamp') - 86400 * 7) { - _e('System hasn\'t been scanned for a long time', 'security-malware-firewall'); - } else { - _e('Look below for scan results.', 'security-malware-firewall'); - } - echo ''; - echo '
'; - if (! $spbc->data["wl_mode_enabled"]) { - printf( - __('%sView all scan results for this website%s%s', 'security-malware-firewall'), - "", - '', - ', ' - ); - } - // show save to pdf link - if ( ! empty($spbc->data['scanner']['last_scan'])) { - echo '  ' - . __('Export results to PDF', 'security-malware-firewall') - . ', '; - } - //show backups link + printf(__('Your WordPress version %s is not supported', 'security-malware-firewall'), $wp_version); + echo '

'; + // return; + } + + echo '

'; + echo ''; + if (empty($spbc->data['scanner']['last_scan'])) { + _e('System hasn\'t been scanned yet. Please, perform the scan to secure the website.', 'security-malware-firewall'); + //should be offset because last_scan is offset + } elseif ($spbc->data['scanner']['last_scan'] < current_time('timestamp') - 86400 * 7) { + _e('System hasn\'t been scanned for a long time', 'security-malware-firewall'); + } else { + _e('Look below for scan results.', 'security-malware-firewall'); + } + echo ''; + echo '
'; + if (! $spbc->data["wl_mode_enabled"]) { printf( - __('%sBackups%s', 'security-malware-firewall'), - ' ', - '' + __('%sView all scan results for this website%s%s', 'security-malware-firewall'), + "", + '', + ', ' ); - echo '

'; - $scanner_disabled = isset($spbc->errors['configuration']) ? 'disabled="disabled"' : ''; - $scanner_disabled_reason = $scanner_disabled - ? 'title="' . __('Scanner is disabled. Please, check errors on the top of the settings.', 'security-malware-firewall') . '"' - : ''; - echo '
' - . '' - . '' - . '
'; - - echo '

'; - echo spbc_scanner__last_scan_info(true); - echo '

'; + } + // show save to pdf link + if ( ! empty($spbc->data['scanner']['last_scan'])) { + echo '  ' + . __('Export results to PDF', 'security-malware-firewall') + . ', '; + } + //show backups link + printf( + __('%sBackups%s', 'security-malware-firewall'), + ' ', + '' + ); + echo '

'; + $scanner_disabled = isset($spbc->errors['configuration']) ? 'disabled="disabled"' : ''; + $scanner_disabled_reason = $scanner_disabled + ? 'title="' . __('Scanner is disabled. Please, check errors on the top of the settings.', 'security-malware-firewall') . '"' + : ''; + echo '
' + . '' + . '' + . '
'; - // Show link for shuffle salts - if ($spbc->settings['there_was_signature_treatment']) { - echo ''; - } - echo ''; - echo ''; + echo '

'; + echo spbc_scanner__last_scan_info(true); + echo '

'; - //* Debug Buttons - // Clear hashes - if (in_array(Server::getDomain(), array('lc', 'loc', 'lh', 'wordpress'), true)) { - echo '' - . '' - . '

'; - } - //*/ - - echo - '
' - . '' . __('Receiving core hashes', 'security-malware-firewall') . ' -> ' - . '' . __('Receiving plugin and theme hashes', 'security-malware-firewall') . ' -> ' - . '' . __('Preparing', 'security-malware-firewall') . ' -> ' - . '' . __('Scanning for modifications', 'security-malware-firewall') . ' -> ' - . '' . __('Updating statuses for the denied files', 'security-malware-firewall') . ' -> ' - . '' . __('Updating statuses for the approved files', 'security-malware-firewall') . ' -> '; - - if ($spbc->settings['scanner__file_monitoring']) { - echo '' - . __('Important File Monitoring', 'security-malware-firewall') - . ' -> '; - } + // Show link for shuffle salts + if ($spbc->settings['there_was_signature_treatment']) { + echo ''; + } + echo ''; + echo ''; + + //* Debug Buttons + // Clear hashes + if (in_array(Server::getDomain(), array('lc', 'loc', 'lh', 'wordpress'), true)) { + echo '' + . '' + . '

'; + } + //*/ - if ($spbc->settings['scanner__signature_analysis']) { - echo '' - . __('Signature analysis', 'security-malware-firewall') - . ' -> '; - } + echo + '
' + . '' . __('Receiving core hashes', 'security-malware-firewall') . ' -> ' + . '' . __('Receiving plugin and theme hashes', 'security-malware-firewall') . ' -> ' + . '' . __('Preparing', 'security-malware-firewall') . ' -> ' + . '' . __('Scanning for modifications', 'security-malware-firewall') . ' -> ' + . '' . __('Updating statuses for the denied files', 'security-malware-firewall') . ' -> ' + . '' . __('Updating statuses for the approved files', 'security-malware-firewall') . ' -> '; - if ($spbc->settings['scanner__heuristic_analysis']) { - echo '' - . __('Heuristic analysis', 'security-malware-firewall') - . ' -> '; - } + if ($spbc->settings['scanner__file_monitoring']) { + echo '' + . __('Important File Monitoring', 'security-malware-firewall') + . ' -> '; + } - if ($spbc->settings['scanner__schedule_send_heuristic_suspicious_files']) { - echo '' - . __('Schedule suspicious files sending', 'security-malware-firewall') - . ' -> '; - } + if ($spbc->settings['scanner__signature_analysis']) { + echo '' + . __('Signature analysis', 'security-malware-firewall') + . ' -> '; + } - if ($spbc->settings['scanner__auto_cure']) { - echo '' . __('Creating a backup', 'security-malware-firewall') . ' -> '; - echo '' . __('Curing', 'security-malware-firewall') . ' -> '; - } + if ($spbc->settings['scanner__heuristic_analysis']) { + echo '' + . __('Heuristic analysis', 'security-malware-firewall') + . ' -> '; + } - if ($spbc->settings['scanner__outbound_links']) { - echo '' . __('Scanning links', 'security-malware-firewall') . ' -> '; - } + if ($spbc->settings['scanner__schedule_send_heuristic_suspicious_files']) { + echo '' + . __('Schedule suspicious files sending', 'security-malware-firewall') + . ' -> '; + } - if ($spbc->settings['scanner__frontend_analysis']) { - echo '' . __('Scanning public pages', 'security-malware-firewall') . ' -> '; - } + if ($spbc->settings['scanner__auto_cure']) { + echo '' . __('Creating a backup', 'security-malware-firewall') . ' -> '; + echo '' . __('Curing', 'security-malware-firewall') . ' -> '; + } - if ($spbc->settings['scanner__important_files_listing']) { - echo '' . __('Scanning for publicly accessible files', 'security-malware-firewall') . ' -> '; - } + if ($spbc->settings['scanner__outbound_links']) { + echo '' . __('Scanning links', 'security-malware-firewall') . ' -> '; + } - echo '' . __('Sending results', 'security-malware-firewall') . '' + if ($spbc->settings['scanner__frontend_analysis']) { + echo '' . __('Scanning public pages', 'security-malware-firewall') . ' -> '; + } - . '
'; - echo '
'; + if ($spbc->settings['scanner__important_files_listing']) { + echo '' . __('Scanning for publicly accessible files', 'security-malware-firewall') . ' -> '; + } - // Log style output for scanned files + echo '' . __('Sending results', 'security-malware-firewall') . '' - echo '
'; + . '
'; + echo '
'; + // Log style output for scanned files - echo '
'; - if ( ! empty($spbc->data['scanner']['last_scan'])) { - spbc_field_scanner__show_accordion(true); - } - echo '
'; + echo '
'; - echo '
'; - echo spbc_field_scanner__log(); - // Scan results log - if ( ! empty($spbc->data['scanner']['last_scan'])) { - spbc_scan_results_log_module(); - } + echo '
'; + if ( ! empty($spbc->data['scanner']['last_scan'])) { + spbc_field_scanner__show_accordion(true); + } + echo '
'; - // Clear hashes - if (! empty($spbc->data['scanner']['last_scan'])) { - echo '' - . ''; - } + echo '
'; + echo spbc_field_scanner__log(); - echo '
'; + // Scan results log + if ( ! empty($spbc->data['scanner']['last_scan'])) { + spbc_scan_results_log_module(); + } - echo spbc_bulk_actions_description(); + // Clear hashes + if (! empty($spbc->data['scanner']['last_scan'])) { + echo '' + . ''; } + + echo '
'; + + echo spbc_bulk_actions_description(); + echo ''; } @@ -4058,48 +3965,43 @@ function spbc_field_backups() echo '
'; - if ( ! $spbc->key_is_ok) { - echo spbc__key_not_valid_tab_html(); - } elseif ( ! $spbc->moderate) { - $button = ''; - $link = sprintf('%s', $spbc->user_token, $button); - echo '

' . __('Please renew your security license.', 'security-malware-firewall') . '

' . $link . '
'; - } else { - // echo '

'; - // _e('Different types of backups', 'security-malware-firewall'); - // echo '

'; - echo '
'; - - echo '
'; - - $table = new ListTable(spbc_list_table__get_args_by_type('cure_backups')); - $table->getData(); - - // Pass output if empty and said to do so - if ($table->items_total !== 0) { - echo '

' - . '' - . ucwords(str_replace('_', ' ', 'cure_backups')) - . ' ' - . $table->items_total - . '' - . '' - . '

'; - echo '
'; + $feature_state = $spbc->feature_restrictions->getState($spbc, 'backups'); + if (false === $feature_state->is_active) { + echo $feature_state->sanitizedReasonOutput(); + echo '
'; + return; + } + echo '
'; - echo '

' - . __('All backups that were made during the automatic curing procedure', 'security-malware-firewall') - . '

'; + echo '
'; - $table->display(); + $table = new ListTable(spbc_list_table__get_args_by_type('cure_backups')); + $table->getData(); - echo "
"; - } + // Pass output if empty and said to do so + if ($table->items_total !== 0) { + echo '

' + . '' + . ucwords(str_replace('_', ' ', 'cure_backups')) + . ' ' + . $table->items_total + . '' + . '' + . '

'; + echo '
'; + + echo '

' + . __('All backups that were made during the automatic curing procedure', 'security-malware-firewall') + . '

'; - echo '
'; + $table->display(); + + echo "
"; } echo '
'; + + echo ''; } function spbc_field_debug_drop() @@ -5380,52 +5282,6 @@ function spbc_get_next_scan_launch_time_text() return ''; } -/** - * Template for status of security license - * - * @return string - */ -function spbc__get_security_status_license_html() -{ - global $spbc; - - // Key is OK - if ($spbc->data['key_is_ok']) { - // Security license is valid - if ((int)$spbc->data['notice_show'] === 0) { - return '' - . __('Security license is valid', 'security-malware-firewall') - . ''; - } - - // Security license expires - if ((int)$spbc->data['notice_show'] === 1) { - return '' - . __('Security license expires in next 30 days', 'security-malware-firewall') - . ''; - } - } - - // Key is not OK - return '' - . __('Security license is unknown', 'security-malware-firewall') - . ''; -} - -/** - * Template for tabs when key is not valid - * - * @return string - */ -function spbc__key_not_valid_tab_html() -{ - return '

' - . __('Plugin does not work until you enter the Access key in ', 'security-malware-firewall') - . '' - . __('General settings', 'security-malware-firewall') - . '.

'; -} - /** * Generate HTML code for accordions to suggest user manual audit services. * @param $for string destination accordion name diff --git a/js/spbc-react-bundle.js b/js/spbc-react-bundle.js index 98fec310a..e8a5c26b8 100644 --- a/js/spbc-react-bundle.js +++ b/js/spbc-react-bundle.js @@ -46,7 +46,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nclass SpbctPage extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {\n constructor(props) {\n super(props);\n this.state = {\n date: new Date()\n };\n }\n componentDidMount() {\n jQuery('.spbc_tab_nav-summary').data('loaded', true); // Summary tab loaded by default\n jQuery('.spbc_tabs_nav_wrapper').on('click', '.spbc_tab_nav', function (event) {\n spbc_switchTab(event.currentTarget);\n });\n // Get additional params\n var params = {\n target: location.search.match(/spbc_target=(\\S*?)(&|$)/) ? location.search.match(/spbc_target=(\\S*?)(&|$)/)[1] : null,\n action: location.search.match(/spbc_action=(\\S*?)(&|$)/) ? location.search.match(/spbc_action=(\\S*?)(&|$)/)[1] : null,\n times: location.search.match(/spbc_times=(\\S*?)(&|$)/) ? location.search.match(/spbc_times=(\\S*?)(&|$)/)[1] : 3\n };\n // Legacy support\n params.target = location.search.match(/spbc_highlight=(\\S*?)(&|$)/) ? location.search.match(/spbc_highlight=(\\S*?)(&|$)/)[1] : params.target;\n params.action = location.search.search(/spbc_highlight=(\\S*?)(&|$)/) != -1 ? 'highlight' : params.action;\n\n // Get open tab form query\n var spbc_tab = document.getElementsByClassName('spbc_tab_nav-' + (location.search.match(/spbc_tab=(\\S*?)(&|$)/) ? location.search.match(/spbc_tab=(\\S*?)(&|$)/)[1] : ''))[0] || null;\n\n // TAB SWITCHING\n // Switch by URL\n if (spbc_tab) {\n\n // Switch to DEBUG\n } else if (+spbcSettings.debug) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-debug')[0];\n // Switch by DEFAULT\n } else if (+spbcSettings.wpms && !+spbcSettings.is_main_site) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-security_log')[0];\n // Switch if Key is OK and SFW is ON\n } else if (+spbcSettings.key_is_ok && +spbcSettings.secfw_enabled) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-traffic_control')[0];\n // Switch if Key is OK\n } else if (+spbcSettings.key_is_ok) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-scanner')[0];\n // Switch if KEY IS BAD\n } else {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-settings_general')[0];\n params = {\n target: 'spbc_key',\n action: 'highlight',\n times: 3\n };\n }\n\n // Switch tab\n if (spbc_tab) spbc_switchTab(spbc_tab, params);\n var ctrlKeyDown = false;\n jQuery(document).on(\"keyup\", function (e) {\n if ((e.which || e.keyCode) == 17) ctrlKeyDown = false;\n });\n jQuery(document).on(\"keydown\", function (e) {\n if ((e.which || e.keyCode) == 116 && ctrlKeyDown) {\n e.preventDefault();\n var active_tab = jQuery('.spbc_tab_nav--active')[0];\n var tab_name = active_tab.classList[1].replace('spbc_tab_nav-', '');\n if (tab_name === 'scanner') return;\n jQuery(active_tab).data('loaded', false);\n spbc_switchTab(active_tab);\n } else if ((e.which || e.keyCode) == 17) {\n ctrlKeyDown = true;\n }\n });\n }\n render() {\n return this.getTabsHeader();\n }\n getTabsHeader() {\n //console.log(this.props);\n this.dataPrepared = {\n 'criticalCount': null,\n 'criticalDot': null,\n 'keyIsOk': null,\n 'displayDebug': null,\n 'isWPMSMainSite': false,\n 'isSecFWEnabled': true\n };\n this.dataPrepared.isWPMSMainSite = +this.props.data.isWPMSMainSite;\n this.dataPrepared.isSecFWEnabled = +this.props.data.isSecFWEnabled;\n let dot = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_ring-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_ringring\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_circle\"\n }));\n if (this.props.data.criticalCount && this.props.data.criticalCount > 0) {\n this.dataPrepared.criticalCount = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"(\", +this.props.data.criticalCount, \")\");\n this.dataPrepared.criticalDot = dot;\n }\n if (!this.props.data.keyIsOk) {\n this.dataPrepared.keyIsOk = dot;\n }\n this.dataPrepared.displayDebug = \"none\";\n if (this.props.data.showDebug === true) {\n this.dataPrepared.displayDebug = \"flex\";\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_tabs_nav_wrapper\",\n style: {\n display: \"flex\",\n flexWrap: \"wrap\"\n }\n }, this.dataPrepared.isSecFWEnabled ? this.getFirewallTab() : '', this.dataPrepared.isWPMSMainSite ? this.getFSWTab() : '', this.dataPrepared.isWPMSMainSite ? this.getScannerTab() : '', this.getSecurityLogTab(), this.getSettingsTab(), this.getSummaryTab(), this.dataPrepared.isWPMSMainSite ? this.getDebugTab() : ''));\n }\n getFirewallTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-traffic_control spbc_tab_nav--active\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M21.3554 5.20115H18.3724C18.2553 5.03834 18.1338 4.87983 18.011 4.71986C17.3452 3.85275 16.5907 2.86993 16.1948 0.538579C16.1561 0.310717 15.9984 0.120967 15.7814 0.0413889C15.5643 -0.038232 15.3213 0.00452184 15.1444 0.153279C12.6517 2.25037 12.0335 4.01887 11.8906 5.92917C11.5892 5.49678 11.3885 4.96066 11.3885 4.55667C11.3885 4.31359 11.2517 4.09119 11.0347 3.98149C10.8178 3.87179 10.5576 3.89353 10.3618 4.0376C9.87282 4.39755 9.45165 4.78633 9.09831 5.2012H0.64453C0.288578 5.2012 0 5.48977 0 5.84573V21.3574C0 21.7134 0.288578 22.0019 0.64453 22.0019H21.3554C21.7114 22.0019 22 21.7134 22 21.3574V5.84568C22 5.48973 21.7114 5.20115 21.3554 5.20115ZM10.3436 5.75162C10.6939 6.65912 11.3952 7.53775 12.2819 7.84845C12.7006 7.99532 13.1395 7.68367 13.1395 7.24019C13.1395 5.25229 13.2941 3.74095 15.1619 1.8798C15.6459 3.7562 16.38 4.71238 16.9884 5.50486C17.6481 6.36419 18.0871 6.95939 18.0871 8.4238C18.0871 10.9116 16.0632 12.9355 13.5754 12.9355C11.6675 12.9355 9.85306 11.6267 9.26091 9.82355C8.78774 8.38264 9.18232 6.93949 10.3436 5.75162ZM15.5117 14.2246V16.8027H6.48827V14.2246H15.5117ZM6.48827 6.49026H8.2615C8.17793 6.66858 8.10363 6.85008 8.04086 7.03549C7.81772 7.69445 7.73711 8.38242 7.79765 9.06838H6.48827V6.49026ZM1.28906 6.49021H5.19921V9.06833H1.28906V6.49021ZM1.28906 10.3574H8.08253C8.4372 11.3486 9.09097 12.2534 9.94591 12.9355H1.28906V10.3574ZM1.28906 14.2246H5.19921V16.8027H1.28906V14.2246ZM10.3554 20.7128H1.28906V18.0918H10.3554V20.7128ZM20.7109 20.7128H11.6445V18.0918H20.7109V20.7128ZM20.7109 16.8027H16.8007V14.2246H20.7109V16.8027ZM20.7109 12.9355H17.217C18.0431 12.2675 18.6826 11.3777 19.0444 10.3574H20.7109V12.9355ZM20.7109 9.06833H19.3402C19.3637 8.85663 19.3762 8.64165 19.3762 8.4238C19.3762 7.62171 19.2609 7.00425 19.0759 6.49021H20.7109V9.06833Z\",\n fill: \"#1D2327\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Firewall\"));\n }\n getFSWTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-fswatcher\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_309)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M17.4381 2.88241H15.4478V1.99201C15.4478 1.70394 15.1335 1.57301 14.8455 1.57301H13.3004C12.9337 0.525466 12.0171 0.00169566 10.9696 0.00169566C9.93357 -0.0372525 8.99125 0.597999 8.63881 1.57301H7.11988C6.8318 1.57301 6.54373 1.70394 6.54373 1.99201V2.88241H4.55336C3.37389 2.89499 2.40896 3.82543 2.35352 5.00365V20.0096C2.35352 21.1619 3.40106 21.9999 4.55336 21.9999H17.4381C18.5904 21.9999 19.6379 21.1619 19.6379 20.0096V5.0037C19.5825 3.82543 18.6176 2.89499 17.4381 2.88241ZM7.59122 2.62055H9.0316C9.28303 2.58987 9.48499 2.39859 9.5292 2.14916C9.68429 1.47376 10.2768 0.988934 10.9696 0.970688C11.6559 0.99149 12.2395 1.47782 12.3837 2.14916C12.4307 2.40721 12.646 2.60095 12.9075 2.62055H14.4003V4.71563H7.59122V2.62055ZM18.5904 20.0097C18.5904 20.5858 18.0142 20.9525 17.4381 20.9525H4.55336C3.97721 20.9525 3.40106 20.5858 3.40106 20.0097V5.0037C3.45449 4.40399 3.95134 3.94097 4.55336 3.93H6.54368V5.26561C6.57135 5.55905 6.82549 5.77856 7.11983 5.76322H14.8454C15.1452 5.77961 15.4073 5.56311 15.4477 5.26561V3.92995H17.438C18.04 3.94097 18.5369 4.40394 18.5903 5.00365V20.0097H18.5904Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 11.7102C8.78397 11.5031 8.45785 11.4914 8.24712 11.684L6.57104 13.2815L5.86396 12.5482C5.66751 12.3411 5.34139 12.3295 5.13066 12.522C4.9278 12.7345 4.9278 13.0689 5.13066 13.2815L6.20437 14.3814C6.2973 14.4855 6.43154 14.543 6.57099 14.5385C6.70914 14.5366 6.84092 14.4801 6.93762 14.3814L8.98031 12.4435C9.18282 12.2577 9.19636 11.9429 9.01054 11.7404C9.00102 11.7299 8.99094 11.7198 8.98041 11.7102Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 12.8359H10.473C10.1837 12.8359 9.94922 13.0704 9.94922 13.3597C9.94922 13.649 10.1837 13.8835 10.473 13.8835H16.4963C16.7856 13.8835 17.0201 13.649 17.0201 13.3597C17.0201 13.0704 16.7856 12.8359 16.4963 12.8359Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 7.51681C8.78397 7.30973 8.45785 7.29805 8.24712 7.49064L6.57104 9.08812L5.86396 8.35482C5.66751 8.14775 5.34139 8.13607 5.13066 8.32865C4.9278 8.54119 4.9278 8.87558 5.13066 9.08812L6.20437 10.188C6.2973 10.2921 6.43154 10.3496 6.57099 10.3452C6.70914 10.3432 6.84092 10.2867 6.93762 10.188L8.98031 8.2501C9.18282 8.06434 9.19636 7.74954 9.01054 7.54708C9.00102 7.53651 8.99094 7.52643 8.98041 7.51681Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 8.64258H10.473C10.1837 8.64258 9.94922 8.87707 9.94922 9.16635C9.94922 9.45563 10.1837 9.69012 10.473 9.69012H16.4963C16.7856 9.69012 17.0201 9.45563 17.0201 9.16635C17.0201 8.87707 16.7856 8.64258 16.4963 8.64258Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 15.8976C8.78397 15.6906 8.45785 15.6789 8.24712 15.8715L6.57104 17.469L5.86396 16.7357C5.66751 16.5286 5.34139 16.517 5.13066 16.7095C4.9278 16.922 4.9278 17.2564 5.13066 17.469L6.20437 18.5689C6.2973 18.6729 6.43154 18.7305 6.57099 18.726C6.70914 18.7241 6.84092 18.6676 6.93762 18.5689L8.98031 16.6309C9.18282 16.4452 9.19636 16.1304 9.01054 15.9279C9.00102 15.9174 8.99094 15.9073 8.98041 15.8976Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 17.0234H10.473C10.1837 17.0234 9.94922 17.2579 9.94922 17.5472C9.94922 17.8365 10.1837 18.071 10.473 18.071H16.4963C16.7856 18.071 17.0201 17.8365 17.0201 17.5472C17.0201 17.2579 16.7856 17.0234 16.4963 17.0234Z\",\n fill: \"#1D2327\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_309\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"File System Watcher\"));\n }\n getScannerTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-scanner\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_209)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"mask\", {\n id: \"mask0_2972_209\",\n style: {\n maskType: \"luminance\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: \"-1\",\n y: \"0\",\n width: \"23\",\n height: \"23\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M21.9961 0.00390816H-0.00390434V22.0039H21.9961V0.00390816Z\",\n fill: \"white\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n mask: \"url(#mask0_2972_209)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M0.644533 8.38281C0.644533 12.6544 4.10734 16.1172 8.37891 16.1172C12.6505 16.1172 16.1133 12.6544 16.1133 8.38281C16.1133 4.11125 12.6505 0.648439 8.37891 0.648439C4.10734 0.648439 0.644533 4.11125 0.644533 8.38281Z\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M10.6741 6.58789L12.2422 5.80384V4.51478\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M6.07422 6.58789L4.50616 5.80384\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M12.2422 8.38281H10.9531\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.80078 8.38281H4.51172\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.80078 8.38281C5.80078 11.2305 6.95505 12.25 8.37891 12.25C9.80276 12.25 10.957 11.2305 10.957 8.38281C10.957 5.5351 9.80276 5.80469 8.37891 5.80469C6.95505 5.80469 5.80078 5.5351 5.80078 8.38281Z\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M10.7443 10.212L12.2422 10.9609V12.25\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M6.00781 10.212L4.50988 10.9609V12.25\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M9.66602 5.83594V4.51336C9.66602 3.80141 9.08886 3.2243 8.37695 3.2243C7.66505 3.2243 7.08789 3.80141 7.08789 4.51336V5.83594\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M4.50977 5.80469V4.51562\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M12.8566 14.6872L19.1511 20.9817C19.4029 21.2335 19.7327 21.3594 20.0625 21.3594C20.3923 21.3594 20.7221 21.2335 20.9739 20.9817C21.4775 20.4782 21.4775 19.6625 20.9739 19.1589L14.6794 12.8644\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_209\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\",\n transform: \"matrix(-1 0 0 1 22 0)\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Malware Scanner \", this.dataPrepared.criticalCount), this.dataPrepared.criticalDot));\n }\n getSecurityLogTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-security_log\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_239)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"mask\", {\n id: \"mask0_2972_239\",\n style: {\n maskType: \"luminance\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: \"0\",\n y: \"0\",\n width: \"23\",\n height: \"22\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M0.0078125 3.8147e-06H22.0078V22H0.0078125V3.8147e-06Z\",\n fill: \"white\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n mask: \"url(#mask0_2972_239)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M1.93359 14.4785H20.0664C20.7783 14.4785 21.3555 15.0557 21.3555 15.7676V20.0645C21.3555 20.7764 20.7783 21.3535 20.0664 21.3535H1.93359C1.22169 21.3535 0.644531 20.7764 0.644531 20.0645V15.7676C0.644531 15.0557 1.22169 14.4785 1.93359 14.4785Z\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M7.7832 18.8867L9.7168 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M9.7168 18.8867L7.7832 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M3.26562 18.8867L5.19922 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.19922 18.8867L3.26562 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M12.2891 18.8867L14.2227 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M14.2227 18.8867L12.2891 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.8066 18.8867L18.7402 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M18.7402 18.8867L16.8066 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.41992 6.22656C5.41992 3.14154 7.92083 0.640626 11.0059 0.640626C14.0909 0.640626 16.5918 3.14154 16.5918 6.22656C16.5918 9.31159 14.0909 11.8125 11.0059 11.8125C7.92083 11.8125 5.41992 9.31159 5.41992 6.22656Z\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M11 3.2207C11.8306 3.2207 12.5039 3.89402 12.5039 4.72461V5.58398C12.5039 6.41457 11.8306 7.08789 11 7.08789C10.1694 7.08789 9.49609 6.41457 9.49609 5.58398V4.72461C9.49609 3.89402 10.1694 3.2207 11 3.2207Z\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M7.99805 10.9277V10.0929C7.99805 8.43172 9.34469 7.08508 11.0059 7.08508C12.667 7.08508 14.0137 8.43172 14.0137 10.0929V10.9277\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_239\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Security Log\"));\n }\n getSettingsTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-settings_general\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_281)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M11.5354 13.0716C11.2269 13.0716 10.9768 13.3217 10.9768 13.6302C10.9766 15.0762 9.80426 16.2481 8.35832 16.2479C6.91238 16.2476 5.74041 15.0753 5.74066 13.6294C5.74092 12.1836 6.91298 11.0117 8.35875 11.0117C8.66727 11.0117 8.91734 10.7616 8.91734 10.4531C8.91734 10.1446 8.66727 9.89453 8.35875 9.89453C6.29616 9.89595 4.62446 11.5676 4.62305 13.6302C4.62305 15.6933 6.29548 17.3657 8.35854 17.3657C10.4216 17.3657 12.094 15.6933 12.094 13.6302C12.094 13.3217 11.8439 13.0716 11.5354 13.0716Z\",\n fill: \"black\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M15.9784 14.9199C15.9251 14.6161 15.6356 14.4129 15.3317 14.4662L14.1625 14.6711C13.9486 14.7086 13.7759 14.8666 13.7195 15.0763C13.5948 15.539 13.4104 15.9835 13.1708 16.3985C13.0616 16.587 13.072 16.8219 13.1974 17L13.8798 17.9724C13.9752 18.1079 13.9593 18.2924 13.842 18.4094L13.1407 19.1107C13.0238 19.2279 12.8396 19.244 12.7041 19.1489L11.7318 18.4666C11.5536 18.3411 11.3187 18.3307 11.1302 18.4399C10.7152 18.6796 10.2708 18.864 9.80805 18.9886C9.59836 19.045 9.44032 19.2178 9.40285 19.4317L9.19531 20.5995C9.16691 20.7626 9.02524 20.8816 8.85973 20.8814H7.86758C7.70206 20.8816 7.56044 20.7626 7.53199 20.5995L7.32703 19.4308C7.28956 19.2169 7.13152 19.0442 6.92184 18.9878C6.45902 18.8631 6.01442 18.6787 5.59926 18.4391C5.41071 18.3298 5.17584 18.3402 4.9977 18.4657L4.02703 19.1476C3.89159 19.2431 3.70709 19.2271 3.59004 19.1098L2.88879 18.4086C2.77174 18.2916 2.75563 18.1075 2.85055 17.972L3.53289 16.9996C3.65832 16.8215 3.66876 16.5866 3.55953 16.3981C3.31981 15.9831 3.13534 15.5386 3.01082 15.0759C2.95445 14.8662 2.78167 14.7082 2.56781 14.6707L1.39906 14.4658C1.2363 14.4374 1.11745 14.2962 1.11719 14.131V13.1389C1.11702 12.9734 1.236 12.8317 1.39906 12.8033L2.56781 12.5983C2.78167 12.5609 2.95445 12.4028 3.01082 12.1931C3.13526 11.7299 3.31972 11.285 3.55953 10.8697C3.66876 10.6812 3.65832 10.4463 3.53289 10.2681L2.85098 9.29876C2.7555 9.16332 2.77149 8.97881 2.88879 8.86177L3.59047 8.16009C3.70743 8.043 3.89168 8.02706 4.02703 8.12228L4.99941 8.80462C5.17756 8.93009 5.41243 8.94049 5.60098 8.83126C6.0161 8.59162 6.4607 8.40716 6.92356 8.28255C7.13324 8.22617 7.29128 8.0534 7.32875 7.83954L7.53371 6.67079C7.58699 6.36692 7.38384 6.07739 7.07996 6.02411C6.77609 5.97083 6.48656 6.17399 6.43328 6.47786L6.28805 7.30716C5.96948 7.41239 5.65937 7.54168 5.36035 7.69388L4.6707 7.21005C4.09131 6.80236 3.30254 6.87111 2.80242 7.3729L2.09859 8.072C1.59728 8.57237 1.52874 9.36089 1.93617 9.94028L2.42 10.6299C2.26776 10.929 2.13847 11.2393 2.03328 11.5581L1.20399 11.7033C0.507118 11.8257 -0.000858177 12.4314 1.19802e-06 13.1389V14.131C-0.000901146 14.8392 0.508021 15.4454 1.2057 15.567L2.035 15.7127C2.14019 16.0313 2.26948 16.3414 2.42172 16.6404L1.93617 17.33C1.52887 17.9095 1.59758 18.698 2.09902 19.1983L2.8007 19.8996C3.30099 20.4011 4.08964 20.4696 4.66899 20.062L5.35649 19.5782C5.6555 19.7304 5.96561 19.8596 6.28418 19.9649L6.42942 20.7942C6.55179 21.4922 7.15894 22.0007 7.86758 21.9986H8.85973C9.56811 21.9995 10.1743 21.4903 10.2957 20.7925L10.4414 19.9632C10.76 19.8579 11.0701 19.7287 11.3691 19.5765L12.0592 20.0603C12.6386 20.4678 13.4273 20.399 13.9275 19.8974L14.6291 19.1958C15.1306 18.6955 15.1993 17.9069 14.792 17.3275L14.3086 16.64C14.4608 16.341 14.59 16.0308 14.6953 15.7123L15.5246 15.5666C15.8285 15.5133 16.0316 15.2238 15.9784 14.9199Z\",\n fill: \"black\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M20.9473 5.07031L20.3629 4.96805C20.2899 4.75733 20.2038 4.55138 20.1051 4.35145L20.4489 3.86719C20.803 3.3636 20.7433 2.6782 20.3075 2.2434L19.7541 1.68867C19.319 1.25194 18.6326 1.19204 18.1286 1.54688L17.6426 1.88762C17.4426 1.78888 17.2367 1.70277 17.026 1.62981L16.9254 1.04801C16.8196 0.441377 16.2925 -0.000986629 15.6768 1.65263e-06H14.8952C14.2794 -0.000771785 13.7525 0.441806 13.6469 1.04844L13.5442 1.63281C13.3335 1.70578 13.1276 1.79188 12.9276 1.89063L12.4416 1.54688C11.938 1.19273 11.2527 1.25241 10.8179 1.68824L10.2653 2.24168C9.82854 2.6767 9.76864 3.36312 10.1235 3.86719L10.4642 4.35317C10.3655 4.5531 10.2794 4.75905 10.2064 4.96977L9.62418 5.07031C9.01772 5.1761 8.5754 5.70294 8.57617 6.31856V7.10016C8.57497 7.71607 9.01742 8.24343 9.62418 8.34926L10.2081 8.45153C10.2811 8.66224 10.3672 8.86819 10.4659 9.06813L10.1248 9.5541C9.77058 10.0575 9.82987 10.7428 10.2653 11.1779L10.8179 11.7305C11.2527 12.1666 11.9384 12.2262 12.4421 11.8718L12.9293 11.5311C13.1293 11.6298 13.3352 11.7159 13.5459 11.7889L13.6486 12.3733C13.7544 12.9797 14.2813 13.4221 14.8969 13.4213H15.6785C16.2943 13.4213 16.8207 12.978 16.9254 12.3711L17.0277 11.7872C17.2384 11.7142 17.4444 11.6281 17.6443 11.5294L18.1286 11.8723C18.6326 12.2273 19.3191 12.1674 19.7541 11.7305L20.3071 11.1775C20.7426 10.7427 20.8025 10.0577 20.4489 9.5541L20.1073 9.06641C20.206 8.86643 20.2921 8.66053 20.3651 8.44981L20.9495 8.34711C21.5546 8.24072 21.9958 7.715 21.9957 7.10059V6.31899C21.9967 5.70307 21.5541 5.17593 20.9473 5.07031ZM20.8786 7.10188C20.8786 7.17479 20.8262 7.23714 20.7544 7.24969L19.8331 7.41125C19.6193 7.44872 19.4465 7.60676 19.3901 7.81645C19.2946 8.1712 19.1531 8.51194 18.9695 8.83008C18.8602 9.01863 18.8706 9.25349 18.9961 9.43164L19.5336 10.1982C19.5757 10.2579 19.5686 10.3392 19.5169 10.3907L18.9643 10.9433C18.9122 10.9933 18.8318 10.9991 18.7731 10.957L18.0052 10.4199C17.8271 10.2945 17.5922 10.2841 17.4037 10.3933C17.0855 10.577 16.7448 10.7184 16.39 10.8139C16.1808 10.871 16.0235 11.0441 15.9866 11.2578L15.825 12.1791C15.8125 12.2509 15.7501 12.3033 15.6772 12.3032H14.8952C14.8222 12.3033 14.7599 12.2509 14.7473 12.1791L14.5854 11.2578C14.5479 11.044 14.3898 10.8712 14.1802 10.8148C13.8253 10.7192 13.4844 10.5778 13.1661 10.3941C12.9775 10.2849 12.7427 10.2953 12.5645 10.4208L11.8001 10.957C11.7404 10.9991 11.6591 10.992 11.6076 10.9403L11.055 10.3877C11.0034 10.3362 10.9963 10.2549 11.0383 10.1952L11.5758 9.42863C11.7013 9.25049 11.7117 9.01562 11.6025 8.82707C11.4187 8.50897 11.2773 8.16819 11.1818 7.81344C11.1246 7.60435 10.9516 7.44722 10.7379 7.41039L9.81668 7.24883C9.74488 7.23628 9.69246 7.17394 9.6925 7.10102L9.69293 6.31899C9.69289 6.24607 9.74531 6.18372 9.81711 6.17117L10.7379 6.00918C10.9518 5.97171 11.1246 5.81367 11.1809 5.60399C11.2765 5.24924 11.4179 4.90849 11.6016 4.59035C11.7108 4.40181 11.7004 4.16694 11.575 3.98879L11.0387 3.22266C10.9967 3.16297 11.0038 3.08168 11.0555 3.03016L11.6085 2.47715C11.66 2.42546 11.7413 2.41837 11.801 2.46039L12.5671 2.99793C12.7453 3.12336 12.9801 3.1338 13.1687 3.02457C13.4868 2.84084 13.8276 2.69943 14.1823 2.60391C14.392 2.54753 14.55 2.37476 14.5875 2.1609L14.7491 1.23965C14.7622 1.16914 14.8234 1.11783 14.8952 1.11719H15.6768C15.7497 1.11715 15.812 1.16957 15.8246 1.24137L15.9861 2.16262C16.0236 2.37647 16.1816 2.54925 16.3913 2.60563C16.7461 2.7011 17.0869 2.84251 17.405 3.02629C17.5935 3.13552 17.8284 3.12512 18.0065 2.99965L18.7731 2.46211C18.8328 2.42009 18.9141 2.42718 18.9656 2.47887L19.5186 3.03188C19.5688 3.08361 19.5751 3.1637 19.5336 3.22266L18.9961 3.99051C18.8706 4.16866 18.8602 4.40353 18.9695 4.59207C19.1531 4.91021 19.2946 5.25096 19.3901 5.60571C19.4465 5.81539 19.6193 5.97343 19.8331 6.0109L20.7544 6.17246C20.8262 6.18501 20.8786 6.24736 20.8786 6.32028V7.10188Z\",\n fill: \"black\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M15.2938 4.03711C13.8199 4.03711 12.625 5.23198 12.625 6.7059C12.6267 8.17912 13.8206 9.37301 15.2938 9.37469C16.7677 9.37469 17.9626 8.17981 17.9626 6.7059C17.9626 5.23198 16.7677 4.03711 15.2938 4.03711ZM15.2938 8.2575C14.4369 8.2575 13.7422 7.56282 13.7422 6.7059C13.742 5.84854 14.4364 5.15309 15.2938 5.15215V5.1543C16.1507 5.1543 16.8454 5.84897 16.8454 6.7059C16.8454 7.56282 16.1507 8.2575 15.2938 8.2575Z\",\n fill: \"black\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_281\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"General Settings\"), this.dataPrepared.keyIsOk));\n }\n getSummaryTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-summary\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_309)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M17.4381 2.88241H15.4478V1.99201C15.4478 1.70394 15.1335 1.57301 14.8455 1.57301H13.3004C12.9337 0.525466 12.0171 0.00169566 10.9696 0.00169566C9.93357 -0.0372525 8.99125 0.597999 8.63881 1.57301H7.11988C6.8318 1.57301 6.54373 1.70394 6.54373 1.99201V2.88241H4.55336C3.37389 2.89499 2.40896 3.82543 2.35352 5.00365V20.0096C2.35352 21.1619 3.40106 21.9999 4.55336 21.9999H17.4381C18.5904 21.9999 19.6379 21.1619 19.6379 20.0096V5.0037C19.5825 3.82543 18.6176 2.89499 17.4381 2.88241ZM7.59122 2.62055H9.0316C9.28303 2.58987 9.48499 2.39859 9.5292 2.14916C9.68429 1.47376 10.2768 0.988934 10.9696 0.970688C11.6559 0.99149 12.2395 1.47782 12.3837 2.14916C12.4307 2.40721 12.646 2.60095 12.9075 2.62055H14.4003V4.71563H7.59122V2.62055ZM18.5904 20.0097C18.5904 20.5858 18.0142 20.9525 17.4381 20.9525H4.55336C3.97721 20.9525 3.40106 20.5858 3.40106 20.0097V5.0037C3.45449 4.40399 3.95134 3.94097 4.55336 3.93H6.54368V5.26561C6.57135 5.55905 6.82549 5.77856 7.11983 5.76322H14.8454C15.1452 5.77961 15.4073 5.56311 15.4477 5.26561V3.92995H17.438C18.04 3.94097 18.5369 4.40394 18.5903 5.00365V20.0097H18.5904Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 11.7102C8.78397 11.5031 8.45785 11.4914 8.24712 11.684L6.57104 13.2815L5.86396 12.5482C5.66751 12.3411 5.34139 12.3295 5.13066 12.522C4.9278 12.7345 4.9278 13.0689 5.13066 13.2815L6.20437 14.3814C6.2973 14.4855 6.43154 14.543 6.57099 14.5385C6.70914 14.5366 6.84092 14.4801 6.93762 14.3814L8.98031 12.4435C9.18282 12.2577 9.19636 11.9429 9.01054 11.7404C9.00102 11.7299 8.99094 11.7198 8.98041 11.7102Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 12.8359H10.473C10.1837 12.8359 9.94922 13.0704 9.94922 13.3597C9.94922 13.649 10.1837 13.8835 10.473 13.8835H16.4963C16.7856 13.8835 17.0201 13.649 17.0201 13.3597C17.0201 13.0704 16.7856 12.8359 16.4963 12.8359Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 7.51681C8.78397 7.30973 8.45785 7.29805 8.24712 7.49064L6.57104 9.08812L5.86396 8.35482C5.66751 8.14775 5.34139 8.13607 5.13066 8.32865C4.9278 8.54119 4.9278 8.87558 5.13066 9.08812L6.20437 10.188C6.2973 10.2921 6.43154 10.3496 6.57099 10.3452C6.70914 10.3432 6.84092 10.2867 6.93762 10.188L8.98031 8.2501C9.18282 8.06434 9.19636 7.74954 9.01054 7.54708C9.00102 7.53651 8.99094 7.52643 8.98041 7.51681Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 8.64258H10.473C10.1837 8.64258 9.94922 8.87707 9.94922 9.16635C9.94922 9.45563 10.1837 9.69012 10.473 9.69012H16.4963C16.7856 9.69012 17.0201 9.45563 17.0201 9.16635C17.0201 8.87707 16.7856 8.64258 16.4963 8.64258Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 15.8976C8.78397 15.6906 8.45785 15.6789 8.24712 15.8715L6.57104 17.469L5.86396 16.7357C5.66751 16.5286 5.34139 16.517 5.13066 16.7095C4.9278 16.922 4.9278 17.2564 5.13066 17.469L6.20437 18.5689C6.2973 18.6729 6.43154 18.7305 6.57099 18.726C6.70914 18.7241 6.84092 18.6676 6.93762 18.5689L8.98031 16.6309C9.18282 16.4452 9.19636 16.1304 9.01054 15.9279C9.00102 15.9174 8.99094 15.9073 8.98041 15.8976Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 17.0234H10.473C10.1837 17.0234 9.94922 17.2579 9.94922 17.5472C9.94922 17.8365 10.1837 18.071 10.473 18.071H16.4963C16.7856 18.071 17.0201 17.8365 17.0201 17.5472C17.0201 17.2579 16.7856 17.0234 16.4963 17.0234Z\",\n fill: \"#1D2327\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_309\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Summary\"));\n }\n getDebugTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-debug\",\n style: {\n display: this.dataPrepared.displayDebug\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Debug\"));\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SpbctPage);\n\n//# sourceURL=webpack:///./js/src/react/components/SpbctPageTabs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nclass SpbctPage extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {\n constructor(props) {\n super(props);\n this.state = {\n date: new Date()\n };\n }\n componentDidMount() {\n jQuery('.spbc_tab_nav-summary').data('loaded', true); // Summary tab loaded by default\n jQuery('.spbc_tabs_nav_wrapper').on('click', '.spbc_tab_nav', function (event) {\n spbc_switchTab(event.currentTarget);\n });\n // Get additional params\n var params = {\n target: location.search.match(/spbc_target=(\\S*?)(&|$)/) ? location.search.match(/spbc_target=(\\S*?)(&|$)/)[1] : null,\n action: location.search.match(/spbc_action=(\\S*?)(&|$)/) ? location.search.match(/spbc_action=(\\S*?)(&|$)/)[1] : null,\n times: location.search.match(/spbc_times=(\\S*?)(&|$)/) ? location.search.match(/spbc_times=(\\S*?)(&|$)/)[1] : 3\n };\n // Legacy support\n params.target = location.search.match(/spbc_highlight=(\\S*?)(&|$)/) ? location.search.match(/spbc_highlight=(\\S*?)(&|$)/)[1] : params.target;\n params.action = location.search.search(/spbc_highlight=(\\S*?)(&|$)/) != -1 ? 'highlight' : params.action;\n\n // Get open tab form query\n var spbc_tab = document.getElementsByClassName('spbc_tab_nav-' + (location.search.match(/spbc_tab=(\\S*?)(&|$)/) ? location.search.match(/spbc_tab=(\\S*?)(&|$)/)[1] : ''))[0] || null;\n\n // TAB SWITCHING\n // Switch by URL\n if (spbc_tab) {\n\n // Switch to DEBUG\n } else if (+spbcSettings.debug) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-debug')[0];\n // Switch by DEFAULT\n } else if (+spbcSettings.wpms && !+spbcSettings.is_main_site) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-security_log')[0];\n // Switch if Key is OK and SFW is ON\n } else if (+spbcSettings.key_is_ok && +spbcSettings.secfw_enabled) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-traffic_control')[0];\n // Switch if Key is OK\n } else if (+spbcSettings.key_is_ok) {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-scanner')[0];\n // Switch if KEY IS BAD\n } else {\n spbc_tab = document.getElementsByClassName('spbc_tab_nav-settings_general')[0];\n params = {\n target: 'spbc_key',\n action: 'highlight',\n times: 3\n };\n }\n\n // Switch tab\n if (spbc_tab) spbc_switchTab(spbc_tab, params);\n var ctrlKeyDown = false;\n jQuery(document).on(\"keyup\", function (e) {\n if ((e.which || e.keyCode) == 17) ctrlKeyDown = false;\n });\n jQuery(document).on(\"keydown\", function (e) {\n if ((e.which || e.keyCode) == 116 && ctrlKeyDown) {\n e.preventDefault();\n var active_tab = jQuery('.spbc_tab_nav--active')[0];\n var tab_name = active_tab.classList[1].replace('spbc_tab_nav-', '');\n if (tab_name === 'scanner') return;\n jQuery(active_tab).data('loaded', false);\n spbc_switchTab(active_tab);\n } else if ((e.which || e.keyCode) == 17) {\n ctrlKeyDown = true;\n }\n });\n }\n render() {\n return this.getTabsHeader();\n }\n getTabsHeader() {\n //console.log(this.props);\n this.dataPrepared = {\n 'criticalCount': null,\n 'criticalDot': null,\n 'keyIsOk': null,\n 'displayDebug': null,\n 'isWPMSMainSite': false,\n 'isSecFWEnabled': true,\n 'isFsWatcherEnabled': true\n };\n this.dataPrepared.isWPMSMainSite = +this.props.data.isWPMSMainSite;\n this.dataPrepared.isSecFWEnabled = +this.props.data.isSecFWEnabled;\n this.dataPrepared.isFsWatcherEnabled = +this.props.data.isFsWatcherEnabled;\n let dot = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_ring-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_ringring\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_circle\"\n }));\n if (this.props.data.criticalCount && this.props.data.criticalCount > 0) {\n this.dataPrepared.criticalCount = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"(\", +this.props.data.criticalCount, \")\");\n this.dataPrepared.criticalDot = dot;\n }\n if (!this.props.data.keyIsOk) {\n this.dataPrepared.keyIsOk = dot;\n }\n this.dataPrepared.displayDebug = \"none\";\n if (this.props.data.showDebug === true) {\n this.dataPrepared.displayDebug = \"flex\";\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"spbc_tabs_nav_wrapper\",\n style: {\n display: \"flex\",\n flexWrap: \"wrap\"\n }\n }, this.dataPrepared.isSecFWEnabled ? this.getFirewallTab() : '', this.dataPrepared.isWPMSMainSite && this.dataPrepared.isFsWatcherEnabled ? this.getFSWTab() : '', this.dataPrepared.isWPMSMainSite ? this.getScannerTab() : '', this.getSecurityLogTab(), this.getSettingsTab(), this.getSummaryTab(), this.dataPrepared.isWPMSMainSite ? this.getDebugTab() : ''));\n }\n getFirewallTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-traffic_control spbc_tab_nav--active\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M21.3554 5.20115H18.3724C18.2553 5.03834 18.1338 4.87983 18.011 4.71986C17.3452 3.85275 16.5907 2.86993 16.1948 0.538579C16.1561 0.310717 15.9984 0.120967 15.7814 0.0413889C15.5643 -0.038232 15.3213 0.00452184 15.1444 0.153279C12.6517 2.25037 12.0335 4.01887 11.8906 5.92917C11.5892 5.49678 11.3885 4.96066 11.3885 4.55667C11.3885 4.31359 11.2517 4.09119 11.0347 3.98149C10.8178 3.87179 10.5576 3.89353 10.3618 4.0376C9.87282 4.39755 9.45165 4.78633 9.09831 5.2012H0.64453C0.288578 5.2012 0 5.48977 0 5.84573V21.3574C0 21.7134 0.288578 22.0019 0.64453 22.0019H21.3554C21.7114 22.0019 22 21.7134 22 21.3574V5.84568C22 5.48973 21.7114 5.20115 21.3554 5.20115ZM10.3436 5.75162C10.6939 6.65912 11.3952 7.53775 12.2819 7.84845C12.7006 7.99532 13.1395 7.68367 13.1395 7.24019C13.1395 5.25229 13.2941 3.74095 15.1619 1.8798C15.6459 3.7562 16.38 4.71238 16.9884 5.50486C17.6481 6.36419 18.0871 6.95939 18.0871 8.4238C18.0871 10.9116 16.0632 12.9355 13.5754 12.9355C11.6675 12.9355 9.85306 11.6267 9.26091 9.82355C8.78774 8.38264 9.18232 6.93949 10.3436 5.75162ZM15.5117 14.2246V16.8027H6.48827V14.2246H15.5117ZM6.48827 6.49026H8.2615C8.17793 6.66858 8.10363 6.85008 8.04086 7.03549C7.81772 7.69445 7.73711 8.38242 7.79765 9.06838H6.48827V6.49026ZM1.28906 6.49021H5.19921V9.06833H1.28906V6.49021ZM1.28906 10.3574H8.08253C8.4372 11.3486 9.09097 12.2534 9.94591 12.9355H1.28906V10.3574ZM1.28906 14.2246H5.19921V16.8027H1.28906V14.2246ZM10.3554 20.7128H1.28906V18.0918H10.3554V20.7128ZM20.7109 20.7128H11.6445V18.0918H20.7109V20.7128ZM20.7109 16.8027H16.8007V14.2246H20.7109V16.8027ZM20.7109 12.9355H17.217C18.0431 12.2675 18.6826 11.3777 19.0444 10.3574H20.7109V12.9355ZM20.7109 9.06833H19.3402C19.3637 8.85663 19.3762 8.64165 19.3762 8.4238C19.3762 7.62171 19.2609 7.00425 19.0759 6.49021H20.7109V9.06833Z\",\n fill: \"#1D2327\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Firewall\"));\n }\n getFSWTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-fswatcher\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_309)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M17.4381 2.88241H15.4478V1.99201C15.4478 1.70394 15.1335 1.57301 14.8455 1.57301H13.3004C12.9337 0.525466 12.0171 0.00169566 10.9696 0.00169566C9.93357 -0.0372525 8.99125 0.597999 8.63881 1.57301H7.11988C6.8318 1.57301 6.54373 1.70394 6.54373 1.99201V2.88241H4.55336C3.37389 2.89499 2.40896 3.82543 2.35352 5.00365V20.0096C2.35352 21.1619 3.40106 21.9999 4.55336 21.9999H17.4381C18.5904 21.9999 19.6379 21.1619 19.6379 20.0096V5.0037C19.5825 3.82543 18.6176 2.89499 17.4381 2.88241ZM7.59122 2.62055H9.0316C9.28303 2.58987 9.48499 2.39859 9.5292 2.14916C9.68429 1.47376 10.2768 0.988934 10.9696 0.970688C11.6559 0.99149 12.2395 1.47782 12.3837 2.14916C12.4307 2.40721 12.646 2.60095 12.9075 2.62055H14.4003V4.71563H7.59122V2.62055ZM18.5904 20.0097C18.5904 20.5858 18.0142 20.9525 17.4381 20.9525H4.55336C3.97721 20.9525 3.40106 20.5858 3.40106 20.0097V5.0037C3.45449 4.40399 3.95134 3.94097 4.55336 3.93H6.54368V5.26561C6.57135 5.55905 6.82549 5.77856 7.11983 5.76322H14.8454C15.1452 5.77961 15.4073 5.56311 15.4477 5.26561V3.92995H17.438C18.04 3.94097 18.5369 4.40394 18.5903 5.00365V20.0097H18.5904Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 11.7102C8.78397 11.5031 8.45785 11.4914 8.24712 11.684L6.57104 13.2815L5.86396 12.5482C5.66751 12.3411 5.34139 12.3295 5.13066 12.522C4.9278 12.7345 4.9278 13.0689 5.13066 13.2815L6.20437 14.3814C6.2973 14.4855 6.43154 14.543 6.57099 14.5385C6.70914 14.5366 6.84092 14.4801 6.93762 14.3814L8.98031 12.4435C9.18282 12.2577 9.19636 11.9429 9.01054 11.7404C9.00102 11.7299 8.99094 11.7198 8.98041 11.7102Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 12.8359H10.473C10.1837 12.8359 9.94922 13.0704 9.94922 13.3597C9.94922 13.649 10.1837 13.8835 10.473 13.8835H16.4963C16.7856 13.8835 17.0201 13.649 17.0201 13.3597C17.0201 13.0704 16.7856 12.8359 16.4963 12.8359Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 7.51681C8.78397 7.30973 8.45785 7.29805 8.24712 7.49064L6.57104 9.08812L5.86396 8.35482C5.66751 8.14775 5.34139 8.13607 5.13066 8.32865C4.9278 8.54119 4.9278 8.87558 5.13066 9.08812L6.20437 10.188C6.2973 10.2921 6.43154 10.3496 6.57099 10.3452C6.70914 10.3432 6.84092 10.2867 6.93762 10.188L8.98031 8.2501C9.18282 8.06434 9.19636 7.74954 9.01054 7.54708C9.00102 7.53651 8.99094 7.52643 8.98041 7.51681Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 8.64258H10.473C10.1837 8.64258 9.94922 8.87707 9.94922 9.16635C9.94922 9.45563 10.1837 9.69012 10.473 9.69012H16.4963C16.7856 9.69012 17.0201 9.45563 17.0201 9.16635C17.0201 8.87707 16.7856 8.64258 16.4963 8.64258Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 15.8976C8.78397 15.6906 8.45785 15.6789 8.24712 15.8715L6.57104 17.469L5.86396 16.7357C5.66751 16.5286 5.34139 16.517 5.13066 16.7095C4.9278 16.922 4.9278 17.2564 5.13066 17.469L6.20437 18.5689C6.2973 18.6729 6.43154 18.7305 6.57099 18.726C6.70914 18.7241 6.84092 18.6676 6.93762 18.5689L8.98031 16.6309C9.18282 16.4452 9.19636 16.1304 9.01054 15.9279C9.00102 15.9174 8.99094 15.9073 8.98041 15.8976Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 17.0234H10.473C10.1837 17.0234 9.94922 17.2579 9.94922 17.5472C9.94922 17.8365 10.1837 18.071 10.473 18.071H16.4963C16.7856 18.071 17.0201 17.8365 17.0201 17.5472C17.0201 17.2579 16.7856 17.0234 16.4963 17.0234Z\",\n fill: \"#1D2327\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_309\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"File System Watcher\"));\n }\n getScannerTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-scanner\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_209)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"mask\", {\n id: \"mask0_2972_209\",\n style: {\n maskType: \"luminance\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: \"-1\",\n y: \"0\",\n width: \"23\",\n height: \"23\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M21.9961 0.00390816H-0.00390434V22.0039H21.9961V0.00390816Z\",\n fill: \"white\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n mask: \"url(#mask0_2972_209)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M0.644533 8.38281C0.644533 12.6544 4.10734 16.1172 8.37891 16.1172C12.6505 16.1172 16.1133 12.6544 16.1133 8.38281C16.1133 4.11125 12.6505 0.648439 8.37891 0.648439C4.10734 0.648439 0.644533 4.11125 0.644533 8.38281Z\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M10.6741 6.58789L12.2422 5.80384V4.51478\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M6.07422 6.58789L4.50616 5.80384\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M12.2422 8.38281H10.9531\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.80078 8.38281H4.51172\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.80078 8.38281C5.80078 11.2305 6.95505 12.25 8.37891 12.25C9.80276 12.25 10.957 11.2305 10.957 8.38281C10.957 5.5351 9.80276 5.80469 8.37891 5.80469C6.95505 5.80469 5.80078 5.5351 5.80078 8.38281Z\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M10.7443 10.212L12.2422 10.9609V12.25\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M6.00781 10.212L4.50988 10.9609V12.25\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M9.66602 5.83594V4.51336C9.66602 3.80141 9.08886 3.2243 8.37695 3.2243C7.66505 3.2243 7.08789 3.80141 7.08789 4.51336V5.83594\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M4.50977 5.80469V4.51562\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M12.8566 14.6872L19.1511 20.9817C19.4029 21.2335 19.7327 21.3594 20.0625 21.3594C20.3923 21.3594 20.7221 21.2335 20.9739 20.9817C21.4775 20.4782 21.4775 19.6625 20.9739 19.1589L14.6794 12.8644\",\n strokeWidth: \"1.30623\",\n strokeMiterlimit: \"10\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_209\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\",\n transform: \"matrix(-1 0 0 1 22 0)\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Malware Scanner \", this.dataPrepared.criticalCount), this.dataPrepared.criticalDot));\n }\n getSecurityLogTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-security_log\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_239)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"mask\", {\n id: \"mask0_2972_239\",\n style: {\n maskType: \"luminance\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: \"0\",\n y: \"0\",\n width: \"23\",\n height: \"22\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M0.0078125 3.8147e-06H22.0078V22H0.0078125V3.8147e-06Z\",\n fill: \"white\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n mask: \"url(#mask0_2972_239)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M1.93359 14.4785H20.0664C20.7783 14.4785 21.3555 15.0557 21.3555 15.7676V20.0645C21.3555 20.7764 20.7783 21.3535 20.0664 21.3535H1.93359C1.22169 21.3535 0.644531 20.7764 0.644531 20.0645V15.7676C0.644531 15.0557 1.22169 14.4785 1.93359 14.4785Z\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M7.7832 18.8867L9.7168 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M9.7168 18.8867L7.7832 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M3.26562 18.8867L5.19922 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.19922 18.8867L3.26562 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M12.2891 18.8867L14.2227 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M14.2227 18.8867L12.2891 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.8066 18.8867L18.7402 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M18.7402 18.8867L16.8066 16.9531\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M5.41992 6.22656C5.41992 3.14154 7.92083 0.640626 11.0059 0.640626C14.0909 0.640626 16.5918 3.14154 16.5918 6.22656C16.5918 9.31159 14.0909 11.8125 11.0059 11.8125C7.92083 11.8125 5.41992 9.31159 5.41992 6.22656Z\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M11 3.2207C11.8306 3.2207 12.5039 3.89402 12.5039 4.72461V5.58398C12.5039 6.41457 11.8306 7.08789 11 7.08789C10.1694 7.08789 9.49609 6.41457 9.49609 5.58398V4.72461C9.49609 3.89402 10.1694 3.2207 11 3.2207Z\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M7.99805 10.9277V10.0929C7.99805 8.43172 9.34469 7.08508 11.0059 7.08508C12.667 7.08508 14.0137 8.43172 14.0137 10.0929V10.9277\",\n strokeWidth: \"1.2985\",\n strokeMiterlimit: \"10\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_239\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Security Log\"));\n }\n getSettingsTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-settings_general\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_281)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M11.5354 13.0716C11.2269 13.0716 10.9768 13.3217 10.9768 13.6302C10.9766 15.0762 9.80426 16.2481 8.35832 16.2479C6.91238 16.2476 5.74041 15.0753 5.74066 13.6294C5.74092 12.1836 6.91298 11.0117 8.35875 11.0117C8.66727 11.0117 8.91734 10.7616 8.91734 10.4531C8.91734 10.1446 8.66727 9.89453 8.35875 9.89453C6.29616 9.89595 4.62446 11.5676 4.62305 13.6302C4.62305 15.6933 6.29548 17.3657 8.35854 17.3657C10.4216 17.3657 12.094 15.6933 12.094 13.6302C12.094 13.3217 11.8439 13.0716 11.5354 13.0716Z\",\n fill: \"black\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M15.9784 14.9199C15.9251 14.6161 15.6356 14.4129 15.3317 14.4662L14.1625 14.6711C13.9486 14.7086 13.7759 14.8666 13.7195 15.0763C13.5948 15.539 13.4104 15.9835 13.1708 16.3985C13.0616 16.587 13.072 16.8219 13.1974 17L13.8798 17.9724C13.9752 18.1079 13.9593 18.2924 13.842 18.4094L13.1407 19.1107C13.0238 19.2279 12.8396 19.244 12.7041 19.1489L11.7318 18.4666C11.5536 18.3411 11.3187 18.3307 11.1302 18.4399C10.7152 18.6796 10.2708 18.864 9.80805 18.9886C9.59836 19.045 9.44032 19.2178 9.40285 19.4317L9.19531 20.5995C9.16691 20.7626 9.02524 20.8816 8.85973 20.8814H7.86758C7.70206 20.8816 7.56044 20.7626 7.53199 20.5995L7.32703 19.4308C7.28956 19.2169 7.13152 19.0442 6.92184 18.9878C6.45902 18.8631 6.01442 18.6787 5.59926 18.4391C5.41071 18.3298 5.17584 18.3402 4.9977 18.4657L4.02703 19.1476C3.89159 19.2431 3.70709 19.2271 3.59004 19.1098L2.88879 18.4086C2.77174 18.2916 2.75563 18.1075 2.85055 17.972L3.53289 16.9996C3.65832 16.8215 3.66876 16.5866 3.55953 16.3981C3.31981 15.9831 3.13534 15.5386 3.01082 15.0759C2.95445 14.8662 2.78167 14.7082 2.56781 14.6707L1.39906 14.4658C1.2363 14.4374 1.11745 14.2962 1.11719 14.131V13.1389C1.11702 12.9734 1.236 12.8317 1.39906 12.8033L2.56781 12.5983C2.78167 12.5609 2.95445 12.4028 3.01082 12.1931C3.13526 11.7299 3.31972 11.285 3.55953 10.8697C3.66876 10.6812 3.65832 10.4463 3.53289 10.2681L2.85098 9.29876C2.7555 9.16332 2.77149 8.97881 2.88879 8.86177L3.59047 8.16009C3.70743 8.043 3.89168 8.02706 4.02703 8.12228L4.99941 8.80462C5.17756 8.93009 5.41243 8.94049 5.60098 8.83126C6.0161 8.59162 6.4607 8.40716 6.92356 8.28255C7.13324 8.22617 7.29128 8.0534 7.32875 7.83954L7.53371 6.67079C7.58699 6.36692 7.38384 6.07739 7.07996 6.02411C6.77609 5.97083 6.48656 6.17399 6.43328 6.47786L6.28805 7.30716C5.96948 7.41239 5.65937 7.54168 5.36035 7.69388L4.6707 7.21005C4.09131 6.80236 3.30254 6.87111 2.80242 7.3729L2.09859 8.072C1.59728 8.57237 1.52874 9.36089 1.93617 9.94028L2.42 10.6299C2.26776 10.929 2.13847 11.2393 2.03328 11.5581L1.20399 11.7033C0.507118 11.8257 -0.000858177 12.4314 1.19802e-06 13.1389V14.131C-0.000901146 14.8392 0.508021 15.4454 1.2057 15.567L2.035 15.7127C2.14019 16.0313 2.26948 16.3414 2.42172 16.6404L1.93617 17.33C1.52887 17.9095 1.59758 18.698 2.09902 19.1983L2.8007 19.8996C3.30099 20.4011 4.08964 20.4696 4.66899 20.062L5.35649 19.5782C5.6555 19.7304 5.96561 19.8596 6.28418 19.9649L6.42942 20.7942C6.55179 21.4922 7.15894 22.0007 7.86758 21.9986H8.85973C9.56811 21.9995 10.1743 21.4903 10.2957 20.7925L10.4414 19.9632C10.76 19.8579 11.0701 19.7287 11.3691 19.5765L12.0592 20.0603C12.6386 20.4678 13.4273 20.399 13.9275 19.8974L14.6291 19.1958C15.1306 18.6955 15.1993 17.9069 14.792 17.3275L14.3086 16.64C14.4608 16.341 14.59 16.0308 14.6953 15.7123L15.5246 15.5666C15.8285 15.5133 16.0316 15.2238 15.9784 14.9199Z\",\n fill: \"black\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M20.9473 5.07031L20.3629 4.96805C20.2899 4.75733 20.2038 4.55138 20.1051 4.35145L20.4489 3.86719C20.803 3.3636 20.7433 2.6782 20.3075 2.2434L19.7541 1.68867C19.319 1.25194 18.6326 1.19204 18.1286 1.54688L17.6426 1.88762C17.4426 1.78888 17.2367 1.70277 17.026 1.62981L16.9254 1.04801C16.8196 0.441377 16.2925 -0.000986629 15.6768 1.65263e-06H14.8952C14.2794 -0.000771785 13.7525 0.441806 13.6469 1.04844L13.5442 1.63281C13.3335 1.70578 13.1276 1.79188 12.9276 1.89063L12.4416 1.54688C11.938 1.19273 11.2527 1.25241 10.8179 1.68824L10.2653 2.24168C9.82854 2.6767 9.76864 3.36312 10.1235 3.86719L10.4642 4.35317C10.3655 4.5531 10.2794 4.75905 10.2064 4.96977L9.62418 5.07031C9.01772 5.1761 8.5754 5.70294 8.57617 6.31856V7.10016C8.57497 7.71607 9.01742 8.24343 9.62418 8.34926L10.2081 8.45153C10.2811 8.66224 10.3672 8.86819 10.4659 9.06813L10.1248 9.5541C9.77058 10.0575 9.82987 10.7428 10.2653 11.1779L10.8179 11.7305C11.2527 12.1666 11.9384 12.2262 12.4421 11.8718L12.9293 11.5311C13.1293 11.6298 13.3352 11.7159 13.5459 11.7889L13.6486 12.3733C13.7544 12.9797 14.2813 13.4221 14.8969 13.4213H15.6785C16.2943 13.4213 16.8207 12.978 16.9254 12.3711L17.0277 11.7872C17.2384 11.7142 17.4444 11.6281 17.6443 11.5294L18.1286 11.8723C18.6326 12.2273 19.3191 12.1674 19.7541 11.7305L20.3071 11.1775C20.7426 10.7427 20.8025 10.0577 20.4489 9.5541L20.1073 9.06641C20.206 8.86643 20.2921 8.66053 20.3651 8.44981L20.9495 8.34711C21.5546 8.24072 21.9958 7.715 21.9957 7.10059V6.31899C21.9967 5.70307 21.5541 5.17593 20.9473 5.07031ZM20.8786 7.10188C20.8786 7.17479 20.8262 7.23714 20.7544 7.24969L19.8331 7.41125C19.6193 7.44872 19.4465 7.60676 19.3901 7.81645C19.2946 8.1712 19.1531 8.51194 18.9695 8.83008C18.8602 9.01863 18.8706 9.25349 18.9961 9.43164L19.5336 10.1982C19.5757 10.2579 19.5686 10.3392 19.5169 10.3907L18.9643 10.9433C18.9122 10.9933 18.8318 10.9991 18.7731 10.957L18.0052 10.4199C17.8271 10.2945 17.5922 10.2841 17.4037 10.3933C17.0855 10.577 16.7448 10.7184 16.39 10.8139C16.1808 10.871 16.0235 11.0441 15.9866 11.2578L15.825 12.1791C15.8125 12.2509 15.7501 12.3033 15.6772 12.3032H14.8952C14.8222 12.3033 14.7599 12.2509 14.7473 12.1791L14.5854 11.2578C14.5479 11.044 14.3898 10.8712 14.1802 10.8148C13.8253 10.7192 13.4844 10.5778 13.1661 10.3941C12.9775 10.2849 12.7427 10.2953 12.5645 10.4208L11.8001 10.957C11.7404 10.9991 11.6591 10.992 11.6076 10.9403L11.055 10.3877C11.0034 10.3362 10.9963 10.2549 11.0383 10.1952L11.5758 9.42863C11.7013 9.25049 11.7117 9.01562 11.6025 8.82707C11.4187 8.50897 11.2773 8.16819 11.1818 7.81344C11.1246 7.60435 10.9516 7.44722 10.7379 7.41039L9.81668 7.24883C9.74488 7.23628 9.69246 7.17394 9.6925 7.10102L9.69293 6.31899C9.69289 6.24607 9.74531 6.18372 9.81711 6.17117L10.7379 6.00918C10.9518 5.97171 11.1246 5.81367 11.1809 5.60399C11.2765 5.24924 11.4179 4.90849 11.6016 4.59035C11.7108 4.40181 11.7004 4.16694 11.575 3.98879L11.0387 3.22266C10.9967 3.16297 11.0038 3.08168 11.0555 3.03016L11.6085 2.47715C11.66 2.42546 11.7413 2.41837 11.801 2.46039L12.5671 2.99793C12.7453 3.12336 12.9801 3.1338 13.1687 3.02457C13.4868 2.84084 13.8276 2.69943 14.1823 2.60391C14.392 2.54753 14.55 2.37476 14.5875 2.1609L14.7491 1.23965C14.7622 1.16914 14.8234 1.11783 14.8952 1.11719H15.6768C15.7497 1.11715 15.812 1.16957 15.8246 1.24137L15.9861 2.16262C16.0236 2.37647 16.1816 2.54925 16.3913 2.60563C16.7461 2.7011 17.0869 2.84251 17.405 3.02629C17.5935 3.13552 17.8284 3.12512 18.0065 2.99965L18.7731 2.46211C18.8328 2.42009 18.9141 2.42718 18.9656 2.47887L19.5186 3.03188C19.5688 3.08361 19.5751 3.1637 19.5336 3.22266L18.9961 3.99051C18.8706 4.16866 18.8602 4.40353 18.9695 4.59207C19.1531 4.91021 19.2946 5.25096 19.3901 5.60571C19.4465 5.81539 19.6193 5.97343 19.8331 6.0109L20.7544 6.17246C20.8262 6.18501 20.8786 6.24736 20.8786 6.32028V7.10188Z\",\n fill: \"black\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M15.2938 4.03711C13.8199 4.03711 12.625 5.23198 12.625 6.7059C12.6267 8.17912 13.8206 9.37301 15.2938 9.37469C16.7677 9.37469 17.9626 8.17981 17.9626 6.7059C17.9626 5.23198 16.7677 4.03711 15.2938 4.03711ZM15.2938 8.2575C14.4369 8.2575 13.7422 7.56282 13.7422 6.7059C13.742 5.84854 14.4364 5.15309 15.2938 5.15215V5.1543C16.1507 5.1543 16.8454 5.84897 16.8454 6.7059C16.8454 7.56282 16.1507 8.2575 15.2938 8.2575Z\",\n fill: \"black\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_281\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"General Settings\"), this.dataPrepared.keyIsOk));\n }\n getSummaryTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-summary\",\n style: {\n display: \"flex\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"g\", {\n clipPath: \"url(#clip0_2972_309)\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M17.4381 2.88241H15.4478V1.99201C15.4478 1.70394 15.1335 1.57301 14.8455 1.57301H13.3004C12.9337 0.525466 12.0171 0.00169566 10.9696 0.00169566C9.93357 -0.0372525 8.99125 0.597999 8.63881 1.57301H7.11988C6.8318 1.57301 6.54373 1.70394 6.54373 1.99201V2.88241H4.55336C3.37389 2.89499 2.40896 3.82543 2.35352 5.00365V20.0096C2.35352 21.1619 3.40106 21.9999 4.55336 21.9999H17.4381C18.5904 21.9999 19.6379 21.1619 19.6379 20.0096V5.0037C19.5825 3.82543 18.6176 2.89499 17.4381 2.88241ZM7.59122 2.62055H9.0316C9.28303 2.58987 9.48499 2.39859 9.5292 2.14916C9.68429 1.47376 10.2768 0.988934 10.9696 0.970688C11.6559 0.99149 12.2395 1.47782 12.3837 2.14916C12.4307 2.40721 12.646 2.60095 12.9075 2.62055H14.4003V4.71563H7.59122V2.62055ZM18.5904 20.0097C18.5904 20.5858 18.0142 20.9525 17.4381 20.9525H4.55336C3.97721 20.9525 3.40106 20.5858 3.40106 20.0097V5.0037C3.45449 4.40399 3.95134 3.94097 4.55336 3.93H6.54368V5.26561C6.57135 5.55905 6.82549 5.77856 7.11983 5.76322H14.8454C15.1452 5.77961 15.4073 5.56311 15.4477 5.26561V3.92995H17.438C18.04 3.94097 18.5369 4.40394 18.5903 5.00365V20.0097H18.5904Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 11.7102C8.78397 11.5031 8.45785 11.4914 8.24712 11.684L6.57104 13.2815L5.86396 12.5482C5.66751 12.3411 5.34139 12.3295 5.13066 12.522C4.9278 12.7345 4.9278 13.0689 5.13066 13.2815L6.20437 14.3814C6.2973 14.4855 6.43154 14.543 6.57099 14.5385C6.70914 14.5366 6.84092 14.4801 6.93762 14.3814L8.98031 12.4435C9.18282 12.2577 9.19636 11.9429 9.01054 11.7404C9.00102 11.7299 8.99094 11.7198 8.98041 11.7102Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 12.8359H10.473C10.1837 12.8359 9.94922 13.0704 9.94922 13.3597C9.94922 13.649 10.1837 13.8835 10.473 13.8835H16.4963C16.7856 13.8835 17.0201 13.649 17.0201 13.3597C17.0201 13.0704 16.7856 12.8359 16.4963 12.8359Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 7.51681C8.78397 7.30973 8.45785 7.29805 8.24712 7.49064L6.57104 9.08812L5.86396 8.35482C5.66751 8.14775 5.34139 8.13607 5.13066 8.32865C4.9278 8.54119 4.9278 8.87558 5.13066 9.08812L6.20437 10.188C6.2973 10.2921 6.43154 10.3496 6.57099 10.3452C6.70914 10.3432 6.84092 10.2867 6.93762 10.188L8.98031 8.2501C9.18282 8.06434 9.19636 7.74954 9.01054 7.54708C9.00102 7.53651 8.99094 7.52643 8.98041 7.51681Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 8.64258H10.473C10.1837 8.64258 9.94922 8.87707 9.94922 9.16635C9.94922 9.45563 10.1837 9.69012 10.473 9.69012H16.4963C16.7856 9.69012 17.0201 9.45563 17.0201 9.16635C17.0201 8.87707 16.7856 8.64258 16.4963 8.64258Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M8.98041 15.8976C8.78397 15.6906 8.45785 15.6789 8.24712 15.8715L6.57104 17.469L5.86396 16.7357C5.66751 16.5286 5.34139 16.517 5.13066 16.7095C4.9278 16.922 4.9278 17.2564 5.13066 17.469L6.20437 18.5689C6.2973 18.6729 6.43154 18.7305 6.57099 18.726C6.70914 18.7241 6.84092 18.6676 6.93762 18.5689L8.98031 16.6309C9.18282 16.4452 9.19636 16.1304 9.01054 15.9279C9.00102 15.9174 8.99094 15.9073 8.98041 15.8976Z\",\n fill: \"#1D2327\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n d: \"M16.4963 17.0234H10.473C10.1837 17.0234 9.94922 17.2579 9.94922 17.5472C9.94922 17.8365 10.1837 18.071 10.473 18.071H16.4963C16.7856 18.071 17.0201 17.8365 17.0201 17.5472C17.0201 17.2579 16.7856 17.0234 16.4963 17.0234Z\",\n fill: \"#1D2327\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"clipPath\", {\n id: \"clip0_2972_309\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"rect\", {\n width: \"22\",\n height: \"22\",\n fill: \"white\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Summary\"));\n }\n getDebugTab() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", {\n className: \"spbc_tab_nav spbc_tab_nav-debug\",\n style: {\n display: this.dataPrepared.displayDebug\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n marginLeft: \"5px\"\n }\n }, \"Debug\"));\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SpbctPage);\n\n//# sourceURL=webpack:///./js/src/react/components/SpbctPageTabs.js?"); /***/ }), diff --git a/js/src/react/components/SpbctPageTabs.js b/js/src/react/components/SpbctPageTabs.js index 2bce63ff2..1e9abdcb7 100644 --- a/js/src/react/components/SpbctPageTabs.js +++ b/js/src/react/components/SpbctPageTabs.js @@ -93,10 +93,12 @@ class SpbctPage extends React.Component{ 'displayDebug': null, 'isWPMSMainSite': false, 'isSecFWEnabled': true, + 'isFsWatcherEnabled': true, }; this.dataPrepared.isWPMSMainSite = +this.props.data.isWPMSMainSite; this.dataPrepared.isSecFWEnabled = +this.props.data.isSecFWEnabled; + this.dataPrepared.isFsWatcherEnabled = +this.props.data.isFsWatcherEnabled; let dot =
; @@ -118,7 +120,7 @@ class SpbctPage extends React.Component{ {/*
*/}
{this.dataPrepared.isSecFWEnabled ? this.getFirewallTab() : ''} - {this.dataPrepared.isWPMSMainSite ? this.getFSWTab() : ''} + {this.dataPrepared.isWPMSMainSite && this.dataPrepared.isFsWatcherEnabled ? this.getFSWTab() : ''} {this.dataPrepared.isWPMSMainSite ? this.getScannerTab() : ''} {this.getSecurityLogTab()} {this.getSettingsTab()} diff --git a/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerRenew.php b/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerRenew.php index 8c1c2b9c1..ffe3e2145 100644 --- a/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerRenew.php +++ b/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerRenew.php @@ -36,13 +36,16 @@ public function __construct(AdminBannersHandler $banners_handler) $this->banners_handler = $banners_handler; $this->banner_id = $this->prefix . $this::NAME . '_' . $this->banners_handler->getUserId(); + $utm_marks = 'cp_mode=security&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security'; + $link = 'https://p.cleantalk.org/?account=undefined¤cy=USD&domains=&extra=true&featured=&fua=true&period=Year&period_interval=3&product_id=4&renew=true&tariff_id=191&user_token=' . $banners_handler->getUserToken() . $utm_marks; + $this->template_data = array( 'button' => '', - 'link' => $spbc->data["wl_mode_enabled"] ? $spbc->data["wl_url"] : - 'https://cleantalk.org/my/bill/security?cp_mode=security&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security&user_token=' - . $banners_handler->getUserToken(), + 'link' => $spbc->data["wl_mode_enabled"] + ? $spbc->data["wl_url"] + : $link, 'plugin_settings_link' => $this->banners_handler->getPluginSettingsLink(), 'title' => esc_html__('Please renew your security license.', 'security-malware-firewall'), 'subtitle' => esc_html__('Account status updates every hour or click Settings -> ' . $spbc->data["wl_brandname"] . ' -> Synchronize with Cloud.', 'security-malware-firewall'), diff --git a/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerTrial.php b/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerTrial.php index 85dc88774..2de742cac 100644 --- a/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerTrial.php +++ b/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerTrial.php @@ -43,13 +43,17 @@ public function __construct(AdminBannersHandler $banners_handler) $this->banners_handler = $banners_handler; $this->banner_id = $this->prefix . $this::NAME . '_' . $this->banners_handler->getUserId(); + $utm_marks = 'cp_mode=security&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security'; + $link = 'https://p.cleantalk.org/?account=undefined¤cy=USD&domains=&extra=true&featured=&fua=true&period=Year&period_interval=3&product_id=4&renew=true&tariff_id=191&user_token=' . $banners_handler->getUserToken() . $utm_marks; + + $this->template_data = array( 'button' => '', - 'link' => $spbc->data["wl_mode_enabled"] ? $spbc->data["wl_support_url"] : - 'https://cleantalk.org/my/bill/security?cp_mode=security&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security&user_token=' - . $banners_handler->getUserToken(), + 'link' => $spbc->data["wl_mode_enabled"] + ? $spbc->data["wl_support_url"] + : $link, 'plugin_settings_link' => $this->banners_handler->getPluginSettingsLink(), 'title' => esc_html__( 'Trial period is now over, please upgrade to premium version to keep your site secure and safe!', diff --git a/lib/CleantalkSP/SpbctWP/Escape.php b/lib/CleantalkSP/SpbctWP/Escape.php index f163ca162..0681b58be 100644 --- a/lib/CleantalkSP/SpbctWP/Escape.php +++ b/lib/CleantalkSP/SpbctWP/Escape.php @@ -90,7 +90,7 @@ public static function escKses($string, $allowed_html, $allowed_protocols = arra return wp_kses($string, $allowed_html, $allowed_protocols = array()); } - public static function escKsesPreset($string, $preset = null, $_allowed_protocols = array()) + public static function escKsesPreset($string, $preset = null, $_allowed_protocols = array(), $allowed_style_props = array()) { $kses_presets = array( @@ -100,6 +100,29 @@ public static function escKsesPreset($string, $preset = null, $_allowed_protocol 'href' => true, ), ), + 'spbc_settings__feature_restrictions' => array( + 'a' => array( + 'target' => true, + 'href' => true, + ), + 'li' => [ + 'class' => 1, + ], + 'ul' => [ + 'style' => 1, + ], + 'div' => [ + 'style' => 1, + ], + 'h3' => [ + 'style' => 1, + ], + 'input' => [ + 'type' => 1, + 'class' => 1, + 'value' => 1, + ], + ), 'spbc_cdn_checker_table' => array( 'a' => array( 'style' => true, @@ -132,8 +155,7 @@ public static function escKsesPreset($string, $preset = null, $_allowed_protocol 'div' => array( 'class' => true, ), - 'p' => array( - ), + 'p' => array(), 'img' => array( 'src' => true, 'alt' => true, @@ -142,6 +164,13 @@ public static function escKsesPreset($string, $preset = null, $_allowed_protocol ) ); + add_filter('safe_style_css', function ($styles) use ($allowed_style_props) { + foreach ( $allowed_style_props as $prop ) { + $styles[] = $prop; + } + return $styles; + }); + if ( !empty($kses_presets[$preset]) ) { $allowed_html = $kses_presets[$preset]; return self::escKses($string, $allowed_html, $allowed_protocols = array()); diff --git a/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestriction.php b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestriction.php new file mode 100644 index 000000000..6341381ed --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestriction.php @@ -0,0 +1,32 @@ +name = $name; + $this->on_moderate_fail = isset($on_moderate_fail) ? (bool) $on_moderate_fail : false; + $this->on_key_fail = isset($on_key_fail) ? (bool) $on_key_fail : false; + } +} diff --git a/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionService.php b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionService.php new file mode 100644 index 000000000..5e7403dd6 --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionService.php @@ -0,0 +1,91 @@ +restrictions = $this->initRestrictions(); + } + + /** + * @return FeatureRestriction[] + */ + public function initRestrictions() + { + $restrictions[] = new FeatureRestriction('firewall_log', true, true); + $restrictions[] = new FeatureRestriction('scanner', true, true); + $restrictions[] = new FeatureRestriction('security_log', true, true); + $restrictions[] = new FeatureRestriction('fswatcher', true, true); + $restrictions[] = new FeatureRestriction('backups', true, true); + return $restrictions; + } + + + /** + * Get the state of a feature for the given SPBC state and feature name. + * + * @param State $spbc Global SPBC State object + * @param string $feature_name The name of the feature. + * @return FeatureRestrictionState The state of the feature. + * @throws \Exception If called restriction name is not registered + * @psalm-suppress PossiblyUnusedMethod + */ + public function getState($spbc, $feature_name) + { + $result = new FeatureRestrictionState(); + + $current_feature_restrictions = $this->getRestrictionByName($feature_name); + + if ( !$current_feature_restrictions) { + throw new \Exception(__CLASS__ . ' error: Feature restriction name is not registered! ' . $feature_name); + } + + if ( ! $spbc->key_is_ok ) { + if ($current_feature_restrictions->on_key_fail) { + $result->is_active = false; + $result->info_html = FeatureRestrictionView::keyNotValid(); + } + } elseif ( ! $spbc->moderate ) { + if ( $current_feature_restrictions->on_moderate_fail ) { + $result->is_active = false; + if ( $spbc->data['key_changed'] ) { + // Here we need to check if the key was changed and the plugin is waiting for the sync. + $result->info_html = FeatureRestrictionView::waitForSync(); + } else { + $result->info_html = FeatureRestrictionView::renewNotice(); + } + } + } + return $result; + } + + + /** + * Get the restriction by name. + * + * @param string $name The name of the restriction to retrieve. + * + * @return FeatureRestriction|false The found restriction object if the name matches, or false if no restriction was found. + */ + private function getRestrictionByName($name) + { + foreach ($this->restrictions as $restriction) { + if ($restriction->name === $name) { + return $restriction; + } + } + return false; + } +} diff --git a/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionState.php b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionState.php new file mode 100644 index 000000000..22e943691 --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionState.php @@ -0,0 +1,53 @@ +is_active = isset($is_active) ? (bool) $is_active : true; + $this->info_html = isset($info_html) ? $info_html : ''; + } + + /** + * Sanitizes and escapes HTML output. + * + * This method uses the escKsesPreset() function from the Escape class + * to sanitize and escape the given HTML output. + * + * @return string The sanitized and escaped HTML output. + * @psalm-suppress PossiblyUnusedMethod + */ + public function sanitizedReasonOutput() + { + return \CleantalkSP\SpbctWP\Escape::escKsesPreset( + $this->info_html, + 'spbc_settings__feature_restrictions', + array(), + array('display') + ); + } +} diff --git a/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionView.php b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionView.php new file mode 100644 index 000000000..e8fb2f527 --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionView.php @@ -0,0 +1,99 @@ +

' + . __('Plugin does not work until you enter the Access key in ', 'security-malware-firewall') + . '' + . __('General settings', 'security-malware-firewall') + . '.

'; + } + + /** + * Wait for synchronization to complete. + * + * This method displays a message asking the user to wait a few seconds while the account data is being pulled from the cloud. + * + * @return string The HTML markup for the message. + */ + public static function waitForSync() + { + return '
' + . '

' . __('Please give us a few seconds to pull account data from the cloud.', 'security-malware-firewall') . '

' . + '
'; + } + + /** + * Display a renewal notice. + * + * This method generates an HTML markup for a renewal notice. + * + * @return string The HTML markup for the renewal notice. + */ + public static function renewNotice() + { + global $spbc; + $renew_text = __('Renew your license, unlock all Security features and join to 20k+ WordPress users who trust CleanTalk!', 'security-malware-firewall'); + $button_text = __('Renew Security license', 'security-malware-firewall'); + $utm_marks = '&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security'; + $renew_link = 'https://p.cleantalk.org/?account=undefined¤cy=USD&domains=&extra=true&featured=&fua=true&period=Year&period_interval=3&product_id=4&renew=true&tariff_id=191&user_token=' . $spbc->user_token . $utm_marks; + $features_list_template = '
    +
  • %s
  • +
  • %s
  • +
  • %s
  • +
  • %s
  • +
  • %s
  • +
  • %s
  • +
  • %s
  • +
+ '; + $features_list_template = sprintf( + $features_list_template, + __('Daily, background Malware scans. Immediate notifications.', 'security-malware-firewall'), + __('Security FireWall by IPs, Subnets, Countries.', 'security-malware-firewall'), + __('Web Application FireWall.', 'security-malware-firewall'), + __('Brute Force protection & User Actions Log (Audit).', 'security-malware-firewall'), + __('Weekly security report', 'security-malware-firewall'), + __('Site Security logs up to 45 days.', 'security-malware-firewall'), + __('Tech Support 24/7.', 'security-malware-firewall') + ); + $notice_template = ' +
+
+

%s

+
+
+ + + +
+
+ %s +
+
+ '; + return sprintf( + $notice_template, + $renew_text, + $renew_link, + $button_text, + $features_list_template + ); + } +} diff --git a/lib/CleantalkSP/SpbctWP/State.php b/lib/CleantalkSP/SpbctWP/State.php index 3d4d9c085..d799a828f 100644 --- a/lib/CleantalkSP/SpbctWP/State.php +++ b/lib/CleantalkSP/SpbctWP/State.php @@ -15,6 +15,8 @@ * */ +use CleantalkSP\SpbctWP\FeatureRestriction\FeatureRestrictionService; + /** * @property mixed data * @property mixed settings @@ -303,6 +305,11 @@ class State extends \CleantalkSP\Common\State 'total_site_themes_count' => 0, ); + /** + * @var FeatureRestrictionService + */ + public $feature_restrictions; + /** * Additional action with options * Set something depending on something @@ -371,6 +378,8 @@ protected function init() $this->data['site_utc_offset_in_seconds'] = (current_time('timestamp') - time()); $this->data['wl_company_name'] = $this->data["wl_mode_enabled"] ? $this->data["wl_brandname"] : $this->default_data['wl_company_name']; + + $this->feature_restrictions = new FeatureRestriction\FeatureRestrictionService(); } /** diff --git a/lib/CleantalkSP/SpbctWP/Views/Settings.php b/lib/CleantalkSP/SpbctWP/Views/Settings.php index 1b77f9c07..da3038eaa 100644 --- a/lib/CleantalkSP/SpbctWP/Views/Settings.php +++ b/lib/CleantalkSP/SpbctWP/Views/Settings.php @@ -23,6 +23,7 @@ public static function tabs() "displayDebug" => $display_debug, "isWPMSMainSite" => is_main_site(), "isSecFWEnabled" => $spbc->settings['secfw__enabled'], + "isFsWatcherEnabled" => $spbc->settings['scanner__fs_watcher'], ]; echo '
'; @@ -99,7 +100,13 @@ private static function getPremiumLink() $link = ''; if ($spbc->data['license_trial'] == 1 && ! empty($spbc->user_token) && ! $spbc->data["wl_mode_enabled"] ) { - $url = $spbc->data["wl_mode_enabled"] ? $spbc->data["wl_support_url"] : 'https://cleantalk.org/my/bill/security?user_token=' . $spbc->user_token; + $utm_marks = '&utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20trial_security'; + $link = 'https://p.cleantalk.org/?account=undefined¤cy=USD&domains=&extra=true&featured=&fua=true&period=Year&period_interval=3&product_id=4&renew=true&tariff_id=191&user_token=' . $spbc->user_token . $utm_marks; + + $url = $spbc->data["wl_mode_enabled"] + ? $spbc->data["wl_support_url"] + : $link; + $link = __('Make it right!', 'cleantalk') . sprintf( __(' %sGet premium%s', 'cleantalk'), diff --git a/security-malware-firewall.php b/security-malware-firewall.php index ec288bbdc..057169ec6 100644 --- a/security-malware-firewall.php +++ b/security-malware-firewall.php @@ -193,7 +193,7 @@ // FireWall if ( ! $spbc->fw_stats['is_on_maintenance'] - && $spbc->moderate // Plugin is enabled + && $spbc->feature_restrictions->getState($spbc, 'firewall_log')->is_active && isset($spbc->fw_stats['last_updated'], $spbc->fw_stats['entries']) // Plugin's FW base is updated && ! CleantalkSP\SpbctWP\Firewall::isException() && (( ! is_admin() // Not admin area @@ -342,7 +342,7 @@ function spbc_change_author_name($link, $_author_id, $_author_nicename) ! SpbcRemoteCalls::check() && $spbc_cron->execute(); unset($spbc_cron); -if ($spbc->settings['scanner__fs_watcher']) { +if ($spbc->feature_restrictions->getState($spbc, 'fswatcher')->is_active && $spbc->settings['scanner__fs_watcher']) { $fswatch_params = array( 'dir_to_watch' => ABSPATH, 'exclude_dirs' => array(), diff --git a/tests/Tests/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionServiceTest.php b/tests/Tests/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionServiceTest.php new file mode 100644 index 000000000..019b8f6e0 --- /dev/null +++ b/tests/Tests/CleantalkSP/SpbctWP/FeatureRestriction/FeatureRestrictionServiceTest.php @@ -0,0 +1,105 @@ +state = $this->createMock(State::class); + $this->featureRestrictionService = new FeatureRestrictionService(); + } + + /** + * @test + * Description: When SPBC state key is not valid and current feature restriction is on key fail + */ + public function getState_whenSpbcKeyIsNotOkayAndCurrentFeatureRestrictionOnKeyFail() + { + $this->state->key_is_ok = false; + + $featureRestriction = new FeatureRestriction('firewall_log', true, true); + $this->featureRestrictionService->restrictions[] = $featureRestriction; + + $result = $this->featureRestrictionService->getState($this->state, 'firewall_log'); + + $this->assertFalse($result->is_active); + } + + /** + * @test + * Description: When SPBC state key is valid and moderate state is off and current feature restriction is on moderate fail + */ + public function getState_whenSpbcKeyIsOkayAndModerateStateIsOffAndOnModerateFail() + { + $this->state->key_is_ok = true; + $this->state->moderate = false; + $this->state->notice_show = false; + + $featureRestriction = new FeatureRestriction('firewall_log', true, true); + $this->featureRestrictionService->restrictions[] = $featureRestriction; + + $result = $this->featureRestrictionService->getState($this->state, 'firewall_log'); + + $this->assertFalse($result->is_active); + } + + public function testSPBCRestrictions() + { + $spbc = new State( + 'spbc', + array( + 'settings', + 'data', + 'remote_calls', + 'debug', + 'installing', + 'errors', + 'fw_stats' + ), + is_multisite(), + is_main_site() + ); + $spbc->moderate = 1; + $spbc->key_is_ok = 1; + $this->assertTrue($spbc->feature_restrictions->getState($spbc, 'firewall_log')->is_active); + $this->assertTrue($spbc->feature_restrictions->getState($spbc, 'security_log')->is_active); + $this->assertTrue($spbc->feature_restrictions->getState($spbc, 'scanner')->is_active); + $this->assertTrue($spbc->feature_restrictions->getState($spbc, 'fswatcher')->is_active); + + $spbc->moderate = 0; + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'firewall_log')->is_active); + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'security_log')->is_active); + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'scanner')->is_active); + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'fswatcher')->is_active); + + + $spbc->moderate = 1; + $spbc->key_is_ok = 0; + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'firewall_log')->is_active); + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'security_log')->is_active); + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'scanner')->is_active); + $this->assertFalse($spbc->feature_restrictions->getState($spbc, 'fswatcher')->is_active); + + //info html + $this->assertNotEmpty($spbc->feature_restrictions->getState($spbc, 'firewall_log')->info_html); + $this->assertNotEmpty($spbc->feature_restrictions->getState($spbc, 'security_log')->info_html); + $this->assertNotEmpty($spbc->feature_restrictions->getState($spbc, 'scanner')->info_html); + $this->assertNotEmpty($spbc->feature_restrictions->getState($spbc, 'fswatcher')->info_html); + + + //wrong name + $this->expectException(\Exception::class); + $this->assertTrue($spbc->feature_restrictions->getState($spbc, 'firewall')->is_active); + $this->assertEmpty($spbc->feature_restrictions->getState($spbc, 'firewall')->info_html); + } +}