Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upd. Scan. Added scan logs to pdf export file and posibility to copy scan logs to clipboard. #433

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/spbc-admin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions css/src/spbc-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,14 @@ span.green_dot{
visibility: hidden;
}

#spbc_scanner_copy_log_to_clipboard{
position: relative;
}

#spbc_scanner_copy_log_to_clipboard_hint{
display: none;
width: 200px;
position: absolute;
top: 20px;
left: 0;
}
3 changes: 3 additions & 0 deletions inc/spbc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ function ($key) {
),
'last_scan_was_just_now' => __('The last scan of this website happened just now. Files scanned: %s.', 'security-malware-firewall'),
'last_scan_was_just_now_links' => __('The last scan of this website happened just now. Files scanned: %s. Outbound links found: %s.', 'security-malware-firewall'),
'copy_log_to_clipboard_hint' => __('Copied!', 'security-malware-firewall'),
'copy_log_to_clipboard_hint_failed' => __('Failed to copy!', 'security-malware-firewall'),
'copy_log_to_clipboard_hint_unsupported' => __('Clipboard API not supported in local environment', 'security-malware-firewall'),
));

wp_localize_script('spbc-settings-js', 'spbcDescriptions', array(
Expand Down
8 changes: 3 additions & 5 deletions inc/spbc-scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2107,26 +2107,24 @@ function spbc_scanner_save_to_pdf($direct_call = false)
$pdf->AliasNbPages();

$pdf->AddPage();

$pdf->drawScanCommonStatsTable();

$pdf->Ln();

$pdf->drawScanResultsOfScanType('heuristic_results');
$pdf->drawScanResultsOfScanType('signature_results');

$pdf->Ln();

$pdf->drawFilesListByType('cure_log');

$pdf->AddPage();

$pdf->drawFilesListByType('critical_files');

$pdf->AddPage();

$pdf->drawFilesListByType('suspicious_files');

$pdf->AddPage();
$pdf->drawScanLogs();

$pdf->Output();
}

Expand Down
10 changes: 10 additions & 0 deletions inc/spbc-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,16 @@ function spbc_field_scanner()
. '<img class="spbc_preloader" src="' . SPBC_PATH . '/images/preloader.gif" />';
}

// Copy to clipboard
if (! empty($spbc->data['scanner']['last_scan'])) {
echo '<p id="spbc_scanner_copy_log_to_clipboard" class="spbc_hint spbc_hint--link spbc_hint--top_right">'
. __('Copy to clipboard', 'security-malware-firewall')
. '&nbsp;&nbsp;|&nbsp;&nbsp;'
. '<span id="spbc_scanner_copy_log_to_clipboard_hint"></span>'
. '</p>'
. '<img class="spbc_preloader" src="' . SPBC_PATH . '/images/preloader.gif" />';
}

echo '<br>';

echo spbc_bulk_actions_description();
Expand Down
Loading
Loading