So I updated my phone, shut it down, cleaned the port, the cable is fine it's not parting anywhere and I can't imagine it's the socket plug so great- like a typical Samsung it just decided to not want to charge anymore- definitely gonna be my last Samsung-
What i think is that you have a dry joint on the charging port which is why its intermittent. So just to be sure, take the cable from your charger and plug it into a USB port on your TV or router and plug into your phone. If it charges albeit slowly, wrap the excess cable around the phone to take up the slack and stop it moving the plug in the port. And experiment like that until you get a constant charge.