This type problem is usually caused by a loose connection.
If you use too much heat when soldering, the pin may twist or get out of alignment, then the plastic hardens and you never know.
Until the plug with the cord doesnt fit the misaligned pin as designed, and after a while heat is generated, which misaligns the pin even more, then before you know it you have a melt down.
Bad solder joints, too much heat, and even factory defective or damaged plugs can do this.
Whenever this happens, you need to replace both the plug on your box and the cord or at least the plug on the cord.
This can be very dangerous, as it can cause fires if there is anything flammable close to it. Dust, lint, most cloths, and flammable liquids can ignite from the heat generated by the loose connection.