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

Logs outbound HTTP requests made by WordPress for inspection.

== Description ==

Telemetry (by ROBOTSTXT) records the external HTTP requests that WordPress (and its plugins and themes) performs through the WordPress HTTP API, so they can be inspected from the administration panel.

For every outbound call, the plugin stores the request method, full URL, host and path, query parameters, body parameters or raw body, sanitized request headers, user agent, and the caller backtrace summary. Sensitive values (authorization headers, passwords, tokens, API keys, secrets, nonces) are automatically redacted before storing, and all payloads are size-limited to keep the database lean.

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.

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.

= 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).
* Logs are only accessible to administrators (`manage_options`).
* No data ever leaves the site; logs are stored in the site's own database.

== 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.

= Settings =

Navigate to **Telemetry → Settings**. 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.

== 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 (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 send any data anywhere? =

No. The plugin only records outbound HTTP requests in the site's own database for local inspection. Nothing is transmitted to third parties.

= 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: 6.2 - 7.1
* PHP: 7.4 - 8.5
* MariaDB: 10.6+
* Multisite: compatible (`Network: true`)

== Changelog ==

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

= 0.2.0 =

* Added: Settings screen with uninstall behavior option (data preserved by default)
* Added: Manager (by ROBOTSTXT) dependency notice, dismissible in the plugins list and permanent in Settings
* Added: `uninstall.php` routine honoring the delete-data option, Multisite aware
* Added: `bin/deploy.sh` distributable packaging script
* Changed: minimum requirements lowered to WordPress 6.2 and PHP 7.4
* Changed: Plugin, author, and update URLs moved to robotstxt.software
* Removed: bundled self-updater (`robotstxt-updater.php`, `update.json`) in favor of the Manager plugin
* Security: query strings and credentials in URLs are redacted before storing
* Fixed: query parameters were not stored due to a discarded `wp_parse_args()` return value
* Fixed: UTF-8 scrubbing no longer discards whole payloads

= 0.1.0 =

* Initial release: outbound HTTP logging with custom table, Logs admin screen with filters, pagination, view and delete actions, and secret redaction

= 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/)
