Package specification
Every ShopClass plugin and theme declares itself in a comment block at the top
of its index.php. Core parses that block to show the package in the admin
list; the registry parses the same block to publish it. One declaration, two
readers, no way for them to disagree.
This page is the practical summary. The normative version (with the parser’s
exact behaviour, the manifest schema and the PR validation rules) is
docs/PACKAGE-SPEC.md
in the repository.
The header block
Section titled “The header block”A plain PHP comment, immediately after <?php:
<?php/*Plugin Name: Digital GoodsPlugin URI: https://github.com/mindstellar/shopclass-plugin-digital-goodsDescription: Attach downloadable files to a listing and deliver them to buyers.Version: 2.0.0Author: MindstellarAuthor URI: https://github.com/mindstellarShort Name: digital-goodsRequires Shopclass: 6.0.0Tested up to: 6.4Requires PHP: 8.0Support URI: https://github.com/mindstellar/shopclass-plugin-digital-goods/issues*/Plugin fields
Section titled “Plugin fields”| Field | Required | Notes |
|---|---|---|
Plugin Name |
yes | Human-readable. Falls back to the filename. |
Description |
yes | One line. Long prose belongs in README.md. |
Version |
yes | See versioning. |
Author |
yes | |
Short Name |
recommended | Should equal your slug. Defaults to Plugin Name. |
Plugin URI |
recommended | Homepage. |
Support URI |
recommended | Rendered as the support icon in the admin list. |
Requires Shopclass |
recommended | Minimum core version. |
Tested up to |
optional | Highest core version you have verified. Shown for information only; core never warns or blocks on it. |
Requires PHP |
recommended | Minimum PHP version. |
Modes |
optional | Site types it works for: classifieds, shop. Absent means classifieds. |
Requires Plugins |
optional | Plugins it needs, such as stripe >=1.2.0, digital-goods. |
Author URI |
optional | |
Plugin update URI |
optional | Legacy self-hosted updates: see auto-update. |
Theme fields
Section titled “Theme fields”Same idea, different names, because theme parsing is a separate function:
| Field | Required | Notes |
|---|---|---|
Theme Name |
yes | |
Description |
yes | |
Version |
yes | |
Author |
yes | |
Theme URI |
recommended | |
Requires Shopclass |
recommended | |
Tested up to |
recommended | |
Parent Theme |
optional | Slug of the theme this one extends. See Child themes. |
Widgets |
optional | Comma-separated widget location ids. |
Modes |
optional | Site types it works for: classifieds, shop. Absent means classifieds. |
Requires Plugins |
optional | Plugins the theme needs. Activating the theme offers to install and activate them. |
Author URI |
optional | |
Theme update URI |
optional | Legacy self-hosted updates. |
Modes and required plugins
Section titled “Modes and required plugins”The site owner picks a site type in Settings → General: classifieds or shop. A theme or plugin that does not declare that type gets a warning there.
A package in the catalog can say the same in shopclass.json, which wins over the header:
{ "modes": ["shop"], "plugins": { "required": { "stripe": ">=1.2.0" }, "recommended": { "digital-goods": "*" } }}A theme’s required plugins are installed and activated from one screen before the theme goes
live. Recommended ones can be skipped. A plugin cannot be turned on while one of its required
plugins is missing, off, or the wrong version. A plain list such as ["stripe"] accepts any
version. A bad slug is ignored, and bad JSON reads as if the file had no modes or plugins.
A shop theme with its own order page names it in order_url, with {id} where the order
number goes. Order e-mails then link to it. It is a path on the site, or a full https://
address for a front end on another site:
{ "order_url": "orders/{id}"}When the page has a friendly address only with friendly URLs on, give the plain one in
order_url and the friendly one in order_url_friendly. Core uses the friendly one when
friendly URLs are on, also in e-mails sent from the admin:
{ "order_url": "index.php?page=custom&route=shop-order&id={id}", "order_url_friendly": "orders/{id}"}Versioning
Section titled “Versioning”Use MAJOR.MINOR.PATCH. Core compares versions to decide whether an update is
available, so a version that does not sort meaningfully will not update
correctly on people’s sites.
Requires Shopclass and Requires PHP decide whether an install offers your
package at all. Set Requires Shopclass to the oldest core version you actually
support, not the newest one you happen to run.
The compatibility badge
Section titled “The compatibility badge”Every package card in the admin carries one short verdict about that install. These are the four, and what earns each:
The checks run in this order, and the first one that matches wins:
| Badge | When | What to do |
|---|---|---|
| Needs 6.5 or newer | Requires Shopclass is above this install |
nothing: the site must upgrade first |
| Needs PHP 8.2 | Core is fine, but Requires PHP is above this server |
nothing: the server must upgrade first |
| Works with 6.4 | It runs here | nothing: this is the goal |
| No version declared | You declared neither Requires Shopclass nor Requires PHP |
declare at least Requires Shopclass |
An older Tested up to does not change the badge, so you do not re-release a
package only because core moved on.
The catalog uses the same first two checks when it picks which of your releases
an install is offered: the newest one whose Requires Shopclass and
Requires PHP that site satisfies. So an old release stays reachable for old sites.
Language packs
Section titled “Language packs”A language pack declares itself in its locale.json, and the repository’s
locale_list.json carries one entry per pack with the same fields. Two of them
are checked the way plugin headers are:
| Field | Meaning |
|---|---|
requires |
Oldest Shopclass the pack works with, e.g. "7.1.0". A 7.1.0 rc or beta counts as 7.1.0. |
requires_php |
Oldest PHP it works with. |
A pack with neither is offered everywhere. One that does not fit is shown greyed out on Settings → Languages with the reason, is left out of the update count, and is refused if someone tries to install it anyway.
A locale_list.json entry may also carry versions: older or newer builds of
the same pack, each with its own version, requires, requires_php and
path (the repository folder holding its files; src/translations/<code>/ when
left out). A site takes the newest of the entry and its versions that fits.
Cores before 7.0.24 and 7.1.2 ignore versions and use the plain entry, so keep
it working for them.
{ "locale_code": "fr_FR", "name": "French (France)", "version": "1.0.154", "versions": [ { "version": "2.0.3", "requires": "7.1.0", "requires_php": "8.2", "path": "src/7.1/translations/fr_FR/" } ]}Artwork
Section titled “Artwork”| Asset | Plugin | Theme | Spec |
|---|---|---|---|
| Icon | assets/icon.svg or assets/icon.png |
None | Square. SVG preferred; PNG at 256×256. |
| Screenshot | assets/screenshot-1.png, … |
screenshot.png at the package root |
4:3, minimum 1200×900. |
The theme screenshot sits at the package root because that is where a decade of themes already put it, and where core looks.
Artwork is optional. Core renders a built-in placeholder for any package without it (a neutral, theme-aware tile tinted from a hash of the slug), so a grid of unillustrated packages still reads as distinct tiles rather than broken images. Do not ship a blank or a “no image” graphic of your own; the fallback is better than one.
Screenshots must show the package’s real interface. No marketing copy, no logos-on-gradients, no before/after collages.
Getting listed
Section titled “Getting listed”Publishing to every install goes through the registries: see the market.