An Oscar Wilde line comes to mind: “I can resist everything except temptation,” said the famed playwright and novelist. Let’s hope President Trump is made of sturdier stuff and can resist the temptation to tell special counsel Robert Mueller, “You’re fired!”

Understandably, Trump is considering doing just that. With leaks about the expanding investigation being spoon-fed to anti-Trump media and with Mueller’s hiring spree including Democratic donors, the president has reason to suspect he’s being set up for a fall.

Yet, in the short term at least, there is a better option. Instead of firing the special counsel, which would serve as a rallying cry to the left and alienate some Republicans, Trump should wage a smart campaign to fight Mueller.

He can begin by firing two other people — Attorney General Jeff Sessions and his deputy, Rod Rosenstein.

Trump is not being served well by either man, and with his presidency possibly hanging in the balance of Mueller’s probe, he must regain control of the Justice Department. Replacing the top two officials is the first step.

As I wrote last week, Trump made a mistake in hiring Sessions. While the former Alabama senator is more than qualified for the post, the fact that he felt compelled by Justice rules to recuse himself from any investigation related to the 2016 campaign because he was a key Trump supporter set in motion a series of disastrous events.

Sessions’ decision to step aside, which Trump opposed, made Rosenstein acting attorney general for purposes of the probe into whether the campaign colluded with Russia. The result was that Rosenstein, a career prosecutor with no affiliation to Trump, unilaterally decided to appoint a special counsel and hired Mueller.

That he did so after the firing of FBI Director James Comey is especially odd. Rosenstein authored a compelling memo recommending Comey’s dismissal, but seemed to lose his nerve after Trump offered conflicting reasons and said he was going to fire Comey no matter what Rosenstein said.

If all that weren’t reason enough to replace the AG and his deputy, now comes word that Rosenstein discussed recusing himself if he becomes a witness in Mueller’s probe.

That seems a near certainty because the probe is said to be looking at the Comey firing as part of its examination of whether Trump obstructed justice. If so, Rosenstein’s memo and discussions with Sessions and Trump would be front and center.

Thus, both Sessions and Rosenstein would be sidelined for the most important issue facing the White House. That wouldn’t be acceptable to any president, and Trump should thank them for their service and show them the door.

Because Trump is being battered each and every day, it’s essential for him to install respected leaders at Justice who agree with him that Mueller’s unlimited probe and Comey’s involvement are unfair.

One potential replacement candidate is Michael Mukasey, a former federal judge and attorney general under President George W. Bush. Mukasey told Lou Dobbs on Fox Business last week that, in addition to his doubts about whether any of Trump’s actions fit the definition of criminally obstructing justice, he ­believes “somebody has got to sit down and have a conversation with Rod Rosenstein about the scope of the investigation . . . and see whether something can be done about that.”

Mukasey added another wrinkle: “The simple fact that Mueller and Comey are not just acquaintances but friends” means “Mueller ought to consider whether he should step aside.”

Mukasey, who spoke before the possibility of a Rosenstein recusal surfaced, has the experience and stature to resolve all the complex legal issues.

Because a new attorney general and deputy would require Senate confirmations, Trump needs to move quickly. He would also need to persuade Senate Republicans of the necessity of new leadership at Justice and that Mueller needs to be reined in.

The incentive for Senate leaders to agree, apart from the facts, would be that an endless, leak-driven probe of the president will damage them, too.

If Democrats succeed in blocking the president’s agenda, the GOP could lose sufficient seats in one or both houses in the 2018 midterms for Dems to take back control.

No matter what he does now, Trump retains the option to ­remove Mueller. But he should remember that, if and when he goes that route, he would face a legal battle, and might recall that the federal courts are not his friend.

The politics of such a move could also be a disaster, especially if it’s seen as premature. That’s why he should wait, and fight Mueller first.

One thing on Trump’s side is that impeachment is ultimately a political issue, and building public support for his agenda could also save his job. Most polls show he’s as weak now as he’s ever been, and sacking Mueller could make it next to impossible for him to broaden his base and keep GOP lawmakers from bolting.

Yes, Mr. President, the temptation to fire Mueller must be incredibly powerful, but now is the time to resist it. For your sake, and for America.

Blasio’s on-track better

Every once in awhile, Mayor de Blasio reminds us that, while he’s a lousy mayor, he’s not stupid.

Take his offer to run the rickety subways. “If the MTA will not fix the problem, I’d rather the City of New York run it,” he told reporters.

Let’s unpack his cleverness.

First, since Gov. Cuomo controls the MTA board, de Blasio was getting in a free shot at Cuomo, his archenemy, over the system’s myriad failures.

Second, the mayor knows there is no way in hell Cuomo would admit defeat and turn transit over to City Hall. So the mayor’s offer to take control comes without risk of having to make good on it.

Third, de Blasio is up for re-election and subway service, which seems to be declining by the day, could become a campaign issue. His offer simultaneously reminds voters he’s not in charge while making him look bold for volunteering.

Touché, mayor. But next time, be careful what you ask for, lest you get it.

No defending Schu’s gun view

Regarding the attempted massacre of congress members at a baseball practice, reader John Dumary Jr. of upstate New York writes: “My Senator, Charles Schumer, said that if it were not for the Capitol police there would have been nobody there to respond to the shooter, but isn’t that exactly what Schumer wants?

“He constantly pushes legislation that would take away our ability to defend ourselves against a madman.”

Baseball prayers

The annual congressional baseball game, which took place the day after the shooting, also drew attention for the group prayer, as the teams joined together to kneel on the field.

God help any high school players who try that.