configs->get_value('aiowps_fcd_exclude_filetypes')) {
$reset_scan_data = true;
}
}
if (!empty($data['aiowps_fcd_exclude_files'])) {
$files = sanitize_textarea_field(trim($data['aiowps_fcd_exclude_files']));
// Get the currently saved config value and check if this has changed. If so do another scan to reset the scan data so it omits these files/dirs
if ($files != $aio_wp_security->configs->get_value('aiowps_fcd_exclude_files')) {
$reset_scan_data = true;
}
}
// Explode by end-of-line character, then trim and filter empty lines
$email_list_array = array_filter(array_map('trim', explode("\n", $data['aiowps_fcd_scan_email_address'])), 'strlen');
foreach ($email_list_array as $key => $value) {
$email_sane = sanitize_email($value);
if (!is_email($email_sane)) {
$errors[] = __('The following address was removed because it is not a valid email address:', 'all-in-one-wp-security-and-firewall') . ' ' . htmlspecialchars($value);
unset($email_list_array[$key]);
}
}
$email_address = implode("\n", $email_list_array);
if (!empty($errors)) {
$info[] = implode('
', $errors);
}
// Save all the form values to the options
$options['aiowps_enable_automated_fcd_scan'] = isset($data["aiowps_enable_automated_fcd_scan"]) ? '1' : '';
$options['aiowps_fcd_scan_frequency'] = absint($fcd_scan_frequency);
$options['aiowps_fcd_scan_interval'] = sanitize_text_field($data["aiowps_fcd_scan_interval"]);
$options['aiowps_fcd_exclude_filetypes'] = $file_types;
$options['aiowps_fcd_exclude_files'] = $files;
$options['aiowps_send_fcd_scan_email'] = isset($data["aiowps_send_fcd_scan_email"]) ? '1' : '';
$options['aiowps_fcd_scan_email_address'] = $email_address;
$this->save_settings($options);
$content['aios-file-change-info-box'] = '';
// Let's check if backup interval was set to less than 24 hours
if (isset($data["aiowps_enable_automated_fcd_scan"]) && ($fcd_scan_frequency < 24) && 0 == $data["aiowps_fcd_scan_interval"]) {
$content['aios-file-change-info-box'] = '
' . __('You have configured your file change detection scan to occur at least once daily.', 'all-in-one-wp-security-and-firewall') . '
'; $content['aios-file-change-info-box'] .= '' . __('For most websites we recommended that you choose a less frequent schedule such as once every few days, once a week or once a month.', 'all-in-one-wp-security-and-firewall') . '
'; $content['aios-file-change-info-box'] .= '' . __('Choosing a less frequent schedule will also help reduce your server load.', 'all-in-one-wp-security-and-firewall') . '
'; $content['aios-file-change-info-box'] .= '