Skip to content

Extension Stability & Safety Since 3.5.0

Extensions run as PHP inside your site, so a buggy or careless one could, in principle, slow a page down, crash it, or do something you didn’t expect. Total CMS adds guardrails so that doesn’t happen — and so you can see exactly what an extension does before you trust it.

There are four layers, all working automatically:

  1. Crash protection — a misbehaving extension can’t take a page down.
  2. Performance monitoring — you can see what each extension costs, and get warned when one is slow.
  3. The pre-enable review — before enabling an extension that touches anything sensitive, you see what it does and why.
  4. Update re-consent — an updated extension can’t silently introduce risky code or new privileges.

Most of this is invisible when everything is healthy. It only surfaces when there’s something you should know about.

Several of these behaviors depend on whether your site is in Production or Development. Set this in Settings → General → Site Environment.

ModeBehavior
Production (default)Protects live visitors: extension errors are contained silently, and an extension that crashes repeatedly is automatically disabled (quarantined).
DevelopmentSurfaces extension errors loudly so you can fix them, and never auto-disables an extension.

If an APP_ENV environment variable is set on the server, it overrides this setting (and Stacks’ in-app preview uses it automatically). When APP_ENV is present, the dropdown is shown but locked, with a note explaining it’s controlled by the environment.

Every place an extension’s code runs during a request — Twig functions and filters, event listeners, and so on — is wrapped so that if it throws an error, the page still renders. The broken piece simply produces nothing instead of a white screen.

In Development, the error is logged loudly so the extension’s author can see and fix it. In Production, it’s contained quietly to protect your visitors.

If an extension crashes repeatedly on a Production site (by default, 5 times within 5 minutes), Total CMS disables it for you — the site heals itself rather than serving broken pages. Every admin page shows admins a warning naming the extension and its last error, and the Extensions page shows:

Auto-disabled for stability. Total CMS disabled this extension after it crashed repeatedly. [Re-enable]

The warning stays until you re-enable the extension or disable it yourself.

Re-enabling clears the quarantine and gives the extension a fresh start. This only happens in Production — in Development, a crashing extension stays enabled and loud so you can debug it.

Total CMS measures how much time each extension adds to a request and surfaces it on the Extensions page — a small line on each card showing the average and most-recent cost, plus a count of any recent errors.

Measuring has a tiny cost, so on Production it’s sampled: by default, 1 request in 50 is profiled. You can change this in Settings → Extensions:

  • Extension profiling (1 in N requests) — 0 turns profiling off entirely, 50 is the default sample rate, 1 profiles every request. Development and preview always profile fully (the overhead doesn’t matter there).

When an extension — or all your enabled extensions combined — adds more time than you’d like, the Extensions page shows a soft warning. The thresholds are configurable in Settings → Extensions:

  • Per-extension slow warning (ms / request) — default 200. Warns when a single extension is heavy.
  • Total extension slow warning (ms / request) — default 500. Warns when your extensions, combined, are heavy.

Set either to 0 to disable that warning. These are guidance only — nothing is disabled automatically for being slow; the decision is always yours.

Most extensions enable in a single click. But when you enable one that touches anything sensitive — or whose source code contains high-risk patterns, whose developer left a note for you, or that ships an agent skill — Total CMS first shows you a short review screen so you can make an informed decision. A freshly uploaded extension lands on the same screen when it has any of these.

You’ll see the review when an extension uses any of these capabilities:

CapabilityWhy it’s flagged
routes:publicExposes public, unauthenticated endpoints
events:listenCan observe all content changes
automationsRuns server-side code automatically on a schedule or content events
mcp:toolsRegisters actions AI agents can call (reachable externally if MCP public access is on)
mcp:resourcesExposes data that AI agents can fetch

Container definitions (container) are deliberately not flagged: extensions can only register services under their own namespace — any attempt to override a core Total CMS service is denied at load time and logged. Registering your own services is infrastructure, not a risk surface.

…or when a quick static scan of the extension’s source finds high-risk calls (shell_exec, eval, raw network requests, base64_decode, and similar). The scan reads the code as text — it never runs the extension to check it.

Bundled extensions (the ones that ship with Total CMS) are exempt from the source scan — they version with core and ship reviewed in the package. Their capability list still shows. For extension developers: persisting files through the storage API instead of raw file_put_contents() keeps your scan clean — the flag exists for unconstrained writes, not for state kept in the sanctioned per-extension directory.

