=== Persjay Graveyard ===
Contributors: jaypeeperos
Tags: plugins, cleanup, database, abandoned plugins, maintenance
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Find dead, abandoned and leftover plugin clutter, see what it costs, and clean it up safely.

== Description ==

https://www.youtube.com/watch?v=lAR6W-UkEWY

Persjay Graveyard scans your site and shows:

* Plugins that were closed on WordPress.org or have not been updated for 2 years or more.
* Inactive plugins and unused themes, with the space they take up.
* An "autopsy" of each plugin: the database tables, saved options, cached values, scheduled tasks and upload folders it keeps.
* Database tables left behind by plugins you already removed, with a confidence label for each.
* A Persjay Graveyard Score from 0 to 100 and a dashboard widget.

You can delete orphaned tables from the screen. Deletion needs a typed confirmation, only removes tables that are orphaned at that moment, and never touches core tables or tables of another WordPress install in the same database.

**Free** includes automatic table snapshots before deletion and restore access, with 30-day retention. If a snapshot cannot be saved, no tables are deleted. These snapshots cover selected tables, not a full site backup.

**Pro** adds full cleanup of the options, cached values and scheduled tasks an inactive plugin left behind, one-click removal of unused themes, and scheduled scans with an email digest.

**Business** adds closed-plugin alerts, replacement suggestions, auto-bury rules that wait for your approval, an activity log with CSV export, and WP-CLI commands.

**Agency** adds a multisite network view with bulk actions, white-label branding and printable client reports.

