PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.2.5
CloudSecure WP Security v1.2.5
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 years ago common.php 2 years ago dashboard.php 2 years ago disable-author-query.php 2 years ago disable-login.php 2 years ago disable-restapi.php 2 years ago disable-xmlrpc.php 2 years ago login-log-table.php 2 years ago login-log.php 2 years ago login-notification.php 2 years ago rename-login-page.php 2 years ago restrict-admin-page.php 2 years ago server-error-notification.php 2 years ago server-error-table.php 2 years ago two-factor-authentication-registration.php 2 years ago two-factor-authentication.php 2 years ago unify-messages.php 2 years ago update-notice.php 2 years ago
server-error-table.php
69 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 array(),
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 );
48 }
49
50 public function get_sortable_columns(): array {
51 return array(
52 'created_at' => array( 'created_at' ),
53 'type' => array( 'type' ),
54 'message' => array( 'message' ),
55 'file' => array( 'file' ),
56 'line' => array( 'line' ),
57 );
58 }
59
60 public function column_default( $item, $column_name ) {
61 switch ( $column_name ) {
62 case 'message':
63 return nl2br( $item[ $column_name ] );
64 default:
65 return $item[ $column_name ];
66 }
67 }
68 }
69