Despite analyst warnings of a looming restaurant recession, McDonald's (MCD) - Get Report reported third-quarter earnings on Friday that beat Wall Street estimates, pleasing investors and sending the company's stock up by more than 2.5%.

Earnings came in at $1.28 billion, or $1.50 a share, on revenue of $6.42 billion. The consensus had called for earnings of $1.47 a share on $6.27 billion in revenue.

Although earnings were $1.31 billion on revenue of $6.62 a year earlier, same-store sales in the latest quarter rose by 3.5%.

Image placeholder title

"Our third-quarter results, including our fifth consecutive quarter of positive comparable sales across all segments, as well as improved restaurant profitability, are a testament to the progress we are making to satisfy the needs of today's dynamic customers," McDonald's Chief Executive Steve Easterbrook said in a statement.

The year-over-year decrease in both earnings and revenue are in line with trends in the overall restaurant industry.

Over the summer, Paul Westra, a senior restaurant analyst at Stifel Financial, predicted that the industry is on the cusp of a "restaurant recession," and he downgraded 11 of the most popular eatery chain stocks, from beleaguered Chipotle Mexican Grill to thriving Panera Bread.

Panera Bread is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. See how Cramer rates the stock here. Want to be alerted before Cramer buys or sells PNRA? Learn more now.

Tepid restaurant traffic in the U.S. is due to several factors including a feeling of malaise over the upcoming presidential election, the popularity of do-it-yourself meal kits and the fact that it is cheaper to cook than eat out.

However, McDonald's is still showing that it has the ability to grow, and it historically has been a recession-proof stock. Even if sales growth becomes more tepid, this company will dominate the sector and spin off profits in the long run.

Part of the reason for McDonald's unprecedented resilience is the fact that the company has a proven ability to adapt its business to customer needs. McDonald's demonstrated this with the introduction of All Day Breakfast last October, and it has continued to do so this year.

One of the biggest trends in food is toward ingredients perceived as healthier. McDonald's has catered to this new American health fanaticism by tweaking the recipes to some of its most popular foods, removing high fructose corn syrup from select baked goods and switching to cage-free eggs.

However, one of the biggest successes in this new healthy bent, as proven by third-quarter results, is McDonald's new Chicken McNuggets recipe, which eliminates preservatives.

Since August, when the company said that it had nixed artificial preservatives, as well as antibiotics, in McNuggets, sales of the dish, which is a mainstay of kids' Happy Meals, increased by 10%.

These are the sorts of moves that make McDonald's a great long-term play. Look for any dips in share price to load up on more shares of this tasty stock.

---

85% Accurate Trader gives his Personal Guarantee: "Give Me 9 Minutes a Week and I Guarantee You $67,548 a Year." What if I told you I know a way you can see a $67,548 per year - or more - in profitable trades just by following this simple step-by-step process? The trader who is sharing this secret has been right more than 8 out of 10 times, turning $5,000 into more than $5 million for himself. Click here to see how easy it is to follow his lead and collect thousands of dollars in "Free Money" every month.

The author is an independent contributor who at the time of publication owned none of the stocks mentioned.