Pro, Business and Agency are optional paid plans, installed as a separate download. Everything in this plugin works without them. Plans, pricing and a free trial are on the [Persjay Graveyard page](https://persjay.com/plugins/persjay-graveyard/).

= Good to know =

"Abandoned" is a signal, not a verdict: some small plugins are simply finished. Table matching is based on names, so check each table before deleting and keep a backup.

= Where are snapshots stored? =

Automatic storage prefers private ZIP files when the server supports them and uses the database otherwise. Saved storage choices take precedence. In Persjay Graveyard > Settings, all plans can choose private ZIP storage and enter an existing writable server directory outside all web roots. Persjay Graveyard > Snapshots shows the active storage and expiry dates. Existing snapshots remain in their original storage. Snapshots expire after 30 days by default and are removed during scheduled cleanup. If the private ZIP location is unavailable, ask your host to define PJGY_SNAPSHOT_PRIVATE_ROOT in wp-config.php as an existing writable directory outside all web roots. On hosts with web aliases or multiple document roots, use a location your host confirms is private. If legacy snapshots are on a separate filesystem, your host may need to move the snapshot folder manually. Cleanup stays blocked until storage is ready.

= Can I download a ZIP without setting up a private folder? =

Yes. Keep Database selected and use Download ZIP on a snapshot in Persjay Graveyard > Snapshots. ZIP downloads require the PHP ZIP extension. To save future ZIPs on the server, use Check ZIP storage in Persjay Graveyard > Settings.

== External services ==

This plugin asks the WordPress.org plugin API (https://api.wordpress.org/plugins/info/1.2/) whether each installed plugin is still available and when it was last updated. Only the plugin folder name is sent, never your site address. This happens when you run a scan, and results are cached for 7 days. See the WordPress.org privacy policy: https://wordpress.org/about/privacy/

== Installation ==

1. Upload the plugin to `/wp-content/plugins/persjay-graveyard`, or install it from the Plugins screen.
2. Activate it.
3. Open Persjay Graveyard and run your first scan.

== Frequently Asked Questions ==

= Do I need Pro to restore deleted tables? =

No. Automatic snapshots before table deletion and table restore are included in Free. Restore access does not require an active paid license. Snapshots are kept for 30 days.

= What happens if a snapshot cannot be saved? =

Table deletion stops. No selected tables are deleted when the snapshot provider is unavailable or saving fails, including when the snapshot size limit is exceeded.

= Are snapshots a full site backup? =

No. Table snapshots cover only the selected tables, including their structure and rows. They do not back up the whole database or your WordPress files. Keep a separate full site backup. Restoring a table snapshot will not overwrite a table that already exists.

== Screenshots ==

1. The overview: your Persjay Graveyard Score and what needs attention.
2. Every installed plugin with its WordPress.org status, size and leftovers.
3. Database tables left behind by removed plugins, each with a confidence label and a typed confirmation before deletion.
4. Unused themes and the space they take up.
5. The dashboard widget.

== Changelog ==

= 0.3.0 =
* Renamed to Persjay Graveyard (slug persjay-graveyard). Paid installs move their settings and snapshots over automatically.
* Use a unique prefix for all code, settings and hooks.
* Show the full Persjay Graveyard name throughout the plugin, emails and reports.
* Load dashboard widget styles through the WordPress style queue.
* Use the WordPress filesystem API for snapshot files.
* Table snapshots now read rows in a consistent, ordered transaction and verify each table is unchanged before it is deleted.

= 0.2.20 =
* Package the WordPress.org edition without the Freemius SDK or updater.
* Clarify translation placeholders and improve snapshot filesystem handling.
* Use Persjay Apps as the admin header byline.

= 0.2.19 =
* Prevent a fatal error when Premium is activated while the free edition is loaded.

= 0.2.18 =
* Improve spacing and button wrapping in Snapshot settings.
* Use the full available width in the Graveyard admin.

= 0.2.17 =
* Prefer private ZIP storage in Automatic mode, with database storage when private ZIP storage is unavailable.
* Add ZIP downloads and a private storage check.
* Show Settings after the paid feature tabs.

= 0.2.16 =
* Move snapshot storage and retention controls to Graveyard > Settings.
* Let all plans choose a writable private ZIP directory.
* Show the active storage and retention settings on the Snapshots tab.

= 0.2.15 =
* Store new snapshots in the database by default, with private ZIP storage available as an advanced option.
* Show each snapshot’s storage, size, and expiry date.
* Give Graveyard its own WordPress admin menu.

= 0.2.14 =
* Store snapshots outside the web root and stop cleanup when private storage is unavailable.
* Move existing snapshot folders into private storage when the filesystem permits.

= 0.2.13 =
* Pro: inspect plugin footprints and configure snapshot retention from 30 to 365 days.
* Business: log plugin activations, deactivations, and successful deletions.
* Agency: set a shared snapshot retention policy for WordPress multisite.
* Fix: use the current Graveyard logo in digest emails by default.
* Improved: explain why the last fallback theme is kept installed.

= 0.2.12 =
* New: automatic table snapshots and restore are now included in Free, with 30-day retention and no paid license required for recovery.
* Improved: table deletion stops if a snapshot provider is unavailable or does not return a valid snapshot ID.
* Fix: incomplete snapshot writes, failed file finalization and failed metadata saves now prevent cleanup from proceeding.
* Updated: table cleanup messages explain snapshot protection and the need for a separate full site backup.
* Updated: plugin author and WordPress.org contributor are now jaypeeperos.


= 0.2.11 =
* New: the Graveyard logo now appears in the admin header, on the first-run screen, in the dashboard widget and on the Freemius account screens. White-label (Agency) shows your own logo, or none.
* Improved: messages such as "Removed Extendable" now have proper spacing, an icon and a centred close button.
* Improved: plugin and theme State columns use clear Active / Inactive badges.
* Improved: the dashboard widget shows the score with a coloured ring and the last scan time.

= 0.2.10 =
* Improved: network bulk actions now say "Nothing needed cleaning." when there was nothing to clean, and report how many sites were skipped (archived, spam, deleted or over the site limit).

= 0.2.9 =
* Fix: free WordPress.org plugins that changed owner (for example WP Mail SMTP, WooCommerce Stripe Gateway, Kadence Email Designer) were shown as Premium / vendor. A matching name is now enough; a Closed verdict needs the full name to match.

= 0.2.8 =
* Fix: spacing between the stat tiles and the "What needs attention" heading in the digest email (spacers now work in Gmail and Outlook).

= 0.2.7 =
* New: plugins still waiting for a WordPress.org check are now finished automatically in the background, so you no longer need to scan again and again.
* New: "Premium / vendor" status for plugins that are not on WordPress.org or are updated by their vendor. They are no longer shown as unverified and never count against the score.
* Improved: a plugin is only marked Closed or Abandoned when both its name and its author match the WordPress.org listing, which removes false positives for premium plugins that share a folder name with a free one.
* Fix: the Graveyard row always shows the installed version.
* New: Ignore a plugin or orphaned table you know is fine. Ignored items stop counting towards the score and can be restored at any time.
* Improved: an orphaned table whose name resembles an installed plugin is capped at Medium confidence and is never pre-selected for deletion.
* Improved: a WordPress.org listing with a differently worded name is accepted when the author clearly matches.

= 0.2.6 =
* Fix: stray closing tag on the Overview screen pushed the WordPress footer up over the content.

= 0.2.5 =
* New: redesigned admin screens with a score header, pill tabs, stat tiles, cleaner tables and forms. Responsive down to phone width.

= 0.2.4 =
* New: redesigned HTML emails for the scan digest and closed-plugin alerts, with a plain-text fallback. Agency white-label colour and logo are used when set.

= 0.2.3 =
* Fix: WP-CLI commands are now `wp graveyard bury-tables` and `wp graveyard bury-leftovers`, as documented.

= 0.2.2 =
* The plugin is now simply called Graveyard.

= 0.2.1 =
* Fix: orphaned-table detection no longer lists tables of active plugins whose folder name differs from their table prefix.
* Fix: premium plugins that share a folder name with a closed WordPress.org plugin are no longer reported as closed.
* Fix: network screen now works when the license is activated on a site rather than the network.

= 0.2.0 =
* Pro: full cleanup of leftovers, unused theme removal, scheduled scans and email digest.
* Business: closed-plugin alerts, replacement suggestions, auto-bury queue, activity log, WP-CLI.
* Agency: network graveyard and bulk actions, white-label, client reports.

= 0.1.0 =
* First prototype: scan, autopsy, score, dashboard widget and orphaned table cleanup.

== Upgrade Notice ==

= 0.2.12 =
Table snapshots and restore are now free. Table deletion stops if a recovery snapshot cannot be saved. Snapshots are kept for 30 days; keep a full site backup too.
