Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ README.md
CLAUDE.md
CHANGELOG.md
SECURITY.md
CONTRIBUTING.md
/languages
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## What and why

<!-- What does this change, and why is it needed? Link the issue if there is one. -->

## 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))
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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 <base>` for several, then push with `--force-with-lease`.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<a href="#wp-cli">WP-CLI</a> ·
<a href="#development">Development</a> ·
<a href="CHANGELOG.md">Changelog</a> ·
<a href="CONTRIBUTING.md">Contributing</a> ·
<a href="SECURITY.md">Security</a>
</p>

Expand Down Expand Up @@ -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
Expand Down
Loading