{"id":50142395,"url":"https://github.com/adamjohnlea/leastudios-snippets","last_synced_at":"2026-05-24T02:04:58.978Z","repository":{"id":359482464,"uuid":"1224186002","full_name":"adamjohnlea/leastudios-snippets","owner":"adamjohnlea","description":"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.","archived":false,"fork":false,"pushed_at":"2026-05-22T03:32:04.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T12:36:36.359Z","etag":null,"topics":["mysql","php","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamjohnlea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-29T03:24:33.000Z","updated_at":"2026-05-22T03:32:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/adamjohnlea/leastudios-snippets","commit_stats":null,"previous_names":["adamjohnlea/leastudios-snippets"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/adamjohnlea/leastudios-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamjohnlea","download_url":"https://codeload.github.com/adamjohnlea/leastudios-snippets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33418555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mysql","php","wordpress","wordpress-plugin"],"created_at":"2026-05-24T02:04:57.758Z","updated_at":"2026-05-24T02:04:58.972Z","avatar_url":"https://github.com/adamjohnlea.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leaStudios Snippets\n\nManage 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.\n\n- **Requires WordPress:** 6.4+\n- **Requires PHP:** 8.1+\n- **License:** GPL-2.0-or-later\n\n## Features\n\n- **PHP, JS, CSS, HTML snippets** managed from the admin.\n- **Auto-insert locations** — header, footer, before/after content, and more.\n- **Conditional logic** — page type, user role, post type, specific page IDs.\n- **Safe mode** — snippets that throw fatal errors are auto-deactivated with an admin notice.\n- **Warning tracking** — snippets that emit non-fatal PHP warnings stay active but surface a dismissible admin notice.\n- **Pre-built library** of hooks for leaStudios suite plugins.\n- **Priority control** for execution order.\n\n## Safety model\n\nOnly 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).\n\n## Installation\n\n1. Upload `leastudios-snippets` to `/wp-content/plugins/`.\n2. Activate via Plugins → Installed Plugins.\n3. Go to **Snippets** in the admin menu and create your first snippet.\n\n## Related plugins\n\nThis 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.\n\n- **[leastudios-payments](../leastudios-payments)**\n- **[leastudios-email-templates](../leastudios-email-templates)**\n- **[leastudios-forms](../leastudios-forms)**\n- **[leastudios-mailer](../leastudios-mailer)**\n\n## Development\n\nThis plugin is self-contained — it can be cloned, linted, tested, and packaged on its own.\n\n```bash\ncomposer install            # install dependencies (incl. dev tools)\ncomposer lint               # phpcs + phpstan\ncomposer test               # phpunit (requires the WP test library)\ncomposer phpcbf             # auto-fix WPCS issues\n```\n\nTo run the test suite, install the WordPress test library once:\n\n```bash\nbash ../leastudios-dev-tools/bin/install-wp-tests.sh wordpress_test root '' localhost latest\n```\n\nThe shared scaffold, packaging script, and project-wide development conventions live in **[leastudios-dev-tools](../leastudios-dev-tools)** — start there when bootstrapping a new plugin or making cross-plugin tooling changes.\n\n## License\n\nGPL-2.0-or-later. See `readme.txt` for the WordPress.org-style header.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjohnlea%2Fleastudios-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamjohnlea%2Fleastudios-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjohnlea%2Fleastudios-snippets/lists"}