Skip to content
Corex

Updates & distribution

Corex updates the way WordPress plugins update: a site checks a source you control, and when a newer release is published it appears in Plugins → Updates in wp-admin — one click to install. Corex never phones home unless you configure a source (spec 034).

The Corex Core plugin declares an Update URI header, so WordPress routes its update check to Corex instead of wordpress.org. On each check:

  1. Corex reads updates.endpoint from config.
  2. It fetches that URL (wp_remote_get) and reads the JSON manifest.
  3. A pure UpdateChecker asks: is the manifest’s version newer than the installed one (semver)?
  4. If yes, a standard plugin-update object is injected into WordPress’s update transient — the update shows in wp-admin like any plugin, and WP’s own updater installs the package.

Fail-safe. An empty, unreachable, error, or malformed source is a silent no-op — the site reports no update. A broken update source can never break a site (constitution Principle IX: the source is optional config, never a hard dependency).

# .env (project root)
UPDATES_ENDPOINT=https://updates.example.com/corex/manifest.json

Or the WordPress option corex_updates_endpoint (.env wins over it). No settings screen has a field for it:

Terminal window
wp option update corex_updates_endpoint https://updates.example.com/corex/manifest.json

The shipped default is empty, so a fresh install never checks any remote source until you opt in.

The project root is the repository only where corex-core is linked into WordPress. Where the plugin is copied into wp-content/plugins/, as in the shared-host package, it is wp-content/, inside the web root: set the option there and do not create a .env. See Settings & feature flags.

Host two artifacts where your sites can reach them (a static host, S3/CloudFront, or GitHub Releases):

1. The package — a zip of the framework plugin at the new version (plugin folder at the zip root), built from a clean release tag.

2. The manifest — a small JSON document:

{
"version": "0.22.0",
"package": "https://github.com/MustafaShaaban/corex/releases/download/v0.22.0/corex-core.zip",
"url": "https://github.com/MustafaShaaban/corex/releases/tag/v0.22.0",
"requires": "7.0",
"tested": "7.0"
}

An update is offered only when version is newer than the installed version. Point package/url at the new tag, upload, and every site with updates.endpoint set surfaces the update on its next check.

This contract is what makes updating safe. An update is a plugin reinstall: WordPress replaces the framework plugin’s files and nothing else.

Updated by an update (framework)Never touched (yours)
plugins/corex-* (Core, Blocks, Forms, Config…)corex-app/ — your application code
Framework add-ons you installedbrand.json — your brand tokens
packages/* framework librariesDatabase content — posts, pages, options
The theme scaffold/tokens shipped by CorexYour data — custom tables, form submissions

Why your work survives: everything you author lives outside the framework plugins — code in corex-app/, identity in brand.json (deep-merged over the theme tokens), content/data in the database. An update swaps framework files underneath that boundary; your layer sits on top, untouched.

Stay upgrade-safe: never edit framework files in place. Extend through the seams (service providers, config overrides, brand.json, child customizations) — anything you change inside a framework plugin is what an update overwrites.

  • Apply a brand — the brand.json layer that updates never touch.
  • The CLI — wp corex reset returns a site to a clean Corex starter (separate from updates).