On the theory that you can judge a president by his critics, Donald Trump must be hitting the bull’s-eye with his warnings about the ­migrants vowing to smash through our border. We know this because the usual suspects — the New York Times and CNN, among ­others — are accusing Trump of making much ado about next to ­nothing.

“Trump Escalates Use of ­Migrants as Election Ploy,” the Times insisted on Page One Tuesday. ­Inside it wrote of “baseless claims” and said he used “race to stoke fears.”

The blatant opinions in the news pages presented a challenge to the paper’s actual editorial page, but it proved itself equal to the partisan moment. It ratcheted up its metaphor machine to “Screech” to accuse the president of “Lyin’ Up a Storm” and “dialing up the demagoguery.”

Long gone are the days when readers could expect even a pretense of fairness from the Gray Lady. But the bias, fused with an ­intentional blind eye regarding the origins, growing size and militancy of the caravan, is beyond the pale.

Consider that a trek that started with fewer than 200 people in Honduras suddenly ballooned to more than 7,500 as reports emerged of left-wing activists organizing the crowds. Photos of the staggeringly long lines and of leaders breaking down fences between Guatemala and Mexico demonstrate there is legitimate reason for concern, ­especially when some leaders say they are determined to come to America.

“We are going to the United States,” one shouted, The Post ­reported. “Nobody is going to stop us!”

“We’re going to get in! We’re ­going to get in together,” another man reportedly said.

Although the president claimed without evidence that “Middle Easterners” infiltrated the caravan, there is, in fact, precious little evidence about who any of the migrants actually are and how many are dangerous. That undercuts the whole point of borders — to keep out undesirables and let the host country decide whom it wants to admit.

Against that messy backdrop, the left-wing media’s hyperpanic ­assault on Trump is instructive.

It confirms what polls suggest and Democrats fear: The caravan could motivate additional Republican and independent voters to back GOP candidates in the midterms.

That possibility builds on a growing consensus that the blue wave spotted in the summer already was diminished by the character-assassination attempt on Brett Kavan­augh. The unfairness of the assault, with the presumption of innocence thrown overboard, was alarming to millions of fair-minded people.

The same phenomenon could be happening with the caravan, which, among other things, is providing a timely reminder that, 21 months into Trump’s presidency, our southern border is still Swiss cheese.

Thus, Kavanaugh and the caravan could tip the election, or at least minimize GOP losses.

The Dems’ fear of that outcome is rational. Stopping illegal immigration has been a popular part of Trump’s formula since Day One ­because it simultaneously bolsters both his economic and public safety agendas.

Its political potency is revealed by how Trump is using the caravan to attack Dems over the failure to tighten the border. He mentions it at his near-daily rallies on behalf of Republican candidates and ­magnifies it on Twitter.

A recent tweet captured his argument: “Every time you see a Caravan, or people illegally coming, or attempting to come, into our Country illegally, think of and blame the Democrats for not giving us the votes to change our pathetic Immigration Laws! Remember the ­Midterms!”

So far, then, the caravan reflects a neat narrative of the president’s policies and Dems’ resistance, and has to be considered a political plus for the GOP. Which explains why the left is going ballistic.

Still, we don’t know how the caravan story ends. Some scenarios contain political dangers for Trump and his party.

For example, it’s not difficult to imagine that carrying out his threat to use the military to seal the border could backfire.

What role would the military play against thousands of unarmed migrants, many of them women and children? Would soldiers open fire if the group rushed the border?

Trump also threatened to cut foreign aid to Honduras, Guatemala and El Salvador. Combined, the three get about $550 million a year from American taxpayers.

Because the aid aims to bolster those nations’ security forces and keep the countries from total collapse, cutting it might actually speed up the collapse.

The caravan, then, depending on when it reaches our border, could end up helping Democrats. If the migrants are turned away or if parents are separated from their children or if there is violence, the left would denounce Trump as a heartless bigot and seize on the issue to motivate its voters.

But we can take comfort knowing the media would be fair. Surely the Times would turn around and, with the same intensity, denounce Dems for using the migrants’ plight as an “Election Ploy.”

Yeah, right.

Salute to at-risk students’ bizman hero

Twenty-nine years ago, real estate developer Dan Rose started an after-school program to help Harlem children keep up with their homework and keep out of trouble. He used chess and tutors and academic advisers to make sure the kids stayed in school and had a real shot at getting into college.

His intense Saturday enrichment programs led scholar Henry Louis Gates to jokingly praise Rose for bringing “Hebrew school to Harlem.”

Rose called his labor of love the Harlem Educational Activities Fund, but he may have to adjust the name. The organization has 600 students enrolled this year and is so popular, it’s expanded to Brooklyn.

The track record is the stuff of legend: 100 percent of HEAF’s students finish high school, some 80 percent get college degrees in six years, and a third of those go on to gain advanced academic degrees.

Last week’s gala (where my wife was among those honored) raised more than $2 million, and Rose, along with his wife, Joanna, took in all the tributes and student success stories with a nonstop smile. The organization they had nursed virtually alone is on solid footing for many years to come.

“You hear so much noise and negative stories about education,” Rose told me. “But this is the good news. These are positive stories about what children can accomplish with the right help.”

Even calling the stories positive does not fully describe the achievement. Thanks to Rose and the dedicated people who shared his dream, thousands of young lives have been prodded and pushed and coached into bright futures.

No other builder can claim a more glorious monument.

Don’s insult makes good ‘horse sense’

“Horseface” won’t go away. Reader Karen Korakis approves of Trump using the insult to refer to Stormy Daniels because she sees it as a “shock strategy” to get good news covered.

Korakis writes, “He knows the liberal media will bury his good news, so he tags the story of Daniels’ lawsuit being thrown out with a shocker guaranteed to make the media lose their minds. Now they have to cover it.”