PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.4.13
CloudSecure WP Security v1.4.13
1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 trunk 0.9.0 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 1.3.17 1.3.18 1.3.19 1.3.2 1.3.20 1.3.21 1.3.22 1.3.23 1.3.24 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8
cloudsecure-wp-security / modules / admin / server-error-table.php
cloudsecure-wp-security / modules / admin Last commit date
captcha.php 2 weeks ago common.php 2 years ago dashboard.php 1 month ago disable-access-system-file.php 9 months ago disable-author-query.php 2 years ago disable-login.php 2 years ago disable-restapi.php 2 weeks ago disable-xmlrpc.php 2 years ago login-log-table.php 4 months ago login-log.php 2 years ago login-notification.php 3 months ago rename-login-page.php 1 month ago restrict-admin-page.php 3 months ago server-error-notification.php 4 months ago server-error-table.php 1 year ago two-factor-authentication-registration.php 3 months ago two-factor-authentication.php 4 months ago unify-messages.php 2 years ago update-notice.php 1 month ago waf-table.php 1 year ago waf.php 1 month ago
server-error-table.php
87 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 if ( ! class_exists( 'WP_List_Table' ) ) {
8 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
9 }
10
11 class CloudSecureWP_Server_Error_Table extends WP_List_Table {
12
13 private $server_error_notification;
14
15 function __construct( CloudSecureWP_Server_Error_Notification $server_error_notification ) {
16 parent::__construct();
17 $this->server_error_notification = $server_error_notification;
18 }
19
20 public function prepare_items() {
21 $per_page = 50;
22 $orderby = sanitize_text_field( $_GET['orderby'] ?? 'created_at' );
23 $order = sanitize_text_field( $_GET['order'] ?? 'desc' );
24 $offset = ( $this->get_pagenum() - 1 ) * $per_page;
25 list( $this->items, $total_items ) = $this->server_error_notification->get_server_errors( $orderby, $order, $per_page, $offset );
26 $this->_column_headers = array(
27 $this->get_columns(),
28 $this->get_hidden_columns(),
29 $this->get_sortable_columns(),
30 );
31
32 $this->set_pagination_args(
33 array(
34 'total_items' => $total_items,
35 'per_page' => $per_page,
36 )
37 );
38 }
39
40 public function get_columns(): array {
41 return array(
42 'created_at' => '日時',
43 'type' => 'タイプ',
44 'message' => 'メッセージ',
45 'file' => 'ファイル',
46 'line' => '',
47 'id' => 'ID',
48 );
49 }
50
51 public function get_hidden_columns() : array {
52 return array(
53 'id',
54 );
55 }
56
57 public function get_sortable_columns(): array {
58 return array(
59 'created_at' => array( 'created_at', false ),
60 'type' => array( 'type', false ),
61 'message' => array( 'message', false ),
62 'file' => array( 'file', false ),
63 'line' => array( 'line', false ),
64 'id' => array( 'id', false ),
65 );
66 }
67
68 public function column_default( $item, $column_name ) {
69 switch ( $column_name ) {
70 case 'message':
71 if ( mb_strlen( $item[ $column_name ], 'UTF-8' ) === 65535 ) {
72 $item[ $column_name ] = $item[ $column_name ] . '...';
73 }
74 return nl2br( esc_html( $item[ $column_name ] ) );
75
76 case 'file':
77 if ( mb_strlen( $item[ $column_name ], 'UTF-8' ) === 65535 ) {
78 $item[ $column_name ] = $item[ $column_name ] . '...';
79 }
80 return esc_html( $item[ $column_name ] );
81
82 default:
83 return esc_html( $item[ $column_name ] );
84 }
85 }
86 }
87