The plug is the sensor, it checks if bonnet is closed to arm the alarm. It runs along the back side towards drivers side on the front panel.
Regarding lock it would be anything, my lock got bent during a minor bump so it could be a part got bent etc.