MIRANDA LAMBERT is cracking the whip – and forcing her hard-partying hubby BLAKE SHELTON to shape up after a recent heart scare.

The “Boys ’Round Here” singer has reportedly packed on nearly 50 pounds in recent months, constantly bingeing on junk food and booze.

“Blake had a serious scare recently,” said a source.

“He went to bed after a wild night of downing tequila, beer and tubs of fried chicken and woke up in the middle of the night with searing pain shooting from his chest through his arms.

“He was gasping for air for a few minutes before he finally pulled himself together. He called Miranda, who’s been on tour, and she told him to rush to an emergency room.”

Fortunately, the pain passed, and Blake later attributed it to heartburn or indigestion.

“It was a huge wake-up call, though,” the source said.

A representative for Shelton denied that he had a heart scare.

Miranda, 29, has now set a goal for her 37-year-old hubby to drop 40 pounds by the end of the year, and she’s pushing him to hire a personal trainer, quit drinking and to ease up on work.

“Blake’s lifestyle has become very unhealthy,” the source added, “but hopefully the recent scare will force him to take better care of himself.”