Search by

portrino / cms-observer-client-wordpress

portrino-dev

CMS Observer Client - Reports WordPress core, PHP/DB version and installed plugins to a CMS Observer instance

Package info

github.com/portrino/cms-observer-client-wordpress

Type:wordpress-plugin

pkg:composer/portrino/cms-observer-client-wordpress

Statistics

Installs: 30

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.4 2026-11-26 00:08 UTC

This package is auto-updated.

Last update: 2026-11-26 00:27:00 UTC


README

Latest Stable Version WordPress 6.4+ PHP 8.1 - 8.5 Total Downloads Monthly Downloads CI

This plugin reports a site's WordPress core version, PHP + DB versions, and installed plugin and theme versions to a central CMS Observer instance, which flags insecure and outdated versions.

Important

Without a central CMS Observer instance this plugin is somewhat useless. So set up your central CMS Observer instance first and then connect any number of WordPress sites by using this client.

Needs CMS Observer 0.7.0 or newer (version 1.x of this plugin works with older ones, without themes).

Works on single sites and multisite networks. A network is reported as one site: its configuration is network-wide, and a plugin or theme counts as active when it's active on any site of the network (a plugin also when network-activated). The parent of an active child theme counts as active too.

πŸ”₯ Installation

Composer

The recommended way for Composer based WordPress setups (e.g. Bedrock):

composer require portrino/cms-observer-client-wordpress

ZIP

Download cms-observer-client-<version>.zip from the GitHub releases and upload it under Plugins > Add New > Upload Plugin. (Don't use GitHub's "Source code" ZIP, it unpacks to a different directory.)

Activate the plugin, on multisite network-wide.

πŸ”§ Configuration

  1. On the Observer, register a new site with the type wordpress (using command line or web interface) and copy the printed token:

    php bin/console app:site:create "<name>" wordpress "<site-url>"
    
  2. In WordPress, go to Settings > CMS Observer (on multisite: Network Admin > Settings > CMS Observer) and set:

    • API URL – the Observer's base URL, must use https://
    • Token – the token from step 1

    Alternatively define CMS_OBSERVER_API_URL and CMS_OBSERVER_TOKEN as constants in wp-config.php or as environment variables. They take precedence over the settings page (environment variable first), so a shared wp-config.php can serve several environments.

Several environments (production, staging, …)

  • Set the token for each environment as environment variable or constant in wp-config.php, not on the settings page. A token saved on the settings page lives in wp_options and is copied along with the database, e.g. when staging gets the production database, and staging would then report as production. The Observer catches this as long as staging has a different domain: the report carries all domains of the site (domains), and the Observer rejects it with HTTP 409 when none matches the registered site URL. WP-CLI shows the Observer's message, the settings page shows the last failed push.
  • Register the site on the Observer with exactly the host WordPress uses (home_url()): the comparison is exact, www.example.com doesn't match example.com.
  • Set WP_ENVIRONMENT_TYPE in each environment's wp-config.php (e.g. define('WP_ENVIRONMENT_TYPE', 'staging');), the report sends it as applicationContext. Without it WordPress reports production.

πŸš€ Run

The plugin sends the report once a day via WP-Cron. On sites with low traffic, or with DISABLE_WP_CRON, run WP-Cron from a system cron job, or push the report with WP-CLI:

wp cms-observer push

To check what would be sent without sending it:

wp cms-observer push --dry-run

πŸ’Ž Credits

This project is the WordPress counterpart of the TYPO3 extension cms-observer-client-typo3.

πŸ§‘β€πŸ’» Contributing

Please have a look at CONTRIBUTING.md.