WordPoints / wordpoints

Points plugin for WordPress
GNU General Public License v2.0
19 stars 15 forks source link

Extensions: "Update package not available" error #749

Closed JDGrimes closed 6 years ago

JDGrimes commented 6 years ago

I have had multiple reports of the same bug: when attempting to update an extension, there would just be an error, "Update package not available". I was able to reproduce it, but after a while it just seemed to fix itself, before I could find the cause. This last time I was able to determine that the 'package' in the extension data object was just an empty string. Thus the error. The reason for that is that the update data was set before the extension license was activated. Without the valid license, only the other info is included in the response, and not the package URL. (At least this is what I suspect.)

JDGrimes commented 6 years ago

Yep, that appears to be it.

We can fix it by just triggering the update check whenever a license is activated.

I guess we could also trigger it on deactivation, but that doesn't really seem as important.

Also, it would be nice if we could just run the check for the extension that the license is for, since it isn't necessary to run it for all extensions. We currently don't have a function that can do that though, and I'd rather not rush its introduction into a point release. So we'll just keep that in mind for later.