| @@ -377,9 +377,9 @@ | ||
| 377 | 377 | <span class="current-version"><?php echo esc_html( $current_version ); ?></span> |
| 378 | 378 | </p> |
| 379 | 379 | |
| 380 | 380 | <?php if ( $is_switching ) : ?> |
| 381 | - <div class="notice notice-info inline"> | |
| 381 | + <div class="notice code-snippets-notice notice-info inline"> | |
| 382 | 382 | <p><?php esc_html_e( 'Version switch in progress. Please wait…', 'code-snippets' ); ?></p> |
| 383 | 383 | </div> |
| 384 | 384 | <?php else : ?> |
| 385 | 385 | <p> |
| @@ -411,9 +411,9 @@ | ||
| 411 | 411 | <?php esc_html_e( 'Switch Version', 'code-snippets' ); ?> |
| 412 | 412 | </button> |
| 413 | 413 | </p> |
| 414 | 414 | |
| 415 | - <div id="version-switch-result" class="notice" style="display: none;"></div> | |
| 415 | + <div id="version-switch-result" class="notice code-snippets-notice" style="display: none;"></div> | |
| 416 | 416 | <?php endif; ?> |
| 417 | 417 | </div><?php |
| 418 | 418 | } |
| 419 | 419 | |
| @@ -422,9 +422,9 @@ | ||
| 422 | 422 | * |
| 423 | 423 | * @return void |
| 424 | 424 | */ |
| 425 | 425 | public static function ajax_switch_version(): void { |
| 426 | - check_ajax_referer( 'code_snippets_version_switch', sanitize_text_field( wp_unslash( $_POST['nonce'] ?? '' ) ) ); | |
| 426 | + check_ajax_referer( 'code_snippets_version_switch', 'nonce' ); | |
| 427 | 427 | |
| 428 | 428 | if ( ! current_user_can( 'update_plugins' ) ) { |
| 429 | 429 | wp_send_json_error( [ 'message' => __( 'You do not have permission to update plugins.', 'code-snippets' ) ] ); |
| 430 | 430 | } |
| @@ -461,14 +461,14 @@ | ||
| 461 | 461 | ); |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | /** |
| 465 | - * AJAX handler for refreshing the onstalled version. | |
| 465 | + * AJAX handler for refreshing the installed version. | |
| 466 | 466 | * |
| 467 | 467 | * @return void |
| 468 | 468 | */ |
| 469 | 469 | public static function ajax_refresh_versions(): void { |
| 470 | - check_ajax_referer( 'code_snippets_refresh_versions', sanitize_text_field( wp_unslash( $_POST['nonce'] ?? '' ) ) ); | |
| 470 | + check_ajax_referer( 'code_snippets_refresh_versions', 'nonce' ); | |
| 471 | 471 | |
| 472 | 472 | if ( ! code_snippets()->current_user_can() ) { |
| 473 | 473 | wp_send_json_error( [ 'message' => __( 'You do not have permission to manage options.', 'code-snippets' ) ] ); |
| 474 | 474 | } |
| @@ -485,9 +485,9 @@ | ||
| 485 | 485 | * @return void |
| 486 | 486 | */ |
| 487 | 487 | public static function render_version_switch_warning(): void { |
| 488 | 488 | ?> |
| 489 | - <div id="version-switch-warning" class="notice notice-warning" style="display: none; margin-top: 20px;"> | |
| 489 | + <div id="version-switch-warning" class="notice code-snippets-notice notice-warning hidden" role="region"> | |
| 490 | 490 | <p> |
| 491 | 491 | <strong><?php esc_html_e( 'Warning:', 'code-snippets' ); ?></strong> |
| 492 | 492 | <?php esc_html_e( 'Switching versions may cause compatibility issues. Always backup your site before switching versions.', 'code-snippets' ); ?> |
| 493 | 493 | </p> |