Not really sure why I didn't check Wikipedia. There's an interesting warning there.
WD-40 is a fine product and has many uses, but it is not real contact cleaner. It leaves a sticky residue that can attract dust.
WD-40 should never be used in locks for the same reason. Locks should be cleaned with isopropyl alcohol, allowed to dry thoroughly and lubricated with dry graphite powder.