Skip to content

Commit bbd0a31

Browse files
committed
Documenation added
1 parent ee0e459 commit bbd0a31

5 files changed

Lines changed: 55 additions & 4 deletions

File tree

.distignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ coverage.xml
1010
.distignore
1111
.gitattributes
1212
.gitignore
13+
.phpcs.cache
1314
.phpunit.result.cache
1415
.scrutinizer.yml
1516
Changelog.md
16-
composer.json
1717
composer.lock
1818
mslsmenu.zip
1919
package.json
@@ -22,3 +22,4 @@ phpdoc.xml
2222
phpstan.neon
2323
phpunit.xml
2424
README.md
25+
AGENTS.md

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.DS_Store
22
.phpunit.result.cache
33
.idea/
4+
.phpcs.cache
45
vendor/
56
reports/
67
mslsmenu/
78
composer.lock
89
mslsmenu.zip
9-
coverage.xml
10+
coverage.xml

AGENTS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `MslsMenu.php` is the WordPress bootstrap; add hooks here or split helpers into new subdirectories under `mslsmenu/` as needed.
5+
- `mslsmenu/` mirrors the shipping bundle; keep source and bundle in sync before release.
6+
- `languages/` stores translation assets; regenerate via `wp i18n make-pot` when strings move.
7+
- `tests/` houses Pest specs with Brain Monkey shims in `tests/Pest.php`; colocate fixtures with their specs.
8+
- `bin/` contains release tooling (`bin/git-release.sh`); prefer extending scripts over one-off commands.
9+
10+
## Build, Test, and Development Commands
11+
- Run `composer install` after cloning to pull dev dependencies.
12+
- `composer test` executes the Pest suite with mocked WordPress APIs.
13+
- `composer analyze` runs PHPStan (level 5) against `MslsMenu.php`; keep it passing before pushing.
14+
- `composer coverage` enables Xdebug coverage for pull request evidence.
15+
- `composer build` triggers `bin/git-release.sh`, refreshing `mslsmenu/` and `mslsmenu.zip` for distribution.
16+
17+
## Coding Style & Naming Conventions
18+
- Follow WordPress PHP standards: tabs for indentation, braces on new lines, no trailing commas.
19+
- Include `declare(strict_types=1);` in new entry points and document public APIs with PHPDoc.
20+
- Use `snake_case` for hook callbacks, `PascalCase` for classes, and `camelCase` for internal helpers unless a hook signature dictates otherwise.
21+
22+
## Testing Guidelines
23+
- Place new specs in `tests/YourFeatureTest.php`; keep case names descriptive (`it('renders menu item')`).
24+
- Stub external WP functions with Brain Monkey setup blocks to keep tests deterministic.
25+
- Run `composer coverage` for behavioral changes and share the summary when coverage changes noticeably.
26+
27+
## Commit & Pull Request Guidelines
28+
- Write short imperative subjects (≈50 chars) such as `Clean menu walker output`; batch related edits together.
29+
- Reference GitHub issues in the body (`Refs #123`) and list the commands you ran.
30+
- PRs should explain the problem, outline the fix, attach UI evidence when relevant, and confirm `composer test` plus `composer analyze`.
31+
32+
## Release Packaging Tips
33+
- Bump the plugin header version in `MslsMenu.php` and sync the same value into `readme.txt` before building.
34+
- Run `composer build`, inspect the refreshed `mslsmenu/` contents, and spot-check the generated `mslsmenu.zip` before tagging.

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ MslsMenu
44
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lloc/MslsMenu/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/lloc/MslsMenu/?branch=master)
55
[![codecov](https://codecov.io/gh/lloc/MslsMenu/graph/badge.svg?token=902NM9H2BW)](https://codecov.io/gh/lloc/MslsMenu)
66

7-
Adds the output of the Multisite Language Switcher to the one (or more) of your navigation menus(s)
7+
MslsMenu extends the Multisite Language Switcher by injecting a language picker into any registered WordPress navigation menu. Install it when you want users to toggle sites and languages without custom walkers.
88

9-
[Latest stable](https://wordpress.org/plugins/mslsmenu/)
9+
## Install
10+
- From WordPress: search for “MslsMenu” under Plugins → Add New and activate it.
11+
- Manual: copy the `mslsmenu/` directory to `wp-content/plugins/` and activate the plugin.
12+
13+
## Usage
14+
- Head to Appearance → Menus, add the “MslsMenu” item to your chosen menu, and arrange it like any other menu entry.
15+
- Configure Multisite Language Switcher as usual; MslsMenu reuses its site mappings automatically.
16+
17+
## Develop
18+
- `composer install` pulls dev tools (Pest, PHPStan, Brain Monkey).
19+
- `composer test` runs the Pest suite; `composer analyze` performs static analysis.
20+
21+
## Contribute
22+
- Review `AGENTS.md` for project conventions and release steps.
23+
- Latest release: https://wordpress.org/plugins/mslsmenu/

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"analyze": "vendor/bin/phpstan analyze",
2525
"git-release": "bin/git-release.sh",
2626
"build": [
27+
"@composer update --no-dev",
2728
"@git-release"
2829
]
2930
},

0 commit comments

Comments
 (0)