Dipstick for Craft CMS

Dipstick is a Craft 6 plugin. Craft 6 is still in beta, and so is Dipstick (6.0.0-beta.1) — try it on staging first and use caution on production sites.

Craft 6 · Beta — use caution on production

Check the engine before you run on Octane

Octane keeps your Craft 6 app in memory between requests. Code written for one-request-per-process PHP doesn't expect that: a static cache or a singleton that remembers the signed-in user hands it to the next visitor. Dipstick finds those spots before your visitors do.

Dipstick

Features

Two ways of looking, one report, and a fix for every finding.

A static scan that never runs your code

Every PHP file in your app, each installed plugin and your Blade templates is parsed, not executed. Static properties set from the request, singletons and controllers that keep the user or site, growing static arrays, globals, superglobals, native headers, exit calls.

A runtime probe that acts like a worker

One process, several simulated requests per site from different visitors, the way Octane serves them. Afterwards Dipstick looks through every service and static property for a request, user or site left over from an earlier request.

Sandboxed

The probe runs in its own short-lived process. Database writes are rolled back; mail, notifications, queued jobs and HTTP calls are faked. Nothing it does is kept or sent, and your web and queue workers are never touched.

Multi-site aware

A service that keeps the current site serves one site's content or language to another. Dipstick probes every site in turn, so site-scoped leaks show up — the most common Octane bug on a multi-site install.

Remediation first

Every finding says why it matters under Octane and how to fix it, with code: scoped() instead of singleton(), once() instead of a static cache, the request in the action instead of the constructor.

  • Score and grade, critical / warning / notice
  • Ignore by fingerprint or @dipstick-ignore

Fits CI

craft:dipstick:scan exits non-zero on critical (or warning) findings and prints JSON, so a pull request that adds a leaky singleton fails before it ships.

From the command line or CI

The same audit as the control panel's Run an audit button, stored with the rest.

bash
php artisan craft:dipstick:scan
# Octane readiness: 62/100 (D) — 1 critical, 1 warning, 0 notice

php artisan craft:dipstick:scan --fail-on=warning   # exit 1 on warnings too
php artisan craft:dipstick:scan --json --no-probe   # static scan only, for CI

Frequently Asked Questions

The questions worth answering before you install it.

Audit before you switch

Dipstick is free. It's a Craft 6 beta plugin on a beta CMS — start on a development or staging site and use caution on production.

More plugins

Pairs well with Dipstick