protected function get_scan_details() { require_once dirname(__FILE__) . '/class-itsec-malware-scanner.php'; require_once dirname(__FILE__) . '/class-itsec-malware-scan-results-template.php'; $results = ITSEC_Malware_Scanner::scan(); $html = ITSEC_Malware_Scan_Results_Template::get_html($results, true); return $html; }
public function filter_logger_data_column_details($details, $data) { if (is_wp_error($data) || !empty($data) && !empty($data['SCAN']['SITE'])) { // Results for Sucuri scans. require_once dirname(__FILE__) . '/class-itsec-malware-scan-results-template.php'; $details = "<div class='itsec-malware-scan-results-wrapper'>\n"; $details .= ITSEC_Malware_Scan_Results_Template::get_html($data, true); $details .= "</div>\n"; } return $details; }
public function handle_ajax_request($data) { global $itsec_globals; require_once dirname(__FILE__) . '/class-itsec-malware-scanner.php'; require_once dirname(__FILE__) . '/class-itsec-malware-scan-results-template.php'; if (!ITSEC_Core::current_user_can_manage()) { $results = new WP_Error('itsec-settings-malware-scan-insufficient-privileges', __('An error prevented the scan from completing as expected. The currently logged in user does not have sufficient permissions to run this scan. You may need to log out of the site and log back in.', 'better-wp-security')); } else { $results = ITSEC_Malware_Scanner::scan(); } ITSEC_Response::set_response(ITSEC_Malware_Scan_Results_Template::get_html($results, true)); }
/** * Define first time column * * @param array $item array of row data * * @return string formatted output * **/ function column_details($item) { $content = ''; if (!empty($item['results']) && in_array($item['results'], array('clean', 'warn', 'error'))) { // Results for Sucuri scans. require_once dirname(__FILE__) . '/class-itsec-malware-scan-results-template.php'; $content .= '<a href="itsec-log-malware-row-' . $item['count'] . '" class="dialog">' . __('Details', 'better-wp-security') . '</a>'; $content .= '<div id="itsec-log-malware-row-' . $item['count'] . '" style="display:none;">'; $content .= "<div class='itsec-malware-scan-results-wrapper'>\n"; $content .= ITSEC_Malware_Scan_Results_Template::get_html($item['data']); $content .= "</div>\n"; $content .= "</div>\n"; } else { if (isset($item['report'])) { // Results for legacy VirusTotal scans. $content .= '<a href="itsec-log-malware-row-' . $item['count'] . '" class="dialog">' . __('Details', 'better-wp-security') . '</a>'; $content .= '<div id="itsec-log-malware-row-' . $item['count'] . '" style="display:none;">'; if (isset($item['report']['resource'])) { $content .= '<strong>' . __('Resource Scanned', 'better-wp-security') . ':</strong> ' . $item['report']['resource'] . '<br />'; } if (isset($item['report']['results'])) { if (isset($item['report']['results']['total'])) { $content .= '<strong>' . __('Total Scans', 'better-wp-security') . ':</strong> ' . $item['report']['results']['total'] . '<br />'; } if (isset($item['report']['results']['positives'])) { $content .= '<strong>' . __('Problems Found', 'better-wp-security') . ':</strong> ' . $item['report']['results']['positives'] . '<br />'; } if (isset($item['report']['results']['scans'])) { $content .= '<h3>' . __('Scan Details', 'better-wp-security') . '</h3>'; $content .= '<ol class="malware_detail_list">'; foreach ($item['report']['results']['scans'] as $service => $results) { $content .= '<li class="malware_detail"><strong>' . $service . '</strong>: ' . $results['result'] . ' ' . $results['detected'] . '<br /></li>'; } $content .= '</ol>'; } } $content .= '</div>'; } } return $content; }