From 7e663047c7eccfbd6ef22050c70edb34d16dd659 Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Mon, 9 Nov 2026 21:32:46 +0100 Subject: [PATCH] docs: add contributing guide with DCO and pull request template Signed-off-by: Florian Laabs --- .distignore | 1 + .gitattributes | 1 + .github/pull_request_template.md | 10 +++++++++ CLAUDE.md | 1 + CONTRIBUTING.md | 38 ++++++++++++++++++++++++++++++++ README.md | 3 ++- 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/pull_request_template.md create mode 100644 CONTRIBUTING.md diff --git a/.distignore b/.distignore index 2a16930..0587a50 100644 --- a/.distignore +++ b/.distignore @@ -26,4 +26,5 @@ README.md CLAUDE.md CHANGELOG.md SECURITY.md +CONTRIBUTING.md /languages diff --git a/.gitattributes b/.gitattributes index 7353eb2..64d8802 100644 --- a/.gitattributes +++ b/.gitattributes @@ -23,6 +23,7 @@ /CLAUDE.md export-ignore /CHANGELOG.md export-ignore /SECURITY.md export-ignore +/CONTRIBUTING.md export-ignore /languages export-ignore # Consistent line endings diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..93ea449 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,10 @@ +## What and why + + + +## Checklist + +- [ ] `npm run format:check`, `composer phpcs` and PHPUnit pass +- [ ] Tests added or adjusted +- [ ] Changed UI strings: `languages/wirecore-rest-control.pot` regenerated +- [ ] Every commit is signed off (`git commit -s`, see [CONTRIBUTING.md](https://github.com/WireCore/WP-Rest-Control/blob/main/CONTRIBUTING.md#license)) diff --git a/CLAUDE.md b/CLAUDE.md index 5533a1e..4044de6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,6 +9,7 @@ WordPress plugin, published on wordpress.org (slug `wirecore-rest-control`) and - Admin pages in plain PHP with `admin-post.php` forms, nonces, `wp_safe_redirect()` plus a notice query arg. No build step for JS; the only CSS build is `npm run build:css` (below). - UI in the WireLayer corporate design: the markup uses the `.wc-*` classes of `@wirecore/wirelayer-css` (class reference: `node_modules/@wirecore/wirelayer-css/llms-full.txt`). `npm run build:css` writes the used components, scoped to `#wirecore-rc`, to `assets/wirelayer/` – committed, CI checks it is up to date. Add a component to the list in `package.json` before using its classes, and run the command again after updating the package. `wirecore-rc-*` classes are hooks for `admin.js` and page layout in `assets/admin.css` (scoped to `#wirecore-rc`, colors and spacing from WireLayer variables). Icons are inline Lucide SVGs (`WireCore_RC_Admin::icon()`). - Supported versions: WordPress 5.8+, PHP 7.4 – 8.5 (verified with PHPCompatibility 10, a WP 5.8/PHP 7.4 instance and the tests on every PHP version) – do not use newer functions without raising the minimum, and avoid anything deprecated up to PHP 8.5 (e.g. `ReflectionProperty::setAccessible()` only below PHP 8.1). The Docker environment runs PHP 8.5. +- Commits are signed off (`git commit -s`) – the DCO check on pull requests requires it (see `CONTRIBUTING.md`). - Formatting with Prettier (tabs, single quotes). Plugin Check must stay free of errors and warnings; justified exceptions are marked with `phpcs:ignore`/`phpcs:disable` plus a comment explaining why. ## Architecture diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f7ebe2f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Contributing + +Thank you for helping with WireCore REST Control. Bug reports, ideas and pull requests are welcome. + +## Before you start + +- For anything bigger than a small fix, open an issue first so we can agree on the approach before you spend time on it. +- Questions about using the plugin belong in the [support forum on wordpress.org](https://wordpress.org/support/plugin/wirecore-rest-control/). +- Security problems go through the private channel in [SECURITY.md](SECURITY.md), not through issues. + +## Development + +The setup – Docker for WordPress, Node.js for Prettier and the WireLayer CSS – is described in [README.md](README.md#development). + +Before a pull request: + +```bash +npm run format:check +composer phpcs +docker compose exec -w /var/www/html/wp-content/plugins/wirecore-rest-control wordpress vendor/bin/phpunit +``` + +The CI runs the same on PHP 7.4 – 8.5, plus Plugin Check on the built package. Add or adjust tests for what you change. + +## Guidelines + +- Code, comments, UI source strings and commit messages are in English. German translations come from translate.wordpress.org; after changing UI strings, regenerate the template `languages/wirecore-rest-control.pot` (see [README.md](README.md#translations)). +- The plugin supports WordPress 5.8+ and PHP 7.4 – 8.5: no newer functions, nothing deprecated up to PHP 8.5. +- Everything global carries the prefix `wirecore_rc_` / `WIRECORE_RC_` / `wirecore-rc-`. +- Everything that is stored goes through `WireCore_RC_Settings::sanitize()`, and existing export files must keep importing. +- Rules are evaluated only in `WireCore_RC_Guard::rule()` and `decide()`; `assets/admin.js` mirrors the inheritance for the display – change both together. +- Plugin Check stays free of errors and warnings. + +## License + +By contributing you agree that your contribution is licensed under the [GPL-2.0-or-later](LICENSE), like the rest of the project. + +Every commit carries a `Signed-off-by` line (`git commit -s`). With it you confirm the [Developer Certificate of Origin](https://developercertificate.org): you wrote the change yourself, or it is based on work under a compatible open source license, and you have the right to contribute it under the GPL. The DCO check on the pull request fails without it. To add it afterwards: `git commit --amend -s` for the last commit, `git rebase --signoff ` for several, then push with `--force-with-lease`. diff --git a/README.md b/README.md index 05a19c3..cfd0c12 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ WP-CLI · Development · Changelog · + Contributing · Security

@@ -147,7 +148,7 @@ The self-test under _Tools_ does not work locally, because the container cannot docker compose exec wordpress wp --allow-root plugin install plugin-check --activate docker compose exec wordpress wp --allow-root plugin check wirecore-rest-control \ --exclude-directories=node_modules,db-data,.vscode,.github,vendor,tests \ - --exclude-files=.gitignore,.gitattributes,.distignore,.prettierrc,.prettierignore,CLAUDE.md,README.md,CHANGELOG.md,SECURITY.md + --exclude-files=.gitignore,.gitattributes,.distignore,.prettierrc,.prettierignore,CLAUDE.md,README.md,CHANGELOG.md,SECURITY.md,CONTRIBUTING.md ``` ### Tests