Careful code, honest numbers

WordPress Plugin Security: What the Handbook Requires, What the Vulnerability Numbers Actually Measure

Most writing about plugin security sells fear by the percentage. The useful version is duller and more practical: four rules WordPress.org publishes for free, a handful of published figures read the way their publisher wrote them, and a checklist that catches the common mistakes before a customer's data does.

November 13, 2026 · 9 min read

acmedentalcare.com · plugin code review
A contact form plugin, read against the handbook
The export works for anyone who knows the address
  • PassForm fields validated or sanitized on arrival
  • PassEntries escaped when shown in the admin
  • PassNonce on the entry delete link
  • FailCapability check on the CSV exportmissing
  • FailPermission callback on the REST routenot set
  • WarnRuns on a supported PHP versionhost on 7.4
Illustrative: a sample code review of a fictional dental office's form plugin

The short answer

Secure WordPress plugin development follows WordPress.org's security handbook: never trust user input, validate it, escape output as late as possible, protect forms with nonces, and check user capabilities before every action, because nonces are not access control. Patchstack's 2025 data found 91% of newly found WordPress vulnerabilities in plugins, a count of flaws found, not of hacked sites. Nobody can promise an unhackable plugin.

On this page
  1. Ninety-one percent of what, exactly
  2. Four rules WordPress.org already wrote down
  3. Broken access control, explained with a contact form
  4. Our review list for every plugin we write or inherit
  5. Why careful custom code lowers risk without removing it
  6. Update it, replace it, or have it rewritten
  7. Getting a plugin reviewed

Ninety-one percent of what, exactly

The figure gets quoted everywhere, usually wrong. Patchstack's report State of WordPress Security in 2026, covering 2025 and updated February 25, 2026, says "91% of new vulnerabilities were found in plugins, and 9% were found in themes." It counts newly found flaws. It does not count hacked websites, and it does not say 91% of hacks come through plugins. Nobody published that number, so we will not invent it.

Read correctly, the figures are still worth an owner's attention. Patchstack sells WordPress security products, which is worth knowing when you weigh any security vendor's report, and every number below is as published and as of November 2026.

Patchstack's 2025 WordPress vulnerability figures, from its report updated February 25, 2026, quoted as published
FindingAs Patchstack published itWhat it does and does not mean
New vulnerabilities"11,334 new vulnerabilities were found in the WordPress ecosystem in 2025", a "42% increase compared to 2024"Flaws reported, not sites attacked
Where they were found"91% of new vulnerabilities were found in plugins, and 9% were found in themes"; "only 6 vulnerabilities reported in the WordPress core"Plugins are where most new flaws turn up; core had very few
Unfixed at disclosure"46% of vulnerabilities did not receive a fix from the developer in time for public disclosure"Updating cannot help when no update exists yet
Speed of attack"the weighted median time to first exploit is 5 hours"Patching on a monthly calendar can be too slow for the serious ones
Most exploited type"Broken Access Control was the most exploited vulnerability"Code that forgot to ask who is allowed to do something
Severity"1,966 (17%) vulnerabilities had a high severity score"Most were not rated high severity; about one in six was

Wordfence, another security vendor, reported in its Q2 2026 quarterly report, published September 2026, that "the majority of the vulnerabilities disclosed in Q2 were plugin related vulnerabilities." We read that report only through search summaries, because its site blocks automated reading, so treat it as a second opinion, not a measurement.

Four rules WordPress.org already wrote down

The best security guide for plugin code is free and published by WordPress.org. Its Common APIs Handbook, Security section, read in November 2026, opens by congratulating the reader on working code, then asks the question every developer should hear once: "But is it safe?" Its guiding principles start with "Never trust user input" and "Escape as late as possible," and add "Sanitization is okay, but validation/rejection is better."

Never trust user input

The handbook says "Don’t trust user input, third-party APIs, or data in your database without verification." Validation "should be performed as early as possible" and should "Accept data only from a finite list of known and trusted values" where it can.

Escape as late as possible

Escaping strips "unwanted data, like malformed HTML or script tags" from output. The handbook's rule: "You always want to escape when you echo, not before."

Nonces guard forms, not doors

A nonce helps "protect URLs and forms from certain types of misuse" including CSRF, and lasts one day by default. The handbook is firm: "Nonces should never be relied on for authentication, authorization, or access control."

Check capabilities every time

"As you build a plugin, make sure to run your code only when the current user has the necessary capabilities." Every action, every screen, every request.

Dark green chalkboard with chalk arrows and small lock doodles circling a plain brass key laid on a torn scrap of halftone paper, no words or letters
Plugin security is mostly a short list of rules, applied every single time.

Broken access control, explained with a contact form

Patchstack's most exploited category sounds abstract. It is not. Picture a custom plugin that stores contact form entries and gives the office an Export button. The button works. The developer hid it from everyone but administrators. What the developer did not do is check, when the export request arrives, whether the person sending it is an administrator. Anyone who learns the address can download every customer's name and phone number.

That is the whole category in one paragraph: code that does the right thing for the right person and never asks who is asking. The fix is the capability check from the handbook, run on the server, on every request. A nonce on the button does not fix it, which is exactly why the handbook says nonces are not for access control.

The same trap waits in custom REST API routes. WordPress.org's REST API Handbook, read in November 2026, says "You must also register a permissions callback for the endpoint," and that since WordPress 5.5, leaving the permission_callback out triggers a _doing_it_wrong notice. Public endpoints may use __return_true, deliberately. We treat every endpoint as private until someone decides, in writing, that it should be public.

Hiding a button is manners. Checking who pressed it is security.

