=== CodeCaste Site Activity Tracker ===
Contributors: codecaste
Tags: activity log, audit log, change tracking, security, monitoring
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Keeps a clear log of every important change on your site: who changed what, and when. Find out quickly what broke your website.

== Description ==

**Something broke? Find out what changed.**

**CodeCaste Site Activity Tracker** is an activity log for WordPress. It quietly watches your site and writes down every important change, so you always know what happened, who did it and when.

Imagine your shop's checkout stops working on Tuesday. Without a log, you have to guess. With this plugin you open one screen and see, for example: "Monday 4:12 PM: the plugin *X* was updated from version 2.1 to 3.0 by an automatic update." Now you know where to look.

= What is it? =

A diary for your website. Each time something important changes, the plugin adds a new line to the diary. You can read the diary in your WordPress admin and get alerts by email.

= Who is it for? =

* **Site owners** who want to know what is happening on their site.
* **Agencies and freelancers** who manage sites for clients and need proof of what changed.
* **Teams** with several administrators and editors, where you need to see who did what.
* **Developers** who need to find the cause of a problem fast.

= What does it do? =

1. **Records changes.** It notes every important change in plugins, themes, users, content, settings and more.
2. **Shows who and how.** Each line shows what changed, the old and new value, when it happened, and who or what did it (an administrator, WP-CLI, the REST API, a scheduled task or an automatic update).
3. **Rates how serious it is.** Every change gets a level: High, Medium, Low or Info, with a plain-language reason. A plugin being deactivated is High. A routine background task is Low.
4. **Shows you what changed.** The Dashboard lists the manual changes people made recently: what changed, who did it and when, with the old and new value.
5. **Alerts you.** You can get emails when something important changes, or a daily or weekly summary.
6. **Protects the log.** Every entry is linked to the one before it. If anyone edits or deletes a record, the plugin can detect it.

= What it tracks =

**WordPress itself**

* **Core, plugins and themes:** installs, updates, automatic updates, activations, deactivations, deletions and failed updates.
* **Users:** new and deleted accounts, role changes, profile and email changes, password changes, logins and application passwords.
* **Content:** pages, posts and templates (created, updated, published, trashed, deleted), plus categories and tags, comments, menus and media library changes.
* **Settings:** important site options such as site title, admin email, permalink structure, search engine visibility, timezone and language, plus Customizer changes.
* **Security-related options:** changes that affect who can access your site or whether search engines can see it are marked for review.
* **Scheduled tasks:** WP-Cron jobs being added or removed.
* **Widgets and server:** changes to widget areas, and PHP version upgrades or downgrades.
* **File integrity:** scheduled scans that detect changed files.

**Popular plugins (when they are active)**

* **Shop and content:** WooCommerce (new products, price and stock changes, deletions), Yoast SEO, Advanced Custom Fields, Elementor and Gravity Forms.
* **Forms:** Contact Form 7, WPForms and Fluent Forms (created, updated, trashed, restored, deleted). The plugin never reads form content or submissions.
* **SEO settings:** Rank Math, All in One SEO, SEOPress and Yoast site-wide settings. Changes to indexing and robots are rated High.
* **Settings of other popular plugins:** caching (WP Rocket, LiteSpeed Cache, WP Fastest Cache, Autoptimize), security (Solid Security, All In One WP Security, Really Simple Security, WPS Hide Login, Akismet), backups (UpdraftPlus), email (WP Mail SMTP, Post SMTP, FluentSMTP), Redirection, Polylang, Jetpack modules, MonsterInsights, WooCommerce payment, tax and checkout settings, Easy Digital Downloads, MemberPress, The Events Calendar, and the Astra, GeneratePress and Divi theme options. Only the names of changed settings are saved, never the values. Developers can add more with the `site_activity_tracker_addon_options` filter.

= Main features =

* **Easy to start:** no setup needed. The Dashboard shows the manual changes people made in the last 7 days: what changed, who did it and when. Automatic updates, scheduled tasks (WP-Cron) and other system activity are not listed. A "Recent Changes" box also appears on your WordPress Dashboard. You can hide it with the `site_activity_tracker_show_dashboard_widget` filter.
* **Impact levels:** simple rules decide how serious a change is, and each one comes with a short explanation.
* **Grouped changes:** related changes, such as updating ten plugins at once, are grouped together as one event.
* **Tamper-evident history:** entries are chained together with SHA-256 hashes. A built-in check tells you if a record was edited or removed. Removing only the newest entries cannot be detected from the database alone; turn on hash anchoring to send the latest chain hash to an external receiver so a truncated history can be spotted.
* **Security health report:** shows how old passwords are (only the date), administrators who have not logged in for a long time, and two-factor authentication status.
* **Notifications:** email. Choose to be told only about High-impact changes, pick the categories you care about, get a daily or weekly digest, and set quiet hours.
* **Scheduled reports:** a daily or weekly email with totals and up to 25 recent changes. Old and new values are never included.
* **Optional extra protection:** send signed copies of your log to your own secure (HTTPS) server, and send a daily signed "fingerprint" of the log to a separate server. Both are off until you set them up.
* **Review flags:** security-related events can be marked for review.
* **Automatic clean-up:** old entries are removed after the number of days you choose.
* **WP-CLI:** list events, check integrity and run reports from the command line. Run `wp help site-activity-tracker`. It also works across a whole multisite network.
* **REST API and developer hooks:** protected endpoints under `/wp-json/site-activity-tracker/v1/`, plus an API to add your own detectors and log your own events.
* **Quiet by design:** changes made by the WordPress installer or by testing tools such as the temporary Plugin Check environment are not counted as site changes.

