Search by

dpezer / silverstripe-site-health

dpezer

Site Health screen for Silverstripe CMS 6: status checks with a health score and recommendations

Package info

github.com/dpezer/silverstripe-site-health

Type:silverstripe-vendormodule

pkg:composer/dpezer/silverstripe-site-health

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-12-01 23:24 UTC

This package is auto-updated.

Last update: 2026-12-01 23:24:38 UTC


README

A Site Health screen for the Silverstripe CMS 6 admin. It runs a set of checks against the site and its server, scores the result, groups the findings by category and explains each one with what to change.

  • 21 checks for Silverstripe and Composer packages (versions and known vulnerabilities), PHP, the database, email, disk and folders, and what the web root exposes.
  • A dashboard: overall score, checks passed, warnings, critical issues and a score per category.
  • Extensible: any module can register its own checks.
  • No cron job, no database tables: the checks run when the screen is opened.

Screenshots

The Status tab: the score, a score per category and what to fix first.

The Status tab of Site Health: overall score, categories and critical issues

The Info tab: facts about the site and its server, a check of the server clock against your browser, and an export for support.

The Info tab of Site Health: Silverstripe versions, the server clock and the date and time of the server

Requirements

  • PHP 8.3 or newer
  • Silverstripe CMS 6.2 or newer (silverstripe/framework ^6.2, silverstripe/admin ^3). Tested with 6.2 and 6.3. Silverstripe 6.1 is not supported: its newest release still has known security vulnerabilities that are fixed in 6.2, so update the site first.
  • Optional: outbound HTTPS access to repo.packagist.org, packagist.org and endoflife.date. Without it the checks that need release information report that they could not be checked.

Installation

composer require dpezer/silverstripe-site-health:dev-main

No version has been tagged yet, so the module is installed from the main branch. Name dev-main explicitly: a plain composer require only finds a development version when the project's minimum-stability allows it. To install it for development only, use composer require --dev.

Then flush once (?flush=1, or sake flush). The module has no database tables, so dev/build is not needed, and the stylesheet is exposed by the Silverstripe vendor plugin.

Open Site Health in the CMS menu (/admin/site-health). Access needs the View site health information permission (under CMS Access), or Access to all CMS sections, or the administrator role.

What it checks

Category Check What it looks at
Security Known vulnerabilities Installed Composer packages against the security advisory database composer audit uses
Security Development packages require-dev packages installed on a live site
Security HTTPS Whether the site is served over HTTPS, including proxies Silverstripe does not trust
Security Web server document root Whether it is public/, not the project folder. If it is the project folder, the check asks the site for .env, composer.json and similar files with a HEAD request (nothing is downloaded): critical when one can be downloaded, only a recommendation when rewrite rules such as an .htaccess file refuse them
Security Allowed hosts SS_ALLOWED_HOSTS set, and entries that can never match
Security Files in the web root phpinfo.php, .env, database dumps, logs, backup copies, .git, other PHP files ...
Security Resources folder _resources (extra.resources-dir) present, no stale second folder
Security Environment type SS_ENVIRONMENT_TYPE
Security Default admin account SS_DEFAULT_ADMIN_* left configured on a live site
Silverstripe & packages Silverstripe version Installed framework and CMS against the latest release
Silverstripe & packages Composer packages Packages the project requires directly against their latest releases
Server & PHP PHP version Silverstripe's PHP requirement, the supported versions per Silverstripe release, PHP end of life
Server & PHP PHP extensions Required and recommended extensions of the PHP that serves the site
Server & PHP PHP memory limit At least the 48M Silverstripe requires
Server & PHP File uploads file_uploads, the temporary upload folder, post_max_size against upload_max_filesize
Server & PHP Error log Whether warnings and errors are written anywhere, and the log is outside public/, writable, not huge
Database Database server version MySQL 8.0 or newer, end of life of MySQL, MariaDB and PostgreSQL
Email Email sending MAILER_DSN: for SMTP it connects and logs in without sending a message
Email Email addresses A valid admin_email, and SS_SEND_ALL_EMAILS_TO not left on a live site
Files & Storage Writable directories Assets and temp folders
Files & Storage Free disk space Free space on each disk the site writes to

