SnipVault 1.3.4
Security: Fixed snippets, folders, projects, automations and snippet tags being readable by signed-out visitors through the public REST API (
/wp/v2/svsnippets,/wp/v2/svfolders,/wp/v2/svprojects,/wp/v2/svautomations,/wp/v2/snipvault-tags), which exposed snippet code, settings, errors and file paths. These routes, plus comments on snippets, now require SnipVault access (manage_options, honouring the restricted-user setting) in every context and return 401 for signed-out requests.Security: SnipVault post types now map every edit/publish/delete capability to
manage_options, so Editors and Authors can no longer read or change snippets through core routes such as/wp/v2/svsnippets/{id}/revisions.Fixed GitHub connections dropping and needing a reconnect every few days. GitHub refresh tokens are single-use, and when the sync cron and the admin UI refreshed an expired token at the same moment, the losing request treated GitHub's
bad_refresh_tokenas a dead connection and wiped the fresh tokens the winning request had just saved. Token refresh now uses an atomic database lock, waiting requests reuse the winner's tokens (bypassing the object cache so they actually see them), and credentials are never cleared if another request has already rotated them.Fixed GitHub credentials being wiped on any 400/401/403 from the token broker (for example rate limits or firewall challenges). Only GitHub's explicit
bad_refresh_token/invalid_granterrors now require a reconnect; other refresh failures are logged and retried.Fixed GitHub connections made through the hosted SnipVault broker never refreshing: the broker now returns refresh tokens and expiry on connect and provides a
/refreshendpoint, so the 8-hour GitHub App access token renews automatically. Sites connected before this update need to reconnect GitHub once.Fixed backslashes being silently stripped from snippet code pulled or imported from GitHub (for example a regex
[\d]+became[d]+). WordPress unslashes post meta on save, so pulled content, imported content and stored conflict payloads are now slashed first and saved exactly as they appear in the repository. Snippets already affected need to be pulled again (or fixed by hand) after updating.