= Screens in the admin =

* **Dashboard:** the list of manual changes, with a View Event page for details and before/after comparisons.
* **Security Hygiene:** password age, inactive administrators, two-factor status and the integrity check.
* **Settings:** quick setup, what to monitor, how long to keep history, notifications, security health and privacy information.

= What it does not do =

* It does not fix problems for you. The only undo is restoring the previous value of a simple site option, and only when you choose to do it yourself.
* It does not scan for malware.
* It does not slow down your visitors. It only watches changes made inside WordPress.

== Privacy ==

By default Site Activity Tracker stores events only in your own WordPress database.

**What is stored:** event type and object name, timestamp, user ID and source of the change, normalized before/after values (such as version numbers or setting values), and the impact level and reason. Email addresses shown in the interface are masked.

**What is never stored:** passwords or password hashes, reset keys, authentication tokens or session keys, API keys or secret credentials, full form submissions or payment data.

External notifications, log forwarding and hash anchoring are optional. They send data only to endpoints that an administrator configures. Receiver URLs and shared secrets are encrypted at rest with a random per-site key kept by the plugin (it does not use your WordPress keys or salts, so changing them has no effect), and requests use TLS verification and short timeouts. See "External services" below.

WordPress privacy exports include safe event summaries for the requested account, without before/after values or internal metadata. Audit records remain subject to the configured retention period. Deleting the plugin keeps your history.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install it from the Plugins screen.
2. Activate the plugin through the Plugins screen.
3. Open **Site Activity Tracker** in the admin menu.
4. Optionally open **Site Activity Tracker > Settings** to choose what to monitor, how long to keep history and who gets alerts.

= Notifications =

Configure channels and timing under **Site Activity Tracker > Settings > Notifications**. Webhook endpoints must use HTTPS.

= External audit receivers and WP-CLI =

Forwarding and hash anchoring are off unless configured. A receiver must accept signed JSON POST requests with an `X-Site-Activity-Tracker-Signature: sha256=<HMAC-SHA256>` header and should store and verify the records independently of this WordPress database.

== External services ==

This plugin works fully offline by default. It contacts an outside service only after an administrator turns on one of the optional features below and enters the address to use. Nothing is sent on activation, and nothing is sent to the plugin author.

= Audit log forwarding receiver (optional) =

Used to keep an independent copy of the log on a server you control. When enabled, batches of event records (event type, object type and name, action, user ID, source, impact level, timestamps and hashes) are sent as signed JSON over HTTPS to the URL entered in Settings. The receiver is chosen and operated by you, so its terms and privacy policy are yours.

= Hash anchoring receiver (optional) =

Used to detect a truncated history. Once a day, the latest chain hash, event ID, site (blog) ID and a timestamp are sent as signed JSON over HTTPS to the URL entered in Settings. The receiver is chosen and operated by you.

Email notifications use your site's normal WordPress mail (wp_mail) and do not use any service from this plugin.

== Frequently Asked Questions ==

= What exactly does this plugin do? =

It keeps an activity log of your WordPress site. Whenever something important changes (a plugin is updated, a user gets a new role, a setting is edited, a page is deleted and so on), it records what changed, the old and new value, who did it and when. You can then search the log, get alerts and use the "What Changed?" tool to find the cause of a problem.

= Does it slow down my site? =

No. It only listens to WordPress while changes happen, saves events in one batch at the end of the request, and never stops a page from loading even if the plugin itself has a problem.

= Can I use it without sending data anywhere? =

Yes. Everything stays in your own WordPress database. Notifications, forwarding and fingerprints are off until you turn them on.

= Does it record passwords or form submissions? =

No. Passwords, reset keys, tokens, API keys, form submissions and payment data are never stored. Email addresses are masked on screen.

= Why do I see "Cron Job Scheduled" entries? =

WordPress reschedules its repeating background tasks, so a "scheduled" entry can appear each time one runs. These are routine and usually Medium impact.

= Why does Site language change from "(not set)" to "(empty)"? =

WordPress saves the language setting the first time you save Settings > General. An empty value means English (US), so the language itself did not change.

= How long is the history kept? =

For the number of days you choose in the settings. Older entries are removed automatically. Deleting the plugin keeps your history.

= What are the requirements? =

WordPress 6.2 or higher, PHP 7.4 or higher, and MySQL 5.6+ or MariaDB 10.1+.

== Changelog ==

= 1.0.0 =
* Initial release by CodeCaste.
* Cryptographic tamper-evident SHA-256 hash chaining with canonical verification.
* Email alerts with digest scheduling and quiet hours.
* Scheduled reports, signed event forwarding, and external hash-chain anchoring.
* Event review flags and WordPress personal-data export.
* Category-based monitoring settings and a quick setup experience.
* Security hygiene auditing with verifiable 2FA inspection and password age reference tracking.
* Granular REST API permissions, multisite-capable WP-CLI commands, and a developer API with extension hooks.