The review screen has up to four parts:

  1. From the developer — a plain-language note (the extension’s reviewNote) explaining what it does and why it needs the access it asks for.
  2. What this extension can access — the sensitive capabilities, in neutral terms, with a reminder that you can disable individual features afterward.
  3. Source-code patterns to review — any high-risk calls the scan found, with file and line. These aren’t proof of anything malicious — many legitimate extensions use them — but they’re worth a look.
  4. What this extension tells AI agents — the full text of the agent skill it ships, if any. While the extension is enabled that text is installed into the project’s .claude/skills/ and read by coding agents working there, so read it as instructions you would be giving the agent yourself.

From there you Enable (apply it) or Cancel. An extension with none of the four — no developer note, no sensitive capability, clean code, no agent skill — skips the review entirely.

Every capability an extension uses becomes a permission toggle in the extension’s settings. You can switch any of them off — disabling just that part of the extension without uninstalling it. So if you want an extension’s Twig functions but not its public endpoint, you can have exactly that.

The review happens when you enable an extension. But an extension can also be updated later — and a new version could introduce risky code or new privileges that you never agreed to. Total CMS handles that too, for sideloaded extensions (ones you installed yourself into tcms-data/extensions/).

When a sideloaded extension’s version changes, Total CMS runs the static source scan on the new code (again, without executing it):

The scan is compared with what you approved. When you enable an extension, Total CMS remembers the risky patterns its review showed you, by pattern and file (curl_exec @ src/Client.php). An update is measured against that list, not against zero:

  • If the new code adds a risky pattern you have not approved (a new call, or a known one in a new file), the extension is disabled until you review it. Every admin page shows admins a warning naming the extension and the new findings, until you re-enable it or disable it yourself. Its settings page lists them too, with a Review & re-enable button that walks you through the review screen for the new version. Re-enabling approves the new version’s findings in turn. The risky new code never runs until you say so.
  • If it adds none, the extension keeps working, including when it still has the patterns you approved. An HTTP client you accepted at 1.0 does not disable the extension at 1.1. Any new capability the update introduces is turned off by default. It appears in the extension’s settings as a toggle you can opt into. The extension doesn’t silently start using a new privilege you didn’t grant.

Updates that add no new risky code and no capabilities install with no interruption at all. An extension enabled before Total CMS 3.6.3 has no approved list yet; its next update takes the findings it has then as approved, rather than disabling it once more.

The same check runs when you upload a replacement on the Extensions page or run tcms extension:install over an installed extension — and there it does not depend on the version number changing. A replacement that adds risky code you have not approved to an enabled extension is disabled pending review even if the developer shipped it under the same version.

Built-in (bundled) extensions are exempt — they ship and update with Total CMS itself, so they’re not re-reviewed on a core upgrade.

The scan is a heuristic that catches obvious high-risk patterns; it is not a guarantee against a determined attacker. For untrusted extensions, the safest source is one you trust — and a future verified extension registry will add cryptographic signing on top of these protections.

If you’re building an extension, these features shape how operators experience it:

  • Write a reviewNote. If your extension uses any sensitive capability, the operator will see the review screen — your note is your chance to explain, in plain language, what you do and why. A note on its own is enough to put the review screen in front of the operator, so keep it to what they need before enabling. A good note is the difference between a confident “Enable” and a nervous one.
  • You see exactly what they see. When you enable your own extension while testing, you get the same review screen — so you can preview how it reads.
  • Capabilities you add in an update default to off for existing users. They’ll find the new capability in your extension’s settings and opt into it. Plan for that: don’t assume a capability added in a point release is immediately active for everyone.
  • The same applies while you develop. Add a Twig function, a command or any other registration to an extension that is already enabled, and its capability is detected at the next boot and stored turned off — the function or command is simply absent, with no error in templates or tcms list. The log carries a warning naming the capability. Turn it on under Admin → Extensions, or run tcms extension:enable <id> again, which grants new capabilities on re-enable.
  • Keep high-risk calls intentional and explainable. If your code legitimately needs file_get_contents('https://…') or base64_decode, that’s fine — it’ll show on the review screen, and your reviewNote can put it in context. Avoid surprising patterns you can’t justify.

See the Manifest Reference for the reviewNote field and the full capability list.