| Property | Value |
|---|---|
| Plugin name | Plugin Update Checker |
| Plugin ID | net.michalski:update-check |
| Composer package | mmd/osticket-plugin-update-check (type osticket-plugin) |
| Plugin class | UpdateCheckPlugin in class.UpdateCheckPlugin.php |
| Configuration class | UpdateCheckConfig in config.php |
| Instances | Singleton, created automatically when enabled |
bootstrap() only does work when the requested script is plugins.php, that is on the plugin list of the Admin Panel. AJAX requests (X-Requested-With: XMLHttpRequest) are ignored.UpdateCheckPlugin reads the settings from the first active instance.PluginUpdateCollector goes through all plugins known via PluginManager::allInstalled() and reads their metadata with PluginManager::getInfoForPath().GitHubReleaseChecker fetches the latest release, first from the cache, otherwise from GitHub.AssetInjector inserts the CSS before </head> and the update data plus JavaScript before </body>.ids[] checkbox (its value is the plugin ID) and appends the badge to the third column, the version column.If there is no update, the page stays unchanged and nothing is inserted.
Every installed plugin whose plugin.php names a GitHub repository in the url field is checked. This applies to plugins by any developer, including the Plugin Update Checker itself.
https://github.com/owner/repo, http://github.com/owner/repo and github.com/owner/repo, each with an optional .git and an optional trailing slash./tree/main) are not recognized.owner/my.plugin is skipped.releases/latest.version from the checked plugin's metadata.A leading v is removed from the tag name and from the installed version. Then PHP version_compare() decides: a badge appears only if the release version is greater than the installed one. Equal or older versions and empty values produce no badge. Pre-release suffixes get no special treatment, they follow the rules of version_compare().
| Case | Duration | Content |
|---|---|---|
| Successful lookup | Setting Cache Duration (hours), default 6 hours | tag_name and html_url of the release |
| Error or no release | fixed 1 hour | Marker none |
osticket-update-check in the PHP temp directory (sys_get_temp_dir()), created with permissions 0755.github_release_<owner>_<repo>.json, with the fields expires_at and data. The token is not part of the cache.| Property | Value |
|---|---|
| URL | https://api.github.com/repos/<owner>/<repo>/releases/latest |
| Method | GET, via cURL |
| Headers | Accept: application/vnd.github.v3+json, User-Agent: osTicket-Plugin-UpdateChecker/..., optional Authorization: Bearer <token> |
| Timeout | 5 seconds total and 5 seconds for connecting |
| Redirects | up to 3 |
| TLS | certificate and host name are verified |
The requests run one after another while the plugin list page is built. With a cold cache and GitHub unreachable, the load time can grow by up to 5 seconds per checked plugin. After that the plugin remembers the failure for one hour. What data goes to GitHub is described under Privacy.
The plugin's CSS and JavaScript live in the assets/ folder and are written inline into the page instead of being linked as external files. This needs no web server change. The update data is available as JSON in window.__pluginUpdates.
The badge is a link whose text is the new version. It leads to the release page on GitHub, opens in a new tab (rel="noopener noreferrer") and has the tooltip Update available: v<version>. The script also registers on pjax:end so the badges are set again after PJAX navigation.
JSON_HEX_TAG and JSON_HEX_APOS so it cannot close a script tag.http: or https:, and writes the values via textContent.data-plugin="update-check" prevents double insertion.[UpdateCheck] Asset injection failed to the PHP error log.include/plugins/update-check/
+-- plugin.php Plugin metadata
+-- class.UpdateCheckPlugin.php Plugin class
+-- config.php Configuration form
+-- src/
| +-- AssetInjector.php Inserts CSS/JS into the output buffer
| +-- FileCache.php File-based cache with expiry
| +-- GitHubReleaseChecker.php URL detection, GitHub query, version comparison
| +-- PluginUpdateCollector.php Walks the installed plugins
+-- assets/
| +-- update-badges.css Badge style
| +-- update-badges.js Places badges into the table
+-- vendor/ Composer autoloader (after composer install)