PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.3.24
CloudSecure WP Security v1.3.24
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-notification.php
cloudsecure-wp-security / modules / admin Last commit date
captcha.php 1 year ago common.php 1 year ago dashboard.php 1 year ago disable-access-system-file.php 7 months ago disable-author-query.php 1 year ago disable-login.php 1 year ago disable-restapi.php 1 year ago disable-xmlrpc.php 1 year ago login-log-table.php 1 year ago login-log.php 1 year ago login-notification.php 1 year ago rename-login-page.php 1 year ago restrict-admin-page.php 1 year ago server-error-notification.php 1 year ago server-error-table.php 1 year ago two-factor-authentication-registration.php 5 months ago two-factor-authentication.php 1 year ago unify-messages.php 1 year ago update-notice.php 1 year ago waf-table.php 1 year ago waf.php 7 months ago
server-error-notification.php
129 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class CloudSecureWP_Admin_Server_Error_Notification extends CloudSecureWP_Admin_Common {
8 private $server_error_notification;
9
10 function __construct( array $info, CloudSecureWP_Server_Error_Notification $server_error_notification ) {
11 parent::__construct( $info );
12 $this->server_error_notification = $server_error_notification;
13 $this->prepare_view_data();
14 $this->render();
15 }
16
17 /**
18 * 画面表示用のデータを準備
19 */
20 public function prepare_view_data(): void {
21 $this->datas = $this->server_error_notification->get_settings();
22
23 if ( ! empty( $_POST ) && check_admin_referer( $this->server_error_notification->get_feature_key() . '_csrf' ) ) {
24
25 foreach ( $this->datas as $key => $val ) {
26
27 if ( $key === 'server_error_notification' ) {
28 $tmp = sanitize_text_field( $_POST[ $key ] ?? '' );
29 if ( ! $this->is_selected( $tmp, self::TF_VALIES ) ) {
30 $this->errors[] = '有効・無効の値が不正です';
31 }
32
33 if ( ! $this->check_environment() ) {
34 $tmp = 'f';
35 }
36
37 $this->datas[ $key ] = $tmp;
38 }
39 }
40
41 if ( empty( $this->errors ) ) {
42 if ( 't' === $this->datas['server_error_notification'] ) {
43 $this->messages[] = 'サーバーエラー通知機能が有効になりました。';
44 } else {
45 $this->messages[] = 'サーバーエラー通知機能が無効になりました。';
46 }
47
48 $enable_email_server_error_notification = sanitize_text_field( $_POST['enable_email_server_error_notification'] ?? 'f' );
49 update_option( 'cloudsecurewp_enable_email_server_error_notification', $enable_email_server_error_notification );
50
51 $this->server_error_notification->save_settings( $this->datas );
52 }
53 }
54
55 $this->datas = $this->get_checked( $this->datas, array( 'server_error_notification' ) );
56 }
57
58 /**
59 * デスクリプション
60 */
61 protected function admin_description(): void {
62 ?>
63 <nav>
64 <ul class="breadcrumb">
65 <li class="breadcrumb__list"><a href="?page=cloudsecurewp">ダッシュボード</a></li>
66 <li class="breadcrumb__list">サーバーエラー通知</li>
67 </ul>
68 </nav>
69 <div class="title-block mb-12">
70 <p class="title-block-small-text">この機能のマニュアルは<a class="title-block-link" target="_blank" href="https://wpplugin.cloudsecure.ne.jp/cloudsecure_wp_security/server_error_notification.php">こちら</a></p>
71 <h1 class="title-block-title">サーバーエラー通知</h1>
72 </div>
73 <div class="title-bottom-text">
74 サーバーエラー「HTTPステータスコード500(Internal Server Error)」が発生したとき、エラーの履歴を記録し、管理�
75 にメールで通知します。<br />
76 <strong>※機能を有効にした場合のみ、エラーの履歴を記録します。</strong><br />
77 1時間以�
78 に同じタイプのエラーが発生した場合、エラーの履歴は記録しますが、メールでの通知は行いません。
79 </div>
80 <?php
81 }
82
83 /**
84 * ページコンテンツ
85 */
86 protected function page(): void {
87 ?>
88 <form method="post">
89 <div class="enabled-or-disabled">
90 <input class="enabled-or-disabled__btn" id="enabled" type="radio" name="server_error_notification" value="t" <?php echo esc_html( $this->datas['server_error_notification_t'] ?? '' ); ?> /><label for="enabled">有効</label>
91 <input class="enabled-or-disabled__btn" id="disabled" type="radio" name="server_error_notification" value="f" <?php echo esc_html( $this->datas['server_error_notification_f'] ?? '' ); ?> /><label for="disabled">無効</label>
92 </div>
93 <div class="box">
94 <div class="box-bottom">
95 <div class="box-row flex-start">
96 <div class="box-row-title not-label">
97 通知
98 </div>
99 <div class="box-row-content ">
100 <input id="enable_email_server_error_notification" class="checkbox" type="checkbox" name="enable_email_server_error_notification" value="t" <?php checked( get_option( 'cloudsecurewp_enable_email_server_error_notification', 't' ), 't' ); ?> /><label for="enable_email_server_error_notification">メールで通知する</label>
101 </div>
102 </div>
103 </div>
104 </div>
105 <div id="submit-btn-area">
106 <?php $this->nonce_wp( $this->server_error_notification->get_feature_key() ); ?>
107 <?php $this->submit_button_wp(); ?>
108 </div>
109 </form>
110 <style>
111 th.column-created_at {
112 width: 180px;
113 }
114
115 th.column-type {
116 width: 200px;
117 }
118
119 th.column-line {
120 width: 64px;
121 }
122 </style>
123 <?php
124 $server_error_table = new CloudSecureWP_Server_Error_Table( $this->server_error_notification );
125 $server_error_table->prepare_items();
126 $server_error_table->display();
127 }
128 }
129