esc_attr() does not understand objects

Hi I see you're using esc_attr() to escape values in your inputs but it's made to work only with strings so it throws fatal error.

I think yo should make your own function to sanitize objects.