WordPress AI / Security

PHP Object Injection Explained for Site Owners (and Why AI-Written Code Needs a Lint Check)

October 2026 advisories again list PHP object injection in WordPress plugins and themes. You do not need to be a developer to understand the risk, or to know what to ask when an AI writes PHP for your site.

Security
PHP
7 min read

Quick Answer

PHP object injection happens when a site takes data from a visitor and rebuilds it into a PHP object using unserialize(). If a suitable class exists on the site, the attacker can steer what it does, which can lead to file deletion or code execution. The fix is vendor patching. When an AI writes PHP for you, the safeguards are linting, verification and a snapshot before anything is saved.

Who This Is For

Site owners who see “PHP object injection” in a security notice, and developers who let an AI edit theme or plugin code.

What It Is

PHP can turn an object into text (serialize) and back (unserialize). That is safe when the text comes from your own code. It becomes dangerous when the text comes from a form, cookie or request that a visitor controls. The visitor can craft input that rebuilds an object of their choosing, and on some sites that object triggers harmful actions when PHP cleans it up.

The attack needs two things at once: unsafe unserialize() on visitor data, and a usable class already present on the site. That is why it often depends on which plugins and themes you have installed together.

In plain English: the site trusts a package it should have inspected, and a stranger gets to decide what is inside.

Recent Examples

These are advisories listed in October 2026. Check the vendor’s page before acting, because versions and fixes change.

ItemAffected versionsStatus reported
Affiliates plugin7.0.1 and earlierFixed in 7.1.0
Convex theme1.16.0 and earlierNo official patch listed at the time of writing
WP Ultimate Exporter3.0 and earlierFixed in 3.1

What a Site Owner Can Do

  • Update. Patched versions are the fix. Turn on updates for security releases.
  • Remove what you do not use. An inactive plugin can still be a risk if it is vulnerable and present.
  • Replace abandoned items. If a theme has no patch, plan to move off it.
  • Keep backups you have tested. Restore matters more than prevention when something slips through.

When an AI Writes PHP

If you let an assistant edit a child theme or your own plugin, a mistake in PHP can take the site down, and sloppy code can create new holes. Revi MCP’s Developer Mode is built around that risk:

  • It is off by default and independent of the other safety modes.
  • Writes are limited to a theme, a child theme, or plugins you explicitly allowlist as your own code.
  • Every PHP write is linted against a temp copy first and rejected if it is broken.
  • The file is verified byte for byte after it lands and snapshotted before the change.
  • WordPress core, wp-config.php and .htaccess are always off-limits.

A lint check catches syntax errors. It does not prove code is secure, so review anything that handles user input, and never ask an AI to add unserialize() on request data.

Let AI Edit Code With Guardrails

Developer Mode lints, verifies and snapshots every PHP write.

See pricing

FAQ

Am I affected if I do not use those plugins?

Not by those specific items, but the same class of flaw appears regularly. Keep everything updated.

Does Revi MCP protect my site from these flaws?

No. Those are bugs in other plugins and themes and need the vendor’s patch. Revi MCP controls what an AI can change through it.

Is linted PHP safe PHP?

No. Linting finds syntax errors. Security review of code that handles user input is still your job.

Related reading: WordPress MCP server guide · Setup and connection guide · Pricing

Reading about it won’t chase your invoices.

Tell us the task you hate most, and we’ll show you what “gone” looks like.