Skip to content

Commit 17ec8fc

Browse files
committed
tweak inline comments
1 parent 2c37e5b commit 17ec8fc

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

classes/admin/class-page-settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function store_settings_form_options() {
133133
\wp_send_json_error( [ 'message' => \esc_html__( 'You do not have permission to update settings.', 'progress-planner' ) ] );
134134
}
135135

136-
// SECURITY FIX: Use check_ajax_referer instead of check_admin_referer for AJAX handlers.
136+
// Use check_ajax_referer instead of check_admin_referer for AJAX handlers.
137137
// check_admin_referer is designed for form submissions, not AJAX requests.
138138
if ( ! \check_ajax_referer( 'progress_planner', 'nonce', false ) ) {
139139
\wp_send_json_error( [ 'message' => \esc_html__( 'Invalid nonce.', 'progress-planner' ) ] );

classes/class-suggested-tasks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function was_task_completed( $task_id ): bool {
185185
* Primarly this is used for deeplinking, ie user is testing if the emails are working
186186
* He gets an email with a link which automatically completes the task.
187187
*
188-
* SECURITY FIX: Added token verification to prevent CSRF attacks.
188+
* Verify token to prevent CSRF attacks.
189189
* Tokens are one-time use and expire after 24 hours.
190190
*
191191
* @return void
@@ -200,7 +200,7 @@ public function maybe_complete_task() {
200200
return;
201201
}
202202

203-
// SECURITY FIX: Verify token to prevent CSRF attacks.
203+
// Verify token to prevent CSRF attacks.
204204
if ( ! isset( $_GET['token'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
205205
return;
206206
}

classes/suggested-tasks/providers/class-email-sending.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function init() {
110110

111111
$this->email_subject = \esc_html__( 'Your Progress Planner test message!', 'progress-planner' );
112112

113-
// SECURITY FIX: Generate a secure token for the completion link to prevent CSRF.
113+
// Generate a secure token for the completion link to prevent CSRF.
114114
$user_id = \get_current_user_id();
115115
$token = \progress_planner()->get_suggested_tasks()->generate_task_completion_token( $this->get_task_id(), $user_id );
116116

@@ -253,7 +253,7 @@ protected function is_there_sending_email_override() {
253253
/**
254254
* Test email sending.
255255
*
256-
* SECURITY FIX: Changed to use check_ajax_referer and get email from $_POST.
256+
* Use check_ajax_referer and get email from $_POST.
257257
*
258258
* @return void
259259
*/
@@ -263,12 +263,12 @@ public function ajax_test_email_sending() {
263263
\wp_send_json_error( [ 'message' => \esc_html__( 'You do not have permission to test email sending.', 'progress-planner' ) ] );
264264
}
265265

266-
// SECURITY FIX: Use check_ajax_referer for AJAX handlers.
266+
// Use check_ajax_referer for AJAX handlers.
267267
if ( ! \check_ajax_referer( 'progress_planner', 'nonce', false ) ) {
268268
\wp_send_json_error( [ 'message' => \esc_html__( 'Invalid nonce.', 'progress-planner' ) ] );
269269
}
270270

271-
// SECURITY FIX: Get email from POST data (AJAX request).
271+
// Get email from POST data (AJAX request).
272272
$email_address = isset( $_POST['email_address'] ) ? \sanitize_email( \wp_unslash( $_POST['email_address'] ) ) : '';
273273

274274
if ( ! $email_address ) {

classes/suggested-tasks/providers/class-tasks-interactive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function handle_interactive_task_submit() {
8888
$value = \sanitize_text_field( \wp_unslash( $_POST['value'] ) );
8989
$setting_path = \json_decode( \sanitize_text_field( \wp_unslash( $_POST['setting_path'] ) ), true );
9090

91-
// SECURITY FIX: Whitelist allowed options to prevent arbitrary options update.
91+
// Whitelist allowed options to prevent arbitrary options update.
9292
// This prevents privilege escalation by restricting which options can be updated.
9393
$allowed_options = $this->get_allowed_interactive_options();
9494

0 commit comments

Comments
 (0)