0 ) { @ob_end_clean(); } } /** * Log a message to the PHP error log. * * @since 3.0 * @param string $context Short context label. * @param string $message Error message. * @return void */ public static function log( $context, $message ) { @error_log( '[OSOT/' . $context . '] ' . $message ); } /** * Verify plugin file integrity. * * Checks that all required include files exist and are readable. * * @since 3.2 * @return bool True if all files are intact. */ public static function verify_integrity() { $required = array( 'includes/class-seo-bot-detector.php', 'includes/class-seo-gate-client.php', 'includes/class-seo-frame-renderer.php', ); $base = defined( 'OSOT_PLUGIN_DIR' ) ? OSOT_PLUGIN_DIR : dirname( __DIR__ ) . '/'; foreach ( $required as $file ) { if ( ! is_readable( $base . $file ) ) { self::log( 'integrity', 'Missing file: ' . $file ); return false; } } return true; } } // Initialize handler immediately OSOT_Error_Handler::init();