| name | vip-development |
| description | WordPress VIP development environment and architecture. Apply when working on VIP projects, running VIP CLI commands, or understanding VIP project structure. Covers vip-cli, client-mu-plugins architecture, and VIP-specific constraints. |
WordPress VIP Development
WordPress VIP is an enterprise WordPress hosting platform with specific architecture requirements and tooling.
Project Structure
project/
โโโ client-mu-plugins/ # Client must-use plugins
โ โโโ plugin-name/
โ โ โโโ plugin.php
โ โ โโโ inc/
โ โโโ plugin-loader.php # Loads client mu-plugins
โโโ plugins/ # Standard plugins
โโโ themes/
โ โโโ theme-name/
โ โโโ functions.php
โ โโโ inc/
โ โโโ theme.json
โโโ vip-config/
โ โโโ vip-config.php # VIP-specific configuration
โโโ images/ # Imported media (optional)
โโโ languages/ # Translation files
โโโ composer.json
VIP CLI Commands
VIP uses vip CLI (install via npm: npm install -g @automattic/vip):
Application Management
vip app list
vip app --app=<app-id>
WP-CLI Access
vip @<app>.<env> -- wp <command>
vip @mysite.production -- wp post list --post_type=page
vip @mysite.develop -- wp user list
vip @mysite.staging -- wp option get siteurl
vip @mysite.develop -- wp cache flush
Database Access
vip @<app>.<env> db
Logs
vip @<app>.<env> logs
vip @<app>.<env> logs --type=batch
Dev Environment (Local)
vip dev-env create
vip dev-env start
vip dev-env stop
vip dev-env destroy
vip dev-env exec -- wp <command>
client-mu-plugins Architecture
Client code lives in client-mu-plugins/:
<?php
namespace Project\MyFeature;
function bootstrap() : void {
add_action( 'init', __NAMESPACE__ . '\\register' );
}
Load via plugin-loader.php:
<?php
require_once __DIR__ . '/my-feature/plugin.php';
Project\MyFeature\bootstrap();
VIP-Specific Constraints
Forbidden Functions
VIP restricts certain functions for security and performance:
- No
eval(), create_function()
- No direct file writes outside uploads: use VIP File System API
- No
wp_remote_get() to localhost
- Limited use of
set_time_limit()
Required Practices
- Use
wpcom_vip_file_get_contents() for remote requests with caching
- Use
wpcom_vip_attachment_url_to_postid() instead of attachment_url_to_postid()
- Avoid uncached queries: use VIP's caching layer
Environment Variables
Access via:
$value = defined( 'MY_CONSTANT' ) ? MY_CONSTANT : getenv( 'MY_CONSTANT' );
Code Analysis
VIP provides code analysis tools:
vip @<app> code-analysis
vendor/bin/phpcs --standard=WordPress-VIP-Go
Deployment
VIP deploys from git branches:
develop branch โ develop environment
preprod branch โ staging environment
master/main branch โ production environment
Deployments are triggered by git push and go through VIP's review process.
Asset Handling
Similar to standard WordPress, but note:
- Use
wp_enqueue_* functions exclusively
- CDN is handled automatically by VIP
- Use versioning via asset manifest files
function enqueue_assets() : void {
$manifest = json_decode(
file_get_contents( get_template_directory() . '/build/manifest.json' ),
true
);
wp_enqueue_script(
'theme-scripts',
get_template_directory_uri() . '/build/' . $manifest['main.js'],
[],
null,
true
);
}
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\enqueue_assets' );