Use trigger_error instead of error_log for providing error messages

The error_log function is expecting a message_type describing where the error is to be sent. Given that none of the E_USER_* constants are valid values for this, a notice is generated instead and no error is logged.

Judging by the way the function's being called it looks like it's just trying to throw errors, in which case trigger_error is the correct function to call.