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

Force update a plugin from simba updates plugin manager based on parameter #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jinantony
Copy link

This PR will force auto update in a plugin hosted by simba plugin updates manager , when the force update parameter will be checked in hosted site.

@DavidAnderson684
Copy link
Owner

@jinantony Please can you explain the root problem being solved by this MR, and why that problem is not already solved by the existing method auto_update_plugin() in the class, and the relationship between the new filter you've added and that existing method?

@jinantony
Copy link
Author

@DavidAnderson684 in the YahnisElsts format reference the format did not have an autoupdate option , hence had to send the force update parameter through the download link.
The new filter will check for the force update parameter and then add the update item to the auto_update_plugins site option and running a wp_maybe_auto_update(); will update the plugin forcefully.

I did not use auto_update_plugin since it was in a version compare condition.

@DavidAnderson684
Copy link
Owner

the format did not have an autoupdate option , hence had to send the force update parameter through the download link.

I'm still confused, as this seems to refer to different things. The "force update" parameter means "check for availability, now, even if a recent check was done". That's not the same as performing an auto-update.

Your comment seems to be saying you're trying to work around a lack in https://github.com/YahnisElsts/plugin-update-checker ? If so, why not send a PR to that repo for whatever is missing?

@jinantony
Copy link
Author

@DavidAnderson684 I have moved the code to auto_update_plugin hook and have tested it and is working as expected.

@DavidAnderson684
Copy link
Owner

@jinantony I'm still confused about the purpose of this PR. Can you describe for me a scenario in which the existing code fails to achieve some expected result? You did give an explanation on June 28th, but that explanation seemed to me to be confused. You say this MR is now "working as expected", but what is the expectation you're referring to - I'm still unclear on the problem you've encountered that this solves?

@jinantony
Copy link
Author

@jinantony I'm still confused about the purpose of this PR. Can you describe for me a scenario in which the existing code fails to achieve some expected result? You did give an explanation on June 28th, but that explanation seemed to me to be confused. You say this MR is now "working as expected", but what is the expectation you're referring to - I'm still unclear on the problem you've encountered that this solves?

@DavidAnderson684 The scenario here was to get a custom variable (force_update) from the plugin url (hosted using simba plugins manager) and perform a force update.

The YahnisElsts plugin actually does not provide an option to send an force update through the plugin update json, hence had to include that variable to the plugin update url.

Now when our plugin encounters this variable , with the latest code it will automatically set the auto_update_plugin value for our plugin as true thus forcing an update

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

Successfully merging this pull request may close these issues.

2 participants