Our review list for every plugin we write or inherit

Whether the plugin is ours or arrived with the site, this is the list we read it against. It is drawn from the handbook and the directory guidelines, plus habits we hold as practice.

  • Every input validated or sanitized where it enters: form fields, query strings, API responses and values read back from the database.
  • Every output escaped at the moment it is printed, including admin screens, because "Even admins are users."
  • A nonce on every form and state-changing link, checked before anything happens.
  • A capability check on every action and screen, on the server, not just a hidden menu.
  • A permission callback on every REST route, private unless deliberately public.
  • WordPress's bundled libraries only. Directory guideline 13 says plugins "may not include those libraries in their own code" for "security and stability reasons."
  • No calls to outside servers without consent, matching guideline 7: plugins "may not contact external servers without explicit and authorized consent."
  • A supported PHP version. WordPress.org says PHP 7.4 has reached end of life and "may expose your site to security vulnerabilities."

The directory guidelines bind only plugins listed on WordPress.org, and a private plugin built for one business is not listed there. We apply the relevant ones anyway, because they are sensible. Our admin dashboards and custom forms pages show the checks in context.

Why careful custom code lowers risk without removing it

No primary source says custom plugins are more secure than bought ones, so we will not say it as a fact. Here is the reasoning, labeled as reasoning. A plugin written for one job contains less code than a general plugin with 400 settings, and code that is not there cannot be wrong. Replacing five third-party plugins with one of your own also means fewer vendors' advisories to track and fewer developers whose schedule decides when your fix arrives. Our plugin replacement service scores each plugin before anyone writes code. The same bargain caught some of the largest sites on the web on November 16, 2026, when an attacker slipped malicious code into Optimizely's testing scripts; our breakdown of the Optimizely hack shows how a trusted vendor became the way in. A third-party script audit lists what your own pages load and who owns it.

The honest counterweight: a popular plugin has thousands of sites and a crowd of security researchers looking at it. Your custom plugin has your developer. That is why the review list above matters, and why a second reader is worth paying for on anything that handles money or personal data. No developer, including us, can promise a plugin that cannot be hacked. Anyone who does is selling the promise.

Update it, replace it, or have it rewritten

Most sites need less drama than a security vendor's sales page suggests. A new host will not fix a risky plugin either, as our look at what moving hosts changes explains. WordPress.org's auto-updates documentation, last updated January 13, 2023, puts the first rule simply: "To keep your WordPress site secure, you should always update your plugins and themes to the latest version." A well-maintained plugin from an active developer, kept updated, is a reasonable choice, and often a cheaper one than ours.

  1. 1

    Update what has updates

    Test on a staging copy for plugins that touch checkout or leads; our maintenance page covers the routine.

  2. 2

    Replace what has gone quiet

    A plugin with no recent release and an open advisory is a candidate for removal. Our fixed-price plugin fixes, from $149 to $399, cover the swap.

  3. 3

    Rewrite what is yours and unsafe

    Custom code that fails the review list gets fixed or rebuilt to the handbook, from $575, depending on complexity, on a fixed written estimate.

  4. 4

    Rethink a site held together by plugins

    If the security list runs to dozens of plugins, see replacing plugin bloat or the free should I leave WordPress? check.

Day to day, our hosting and maintenance plans, from $55 a month as of November 2026, include a firewall, malware scans and alerts that reach a person, as that page describes. The comparison of WordPress and Next.js security covers the platform question.

Getting a plugin reviewed

Send us the plugin, or tell us which ones the site runs. We read the code against the list above and write down what we find, in plain English, with what to fix first. If the fix is a rewrite, the custom plugin development estimate is fixed and in writing. The section overview explains how we build plugins generally, and our page on who owns plugin code covers what to sort out before anyone touches it.

DataCram is a web studio in San Antonio, Texas, building for the web since 1999, working with businesses across the US by phone, video and a shared project page. Start with the free website health check or call (210) 346-0848.

Questions owners ask about custom WordPress plugins

No published source says that. Patchstack's report covering 2025 found 91% of newly found WordPress vulnerabilities were in plugins and 9% in themes, as of November 2026. That counts flaws discovered, not sites hacked. It tells you where new flaws turn up, which is a good reason to keep plugins few, current and well written.

Not automatically, and no study we know of measures it. Custom code written to WordPress's security handbook avoids the common mistakes, and fewer third-party plugins means fewer vendors' advisories to track. A popular plugin, though, gets reviewed by many researchers. A custom plugin's safety depends on its developer and on review.

A nonce is a token WordPress uses to protect URLs and forms from misuse such as cross-site request forgery; by default it lasts one day. It is not enough on its own. WordPress.org's handbook says nonces should never be relied on for authentication, authorization or access control. A capability check does that job.

It means the plugin performs an action without checking whether the current user is allowed to. Patchstack named it the most exploited vulnerability type in its 2025 data. The usual fix is a server-side capability check on every action, plus a permission callback on every custom REST API route.

No, and be wary of anyone who does. We can write the plugin to WordPress.org's security handbook, review it against a written checklist, keep it on a supported PHP version and update it when something changes. That lowers risk. It does not remove it.

Yes, after a backup and a test on a staging copy. A deactivated plugin still sits on the server, and a plugin nobody uses is one nobody watches for updates. WordPress.org's optimization guidance also recommends deleting unnecessary plugins for performance.

Keep reading

Free · No obligation

Have a plugin read by someone careful

Tell us which plugin worries you and what it handles. Someone at DataCram replies with what a review covers, what it costs and what we would check first.

Which of these sounds like you? (pick any)

Rather talk now? Call (210) 346-0848.

CallGet a quote