Thanks so much for your advice! Sorry, yes I did misunderstand!
You are right, there is a wire coming up from behind the socket and running across the wall. I will sort that as you are right, it's not safe.
I'll try to follow the advice given and research more into how to run the waste pipe...