=== Backtrail ===
Contributors: thomasbkc
Tags: logging, debugging, maintenance, activity log, troubleshooting
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.4.0
License: GPLv2 or later

See what changed on your site right before it broke.

== Description ==

Backtrail is not a full activity-log plugin. It's a minimal debugging tool
that answers one question: "What happened right before the site broke?"

It logs:

* Plugin activation / deactivation / updates
* Theme switches, theme updates and Customizer changes
* Post/page creation, edits, deletions and trash/restore
* PHP fatal errors (the actual "site broke" moment)
* Permalink structure changes (a common, silent cause of sudden 404s)

Each logged change is tagged with a rough risk level (High / Medium / Low), based on
how likely that type of change is to be the actual cause when something breaks.
Code changes like plugin/theme updates rank higher than a content edit.

If a burst of changes happens in a short window, the "Backtrail" page in wp-admin
(and a small indicator in the admin bar, visible everywhere) shows a warning, so an
admin can quickly see whether something was recently changed before starting to debug.

You can also mark the exact moment something broke ("Mark as incident"), and the
plugin highlights everything that happened in the hour before it. You can also
filter by type, search, copy a plain-text summary to paste into a support ticket,
or export the log as CSV.

If wp-admin itself becomes unreachable, the log is still readable via WP-CLI:
`wp backtrail list`.

== Installation ==

1. In wp-admin, go to Plugins → Add New, search for "Backtrail" and click Install Now.
   (Or upload the zip via Plugins → Add New → Upload Plugin.)
2. Activate the plugin.
3. Go to the "Backtrail" menu item in wp-admin.

== Changelog ==

= 1.4.0 =
* Renamed from "What Changed?" to Backtrail. The admin page, WP-CLI command
  (`wp backtrail list`), text domain and all internal prefixes use the new name.
* Admin page CSS and JavaScript now load as enqueued files, and the admin bar
  highlight uses wp_add_inline_style(), instead of inline style and script tags.

= 1.3.3 =
* Fixed: several Plugin Check warnings in the database class were not actually
  being suppressed, because stacking multiple phpcs:ignore comments above a
  multi-line statement only protects the single line immediately below the
  last comment, not the whole statement. Every flagged query is now on one
  physical line with a single combined ignore comment directly on it.

= 1.3.2 =
* Fixed: missing "License" plugin header, and removed a placeholder Plugin URI
  (found by the wordpress.org Plugin Check tool).
* Fixed: CSV export now correctly respects an active type/search filter (it was
  previously reading the filter from the wrong request source, so exporting
  while filtered silently exported everything).
* Cleaned up: read-only filter/pagination parameters are now read from a single
  place instead of twice, with each direct database query and file operation
  documented and annotated for Plugin Check.

= 1.3.1 =
* Fixed: the admin page timeline now uses the site's own Date Format and Time Format
  settings (Settings -> General) instead of a hardcoded 24-hour time, so e.g. a site
  configured for 12-hour time shows AM/PM correctly.

= 1.3.0 =
* Added: logging when a post/page is moved to or restored from trash (previously only
  permanent deletion was logged).
* Added: logging of permalink structure changes, a common silent cause of sudden 404s.
* Added: pagination (Newer/Older) on the timeline instead of a hard 200-row cutoff.

= 1.2.0 =
* Added: WP-CLI support (`wp what-changed list`, now `wp backtrail list`), so the log is readable even if
  wp-admin itself won't load. Supports --limit, --type and --format (table/csv/json/count).

= 1.1.0 =
* Added: PHP fatal error logging.
* Added: "Mark as incident" button that highlights the hour of changes leading up to it.
* Added: filter by type (Plugins / Theme / Content / Errors) and text search.
* Added: CSV export.
* Added: "Copy summary" button (plain-text list of the visible entries).
* Added: admin bar indicator, visible on every wp-admin screen.

= 1.0.0 =
* First release: plugin, theme and content logging, timeline, alert banner and risk levels.
