One month ago, Facebook seemed to be on the brink of demise, with CEO Mark Zuckerberg testifying before Congress about a data-harvesting scandal that affected millions of users. CNBC's Jim Cramer, whose charitable trust owns shares of Facebook, even sold some of the social media giant's stock on the news, citing the concerning headlines. "Facebook seemed like it was running amok and was about to be leveled by the government," the "Mad Money" host recalled. "No wonder the stock traded down to 18 times earnings." But since the scandal — which on Wednesday spurred the shutdown of the data-harvester, Cambridge Analytica — four things have brought Facebook back from near-death, Cramer said.

1. Apologies

At first, Facebook executives were criticized for not apologizing and taking responsibility for the issue. Zuckerberg and COO Sheryl Sandberg got flak for "dodging" the press. But as soon as the apologies came, things started looking up for Facebook, Cramer said. "Suddenly, it was Facebook with a human face," he quipped.

2. Earnings

Then came Facebook's first-quarter earnings report, which beat analyst expectations and showed steady user engagement despite the media uproar. "[It] made us realize that whatever the media might say about Facebook, the users and advertisers still love it," Cramer said. "I think to most people, especially young people, the scandal was a non-story," he continued, noting that "when we post stuff on the internet, perhaps there's not that much of an expectation of privacy."

3. Counsel

Since the start of the scandal, Cramer called on Facebook's management to hire outside counsel to review the company's practices and ensure that the issue didn't repeat itself. "Well, they just did it. They just hired some tough outside lawyers to monitor and clean up any bias," Cramer said on Wednesday. "The outside examiners who signed on are so respected by Congress that I think Facebook may have this whole issue in the bag now, presuming that there's not another Cambridge Analytic lurking in the wings."

4. Snap

Snap's stock tanked on Wednesday following the company's weaker than expected first-quarter earnings report, causing analysts to question the social media app's sustainability. "Memo to Snap's management: only you can prevent cash fires, and, from the looks of things, you're not doing a very good job," Cramer said, adding that the company "imploded so badly" that it could help Facebook in the long run.

Conclusions

"Here's my bottom line: I fully expect many more things to go wrong" in the market to threaten even the best of stocks, the "Mad Money" host said. "However, as ... Facebook demonstrate[s], the end of the world is not always nigh."

WATCH: Cramer finds pockets of positivity in a negative market