| @@ -165,9 +165,9 @@ | ||
| 165 | 165 | url: ajaxurl, |
| 166 | 166 | type: 'POST', |
| 167 | 167 | data: { |
| 168 | 168 | action: 'metasync_validate_robots', |
| 169 | - nonce: '<?php echo wp_create_nonce('metasync_nonce'); ?>', | |
| 169 | + nonce: '<?php echo esc_js(wp_create_nonce('metasync_nonce')); ?>', | |
| 170 | 170 | content: content |
| 171 | 171 | }, |
| 172 | 172 | success: function(response) { |
| 173 | 173 | if (response.success && response.data) { |
| @@ -279,9 +279,9 @@ | ||
| 279 | 279 | url: ajaxurl, |
| 280 | 280 | type: 'POST', |
| 281 | 281 | data: { |
| 282 | 282 | action: 'metasync_get_default_robots', |
| 283 | - nonce: '<?php echo wp_create_nonce('metasync_nonce'); ?>' | |
| 283 | + nonce: '<?php echo esc_js(wp_create_nonce('metasync_nonce')); ?>' | |
| 284 | 284 | }, |
| 285 | 285 | success: function(response) { |
| 286 | 286 | if (response.success) { |
| 287 | 287 | $('#robots-txt-editor').val(response.data.content); |
| @@ -299,9 +299,9 @@ | ||
| 299 | 299 | url: ajaxurl, |
| 300 | 300 | type: 'POST', |
| 301 | 301 | data: { |
| 302 | 302 | action: 'metasync_validate_robots', |
| 303 | - nonce: '<?php echo wp_create_nonce('metasync_nonce'); ?>', | |
| 303 | + nonce: '<?php echo esc_js(wp_create_nonce('metasync_nonce')); ?>', | |
| 304 | 304 | content: content |
| 305 | 305 | }, |
| 306 | 306 | success: function(response) { |
| 307 | 307 | const $results = $('#validation-results'); |
| @@ -359,9 +359,9 @@ | ||
| 359 | 359 | url: ajaxurl, |
| 360 | 360 | type: 'POST', |
| 361 | 361 | data: { |
| 362 | 362 | action: 'metasync_preview_robots_backup', |
| 363 | - nonce: '<?php echo wp_create_nonce('metasync_nonce'); ?>', | |
| 363 | + nonce: '<?php echo esc_js(wp_create_nonce('metasync_nonce')); ?>', | |
| 364 | 364 | backup_id: backupId |
| 365 | 365 | }, |
| 366 | 366 | success: function(response) { |
| 367 | 367 | if (response.success && response.data) { |
| @@ -402,9 +402,9 @@ | ||
| 402 | 402 | $confirmBtn.html('<span class="dashicons dashicons-backup"></span> <?php esc_html_e('Restore', 'metasync'); ?>') |
| 403 | 403 | .removeClass('button-primary') |
| 404 | 404 | .addClass('button-restore') |
| 405 | 405 | .data('backup-id', backupId) |
| 406 | - .data('nonce', '<?php echo wp_create_nonce('metasync_restore_robots_backup'); ?>') | |
| 406 | + .data('nonce', '<?php echo esc_js(wp_create_nonce('metasync_restore_robots_backup')); ?>') | |
| 407 | 407 | .show(); |
| 408 | 408 | |
| 409 | 409 | // Hide close button for preview |
| 410 | 410 | $cancelBtn.hide(); |