Skip to content

Commit a5fd4d5

Browse files
docs: add copilot instructions for bluem-woocommerce plugin
This commit introduces a new documentation file outlining the project overview, repository layout, key commands, coding conventions, and release workflow for the bluem-woocommerce plugin. This will assist developers in understanding the structure and usage of the plugin more effectively.
1 parent a8638d9 commit a5fd4d5

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/copilot-instructions.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copilot Instructions — bluem-woocommerce
2+
3+
## Project overview
4+
5+
WordPress + WooCommerce plugin providing Bluem payment, eMandates and iDIN identity services.
6+
PHP 8.0+, using the `bluem-development/bluem-php` SDK. Licensed GPL v3.
7+
8+
## Repository layout
9+
10+
| Path | Purpose |
11+
|---|---|
12+
| `bluem.php` | Main plugin entry point (WP plugin header) |
13+
| `bluem-*.php` | Feature modules (payments, mandates, iDIN, login, etc.) |
14+
| `gateways/` | WooCommerce payment gateway classes |
15+
| `src/` | Namespaced PHP classes (`Bluem\Wordpress\…`) |
16+
| `views/` | Admin page templates |
17+
| `css/`, `js/` | Front-end assets |
18+
| `tests/Unit/`, `tests/Acceptance/` | PHPUnit + Codeception tests |
19+
| `docker-compose.yml` | Local dev env (MySQL 5.7, WordPress, phpMyAdmin) |
20+
| `svn-directory/` | WordPress.org SVN checkout for plugin releases |
21+
| `build/` | Generated build output (do **not** edit directly) |
22+
| `Makefile` | Dev & release tasks (see below) |
23+
24+
## Key commands
25+
26+
```sh
27+
make install # composer install
28+
make unit_test # PHPUnit
29+
make acceptance_test # Codeception
30+
make lint # php-cs-fixer check
31+
make lint_fix # php-cs-fixer fix
32+
make copy-to-docker # build & copy plugin into Docker env
33+
make prepare-release NEW_TAG=x.y.z # build, tag, update trunk (SVN)
34+
make release # commit prepared release to WP SVN
35+
```
36+
37+
## Coding conventions
38+
39+
- `declare(strict_types=1);` in all PHP files.
40+
- Follow WordPress Coding Standards (WPCS) and PSR-12 where compatible.
41+
- Use typed properties, return types, union types, readonly, enums (PHP 8.x).
42+
- WordPress globals and hooks: use `add_action` / `add_filter`; avoid direct DB queries — use `$wpdb` with prepared statements.
43+
- WooCommerce gateway classes extend `WC_Payment_Gateway`.
44+
- Escape all output (`esc_html`, `esc_attr`, `wp_kses_post`). Sanitise all input (`sanitize_text_field`, `absint`, etc.).
45+
46+
## Release workflow
47+
48+
1. Bump version in `bluem.php` plugin header and `build.env`.
49+
2. `make prepare-release NEW_TAG=x.y.z` — builds into `build/`, copies to `svn-directory/tags/` and `svn-directory/trunk/`.
50+
3. `make release` — commits tag + trunk to WordPress.org SVN.
51+
52+
## Things to watch out for
53+
54+
- `build/` and `svn-directory/` are deployment artifacts; never edit them directly.
55+
- Docker volumes live under `docker/`; plugin code is mounted via `docker/plugins/`.
56+
- The plugin depends on `bluem-development/bluem-php` — check its API when suggesting SDK calls.
57+
- Keep WP compatibility ≥ 5.0 and WC compatibility reasonable.
58+

0 commit comments

Comments
 (0)