<?php
/*
Plugin Name: Node Probe
Description: Shows server hostname at top of pages, or outputs hostname immediately for ?node=1 or curl testing
Version: 2.1
Author: Gabe
*/
add_action('init', function() {
    if (isset($_GET['node'])) { echo esc_html(gethostname()); exit; }
    if (isset($_SERVER['HTTP_X_NODE_TEST'])) { echo esc_html(gethostname()); exit; }
});
add_action('template_redirect', function() {
    $hostname = esc_html(gethostname());
    echo '<div style="position:fixed;top:0;left:0;width:100%;background:#ff0;color:#000;padding:5px;text-align:center;z-index:9999;font-weight:bold;">Hostname: ' . $hostname . '</div>';
    echo '<style>body { padding-top:30px; }</style>';
    flush();
});
