I have a Motorola G5S. Ever since I got it, I had a problem with charging cables, this is any cable I use. At first I thought the cable that came with the phone was faulty since after about 12 months, it stopped charging the phone. So then I changed to a new cable. However, each cable I use thereafter becomes unable to charge my (or any other Android) phone at seemingly increasingly short durations, ie the 2nd one might last just a few months, then a few weeks and lately, just a few days. I tried a new cable that was charging a different android just fine, and it worked for me, so I continued to use it. But yesterday it stopped working again.
The above is true whether the charging pins on the cable are sticking out like they should, or depressed into the plug (and therefore loose).