Contributions are greatly appreciated. You can help in several ways:
When contributing code specifically, please keep the following in mind:
- Write code that is backward-compatible to PHP 5.2 and WordPress 4.9.
- Follow the WordPress coding and documentation standards.
- If applicable, provide integration tests for your changes.
This project provides workflows for:
- running integration tests (using PHPUnit)
- checking coding and documentation standards (using PHPCodeSniffer).
- static analysis (using PHPStan).
It is also integrated with GitHub Actions to ensure those always pass.
It is recommended to run integration tests and PHPCodeSniffer locally before committing, to check in advance that your changes do not cause unexpected issues. Here is how you can do that:
composer install: Set up all plugin dependenciesvendor/bin/phpunit: Run the integration tests.vendor/bin/phpcs: Check against the WordPress Coding Standards.
This plugin uses @wordpress/scripts for building, linting, and minifying JavaScript and CSS assets. Both source and minified versions are located in wp-multi-network/assets/.
To work with JavaScript and CSS:
npm install: Install Node.js dependencies (Node.js 20+ required)npm run build: Build minified production-ready assets from source filesnpm run start: Start development mode with file watching and hot reloadnpm run lint:js: Lint JavaScript filesnpm run lint:css: Lint CSS filesnpm run format: Auto-format JavaScript and CSS files
The asset structure:
- Source files (edit these):
wp-multi-network.js,wp-multi-network.css,wp-multi-network-rtl.css(unminified, for debugging) - Minified files (auto-generated):
wp-multi-network.min.js,wp-multi-network.min.css,wp-multi-network-rtl.min.css(production)
The plugin automatically loads source files when WP_SCRIPT_DEBUG is enabled, otherwise it loads minified versions.
Important: Edit the non-minified source files in wp-multi-network/assets/. The minified .min.js and .min.css files are automatically generated by the build process and should not be edited directly.
- Integration tests go into the
tests/integration/testsdirectory. - File names must be prefixed with
test-. - Each test class must extend the
WPMN_UnitTestCaseclass.