Skip to content

Database Schema

SnipShare stores its data in ten custom tables (prefixed with your site’s table prefix, for example wp_). It does not use custom post types. The tables are created on activation via dbDelta() and kept up to date by a version check on load.

Table Holds
snipshare_pastes Pastes: owner, parent (fork source), title, description, visibility, status, password hash, burn flag, expiry, version, counts (fork/view/star/file), and the unique share_hash.
snipshare_files Files belonging to a paste: filename, content, language, and sort order.
snipshare_paste_meta Arbitrary key/value metadata attached to a paste.
snipshare_tags Tags: name, slug, and usage count.
snipshare_paste_tags Join table linking pastes to tags.
snipshare_revisions Per-file revision history: content, filename, language, version, and optional change note.
snipshare_collections Collections: owner, name, slug, description, visibility, and paste count.
snipshare_collection_pastes Join table linking collections to pastes, with sort order.
snipshare_stars Stars: which user starred which paste.
snipshare_reports Moderation reports: paste, reporter, reason, details, status, and reviewer.
  • Paste visibility: public, private, unlisted.
  • Paste status: active, expired, trashed.
  • Collection visibility: public, private.
  • Report reason: spam, inappropriate, malicious, copyright, other.
  • Report status: pending, reviewed, dismissed.

An hourly WP-Cron event (snipshare_expire_pastes) marks overdue pastes as expired and permanently deletes pastes that have been trashed for more than 30 days. Deleting a paste cascades to its files, revisions, tags links, collection links, stars, and reports.