Skip to content

jdredman/extend-blocks

Repository files navigation

Extend Blocks - WordPress Gutenberg Plugin

A WordPress plugin that extends Gutenberg functionality with additional blocks for creating more visual and functional WordPress sites while maintaining minimal lock-in through adherence to WordPress core principles.

Philosophy

  • Core-First Approach: Stick to WordPress and Gutenberg core functionality as much as possible
  • Minimal Lock-in: Ensure content remains accessible even if the plugin is deactivated
  • Best Practices: Follow WordPress and Gutenberg development standards
  • Clean Code: Modern, organized, secure, and human-readable code
  • No Bloat: Clean up unused files and maintain a lean codebase

Development Setup

Prerequisites

  • Node.js 18+ and npm
  • WordPress 6.0+
  • PHP 8.0+
  • wp-env (WordPress local development environment)

Local Development

# Install wp-env globally if you haven't already
npm install -g @wordpress/env

# Clone and navigate to the project
git clone <repository-url>
cd extend-blocks

# Install dependencies
npm install

# Start the local WordPress environment
wp-env start

# Build the plugin assets
npm run build

# For development with hot reload
npm run start

Access Points

Project Structure

extend-blocks/
├── .wp-env.json                 # wp-env configuration
├── package.json                 # Node.js dependencies and scripts
├── webpack.config.js            # Build configuration
├── extend-blocks.php            # Main plugin file
├── includes/                    # PHP classes and functionality
│   ├── class-extend-blocks.php  # Main plugin class
│   ├── class-block-loader.php   # Block registration and loading
│   └── blocks/                  # Individual block PHP files
├── src/                         # JavaScript/React source files
│   ├── index.js                 # Main entry point
│   ├── blocks/                  # Block JavaScript files
│   │   ├── example-block/       # Individual block folders
│   │   │   ├── index.js
│   │   │   ├── edit.js
│   │   │   ├── save.js
│   │   │   └── style.scss
│   └── shared/                  # Shared utilities and components
├── build/                       # Compiled assets (generated)
├── assets/                      # Static assets
│   ├── images/
│   └── icons/
└── languages/                   # Translation files

Available Commands

# Development
npm run start          # Start development with hot reload
npm run build          # Build for production
npm run dev            # Build for development
npm run format         # Format code with Prettier
npm run lint:js        # Lint JavaScript files
npm run lint:css       # Lint CSS/SCSS files
npm run packages-update # Update WordPress packages

# WordPress Environment
wp-env start           # Start local WordPress
wp-env stop            # Stop local WordPress
wp-env clean           # Clean and restart environment
wp-env logs            # View environment logs

# Plugin Management
npm run plugin-zip     # Create installable plugin zip
npm run clean          # Clean build files and unused assets

Development Guidelines

See DEVELOPMENT_GUIDELINES.md for comprehensive development standards and practices.

Contributing

  1. Follow the development guidelines
  2. Create feature branches from main
  3. Write clear commit messages
  4. Test thoroughly in wp-env
  5. Clean up any unused files before committing
  6. Submit pull requests with detailed descriptions

License

GPL v2 or later - following WordPress licensing standards.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published