{"id":50142397,"url":"https://github.com/adamjohnlea/leastudios-dev-tools","last_synced_at":"2026-05-24T02:04:58.989Z","repository":{"id":359655841,"uuid":"1224188466","full_name":"adamjohnlea/leastudios-dev-tools","owner":"adamjohnlea","description":"Shared scaffolding and tooling for the leaStudios family of WordPress plugins.","archived":false,"fork":false,"pushed_at":"2026-05-22T19:47:33.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T22:31:37.310Z","etag":null,"topics":["developer-tools","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:28:51.000Z","updated_at":"2026-05-22T19:47:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/adamjohnlea/leastudios-dev-tools","commit_stats":null,"previous_names":["adamjohnlea/leastudios-dev-tools"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/adamjohnlea/leastudios-dev-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-dev-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-dev-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-dev-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-dev-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamjohnlea","download_url":"https://codeload.github.com/adamjohnlea/leastudios-dev-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjohnlea%2Fleastudios-dev-tools/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":["developer-tools","mysql","php","wordpress","wordpress-plugin"],"created_at":"2026-05-24T02:04:58.130Z","updated_at":"2026-05-24T02:04:58.979Z","avatar_url":"https://github.com/adamjohnlea.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leaStudios Dev Tools\n\nShared scaffolding and tooling for the leaStudios family of WordPress plugins.\n\nThis repo is **not a plugin**. It's the development home for:\n\n- **`_boilerplate/`** — the starting scaffold for any new leaStudios plugin (PSR-4, modern PHP 8.1+, REST controller stub, security helpers, sample test).\n- **`bin/install-wp-tests.sh`** — installs the WordPress test library (`wordpress-tests-lib`) into a temp dir so each plugin can run `phpunit` against a real WordPress.\n- **`bin/package.sh`** — packages a plugin into a distributable `.zip` (respecting each plugin's `.distignore`).\n- **`bin/check-shared.sh`** — verifies that files intentionally duplicated across the plugins (`Security/Nonce.php`, `Encryption/Options_Encryptor.php`, `Shared/Datetime_Util.php`, and their duplicated tests) remain in sync. Exits non-zero on drift, with a normalized diff so you can see exactly what changed. Enforced automatically — see \"Check shared files for drift\" below.\n- **`bin/git-hooks/`** + **`bin/install-hooks.sh`** — a shared `pre-push` hook that runs `check-shared.sh` before every push, plus a one-time installer that wires it into each suite repo.\n- **`config-templates/`** — canonical `phpcs.xml.dist`, `phpstan.neon`, `phpunit.xml.dist`, and `tests/bootstrap.php` templates that every plugin repo copies in.\n- **`CLAUDE.md`** — project-wide development conventions (coding standards, security rules, WordPress patterns) that apply across all leaStudios plugins.\n- **`CODE_REVIEW.md`** — historical code-review notes for the plugin family.\n\n## How it relates to the plugins\n\nEach leaStudios plugin lives in its own git repository alongside this one in `wp-content/plugins/`:\n\n```\nwp-content/plugins/\n├── leastudios-dev-tools/         (this repo)\n├── leastudios-payments/          (own repo)\n├── leastudios-email-templates/   (own repo)\n├── leastudios-forms/             (own repo)\n├── leastudios-mailer/            (own repo)\n└── leastudios-snippets/          (own repo)\n```\n\nEach plugin is **self-contained** — it has its own `composer.json` with dev dependencies, its own `phpcs.xml.dist`, `phpstan.neon`, `phpunit.xml.dist`, and `tests/bootstrap.php`. A plugin can be cloned, linted, tested, and packaged on its own without this repo being present.\n\nThis repo is the **canonical source** of those configs. When you change a config template here, propagate the change to each plugin repo manually (or via a small sync script).\n\n## Common workflows\n\n### Bootstrap a new plugin\n\n```bash\ncp -R leastudios-dev-tools/_boilerplate leastudios-newthing\ncd leastudios-newthing\n# Find/replace plugin-name → newthing, PluginName → Newthing, etc.\n# (See _boilerplate/README — todo)\ncomposer install\ngit init\n```\n\n### Install the WordPress test library (one-time, shared across all plugins)\n\n```bash\nbash leastudios-dev-tools/bin/install-wp-tests.sh wordpress_test root '' localhost latest\n```\n\nThis drops the test library into `/tmp/wordpress-tests-lib/`. Every plugin's `tests/bootstrap.php` looks for it there (or via the `WP_TESTS_DIR` env var).\n\n### Run a plugin's tests / lint\n\nFrom inside any plugin directory:\n\n```bash\ncomposer install      # one-time\ncomposer lint         # phpcs + phpstan\ncomposer test         # phpunit\ncomposer phpcbf       # auto-fix WPCS issues\n```\n\n### Package a plugin for distribution\n\n```bash\nbash leastudios-dev-tools/bin/package.sh leastudios-payments\n# → produces leastudios-payments-X.Y.Z.zip\n```\n\nOr `bash leastudios-dev-tools/bin/package.sh all` to package every plugin.\n\n### Check shared files for drift\n\n```bash\nbash leastudios-dev-tools/bin/check-shared.sh\n```\n\nConfirms that files duplicated across plugins by design (e.g. `Security/Nonce.php` and its tests) haven't drifted. Exits 0 if everything's in sync, 1 with a normalized diff if anything has changed. Add new shared files by appending to `SHARED_FILES` in the script (paths are relative to each plugin root).\n\nThis check runs automatically, so drift is caught without anyone remembering to run it:\n\n- **Pre-push hook (local).** Run the one-time installer after cloning the suite:\n\n  ```bash\n  bash leastudios-dev-tools/bin/install-hooks.sh\n  ```\n\n  It points each repo's `core.hooksPath` at `bin/git-hooks`, so a push that would introduce drift is blocked before it leaves your machine. Re-run it after adding a new plugin repo.\n\n- **CI (GitHub Actions).** `.github/workflows/check-shared.yml` in this repo checks out the suite and runs the same check on every push to `leastudios-dev-tools`, on a weekly schedule, and on demand (`workflow_dispatch`). The private `leastudios-siteaudit` repo is not cloned in CI; the pre-push hook covers it.\n\n`check-shared.sh` still needs the whole suite checked out as siblings — it cannot run inside a single isolated plugin clone.\n\n## Versioning\n\nThis repo isn't published as a Composer package — its contents are copy-in templates. Each plugin pins its own versions of `phpstan/phpstan`, `wp-coding-standards/wpcs`, etc. in its own `composer.json`.\n\n## License\n\nGPL-2.0-or-later, matching the plugins.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjohnlea%2Fleastudios-dev-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamjohnlea%2Fleastudios-dev-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjohnlea%2Fleastudios-dev-tools/lists"}