=== Remotera ===
Contributors: remotera
Tags: monitoring, uptime, security, health, inventory
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connects this site to your Remotera panel and pushes signed health, inventory and update data. The panel never connects back to your site.

== Description ==

Remotera is the monitoring agent for Remotera. Your site pushes measurements to the panel you
configure; the panel never opens a connection to your site, and nothing is scanned from the
outside.

The product page — documentation, security overview and the legal documents — is
[remotera.uk/solutions/remotera-wp](https://remotera.uk/solutions/remotera-wp/).

**A Remotera panel is required.** The plugin does not work on its own: you need a panel
account (hosted at [backoffice.remotera.uk](https://backoffice.remotera.uk/setup) or a
self-hosted installation) and a site token. Point the plugin at that panel, paste the
token, and the first snapshot is sent within a minute.

What the panel shows:

* **Heartbeat** every five minutes with core, runtime and database health.
* **Inventory** of plugins, themes and translations, including available updates.
* **Database, cron, filesystem and disk** measurements (counts and byte sizes, never row contents).
* **Hardening and core-integrity** checks, so a modified file or a weakened setting is visible.

= Monitoring only =

This version is read-only. It collects measurements, takes snapshots and runs an integrity
scan when you ask for one; it never updates, backs up, restores or edits anything on your
site. There is no remote administration here: the commands it understands are ping, snapshot,
block collection and integrity scan.

If you also want remote updates, backups and restores, your panel can install the full
Remotera agent as a separate package (not distributed on WordPress.org). This plugin then
steps aside so the two never run at the same time.

Design notes:

* **No inbound connections.** There is no REST route for the panel to call, no remote
  login and no stored WordPress administrator password.
* **Read-only collection.** The plugin never reads post content, option values or file
  contents. It reports counts, sizes, versions, statuses, boolean flags and the
  administrator usernames listed below.
* **Local development is silent.** When `WP_ENVIRONMENT_TYPE` is `local`, nothing is sent.
* **Offline tolerant.** Failed deliveries are queued locally (at most 20 envelopes) and
  retried with exponential backoff, so a panel outage does not lose measurements.

== External services ==

This plugin connects to services outside your site. Nothing is sent until you connect the
site to a panel.

= Remotera panel =

The panel URL is entered by you (for example `https://backoffice.remotera.uk`). It is the
service this plugin exists to talk to.

* **What is sent:** the site URL and home URL; WordPress, PHP, database and server versions;
  plugin, theme and translation inventory (name, version, status, update availability);
  counts and byte sizes for posts, tables, files and disk; scheduled cron hook names and
  intervals; role counts and up to 50 administrator usernames; hardening flags as booleans
  (for example whether file editing is disabled); and core-integrity results.
* **When:** a heartbeat every five minutes, snapshots on their configured interval, and
  immediately after you press "Connect" or "Collect now".
* **Why:** to display the site's health, inventory and maintenance state in your panel and
  to deliver the commands you trigger there.
* **Endpoints:** `/api/v1/agent/connect`, `/api/v1/agent/heartbeat`,
  `/api/v1/agent/snapshot`, `/api/v1/agent/config`, `/api/v1/agent/commands/{id}/ack`,
  `/api/v1/agent/commands/{id}/result`.

Privacy policy: https://remotera.uk/solutions/remotera-wp/legal/privacy-policy.html
Terms of use: https://remotera.uk/solutions/remotera-wp/legal/terms-of-use.html
Data processing agreement: https://remotera.uk/solutions/remotera-wp/legal/data-processing-agreement.html

= WordPress.org =

The plugin reads update data that WordPress itself already collects from WordPress.org and,
when that data is stale, asks WordPress to refresh it. It also fetches the official core
checksums list.

* **What is sent:** the WordPress version, locale and the list of installed plugin/theme
  slugs that WordPress normally sends for update checks. No site data, no user data.
* **When:** at most every 12 hours, and only when the cached update data is stale.
* **Endpoints:** `https://api.wordpress.org/core/checksums/1.0/`,
  `https://api.wordpress.org/plugins/info/1.2/`, `https://api.wordpress.org/themes/info/1.2/`.
* **Why:** to report available updates and to verify that core files are unmodified.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install it from **Plugins → Add New**.
2. Activate the plugin.
3. Open **Settings → Remotera**, paste your panel URL and site token, then press
   **Save and connect**.

== Frequently Asked Questions ==

= Does the panel connect to my site? =

No. The agent pushes data and pulls commands; the panel never opens a connection to your
site. This is a deliberate design decision, not a configuration option.

= Can I use the plugin without a Remotera panel? =

No. Remotera is a connector. Without a panel URL and site token it collects nothing and
sends nothing; the settings screen tells you so.

= Where are the terms, privacy policy and data processing agreement? =

The product page at [remotera.uk/solutions/remotera-wp](https://remotera.uk/solutions/remotera-wp/)
is the single place for the legal documents:

* [Terms of Use](https://remotera.uk/solutions/remotera-wp/legal/terms-of-use.html)
* [Privacy Policy](https://remotera.uk/solutions/remotera-wp/legal/privacy-policy.html)
* [Data Processing Agreement](https://remotera.uk/solutions/remotera-wp/legal/data-processing-agreement.html)

The same links appear at the bottom of *Settings → Remotera*.

= Which data is collected? =

The full list is in the *External services* section above: versions, inventory metadata,
counts, byte sizes, cron schedules, role counts, administrator usernames and boolean
configuration flags. Post content, option values and file contents are never read.

= Are my administrator usernames sent? =

Up to 50 administrator usernames are sent, because the panel flags the well-known `admin`
username as a hardening risk. E-mail addresses, display names and passwords are not sent.

= Can this plugin update, back up or restore my site? =

Not this version. The WordPress.org package is monitoring only: it reports, it does not
change anything. Remote updates, backups and restores belong to the full agent that your
panel installs separately.

= How does this plugin update itself? =

Through the WordPress.org plugin directory, like any other plugin. The panel never pushes
an update to it.

= Where is the site token stored? =

In your own database, encrypted with a key derived from your `wp_salt('auth')`. It is never
shown again after saving, and no WordPress administrator password is stored at all.

= Does the plugin write to my files? =

No. It stores its connection settings and queued envelopes in `wp_options` and writes
nothing else: no plugin, theme or core files, no `wp-content` files and no `wp-config.php`.

= What happens when I uninstall the plugin? =

Your connection settings are kept by default, so reinstalling the plugin reconnects the
same site without creating a second site record in the panel. If you want a clean removal,
tick **Delete all plugin data when the plugin is uninstalled** under *Settings → Remotera →
Data* before deleting the plugin.

= What happens if the panel is down? =

Measurements are queued locally (at most 20 envelopes) and retried with exponential
backoff. Nothing is lost silently, and the settings screen shows the queue depth.

= I used the old "Remotera Agent" plugin. Will my connection survive? =

Yes. Remotera replaced the older Remotera Agent plugin with the same option names and token;
on activation the old plugin is deactivated so the site is not reported twice.

== Changelog ==

= 1.3.0 =
* Renamed to Remotera with the `remotera` slug.
* The WordPress.org package is monitoring only: update, backup, restore, hardening and repair
  code is not shipped, so the plugin cannot administer the site remotely.
* Connectivity checks, snapshots and the settings screen are unchanged.

= 1.2.2 =
* The settings screen and the plugin row link to the product page and the legal documents
  (Terms of Use, Privacy Policy, Data Processing Agreement).
* The plugin URI now points at the canonical product page.

= 1.2.1 =
* Integrity scans now report the expected and current MD5 plus the file size for each
  mismatched, missing or unexpected file, so the panel can show hash evidence without
  collecting file contents.

= 1.2.0 =
* Renamed to Remotera WP with the `remotera-wp` slug, text domain and GPL-2.0-or-later license.
* Existing Remotera Agent settings, token and queued envelopes migrate automatically on activation.
* The previous plugin is deactivated when the new one is activated, so a site never reports twice.
* Added an English readme, license file and store assets.
* Uninstalling can now remove all plugin data; the setting is opt-in and keeps the
  connection by default.

= 1.1.1 =
* Fixed the `translation.update` result mapping: `Language_Pack_Upgrader` returns results in
  order, not keyed by language code, and success may be `true` or an array. Only counting
  `true` marked successfully installed language packs as failures.

= 1.1.0 =
* Added the `translations` block for pending plugin, theme and core language packs.
* Added the `translation.update` command.

= 1.0.1 =
* Drop-ins without a version header are no longer reported as missing, so sites with drop-ins
  no longer look permanently "plugins incomplete".
* Asking for "latest" while the WordPress.org offer is unavailable and the transient is fresh
  now reports `already_current` instead of rejecting with `invalid_params`.

= 1.0.0 =
* First release: five inventory blocks, heartbeat with outbox and retry, signed command channel.

== Upgrade Notice ==

= 1.3.0 =
Renamed to Remotera. The WordPress.org package is monitoring only; remote updates, backups
and restores moved to the full agent that your panel installs.

= 1.2.2 =
Links to the product page and the legal documents, plus plugin page screenshots.

= 1.2.1 =
Integrity findings now include the expected and current hash plus the file size.

= 1.2.0 =
Remotera WP replaces Remotera Agent. Activate the new plugin once: your panel URL, token and
queued data are migrated automatically and the old plugin is deactivated.
