Skip to content

feat: GitHub updater — WordPress plugin update notifications from GitHub Releases - #36

Merged
welbinator merged 1 commit into
developfrom
feature/github-updater
Feb 25, 2026
Merged

feat: GitHub updater — WordPress plugin update notifications from GitHub Releases#36
welbinator merged 1 commit into
developfrom
feature/github-updater

Conversation

@welbinator

Copy link
Copy Markdown
Owner

Summary

Adds a GitHub Releases-based update system so WordPress notifies site owners when a new LearnKit version is available — enabling one-click updates directly from the Plugins page.

How it works

  1. Hooks into pre_set_site_transient_update_plugins to check the GitHub API for a newer release
  2. If a newer version exists, injects the update data into the WP update transient
  3. Also hooks plugins_api to populate the "View version details" modal with release notes/changelog
  4. Results are cached in a 12-hour transient to avoid hammering the API; cache is busted after a successful update

Improvements over prior art

Area Improved
Caching 12-hour transient; busted after update
Error handling Validates HTTP status code + response shape, not just is_wp_error
Asset selection Loops assets for application/zip; falls back to GitHub's auto-generated tag zip
Plugin info popup plugins_api filter populates "View details" modal with changelog
Debug noise No error_log() calls left in
User-Agent Proper WordPress/X.X; home_url() format
GitHub API version Sends X-GitHub-Api-Version: 2022-11-28 header
Security download_url sanitized with esc_url_raw() before storing

Files changed

  • includes/class-learnkit-github-updater.php — new updater class
  • learnkit.php — require the updater

@welbinator
welbinator merged commit aa72855 into develop Feb 25, 2026
2 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant