Update bundled plugin-update-checker to v5.7 and remove broken setBranch() call
The bundled PUC was missing the setBranch() method on the main UpdateChecker class (it's only on Vcs\PluginUpdateChecker via the VcsCheckerMethods trait). When called with a non-VCS URL like the Gitea update URL, this caused a fatal error at plugin activation. Updating to PUC v5.7 (May 2026) which is the latest upstream release. The setBranch() call is removed because PUC doesn't recognize Gitea as a VCS host; the plugin falls back to PUC's plain JSON metadata mode, which is fine for a plugin hosted on a self-managed repo.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace YahnisElsts\PluginUpdateChecker\v5p7;
|
||||
|
||||
use YahnisElsts\PluginUpdateChecker\v5\PucFactory as MajorFactory;
|
||||
use YahnisElsts\PluginUpdateChecker\v5p7\PucFactory as MinorFactory;
|
||||
|
||||
require __DIR__ . '/Puc/v5p7/Autoloader.php';
|
||||
new Autoloader();
|
||||
|
||||
require __DIR__ . '/Puc/v5p7/PucFactory.php';
|
||||
require __DIR__ . '/Puc/v5/PucFactory.php';
|
||||
|
||||
//Register classes defined in this version with the factory.
|
||||
foreach (
|
||||
array(
|
||||
'Plugin\\UpdateChecker' => Plugin\UpdateChecker::class,
|
||||
'Theme\\UpdateChecker' => Theme\UpdateChecker::class,
|
||||
|
||||
'Vcs\\PluginUpdateChecker' => Vcs\PluginUpdateChecker::class,
|
||||
'Vcs\\ThemeUpdateChecker' => Vcs\ThemeUpdateChecker::class,
|
||||
|
||||
'GitHubApi' => Vcs\GitHubApi::class,
|
||||
'BitBucketApi' => Vcs\BitBucketApi::class,
|
||||
'GitLabApi' => Vcs\GitLabApi::class,
|
||||
)
|
||||
as $pucGeneralClass => $pucVersionedClass
|
||||
) {
|
||||
MajorFactory::addVersion($pucGeneralClass, $pucVersionedClass, '5.7');
|
||||
//Also add it to the minor-version factory in case the major-version factory
|
||||
//was already defined by another, older version of the update checker.
|
||||
MinorFactory::addVersion($pucGeneralClass, $pucVersionedClass, '5.7');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user