Skip to content

Cli And Deploy

WP-CLI Batch Scripts for Multi-Site Operations

Moved to sops/wp-cli-batch-scripts.md on 2026-05-20 — see SOP for the full procedure.


DearFlip (dflip) Flipbook CPT thumbnails are client-side — WP-CLI bulk creation skips the auto-thumb step

From legacy section: SEO NEO / Workbook

Pattern: DearFlip's "auto thumbnail from PDF page 1" only fires when the Flipbook post is saved through the admin UI: the JS reads page 1 with pdf.js in the browser and submits a base64 JPEG via the metabox form. The server-side process_thumb() in inc/metaboxes.php only writes a file when the inbound pdf_thumb is a data:image/jpeg;base64,... payload. Bulk-creating Flipbook posts via WP-CLI (wp post create --post_type=dflip + update_post_meta('_dflip_data', ...)) doesn't go through any browser, so no thumbnail gets generated — every shelf thumb on the resulting page renders as a missing image. Rule: Any pipeline that mass-creates DearFlip Flipbook posts must extract page-1 covers itself and place them at /wp-content/uploads/dflip-thumbs/{POST_ID}.jpeg AND set _dflip_data['pdf_thumb'] to the URL https://{site}/wp-content/uploads/dflip-thumbs/{POST_ID}.jpeg?{timestamp} (the ?{timestamp} cache-buster matters — DearFlip uses it). Cover extraction one-liner: gs -sDEVICE=jpeg -dJPEGQ=90 -r150 -dFirstPage=1 -dLastPage=1 -sOutputFile=cover.jpg input.pdf. Use set_url_scheme(content_url(...), 'https') not content_url() — the latter sometimes returns http:// on multisite/HTTPS-mixed installs. Reference implementation: clients/_active/empire-media-network/build/bulk-flipbooks.php. Date: 2026-04-28


For 5+ WordPress pages of the same change, use WP-CLI eval-file over SSH — not MCP calls

Moved to sops/wp-cli-batch-scripts.md on 2026-05-20 — see SOP for the full decision tree and commands.