tearoom1/kirby-content-watch

Kirby plugin that allows you to keep track of what has been changed and by whom.

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Language:JavaScript

Type:kirby-plugin

v1.0.1 2025-05-25 07:43 UTC

This package is auto-updated.

Last update: 2025-05-25 11:09:09 UTC


README

This plugin tracks all content changes in your Kirby site and adds a panel view that displays those changes. It shows modification date and editor information and the history of changes for each file. This allows you to keep track of what has been changed and who made the changes.

Additionally it provides a view to see which pages are currently locked and by whom.

Features

  • Change Tracking: Automatically tracks all content changes in pages and files
  • Editor Attribution: Records which editor made each change with timestamp
  • History Timeline: Lists all content files across your Kirby site, sorted by modification date
  • File Tracking: Tracks both page content and media file changes
  • Locked Pages View: Shows which pages are currently being edited and by whom
  • Search Functionality: Quickly find specific content files
  • Direct Panel Links: One-click access to edit content in the Panel
  • Customizable Retention: Configure how long history is kept
  • Version Restore: Restore previous versions of content with a single click (optional)

Installation

Manual

  1. Download or clone this repository
  2. Place the folder kirby-content-watch in /site/plugins/

Composer

composer require tearoom1/kirby-content-watch

Usage

After installation, you'll see a new "Content Watch" item in the Panel menu. Click on it to access:

  • Files View: All content files with their modification history
  • Locked Pages: Overview of currently locked pages and who is editing them

Each file in the list can be expanded to show its modification history. For each history entry with a snapshot, a restore button is available to revert to that previous version.

Configuration

You can configure the plugin in your config.php:

return [
    'tearoom1.content-watch' => [
        // How many days to keep history entries (default: 30)
        'retentionDays' => 30,
        
        // Maximum number of history entries to keep per file (default: 10)
        'retentionCount' => 10,
        
        // Whether to show locked pages in the interface (default: true)
        'enableLockedPages' => true,
        
        // Whether to enable content restore functionality (default: false)
        // When disabled, content snapshots are not stored to save disk space
        'enableRestore' => true
    ]
];

How It Works

The plugin creates a .content-watch.json file in each content directory that has been modified. This file stores the history of changes including editor information, timestamps, and content snapshots for restoration (if restore is enabled). History entries are automatically pruned based on your retention settings.

When restore functionality is enabled:

  1. Each time content is changed, a snapshot of the content is saved
  2. You can view and restore previous versions through the interface
  3. When you restore a previous version, the plugin will:
    • Extract the content from the saved snapshot
    • Overwrite the current content file
    • Record this restoration in the history with a reference to the restored version

When restore functionality is disabled:

  1. The plugin only tracks metadata like timestamps and editor information
  2. No content snapshots are stored, reducing disk usage
  3. The restore buttons will not be displayed in the interface

NOTE: The restore functionality only works for page content. It does not track changes of media/binary files.

Requirements

  • Kirby 4.x or 5.x
  • PHP 8.0+

License

MIT

Credits

  • Developed by TearoomOne