=== Easy Monitor ===
Contributors: AresIT
Tags: security, vulnerabilities, monitoring, cve
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sends your plugin, theme and WordPress versions to the WP Easy Monitor service and shows known vulnerabilities in wp-admin.

== Description ==

Easy Monitor is the connector plugin for the WP Easy Monitor service (https://wpeasymonitor.com/). After you connect a site with a one-time enrollment code, the plugin sends an inventory of your installed plugins, themes, WordPress core, PHP and server/database versions to the service. The service matches them against the free WPVulnerability database and returns known vulnerabilities, which this plugin shows in a dashboard page, a dashboard widget, an admin-bar badge and a Site Health test. A multi-site dashboard at https://app.wpeasymonitor.com/ shows every connected site in one place.

The plugin needs a WP Easy Monitor account and does nothing until you connect the site. Without the service there is nothing to match against.

The **Easy Monitor → Site Status** page shows the whole site at a glance: installed plugins and themes with their versions, available updates, auto-update state and known vulnerabilities, plus WordPress configuration, PHP settings and extensions, database and web server details. With status sharing on (the default once connected), the same details are sent to the service so the multi-site dashboard can show them. Turn it off under **Easy Monitor → Settings**.

Once a day, in the background, the plugin compares the WordPress core files under wp-admin and wp-includes with the official checksums from api.wordpress.org and reports files that were modified or do not belong there. Together with a few hardening facts and the list of administrators, this lets the dashboard score the site's security and alert you when a check starts failing or a new administrator appears.

From the multi-site dashboard you can ask a site for a fresh report with **Refresh now**. The site picks the request up from the service within 15 minutes, or right away when the service can reach it. This can be turned off under **Easy Monitor → Settings**.

Updates to this plugin come from WordPress.org like any other plugin.

= External services =

This plugin connects to two external services. Nothing is sent to either until you connect the site under **Easy Monitor → Settings** with an enrollment code; connecting the site is your consent to the transfers described here. Disconnecting (or uninstalling) revokes the site token on the service and stops all transfers.

**1. The WP Easy Monitor service (required).** The plugin exists to feed this service and does nothing without it.

* Hosts: the API at https://api.wpeasymonitor.com (a `WPVM_BACKEND_URL` constant in wp-config.php overrides it) and the dashboard at https://app.wpeasymonitor.com/, which the plugin only links to.
* When: once when you connect (the enrollment code, the site URL and the site name); then once a day from WP-Cron, a minute after a plugin, theme or core install, update, activation or deactivation, after WordPress's own update checks, when you click **Re-scan now** or **Test connection**, and when the dashboard asks for a refresh (if allowed). While refresh requests are allowed, the site also checks in every 15 minutes to ask whether one is pending. Requests are authenticated with the per-site token and signed with HMAC-SHA256.
* What is sent: see "Privacy / data collected" below.
* Provider: WP Easy Monitor (https://wpeasymonitor.com/).
* Terms of Use: TODO-OWNER publish the page and put its URL here.
* Privacy Policy: TODO-OWNER publish the page and put its URL here.

**2. api.wordpress.org (WordPress's own update API).** Once a day, from WP-Cron and only while the site is connected, the plugin downloads the list of core file checksums for the installed WordPress version and locale, using WordPress's `get_core_checksums()` function. This is the same request WordPress makes when it updates itself. Only the WordPress version and locale are sent. Terms: https://wordpress.org/about/privacy/

= Privacy / data collected =

For vulnerability matching, this plugin transmits to the WP Easy Monitor service:

* Component **slugs** and **versions** (plugins, themes, WordPress core), whether each is active, and the update version WordPress already offers for each (read from WordPress's own update data; the plugin never starts an update check).
* Environment **versions** (PHP, web server, database, and similar).
* The **site URL** and, at enrollment, the **site name** (used to identify the site in the dashboard).

For the security checks, it also transmits:

* A few **hardening facts**, as yes/no values: whether WP_DEBUG is on and errors are displayed, whether the file editor is disabled (DISALLOW_FILE_EDIT), whether XML-RPC is enabled, whether a user with the login "admin" exists, whether the default `wp_` table prefix is used (not the prefix itself), whether the WordPress Address uses https, and the number of administrators.
* The **administrators**: for each one, the user id, the **login name**, the registration date and a **SHA-256 hash of the lowercased email address**. The email address itself is never sent. The service uses this list only to alert you when a new administrator appears.
* The result of the daily **core file check**: the WordPress version and locale, the number of modified and unexpected files under wp-admin and wp-includes, and up to 50 **file paths** of each (relative to the WordPress folder, e.g. `wp-includes/version.php`). File contents are never sent, and wp-content and wp-config.php are never looked at.

Developers can trim the security report with the `wpvm_security_payload` filter.

With **status sharing** on (the default, can be turned off in Settings), it also transmits the Site Status page data: plugin and theme names, states, available updates and auto-update settings, must-use plugins and drop-ins, WordPress configuration (site/home URL, debug constants, user count, and similar), PHP settings and extensions, database server version, charset and size, and web server details. The database host and name, table prefix and exact operating system version stay on the site. Developers can trim it with the `wpvm_status_payload` filter.

It never transmits post content, passwords, keys, email addresses or the contents of any file. Apart from the administrator logins above, it sends no user data. All transmission is to the WP Easy Monitor service, except the core checksum request to api.wordpress.org described above.

= Communication =

The plugin talks only to the WP Easy Monitor service (built in; a `WPVM_BACKEND_URL` constant in wp-config.php overrides it) and to api.wordpress.org for core checksums. Requests to the service are authenticated with a per-site token and signed with HMAC-SHA256. All network requests run in WP-Cron or on explicit admin actions and never block front-end page loads.

While dashboard refresh is allowed (the default), the site checks with the service every 15 minutes whether a refresh was requested, and registers one public REST route, `POST /wp-json/wpvm/v1/nudge`. The service calls it to make the site check in at once. The route takes no input; it only makes the site ask its own service, over the signed connection, whether a refresh is pending, at most once every 20 seconds. Turning dashboard refresh off removes the route and stops the checks.

== Installation ==

1. Install and activate the plugin.
2. Create an account at https://app.wpeasymonitor.com/ and create an enrollment code under "Connect a site".
3. Go to **Easy Monitor → Settings**, enter the enrollment code, and click **Connect**.
4. The first inventory is sent automatically; findings appear under **Easy Monitor**.

== Frequently Asked Questions ==

= I used the plugin before it was on WordPress.org. How do I switch? =

Versions up to 0.7.0 were installed in a `wp-vuln-monitor` folder and do not update to this one. Deactivate the old plugin, delete its files without uninstalling it (`wp plugin delete wp-vuln-monitor` with WP-CLI, or remove the folder over FTP; **Delete** in wp-admin disconnects the site), then install and activate Easy Monitor. The settings are kept, so the site stays connected.

= Do I need an account? =

Yes. The plugin is the connector for the WP Easy Monitor service and does nothing until you connect the site with an enrollment code from https://app.wpeasymonitor.com/.

= Where is my data sent? =

Only to the WP Easy Monitor service (and the core checksum request to api.wordpress.org). See "External services" and "Privacy / data collected" above for exactly what is sent and when.

= Does it send anything before I connect the site? =

No. Until a site token exists, every scheduled task returns without contacting anything.

= Does it slow down my site? =

No. All remote calls run via WP-Cron or on explicit admin actions.

= How do I stop it? =

Click **Disconnect** under **Easy Monitor → Settings**. That revokes the site token on the service and removes it here. Uninstalling the plugin does the same and deletes all of its options.

== Changelog ==

= 0.8.0 =
* Prepared for the WordPress.org plugin directory. Updates now come from WordPress.org; the self-updater from 0.5.0 and the `Update URI` header are gone.
* The inventory is re-sent after WordPress's own scheduled update checks instead of whenever an update transient is written. The versions WordPress offers can now reach the dashboard up to a few hours later than before; the daily inventory still catches everything.
* Settings notices are chosen from a fixed list of messages instead of being passed as text in the URL.
* The Settings page describes everything the plugin sends, matching this readme.
* Readme: external services, consent and data transfers documented in one place.
* Renamed to Easy Monitor, slug and folder `easy-monitor`. Sites on the old `wp-vuln-monitor` folder must install this plugin once by hand; see the FAQ.
* The plugin now talks to https://api.wpeasymonitor.com.

= 0.7.0 =
* Security checks: the inventory includes a few hardening facts (debug display, file editor, XML-RPC, a user named "admin", the default table prefix, HTTPS, the number of administrators) and the list of administrators (id, login, registration date and a SHA-256 hash of the email; never the email). The dashboard scores them and alerts when a new administrator appears.
* Daily core file check in WP-Cron: files under wp-admin and wp-includes are compared with the checksums from api.wordpress.org, and modified or unexpected files are reported (at most 50 paths each). The check runs in short steps that continue a minute later, so it never holds up a page load or a shared host.
* New `wpvm_security_payload` filter to trim the security report.

= 0.6.0 =
* The inventory includes the update WordPress already offers for each plugin and theme, and the WordPress core update, read from WordPress's own update data (it never starts an update check). The dashboard uses it to show outdated components.
* The Easy Monitor page lists components that wordpress.org has closed or that have not been updated there for two years, when the backend reports them.

= 0.5.2 =
* Renamed to WP Easy Monitor (wpeasymonitor.com). The plugin folder, settings and the `wp vuln-monitor` command are unchanged, so existing sites update in place and stay connected.
* Settings and Site Status show the dashboard this site is connected to (app.wpeasymonitor.com, linked) instead of the backend API address.

= 0.5.1 =
* New look for the plugin's admin pages, matching the multi-site dashboard: white/grey cards and tables, severity pills, dark grey buttons. The Dashboard widget shows severity counts as tiles.

= 0.5.0 =
* Updates itself from the WP Easy Monitor backend (removed again in 0.8.0).

= 0.4.1 =
* Performance: admin pages no longer wait on the backend. When no report is cached yet, it is fetched in the background (at most every 5 minutes) instead of during the page load.
* Fix: an error answer from the backend is no longer cached as if it were the report.

= 0.4.0 =
* The backend address is built in: connecting only asks for the enrollment code. Define `WPVM_BACKEND_URL` in wp-config.php to use a different backend.

= 0.3.1 =
* Security: the database host, database name, table prefix and exact operating system version are no longer sent to the backend. They still show on this site's Site Status page.
* Security: Disconnect and uninstall now revoke the site token on the backend, so an old copy of it stops working.

= 0.3.0 =
* "Refresh now" from the multi-site dashboard, with a setting to turn it off.

= 0.2.1 =
* Security: the backend URL must use HTTPS (plain HTTP only for localhost), so the site token is never sent unencrypted.

= 0.2.0 =
* New Site Status page; its data is sent to the backend for the multi-site dashboard (toggle in Settings, `wpvm_status_payload` filter).

= 0.1.0 =
* Initial release: inventory submission, findings dashboard, widget, admin-bar badge, Site Health test, and WP-CLI commands.

== Upgrade Notice ==

= 0.8.0 =
First release on WordPress.org. Updates now come from WordPress.org.
