Closed bymem closed 1 year ago
That particular filter only applies to update information requests. It doesn't do anything for downloads. So the key isn't being removed - it's not getting added in the first place.
There are multiple ways you could modify the download URL. One option would be to use the pre_inject_update
filter. It runs just before the update checker inserts the update into the internal update list that's used by WordPress core.
Here's a basic example (not tested):
$bonzaiUpdateChecker->addFilter('pre_inject_update', 'example_callback');
function example_callback($updateInfo) {
if ( !empty($updateInfo->download_url) ) {
$updateInfo->download_url = add_query_arg('license_key', 'abcdef', $updateInfo->download_url);
}
return $updateInfo;
}
Thank you so much that really did the trick, that could be a good add on to you'r already great tourial. Thank you so much the help.
Hi.
I'm trying to implement a license checker in the use of the wp-update-server, and i followed the epic torturial on securing your download links. And most of it seems to be working.
But i'm running into the problem that it seems like the license key is removed at the download request. I'm checking the request log, where i can see that the license key is being added at the get_metadata request, but when the download request is sent the license is not present.
this is the request log: