$slug ), $args ), admin_url( 'admin.php' ) ); } /** * Stop unless the current user may manage the plugin. */ public static function guard() { if ( ! current_user_can( Plugin::capability() ) ) { wp_die( esc_html__( 'Sorry, you are not allowed to access this page.', '007aj-security-scanner-firewall' ), 403 ); } } /** * Print the result message of a previous action (fixed messages chosen by key). */ public static function messages() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display only; the key selects a fixed message. $key = isset( $_GET['ajsec_msg'] ) ? sanitize_key( wp_unslash( $_GET['ajsec_msg'] ) ) : ''; $messages = array( 'unlocked' => array( 'success', __( 'Lockout removed.', '007aj-security-scanner-firewall' ) ), 'not_locked' => array( 'warning', __( 'That IP address was not locked out.', '007aj-security-scanner-firewall' ) ), 'log_cleared' => array( 'success', __( 'Activity log cleared.', '007aj-security-scanner-firewall' ) ), 'scan_done' => array( 'success', __( 'Integrity scan finished.', '007aj-security-scanner-firewall' ) ), 'scan_error' => array( 'error', __( 'The integrity scan could not run. See the details below.', '007aj-security-scanner-firewall' ) ), ); if ( isset( $messages[ $key ] ) ) { printf( '
%2$s