| @@ -824,11 +824,10 @@ | ||
| 824 | 824 | if (array_key_exists($theme, $presets)) { |
| 825 | 825 | return $presets[$theme]; |
| 826 | 826 | } |
| 827 | 827 | |
| 828 | - // specific preset not found (Pro-only/custom theme saved while Pro add-on inactive). | |
| 829 | - // Fall back to base preset so core CSS vars (--adminify-menu-width) always emit. | |
| 830 | - return isset($presets['preset1']) ? $presets['preset1'] : $common_var; | |
| 828 | + // specific preset not found | |
| 829 | + return []; | |
| 831 | 830 | } |
| 832 | 831 | |
| 833 | 832 | public static function get_page_templates($type = '') |
| 834 | 833 | { |
| @@ -1266,31 +1265,13 @@ | ||
| 1266 | 1265 | * @return bool |
| 1267 | 1266 | */ |
| 1268 | 1267 | public static function is_iframe() |
| 1269 | 1268 | { |
| 1270 | - // Adminify-tagged iframe URL: Templates.php injects a JS interceptor that | |
| 1271 | - // rewrites every iframe src to include ?adminify-iframe=1. Authoritative | |
| 1272 | - // when present and works regardless of browser headers (covers WordPress | |
| 1273 | - // Playground where Sec-Fetch-Dest + Referer are stripped by the SW). The | |
| 1274 | - // param is read-only intent; no sanitization concern beyond isset. | |
| 1275 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only flag. | |
| 1276 | - if ( isset($_GET['adminify-iframe']) ) { | |
| 1277 | - return true; | |
| 1278 | - } | |
| 1279 | - // Fetch Metadata Request Headers (modern browsers): authoritative. | |
| 1280 | - if ( isset($_SERVER["HTTP_SEC_FETCH_DEST"]) ) { | |
| 1281 | - return strtolower(sanitize_text_field(wp_unslash($_SERVER["HTTP_SEC_FETCH_DEST"]))) === "iframe"; | |
| 1282 | - } | |
| 1283 | - // Header absent (older browsers): fall back to a same-host /wp-admin Referer. | |
| 1284 | - if ( ! empty($_SERVER['HTTP_REFERER']) ) { | |
| 1285 | - $referer = wp_unslash($_SERVER['HTTP_REFERER']); | |
| 1286 | - $referer_host = wp_parse_url($referer, PHP_URL_HOST); | |
| 1287 | - $self_host = isset($_SERVER['HTTP_HOST']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_HOST'])) : ''; | |
| 1288 | - if ( $referer_host && $self_host && strtolower($referer_host) === strtolower($self_host) && strpos($referer, '/wp-admin') !== false ) { | |
| 1289 | - return true; | |
| 1290 | - } | |
| 1291 | - } | |
| 1292 | - return false; | |
| 1269 | + return isset($_SERVER["HTTP_SEC_FETCH_DEST"]) && strtolower(sanitize_text_field(wp_unslash($_SERVER["HTTP_SEC_FETCH_DEST"]))) === "iframe"; | |
| 1270 | + // $isIframe = isset($_SERVER["HTTP_SEC_FETCH_DEST"]) && strtolower($_SERVER["HTTP_SEC_FETCH_DEST"]) === "iframe"; | |
| 1271 | + // if ( $isIframe ) return true; | |
| 1272 | + // if ( isset($_GET['adminify-iframe']) ) return true; | |
| 1273 | + // return false; | |
| 1293 | 1274 | } |
| 1294 | 1275 | |
| 1295 | 1276 | /** |
| 1296 | 1277 | * Load a template file. |