Otter Blocks is a WordPress Gutenberg blocks page builder plugin. It's a monorepo containing:
- Otter Blocks (main free plugin) —
otter-blocks.php - Otter Pro (premium extension) —
plugins/otter-pro/ - Blocks Animation —
plugins/blocks-animation/ - Blocks CSS —
plugins/blocks-css/ - Blocks Export/Import —
plugins/blocks-export-import/
Namespace: ThemeIsle\GutenbergBlocks. Requires WordPress 6.2+, PHP 7.4+ (platform target).
# Setup
npm ci && composer install
# Development (watch mode)
npm run start # All configs with watch
npm run dev:lite # Watch lite blocks only
npm run dev:pro # Watch pro blocks only
# Production build
npm run build # Full production build (all configs in parallel)
npm run prod:lite # Lite blocks only
npm run prod:pro # Pro blocks only
npm run prod:grunt # SASS compilation via Grunt
# Sister plugins build
npm run plugins # Build blocks-animation, blocks-css, blocks-export-import# JavaScript unit tests (Jest)
npm run test:unit
npm run test:unit:watch
# PHP unit tests (requires wp-env)
npm run test:unit:php # Starts wp-env + runs PHPUnit
npm run test:unit:php:base # PHPUnit only (if wp-env already running)
npm run test:unit:php:multisite # Multisite PHPUnit tests
# E2E tests (Playwright)
npm run test:e2e:playwright
npm run test:e2e:playwright-ui # With UI
# Performance tests
npm run test:performancePHPUnit config: phpunit.xml (single-site), phpunit/multisite.xml.
Playwright config: src/blocks/test/e2e/playwright.config.js.
# JavaScript
npm run lint # ESLint check
npm run format # ESLint autofix
# PHP
composer run lint # PHPCS
composer run format # PHPCBF
composer run phpstan # PHPStan static analysis (uses phpstan.neon + baseline)ESLint: WordPress preset with TypeScript (.eslintrc). PHPCS: WordPress-Core/Docs/Extra + VIP-Go (phpcs.xml).
Three webpack configs, all extending @wordpress/scripts:
webpack.config.js— Lite: dashboard, onboarding, animation frontend, and all free blockswebpack.config.pro.js— Pro blocks and featureswebpack.config.plugins.js— Sister plugins (animation, CSS, export-import)
Grunt handles SASS compilation and version bumping (Gruntfile.js).
blocks.json is the central manifest mapping every block to its block.json path and SCSS asset paths. Both webpack and Grunt read this file. Pro blocks are marked with isPro: true.
class-main.php— Singleton bootstrap, hooks, autoloading, SVG/MIME handlingclass-registration.php— Block registration (WordPress native), asset enqueue, block categories (themeisle-blocks,themeisle-woocommerce-blocks), lazy-load dependenciesclass-pro.php— Pro plugin loaderclass-patterns.php— Pattern librarycss/— CSS generation classes (Block_Frontend,CSS_Handler)plugins/— Feature modules: Block_Conditions, Dynamic_Content, Dashboard, Stripe_API, Template_Cloudrender/— Dynamic block server-side renderersserver/— REST API endpointsintegrations/— Form provider integrations (email services)
src/blocks/blocks/— Individual block implementations (edit.js, index.js, inspector.js, block.json)src/blocks/components/— Shared React componentssrc/blocks/frontend/— Block frontend scripts (loaded on visitor-facing pages)src/blocks/plugins/— Editor plugins (conditions, CSS, animations, copy-paste styles)src/blocks/helpers/— Utility functionssrc/pro/— Pro block implementationssrc/dashboard/— Otter settings dashboardsrc/onboarding/— Onboarding wizardsrc/animation/,src/css/,src/export-import/— Sister plugin sources
Uses @wordpress/env (wp-env). Config: .wp-env.override.json. Start with npm run test:unit:php:setup or npx wp-env start.
- Text domains:
otter-blocks,otter-pro,blocks-animation,blocks-css,blocks-export-import - Tab indentation (JS and PHP), single quotes, semicolons required (JS)
- Block namespace:
themeisle-blocks/<block-name>(e.g.,themeisle-blocks/accordion) - PHP autoloading follows class file naming:
class-<name>.php - Distribution via
npm run dist(runsbin/dist.sh, creates ZIP artifacts filtered by.distignore)