WD40 is great for a lot of things, but not for guns.
I used it for a long time. Found that it leaves a film that turns to gum and stops things up.
I now use Breakfree or CLP as stated in the manual for my AR. But when I was still on active duty 22 years ago I heard stories of units using motor oil with good effect. I was an Ordinance Officer at the time, but working on tactical vehicles not pistols or rifles.
After I retired I worked for General Motors and saw a demonstration of MilTech that impressed me very much. I use MilTech on my pistols.
I think the important thing for most of us is to keep the stuff that is supposed to be wet, wet with good oil, and motor oil or Mobil 1 are good oils.