Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings page is unaware of license changes after activation #5

Open
Brugman opened this issue Feb 11, 2024 · 0 comments
Open

Settings page is unaware of license changes after activation #5

Brugman opened this issue Feb 11, 2024 · 0 comments

Comments

@Brugman
Copy link

Brugman commented Feb 11, 2024

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_activation and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant