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

Run plugin updates when needed #2497

Merged
merged 1 commit into from
Mar 22, 2019
Merged

Run plugin updates when needed #2497

merged 1 commit into from
Mar 22, 2019

Conversation

jom
Copy link
Member

@jom jom commented Mar 21, 2019

This runs updates when the recorded version in the database doesn't match the current plugin version.

Currently it just updates sensei-version (so the compatibility plugin loads WCPC), but we could add additional steps from one of Sensei's three activation methods:
Sensei_Main::activate()
Sensei_Main::activate_sensei()
Sensei_Main::activation()

Outside of this PR, I think we should consolidate these activation methods

@jom jom added the [Type] Bug label Mar 21, 2019
@jom jom added this to the 2.0.0 milestone Mar 21, 2019
@donnapep
Copy link
Collaborator

Do we need to worry about woothemes-sensei-version at all? Would it ever be possible that version was set but not the sensei-version one?

@jom
Copy link
Member Author

jom commented Mar 22, 2019

Do we need to worry about woothemes-sensei-version at all? Would it ever be possible that version was set but not the sensei-version one?

I don't think we do. It will always be less than 2.0.0 so we would always want to execute the code. I tested what version_compare does with false and we should be safe.
version_compare( '2.0.0', false, '>' ) === true

Copy link
Contributor

@alexsanford alexsanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me! 💯

@jom jom merged commit d411a77 into release/2.0 Mar 22, 2019
@jom jom deleted the update/version-on-update branch March 22, 2019 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants