Skip to main content

Ship a Plugin ZIP

When a LocalWP Devkit project is ready to deliver, build a project plugin ZIP from the devkit root:

bun run build:zip -- --project <slug>

The command runs the project check before packaging. If the check fails, fix the project and rerun the command.

Output​

The ZIP is written inside the project, and the command prints its deploy digest:

Built: .../projects/<slug>/dist/oh-my-idetch-<version>.zip
Deploy digest: sha256:...

The ZIP root is:

oh-my-idetch/

This is the runtime plugin artifact for that project.

What Goes Into the ZIP​

The project ZIP contains the runtime plugin surface:

IncludedPurpose
oh-my-idetch.phpWordPress plugin entry file.
src/**Project runtime PHP source.
cms/acf-json/**Project CMS field JSON when present.
vendor/**The project's locked PHP dependencies, including the Builder package.
wpml-config.xmlWPML configuration that keeps the Builder's ownership details off translations.
flags.jsonProduction mode marker (MODE: PROD) and the build's DEPLOY_DIGEST.

The deploy digest is a fingerprint of what the ZIP contains: the plugin entry file, src/**, cms/acf-json/**, and the locked etch-builders version. Rebuilding an unchanged project gives the same digest.

The ZIP does not include devkit tooling, project notes, tests, generated agent skills, local environment files, Local site backups, Local Blueprints, or premium plugin files.

Before You Ship​

Run the normal LocalWP verification loop first:

bun run project:check -- --project <slug>
bun run localwp:sync -- --project <slug>
bun run localwp:verify -- --project <slug>
bun run localwp:doctor -- --project <slug>
bun run localwp:capabilities -- --project <slug>

Then verify the site in LocalWP using the bound Local site address. For WooCommerce, facets, dropdowns, drawers, checkout gateways, or other interactive OhMyEtch behavior, browser/runtime verification is required; the project ZIP command only proves the package can be built from checked source.

Going Live​

LocalWP stays the place where you build, check, sync, and verify code changes. Staging and production only ever receive the plugin ZIP.

How a Live Site Registers a ZIP​

  • Each new build registers itself once. On a live site the plugin registers the project's code-owned content once per deployed build (plugin version plus deploy digest). Uploading a ZIP with a new digest registers on the next WordPress request, whether that is a page view, WP-CLI, cron, or REST. An unchanged rebuild does not register again.
  • No manual step. Do not delete any option by hand after a deploy; that was the Devkit 1.0.x deploy step. A site upgraded from a 1.0.x ZIP registers once after the upgrade. This applies once the project carries the Devkit 1.1.0 project files: a project created with Devkit 1.0.x and not migrated still behaves the old way, and localwp:doctor warns project Plugin.php predates the deploy-keyed production lock until it is migrated.
  • Failures back off. A failing registration waits 15 minutes before trying again instead of rerunning on every page. When another update holds the Builder's site lock, it tries again after about a minute without logging anything. Each attempt writes a single [OhMyIDEtch] Production site registration failed ... line to the PHP error log and keeps the list of failing items. A registration that crashes, for example because only some project files were updated, counts as a failed attempt (OMIDE_SITE_REGISTRATION_EXCEPTION) instead of breaking every page. The plugin shows no admin notice.
  • Reading settings. Each registration also applies the project's reading settings. With the starter settings, the first registration that finds the project home page makes it the static front page (once per site), every registration resets the posts page to none, and plain permalinks become /%postname%/. If the live site needs a posts page, change the project's reading settings first.

Workflow​

  1. On LocalWP, project:check, localwp:sync, and localwp:verify all pass.

  2. Build the ZIP with bun run build:zip -- --project <slug> and note the printed deploy digest.

  3. On the first launch, move the site data that is not code-owned (posts, media, users, WooCommerce data, plugin settings) with your usual migration tool. The ZIP carries only code-owned site content, styles, and ACF JSON.

  4. Upload the ZIP on staging first (Plugins > Add New > Upload Plugin, replacing the current version), then load one page.

  5. Check the registration with WP-CLI on that server:

    wp oh-my-idetch registration status

    current: true with a deploy_key that ends in the printed digest means this build is registered. backing_off: true means it failed; last_failure lists each failing item and its Builder code.

  6. Fix a failure at its source. Usually that is a code change and a rebuilt ZIP, which registers at once without waiting. When the cause was on the site, for example a conflicting page you removed in wp-admin, retry immediately instead of waiting 15 minutes:

    wp oh-my-idetch registration retry
  7. Repeat steps 4 to 6 on production with the same ZIP.

Content Ownership on a Live Site​

A live site follows the same ownership rules as localwp:sync; see Content Ownership. What differs on the server:

  • Code wins on every new deploy for code-owned content, so wp-admin edits to it are replaced (WordPress keeps a revision). Mark content that editors should own with hand_over_after_create() before you deploy it.
  • Adoption with adopt_existing() takes over a matching wp-admin page on the first registration of the deploy that carries it. Back up the production database before that upload.
  • Conflicts fail the registration, which then backs off: a page someone else created with the same slug, or ETCH_SITE_PERSISTENCE_HANDED_OVER_RECLAIM_REQUIRED for handed-over content that the code manages again. Fix it in code (rename the slug, adopt_existing(), or reclaim_from_editors()) and upload a new ZIP. When the fix is on the site, such as a restored page, run wp oh-my-idetch registration retry.
  • Notices never fail the registration. Content removed from code and style copies made in the Etch editor are kept with the last registration: wp oh-my-idetch registration status lists them under last_notices, and the registration's single PHP error log line counts them.
  • There is no retire command on a live site. Content removed from code stays published there; --retire-orphans only changes the LocalWP site. Move such pages to draft or delete them in wp-admin after the deploy.

Multilingual Sites (WPML)​

The ZIP ships wpml-config.xml, which keeps WPML from copying the Builder's ownership details to translations, and the Builder never writes to a translation. This has not been tested on a live WPML site yet. After the first deploy to a WPML site, check that wp oh-my-idetch registration status reports current: true and that translated pages still show their own content.

Keep the Devkit​

Do not duplicate the whole devkit for every site. Keep the devkit as the long-lived workspace and create a new projects/<slug> folder for each site. Each project can build its own deployable plugin ZIP.