Recovery plugin: folder-agnostic detection + one-click install from Gitea
Detection (recovery-bootstrap.php): - Match on plugin Name + Author instead of hard-coded folder slug, so the recovery plugin is found regardless of whether it was unpacked as site-recovery/, wp-site-recovery/, or anything else. One-click install (recovery-installer.php — new): - Pulls site-recovery from a private Gitea repo via the standard archive endpoint with token auth. - Ref resolution order: latest release → latest tag → main branch HEAD. Lets us tag pinned releases in Gitea later without changing code. - upgrader_source_selection filter forces the unpacked folder name to 'site-recovery' regardless of the gitea wrapper-folder suffix. - Config from constants in wp-config.php (WPH_GITEA_HOST/OWNER/REPO/TOKEN) beats DB option storage. Constants are visually locked in the settings UI so admins can see they're inherited. Settings page (hidden submenu, reachable at Tools → Site Healthcheck → 'Configure gitea source'): - Host / Owner / Repo / Token fields - Inline 'Install now' button when configured + plugin not installed Bootstrap status panel: - Shows the recovery plugin's actual file path when active - 'Install from gitea (latest)' button when configured + missing - 'Configure gitea source' button when not configured + missing Install handler shows a success message via transient on the main healthcheck page after a successful install + activate.
This commit is contained in:
@@ -24,6 +24,7 @@ require_once WPH_PLUGIN_DIR . 'includes/class-wph-step.php';
|
||||
require_once WPH_PLUGIN_DIR . 'includes/class-wph-steps.php';
|
||||
require_once WPH_PLUGIN_DIR . 'includes/class-wph-session.php';
|
||||
require_once WPH_PLUGIN_DIR . 'includes/recovery-bootstrap.php';
|
||||
require_once WPH_PLUGIN_DIR . 'includes/recovery-installer.php';
|
||||
require_once WPH_PLUGIN_DIR . 'includes/admin-page.php';
|
||||
require_once WPH_PLUGIN_DIR . 'includes/report.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user