Extension Developer Guide

These pages contain a canonical guide that distills many of the key concepts and processes found in the documentation for WooCommerce Core and WooCommerce Admin. The objective of these pages is to provide a centralized learning pathway for anyone who wants to start developing a WooCommerce extension.

Table of Contents

Overview

  • Core WooCommerce Concepts
    • Actions and Filters
    • Critical Flows
  • Best Practices for Extensions
    • Curated Extensibility

Getting Started

  • Prerequisites for development
    • Recommended Reading
    • Required Software
  • Setting up a reusable WordPress development environment
    • WordPress-specific Tools
    • General PHP-based Tools
    • Minimum Server Requirements
  • Anatomy of a WordPress Development Environment
  • Adding WooCommerce Core to your Environment
  • Adding WooCommerce Admin to your Environment
  • Adding WooCommerce Blocks to your Environment

Creating your First Extension

  • Using the WooCommerce Admin Extension Generator
  • The Architecture of an Extension
  • Installing Dependencies
  • Generating an Initial Build of JavaScript Assets
  • Activating your Extension for the First Time

Designing a Simple Extension

  • The Main Plugin File
  • Managing Extension Lifecycle
  • The Core Extension Class
  • Handling Execution
  • Handling Deactivation
  • Uninstallation
  • Putting it All Together

Registering with the WooCommerce Admin Navigation

  • Creating Navigation Categories and Items with PHP
    • Importing Navigation Classes
    • Checking for Navigation Feature Availability
    • Registering Menu Items and Categories
    • Hooking into the Navigation Renderer
    • Working with Custom Post Types
  • Using JavaScript and SlotFill to override navigation item behavior

Handling Merchant Onboarding

  • Adding Setup Tasks
  • Adding Store Management Links
  • Using Admin Notes

Working with WooCommerce Admin Pages

  • Connecting a PHP-powered Page to WooCommerce Admin
  • Registering a New React-powered Page

Building Interfaces with WooCommerce Components

  • Building Components that Display Static Data
  • Querying Live Data to Display in Components
  • Handling Events in Components

Handling Deactivation and Uninstallation

  • Removing Scheduled Actions
  • Removing Admin Notes
  • Removing Admin Tasks
  • Unregistering Navigation
  • WordPress Cleanup Tasks