| @@ -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 code-snippets-notice notice-warning" role="region"> | |
| 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> |