SM Snippets
A local, boring-in-the-best-way snippet manager for WordPress.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/shehuphd/sm-snippets/archive/refs/heads/main.zipDeclares an update source (https://github.com/shehuphd/sm-snippets), so updates arrive through the plugin's own updater.
Readme
SM Snippets
A local, boring-in-the-best-way snippet manager for WordPress.
Why
SM Snippets stores snippets in your own WordPress database and runs them where you tell it to. Everything happens on your own site, from one admin screen: paste the code, choose a placement and targeting rules, and activate it.
Quick start
- Download the latest release ZIP from GitHub, or zip the
sm-snippetsfolder yourself. - In WordPress, go to Plugins, Add New, Upload Plugin, and upload the ZIP.
- Activate it, then open the new SM Snippets menu in the admin sidebar.
- Click Add New, paste a snippet, pick a placement, tick Active, and save. It runs on the next page load.
To confirm it works in seconds: add an HTML snippet with `, placement "Site head", set it Active, then view your homepage source. The comment appears inside`.
What it does
- Runs HTML, CSS, JavaScript, and PHP snippets in eight placements, from
wp_headto a shortcode. - Targets by page mode, URL path, post ID, post type, login state, and environment, with an admins-only testing switch.
- Pauses everything with one click (safe mode), a constant, or a URL parameter.
- Imports JSON exports from other snippet plugins through a review screen, with everything paused by default.
- Keeps the last 20 revisions of each snippet.
- Updates itself from this repository's GitHub releases through the standard WordPress updates screen.
The full manual is in USAGE.md. The internals are described in ARCHITECTURE.md. Changes per release are in CHANGELOG.md.
License
GPL-2.0-or-later.
By Mo Shehu