media_handle_upload on mix form fields (not required file input)

I have been able to check the file size with $ _FILES [$ id] [ 'size'] > 0. So the WP_error validation will only run if there is a file in bytes.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)