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] Deprecation notice for authentication via URL query parameters #384

Closed jeremycaris closed 4 years ago

jeremycaris commented 4 years ago

I can't find any existing issues addressing this. I'm getting this "Deprecation notice for authentication via URL query parameters" email from Github:

"your personal access token (my-theme-name) using WordPress/5.4.2; http://my-website-url.com was used as part of a query parameter to access an endpoint through the GitHub API: ... Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation. ... Visit https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param for more information about suggested workarounds and removal dates."

Here's how I'm using PUC:

require 'sofw/checker/plugin-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
    'https://github.com/my-account/my-theme-name/',
    __FILE__,
    'my-theme-name'
);
$myUpdateChecker->setAuthentication('my-auth-token');
$myUpdateChecker->getVcsApi()->enableReleaseAssets();

My theme updates fine, as it always has, but I'm getting the "Deprecation notice for authentication via URL query parameters" from GitHub regularly. It seems that a PUC update will be required to resolve this. Please advise.

YahnisElsts commented 4 years ago

Hmm, I thoughtI fixed that issue a while ago. Do you have the latest version of PUC? If you do, could it be that one of your users is still using an older version of your theme that includes an outdated version of PUC?

jeremycaris commented 4 years ago

I've had PUC 4.9 installed for quite a while. But, yes it is possible that the site is still running an older version of the theme which may have an older version of PUC. I will update you asap.

jeremycaris commented 4 years ago

That's what the issue was... they were running an outdated version of the theme with PUC 4.7. I don't know why I didn't check that first. Thanks for the help! And thanks for PUC!