To install all dependencies from npm and composer for all wp-modules in your plugin run this command:
sh pluginade.sh install
To remove node_modules and vendor directories for all wp-modules in your plugin and re-install all dependencies from npm and composer run this command:
sh pluginade.sh install:clean
sh pluginade.sh lint:php
If you want to override any WordPress Coding Standards for your project, add your own custom phpcs.xml file to the root of your plugin, and Pluginade will use that.
To automatically fix any PHP issues that can be autofixed to conform with WordPress Coding Standards, run this command:
sh pluginade.sh lint:php:fix
sh pluginade.sh lint:css
To automatically fix any CSS issues that can be autofixed to conform with WordPress's standards, run this command:
sh pluginade.sh lint:css:fix
sh pluginade.sh lint:js
If you want to override any javascript standards in your own plugin, ass your own .eslintrc
file to the root of your plugin, and Pluginade will use that.
To automatically fix any Javascript issues that can be autofixed to conform with WordPress's standards, run this command:
sh pluginade.sh lint:js:fix
sh pluginade.sh test:phpunit
That will find any files which end with Test.php
, and run the tests within them.
To run the tests inside a specific test file in your plugin, provide a --path
argument, starting at your plugin's root. For example, if you have a test inside your plugin located at wp-modules/sample-module//tests/MyPhpUnitTest.php
, you can run only the tests in that file like this:
sh p.sh test:phpunit --path=wp-modules/api-generate-module/tests/SampleTest.php
Note that you need to pass the --path
argument first if you wish to pass additional values to PHPUnit.
You can easily run all tests in a specific directory by providing the path to that directory like this:
sh p.sh test:phpunit --path=wp-modules/api-generate-module
That will find and run all PHPUnit tests no matter where they exist within that directory, or its subdirectories.
PHP unit includes many other options, and you can pass those alongside your call. For example, if you want to use the --filter
option to only run tests from the SampleTest class, do this:
sh p.sh test:phpunit --filter=SampleTest
Note that not all of the available options for PHPUnit make sense to use here. For example, Pluginade Scripts already provides a --bootstrap
and -c|--configuration
to make it work with the underlying WordPress docker container, so passing those isn't advised.
sh pluginade.sh test:js
Note: If you want to provide your own custom Jest coniguration, add a jest.config.js
file to your plugin's root directory, and Pluginade will use that.
sh pluginade.sh test:playwright
Note: If you want to provide your own custom Jest coniguration, add a playwright.config.ts
file to your plugin's root directory, and Pluginade will use that.
To run a security scan on the plugin's PHP code using only security sniffs enabled from WordPress Coding Standards, run this command.
sh pluginade.sh security:php
Note: At this time there isn't a way to run only tests in a single file, it just runs all of the tests in the plugin. This functionality is on the road map for pluginade in the future.
sh pluginade.sh build
sh pluginade.sh dev
sh pluginade.sh zip
Note that you can add a .zipignore file to the root of your plugin to control what files are not included in the zip. Pluginade includes a default zipignore which removes things usually not desired (like node_modules directories), but this can be overridden.