{"id":50962124,"url":"https://github.com/ahegyes/wordpress-plugin-template","last_synced_at":"2026-06-18T15:03:55.918Z","repository":{"id":355458765,"uuid":"1224395675","full_name":"ahegyes/wordpress-plugin-template","owner":"ahegyes","description":"GitHub template for WordPress plugins built on the DWS v2 framework — per-fork scoped dependencies, full test + CI scaffolding.","archived":false,"fork":false,"pushed_at":"2026-05-03T17:35:16.000Z","size":587,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2026-05-03T19:28:22.424Z","etag":null,"topics":["dws-framework","php","template","wordpress","wordpress-plugin","wordpress-plugin-template"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahegyes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-29T08:36:31.000Z","updated_at":"2026-05-03T17:35:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ahegyes/wordpress-plugin-template","commit_stats":null,"previous_names":["ahegyes/wordpress-plugin-template"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/ahegyes/wordpress-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahegyes%2Fwordpress-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahegyes%2Fwordpress-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahegyes%2Fwordpress-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahegyes%2Fwordpress-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahegyes","download_url":"https://codeload.github.com/ahegyes/wordpress-plugin-template/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahegyes%2Fwordpress-plugin-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34495380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["dws-framework","php","template","wordpress","wordpress-plugin","wordpress-plugin-template"],"created_at":"2026-06-18T15:03:55.213Z","updated_at":"2026-06-18T15:03:55.910Z","avatar_url":"https://github.com/ahegyes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DWS Plugin Template\n\nScaffold for WordPress plugins on the DWS framework. Each fork ships its own scoped copy of the framework + PHP-DI (via humbug/php-scoper) so two plugins can't collide on framework versions.\n\n## Architecture\n\n```\ndws-plugin-template/\n├── dws-plugin-template.php   # WP plugin entry: header → autoload → check_requirements → boot\n├── functions.php             # Global facade (theme/snippet API surface)\n├── uninstall.php             # WP-invoked cleanup on plugin deletion\n├── src/\n│   ├── Plugin.php            # Singleton: container + kernel + lifecycle\n│   └── AdminNotice.php       # Demo HookableInterface component\n├── config/\n│   └── container.php         # PHP-DI definitions\n├── tests/\n│   ├── bootstrap.php         # Composer autoload + (in wp-env) WP load\n│   ├── Unit/                 # Pure PHP, no Docker\n│   ├── Integration/          # wp-env Docker, real WP loaded\n│   └── e2e/                  # Playwright + @wordpress/e2e-test-utils-playwright\n├── scoper.inc.php            # php-scoper config — extends wordpress-configs base\n└── dependencies/             # Generated: scoped framework + PHP-DI (gitignored)\n```\n\n## Placeholder Convention\n\nReplace these throughout the codebase when forking. Two real v1 plugins shown as examples — pick the column matching your fork:\n\n| Placeholder                                    | WC plugin example                            | Generic WP plugin example            |\n|------------------------------------------------|----------------------------------------------|--------------------------------------|\n| `dws-plugin-template` (slug + text-domain)     | `locked-payment-methods-for-woocommerce`     | `internal-comments`                  |\n| `DWS_PLUGIN_TEMPLATE` (constants)              | `DWS_LPMWC`                                  | `DWS_IC`                             |\n| `dws_plugin_template_` (functions)             | `dws_lpmwc_`                                 | `dws_ic_`                            |\n| `DeepWebSolutions\\PluginTemplate\\` (namespace) | `DeepWebSolutions\\LockedPaymentMethods\\`     | `DeepWebSolutions\\InternalComments\\` |\n| `DWS Plugin Template` (display)                | `Locked Payment Methods for WooCommerce`     | `Internal Comments`                  |\n| `8811` (wp-env port — 3 spots)                 | any free port (avoid 8888/8889)              | any free port (avoid 8888/8889)      |\n\n**WC plugins follow extra conventions** (per v1 + WC trademark policy):\n- **Display**: `X for WooCommerce` (WC trademark requirement). NOT \"WooCommerce X\" or \"WC: X\".\n- **Slug** + **text-domain**: end in `-for-woocommerce`.\n- **Constant + function abbreviations** end in `WC` (`LPMWC` = Locked Payment Methods + WooCommerce). Keeps `DWS_` prefix.\n- **Composer package name** convention is `deep-web-solutions/wc-\u003cshort-name\u003e` (e.g., `wc-locked-payment-methods`).\n\n**Generic WP plugins** drop the `WC` everything: plain slug, plain abbreviation, `wp-` composer prefix (e.g., `deep-web-solutions/wp-internal-comments`).\n\n**Both variants share v2's flat namespace** — `DeepWebSolutions\\PluginName\\` only. v1's `\\WC_Plugins\\` and `\\Plugins\\` middle segments are dropped in v2.\n\nThe port appears in: `.wp-env.tests.json` (`\"port\"`), `playwright.config.js` (`WP_BASE_URL`), and this README's \"Open localhost\" line. All three must match.\n\nScoped deps land under `\\Scoped\\` inside the plugin's namespace (`DeepWebSolutions\\PluginTemplate\\Scoped\\DI\\...`). The `\\Scoped\\` segment is invariant; renaming the namespace placeholder above is enough.\n\n## Fork Reset Checklist\n\nTemplate tracks its own version + history; forks start fresh:\n\n- Reset `2.0.0` → `1.0.0` everywhere (plugin header, `_VERSION` constant, all `@since` / `@version`, `readme.txt` Stable tag, `CHANGELOG.md` heading). Don't touch the SemVer / Keep-a-Changelog URLs.\n- Wipe `CHANGELOG.md` body to a single empty `## 1.0.0 - unreleased` block (keep prologue + markers).\n- Delete `changelog/*.md` (keep `.gitkeep`).\n- Rewrite `readme.txt` Description / Tags / Contributors / etc.\n\n## Local Development\n\nRequires:\n\n- PHP 8.5+ with `pcov` extension (homebrew: `pecl install pcov`).\n- Node.js 24+ (for `@wordpress/env`).\n- Docker (for `@wordpress/env`).\n\n```sh\ncomposer packages-install   # Resolves deps + runs php-scoper → dependencies/\ncomposer test:unit          # Pure PHP unit tests, no Docker\n\nnpm install                 # Installs @wordpress/env, @playwright/test, etc.\nnpx playwright install      # Downloads browser binaries (one-time, ~150MB)\nnpm run wp-env:start        # Boots WordPress in Docker\n\ncomposer test:integration   # PHPUnit Integration suite (real WP, no browser)\nnpm run test:e2e            # Playwright E2E suite (browser, real admin UI)\n\nnpm run wp-env:stop\n```\n\n\u003e Use `composer packages-install` / `packages-update` (never bare `composer install` / `update`) — the wrappers pass `--ignore-platform-reqs`, which prevents composer from emitting a `platform_check.php` that would bypass the framework's friendly version-check admin notice.\n\nTo activate the plugin in the wp-env browser:\n\n```sh\nnpm run wp-env -- run cli wp plugin activate dws-plugin-template\n```\n\nOpen \u003chttp://localhost:8811/wp-admin\u003e and you'll see the \"DWS Plugin Template is active\" admin notice. The port is set in `.wp-env.tests.json` — change `\"port\"` when forking if 8811 collides with another wp-env you run locally.\n\n## Composer Scripts\n\n| Command                           | What it does                                            |\n|-----------------------------------|---------------------------------------------------------|\n| `composer test:unit`              | PHPUnit Unit suite (no Docker)                          |\n| `composer test:integration`       | PHPUnit Integration suite (requires wp-env)             |\n| `npm run test:e2e`                | Playwright E2E suite (requires wp-env)                  |\n| `composer lint:php`               | PHPCS + PHPStan                                         |\n| `composer format:php`             | PHPCBF auto-fix                                         |\n| `composer quality-check`          | `lint:php` + `test:unit`                                |\n| `composer scope-php-dependencies` | Manual scoping run (auto-runs after `composer install`) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahegyes%2Fwordpress-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahegyes%2Fwordpress-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahegyes%2Fwordpress-plugin-template/lists"}