This page will guide you through the process of setting up WooCommerce development environment on your local machine. It should work on Linux, macOS, or Windows 10 with the Linux Subsystem.
Table of Contents
Getting Started
Please check out our getting started guide for information about prerequisites and initial setup.
Development Information
We also have more in-depth documentation on how to develop in our repository. This also includes information about how to set up the development environment.
Troubleshooting
Build Out-of-memory Error
Note: Depending on your PHP settings, you may encounter an out-of-memory error similar to the following...
> wp i18n make-pot . --exclude=".github,.wordpress-org,bin,sample-data,node_modules,tests" --slug=woocommerce '--skip-audit'
Plugin file detected.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108872 bytes) in /Users/exampleuser/vagrant-local/www/woocommerce-dev/public_html/wp-content/plugins/woocommerce/vendor/mck89/peast/lib/Peast/Syntax/Utils.php on line 37
If this happens, increase the memory_limit
setting in your php.ini configuration file and re-run pnpm nx build woocommerce
.
Alternatively, you might encounter 'Maximum function nesting level reached' error from xDebug. In that case, disable xDebug in your PHP installation temporarily.
Debugging
Using Xdebug in the wp-env environment
Please refer to WP-ENV official README section for setting up Xdebug.
Debugging synced lookup information:
To debug synced lookup information in the database, you can bypass the action scheduler and immediately sync order and customer information by using the woocommerce_analytics_disable_action_scheduling
hook.
add_filter( 'woocommerce_analytics_disable_action_scheduling', '__return_true' );
Using debug
package.
Currently, the debug package is utilized to provide additional debugging for various systems. This tool outputs additional debugging information in the browser console when it is activated.
To activate, open up your browser console and add this:
localStorage.setItem( 'debug', 'wc-admin:*' );
WooCommerce Admin Test Helper
WooCommerce Admin Test Helper is a plugin that makes it easier to test the WooCommerce Admin plugin.
IDE integrations
WooCommerce core has linting rules in place via pre-commit hooks to ensure code standards are used. Ensure you have installed NPM and Composer packages, so these are set up!
While developing, we recommend adding support to your editor for the following (most IDEs have plugins for this):
- phpcs
- eslint
- editorconfig
Additional resources
Contribution
- Set up development environment
- Our Git Flow
- SCSS and JS minification
- Naming conventions
- CSS SASS coding guidelines and naming conventions
- Critical Flows
- API Critical Flows
- String localisation guidelines
- Translating WooCommerce
- Deprecation in core
- Adding Actions and Filters
- Common Issues
- Writing high-quality testing instructions
Release Notes
- Release Testing Instructions
- 3.6.x notes/FAQ
- 2.6.x to 3.0.0 Developer Migration Notes
- Select2 fields not working in 3.0.x
- Thumbnail Image Regeneration in 3.3+
- Customizing image sizes in 3.3+
REST API and CLI
CRUD & Data Descriptions
- Database Description
- CRUD Objects in 3.0
- Order and Order Line Item Data
- Coupon Data
- Customer Data
- Product Data
- Data Stores
Internal APIs
Theming
- Enabling product gallery features (zoom, swipe, lightbox)
- Template File Guidelines for Devs and Theme Authors
Examples / Guides
WooCommerce is an open source commerce platform built for WordPress and lovingly crafted by Automattic and the WooCommerce community 💜. Come and work with us!