An unregistered plumber has been sentenced after conducting gas work and leaving it in a dangerous state.