So draining against gravity is bad. The electric outlet cover should be screwed into place and if that’s a dryer vent the lint will collect and clog creating a fire hazard. In sorry, but, that whole setup is janky.
Edit: oh jeeze you have a whole outlet hanging out too.
Edit: I saw your other picture, I too am no plumber, but, none of that looks right
If possible go have it looked at. I did this 4 years ago and it still hurts. Please don’t be me.