Update URL Protocol
The update_url field in extension manifests declares an endpoint that the Pubvana auto-update system polls to check for newer versions of the extension. This endpoint is called AddonUpdateService and runs on admin pageload (if the pageload check setting is enabled) and via the marketplace:revalidate Spark command.
Standard Endpoint
For Pubvana Marketplace extensions, the standard endpoint is:
https://pubvana.net/api/dstore/v1/update/check
This is a POST endpoint. AddonUpdateService sends:
{
"type": "widget",
"current_version": "2.0.0"
}
Expected Response Format
Your update_url endpoint must return JSON with this structure:
{
"version": "2.1.0",
"download_url": "https://your-server.com/downloads/recent_posts-2.1.0.zip",
"changelog": "Fixed edge case with empty post lists. Added show_author option."
}
| Field | Type | Required | Description |
|---|---|---|---|
version |
string | yes | Latest available version (semver) |
download_url |
string | yes | Direct ZIP download URL |
changelog |
string | no | Plain text or markdown changelog for this version |
If no update is available (current version is the latest), return the current version and the current download URL. AddonUpdateService compares version against the installed version using semver comparison — it only triggers an update prompt when the returned version is strictly greater.
Hosting Your Own Update Endpoint
If you distribute extensions outside the Pubvana Marketplace, you can host your own update_url endpoint. Minimum requirements:
- HTTPS only
- Accepts POST requests with
application/jsonbody - Returns
Content-Type: application/json - Returns HTTP 200 on success; non-200 responses are treated as "no update available" (not errors)
Example minimal PHP implementation:
<?php
// update-check.php — hosted on your own server
header('Content-Type: application/json');
$body = json_decode(file_get_contents('php://input'), true);
$slug = $body['slug'] ?? '';
$versions = [
'my_widget' => [
'version' => '1.3.0',
'download_url' => 'https://yoursite.com/downloads/my_widget-1.3.0.zip',
'changelog' => 'Bug fixes and performance improvements.',
],
];
if (isset($versions[$slug])) {
echo json_encode($versions[$slug]);
} else {
echo json_encode(['version' => '0.0.0', 'download_url' => '']);
}
Setting update_url in Your Manifest
{
"name": "My Widget",
"version": "1.2.0",
"update_url": "https://yoursite.com/update-check.php",
...
}
Update Flow
When AddonUpdateService detects that version > installed_version:
- An update notification is inserted into
admin_notifications(visible in the admin header) - The admin visits Marketplace and sees the "Update Available" badge on the extension
- Clicking "Update" calls
MarketplaceService::installFree($download_url)with the URL from the update response - After download and extraction,
discover()+sync()are run to register the new version - Any new migrations are run automatically
For premium extensions, installLicensed() is called instead, re-validating the license before downloading.