When warranty on my vehicle runs out I might add push-button microswitch beneath the the door.
So if I push the door slightly* harder it touches the microswitch and activates the locking mechanism.
Though I always push the release button if I exit the vehicle. Even at destination where I do not charge
If microswitch doesn't work I will glue a magnet to J1772 plug and a sensor beneath the plastic bumper.
*note that charging door is springy even if it is closed. Seals push it up against latch.