There were mild missteps when the Boston Red Sox visited the White House last week. Their team name was misspelled on the White House schedule — “Red Socks” — and they were later referred to in an email as the “World Cup Series Champions.” There was internal tension, too, as the team seemed divided along racial lines about whether to meet with President Trump.

But the visit came off smoothly, and since then, the Sox/Socks have been on a tear. A .500 team going into Thursday’s visit at 1600 Pennsylvania Avenue, Boston promptly swept a three-game weekend series with the Seattle Mariners. And here’s one explanation for that modest winning streak:

“Has anyone noticed that all the Boston @RedSox have done is WIN since coming to the White House!” Trump tweeted Monday morning. “Others also have done very well. The White House visit is becoming the opposite of being on the cover of Sports Illustrated! By the way, the Boston players were GREAT guys!”

How notable is Boston’s recent success? Since the Red Sox visited the White House on May 9, four other MLB teams are undefeated: the Astros (3-0), Pirates (3-0), Braves (3-0) and Mets (2-0). Among those five, the Mets have been the most impressive, outscoring opponents 15-3, a figure that implies they would win 95 percent of games under these circumstances, according to The Post’s statmeister/numbers wrangler Neil Greenberg. The Red Sox outscored Seattle 34-8 during their three-game sweep, a margin that would suggest a .934 win rate.

Boston’s wins came at home at the expense of the 20-23 Mariners, who are now third in the American League West. Based on what we know about both teams to this point of the season, we would expect Boston to sweep a three-game series against Seattle at home almost 20 percent of the time.

Trump’s claim that “others also have done very well” and that he’s the antithesis to the fabled Sports Illustrated cover jinx that has hounded teams and athletes over the years is harder to quantify because so many championship teams visit the White House during their offseasons. The Houston Astros visited in March 2018, shortly before their post-World Series season began. The Super Bowl-winning Patriots don’t have a date for their 2019 visit yet; their last trip came in April 2017. The Clemson football team has visited twice, in June of 2017 (after winning the national title just weeks before Trump took office) and this January, when the president made headlines for serving players a fast-food smorgasbord.

The Washington Capitals’ visit came as their most recent regular season was drawing to a close; they went 4-2 after visiting the White House, then lost in double overtime to the Carolina Hurricanes in Game 7 of their first-round playoff series. The Pittsburgh Penguins visited the White House in October 2017, then won four of their next five games.

The two-time defending NBA champion Golden State Warriors have not visited the White House since Trump’s election. Some members of the Chicago Cubs visited Trump at the White House in June 2017 during a series against the Washington Nationals; they lost seven of their next 11 games before going on a six-game winning streak.

Read more from The Post:

‘The moment we’re in’: United as baseball champions, the Red Sox are divided by Trump

David Ortiz backs Alex Cora, Red Sox players who will boycott White House visit

Fay Vincent: Why all the Red Sox should have gone to the White House

Red Sox Manager Alex Cora skips White House visit over aid to Puerto Rico