check first that $_SERVER['REMOTE_ADDR'] exists and is not empty on tep_...

...get_ip_address() function