Skip to content

Commit 08c577c

Browse files
committed
chore: stage and commit all changes, update changelog for shared components
1 parent 364522c commit 08c577c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2518
-796
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "Initiate Mustache Variable Registry Scan"
3+
description: "Prompt for running a new scan and updating the mustache variable registry with wizard support."
4+
category: "registry"
5+
date: 2025-12-18
6+
---
7+
8+
# Mustache Variable Registry Scan Wizard
9+
10+
You are about to run a full scan of the repository for mustache template variables.
11+
12+
**This process will:**
13+
14+
- Discover all `{{mustache}}` placeholders in source, config, and docs.
15+
- Compare results to the current registry.
16+
- Identify undocumented, unused, or changed variables.
17+
- Guide you through reviewing and updating the registry.
18+
19+
## Steps
20+
21+
1. **Scan**: Run the scan to auto-discover all variables.
22+
2. **Review**: For each new or changed variable, the wizard will prompt you to:
23+
- Confirm or edit the variable name.
24+
- Assign a type and category.
25+
- Add a description and example value.
26+
3. **Validate**: The wizard will validate the updated registry against the schema.
27+
4. **Diff & Report**: Optionally, generate a diff/markdown report for review or PRs.
28+
5. **Save**: Confirm and write the updated registry.
29+
30+
## Usage
31+
32+
Run:
33+
34+
```sh
35+
npm run scan:mustache-registry
36+
```
37+
38+
Or, for wizard mode:
39+
40+
```sh
41+
npm run scan:mustache-registry -- --wizard
42+
```
43+
44+
---
45+
46+
**Tip:** Use the wizard to ensure all variables are well-documented and categorized for future maintainers.

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ We welcome various types of contributions:
7878

7979
```bash
8080
# Fork the repository on GitHub, then clone your fork
81-
git clone https://github.com/YOUR-USERNAME/{{slug}}.git
82-
cd {{slug}}
81+
git clone https://github.com/YOUR-USERNAME/{{plugin_slug}}.git
82+
cd {{plugin_slug}}
8383

8484
# Add upstream remote
85-
git remote add upstream https://github.com/{{author}}/{{slug}}.git
85+
git remote add upstream https://github.com/{{author}}/{{plugin_slug}}.git
8686
```
8787