Each result is good, recommended or critical. Many checks are stricter on a live site than in development.

Score

The score follows this formula: a critical issue weighs 1.5 and a recommendation counts for half a failure. The site is Good at 80 or more with no critical issue, otherwise Needs attention.

The Info tab

Next to Status there is an Info tab with the facts about the site, grouped in sections you can open and close: Silverstripe, server and PHP extensions, the date and time of the server, Composer packages (grouped by direct requirement, Silverstripe, other and development), database, content (counts of pages, Elemental blocks, files, users, groups, administrators and locales), filesystem, environment variables, email and the current health results.

To get help, Copy site info to clipboard puts a text report in your clipboard, ready to paste into an issue or an email, and Download as JSON saves the same data as a file. Both are for support and contain no secrets:

  • Only a fixed list of environment variables is read, never the whole environment. Passwords, usernames and tokens show set or not set, and MAILER_DSN shows only its scheme (for example smtps).
  • Fields marked private (server paths, host names, the mail server address, the admin URL, the sender address, the account PHP runs as) are visible on the screen but left out of the copy and the download.
  • The content counts are read through the ORM when the tab is opened, so on a very large site that tab takes a little longer than Status. Counts for modules that are not installed (Elemental, Fluent) are left out.

At the top of the tab a Server clock box compares the time of the server with the clock of the browser you are looking at, which catches a server that is an hour behind or ahead. It compares the exact moment (seconds since 1970), so a different timezone is not a difference, and a gap of less than a minute counts as the same time because the page needs a moment to arrive. The comparison is made in your browser: nothing is sent anywhere and it is not part of the export. It needs JavaScript; without it the box stays empty.

The tab needs the same VIEW_SITE_HEALTH permission as Status.

Add your own section by implementing Dpws\SiteHealth\Info\InfoProvider and listing it in YAML:

Dpws\SiteHealth\Info\InfoRegistry:
  providers:
    - MyVendor\MyModule\MyInfoProvider
  disabled_providers:
    - Dpws\SiteHealth\Info\Provider\PackagesProvider

Read more variables as "set or not set" with EnvironmentProvider.presence_variables; the same class has value_variables and private_variables for values that are safe to show.

Configuration

Everything is configured in YAML. Switch a check off by class name or ID:

Dpws\SiteHealth\Check\CheckRegistry:
  disabled_checks:
    - disk_space

Accept a known advisory or leave a package out:

Dpws\SiteHealth\Check\SecurityAdvisoriesCheck:
  ignored_advisories:
    - PKSA-xxxx-xxxx-xxxx   # or a CVE number
  ignored_packages:
    - vendor/package

Change thresholds:

Dpws\SiteHealth\Check\DiskSpaceCheck:
  critical_free_bytes: 524288000        # 500 MB
  recommended_free_bytes: 2147483648    # 2 GB

Other options include PublicFilesCheck (critical_patterns, recommended_patterns, allowed_php_files, ignored_paths, scan_depth), PhpVersionCheck (supported_php, eol_warning_days), PhpExtensionsCheck (required_extensions, recommended_extensions), EmailTransportCheck (probe_timeout, probe_lifetime), WebRootCheck (probe, probe_files, probe_timeout, probe_lifetime, probe_failure_lifetime) and HealthReport (category_order). Each class documents its options next to the private static property.

Hiding it from the CMS menu

Site Health is in the menu for everyone who has the VIEW_SITE_HEALTH permission, and administrators always have it. If editors who are administrators do not need to see it, use the framework's own setting:

Dpws\SiteHealth\Admin\SiteHealthAdmin:
  ignore_menuitem: true

This only removes the menu entry. /admin/site-health keeps working for everyone who is allowed to view it, so a developer can still open it by its address. To take away access, remove the permission from the group instead.

Writing your own check

