=== Telemetry disabler (by ROBOTSTXT) ===
Contributors: robotstxt, javiercasares
Tags: telemetry, privacy, http, requests, logging
Requires at least: 4.0
Tested up to: 7.1
Stable tag: 0.6.2
Requires PHP: 5.6
Version: 0.6.2
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt

Reduces the telemetry WordPress sends out and logs every outbound HTTP request, so your site shares less and you can see everything.

== Description ==

A WordPress site talks to the outside world all the time: update checks for core, plugins and themes, and every HTTP call made by the ecosystem around them. Each of those calls can expose details about your site: its URL, versions, active plugins and themes, database server, PHP extensions, and more.

Telemetry disabler (by ROBOTSTXT) gives you control over that conversation in two ways: it sends less, and it shows you everything.

= Send less =

The three WordPress.org update checks run in "Safe" mode by default, meaning they only send the minimum data required to keep receiving updates:

* **Core version check** (`api.wordpress.org/core/version-check/`): only the WordPress version, PHP version, locale, normalized MySQL/MariaDB version (for example "11.8.8-MariaDB", without distribution or logging suffixes), and update channel. Site counts, database history, PHP extensions and platform details are removed, the site-identifying `wp_install`/`wp_blog` headers are stripped, and translation payloads are reduced to empty entries (only the project and locale identifiers are kept).
* **Themes version check** (`api.wordpress.org/themes/update-check/`): each theme is reported with only its name, version, update URI, template and stylesheet; translations are reduced to empty entries, plus the site locale.
* **Plugins version check** (`api.wordpress.org/plugins/update-check/`): each plugin is reported with only its version, update URI and requirements (WordPress, PHP, dependent plugins); translations are reduced to empty entries, plus the locale and the "all" flag.
* Update URIs pointing at wordpress.org are kept as-is (they are public slugs); update URIs hosted anywhere else are replaced with a deterministic hash, so external plugin and theme sources are not disclosed.

Each check can be switched back to "Original" in the Settings screen to send exactly what WordPress would send without this plugin.

Additionally, outbound requests normally identify the site in the User-Agent header (for example "WordPress/6.9; https://example.com/"). With the "Hash the site URL in the User-Agent" setting (enabled by default), the URL is replaced with a fixed hash so the site is no longer identifiable while remaining consistent across requests.

= See everything =

Every outbound HTTP request made through the WordPress HTTP API is recorded in the site's own database: request method, full URL, host and path, query parameters, body parameters or raw body, sanitized request headers, user agent, and a caller backtrace summary to know which component triggered the call.

The Logs screen provides a paginated list with filters by method, host and date range, a detailed single-entry view, and nonce-protected delete actions. Entries pointing to `api.wordpress.org` get a dedicated analysis view that groups environment, extensions, platform, and image support parameters.

= Privacy by default =

* Sensitive keys (`authorization`, `password`, `pass`, `token`, `secret`, `api_key`, `apikey`, `nonce`) are redacted before anything is written to the database.
* Credentials embedded in URLs are stripped, and query strings are stored redacted.
* Payloads are truncated (64 KB per JSON blob, 64 KB raw body, 16 KB caller trace).
* Log retention is configurable (12 hours by default, 1 day, or 3 days), a maximum of 1000 entries is always enforced, and the cleanup runs when browsing the logs and twice a day automatically.
* Logs are only accessible to administrators (`manage_options`).
* No data ever leaves the site; logs are stored in the site's own database.

On Multisite, the network administrator chooses between two modes in **Network Admin → Telemetry**: "Per-site" (default), where every site keeps its own settings and its own log table managed by each site administrator, or "Global", where one shared configuration and one central log table (on the main site) collect the outbound requests of the whole network, managed from the Network Admin only.

