Skip to content

A robust starter for WordPress single-block plugins. Features mustache-based templates, validation workflows, automation, and agent-ready docs. Built for LightSpeed and WordPress development standards.

License

Notifications You must be signed in to change notification settings

lightspeedwp/single-block-plugin-scaffold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
title version last_updated author description type
{{name}} - WordPress Block Plugin
{{version}}
2024-10-18
{{author}}
{{description}}
documentation

{{name}}

{{description}}

Quick Start

  1. Install Dependencies

    npm install
    composer install
  2. Start Development

    npm run start
  3. Build for Production

    npm run build

Development

This plugin uses modern WordPress development practices:

  • WordPress Scripts for building and linting
  • React/JSX for block editor components
  • SCSS for styling
  • PHP 8.0+ for server-side functionality
  • PHPUnit for PHP testing
  • Jest for JavaScript testing
  • Playwright for E2E testing

Placeholder Mappings

This template uses mustache-style placeholders that should be replaced when scaffolding a new plugin:

Placeholder Description Example
{{slug}} Plugin slug (kebab-case) my-awesome-block
{{namespace}} Plugin namespace (kebab-case) mycompany
{{author}} Plugin author John Doe
{{description}} Plugin description An awesome block plugin
{{license}} License identifier GPL-3.0-or-later
{{textdomain}} WordPress text domain my-awesome-block
{{version}} Plugin version 1.0.0
{{name}} Human-readable plugin name My Awesome Block

File Structure

{{slug}}/
├── src/
│   ├── {{slug}}/
│   │   ├── block.json          # Block metadata
│   │   ├── edit.js             # Editor component
│   │   ├── save.js             # Save component
│   │   ├── index.js            # Block registration
│   │   ├── render.php          # Server-side render
│   │   └── style.scss          # Block styles
│   ├── scss/
│   │   ├── editor.scss         # Editor-only styles
│   │   └── style.scss          # Frontend-only styles
│   └── index.js                # Main entry point
├── bin/
│   ├── build.sh               # Build script
│   ├── test.sh                # Test script
│   ├── install-wp-tests.sh    # WordPress test setup
│   └── update-version.js      # Version update utility
├── tests/
│   ├── date.js                # Date utility functions
│   └── date.test.js           # Date utility tests
├── .github/
│   └── workflows/
│       └── ci-cd.yml          # GitHub Actions workflow
├── .vscode/                   # VSCode configuration
├── .husky/                    # Git hooks
├── docs/                      # Documentation
├── {{slug}}.php               # Main plugin file
├── package.json               # Node.js dependencies
├── composer.json              # PHP dependencies
├── .wp-env.json               # WordPress environment
└── CODEOWNERS                 # Code ownership

Scripts

NPM Scripts

  • npm run build - Build production assets
  • npm run start - Start development with watch mode
  • npm run lint - Lint JavaScript and CSS
  • npm run test - Run all tests
  • npm run makepot - Generate translation POT file
  • npm run makejson - Generate JSON translation files
  • npm run i18n - Complete i18n workflow (makepot + makejson)
  • npm run env:start - Start WordPress environment
  • npm run plugin-zip - Create distribution ZIP

Composer Scripts

  • composer run lint - Lint PHP code
  • composer run test - Run PHP tests
  • composer run analyse - Run static analysis

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

This project is licensed under the {{license}} License - see the LICENSE file for details.

Support

For support, please see:

About

A robust starter for WordPress single-block plugins. Features mustache-based templates, validation workflows, automation, and agent-ready docs. Built for LightSpeed and WordPress development standards.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •