RRZE Plugin Blueprint
Clone, customize, and start building professional WordPress plugins with RRZE Plugin Blueprint!
by RRZE Webteam · github.com/rrze-webteam/rrze-plugin-blueprint · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/rrze-webteam/rrze-plugin-blueprint/archive/refs/heads/main.zipRRZE Plugin Blueprint is a modern, modular starter framework for building custom WordPress plugins with best practices in mind. It provides a robust foundation with PSR-4 autoloading, advanced options and settings management, block support, internationalization (i18n) for both PHP and JavaScript, and system requirements checks—so you can focus on your plugin’s unique features.
Key Features
-
PSR-4 Autoloading
All PHP classes under theRRZE\PluginBlueprintnamespace are autoloaded from theincludes/directory. -
Activation & Deactivation Hooks
Easily add setup or cleanup routines using the providedactivation()anddeactivation()methods. -
System Requirements Check
The plugin checks for minimum WordPress and PHP versions before initializing, displaying admin notices if requirements are not met. -
Singleton Initialization
Access the main plugin instance anywhere via theplugin()andmain()helper functions. -
Centralized Defaults
TheDefaultsclass manages all plugin default values, which can be filtered and reused throughout your code. -
Advanced Settings API Integration
TheSettingsclass lets you easily create settings pages, sections, and fields with validation and sanitization.
👉 See the Settings class README -
Custom Post Types & Taxonomies
GenericCPTandTaxonomyclasses make it easy to register custom post types and taxonomies. -
Shortcode Registration
A genericShortcodeclass allows for quick and clean shortcode registration. -
Gutenberg Block Support
Example: Includes a structure for both static and dynamic blocks, each with their own build process and assets.
👉 Static Block README
👉 Dynamic Block README -
Internationalization (i18n) for PHP and JS
All user-facing strings are translatable. The build process and scripts support extracting and generating.pot,.po,.mo, and.jsonfiles for both PHP and JS translations.
Directory Structure
rrze-plugin-blueprint/
│
├── blocks/
│ ├── block-dynamic/
│ │ ├── README.md
│ │ └── src/
│ └── block-static/
│ ├── README.md
│ └── src/
├── build/
│ └── blocks/
│ ├── block-dynamic/
│ └── block-static/
├── includes/
│ ├── Defaults.php
│ ├── Main.php
│ └── Common/
│ ├── Blocks/
│ ├── CPT/
│ ├── Plugin/
│ ├── Settings/
│ └── Shortcode/
├── languages/
│ └── rrze-plugin-blueprint.pot
├── package.json
├── rrze-plugin-blueprint.php
├── README.md
├── readme.txt
├── build-plugin.js
├── webpack.config.js
Development Workflow
-
Install dependencies:
npm install -
Build all blocks:
npm run buildEach block will have its own build directory with compiled assets and static files.
-
Internationalization:
- Extract PHP and JS strings:
wp i18n make-pot . languages/rrze-plugin-blueprint.pot --domain=rrze-plugin-blueprint --exclude=node_modules,vendor,build - Generate JS translation JSON files:
wp i18n make-json languages/rrze-plugin-blueprint-LOCALE.po --no-purge
- Extract PHP and JS strings:
Customization
-
Register a new block:
Add a folder underblocks/, create asrc/andblock.json, and add a build script inpackage.json. -
Override default values:
EditDefaults.phpor use therrze_plugin_blueprint_defaultsfilter. -
Change the PHP namespace:
You can update the PHP namespace throughout the plugin by running:npm run update:namespaceThis will replace the namespace in all PHP files (except in the
build/directory). -
Change the text domain You can update the text domain throughout the plugin by running:
npm run update:textdomainThis will replace the textdomain in all PHP and JS files (except in the
build/directory). -
Change the plugin slug You can update the plugin slug throughout the plugin by running:
npm run update:slugThis will replace the plugin slug in all PHP and JS files (except in the
build/directory).Note: Don’t forget to change the plugin directory and file names accordingly.
Internationalization
- All strings use the
rrze-plugin-blueprinttext domain. - Translation files (
.pot,.po,.mo,.json) are in thelanguages/directory. - JS translations are loaded using
wp_set_script_translations().
Clone, customize, and start building professional WordPress plugins with RRZE Plugin Blueprint!