# Blaminhor Essentials — WP-CLI reference for AI agents and scripts

Every module of this plugin can be configured from the command line via the
`wp blaminhor ...` namespace. No HTTP request, no admin browser, no cookie
needed — just WordPress and WP-CLI installed on the target environment.

This file is intended as a quick reference for AI coding assistants
(Claude Code, Cursor, etc.) and automation scripts (CI/CD, fixtures,
multi-environment setup). The authoritative help is always:

    wp help blaminhor
    wp help blaminhor <subcommand>

## Capabilities

Every command that mutates state checks the WordPress `manage_options`
capability of the user passed via `--user=<login-or-id>`. Without `--user`,
WP-CLI runs as no user — mutating commands will refuse with a clear error.
Read-only commands work without `--user`.

## Output formats

All listing commands accept `--format=table|json|csv|yaml|count|ids`.
The `ids` format is space-separated and meant to be piped into another
command — for instance:

    for m in $(wp blaminhor modules list --inactive-only --format=ids); do
      wp --user=admin blaminhor modules activate "$m"
    done

## Confirmation

Destructive commands prompt with `WP_CLI::confirm()`. Pass `--yes` to skip
the prompt in scripts. The prompt accepts `y`/`n` on stdin.

## Lifecycle

    wp blaminhor info                                   # plugin/env summary
    wp blaminhor modules list [--active-only|--inactive-only] [--category=<slug>]
    wp blaminhor modules info <module-id>
    wp blaminhor modules activate <module-id>           # honours pre_activation_check
    wp blaminhor modules deactivate <module-id> [--yes]
    wp blaminhor modules status <module-id>             # exit 0=active, 1=inactive

## Per-module commands (alphabetical)

### Backup
    wp blaminhor backup list [--format=...]
    wp blaminhor backup info
    wp blaminhor backup delete <prefix> [--yes]
    # Creating / restoring a backup is admin-UI only (stepped AJAX, safety net).

### Broken Links
    wp blaminhor broken-links get
    wp blaminhor broken-links set --post-types=post,page --timeout=15
    wp blaminhor broken-links list [--include-dismissed] [--format=ids]
    wp blaminhor broken-links check-url https://example.com/page/
    wp blaminhor broken-links dismiss <id>...
    wp blaminhor broken-links delete <id>... [--yes]
    wp blaminhor broken-links stats

### Cache & Performance
    wp blaminhor cache purge [--page=<url>]
    wp blaminhor cache status
    wp blaminhor cache get

### Classic Editor
    wp blaminhor classic-editor get
    wp blaminhor classic-editor set --enable-classic-editor=true

### Cookies (consent banner)
    wp blaminhor cookies get
    wp blaminhor cookies set --layout=banner-bottom --gcm=true --tcf=false
    wp blaminhor cookies bump-version [--version=YYYY.MM.DD]
    wp blaminhor cookies log-stats [--days=30]
    wp blaminhor cookies clear-log [--older-than=365] [--yes]

### Database Optimizer
    wp blaminhor db-optimizer get
    wp blaminhor db-optimizer set --auto-cleanup=true --schedule=daily --tasks=revisions,transients
    wp blaminhor db-optimizer scan
    wp blaminhor db-optimizer clean --tasks=revisions,spam_comments --dry-run
    wp blaminhor db-optimizer clean --tasks=all --yes
    wp blaminhor db-optimizer optimize-tables --yes

### Disable Comments
    wp blaminhor disable-comments get
    wp blaminhor disable-comments set --disable-comments=true --hide-from-admin=true
    wp blaminhor disable-comments close-existing [--yes]
    wp blaminhor disable-comments delete-all [--yes]   # IRREVERSIBLE

### Domain Changer
    wp blaminhor domain-changer info
    wp blaminhor domain-changer set --backup-before-change=true
    wp blaminhor domain-changer migration-recipe --old=old.com --new=new.com
    # Actual migration: use the printed `wp search-replace` recipe.

### Duplicator
    wp blaminhor duplicator get
    wp blaminhor duplicator set --copy-meta=true --copy-status=draft
    wp blaminhor duplicator duplicate-post <id> [--porcelain]
    wp blaminhor duplicator duplicate-term <id> --taxonomy=category [--porcelain]

### Fatal Error Recovery
    wp blaminhor fer status
    wp blaminhor fer get-recovery-key [--reveal]
    wp blaminhor fer regenerate-key
    wp blaminhor fer force-disable <plugin-slug> [--yes]
    wp blaminhor fer force-enable <plugin-slug>

