This installment in the
Diary of a Wimpy Kid series follows Greg Heffley, a middle school student whose school year spirals into chaos as budget cuts, failing test scores, and administrative dysfunction threaten to shut down his school entirely.
Greg opens his diary by reflecting on how little actual learning takes place during the school day. His Latin teacher, Mr. Leyton, is fired after the school discovers he was teaching a completely made-up language for three months. Other teachers are equally ineffective: his Social Studies teacher, Mrs. Lackey, only covers countries she plans to visit in retirement, and the Science teacher, Mr. Rask, has abandoned the curriculum in favor of gross topics like flatulence to hold students' attention. The Algebra position sits vacant after the teacher went on maternity leave, leaving students on a candy-company-sponsored math website. When standardized test scores come back as the worst in the state, the superintendent fires Principal Mancy and brings the former principal, Mr. Bottoms, out of retirement.
Principal Bottoms immediately cuts any class not tied to the standardized test and creates the High Flyers Club, a rewards program modeled on airline loyalty programs. Students with straight A's receive perks such as preferred seating, snacks during class, and early dismissal. Non-members like Greg are squeezed into shrinking classroom space; Greg ends up sitting on a scalding heater in Geometry. The difficulty of earning membership drives widespread cheating, with students writing equations on water bottle labels, building fake arms to conceal phones, and tapping out answers in Morse code. The school brings in a speaker named Clarence Cluster, who claims cheating ruined his life, though Greg suspects he is the same actor his family saw at a dinner theater show.
Meanwhile, the school library becomes a battleground. The librarian, Ms. Masie, had used her own money to stock a popular graphic novel section, with the
Commando Crocodile series in highest demand. When a parent complains that the crocodile character is not wearing pants, the school's policy requires the book's removal. Ms. Masie draws pants on the character with a marker, but students smuggle uncensored copies from home, prompting bag checks at the entrance. More complaints follow, and eventually the banned section grows larger than the main library.
Greg also recounts the history of the school's namesake, Larry Mack, its first principal, who stole school funds to launch a chain of car dealerships and went to prison. A rumor that Mack buried half the stolen money under the school triggers a treasure-hunting craze, with students breaking through locker walls searching for cash.
The school's beloved fudgedogs become another flashpoint. The food item was accidentally created the previous year when cafeteria worker Mrs. Podsner dropped a tofu hot dog into a vat of hot fudge. After a consulting company links fudgedog consumption to declining test scores, Principal Bottoms cancels them. Students stage a walkout, and a compromise is eventually reached: one and a half fudgedogs per student per day.
Conditions worsen after the state diverts education funding to build a new baseball stadium. Greg's school, having scored lowest on the standardized test, absorbs the deepest cuts. Student supplies are rationed, teachers receive one dry-erase marker per week, heat is shut off after lunch, and the exterminator's contract is canceled, leading to cockroach and mouse infestations. The janitorial staff is cut from 10 to three, supplemented by a secondhand cleaning robot that begins attending classes and copying Greg's quiz answers. Teachers start quitting after a promised raise is canceled.
Desperate for revenue, the school launches the Platinum High Flyers Club, which requires no academic merit, only a $12.99 monthly fee. Corporate sponsorships fill the building with advertisements, and the school sells its naming rights to an exterminator, rebranding itself "1-800-DED-BUGS Middle School." After parents protest the advertising, Principal Bottoms pivots to renting out C-wing classrooms to outside tenants, including a bakery, a hot yoga studio, a beekeeper, and the police department's attack dog training unit.
At the annual PTA auction, Greg's mother, Susan Heffley, wins the "Principal for the Day" prize for Greg after a heated bidding war. Principal Bottoms hands Greg a name tag and keys and immediately leaves. Greg spends the day dealing with a burst pipe, handing out lollipops to troublemakers (which incentivizes more misbehavior), and mediating teacher disputes that spiral out of control. The day ends with Greg kissing a pig at an assembly that Principal Bottoms had been avoiding. Greg leaves a note reading "I quit" and goes home.
The student newspaper breaks the news that the state will close the school if test scores do not improve. Students will be split alphabetically between two schools: Fulson Tech, a lavish new facility with napping pods and a chef-designed cafeteria, and Slacksville Middle School, an aging building next to the state dump. Greg is initially assigned to Fulson Tech and his best friend, Rowley Jefferson, to Slacksville. But when Alex Aruda, the smartest student in Greg's grade, is pulled out for boarding school, his removal from the alphabetical list flips every assignment, sending Greg to Slacksville.
On test day, students assigned to Fulson Tech deliberately tank their scores since a school closure benefits them. Thirty minutes in, a chain reaction unfolds: A snake that previously escaped from an event called Randy's Reptile Revue enters the C-wing room where police dogs are being trained, panicking the dogs, who break down their door. The beekeeper opens her door to investigate, releasing her bees into the school. Students evacuate, the test goes unfinished, and the state refuses a do-over.
The school closes. Because Greg is the only student in his neighborhood assigned to Slacksville, no regular bus serves his area, and he arrives each morning in a pet grooming van. The education at Slacksville is even worse, but Greg thrives. He earns the nickname "Time Lord" for being able to read an analog clock and becomes popular after recreating fudgedogs in Home Ec class using the old school's recipe. He attracts a girlfriend named Sophie, and they begin dating.
On their first date, Greg discovers that Sophie's father is Larry Mack Junior, who runs the family car dealership empire. At dinner, their waiter turns out to be Mr. Leyton, the fired Latin teacher. Greg converses with Mr. Leyton in the made-up language, impressing Larry Mack Junior. When Sophie tells her father about Greg's fudgedog success, Larry Mack Junior grows even more interested and spends the evening discussing business with Greg.
Crediting Greg's intelligence to the education he received at Larry Mack Middle School, Larry Mack Junior donates enough money to reopen it as "Larry Mack Junior Middle School." During renovations, workers discover bags of cash hidden in the C-wing walls, confirming the old rumor about Larry Mack's buried money. All displaced students must return, and most are unhappy, making Greg the unintentional villain. Sophie breaks up with him via note because she does not want a long-distance relationship. Larry Mack Junior enrolls part-time at the school and gets Mr. Leyton rehired. Slacksville patents the fudgedog recipe and blocks Greg's school from selling them. Principal Bottoms refuses to return from the Caribbean, and the temporary replacement appears to be the same actor who played Clarence Cluster, leaving Greg with serious doubts about the future of his education.