The Popish Plot was an alleged Catholic conspiracy. In reality the public scandal was provoked by a conspiracy to discredit Catholics in England.
In 1678 a corrupt English clergyman named Titus Oates announced that he had uncovered a "Popish Plot" to murder King Charles II of England and replace him with James, his Roman Catholic brother. Nonconformists rushed to support the AnglicanWhigs, who consequently won a great majority in the House of Commons. In 1679 the Whigs passed the "Exclusion Bill" to keep James from the throne, but the act failed to pass the House of Lords. It later developed that Oates had lied, and Whig popularity declined after capitalising off of near-civil-war.
The Gunpowder Plot of 1605 was a desperate but failed attempt by a group of provincial English Catholic extremists to kill King James I of England, his family, and most of the Protestant aristocracy in one fell swoop by blowing up the Houses of Parliament during the State Opening.
The Gunpowder Plot was one of a series of unsuccessful assasination attempts against James I; the Main Plot and the Bye Plot of 1603 being earlier attempts.
Many modern historians think that Cecil's agents had infiltrated the plot early on in its gestation but allowed it to continue for dramatic effect; certainly the propaganda value of a "Popishplot" was not underplayed during the next few hundred years.
Disaster came suddenly, without fault on Pepyss part, and his career was closed for a time.
In 1678, the popishplot was invented, and the death of Sir Edmund Berry Godfrey drove the public mad with alarm, while unprincipled men took the opportunity of compromising their enemies in order to bring about their condemnation on false issues.
Pepys had enemies who sought to sacrifice him by means, chiefly, of the fictitious evidence of a miscreant named John Scott (calling himself colonel Scott).