Composer
Blockstudio is available on Packagist. There are several ways to install it via Composer depending on your project setup.
As a Plugin
Use composer/installers to install Blockstudio directly into your wp-content/plugins/ directory. This is the standard approach for Composer-managed WordPress projects like Bedrock.
{
"require": {
"composer/installers": "^2.0",
"blockstudio/blockstudio": "^7.0"
},
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
}
}
}Activate Blockstudio through the WordPress admin or WP-CLI:
wp plugin activate blockstudioYour project's Composer autoloader must be loaded before WordPress initializes. In Bedrock this is handled automatically. In other setups, use a must-use plugin:
<?php
require_once dirname( __DIR__, 2 ) . '/vendor/autoload.php';As a Must-Use Plugin
Install Blockstudio into mu-plugins/ so it loads automatically without activation. Override the installer path to target the mu-plugins directory:
{
"require": {
"composer/installers": "^2.0",
"blockstudio/blockstudio": "^7.0"
},
"extra": {
"installer-paths": {
"wp-content/mu-plugins/{$name}/": ["type:wordpress-plugin"]
}
}
}WordPress only auto-loads PHP files at the root of mu-plugins/, not subdirectories. Add a loader file:
<?php
require_once WPMU_PLUGIN_DIR . '/blockstudio/blockstudio.php';No activation needed. Blockstudio loads on every request automatically.
Bundled in a Theme
Install Blockstudio as a dependency inside your theme. This keeps everything self-contained without requiring a separate plugin.
{
"require": {
"blockstudio/blockstudio": "^7.0"
}
}Load it in your theme's functions.php:
<?php
require_once __DIR__ . '/vendor/autoload.php';Blockstudio bootstraps automatically through Composer's autoloader. Asset URLs resolve to the correct theme directory. Blocks defined in your theme's blockstudio/ folder work exactly as they would with a plugin install.
Bundled in a Plugin
Install Blockstudio as a dependency inside another plugin. The same autoload bootstrap applies.
{
"require": {
"blockstudio/blockstudio": "^7.0"
}
}Load it in your plugin's main file:
<?php
/*
Plugin Name: My Plugin
*/
require_once __DIR__ . '/vendor/autoload.php';Asset URLs resolve to the correct plugin vendor directory.
Dependencies
Blockstudio's runtime dependencies (TailwindPHP, ScssPhp, Minify) are bundled and namespaced inside the plugin. The only Composer dependency installed into your vendor/ directory is yahnis-elsts/plugin-update-checker, which handles version conflict resolution internally.
composer.json requires:
php >= 8.2
yahnis-elsts/plugin-update-checker ^5.6Updates
Composer installations receive updates through Composer. The built-in GitHub updater is automatically disabled when Blockstudio is loaded from a vendor/ directory.