8888
### 2. Install Dependencies
@@ -206,7 +206,7 @@ export default function Edit( { attributes, setAttributes } ) {
206206
Example:
207207

208208
```scss
209-
.wp-block-{{namespace}}-{{slug}} {
209+
.wp-block-{{namespace}}-{{block_slug}} {
210210
&__content {
211211
padding: var(--wp--preset--spacing--medium);
212212
border: 1px solid var(--wp--preset--color--border);
@@ -395,7 +395,7 @@ Outstanding contributors may be invited to become:
395395

396396
### Questions About Contributing
397397

398-
- **General questions** - Use [GitHub Discussions](https://github.com/{{author}}/{{slug}}/discussions)
398+
- **General questions** - Use [GitHub Discussions](https://github.com/{{author}}/{{plugin_slug}}/discussions)
399399
- **Specific issues** - Comment on relevant GitHub issues
400400
- **Development help** - See [SUPPORT.md](SUPPORT.md) for channels
401401
- **Urgent matters** - Contact maintainers directly

DEVELOPMENT.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ This document provides comprehensive information for developers working on {{nam
2323
### 1. Clone and Install
2424

2525
```bash
26-
git clone https://github.com/{{author}}/{{slug}}.git
27-
cd {{slug}}
26+
npm install
27+
composer install
28+
git clone https://github.com/{{author}}/{{plugin_slug}}.git
29+
cd {{plugin_slug}}
2830
npm install
2931
composer install
3032
```
@@ -65,14 +67,14 @@ The plugin follows WordPress block development best practices with multiple bloc
6567
```
6668
src/
6769
├── index.js # Main entry point - registers all blocks
68-
├── {{block-slug-1}}/ # First block
70+
├── {{block_slug}}/ # Block directory
6971
│ ├── block.json # Block metadata and configuration
7072
│ ├── edit.js # Editor component (React)
7173
│ ├── save.js # Frontend save component
7274
│ ├── index.js # Block registration
7375
│ ├── render.php # Server-side render callback
7476
│ └── style.scss # Block-specific styles
75-
├── {{block-slug-2}}/ # Second block
77+
├── {{block_slug}}/ # Another block
7678
│ └── ...
7779
└── shared/ # Shared between blocks
7880
├── components/ # Shared React components
@@ -349,7 +351,7 @@ This updates version numbers in:
349351

350352
- `package.json`
351353
- `composer.json`
352-
- `{{slug}}.php`
354+
- `{{plugin_slug}}.php`
353355
- `src/*/block.json`
354356
- `README.md`
355357

@@ -451,7 +453,7 @@ define( 'SCRIPT_DEBUG', true );
451453

452454
### Getting Help
453455

454-
1. Check existing [GitHub Issues](https://github.com/{{author}}/{{slug}}/issues)
456+
1. Check existing [GitHub Issues](https://github.com/{{author}}/{{plugin_slug}}/issues)
455457
2. Read [WordPress Block Editor Handbook](https://developer.wordpress.org/block-editor/)
456458
3. Join [WordPress Slack](https://wordpress.slack.com) #core-editor channel
457459
4. Review [LightSpeed Standards](https://github.com/lightspeedwp/.github)

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ We take the following types of vulnerabilities seriously:
132132

133133
#### Preferred Method: Private GitHub Security Advisory
134134

135-
1. Go to the [Security tab](https://github.com/{{author}}/{{slug}}/security) of our repository
135+
1. Go to the [Security tab](https://github.com/{{author}}/{{plugin_slug}}/security) of our repository
136136
2. Click "Report a vulnerability"
137137
3. Fill out the security advisory form with details
138138
4. Submit the report
@@ -322,7 +322,7 @@ The plugin complies with:
322322
### Security Team
323323

324324
* **Security Email**: security@{{author}}.com
325-
* **GitHub Security**: [Security Tab](https://github.com/{{author}}/{{slug}}/security)
325+
* **GitHub Security**: [Security Tab](https://github.com/{{author}}/{{plugin_slug}}/security)
326326
* **Maintainer**: [@{{author}}](https://github.com/{{author}})
327327

328328
### Security Resources

SUPPORT.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Need help with {{name}}? This guide provides various support options and resourc
4848

4949
**Best for**: Bug reports, feature requests, technical issues
5050

51-
* **Create an issue**: [{{slug}} Issues](https://github.com/{{author}}/{{slug}}/issues)
51+
* **Create an issue**: [{{plugin_slug}} Issues](https://github.com/{{author}}/{{plugin_slug}}/issues)
5252
* **Search existing issues**: Check if your issue already exists
5353
* **Follow templates**: Use the provided issue templates
5454
* **Be specific**: Provide detailed information and reproduction steps
@@ -89,7 +89,7 @@ Any other context about the problem here.
8989

9090
**Best for**: Questions, ideas, general discussion
9191

92-
* **Ask questions**: [{{slug}} Discussions](https://github.com/{{author}}/{{slug}}/discussions)
92+
* **Ask questions**: [{{plugin_slug}} Discussions](https://github.com/{{author}}/{{plugin_slug}}/discussions)
9393
* **Share ideas**: Discuss potential features
9494
* **Community help**: Get help from other users
9595
* **Show and tell**: Share how you're using the plugin
@@ -98,7 +98,7 @@ Any other context about the problem here.
9898

9999
**Best for**: General WordPress questions, plugin installation help
100100

101-
* **Plugin support forum**: [WordPress.org {{slug}} Forum](https://wordpress.org/support/plugin/{{slug}}/)
101+
* **Plugin support forum**: [WordPress.org {{plugin_slug}} Forum](https://wordpress.org/support/plugin/{{plugin_slug}}/)
102102
* **Community driven**: Volunteers provide help
103103
* **Public archive**: Searchable for future users
104104
* **WordPress focused**: WordPress-specific issues
@@ -286,9 +286,9 @@ A: Deactivate the plugin immediately, then report the issue with your WordPress
286286

287287
### Project Links
288288

289-
* **GitHub Repository**: [{{author}}/{{slug}}](https://github.com/{{author}}/{{slug}})
290-
* **WordPress.org Plugin**: [{{slug}}](https://wordpress.org/plugins/{{slug}}/)
291-
* **Documentation**: [GitHub Pages](https://{{author}}.github.io/{{slug}}/)
289+
* **GitHub Repository**: [{{author}}/{{plugin_slug}}](https://github.com/{{author}}/{{plugin_slug}})
290+
* **WordPress.org Plugin**: [{{plugin_slug}}](https://wordpress.org/plugins/{{plugin_slug}}/)
291+
* **Documentation**: [GitHub Pages](https://{{author}}.github.io/{{plugin_slug}}/)
292292

293293
## Contributing to Support
294294

USAGE.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ This guide explains how to use the {{name}} in your WordPress site.
1515

1616
### From WordPress Admin
1717

18-
1. Download the plugin ZIP file from the [releases page](https://github.com/{{author}}/{{slug}}/releases)
18+
1. Download the plugin ZIP file from the [releases page](https://github.com/{{author}}/{{plugin_slug}}/releases)
1919
2. In your WordPress admin, go to **Plugins > Add New**
2020
3. Click **Upload Plugin** and select the ZIP file
2121
4. Click **Install Now** and then **Activate**
2222

2323
### Manual Installation
2424

2525
1. Download and extract the plugin files
26-
2. Upload the `{{slug}}` folder to `/wp-content/plugins/`
26+
2. Upload the `{{plugin_slug}}` folder to `/wp-content/plugins/`
2727
3. Activate the plugin through the **Plugins** menu in WordPress
2828

2929
### Via Composer
3030

3131
```bash
32-
composer require {{author}}/{{slug}}
32+
composer require {{author}}/{{plugin_slug}}
3333
```
3434

3535
## Getting Started
@@ -100,17 +100,17 @@ You can add custom styles using WordPress's Additional CSS feature:
100100

101101
```css
102102
/* Target the block wrapper */
103-
.wp-block-{{namespace}}-{{block-slug}} {
103+
.wp-block-{{namespace}}-{{block_slug}} {
104104
/* Your custom styles */
105105
}
106106

107107
/* Target the content area */
108-
.wp-block-{{namespace}}-{{block-slug}}__content {
108+
.wp-block-{{namespace}}-{{block_slug}}__content {
109109
/* Content-specific styles */
110110
}
111111

112112
/* Alignment variations */
113-
.wp-block-{{namespace}}-{{block-slug}}.has-text-align-left {
113+
.wp-block-{{namespace}}-{{block_slug}}.has-text-align-left {
114114
/* Left-aligned styles */
115115
}
116116
```
@@ -258,39 +258,39 @@ Yes! See [CONTRIBUTING.md](../CONTRIBUTING.md) for information on how to contrib
258258
### Basic Usage
259259

260260
```html
261-
<!-- wp:{{namespace}}/{{block-slug}} {"content":"Hello World","alignment":"center"} -->
262-
<div class="wp-block-{{namespace}}-{{block-slug}} has-text-align-center">
263-
<div class="wp-block-{{namespace}}-{{block-slug}}__content">
261+
<!-- wp:{{namespace}}/{{block_slug}} {"content":"Hello World","alignment":"center"} -->
262+
<div class="wp-block-{{namespace}}-{{block_slug}} has-text-align-center">
263+
<div class="wp-block-{{namespace}}-{{block_slug}}__content">
264264
<p>Hello World</p>
265265
</div>
266266
</div>
267-
<!-- /wp:{{namespace}}/{{block-slug}} -->
267+
<!-- /wp:{{namespace}}/{{block_slug}} -->
268268
```
269269

270270
### With Custom Colors
271271

272272
```html
273-
<!-- wp:{{namespace}}/{{block-slug}} {"content":"Styled content","textColor":"primary","backgroundColor":"secondary"} -->
274-
<div class="wp-block-{{namespace}}-{{block-slug}} has-primary-color has-secondary-background-color has-text-color has-background">
275-
<div class="wp-block-{{namespace}}-{{block-slug}}__content">
273+
<!-- wp:{{namespace}}/{{block_slug}} {"content":"Styled content","textColor":"primary","backgroundColor":"secondary"} -->
274+
<div class="wp-block-{{namespace}}-{{block_slug}} has-primary-color has-secondary-background-color has-text-color has-background">
275+
<div class="wp-block-{{namespace}}-{{block_slug}}__content">
276276
<p>Styled content</p>
277277
</div>
278278
</div>
279-
<!-- /wp:{{namespace}}/{{block-slug}} -->
279+
<!-- /wp:{{namespace}}/{{block_slug}} -->
280280
```
281281

282282
### In a Pattern
283283

284284
```html
285285
<!-- wp:group {"layout":{"type":"constrained"}} -->
286286
<div class="wp-block-group">
287-
<!-- wp:{{namespace}}/{{block-slug}} {"content":"Pattern Example","alignment":"center"} -->
288-
<div class="wp-block-{{namespace}}-{{block-slug}} has-text-align-center">
289-
<div class="wp-block-{{namespace}}-{{block-slug}}__content">
287+
<!-- wp:{{namespace}}/{{block_slug}} {"content":"Pattern Example","alignment":"center"} -->
288+
<div class="wp-block-{{namespace}}-{{block_slug}} has-text-align-center">
289+
<div class="wp-block-{{namespace}}-{{block_slug}}__content">
290290
<p>Pattern Example</p>
291291
</div>
292292
</div>
293-
<!-- /wp:{{namespace}}/{{block-slug}} -->
293+
<!-- /wp:{{namespace}}/{{block_slug}} -->
294294
</div>
295295
<!-- /wp:group -->
296296
```

inc/class-patterns.php

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,25 @@ public function register_patterns() {
9191
}
9292

9393
/**
94-
* Derive pattern slug from filename.
95-
*
96-
* Converts 'patterns/example-plugin-card.php' to 'example-plugin/card'
97-
*
98-
* @since 1.0.0
99-
* @param string $pattern_file Full path to pattern file.
100-
* @return string Pattern slug.
101-
*/
102-
private function get_pattern_slug_from_file( $pattern_file ) {
103-
$filename = basename( $pattern_file, '.php' );
104-
105-
// Remove {{slug}}- prefix if present.
106-
$pattern_name = str_replace( '{{slug}}-', '', $filename );
107-
108-
// Return namespaced slug.
109-
return '{{slug}}/' . $pattern_name;
110-
}
94+
* Derive pattern slug from filename.
95+
*
96+
* Converts 'patterns/{{slug}}-tour-card.php' to '{{slug}}/tour-card'
97+
*
98+
* @since 1.0.0
99+
* @param string $pattern_file Full path to pattern file.
100+
* @return string Pattern slug.
101+
*/
102+
private function get_pattern_slug_from_file( $pattern_file ) {
103+
$filename = basename( $pattern_file, '.php' );
104+
105+
// Remove '{{slug}}-' prefix if present, preserving post type and pattern purpose.
106+
if ( strpos( $filename, '{{slug}}-' ) === 0 ) {
107+
$pattern_name = substr( $filename, strlen( '{{slug}}-' ) );
108+
} else {
109+
$pattern_name = $filename;
110+
}
111+
112+
// Return namespaced slug in the format '{{slug}}/{post_type}-{pattern}'.
113+
return '{{slug}}/' . $pattern_name;
114+
}
111115
}

languages/{{slug}}.pot

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
# Copyright (C) Example Author
2-
# This file is distributed under the same license as the Example Plugin package.
1+
2+
# Copyright (C) {{author}}
3+
# This file is distributed under the same license as the {{name}} package.
34
msgid ""
45
msgstr ""
5-
"Project-Id-Version: Example Plugin 1.0.0\n"
6-
"Report-Msgid-Bugs-To: https://github.com/Example Author/example-plugin/issues\n"
7-
"POT-Creation-Date: 2024-01-01 00:00:00+00:00\n"
6+
"Project-Id-Version: {{name}} {{version}}\n"
7+
"Report-Msgid-Bugs-To: https://github.com/{{author}}/{{slug}}/issues\n"
8+
"POT-Creation-Date: {{pot_date}}\n"
89
"MIME-Version: 1.0\n"
910
"Content-Type: text/plain; charset=UTF-8\n"
1011
"Content-Transfer-Encoding: 8bit\n"
1112
"Language-Team: LANGUAGE <[email protected]>\n"
1213
"X-Generator: WP-CLI\n"
13-
"X-Domain: example-plugin\n"
14+
"X-Domain: {{textdomain}}\n"
1415

1516
#. Plugin Name of the plugin
16-
msgid "Example Plugin"
17+
msgid "{{name}}"
1718
msgstr ""
1819

1920
#. Description of the plugin
20-
msgid "A multi-block WordPress plugin scaffold example"
21+
msgid "{{description}}"
2122
msgstr ""
2223

2324
#. Author of the plugin
24-
msgid "Example Author"
25+
msgid "{{author}}"
2526
msgstr ""

0 commit comments

Comments
 (0)