Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Easily check DNS migration changes - see whether a DNS change has propagated when you don't have command line access. https://www.damiencarbery.com/2017/07/easily-check-dns-migration-changes/
<?php
/*
Plugin Name: Migration Test
Plugin URI: https://www.damiencarbery.com/2017/07/easily-check-dns-migration-changes/
Description: Display the server name in the footer. Used to easily see when a site migration DNS changes have propagated.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
License: GPL2
*/
add_action( 'wp_footer', 'dcwd_server_hostname', 100 );
function dcwd_server_hostname() {
// Add a comment which may not be possible to see when on a mobile or table device.
echo '<!-- ', "\n", $_SERVER[ 'SERVER_ADDR' ], ' (expecting 12.34.56.78)', "\n", '-->';
// Or a paragraph with small, light font (change the font colour to be discreet against the footer background).
echo '<p style="font-size: 9px; color: #ccc">', $_SERVER[ 'SERVER_ADDR' ], ' (expecting 12.34.56.78)</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.