Skip to content

Commit a7963f1

Browse files
Revise core setup and docs (#22)
1 parent 828c5ff commit a7963f1

11 files changed

Lines changed: 98 additions & 29 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Pull Request
2+
3+
## Checklist
4+
- [ ] Tests pass (`composer run test:php` and `npm test`)
5+
- [ ] Linting passes (`composer run lint:php`)
6+
- [ ] Documentation updated
7+
8+
## Summary
9+
Please provide a short summary of the changes.

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,29 @@ permissions:
33
name: CI
44
on:
55
push:
6+
branches: [main]
67
pull_request:
8+
branches: [main]
79
jobs:
810
build:
911
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php-version: ['8.2', '8.3', '8.4']
1015
steps:
1116
- uses: actions/checkout@v4
1217
- name: Setup PHP
13-
uses: # uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f
18+
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f
1419
with:
15-
php-version: '8.2'
20+
php-version: ${{ matrix.php-version }}
21+
coverage: none
1622
- name: Install dependencies
1723
run: composer install --no-interaction
1824
- name: PHP Lint
19-
run: composer lint:php
25+
run: composer run lint:php
2026
- name: PHPStan
21-
run: composer analyze:php
27+
run: composer run analyze:php
2228
- name: PHPUnit
23-
run: composer test:php
29+
run: composer run test:php
2430
- name: Node tests
2531
run: npm test

LOCAL_DEVELOPMENT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,10 @@
22

33
A template repository for building WordPress plugins that follow Starisian coding conventions and SPARXSTAR deployment needs.
44

5-
## Supported Stack
6-
- WordPress 6.4+
7-
- PHP 8.2+
8-
- Node.js (LTS) for optional asset tooling
9-
10-
## Usage
5+
## Quick Start
116
1. Clone this repo.
12-
2. Rename namespaces and plugin headers.
13-
3. Run `composer install` and `npm install` if using JS tooling.
14-
4. Implement features in `src/` and enqueue assets from `assets/`.
15-
16-
### When to Fork vs. Extend
17-
- **Fork** to create a new plugin.
18-
- **Extend** by importing as a subtree if you need to keep upstream changes.
7+
2. Run `composer install`.
8+
3. Activate the plugin in WordPress.
9+
4. "Hello World."
1910

20-
For architecture details see [ARCHITECTURE.md](ARCHITECTURE.md). Contribution guidelines live in [CONTRIBUTING.md](CONTRIBUTING.md).
11+
For detailed guides and notes, see the [docs/](docs/) directory.

docs/FIRST_CONTRIBUTION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# First Contribution
2+
3+
1. Fork the repository.
4+
2. Clone your fork and create a branch.
5+
3. Run `composer install` and `npm install`.
6+
4. Pick a "good first issue" or open a new one.
7+
5. Make your changes in `src/` or `tests/` as needed.
8+
6. Run `composer run lint:php` and `composer run test:php` before committing.
9+
7. Commit with a descriptive message and push to your fork.
10+
8. Open a pull request using the template and request review.

docs/LOCAL_DEVELOPMENT.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Local Development
2+
3+
```yaml
4+
version: '3.9'
5+
services:
6+
wordpress:
7+
image: wordpress:6.4-php8.2
8+
ports:
9+
- "8000:80"
10+
environment:
11+
WORDPRESS_DB_HOST: db
12+
WORDPRESS_DB_USER: wordpress
13+
WORDPRESS_DB_PASSWORD: wordpress
14+
WORDPRESS_DB_NAME: wordpress
15+
volumes:
16+
- ./:/var/www/html/wp-content/plugins/starisian-plugin
17+
db:
18+
image: mysql:8
19+
environment:
20+
MYSQL_DATABASE: wordpress
21+
MYSQL_USER: wordpress
22+
MYSQL_PASSWORD: wordpress
23+
MYSQL_RANDOM_ROOT_PASSWORD: '1'
24+
volumes:
25+
- db_data:/var/lib/mysql
26+
volumes:
27+
db_data:
28+
```
29+
30+
## Commands
31+
- `composer install`
32+
- `npm install`
33+
- `docker compose up -d`
34+
- Run unit tests: `composer run test:php`
35+
- Lint PHP: `composer run lint:php`
36+
- Analyze: `composer run analyze:php`
37+
- Build assets: `npm run build`

docs/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
# Documentation
22

3-
Extended guides and design notes live here.
3+
## Supported Stack
4+
- WordPress 6.4+
5+
- PHP 8.2+
6+
- Node.js (LTS) for optional asset tooling
7+
8+
## Usage
9+
1. Clone this repo.
10+
2. Rename namespaces and plugin headers.
11+
3. Run `composer install` and `npm install` if using JS tooling.
12+
4. Implement features in `src/` and enqueue assets from `assets/`.
13+
14+
### When to Fork vs. Extend
15+
- **Fork** to create a new plugin.
16+
- **Extend** by importing as a subtree if you need to keep upstream changes.
17+
18+
For architecture details see [ARCHITECTURE.md](../ARCHITECTURE.md). Contribution guidelines live in [CONTRIBUTING.md](../CONTRIBUTING.md).

phpstan-baseline.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
ignoreErrors: []

phpstan.neon.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ parameters:
88
autoload_files:
99
- ./vendor/autoload.php
1010

11+
baseline: phpstan-baseline.neon
12+
1113
treatPhpDocTypesAsCertain: false
1214

1315
excludePaths:

src/core/PluginCore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public static function getInstance(): PluginCore {
3636
*/
3737
private function __construct() {
3838
// Register core plugin hooks, rules, or services here.
39-
if (class_exists(PluginRules::class, false)) {
40-
PluginRules::register_hooks();
39+
if (class_exists('\\Starisian\\src\\includes\\PluginRules', false)) {
40+
\Starisian\src\includes\PluginRules::register_hooks();
4141
}
4242
}
4343
}

0 commit comments

Comments
 (0)