I use this code on a daily basis to make and test quick changes in the live environment on websites that use the smarty templating system. There are two techniques you can use one this by ip address and the other by GET variable.
{if $smarty.server.REMOTE_ADDR == '111.111.111.111'}
{* other debugging code goes here *}
{/if}Replace 111.111.111.111 with you own public ip address. Your can use this link to get your ip address from google .
The second technique allows you to try your code changes only when you provide a GET variable such as debug=Y
{if $smarty.get.debug == 'Y'}
{* other debugging code goes here *}
{/if}So in this example you can use https://pinakin.me.uk/?debug=Y to show your code but no one else gets to see it live.
If you are using a Web Firewall such as Sucuri then you will need to use the following instead.
{if $smarty.server.HTTP_X_SUCURI_CLIENTIP == '111.111.111.111'}
{* other debugging code goes here *}
{/if}For PHP it is
if ($_SERVER['REMOTE_ADDR'] == '111.111.111.111' ) {
//your code here
}