- You need to make sure that you have php installed and that
phpis available in your path. To check that you can runwhich php
To install php 8.0 on macos, you can use homebrew:
brew install shivammathur/php/php@8.0To install php 8.0 on ubuntu, you can use the following command:
sudo apt install php8.0-
You need to make sure that you have mysql installed and that
mysqlis available in your path. To check that you can runwhich mysql -
If you don't have composer, you will need to install it:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --filename=composer
php -r "unlink('composer-setup.php');"- Install all dependencies using composer:
./composer install- Create a local tunnel for localhost on port 8800 using ngrok.io
ngrok http 8800-
Copy
.env.testingto .env.localand update env vars. -
If needed reset any existing testing configuration
./composer test-reset- Launch the web server
./composer run-script startVisit the address given by the localtunnel
Wordpress admin username and password are beans
To run all linters:
./composer run-script lintTo only run phpcs,
./vendor/bin/phpcsTo only run phpstan,
./vendor/bin/phpstan analyze --memory-limit=200MTo reformat the code:
./vendor/bin/phpcbfEnsure that your code is well documented:
https://stackoverflow.com/questions/1310050/php-function-comments https://www.phpdoc.org/ https://phpdocu.sourceforge.net/howto.php https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.param.pkg.html https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/
to be completed...
Install Xdebug to debug your php code. Follow the wizard step here: https://xdebug.org/wizard
To get PHPInfo:
php -f scripts/phpinfo.php > phpinfo.txtOpen phpinfo.txt to read the output.
To create pot file:
./vendor/bin/wp i18n make-pot src src/i18n/beans-woocommerce.pot --exclude=srcTo create mo file:
./vendor/bin/wp i18n make-mo src/i18nTranslated strings can be downloaded from WordPress Translation platform
- WooCommerce minimum requirements by version
- WooCommerce versions
- WooCommerce REST API
- WordPress minimum requirements by version
- PHP supported versions
Useful links
- Debugging WP 404: https://gist.github.com/yunusga/33cf0ba9e311e12df4046722e93d4123