PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.2.6
CloudSecure WP Security v1.2.6
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 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-notification.php
123 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 <div class="title-block mb-12">
64 <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>
65 <h1 class="title-block-title">サーバーエラー通知</h1>
66 </div>
67 <div class="title-bottom-text">
68 サーバーエラー「HTTPステータスコード500(Internal Server Error)」が発生したとき、エラーの履歴を記録し、管理�
69 にメールで通知します。<br />
70 <strong>※機能を有効にした場合のみ、エラーの履歴を記録します。</strong><br />
71 1時間以�
72 に同じタイプのエラーが発生した場合、エラーの履歴は記録しますが、メールでの通知は行いません。
73 </div>
74 <?php
75 }
76
77 /**
78 * ページコンテンツ
79 */
80 protected function page(): void {
81 ?>
82 <form method="post">
83 <div class="enabled-or-disabled">
84 <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>
85 <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>
86 </div>
87 <div class="box">
88 <div class="box-bottom">
89 <div class="box-row flex-start">
90 <div class="box-row-title not-label">
91 通知
92 </div>
93 <div class="box-row-content ">
94 <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>
95 </div>
96 </div>
97 </div>
98 </div>
99 <div id="submit-btn-area">
100 <?php $this->nonce_wp( $this->server_error_notification->get_feature_key() ); ?>
101 <?php $this->submit_button_wp(); ?>
102 </div>
103 </form>
104 <style>
105 th.column-created_at {
106 width: 180px;
107 }
108
109 th.column-type {
110 width: 200px;
111 }
112
113 th.column-line {
114 width: 64px;
115 }
116 </style>
117 <?php
118 $server_error_table = new CloudSecureWP_Server_Error_Table( $this->server_error_notification );
119 $server_error_table->prepare_items();
120 $server_error_table->display();
121 }
122 }
123