public function run($arguments) { $module = new ITSEC_Malware(); $module->run(); $response = $module->one_time_scan(); $report = $module->scan_report($response['resource']); return $report; }
/** * Executes one-time malware result retrieval. * * @since 4.0 * * @return void */ public function wp_ajax_itsec_malware_get_scan_results_ajax() { if (!wp_verify_nonce(sanitize_text_field($_POST['nonce']), 'itsec_do_malware_scan_status')) { die(__('Security error!', 'it-l10n-better-wp-security')); } $module = new ITSEC_Malware(); $module->run(); $response = $module->scan_report(); if (!isset($response['positives'])) { $response['nonce'] = wp_create_nonce('itsec_do_malware_scan_status'); } header('Content-Type: application/json'); die(json_encode($response)); }
public function malware_get_scan_results() { global $itsec_globals; if (!class_exists('ITSEC_Malware')) { require trailingslashit($itsec_globals['plugin_dir']) . 'modules/free/malware/class-itsec-malware.php'; } $module = new ITSEC_Malware(); $module->run(); $response = $module->scan_report(); return $response; }
public function malware_get_scan_results() { global $itsec_globals, $itsec_modules_path; if (!class_exists('ITSEC_Malware')) { require $itsec_modules_path . 'malware/class-itsec-malware.php'; } $module = new ITSEC_Malware(); $module->run(); $response = $module->scan_report(); return $response; }
/** * Performs a malware scan * * @since 1.12 * * @return void */ public function malwarescan() { if (!class_exists('ITSEC_Malware')) { WP_CLI::error(__('Malware scanning is not enabled. You must enable the module first.', 'it-l10n-ithemes-security-pro')); } $module = new ITSEC_Malware(); $module->run(); $response = $module->one_time_scan(); $report = $module->scan_report($response['resource']); if (!is_array($report) && $report !== false) { //Response isn't correct, throw an error WP_CLI::error(__('There was an error in the scan operation. Please check the site logs or contact support.', 'it-l10n-ithemes-security-pro')); } elseif (isset($report['positives']) && $report['positives'] > 0) { //malware was detected WP_CLI::warning(__('Issues were detected during the malware scan. Please check the logs for more information.', 'it-l10n-ithemes-security-pro')); } else { //no changes detected WP_CLI::success(__('Malware scan completed. No problems were detected.', 'it-l10n-ithemes-security-pro')); } }