| @@ -70,13 +70,13 @@ | ||
| 70 | 70 | return defined('METASYNC_VERSION') ? METASYNC_VERSION : 'unknown'; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | private function is_plugin_admin_page() { |
| 74 | - if (!isset($_GET['page'])) { | |
| 74 | + if (!isset($_GET['page'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page and tab check for GA4 assets | |
| 75 | 75 | return false; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $page = sanitize_text_field($_GET['page']); | |
| 78 | + $page = sanitize_text_field(wp_unslash($_GET['page'])); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page and tab check for GA4 assets | |
| 79 | 79 | |
| 80 | 80 | $plugin_slug = 'searchatlas'; |
| 81 | 81 | if (class_exists('Metasync_Admin') && isset(Metasync_Admin::$page_slug)) { |
| 82 | 82 | $plugin_slug = Metasync_Admin::$page_slug; |
| @@ -85,13 +85,13 @@ | ||
| 85 | 85 | return $page === $plugin_slug || strpos($page, $plugin_slug . '-') === 0; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | private function get_admin_screen_name() { |
| 89 | - if (!isset($_GET['page'])) { | |
| 89 | + if (!isset($_GET['page'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page and tab check for GA4 assets | |
| 90 | 90 | return 'Unknown'; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $page = sanitize_text_field($_GET['page']); | |
| 93 | + $page = sanitize_text_field(wp_unslash($_GET['page'])); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page and tab check for GA4 assets | |
| 94 | 94 | |
| 95 | 95 | $plugin_slug = 'searchatlas'; |
| 96 | 96 | if (class_exists('Metasync_Admin') && isset(Metasync_Admin::$page_slug)) { |
| 97 | 97 | $plugin_slug = Metasync_Admin::$page_slug; |
| @@ -109,10 +109,10 @@ | ||
| 109 | 109 | $plugin_slug . '-404-monitor' => '404 Monitor', |
| 110 | 110 | 'ottodebug' => 'OTTO Debug', |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - if ($page === $plugin_slug && isset($_GET['tab'])) { | |
| 114 | - $tab = sanitize_text_field($_GET['tab']); | |
| 113 | + if ($page === $plugin_slug && isset($_GET['tab'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page and tab check for GA4 assets | |
| 114 | + $tab = sanitize_text_field(wp_unslash($_GET['tab'])); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page and tab check for GA4 assets | |
| 115 | 115 | return 'Settings - ' . ucfirst(str_replace('_', ' ', $tab)); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return $screen_map[$page] ?? 'Unknown Page'; |