USB charging and data transfer problems

I recently got some mobile phones given to repair the USB ports.
You might know the problems claimed on faulty USB problems first hand: charging takes forever, device is not always recognised in Windows, data transfers are interrupted or the device disappears suddenly and without any reason from your explorer.
Although a lot of devices can suffer from from those symptoms and will work fina after paying money for a new USB port I also discovered a totally different source for the problem.
In my case the cables itself.
It is obvious that you should try a different USB cable before going through the lengths of replacing a USB port, but:
a) not all cables are the same even if they have the same connectors!
Some cables contain resistors to regulate the max charging current, others simply have flimsy and hair thin wires inside, prone to breaking.
b) not all chargers are the same either!
For example Apple chargers provide a voltage on the data lines that in return tells the device how fast it can charge - totally against the USB standards but Apple claims it is fine because they don't use a USB connector on the device side...

Why does my device get problems with the USB?
Well, to be honest, I don't know as it is not my device ;)
Joking aside I will narrow it down to wear and tear.
Both the connection on the phone and inside the USB connector can and will wear down over time.
With daily charges for power users it is obvious that at some stage one part has to fail.
Having a spare, quality replacement cable at hand often helps to find the source of the problem.
In my case I had the cables for the phones but also a brand new and with 5$ quite expensive cable to spare.
Guess what? None of the supplied cables worked while my new cable performed perfectly with all "broken" phones.
After checking the USB ports with good light and a magnifying glass I could see dust, dirt and worn contacts.
For 3 of the 5 devices a decent cleaning with methylated spirit and a small brush fixed that issue, the other two will either need a proper new cable or a port replacement.

What to do if I have USB problems?
1. Check on a different PC or for the charging use a different charger.
2. Try a different, if possible new cable.
3. Check and clean the USB port.
Only if the above won't help at all you should consider that the port itself might be faulty!

Is there something to prevent the repair?
Yes: don't use your USB port too often ;)
This means, you can use a QI charger (wireless) and for the data transfer WiFi, on Android Airdroid is a really good choice.
Keep your device clean! This does not mean you are a filthy pig, but more that a phone with an uncovered port tends to collect dust and dirt over time.
In your hand bag, pocket or car, it does not matter time will get unwanted stuff in there.
If you want to keep your device happy use a cover that also covers the USB port.

I checked all the above and think I need a new port - what are my options?
If in warranty go the offical way.
Out of warranty a repair shop will fix it fast, but not always at reasonable costs, depending on the device and labour involved. Some devices are easy, others require the display to be removed to acces the port electronics.
Online tutorials on how to dismantle your device should be available and if you are good with sensitive stuff you can do the repair yourself.
Some sellers of replacement ports not only include all the tools you need (watch out for this if you don't already have them) but also videos on how to do it.

I hope this little info helps people to avoid high repair costs for no good reason.