GitHub Updater & GitLab

GitLab Support

I’ve finally been able to add support for GitLab in the GitHub Updater v4.5.0. Additionally, support for GitLab CE and GitLab Enterprise are also included. All that’s required is an additional header with the base URI for the GitLab server. As an example, GitLab CE: https://gitlab.example.com or GitLab Enterprise: https://gitlab.example.com.

Extras for GitHub

Support for GitHub Enterprise is also included using a similar header, GitHub Enterprise: https://github.example.com.
Support for updating from GitHub assets is also included if an asset exists for a tagged release. It will be preferentially used for the update. Using an asset’s URI for the remote installation of a plugin or theme will also function as expected.

Under the Hood

A bit of refactoring has been done as well. An abstract class API has been created to simplify the structure of all the git server API classes. Additionally a class Messages has been created to hold admin notices.
The class Base has been refactored to hold information regarding the added APIs in static arrays for use throughout the codebase.
I hope everyone likes the changes and updates. As always, if there are problems or improvements, please create an issue on GitHub.
Thanks.

Smash API Rate Limit & More

So GitHub Updater just received a couple of new features in version 4.3.0.
At the suggestion of @mlteal, there is now a setting to add a personal GitHub Access Token. You must at least select public_repos. What this does is blast away the limit of 60 API calls per hour and raises it to 5000 API calls per hours. If you need more than than I’ve got nothing more for ya. :smiley:
At the suggestion of our friends at Pods I’ve added the ability to switch between branches of a plugin. You must ensure that all branches have the appropriate headers otherwise you may find yourself unable to update. :frowning:
@szepeviktor has been driving me to fix a number of things including now having View details available on the plugins page.

GitHub Updater and Error Messages

GitHub Updater now gives some feedback when the API responds with an error. What I’ve done is capture the HTTP error code and add that to an admin_head hook.
I’ve also included some data if the error is the result of banging against GitHub API’s rate limit for unauthenticated accesses.

Error Codes

As these are HTTP response codes it’s pretty simple to figure out. A 401 means that the authorization is incorrect.

  • For Bitbucket repos this can mean not having read access to the repository or having an incorrect user/pass entered in the Settings.
  • For GitHub repos it can mean using an Access Token for a public repository or having the incorrect Access Token for a private repository.

A 403 error usually means that you have surpassed GitHub API’s rate limit for unauthenticated access of 60 per hour or you have not included an Access Token for a private GitHub repository.
If you have knocked up against the rate limit, the error will tell you when your rate limit will be reset.
GitHub Updater error message