Publishing to the plugin shop
The plugin shop (Settings → Plugins → Plugin shop) lists community plugins. Every Hub reads the official shop by default, and the people who run a Hub install plugins from it with one click; then everyone on that Hub chooses which ones to turn on.
How the shop works
- The official shop is hosted by the official Hub, which sets
PLUGIN_SHOP_URLto'self'. It keeps each plugin's newest version indata/shop/and counts downloads. - Every other Hub reads its catalog at
https://<official hub>/app/api.php?action=shop_catalog(the defaultPLUGIN_SHOP_URL). A Hub can point at another catalog, or host its own with'self'. - Installing downloads the ZIP, checks its SHA-256 against the catalog, unpacks only plugin files, and runs the same checks as a plugin uploaded by hand. A plugin someone installed by hand is never replaced by the shop.
Publishing a plugin
Write and test your plugin first: the plugin guide has everything. Then, on the Hub that hosts the shop:
php tools/shop-publish.php path/to/your-plugin --tags=fun,games --homepage=https://example.com/your-plugin
You can pass the plugin's folder (it's zipped for you) or a .zip. To publish an update, raise "version" in plugin.json and publish again: each version can only be published once, and only the newest is offered.
php tools/shop-publish.php --list what's in the shop, with download counts
php tools/shop-publish.php --remove=my-plugin take a plugin out (Hubs that installed it keep their copy)
Publishing from inside the app is coming: the publishing code (shop_publish() in lib/plugins.php) already checks ownership, so only a plugin's first publisher can publish its new versions.
What a published plugin must have
- A valid
plugin.json(id, name, version, main), exactly as for any plugin. - Only plugin files:
js,css,json,md,txt, images, fonts and sounds. Up to 3 MB zipped and 6 MB unpacked. homepage, if you give one, must be anhttps://link. Linking to the plugin's source helps people trust it.
Catalog format
A shop catalog is JSON with a plugins list. Each entry has id, name, version, author, description, homepage, tags, download (where its ZIP is) and sha256 (the SHA-256 of that exact ZIP). The official shop adds downloads and updated. plugin-shop.example.json is a complete example if you'd rather host a static catalog.