I doused a padlock in WD-40 and let it sit for two weeks. Here's the result:
The key went in, turned easily and it unlocked. No gum, no varnish, why it was as if it had been lubricated.
Heck, bacon grease would hold up for two weeks, it needs to be quite a bit longer than that.
"Oil" the hinges on two doors side by side, one with WD-40 and one with the Tri-Flo I mentioned. See which one lasts longer, much longer, every time.
That doesn't mean you can't use WD-40 to "lubricate", it just means lubrication wasn't its primary goal or best attribute. WD-40 has been proven to protect from rust well, but that isn't lubri9cation, that is rust protection, and fresh WD-40 can break up old gunk (Fresh most anything can) and get things moving, but that doesn't mean it's a great lubricant.