The man accused of plotting a Times Square attack was so worried about bungling the operation and being mocked in the press that he underwent eye surgery to improve his vision, court records showed Friday.

Ashiqul Alam, 22, was nervous about his eyeglasses falling off his face during the terror strike and creating an embarrassing debacle that would lead media outlets to dub him the “Looney Tunes Terrorist,” according to federal charging documents.

“Let’s say we are in an attack, right, say that my glasses fall off. What if I accidentally shoot you?” Alam is quoted as telling an undercover officer in the filing in Brooklyn federal court.

“You know what I mean. Imagine what the news channel would call me, the ‘Looney Tunes Terrorist’ or the ‘Blind Terrorist.’ ”

Alam, a Bangladeshi citizen living in Jackson Heights, Queens, allegedly discussed buying suicide vests and hand grenades — but opted instead to try and shoot up the Crossroads of the World, the documents said. There was no indication he trained overseas, a law-enforcement source told The Post. Alam was charged with knowingly receiving two firearms with obliterated serial numbers in Brooklyn as part of the plot.

In the charging documents, Alam expressed his desire to destroy the new World Trade Center in lower Manhattan with “probably a rocket launcher, like a huge one.”

Alam also praised Osama bin Laden, claiming that his “mission is a complete success, thousands of American soldiers died and trillions of their monies gone in the war.”

The aspiring terrorist had hoped he and the undercover informant would become “legends” from the planned attack.

In January, Alam and an informant agreed to do a “recon” and met at Times Square and took cellphone images and videos as Alam stated he was “looking for potential targets,” the documents allege.

Alam was arraigned in Brooklyn federal court on Friday, where prosecutors said the Lasik surgery he received was intended to help him “shoot more accurately.”

Alam stood quietly in court as his mother cried into her headdress. Prosecutor David Kessler said Alam had “taken specific steps to plan an attack,” including “research on Times Square and firearms, explosives.”

The suspect also “got Lasik surgery to be able to shoot more accurately,” Kessler said.

Alam’s defense argued that the suspect works two jobs and is a senior at John Jay College of Criminal Justice.

Judge Cheryl Pollack ordered Alam held without bail.