Plugin: self-hosted auto-updates from Gitea via PUC (hc-8gb)

Vendors YahnisElsts/plugin-update-checker v5.7 under vendor/ and wires it
to poll updates.json on the repo main branch. WP surfaces new versions
via Dashboard → Updates on its normal twice-daily cadence.

PUC is vendored (not a submodule) so Gitea's archive/main.zip — the
download target — includes it. Folder rename on install is handled by
PUC's built-in upgrader_source_selection filter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 09:52:40 +01:00
parent 8e288e1ef6
commit 19d726fe1c
121 changed files with 9577 additions and 2 deletions

View File

@@ -33,3 +33,16 @@ require_once ATT_HC_PLUGIN_DIR . 'includes/report.php';
add_action('plugins_loaded', function () {
ATT_HC_Steps::instance()->discover(ATT_HC_PLUGIN_DIR . 'includes/steps/');
});
// Self-hosted updates from Gitea. Metadata JSON lives on the repo's main branch;
// PUC polls it twice a day and surfaces new versions via WP's normal update flow.
$att_hc_puc = ATT_HC_PLUGIN_DIR . 'vendor/plugin-update-checker/plugin-update-checker.php';
if (file_exists($att_hc_puc)) {
require_once $att_hc_puc;
\YahnisElsts\PluginUpdateChecker\v5\PucFactory::buildUpdateChecker(
'https://git.h12e.com/steve/wp-healthcheck/raw/branch/main/updates.json',
ATT_HC_PLUGIN_FILE,
'att-site-healthcheck'
);
}
unset($att_hc_puc);