Skip to content

Commit 60091c7

Browse files
committed
Fix WordPress Coding Standards violations
- Fix output escaping in public/class-public.php (use esc_html__()) - Fix missing wp_unslash() before sanitization in public/class-public.php - Fix inline comment formatting (add periods) - Fix Yoda condition check in public/class-public.php - Fix output escaping in public/partials/subscribe-form.php (use esc_html_e())
1 parent 1260f1b commit 60091c7

32 files changed

Lines changed: 5539 additions & 5189 deletions

admin/class-admin.php

Lines changed: 179 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
if ( ! defined( 'ABSPATH' ) ) {
10-
exit;
10+
exit;
1111
}
1212

1313
use MSKD\Admin\Admin;
@@ -22,182 +22,182 @@
2222
*/
2323
class MSKD_Admin {
2424

25-
/**
26-
* Plugin pages prefix
27-
*/
28-
const PAGE_PREFIX = 'mskd-';
29-
30-
/**
31-
* Subscriber ID used to identify one-time emails (not associated with any subscriber)
32-
*/
33-
const ONE_TIME_EMAIL_SUBSCRIBER_ID = 0;
34-
35-
/**
36-
* The new Admin instance
37-
*
38-
* @var Admin
39-
*/
40-
private Admin $admin;
41-
42-
/**
43-
* Constructor - initialize the new Admin class
44-
*/
45-
public function __construct() {
46-
$this->admin = new Admin();
47-
}
48-
49-
/**
50-
* Initialize admin hooks
51-
* Delegates to the new Admin class
52-
*/
53-
public function init(): void {
54-
$this->admin->init();
55-
}
56-
57-
/**
58-
* Get preserved form data for one-time email
59-
*
60-
* @return array
61-
*/
62-
public function get_one_time_email_form_data(): array {
63-
return $this->admin->get_one_time_email_form_data();
64-
}
65-
66-
/**
67-
* Register admin menu and submenus
68-
* Delegates to the new Admin class
69-
*/
70-
public function register_menu(): void {
71-
$this->admin->register_menu();
72-
}
73-
74-
/**
75-
* Enqueue admin assets
76-
* Delegates to the new Admin class
77-
*
78-
* @param string $hook The current admin page hook.
79-
*/
80-
public function enqueue_assets( string $hook ): void {
81-
$this->admin->enqueue_assets( $hook );
82-
}
83-
84-
/**
85-
* Show WP-Cron warning notice
86-
* Delegates to the new Admin class
87-
*/
88-
public function show_cron_notice(): void {
89-
$this->admin->show_cron_notice();
90-
}
91-
92-
/**
93-
* Show share notice
94-
* Delegates to the new Admin class
95-
*/
96-
public function show_share_notice(): void {
97-
$this->admin->show_share_notice();
98-
}
99-
100-
/**
101-
* Handle admin actions (add, edit, delete)
102-
* Delegates to the new Admin class
103-
*/
104-
public function handle_actions(): void {
105-
$this->admin->handle_actions();
106-
}
107-
108-
/**
109-
* Render Dashboard page
110-
* Delegates to the new Admin class
111-
*/
112-
public function render_dashboard(): void {
113-
$this->admin->render_dashboard();
114-
}
115-
116-
/**
117-
* Render Subscribers page
118-
* Delegates to the new Admin class
119-
*/
120-
public function render_subscribers(): void {
121-
$this->admin->render_subscribers();
122-
}
123-
124-
/**
125-
* Render Lists page
126-
* Delegates to the new Admin class
127-
*/
128-
public function render_lists(): void {
129-
$this->admin->render_lists();
130-
}
131-
132-
/**
133-
* Render Compose page
134-
* Delegates to the new Admin class
135-
*/
136-
public function render_compose(): void {
137-
$this->admin->render_compose();
138-
}
139-
140-
/**
141-
* Render Queue page
142-
* Delegates to the new Admin class
143-
*/
144-
public function render_queue(): void {
145-
$this->admin->render_queue();
146-
}
147-
148-
/**
149-
* Render Settings page
150-
* Delegates to the new Admin class
151-
*/
152-
public function render_settings(): void {
153-
$this->admin->render_settings();
154-
}
155-
156-
/**
157-
* Render One-Time Email page
158-
* Delegates to the new Admin class
159-
*/
160-
public function render_one_time_email(): void {
161-
$this->admin->render_one_time_email();
162-
}
163-
164-
/**
165-
* AJAX handler to dismiss share notice
166-
* Delegates to the new Admin class
167-
*/
168-
public function ajax_dismiss_share_notice(): void {
169-
$this->admin->ajax_dismiss_share_notice();
170-
}
171-
172-
/**
173-
* AJAX handler for SMTP test
174-
* Delegates to the new Admin class
175-
*/
176-
public function ajax_test_smtp(): void {
177-
$this->admin->ajax_test_smtp();
178-
}
179-
180-
/**
181-
* AJAX handler: Truncate subscribers table
182-
* Delegates to the new Admin class
183-
*/
184-
public function ajax_truncate_subscribers(): void {
185-
$this->admin->ajax_truncate_subscribers();
186-
}
187-
188-
/**
189-
* AJAX handler: Truncate lists table
190-
* Delegates to the new Admin class
191-
*/
192-
public function ajax_truncate_lists(): void {
193-
$this->admin->ajax_truncate_lists();
194-
}
195-
196-
/**
197-
* AJAX handler: Truncate queue table
198-
* Delegates to the new Admin class
199-
*/
200-
public function ajax_truncate_queue(): void {
201-
$this->admin->ajax_truncate_queue();
202-
}
25+
/**
26+
* Plugin pages prefix
27+
*/
28+
const PAGE_PREFIX = 'mskd-';
29+
30+
/**
31+
* Subscriber ID used to identify one-time emails (not associated with any subscriber)
32+
*/
33+
const ONE_TIME_EMAIL_SUBSCRIBER_ID = 0;
34+
35+
/**
36+
* The new Admin instance
37+
*
38+
* @var Admin
39+
*/
40+
private Admin $admin;
41+
42+
/**
43+
* Constructor - initialize the new Admin class
44+
*/
45+
public function __construct() {
46+
$this->admin = new Admin();
47+
}
48+
49+
/**
50+
* Initialize admin hooks
51+
* Delegates to the new Admin class
52+
*/
53+
public function init(): void {
54+
$this->admin->init();
55+
}
56+
57+
/**
58+
* Get preserved form data for one-time email
59+
*
60+
* @return array
61+
*/
62+
public function get_one_time_email_form_data(): array {
63+
return $this->admin->get_one_time_email_form_data();
64+
}
65+
66+
/**
67+
* Register admin menu and submenus
68+
* Delegates to the new Admin class
69+
*/
70+
public function register_menu(): void {
71+
$this->admin->register_menu();
72+
}
73+
74+
/**
75+
* Enqueue admin assets
76+
* Delegates to the new Admin class
77+
*
78+
* @param string $hook The current admin page hook.
79+
*/
80+
public function enqueue_assets( string $hook ): void {
81+
$this->admin->enqueue_assets( $hook );
82+
}
83+
84+
/**
85+
* Show WP-Cron warning notice
86+
* Delegates to the new Admin class
87+
*/
88+
public function show_cron_notice(): void {
89+
$this->admin->show_cron_notice();
90+
}
91+
92+
/**
93+
* Show share notice
94+
* Delegates to the new Admin class
95+
*/
96+
public function show_share_notice(): void {
97+
$this->admin->show_share_notice();
98+
}
99+
100+
/**
101+
* Handle admin actions (add, edit, delete)
102+
* Delegates to the new Admin class
103+
*/
104+
public function handle_actions(): void {
105+
$this->admin->handle_actions();
106+
}
107+
108+
/**
109+
* Render Dashboard page
110+
* Delegates to the new Admin class
111+
*/
112+
public function render_dashboard(): void {
113+
$this->admin->render_dashboard();
114+
}
115+
116+
/**
117+
* Render Subscribers page
118+
* Delegates to the new Admin class
119+
*/
120+
public function render_subscribers(): void {
121+
$this->admin->render_subscribers();
122+
}
123+
124+
/**
125+
* Render Lists page
126+
* Delegates to the new Admin class
127+
*/
128+
public function render_lists(): void {
129+
$this->admin->render_lists();
130+
}
131+
132+
/**
133+
* Render Compose page
134+
* Delegates to the new Admin class
135+
*/
136+
public function render_compose(): void {
137+
$this->admin->render_compose();
138+
}
139+
140+
/**
141+
* Render Queue page
142+
* Delegates to the new Admin class
143+
*/
144+
public function render_queue(): void {
145+
$this->admin->render_queue();
146+
}
147+
148+
/**
149+
* Render Settings page
150+
* Delegates to the new Admin class
151+
*/
152+
public function render_settings(): void {
153+
$this->admin->render_settings();
154+
}
155+
156+
/**
157+
* Render One-Time Email page
158+
* Delegates to the new Admin class
159+
*/
160+
public function render_one_time_email(): void {
161+
$this->admin->render_one_time_email();
162+
}
163+
164+
/**
165+
* AJAX handler to dismiss share notice
166+
* Delegates to the new Admin class
167+
*/
168+
public function ajax_dismiss_share_notice(): void {
169+
$this->admin->ajax_dismiss_share_notice();
170+
}
171+
172+
/**
173+
* AJAX handler for SMTP test
174+
* Delegates to the new Admin class
175+
*/
176+
public function ajax_test_smtp(): void {
177+
$this->admin->ajax_test_smtp();
178+
}
179+
180+
/**
181+
* AJAX handler: Truncate subscribers table
182+
* Delegates to the new Admin class
183+
*/
184+
public function ajax_truncate_subscribers(): void {
185+
$this->admin->ajax_truncate_subscribers();
186+
}
187+
188+
/**
189+
* AJAX handler: Truncate lists table
190+
* Delegates to the new Admin class
191+
*/
192+
public function ajax_truncate_lists(): void {
193+
$this->admin->ajax_truncate_lists();
194+
}
195+
196+
/**
197+
* AJAX handler: Truncate queue table
198+
* Delegates to the new Admin class
199+
*/
200+
public function ajax_truncate_queue(): void {
201+
$this->admin->ajax_truncate_queue();
202+
}
203203
}

