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 scan.
  *
  * @since 4.0
  *
  * @return void
  */
 public function wp_ajax_itsec_malware_request_url_scan_ajax()
 {
     if (!wp_verify_nonce(sanitize_text_field($_POST['nonce']), 'itsec_do_malware_scan')) {
         die(__('Security error!', 'it-l10n-better-wp-security'));
     }
     $module = new ITSEC_Malware();
     $module->run();
     $response = $module->one_time_scan();
     $response['nonce'] = wp_create_nonce('itsec_do_malware_scan_status');
     header('Content-Type: application/json');
     die(json_encode($response));
 }
Beispiel #3
0
<?php

// Set up Malware Admin
require_once 'class-itsec-malware-admin.php';
$itsec_malware_admin = new ITSEC_Malware_Admin();
$itsec_malware_admin->run(ITSEC_Core::get_instance());
// Set up Malware Frontend
require_once 'class-itsec-malware.php';
$itsec_malware = new ITSEC_Malware();
$itsec_malware->run();
 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;
 }
 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;
 }
 /**
  * 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'));
     }
 }