President Donald Trump's plan to secure border-wall funding while slashing asylum protections for immigrant children is garnering scorn even from allies like former House Speaker Newt Gingrich and conservative immigration hardliners.

Gingrich told USA Today that the bill was "just plain a mistake" and contained nothing that would entice Democrats to vote for it.

At the same time, immigration hawks have criticized Trump for focusing on a wall above all else.

President Donald Trump's strategy for negotiating an end to a record-long government shutdown is garnering critics from across the political spectrum, with everyone from Democrats to prominent conservatives to hardline immigration hawks at odds with the Republican plan.

The Senate is set to vote Thursday on a Trump-backed bill that would end the 34-day-old shutdown, secure $5.7 billion in border-wall funding, provide temporary protections to roughly 1 million immigrants, and overhaul the asylum system.

The bill is almost certain to fail in the Senate, where Democrats dismissed it as a nonstarter even before Trump announced the plan. They then spent much of the week criticizing Republicans for adding in a slew of unexpected restrictions on Central American children seeking asylum, and they accused Republicans of negotiating in bad faith.

But Newt Gingrich scorned the bill almost as heavily. The former House speaker told USA Today that the plan made essentially no concessions to Democrats and could hardly be expected to receive bipartisan support.

Former House Speaker Newt Gingrich being interviewed on the "Fox & Friends" TV program in New York on May 24. Associated Press/Richard Drew

Read more: Democrats are rejecting Trump's immigration deal for 3 glaring reasons, and it shows just how far apart the 2 sides still are

"I think that's misdesigned. I mean, you either design a deal that gets you Democrats, or you don't," Gingrich said. "If you're trying to attract people with sugar, you shouldn't pour vinegar on top of it."

The statement was notable from Gingrich, who while demanding deep budget cuts in 1995 presided over what until now had been the longest government shutdown in US history.

Gingrich said the Republican bill wouldn't stand a chance without more Democrat-friendly changes.

"I don't see any way they can pass it," he said. "This was just plain a mistake."

'So much focus has been on barriers, walls, and fences'

Children climbing up the Mexican side of a US-Mexico border fence on June 24 in Sunland Park, New Mexico. Joe Raedle/Getty Images

But on the other end of the conservative spectrum, immigration hardliners accused Trump of compromising too much on the bill, which extends two popular immigration programs — Deferred Action for Childhood Arrivals and Temporary Protected Status — for roughly 1 million immigrants by three years.

The group NumbersUSA, which pushes for lower immigration levels, assailed Trump in a statement for making what it called an "amnesty-for-wall trade" that it said would "reward previous immigration lawbreakers without preventing future immigration lawbreakers."

The group previously outlined 10 recommendations to "fix the broken immigration enforcement system," and none of them included a wall. Instead, the group suggested legal and policy-related changes, such as ending birthright citizenship and restricting asylum protections.

"We're obviously a little frustrated because so much focus has been on barriers, walls, and fences," Chris Chmielenski, NumbersUSA's director of content and activism, told Politico.

RJ Hauman, the government-relations director at Federation for American Immigration Reform, a lobbying group that also aims to limit immigration overall, told Politico he's frustrated that Trump's proposals had gotten "increasingly weak."

Trump with Senate Majority Leader Mitch McConnell after a luncheon on Capitol Hill on January 9. Associated Press/Alex Brandon

The Senate is scheduled to vote Thursday on both the Republican plan and a second Democratic bill that would reopen the government without wall funding. Both bills are expected to fail.

But Trump has characterized the immigration deal as a "common-sense compromise," and Senate Majority Leader Mitch McConnell said in a statement on Thursday that the bill was "pragmatic" and "bipartisan."

"Deep down, my friends across the aisle know this is not a reasonable reaction to a president of the other party," McConnell said.