manifest / unclassified / pressshot-plugin
PressShot
PressShot Library for WordPress: shots, folders, tags, share links, and Trash at /shots.
★ 0stars
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dhanson-wp/pressshot-plugin/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
PressShot for WordPress
The PressShot Library for WordPress: shots, folders, tags, share links, and Trash, served at /shots for people who can upload files on the site. Your WordPress account is your sign-in. Work happens on the shots-library branch.
How it works
- A shot is an attachment registered by a capture app. The PressShot Mac app uploads with
POST /wp/v2/media, then callsPOST /wp-json/pressshot/v1/captures/{id}/registerwith{ "source": "pressshot" }and gets back{ id, source, shareUrl }. Registering sets_pressshot_captureand_pressshot_source. Allowed sources come from thepressshot_shot_sourcesfilter. The full contract is in docs/shot-marker.md. - A team site is shared. Everyone with
upload_filessees every shot. Folders (nested) and tags are shared too. There's no manager view and no per-shot privacy. WordPress administrators can see every upload in wp-admin anyway. - A personal site is private because nobody else is on it.
- The files aren't secret. The plugin hides shots from WordPress's public listings (
/wp/v2/media, the folder and tag routes, attachment pages, and oEmbed) for anyone without Library access, and its own routes check access on every request. Each file still lives at a normal uploads address that isn't secret: anyone who has the exact address can open it, and revoking a link doesn't change that. Only a private WordPress.com site or server rules protect the files themselves, and a private site also blocks the/s/share pages. - Share links live at
/s/{token}, one per shot or folder, with optional expiry and revocation. Shot links need permission to edit that attachment; folder links need Editor or above (edit_others_posts). Delete and restore followdelete_post. - Trash keeps deleted shots for 30 days (WordPress's
EMPTY_TRASH_DAYS). Restoring doesn't bring back old links.
Requirements
- WordPress 7.1 or newer, PHP 7.4 or newer.
- Pretty permalinks. Plain permalinks aren't supported.
- Never serve
/shotsfrom a shared page cache. The page carries a per-person REST nonce. Exclude/shots(and/s/) from any page cache that doesn't already skip signed-in visitors. - The
/shotspath can be changed with thepressshot_shots_pathfilter. Save Settings → Permalinks after changing it.
Still being checked
- Whether revoking a link also stops a VideoPress recording from playing for someone who already has its VideoPress address. Until that's verified on a hosted site, revocation is only known to close the share page and the plugin's own token media route, not the VideoPress file.
- Hosted behavior on WordPress.com: VideoPress upload and playback, protected image delivery and caching, and application-password approval.
Guides
Development
bin/sync-studio.shcopies the plugin into the local Studio site and activates it.bin/test-php.sh [file...]runstests/php/*-test.phpthrough Studio WP-CLI and exits non-zero on anyFAILline.npm run build,npm start, andnpm run test:jsuse@wordpress/scripts.npm run plugin-zipbuilds the app, then writespressshot-plugin.zipwith apressshot/folder inside, then runsbin/check-zip.sh, which fails ifbuild/library.jsorbuild/library.asset.phpis missing from the ZIP. Thefilesfield inpackage.jsondecides what goes in.
Tests share tests/php/harness.php, which provides $check, $call, $make_user, and $make_shot, and removes only the users and attachments it created.
License
GPL-2.0-or-later, the same license as WordPress. See LICENSE.