### Favicon
    wp blaminhor favicon get
    wp blaminhor favicon generate <attachment-id> [--theme-color=#hex] [--bg-color=#hex]
    wp blaminhor favicon delete [--yes]

### Hide Login
    wp blaminhor hide-login get
    wp blaminhor hide-login status                      # exit 0=enabled, 1=disabled
    wp blaminhor hide-login enable [--slug=<slug>] [--redirect=<slug>]
    wp blaminhor hide-login disable [--yes]
    wp blaminhor hide-login set --slug=back-door

### HTTPS Redirect
    wp blaminhor https-redirect get
    wp blaminhor https-redirect status
    wp blaminhor https-redirect enable [--hsts=true] [--hsts-max-age=63072000]
    wp blaminhor https-redirect disable [--yes]
    wp blaminhor https-redirect set --redirect-admin=true --fix-mixed-content=true

### Image Sizes
    wp blaminhor image-sizes list
    wp blaminhor image-sizes disable <size>
    wp blaminhor image-sizes enable <size>
    wp blaminhor image-sizes add-custom --name=hero --width=1920 --height=600 [--crop]
    wp blaminhor image-sizes remove-custom <name> [--yes]

### Maintenance / Coming Soon
    wp blaminhor maintenance get
    wp blaminhor maintenance status                     # exit 0=enabled, 1=disabled
    wp blaminhor maintenance enable [--headline=...] [--message=...] [--bypass-ips=1.2.3.4,5.6.7.8]
    wp blaminhor maintenance disable [--yes]
    wp blaminhor maintenance set --message="Back in 1h"

### Mute Core Emails
    wp blaminhor mute-emails get
    wp blaminhor mute-emails mute <email-key>
    wp blaminhor mute-emails unmute <email-key>

### Post Types Order
    wp blaminhor pto get
    wp blaminhor pto set --post-types=post,page --auto-sort=true
    wp blaminhor pto list-items page [--taxonomy]
    wp blaminhor pto reorder page --order=42,11,7
    wp blaminhor pto reset page [--taxonomy] [--yes]

### Redirections 301
    wp blaminhor redirections get
    wp blaminhor redirections set --log-redirects=true --case-insensitive=true
    wp blaminhor redirections add --source=/old --target=/new [--regex] [--porcelain]
    wp blaminhor redirections list [--search=<term>] [--active-only] [--format=ids]
    wp blaminhor redirections delete <id> [--yes]

### SEO/GEO
    wp blaminhor seo get
    wp blaminhor seo set --sitemap-enabled=true --ai-block-chatgpt=true --ai-block-claude=true
    wp blaminhor seo list-urls [--format=ids]
    wp blaminhor seo regenerate-sitemap
    wp blaminhor seo ping-engines

### SMTP Mailer
    wp blaminhor smtp get [--show-relays]
    wp blaminhor smtp set --from-email=hello@example.com --from-name="Hello" --enable-logging=true
    wp blaminhor smtp add-relay --name=Gmail --host=smtp.gmail.com --port=587 \
                                 --encryption=tls --from-email=hello@example.com \
                                 --username=foo --password="$SMTP_PASSWORD"
    wp blaminhor smtp list-relays
    wp blaminhor smtp delete-relay <index> [--yes]
    wp blaminhor smtp test [--to=admin@example.com]

### User Role Editor
    wp blaminhor ure list-roles
    wp blaminhor ure get-role <slug> [--granted-only]
    wp blaminhor ure get
    # Mutating roles: use core `wp role` and `wp cap` commands.

## Secrets handling

Pass credentials via environment variables when possible:

    BLAMINHOR_SMTP_PASSWORD='s3cret' wp blaminhor smtp add-relay --name=... --password=

The CLI never prints SMTP passwords in cleartext (masked as `***` in
`get --show-relays` and `list-relays`).

## Recommended setup playbook for a fresh install

    wp --user=admin blaminhor modules activate smtp
    BLAMINHOR_SMTP_PASSWORD="$SMTP" wp --user=admin blaminhor smtp add-relay \
      --name=Brevo --host=smtp-relay.brevo.com --port=587 \
      --encryption=tls --from-email=hello@example.com \
      --username=$SMTP_USER --password="$BLAMINHOR_SMTP_PASSWORD"
    wp --user=admin blaminhor smtp test
    wp --user=admin blaminhor modules activate seo-manager
    wp --user=admin blaminhor seo set --sitemap-enabled=true --ai-block-chatgpt=true
    wp --user=admin blaminhor modules activate https-redirect
    wp --user=admin blaminhor https-redirect enable --hsts=true
