Error code when ZIP is not downloaded
-
Hi David,
I’ve received a good number of support requests saying that “they cannot update the add-on”, as a general error is displayed, saying that the ZIP is not valid.
I checked the cause of that, and in
Updraft_Manager_Plugin
, thepinfo_download
method justdie
s if there is no valid license or the license has expired.So on the website requesting to download the ZIP, this results in an empty file but with a valid header (200).
Is there any reason for not setting a different header, like is done in the other checks?
I’ve updated the class on my side to have a 403 or 402 error, which translates on the update screen as a more appropriate message:
if (empty($entitlements) && !$this->downloadable_base_plugin) {
header($_SERVER['SERVER_PROTOCOL'] . ' 403 No valid license found', true, 403);
die;
}
if ('expired' === $entitlements && !$this->downloadable_base_plugin) {
header($_SERVER['SERVER_PROTOCOL'] . ' 402 License expired', true, 402);
die;
}Error 402 gives this result in WP when trying to update:
What do you think?
Marc
- You must be logged in to reply to this topic.