Run into this myself, its a pain but a quick and easy fix is
if (!isset($site))
instead of
if ($site == "")
or if you have access to the PHP.INI file you can change
error_reporting = E_ALL
to
error_reporting = E_ALL & ~E_NOTICE
turn off E_NOTICE which is the error switch which warns of uninitialized variables