Chosen Solution

i think that the socket has been damaged, and hence sometimes the charging is unsuccessful and i have to replug charges as long as it doesn’t actually start charging.

You likely need to replace both the MagSafe charger and the DC-In board following this IFIXIT guide: MacBook Pro 13" Retina Display Mid 2014 MagSafe DC-In Board Replacement. Here’s the needed part: MacBook Pro 13" Retina (Late 2013-Early 2015) MagSafe 2 DC-In Board Do be careful on where you buy your new replacement MagSafe charger as there are a lot of fakes out there now! These fakes can damage your system! Counterfeit Macbook charger teardown: convincing outside but dangerous inside I strongly recommend you order it directly from Apple!