Updates for this plugin are delivered through the [Manager (by ROBOTSTXT)](https://www.robotstxt.software/plugins/robotstxt-manager/) plugin. If the Manager is not active, the plugin shows a dismissible reminder in the plugins list and a permanent notice on its Settings screen.

== Using the plugin ==

= Logs =

Navigate to **Telemetry → Logs**. Use the method, host and date filters to narrow the list, then click **View** on any entry to see its full details, or **Delete** to remove it. The **Delete all logs** button requires a second confirmation before permanently removing every entry.

= Settings =

Navigate to **Telemetry → Settings**. The three WordPress.org update checks (Core, Themes, Plugins) can run in "Safe" mode (default, limited data) or "Original" mode (unchanged WordPress behavior). "Hash the site URL in the User-Agent of outbound requests" (enabled by default) replaces the site URL in outbound User-Agent headers with a fixed hash. "Log retention" controls how long entries are kept (12 hours by default, 1 day, or 3 days). The "Delete all telemetry logs and plugin options on uninstall" checkbox controls the uninstall behavior: unchecked by default, so all telemetry data is preserved when the plugin is removed. When the Manager (by ROBOTSTXT) plugin is not active, a permanent notice about updates is shown on this screen.

= Multisite =

Navigate to **Network Admin → Telemetry**. The "Configuration mode" setting controls how the plugin runs: "Per-site" (default) lets every site manage its own Settings and Logs screens, while "Global" centralizes the configuration and the logs of the whole network on the main site, managed from the Network Admin only. When switching to Global, the network settings start from the main site values.

== Extra Configurations ==

This plugin does not require any `define()` in `wp-config.php`.

== Installation ==

= Automatic download =

Visit the plugin section in your WordPress, search for "Telemetry disabler (by ROBOTSTXT)"; download and install the plugin.

= Manual download =

Extract the contents of the ZIP and upload the contents to the `/wp-content/plugins/robotstxt-telemetry/` directory. Once uploaded, it will appear in your plugin list.

== Frequently Asked Questions ==

= Does the plugin stop WordPress updates from working? =

No. Safe mode keeps the minimum data the WordPress.org APIs need to deliver updates: what you have installed and at which version. Everything else (site counts, environment details, site-identifying headers, translation metadata) is removed.

= What is the difference between "Safe" and "Original" modes? =

"Safe" (default) sends only the minimum data required to keep receiving updates. "Original" sends exactly what WordPress would send without this plugin. You can switch each of the Core, Themes and Plugins checks independently.

= How does the plugin work on Multisite? =

By default every site manages its own settings and logs ("Per-site" mode). A super administrator can switch the network to "Global" mode in **Network Admin → Telemetry**: one shared configuration and one central log table on the main site then cover the whole network, and the per-site Telemetry screens are replaced by the Network Admin ones.

= Does the plugin send any data anywhere? =

No. The plugin only records outbound HTTP requests in the site's own database for local inspection, and reduces what WordPress sends to third parties. Nothing is transmitted by the plugin itself.

= Where is the data stored? =

In a custom database table (`{$wpdb->prefix}robotstxt_telemetry_logs`) created on activation, using the WordPress database API.

= What happens to my logs when I uninstall the plugin? =

By default all logs are preserved. If you want a full cleanup, enable "Delete all telemetry logs and plugin options on uninstall" in **Telemetry → Settings** before uninstalling.

= How do I get updates? =

Install and activate the [Manager (by ROBOTSTXT)](https://www.robotstxt.software/plugins/robotstxt-manager/) plugin, which handles updates for ROBOTSTXT plugins.

== Compatibility ==

* WordPress: 4.0 - 7.1
* PHP: 5.6 - 8.5
* MariaDB: 10.6+
* Multisite: compatible (Per-site and Global modes)

On WordPress versions older than 5.1, the Core update check Safe mode cannot reduce the query arguments (the needed hook does not exist in those versions); the site-identifying headers and the translations payload are still reduced.

== Changelog ==

Only the 3 last versions. The full changelog will be at changelog.txt

= 0.6.2 =

* Changed: translations payloads in the WordPress.org update checks now send empty entries (only the project and locale identifiers), removing the POT/PO dates

= 0.6.1 =

* Changed: minimum requirements lowered to WordPress 4.0 and PHP 5.6, with compatibility fallbacks for older WordPress APIs
* Fixed: duplicated "Save Changes" button on the Settings screen
* Changed: plugin renamed to "Telemetry disabler (by ROBOTSTXT)" with a new description

= 0.6.0 =

* Added: Multisite configuration mode (Per-site by default, Global from the Network Admin) to run the settings and logs per site or centrally for the whole network

= Previous versions =

If you want to see the full changelog, visit the [changelog.txt](https://www.robotstxt.software/plugins/robotstxt-telemetry/) page.

== Compliance ==

This plugin adheres to the following security measures and review protocols for each version:

* [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/)
* [WordPress Plugin Security](https://developer.wordpress.org/plugins/wordpress-org/plugin-security/)
* [WordPress APIs Security](https://developer.wordpress.org/apis/security/)
* [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards)
* [Plugin Check (PCP)](https://wordpress.org/plugins/plugin-check/)
