How elicus/wpmozo-blocks-and-addons works
Project type and purpose
• This is a WordPress plugin (“WPMozo Addons For Gutenberg”) that adds a set of custom Gutenberg blocks to the WP editor.
• PHP code in the “includes” folder handles plugin initialization, block registration, i18n, and asset enqueuing.
• JavaScript/React code under “src” implements each block’s editor UI and save routines; a build step (npm/webpack) produces the final assets in “assets/js” and “assets/css.”
File structure
• Top‐level:
• wpmozo-addons-for-gutenberg.php → main plugin file
• includes/ → PHP classes for loader, hooks, i18n, block registration
• src/ → source code for individual blocks and shared React components
• assets/ → compiled CSS/JS/fonts/images served to editor and front end
• package.json & package-lock.json → npm build configuration
• Patterns:
• Modular block definitions (each block in its own subfolder in src/blocks)
• Shared UI components in src/components
• PHP “blocks” classes mirror built JS blocks for server‐side registration
• Build/deploy:
• npm run build → transpiles/concatenates src/ → assets/
• Plugin PHP enqueues those assets via WP hooks
README for additional insights
• Confirms WordPress plugin metadata, installation steps.
Elements
• Clear component labels (e.g., “Block Registration Service,” “Gutenberg Editor,” “React Block JS Bundle”)
• Build → assets
• PHP enqueue hooks → Editor load
• Editor actions → REST API → Database
• Page load → Front-end enqueue → Browser render