WP Manifestindependent plugin directory
manifest / developer / leastudios-snippets

leaStudios Snippets WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

Manage custom PHP, JavaScript, CSS, and HTML snippets without editing theme files. Auto-insert locations, conditional logic, safe-mode error handling, and a pre-built library of hooks for the leaStudios suite.

★ 0stars
12release downloads
v1.1.4latest · 5mo ago

Install

Download leastudios-snippets-1.1.4.zip From the v1.1.4 release on GitHub, May 24, 2026

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/adamjohnlea/leastudios-snippets/releases/download/v1.1.4/leastudios-snippets-1.1.4.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Manage custom PHP, JavaScript, CSS, and HTML snippets without editing theme files. Auto-insert locations, conditional logic, safe-mode error handling, and a pre-built library of hooks for the leaStudios suite.

  • Requires WordPress: 6.4+
  • Requires PHP: 8.1+
  • License: GPL-2.0-or-later

Features

  • PHP, JS, CSS, HTML snippets managed from the admin.
  • Auto-insert locations — header, footer, before/after content, and more.
  • Conditional logic — page type, user role, post type, specific page IDs.
  • Safe mode — snippets that throw fatal errors are auto-deactivated with an admin notice.
  • Warning tracking — snippets that emit non-fatal PHP warnings stay active but surface a dismissible admin notice.
  • Pre-built library of hooks for leaStudios suite plugins.
  • Priority control for execution order.

Safety model

Only administrators with manage_options can create or edit snippets. A custom error handler captures fatal errors during snippet execution; the offending snippet is auto-deactivated and a safe-mode flag prevents re-execution until you fix and re-enable it. Fatal errors are contained even when they occur in deferred hooks or as uncatchable fatals, via a shutdown handler. If the site defines DISALLOW_FILE_MODS or DISALLOW_FILE_EDIT, creating and editing snippets is disabled (existing snippets keep running).

Installation

  1. Upload leastudios-snippets to /wp-content/plugins/.
  2. Activate via Plugins → Installed Plugins.
  3. Go to Snippets in the admin menu and create your first snippet.

This plugin is part of the leaStudios plugin family. It works on its own, and ships pre-built snippets that hook into the other leaStudios plugins (payments, email-templates, forms, mailer) under the Library tab. Browse there if you want quick examples of customising the rest of the suite.

Development

This plugin is self-contained — it can be cloned, linted, tested, and packaged on its own.

composer install            # install dependencies (incl. dev tools)
composer lint               # phpcs + phpstan
composer test               # phpunit (requires the WP test library)
composer phpcbf             # auto-fix WPCS issues

To run the test suite, install the WordPress test library once:

bash ../leastudios-dev-tools/bin/install-wp-tests.sh wordpress_test root '' localhost latest

The shared scaffold, packaging script, and project-wide development conventions live in leastudios-dev-tools — start there when bootstrapping a new plugin or making cross-plugin tooling changes.

License

GPL-2.0-or-later. See readme.txt for the WordPress.org-style header.

Releases

6 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.1.4 latest
May 24, 2026 5mo ago
leastudios-snippets-1.1.4.zip
6
May 24, 2026 5mo ago
leastudios-snippets-1.1.3.zip
1
May 24, 2026 5mo ago
leastudios-snippets-1.1.2.zip
1
May 23, 2026 5mo ago
leastudios-snippets-1.1.0.zip
0
May 23, 2026 5mo ago
leastudios-snippets-1.0.0.zip
2
May 23, 2026 5mo ago
leastudios-snippets-1.1.1.zip
2
A grade

Security

leaStudios Snippets 1.1.4 · audited by WP Registry

No security issues found.

Audited release
1.1.4
Findings
none
Worst severity
—
Content hash
28497347f0a76d0285f0641c…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.