Implement Dpws\SiteHealth\Check\HealthCheck and register the class:

use Dpws\SiteHealth\Check\Category;
use Dpws\SiteHealth\Check\CheckResult;
use Dpws\SiteHealth\Check\HealthCheck;
use Dpws\SiteHealth\Check\Status;

class QueueIsMovingCheck implements HealthCheck
{
    public function getID(): string
    {
        return 'mymodule_queue_moving'; // unique, prefixed with your module
    }

    public function getTitle(): string
    {
        return _t(self::class . '.TITLE', self::class . '.TITLE');
    }

    public function getCategory(): string
    {
        return Category::SERVER; // or a key of your own
    }

    public function run(): CheckResult
    {
        return new CheckResult(
            check: $this->getID(),
            status: Status::Good,
            label: 'The queue is processing jobs',
            description: 'Why this matters.',
            details: ['Last job finished 2 minutes ago'], // optional list
            actions: [['title' => 'Documentation', 'url' => 'https://example.com/docs']], // optional links
        );
    }
}
Dpws\SiteHealth\Check\CheckRegistry:
  checks:
    - MyVendor\MyModule\QueueIsMovingCheck

Results are plain text: the screen escapes them. Keep checks cheap and read-only. A check that throws does not break the screen: it shows as "could not be completed" and the details go to the log. A category of your own needs a translation entry Dpws\SiteHealth\Check\Category.<key> in your module's lang file.

What leaves your server

Request Sends Used for
repo.packagist.org/p2/<package>.json package name latest releases
packagist.org/api/security-advisories/ package names known vulnerabilities
endoflife.date/api/<product>.json product name (php, mysql, ...) end of life dates
The mail server in MAILER_DSN an SMTP login, no message email check
The site's own address, only when the document root is the project folder HEAD /.env, /composer.json ... for files that exist whether they can be downloaded

Nothing about the site, its URL or its users is sent to those servers, and the User-Agent is generic. The request for the project files goes to the site itself, never transfers a file (HEAD) and does not verify its certificate, because only the status of the site's own address is read; the result is kept for 10 minutes. probe: false switches it off. Responses are cached for 12 hours (a failed request for 5 minutes, the SMTP test for 10 minutes), in the cache namespace sitehealth. To work offline or through a mirror, replace the source of release data:

SilverStripe\Core\Injector\Injector:
  Dpws\SiteHealth\Version\ReleaseData:
    class: MyVendor\MyModule\MyReleaseData   # implements Dpws\SiteHealth\Version\ReleaseData

Check again, under the title on the Status tab, throws away that cache so the next view asks again, and the line next to it says how old the data on the screen is. It is a POST with the security token of your session, it needs the same permission as viewing the screen, and a second click within a minute is refused with a message instead of asking Packagist about every package again. Change the minute with:

Dpws\SiteHealth\Version\DataRefresher:
  cooldown: 60   # seconds, 0 switches the pause off

The database check reads the server version from the open connection and runs no SQL.

The Info tab sends nothing anywhere. It only reads the local installation, and the content counts come from the ORM of your own site.

Limitations

  • Checks run when the screen is opened. Cached release data can be up to 12 hours old, so a newly published vulnerability appears after the cache expires and someone opens the screen, or after someone clicks Check again. There are no notifications and no history.
  • The first view after the cache expires makes a few HTTP requests (about a second on a normal connection).
  • Some checks (HTTPS, document root) are only meaningful for a web request.
  • A passing email check shows that the server accepts the connection, not that a message arrives. Send yourself one, for example with the password reset form.
  • Translations: English only.
  • No release has been tagged yet and the API (HealthCheck, CheckResult) may still change.

Documentation

See docs/en/index.md for how it works inside and how to add a check.

Development

composer install
vendor/bin/phpunit
vendor/bin/phpcs

The tests never open a database connection or use the network. Run them with SS_PHPUNIT_FLUSH=1 after adding classes. Issues and pull requests are welcome, see CONTRIBUTING.md.

License

BSD-3-Clause