admin/partials/compose-wizard.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class="mskd-email-preview-iframe"
446446
<?php esc_html_e( 'Use default sender', 'mail-system-by-katsarov-design' ); ?>
447447
<span class="description">
448448
<?php
449-
$default_from = get_option( 'mskd_settings', array() );
449+
$default_from = get_option( 'mskd_settings', array() );
450450
$default_email = ! empty( $default_from['from_email'] ) ? $default_from['from_email'] : get_bloginfo( 'admin_email' );
451451
printf(
452452
esc_html__( '(%s)', 'mail-system-by-katsarov-design' ),
@@ -469,7 +469,7 @@ class="mskd-email-preview-iframe"
469469
</div>
470470
<div class="mskd-nested-form-field">
471471
<input type="email" name="from_email" id="from_email" class="regular-text"
472-
placeholder="<?php esc_attr_e( 'sender@example.com', 'mail-system-by-katsarov-design' ); ?>">
472+
placeholder="<?php esc_attr_e( 'sender@example.com', 'mail-system-by-katsarov-design' ); ?>">
473473
<p class="description">
474474
<?php esc_html_e( 'Email address that will appear as the sender of this campaign.', 'mail-system-by-katsarov-design' ); ?>
475475
</p>
@@ -481,7 +481,7 @@ class="mskd-email-preview-iframe"
481481
</div>
482482
<div class="mskd-nested-form-field">
483483
<input type="text" name="from_name" id="from_name" class="regular-text"
484-
placeholder="<?php esc_attr_e( 'Sender Name', 'mail-system-by-katsarov-design' ); ?>">
484+
placeholder="<?php esc_attr_e( 'Sender Name', 'mail-system-by-katsarov-design' ); ?>">
485485
<p class="description">
486486
<?php esc_html_e( 'Display name for the sender (optional).', 'mail-system-by-katsarov-design' ); ?>
487487
</p>

0 commit comments

Comments
 (0)