-
-
Notifications
You must be signed in to change notification settings - Fork 0
WordPress multi-block plugin scaffold with CPT, taxonomies, SCF fields, and block bindings #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…ponents Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
…query builder, gallery accessibility Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a comprehensive multi-block WordPress plugin scaffold designed for WP 6.5+ with extensive Gutenberg block support, custom post types, taxonomies, SCF field integration, Block Bindings API, and a complete test suite. The scaffold uses Mustache variables ({{variables}}) throughout for instantiation flexibility.
Key Features:
- 4 Gutenberg blocks (card, collection, slider, featured) with server-side rendering
- Custom post type and taxonomy registration
- SCF integration with repeaters and flexible content fields
- Block Bindings API for dynamic field display
- Comprehensive pattern and template system
- Shared React components and custom hooks
- Full test coverage (PHPUnit, Jest, Playwright E2E)
Reviewed changes
Copilot reviewed 107 out of 111 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
{{slug}}.php |
Main plugin file with class autoloading, SCF dependency checks, and block registration |
inc/class-*.php |
PHP classes for post types, taxonomies, fields, repeater fields, block bindings, templates, and patterns |
src/blocks/*/ |
Four block implementations (card, collection, slider, featured) with edit/save/render components |
src/components/*/ |
Shared React components (Slider, PostSelector, TaxonomyFilter, Gallery, etc.) |
src/hooks/ |
Custom hooks (usePostType, useTaxonomies, useFields, useRepeater, useSlider, useCollection) |
templates/, patterns/, parts/ |
Block templates, patterns, and template parts for single/archive views |
tests/ |
Comprehensive test suite (PHPUnit, Jest, Playwright) with bootstrap and setup files |
webpack.config.cjs, package.json, composer.json |
Build configuration and dependencies |
| Configuration files | PHPUnit, PHPStan, PHPCS, wp-env configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await page.click( '.edit-post-header-toolbar__inserter-toggle' ); | ||
|
|
||
| // Check for block category. | ||
| const categoryTab = page.locator( '[aria-label="{{name}}"]' ); |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable categoryTab.
| await page.fill( '.block-editor-inserter__search input', '{{name}} Card' ); | ||
|
|
||
| // Check if block appears in search. | ||
| const blockItem = page.locator( |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable blockItem.
…dation ## Critical Issues Fixed ### Issue #1: Indentation Contradictions (CRITICAL) - **wpcs-php.instructions.md**: Fixed line 379 contradiction - Changed from "Use 4 spaces for indentation, no tabs" - To: "Use tabs for indentation (WordPress PHP standard)" - Now consistent with line 24 which correctly states "tabs" - **wpcs-javascript.instructions.md**: Clarified JS indentation rules - Line 131: Added context "tabs for vanilla JavaScript (WordPress core standard)" - Line 132: Added "For React/JSX files, use 2 spaces to align with @wordpress/scripts" - Line 562: Clarified "2 spaces for React/JSX files (Gutenberg standard), tabs for vanilla JS" - Resolves contradiction between tabs (line 131) and 2 spaces (line 561) ### Issue #3: Placeholder Preservation Checklist (CRITICAL) - **scaffold-extensions.instructions.md**: Added comprehensive validation section - New "Mustache Placeholder Preservation Checklist" with 6 subsections - Core Placeholders checklist (namespace, slug, textdomain, name, etc.) - Template Files checklist (patterns, templates, blocks) - Common Hard-coding Mistakes with BAD vs GOOD examples - 5-step Validation procedure including mustache scanning - Documentation requirements for new placeholders - Risk prevention identifying high-risk files ## Impact ### Before: - AI agents received contradictory guidance on indentation - No explicit validation checklist for mustache placeholder preservation - Risk of hard-coded values breaking scaffold generation ### After: - Clear, consistent indentation standards (PHP: tabs, React: 2 spaces, vanilla JS: tabs) - Comprehensive checklist prevents mustache placeholder violations - Explicit validation steps ensure scaffold integrity ## Validation ✅ Instructions now consistent across all WPCS files ✅ Placeholder preservation explicitly documented with examples ✅ High-risk files identified for extra caution ✅ 5-step validation procedure added ## Files Modified - .github/instructions/wpcs-php.instructions.md (1 line corrected) - .github/instructions/wpcs-javascript.instructions.md (3 sections clarified) - .github/instructions/scaffold-extensions.instructions.md (106 lines added) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
name: "Pull Request"
about: "General changes, refactors, and maintenance"
title: "PR: WordPress multi-block plugin scaffold with CPT, taxonomies, SCF fields, and block bindings"
labels: ["status:needs-review"]
General Pull Request
Linked issues
Closes #1
Changelog
Added
src/blocks/:card: Single post display with image, title, subtitle, excerpt, meta.collection: Grid/list/slider layouts with query controls, pagination, taxonomy filtering.slider: Carousel with autoplay, dots, arrows, touch/swipe, keyboard nav.featured: Featured posts with grid, featured-first, hero layouts.inc/class-post-types.php,inc/class-taxonomies.php).inc/class-fields.php,inc/class-repeater-fields.php).inc/class-block-bindings.php).patterns/,templates/,parts/).src/components/): Slider, PostSelector, TaxonomyFilter, FieldDisplay, RepeaterField, Gallery, QueryControls.src/hooks/): usePostType, useTaxonomies, useFields, useRepeater, useSlider, useCollection.tests/).uninstall.php).{{variables}}for scaffold instantiation.Changed
Fixed
Removed
Risk Assessment
Risk Level: Medium
Potential Impact:
Mitigation Steps:
How to Test
Prerequisites
inc/class-post-types.phpTest Steps
Block Registration:
card,collection,slider,featured) in the post/page editor.Custom Post Types & Taxonomies:
SCF Field Integration:
Block Bindings API:
Patterns & Templates:
Uninstall:
Expected Results
Edge Cases to Verify
Checklist (Global DoD / PR)
References
Plugin Details / Spec
Complete multi-block WordPress plugin scaffold per spec. Includes 4 Gutenberg blocks, custom post type/taxonomy, SCF integration with repeaters, Block Bindings API (WP 6.5+), patterns/templates/parts, and full test suite. All files use Mustache
{{variables}}for scaffold instantiation.Blocks (
src/blocks/)PHP Classes (
inc/)class-post-types.php/class-taxonomies.php- CPT and taxonomy registrationclass-fields.php/class-repeater-fields.php- SCF field groups including repeaters and flexible contentclass-block-bindings.php- WP 6.5+ Block Bindings source for{{namespace}}/fieldsclass-block-templates.php/class-patterns.php- Template and pattern registrationShared React Components (
src/components/)Custom Hooks (
src/hooks/)Infrastructure
patterns/- 7 PHP pattern files (archive, card, single, grid, slider, featured, meta)templates/- Block templates for single/archive viewsparts/- Template parts (header, meta, sidebar)tests/- PHPUnit, Jest, Playwright E2E testsuninstall.php- Complete cleanup on removalBlock Bindings Example
Plugin Dependencies (WP 6.5+)