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).
How a site checks for updates
Section titled “How a site checks for updates”The Corex Core plugin declares an Update URI header, so WordPress routes its update check to Corex
instead of wordpress.org. On each check:
- Corex reads
updates.endpointfrom config. - It fetches that URL (
wp_remote_get) and reads the JSON manifest. - A pure
UpdateCheckerasks: is the manifest’sversionnewer than the installed one (semver)? - 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).
Configure the endpoint
Section titled “Configure the endpoint”# .env (project root)UPDATES_ENDPOINT=https://updates.example.com/corex/manifest.jsonOr the WordPress option corex_updates_endpoint (.env wins over it). No settings screen has a field
for it:
wp option update corex_updates_endpoint https://updates.example.com/corex/manifest.jsonThe 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.
Publish a release
Section titled “Publish a release”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.
The safe-edit boundary
Section titled “The safe-edit boundary”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 installed | brand.json — your brand tokens |
packages/* framework libraries | Database content — posts, pages, options |
| The theme scaffold/tokens shipped by Corex | Your 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.
See also
Section titled “See also”- Apply a brand — the
brand.jsonlayer that updates never touch. - The CLI —
wp corex resetreturns a site to a clean Corex starter (separate from updates).