Download the PHP package portrino/cms-observer-client-wordpress without Composer
On this page you can find all versions of the php package portrino/cms-observer-client-wordpress. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download portrino/cms-observer-client-wordpress
More information about portrino/cms-observer-client-wordpress
Files in portrino/cms-observer-client-wordpress
Package cms-observer-client-wordpress
Short Description CMS Observer Client - Reports WordPress core, PHP/DB version and installed plugins to a CMS Observer instance
License GPL-2.0-or-later
Informations about the package cms-observer-client-wordpress
WordPress Plugin cms-observer-client
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):
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
-
On the Observer, register a new site with the type
wordpress(using command line or web interface) and copy the printed token: -
In WordPress, go to Settings > CMS Observer (on multisite: Network Admin > Settings > CMS Observer) and set:
API URL– the Observer's base URL, must usehttps://Token– the token from step 1
Alternatively define
CMS_OBSERVER_API_URLandCMS_OBSERVER_TOKENas constants inwp-config.phpor as environment variables. They take precedence over the settings page (environment variable first), so a sharedwp-config.phpcan 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 inwp_optionsand 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.comdoesn't matchexample.com. - Set
WP_ENVIRONMENT_TYPEin each environment'swp-config.php(e.g.define('WP_ENVIRONMENT_TYPE', 'staging');), the report sends it asapplicationContext. Without it WordPress reportsproduction.
🚀 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:
To check what would be sent without sending it:
💎 Credits
This project is the WordPress counterpart of the TYPO3 extension cms-observer-client-typo3.
🧑💻 Contributing
Please have a look at CONTRIBUTING.md.