Hi everyone,
I would like to share my first Kirby plugin:
kirby-trash - a “proper” trash can for Kirby.
Deleted pages and files are not removed instantly (as per default in Kirby) but moved to a trash where they can be restored or deleted permanently, via a dedicated Panel area:

How it works:
the plugin listens to the page.delete:before / file.delete:before hooks and copies the affected content (including all translations, files, subpages and Kirby 5 \_changes versions) into a configurable trash storage before Kirby deletes it. If the safety copy fails, the deletion is blocked, so content never gets deleted without a copy. Restoring puts everything back verbatim, so UUIDs and internal links survive.
Features:
-
Panel area with a table view (original path, size, deletion date, time left / see screenshot) and a details dialog with direct restore/delete actions
-
Automatic cleanup with configurable retention (default 30 days, set to
-1to keep indefinitely) plus akirby trash:cleanupCLI command for cronjobs (if you need “precision cleanup” - otherwise, cleanup will occur on your next visit to the kirby-trash panel area) -
Per-role permissions (
access,restore,delete),admin-only by default -
enabledandrootoptions accept closures, e.g. to switch by environment -
English and German translations
Installation:
composer require sigtrygg-space/kirby-trash
Requires Kirby 5 and PHP 8.2+.
Links:
This is my first plugin. I am very open to feedback of any kind: bug reports, API design opinions, translations, naming, edge cases I have not thought of.
The current version is a v0.1.2 pre-release - issues and PRs are welcome on GitHub, or just reply here.
Thanks for reading, and I hope it is useful to some of you!
A note on the building method
I started working on this Idea a few years back as part of a website project but I never quite got around to finishing it. Claude to the rescue: kirby-trash now exists - not just for my project, but as a free plugin for Kirby 5.
So, yeah - kirby-trash was co-authored by Claude Fable 5: The code was developed on the basis of my unfinished work, then reviewed and tested in an iterative loop between two AI Instances (build + audit) and some human interference from my part, including a full manual test setup.