=== Admin Audit Log for WooCommerce ===
Contributors: catcodestudio
Tags: woocommerce, audit log, activity log, security, history
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

An admin activity log for WooCommerce: who changed what and when in orders, products, settings and the admin area, with a before/after diff.

== Description ==

As soon as more than one person works in a shop, the questions start: who changed that price, who cancelled that order, when did the discount disappear. WooCommerce has no answer — the order screen shows status changes only, and everything else is not recorded anywhere.

This plugin keeps its own journal. Every action becomes a separate entry with the user, the role, the IP address, the time and the list of changed fields in a "before → after" form.

= What is recorded (free) =

* Orders — status, totals, payment method, billing and shipping addresses, line items, deletion and moving to trash.
* Admin logins, logouts and failed login attempts (only the submitted username is stored, never the password).
* Products — price, sale price, stock quantity, stock status, SKU, publication status, dimensions, descriptions.
* Product categories, tags and attributes.
* WooCommerce settings — values are compared key by key, so it is visible exactly which payment or shipping option was changed.
* Users and roles — account creation, edits and deletion, role changes, the fact that a password was changed.
* Plugins and themes — activation, deactivation, installation, update, deletion, switching the active theme.
* Journal screen with filters (user, event type, action, source, IP, date range) and pagination.
* Search by value, including inside the stored changes.
* Expanding an entry shows a "Field / Before / After" table.
* One-button clean-up according to the retention rules.

= Pro =

* CSV export of the filtered journal.
* Automatic clean-up on a schedule — a daily job removes entries older than N days and keeps the row limit without reminders.
* E-mail notifications about critical events (failed logins, new users, role changes, plugin activation, settings changes, order deletion).
* Longer retention: up to 10 years and no row limit (free tier: 90 days and 50,000 entries).
* Recording changes made outside the admin area: storefront, REST API, WP-Cron, WP-CLI.

A fresh install is the free tier and nothing else — Pro never switches itself on. If you want to see what it does, the settings screen has a "Try Pro for 7 days" button: you enter an e-mail, we issue a real 7-day key and unlock Pro right away. No card, nothing is charged, one trial per install. When the trial ends the free tier keeps working with no time limit. The licence is annual (1 to 5 years) and includes updates and support for that term.

= Privacy and security =

* The journal cannot be edited from the interface: there is no "edit" or "delete" for an individual entry.
* Passwords, tokens, API keys, card numbers and similar fields never reach the table — they are masked before the write, so they are absent from the screen, from the CSV export and from a database dump. The list of masked fields is configurable.
* A password change is recorded as a fact, without the value and without the hash.
* The IP address is taken from REMOTE_ADDR only — proxy headers can be forged by the visitor.
* Storing the user agent can be turned off if your data protection policy requires it.

= Requirements =

* WooCommerce 7.0 or newer
* PHP 7.4+

The plugin interface is fully translated into Ukrainian. / Інтерфейс плагіна повністю перекладено українською.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/admin-audit-log-for-woocommerce/` and activate it.
2. Go to WooCommerce → Журнал дій (Audit Log).
3. On the "Settings" tab choose which event groups to record and set the retention period.

== Frequently Asked Questions ==

= Can an individual entry be edited or deleted? =

No. The plugin has neither a button nor a request for that. Only two actions on the journal as a whole are available — clean-up by the retention rules and a full clean-up — and both are themselves recorded in the journal.

= Do passwords and payment gateway keys end up in the journal? =

No. Masking happens on the write path, not on display: the value of such a field is not stored at all. The fact that a key was changed is still visible — otherwise a token rotation would pass unnoticed.

= Why are changes made during checkout not shown? =

The free tier records actions in the admin area. Changes from the storefront, the REST API, WP-Cron and WP-CLI are enabled by a separate switch in Pro — on a busy shop this is the noisiest source.

= Will the journal grow out of control? =

No. Retention rules apply by age and by row count, and every event group can be switched off separately. In the free tier the rules are applied with a button in the settings; with a Pro licence a daily job does it without reminders. The table size is shown on the journal screen.

= Does it work with HPOS (custom order tables)? =

Yes. The plugin listens to WooCommerce CRUD objects, so HPOS and the classic post-based order storage behave the same.

= Does the plugin start a trial by itself? =

No. A fresh install is the free tier: the Pro fields stay visible in their place, greyed out and marked "Pro", and nothing is unlocked until you press "Try Pro for 7 days" and enter an e-mail. That is the only place a trial is ever born.

= What happens when the trial ends? =

Recording of every event group, the journal, the filters, the search and the diffs keep working with no time limit. Only the Pro features listed above are locked. Settings you made during the trial are kept, not wiped.

== Screenshots ==

1. The activity journal with filters and summary figures.
2. An expanded entry — the "Field / Before / After" table.
3. Settings: event groups, retention, privacy.
4. E-mail notification about a critical event (Pro).

== Changelog ==

= 1.1.0 =
* The Pro trial no longer starts by itself. A fresh install is the free tier until the owner presses "Try Pro for 7 days".
* The trial now issues a real 7-day licence key by e-mail, through the same path a purchased key takes.
* Licence keys are checked against the CatCode licence server (activate on save, re-check once a day) instead of being accepted offline. If the server is unreachable, Pro keeps working for another 14 days.
* A key can be released from the site, freeing the activation slot for another store.
* Pro fields stay in place, greyed out, with a "Pro" badge and a line explaining what they do — instead of disappearing or being replaced by a banner.
* One dismissible notice, shown after the first journal entry rather than right after activation. Dismissed once, never shown again.
* Settings made during the trial are no longer wiped by a later "Save settings" on the free tier.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
The Pro trial no longer starts automatically: after the update the plugin runs as the free tier until you start a trial or enter a key from the settings screen.

= 1.0.0 =
Initial release.
