The Prophet (Mohammed, not John Smith), may peace be upon him, never condemned coffee. IE it’s not in the Q’ran/Koran. Even alcohol took awhile be made haram.Caffeine is a stimulant so it's the same as pork for Muslims.
Certain sects of Islam may prescribe coffee, or caffeine. Most don’t. It’s drunk freely -even prized- throughout the Arab world, as well as Malaysia, Africa, Eastern Europe, and other Islamic domains. Ditto teas (OMFG, Arab BBQ tea is a delight unparalleled anywhere IMHO), and in many places even hashish is allowed. Shisha, of course, is far more prevalent. (Double apple is the best ) To the best of my knowledge allowed everywhere except the most radical of sects.
In the LDS church, meanwhile, a bargain was struck. The women wanted the men to stop smoking/dipping & drinking. JS prayed on it, and found God to be amendable IF AND ONLY IF the women were equally willing to give up their tea. IE don’t ask a sacrifice of one, if unwilling to make a sacrifice yourself. So the men gave up their scotch & cigars upstairs, and the women gave up their teas downstairs. Sacrifices made. Balance achieved. Which -many, even most- Mormons follow to this day.
But, for whatever reason, many people mix up Mormon & Muslim (&/or Jewish) dietary restrictions. Halal & Kosher are at least CLOSE, but the Word of Wisdom is an entirely separate thing