It's almost like a script for a bad movie.

Just as Facebook and Twitter face slowing user growth after attracting nearly half the world's population to their respective services, coordinated campaigns of harassment and abuse have begun to show their effects. User counts are dropping and stock prices are in freefall.

This week, social media is having a moment of reckoning.

It began Wednesday with Facebook, which announced that daily active user counts had fallen in Europe, to 279 million from 282 million earlier this year. Facebook also indicated it was no longer growing in the US and Canada, two of the most lucrative advertising markets. Just as Facebook was working through its second year of nearly nonstop scandals over unchecked political meddling and data misuse, it was becoming clear that the days of consistent and relatively easy growth were fading.

Then, on Friday, Twitter said it too was seeing user counts drop, to 335 million people who log in each month from 336 million just three months earlier, in part because of its efforts to, as it says, improve "the long-term health of the platform."

Now Playing: Watch this: Trump slams 'shadow banning' on Twitter: What even is...

Amid the hairy questions about the health of social media sites, and their impact on our lives, our politics and our culture, it seems Wall Street finally has to worry as well.

"We're investing so much in security that it will significantly impact our profitability," Facebook CEO Mark Zuckerberg said on a Wednesday conference call. "This is a critical year for Facebook."

And maybe beyond this year as well, given the demands on these platforms to police themselves.

"We don't think that this work will necessarily ever be done," Twitter CEO Jack Dorsey said Friday. "It doesn't have an endpoint."

Wall Street has clearly been rattled. Facebook on Thursday suffered the worst market value drop ever for a public company in the US, slumping by $120 billion. On Friday Twitter watched its value sink more than 17 percent after releasing its earnings results.

Uncertain future

While it's easy to diagnose the problem, it's much harder to find a cure. And it's only in the past year or so that Facebook and Twitter have begun to meaningfully address concerns about their respective services.

Zuckerberg in particular was publicly dismissive after the 2016 US presidential election that hoaxes and false news stories had impacted voting trends. Then he was slow to address concerns about abuse and harassment campaigns by some Facebook users, most recently the popular conspiracy theorist Alex Jones. And Facebook has been blamed as well for not watching its service closely enough to stop the spread of misinformation that led to violence in other countries.

By the time Zuckerberg was invited to Capitol Hill in April to answer questions from three congressional committees over two days and a combined 10 hours of testimony, he was contrite.

"We didn't take a broad enough view of our responsibility, and that was a big mistake. And it was my mistake. And I'm sorry," he said when speaking to members of the Senate Judiciary Committee and Senate Commerce Committee. "I started Facebook, I run it, and I'm responsible for what happens here."

For Twitter, the problems have been even more pronounced. Hate mobs have used the service to coordinate campaigns against politicians, activists and victims of mass shootings. President Donald Trump has used Twitter to make some of his most controversial statements, ranging from threats against other countries to personal insults against women's looks.

CNET Daily News Get today's top news and reviews collected for you.

Twitter's response after waves of pointed criticism has been to focus on the idea of fostering "healthy" conversations on its service while stepping up enforcement of its rules.

"We believe that Twitter's value as a daily service is enhanced when the conversation on the platform is healthier and people feel safe freely expressing themselves," Dorsey said Friday. "We are making progress."

Now the companies will have to convince investors of that, too.

First published July 27 at 8:20 a.m. PT.

Update at 2:18 p.m. PT: Adds additional details about some people's criticism of Twitter and Facebook.

Cambridge Analytica: Everything you need to know about Facebook's data mining scandal.

iHate: CNET looks at how intolerance is taking over the internet.