Skip to content

Repository files navigation

WordPress Operations Logo

WP OPS

Tools, scripts, and guides for modern WordPress development & devops—optimized for Trellis/Bedrock workflows.

Contents

wp-ops CLI

A single entry point for everything in this repo. Auto-discovers commands across every category and groups them by subdirectory.

A Go rewrite of this CLI (go/) is feature-complete and installable — same manifest-driven commands, a real Cobra binary, generated shell completions, and a Bubble Tea interactive picker with no fzf dependency. See docs/cli-ux-plan.md for the plan and current milestone status.

# Recommended: Homebrew (installs the Go binary)
brew install imagewize/tap/wp-ops

# Without Homebrew, the bash CLI:
./install.sh                 # add wp-ops to your PATH (one-time)

wp-ops                       # interactive picker
wp-ops --help                # list all categories
wp-ops trellis --help        # list commands in one category
wp-ops <category> <command> [args...]

wp-ops search webp           # find a command by name or description
wp-ops docs oom              # search the guides, not just the commands
wp-ops doctor                # check dependencies and environment
wp-ops <command> --where     # print the path to a command's script

wp-ops with no arguments opens an interactive picker. In the bash CLI, install fzf (brew install fzf) and it becomes a fuzzy search over every command with the script's header as a live preview; without fzf it falls back to a numbered category → command menu. The Go CLI's picker (Bubble Tea) has this built in — no fzf dependency either way.

Run wp-ops doctor first — it reports which of the external tools these scripts rely on (WP-CLI, Ansible, ImageMagick, gh, cwebp, Node, …) are actually installed, so you find out before a command fails partway through.

Two categories need environment variables pointing at a real project before their commands work:

# Ansible playbooks (wp-ops trellis <playbook>) need a Trellis project's ansible.cfg/inventory/group_vars
export TRELLIS_DIR=/path/to/your/trellis
wp-ops trellis database-backup -e site=example.com -e env=production

# WP-CLI scripts (wp-ops wp-cli|bedrock <script>) need a real WordPress/Bedrock install
export WP_SITE_DIR=/path/to/your/bedrock-site
wp-ops wp-cli scanner-wrapper
wp-ops bedrock wp-cli-pattern-validate web/app/themes/your-theme/patterns/ --fix

If either variable is unset, wp-ops looks for the project by walking up from your current directory and asks before using what it finds — it never guesses silently, and non-interactive runs require the variable to be set explicitly. Detection deliberately only matches a project you're actually standing inside, so an unrelated Trellis checkout sitting next to your current repo won't be picked up.

nginx/ and troubleshooting/ contain guides and Nginx config templates rather than runnable scripts; wp-ops nginx lists those documents instead of commands.

A good deal of what this repo knows is written down rather than scripted, so wp-ops docs searches the prose the way wp-ops search searches the catalog:

wp-ops docs                  # list every guide
wp-ops docs "search-replace" # show matching lines, grouped by document
wp-ops docs oom -w           # whole words only (so "oom" skips "server room")
wp-ops docs oom -l           # paths only, for piping: wp-ops docs oom -l | xargs $EDITOR

When wp-ops search finds no command for a term, it checks the documentation and points you there.

Everything else runs on your own machine, including the commands that touch a server — Ansible playbooks, server-monitor, and post-count --ssh all reach out over SSH from here. The exception is the log monitors, which read /srv/www/<site>/logs/ and /var/log/ directly and execute on the host. Those are tagged (server) in listings and search, and running one locally prints the SSH invocation rather than failing on a missing log path:

ssh web@example.com 'bash -s' < scripts/monitoring/run-monitoring.sh
ssh root@example.com 'bash -s' < scripts/monitoring/error-monitor.sh example.com 48

Nothing needs to be installed on the server for that — the script is streamed to its stdin. The access-log monitors want gawk there for accurate time filtering (Ubuntu ships mawk, so apt install gawk); without it they fall back to a line-count estimate. error-monitor needs neither gawk nor a log path — it takes the domain, and connecting as root additionally gets you the systemd sections (critical errors, PHP segfaults, OOM kills) that the web user can't read. wp-ops --json reports the local/server split as a runs_on field.

wordpress-utilities/ is different: those are copy-paste-into-a-theme snippets, not runnable scripts, so wp-ops wordpress-utilities <snippet> prints or clipboard-copies them instead:

wp-ops wordpress-utilities footer --copy     # copy to clipboard
wp-ops wordpress-utilities footer > footer.php   # redirect into your theme

Trellis

Tool Description Docs
Updater Safely update Trellis while preserving custom configurations
Backup Tools Ansible playbooks for database and files backup/push/pull
Provisioning Common provisioning commands and workflows
New Machine Setup Set up macOS for Trellis development
Project Setup Clone and configure an existing Trellis/Bedrock project
Monitoring Nginx log monitoring for traffic analysis and security threat detection
Security fail2ban IP blocking, manual deny rules, and AbuseIPDB reputation lookup

Bedrock

Tool Description Docs
Local Package Development Test an in-development plugin/theme branch in a Bedrock site via a Composer path repository, before tagging a release
WP-CLI Config Standard wp-cli.yml for Bedrock path setup plus a wp pattern validate command for canonicalizing block pattern files

WP-CLI

Tool Description Docs
Content Creation Automated page creation and content management workflows
Migration Tools Migrate WordPress sites to Trellis/Bedrock (single and multi-site)
URL Update Methods WordPress URL update methods for migrations
Diagnostics Diagnostic tools for transients, caching, and performance
Security Scanners Dual-scanner suite for malware detection and security auditing
SEO SEO analysis and audit tools for page structure, redirects, schema markup, blog content, and orphan pages

Nginx

Tool Description Docs
Image Optimization WebP/AVIF configuration with automatic format serving
Browser Caching Optimal static asset caching configuration
Redirects Redirect configuration for SEO and URL management

Scripts

27 standalone Bash/PHP/Python utilities — full docs, flags, and examples in scripts/README.md.

Category Includes Docs
Releases & GitHub PR creation, plugin/theme release automation, WordPress.org SVN deploy, release asset upload, GitHub traffic stats
Monitoring & Security Traffic/security/AI-bot monitoring, 404 & redirect checking, CF7 smoke test, updown.io webhooks
Backups Trellis-aware database and full-site backups
Images, WooCommerce & Files Batch resize, WebP conversion, square-canvas padding, Openverse image search/download, WooCommerce product variations, theme/package sync, find & replace
Content Reporting Published-post counts by year/month

MCP Server

Exposes wp-ops operations as MCP tools, so Claude (and other MCP-compatible clients) can call them directly instead of running the underlying scripts by hand. Scaffold stage — five tools so far (security_scan, db_backup, wp_cli, redirect_audit, schema_audit), more planned. See mcp-server/README.md for tool details, setup, transports (stdio/Streamable HTTP), and Docker usage.

WordPress Utilities

Tool Description Docs
Snippets Self-contained PHP snippets ready to drop into themes or plugins
Age Verification Cookie-based age verification with modal interface and ACF integration
Analytics Google Analytics, Matomo implementation and detection
Speed Optimization Performance testing and TTFB analysis with curl/wget

Troubleshooting

Tool Description Docs
Server Diagnostics Diagnose PHP-FPM, MariaDB, and server issues

Requirements

  • Core: Git, Bash, rsync
  • Tool-specific: See individual docs for Ansible, WP-CLI, ImageMagick, etc.

License

MIT License. See LICENSE.md for details.


Copyright © Imagewize

About

Tools, scripts, and guides for modern WordPress development & devops—optimized for Trellis/Bedrock workflows

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages