You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I've included class-plugin-updater.php in my plugin, but I'm refactoring class-settings-page.php to fit me better. Regardless, even in its original form, I think class-settings-page.php is missing some important functionality.
Checking if a stored license is valid, is done with $license_message->data->activated, which comes from the example_plugin_license_message option. That option is only created/updated in activate_license. That function is only called inside handle_license_activationand only if a new license key is set. And that function is only run when the update_option_example_plugin_settings_option_name hook triggers, which has to do with submitting a form.
Here's a scenario:
The user installs the plugin, enters their license, it gets checked, it's valid, the response saying it's valid gets stored in example_plugin_license_message, the plugin continues to work.
13 months later, the license is expired. I think the settings page will still say that it's valid. Unless you remove the license and re-enter the same license. Then the check will be done again, and mess up their advantageous bug.
I think we need to add some code to recheck the license every X days.
Kinda related but unrelated: Why is the settings page code using the example_plugin_license_message option, but the updater code does not? The updater is completely disconnected and stores results in a transient. Why two methods?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi. I've included
class-plugin-updater.php
in my plugin, but I'm refactoringclass-settings-page.php
to fit me better. Regardless, even in its original form, I thinkclass-settings-page.php
is missing some important functionality.Checking if a stored license is valid, is done with
$license_message->data->activated
, which comes from theexample_plugin_license_message
option. That option is only created/updated inactivate_license
. That function is only called insidehandle_license_activation
and only if a new license key is set. And that function is only run when theupdate_option_example_plugin_settings_option_name
hook triggers, which has to do with submitting a form.Here's a scenario:
The user installs the plugin, enters their license, it gets checked, it's valid, the response saying it's valid gets stored in
example_plugin_license_message
, the plugin continues to work.13 months later, the license is expired. I think the settings page will still say that it's valid. Unless you remove the license and re-enter the same license. Then the check will be done again, and mess up their advantageous bug.
I think we need to add some code to recheck the license every X days.
Kinda related but unrelated: Why is the settings page code using the
example_plugin_license_message
option, but the updater code does not? The updater is completely disconnected and stores results in a transient. Why two methods?Thanks.
The text was updated successfully, but these errors were encountered: