YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.22k stars 403 forks source link

GitHub API returns 404 for all requests #523

Closed swinggraphics closed 1 year ago

swinggraphics commented 1 year ago

Releases and tags are empty—I'm using master—so I don't know what those status codes should be, but master should definitely be working, as well as Request Info from the Metadata URL in Debug Bar. The URL is correct (https://api.github.com/repos/Organizationname/repo-name/branches/master) and the access token is good. The access token has "Full control of private repositories" and works in the Git Updater plugin. How shouuld I try to troubleshoot this?

YahnisElsts commented 1 year ago

When you say that the URL is correct, do you mean that you see the update checker making requests to that URL, or that it is the URL you have set as the metadata URL for the update checker? The first would be correct, but the second would be a mistake: the update checker should be given the repository URL, not an API URL.

In general, to debug something like this, I would want to log HTTP requests (with headers) and see the full response from GitHub API.

swinggraphics commented 1 year ago

I have the access token saved in an option. Turned out there was an error elsewhere in the plugin that was preventing that from being read. 🙄 All good now! Works beautifully. Thank you for this, and thank you for responding and wanting to help @YahnisElsts!