Closed JDGrimes closed 7 years ago
There are really two parts to this, I guess.
The later was the primary focus of the original ticket, but I have always kind of thought that we should do both, which is likely why I changed the scope when copying this over.
Just realized that when an expired license key is attempted to be activated, the feedback just says that it is invalid. It should probably be saved, since it actually technically is valid, but marked as expired.
Now, a user will see this when activating an expired license:
And the key will be saved, and they'll see this in the license row in the table:
We probably ought to add a button to recheck the license status. Otherwise, after the user renews the license, I'm not sure that the status will get updated. At least not right away, but maybe not at all (which in itself may be an issue).
We recheck a license's status when an update check fails, however, once a license's status is thought to be invalid/expired, I don't think that we ever do a check that would detect its renewal. We should do something similar as we did in https://github.com/WordPoints/wordpoints/commit/a9bc1293ad78952764db4b0508d19d71b0b6aaeb.
I was wondering whether we need to keep tack of the license statuses in an option or something, or whether we can just pull all of the license info up and check it each time. The latter option may be too expensive an operation (we'd have to call wordpoints_get_modules()
), so we might have to go the slightly more complicated route of storing the list of expired/invalid license keys in an option.
On second thought though, I'm not sure that we can display the information that we want to without the module info anyway (extension name, for example). Anyway, we can't get the renewal URL without the extension ID.
The good news is, that we can get the extension info without having to read the files, because extensions can register their headers directly. So I think I'll opt for just running the check each time for now.
Examples:
And when a license is deactivated:
Previously: https://github.com/WordPoints/wordpointsorg/issues/5