Please cd
to wp-content/plugins/
and clone this repo:
git clone [email protected]:kienstra/machine-learning
Then, cd
to the machine-learning/
directory and run composer install
and npm install
. This will install dependencies, including wp-dev-lib. It will also install a pre-commit hook.
If you add a new class while developing, add the class name to Plugin::$classes
so that it's instantiated:
/**
* This plugin's PHP classes.
*
* @var array
*/
public $classes = array( 'Asset', 'Block' );
You may run the PHPUnit tests in an environment where WordPress unit tests are installed, like VVV.
To run tests:
$ phpunit
To run tests with an HTML coverage report:
$ phpunit --coverage-html /tmp/report
If you've already run npm install
, execute npm run dev
. This will compile the block JavaScript file.
Assuming you've run composer install
and npm install
from the development setup, do npm run build
. This will create an machine-learning.zip
file, and a build/
directory. It will also compile the block JavaScript file.