{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://lightspeedwp.com/schemas/plugin-config.json", "title": "WordPress Multi-Block Plugin Configuration", "description": "Pre-filled configuration for plugin generation wizard. Fill in values and pass to generate-plugin with --config flag.", "type": "object", "required": [ "slug", "name", "author" ], "properties": { "_comment": { "type": "string", "description": "Optional comment field for documentation purposes", "default": "Fill in the values below and save as plugin-config.json, then run: node scripts/generate-plugin.js --config plugin-config.json" }, "slug": { "type": "string", "x-stage": 1, "description": "URL-safe plugin identifier (lowercase, hyphens only, no underscores)", "pattern": "^[a-z][a-z0-9-]{1,48}[a-z0-9]$", "minLength": 2, "maxLength": 50, "examples": [ "tour-operator", "event-manager-pro", "portfolio-showcase" ] }, "name": { "type": "string", "description": "Human-readable plugin name", "minLength": 1, "maxLength": 100, "examples": [ "Tour Operator", "Event Manager Pro", "Portfolio Showcase" ] }, "description": { "type": "string", "description": "Short description of what the plugin does", "minLength": 1, "maxLength": 500 }, "author": { "type": "string", "x-stage": 1, "minLength": 2, "maxLength": 100, "default": "Your Name or Company", "examples": [ "LightSpeed", "Acme Corporation", "Jane Developer" ] }, "author_uri": { "type": "string", "description": "Author website URL (must include protocol)", "format": "uri", "pattern": "^https?://", "default": "https://example.com", "examples": [ "https://developer.lsdev.biz", "https://yourcompany.com" ] }, "repository_url": { "type": "string", "description": "Repository URL for the plugin, used for package.json homepage, repository and bugs (must include protocol). Defaults to https://github.com/lightspeedwp/.", "format": "uri", "pattern": "^https?://", "examples": [ "https://github.com/lightspeedwp/ls-test" ] }, "version": { "type": "string", "description": "Starting version number (semantic versioning)", "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?$", "default": "1.0.0", "examples": [ "1.0.0", "2.1.0", "1.0.0-beta.1" ] }, "textdomain": { "type": "string", "description": "Text domain for internationalization (usually matches slug)", "pattern": "^[a-z][a-z0-9-]{1,48}[a-z0-9]$", "examples": [ "tour-operator", "event-manager" ] }, "namespace": { "type": "string", "description": "PHP namespace (usually slug with underscores instead of hyphens)", "pattern": "^[a-z][a-z0-9_]{1,48}[a-z0-9]$", "examples": [ "tour_operator", "event_manager" ] }, "requires_wp": { "type": "string", "description": "Minimum required WordPress version", "pattern": "^\\d+\\.\\d+$", "default": "6.5", "examples": [ "6.5", "6.7" ] }, "requires_php": { "type": "string", "description": "Minimum required PHP version", "pattern": "^\\d+\\.\\d+$", "default": "8.0", "examples": [ "8.0", "8.1", "8.2" ] }, "license": { "type": "string", "description": "Plugin license identifier (SPDX format)", "default": "GPL-2.0-or-later", "enum": [ "GPL-2.0-or-later", "GPL-3.0-or-later", "MIT", "Apache-2.0" ], "examples": [ "GPL-2.0-or-later", "GPL-3.0-or-later" ] }, "license_uri": { "type": "string", "format": "uri", "description": "License URL for the plugin header and readme.txt. Defaults to the URL for the selected license." }, "tested_up_to": { "type": "string", "description": "WordPress version the plugin has been tested up to (readme.txt \"Tested up to\"). Defaults to requires_wp.", "pattern": "^\\d+\\.\\d+(\\.\\d+)?$", "examples": [ "6.8" ] }, "contributors": { "type": "string", "description": "Comma-separated WordPress.org usernames for readme.txt. Defaults to the author name, lowercased with non-alphanumeric characters removed.", "examples": [ "lightspeedwp" ] }, "content_model": { "type": "string", "x-stage": 1, "description": "Whether this plugin defines a custom content model (post types/taxonomies) or is functional-only (blocks/settings, no post types or taxonomies). Omitting this property preserves legacy behaviour driven solely by the presence of post_types.", "enum": [ "none", "custom" ], "default": "custom", "examples": [ "none", "custom" ] }, "post_types": { "type": "array", "description": "Custom post types to register for this plugin", "default": [], "items": { "type": "object", "required": [ "slug", "singular", "plural" ], "properties": { "slug": { "type": "string", "description": "Custom post type slug (max 20 chars, lowercase, underscores allowed)", "pattern": "^[a-z][a-z0-9_]{0,18}[a-z0-9]$", "minLength": 2, "maxLength": 20, "examples": [ "tour", "event", "portfolio_item" ] }, "singular": { "type": "string", "description": "Singular name for the custom post type", "minLength": 1, "maxLength": 50, "examples": [ "Tour", "Event", "Portfolio Item" ] }, "plural": { "type": "string", "description": "Plural name for the custom post type", "minLength": 1, "maxLength": 50, "examples": [ "Tours", "Events", "Portfolio Items" ] }, "supports": { "type": "array", "description": "Features supported by the custom post type", "default": [ "title", "editor", "thumbnail", "excerpt", "custom-fields", "revisions" ], "uniqueItems": true, "items": { "type": "string", "enum": [ "title", "editor", "author", "thumbnail", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "page-attributes", "post-formats" ] } }, "has_archive": { "type": "boolean", "description": "Enable archive page for the custom post type", "default": true }, "public": { "type": "boolean", "description": "Make the custom post type publicly queryable", "default": true }, "menu_icon": { "type": "string", "description": "Dashicon class name for admin menu (e.g., 'dashicons-palmtree')", "pattern": "^dashicons-[a-z0-9-]+$", "default": "dashicons-admin-post", "examples": [ "dashicons-palmtree", "dashicons-calendar-alt", "dashicons-portfolio" ] }, "taxonomies": { "type": "array", "description": "Custom taxonomies for this post type - each item is either a taxonomy slug (string) or a legacy taxonomy object", "default": [], "items": { "oneOf": [ { "type": "string", "description": "Taxonomy slug (references a taxonomy defined in the top-level taxonomies array)", "pattern": "^[a-z][a-z0-9_]{0,30}[a-z0-9]$", "examples": [ "destination", "event_category", "portfolio_tag" ] }, { "type": "object", "description": "Legacy taxonomy object (will be converted to a top-level taxonomy)", "required": [ "slug", "singular", "plural" ], "properties": { "slug": { "type": "string", "description": "Taxonomy slug (lowercase, underscores allowed)", "pattern": "^[a-z][a-z0-9_]{0,30}[a-z0-9]$", "minLength": 2, "maxLength": 32, "examples": [ "destination", "event_category", "portfolio_tag" ] }, "singular": { "type": "string", "description": "Singular label for the taxonomy", "minLength": 1, "maxLength": 50, "examples": [ "Destination", "Event Category", "Portfolio Tag" ] }, "plural": { "type": "string", "description": "Plural label for the taxonomy", "minLength": 1, "maxLength": 50, "examples": [ "Destinations", "Event Categories", "Portfolio Tags" ] }, "hierarchical": { "type": "boolean", "description": "Whether taxonomy is hierarchical (like categories) or flat (like tags)", "default": true } } } ] } }, "fields": { "description": "SCF field definitions for this post type - can be array of fields (legacy) or use top-level fields array", "default": [], "oneOf": [ { "type": "array", "description": "Legacy format - fields embedded in post type (will be converted to top-level fields)", "items": { "type": "object", "required": [ "name", "label", "type" ], "properties": { "name": { "type": "string", "description": "Field key (lowercase, underscores, no spaces)", "pattern": "^[a-z][a-z0-9_]*$", "minLength": 2, "maxLength": 64, "examples": [ "price", "duration_days", "featured_image_gallery" ] }, "label": { "type": "string", "description": "Human-readable field label shown in admin", "minLength": 1, "maxLength": 100, "examples": [ "Price per Person", "Duration (Days)", "Featured Image Gallery" ] }, "type": { "type": "string", "description": "SCF field type", "enum": [ "text", "textarea", "wysiwyg", "number", "email", "url", "password", "image", "file", "gallery", "select", "checkbox", "radio", "button_group", "true_false", "date_picker", "time_picker", "date_time_picker", "color_picker", "link", "post_object", "page_link", "relationship", "taxonomy", "user", "google_map", "message", "accordion", "tab", "group", "repeater", "flexible_content", "clone" ] }, "required": { "type": "boolean", "description": "Whether this field is required", "default": false }, "instructions": { "type": "string", "description": "Help text displayed below the field in admin", "maxLength": 500, "examples": [ "Enter the base price for this tour (in your currency)", "Number of days for this tour" ] }, "default_value": { "description": "Default value for the field (type depends on field type)", "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "array" }, { "type": "null" } ] }, "placeholder": { "type": "string", "description": "Placeholder text for text-based fields", "maxLength": 100, "examples": [ "Enter price...", "Select option..." ] }, "choices": { "type": "object", "description": "Available choices for select, checkbox, radio, and button_group fields", "patternProperties": { "^[a-z0-9_-]+$": { "type": "string" } }, "examples": [ { "easy": "Easy", "moderate": "Moderate", "challenging": "Challenging" } ] }, "min": { "type": "number", "description": "Minimum value for number fields" }, "max": { "type": "number", "description": "Maximum value for number fields" }, "step": { "type": "number", "description": "Step increment for number fields", "default": 1 }, "return_format": { "type": "string", "description": "Return format for various field types", "enum": [ "value", "label", "array", "url", "id", "object" ] }, "multiple": { "type": "boolean", "description": "Allow multiple selections for select/post_object/user fields", "default": false }, "allow_null": { "type": "boolean", "description": "Allow null/empty value", "default": false } } } } ] } } } }, "taxonomies": { "type": "array", "description": "Top-level taxonomy definitions shared across post types", "default": [], "items": { "type": "object", "required": [ "slug", "singular", "plural", "post_types" ], "properties": { "slug": { "type": "string", "description": "Taxonomy slug (lowercase, underscores allowed)", "pattern": "^[a-z][a-z0-9_]{0,30}[a-z0-9]$", "minLength": 2, "maxLength": 32, "examples": [ "destination", "event_category", "portfolio_tag" ] }, "singular": { "type": "string", "description": "Singular label for the taxonomy", "minLength": 1, "maxLength": 50, "examples": [ "Destination", "Event Category", "Portfolio Tag" ] }, "plural": { "type": "string", "description": "Plural label for the taxonomy", "minLength": 1, "maxLength": 50, "examples": [ "Destinations", "Event Categories", "Portfolio Tags" ] }, "hierarchical": { "type": "boolean", "description": "Whether taxonomy is hierarchical (like categories) or flat (like tags)", "default": true }, "post_types": { "type": "array", "description": "Array of post type slugs this taxonomy applies to", "minItems": 1, "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,18}[a-z0-9]$", "examples": [ "tour", "event", "portfolio_item" ] } } } } }, "fields": { "type": "array", "description": "Top-level field group definitions organized by post type", "default": [], "items": { "type": "object", "required": [ "post_type", "field_group" ], "properties": { "post_type": { "type": "string", "description": "Post type slug this field group applies to", "pattern": "^[a-z][a-z0-9_]{0,18}[a-z0-9]$", "examples": [ "tour", "event", "portfolio_item" ] }, "field_group": { "type": "array", "description": "Array of field definitions for this post type", "items": { "type": "object", "required": [ "name", "label", "type" ], "properties": { "name": { "type": "string", "description": "Field key (lowercase, underscores, no spaces)", "pattern": "^[a-z][a-z0-9_]*$", "minLength": 2, "maxLength": 64 }, "label": { "type": "string", "description": "Human-readable field label shown in admin", "minLength": 1, "maxLength": 100 }, "type": { "type": "string", "description": "SCF field type", "enum": [ "text", "textarea", "wysiwyg", "number", "email", "url", "password", "image", "file", "gallery", "select", "checkbox", "radio", "button_group", "true_false", "date_picker", "time_picker", "date_time_picker", "color_picker", "link", "post_object", "page_link", "relationship", "taxonomy", "user", "google_map", "message", "accordion", "tab", "group", "repeater", "flexible_content", "clone" ] }, "required": { "type": "boolean", "description": "Whether this field is required", "default": false }, "instructions": { "type": "string", "description": "Help text displayed below the field in admin" }, "default_value": { "description": "Default value for the field" }, "placeholder": { "type": "string", "description": "Placeholder text for text-based fields" }, "choices": { "type": "object", "description": "Available choices for select, checkbox, radio, and button_group fields" }, "min": { "type": "number", "description": "Minimum value for number fields" }, "max": { "type": "number", "description": "Maximum value for number fields" }, "step": { "type": "number", "description": "Step increment for number fields" }, "return_format": { "type": "string", "description": "Return format for various field types" }, "multiple": { "type": "boolean", "description": "Allow multiple selections" }, "allow_null": { "type": "boolean", "description": "Allow null/empty value" } } } } } } }, "blocks": { "type": "array", "description": "Block types to generate for this plugin", "default": [ "collection", "slider" ], "uniqueItems": true, "items": { "type": "string", "enum": [ "collection" ] } } }, "additionalProperties": true, "allOf": [ { "if": { "properties": { "content_model": { "const": "none" } }, "required": [ "content_model" ] }, "then": { "properties": { "post_types": { "maxItems": 0 }, "taxonomies": { "maxItems": 0 }, "cpt_slug": { "maxLength": 0 }, "name_singular": { "maxLength": 0 } } } } ] }