It was the last week of July on the Jersey Shore, and water-borne bacteria was rampant at the beach.

One of out every six beaches in the state was under an advisory or closed on July 25 because of excessive bacteria — the kind found alongside the feces of warm-blooded animals, the kind that indicates a heightened risk of stomach illness and skin and eye infections.

From the Bayshore to North Wildwood, from no-frills Toms River beaches to the boardwalks of Long Branch, no area of the state was immune. Seven beaches in Atlantic City were closed before these nasty microbes dispersed and it was safe to swim again.

RIP CURRENTS:2017 has recorded most rip current-related fatalities

INEQUALITY PROTESTS:As Malcolm Jenkins leads NFL player demonstrations, his old coach (a police officer) weighs in

It was the lowest point of the season. In fact, that week represents the single-worst week for water quality in New Jersey since bacteria advisories (as an alternative to beach closures) became standard in the state five years ago.

But the Shore would rebound and log a mostly typical summer, in terms of clean swimming water, according to an Asbury Park Press analysis of data maintained by the New Jersey Cooperative Coastal Monitoring Program.

Each week between Memorial Day and Labor Day, the Press reported on the findings of water samples taken from every public swimming beach in the state.

HURRICANE MARIA:Tired of waiting, NJ residents look for ways to help Puerto Rico

HERO:NJ florist died trying to save stranger in Point Pleasant Beach surf

Which beaches popped up most frequently? Watch the video at the top to find out.

This summer, nearly 4,000 water quality samples were taken at New Jersey's 211 public swimming beaches.

Let's break it down

4 percent of the tests failed to meet safe swimming standards , just slightly higher than in 2016. The average from summer 2005 through summer 2015 was 3.5 percent.

, just slightly higher than in 2016. The average from summer 2005 through summer 2015 was 3.5 percent. The national average in 2013 was 10 percent, according to the Natural Resources Defense Council. New Jersey is routinely ahead of most states , including New York, Florida and Hawaii, in terms of water quality.

, including New York, Florida and Hawaii, in terms of water quality. 78 bacteria advisories were issued in New Jersey during the 2017 summer, compared to 120 last year. But the advisories this year resulted in 28 closures , or twice as many as during the 2016 season.

were issued in New Jersey during the 2017 summer, compared to 120 last year. But the advisories this year resulted in , or twice as many as during the 2016 season. A greater share of the failed tests this year came from samples on ocean beaches, nearly three in every five high tests came from an ocean beach instead of a bay or river beach — a 14 percent increase from 2016. Proportionally, however, bay and river swimming beaches — outnumbered 7 to 1 by ocean beaches — are still much more likely to have excessive bacteria.

instead of a bay or river beach — a 14 percent increase from 2016. Proportionally, however, bay and river swimming beaches — — are still much more likely to have excessive bacteria. The highest result registered was taken on July 24 on a Toms River beach in Island Heights, which measured 1,800 colony forming units (cfu) — more than 17 times the safe limit. On an ocean beach, the highest was May 22 at South Bath Avenue in Long Branch when a sample was tested at 890 cfu, or 8½ times what is considered safe.

What we've learned

The data isn't just used by the public and news reporters. New Jersey Department of Environmental Protection staff uses the data to identify areas of concern.

Each exceedance of the safe swimming standard triggers a series of actions, according to a statement provided by DEP spokesman Larry Hajna.

When a location repeatedly comes up with high tests, state and local officials combine forces to investigate why.

Leaky sewer infrastructure was determined to be the culprit behind high levels of enterococcus at beaches in Belmar and Highlands.

They're still searching for a reason why bacteria is concentrated at the beach by South Bath Avenue in Long Branch.

"The Department has teamed up with Long Branch and Monmouth County Health Department and is committed to finding the source," the DEP statement reads.

NEW TODAY:Body found mile off Barnegat Light ID'd as Belmar man

LEAKS:Toms River schools hire private eye to hunt for source of news story

Russ Zimmer: 732-557-5748, razimmer@app.com