C:\xampp\htdocs\landing\wp-content\plugins\better-wp-security\core\modules\site-scanner\logs.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php

class ITSEC_Site_Scanner_Logs {
    public function 
__construct() {
        
add_filter'itsec_logs_prepare_site-scanner_entry_for_list_display', array( $this'filter_entry_for_list_display' ), 10);
        
add_filter'itsec_logs_prepare_site-scanner_entry_for_details_display', array( $this'filter_entry_for_details_display' ), 10);
        
add_filter'itsec_highlighted_log_site-scanner-report_notice_title', array( $this'filter_highlight_title' ), 10);
        
add_filter'itsec_highlighted_log_site-scanner-report_notice_message', array( $this'filter_highlight_message' ), 10);

        if ( 
did_action'admin_enqueue_scripts' ) ) {
            
$this->enqueue();
        } else {
            
add_action'admin_enqueue_scripts', array( $this'enqueue' ) );
        }
    }

    public function 
filter_entry_for_list_display$entry$code$code_data ) {
        
$entry['module_display'] = esc_html__'Site Scan''better-wp-security' );

        switch ( 
$code ) {
            case 
'scan':
                if ( 
'process-start' === $entry['type'] ) {
                    
$entry['description'] = esc_html__'Scan Performance''better-wp-security' );
                } else {
                    
$entry['description'] = esc_html__'Scan''better-wp-security' );
                }
                break;
            case 
'verify-scan':
                if ( 
$code_data[0] === 'invalid_secret' ) {
                    
$entry['description'] = __'Scan Verification Failed: Invalid Secret''better-wp-security' );
                } else {
                    
$entry['description'] = __'Site Verification Succeeded''better-wp-security' );
                }
                break;
            default:
                require_once( 
dirname__FILE__ ) . '/util.php' );
                
$entry['description'] = ITSEC_Site_Scanner_Util::get_scan_code_description$entry['code'] );

                if ( ! 
$entry['description'] ) {
                    
$entry['description'] = $entry['code'];
                }
        }

        return 
$entry;
    }

    public function 
filter_entry_for_details_display$details$entry$code$code_data ) {
        require_once( 
dirname__FILE__ ) . '/template.php' );

        
$entry $this->filter_entry_for_list_display$entry$code$code_data );

        
$details['module']['content']      = $entry['module_display'];
        
$details['description']['content'] = $entry['description'];

        if (
            isset( 
$entry['data']['results'] ) &&
            ( 
is_array$entry['data']['results'] ) || is_wp_error$entry['data']['results'] ) ) &&
            ! 
in_array$entry['type'], [ 'process-start''process-update''process-stop' ], true )
        ) {
            
$details['results'] = array(
                
'header'  => esc_html__'Results''better-wp-security' ),
                
'content' => ITSEC_Site_Scanner_Template::get_html$entry['data']['results'] ),
            );
        }

        return 
$details;
    }

    public function 
filter_highlight_title$title$entry ) {
        
$factory ITSEC_Modules::get_container()->get( \iThemesSecurity\Site_Scanner\Factory::class );

        
$scan $factory->for_log_item$entry );

        if ( 
is_wp_error$scan ) ) {
            return 
esc_html__'The iThemes Security site scan encountered an error.''better-wp-security' );
        }

        
$count $scan->count( \iThemesSecurity\Site_Scanner\Status::WARN );

        return 
esc_htmlsprintf(
            
_n(
                
'iThemes Security found %s issue during a site scan.',
                
'iThemes Security found %s issues during a site scan.',
                
$count,
                
'better-wp-security'
            
),
            
number_format_i18n$count )
        ) );
    }

    public function 
filter_highlight_message$title$entry ) {
        return 
sprintf(
            
esc_html__'Please %1$sreview the logs%2$s to make sure your system is secure.''better-wp-security' ),
            
'<a href="{{ $view }}">',
            
'</a>'
        
);
    }

    public function 
enqueue() {
        
wp_enqueue_script'itsec-site-scanner-scan-settings' );
        
wp_enqueue_style'itsec-core-packages-components-site-scan-results-style' );
    }
}

new 
ITSEC_Site_Scanner_Logs();
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586