In 1892 Wilde wrote a play called Lady Windermere's Fan, a comedy that hinged on manners, secret identities and the Victorian terror of the social faux pas. For the first time, one of his plays was a hit. He then wrote a play called Salomé, about the Biblical character who demands the execution of John the Baptist in the New Testament. The play was written in French, but it was years before it could be performed due to a French law that forbade the dramatic portrayal of Biblical characters.
Wilde's play A Woman of No Importance premiered in 1893. The comedies An Ideal Husband and The Importance of Being Earnest premiered in early 1895. Earnest was Wilde's last play, and is considered his best for its dead-on satire. Wilde's plays mined for comedy the intricate rules of Victorian courtship and social interactions. The characters in his plays were often scheming, lying, and hiding things from themselves or each other, behind a veneer of Victorian manners. Wilde eviscerated these hypocrisies with his pen.
It was a period of great creativity for Wilde. It was also an important time in his personal life. A few years earlier, Wilde had been introduced to Lord Alfred Douglas, then an undergraduate student at Oxford. Wilde and Douglas, or "Bosie" as Wilde called him, soon began having a romantic affair. Word of their relationship eventually leaked to Douglas's father John, the Marquess of Queensberry. Queensberry was a belligerent man, and he did not like the idea of his son being in a homosexual relationship with an older man. He set out to take Wilde down.
On 14 February 1895, Queensberry showed up at St. James's Theatre in London with an armload of vegetables, which he planned to throw at Wilde when he took his bows at the end of The Importance of Being Earnest. This plant-based attack was thwarted when Queensberry was denied entry to the theater. Four days later, he left a calling card at Wilde's home addressed to Oscar Wilde, "posing somdomite" (a misspelling of Sodomite). Wilde was furious. He decided to sue Queensberry for libel. It turned out to be the worst decision he ever made.