Prop the cat flap open, so it resembles tho hole that was there, leave her to use it like this for about a week.
Then remove the magnetic strip from the flap so it swings freely, again leave her to use it like this for about a wekk.
Then try putting the magnetic strip back in the flap and hopefully you should have sucess!
As for the poo in the corner, you need to make sure you have removed all trace of this otherwise she will keep returning to the same spot, remember their noses are much more sensitive than ours.
To clean the area, flush the area with water, use a normal houshold cleaning product (that wont remove the colour from the carpet), I normally use washing powder, then flush the area with water again. Then use vodka (or gin or any other colourless spirit), you can use the cheapest one you can find

. Then flush the area with water once more.
Even if your cat goes outside, it is still a good idea to keep a tray inside, even if it is just for night time use. For one thing is it will save these accidients and secondly, if you can see their poo, then you would be able to see if their are any problems, it can be a great early warning signal for illnesses.