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

Deactivation and activation of VersionPress keeps original VPIDs and files #931

Merged
merged 5 commits into from Apr 19, 2016

Conversation

Projects
None yet
4 participants
@JanVoracek
Copy link
Member

JanVoracek commented Apr 15, 2016

Resolves #906.

When user deactivates and activates VersionPress, it uses original IDs where it's possible. It means that now it is possible to track history of e.g. post even after update of VersionPress. Technically, it was achieved by moving some of the logic from deactivation to uninstallation. For example, INI files are now only deleted on uninstallation.

The update process remains the same:

  1. Deactivate VersionPress
  2. Replace it with a new version (or simply call wp plugin install <path to zip> --force)
  3. Activate VersionPress
  4. Initialize VersionPress

Is this OK or should I create some WP-CLI command for update?

I also encountered a little problem: VersionPress cannot be updated using GUI only. WordPress refuses new ZIP if VersionPress is already installed. The user may click on the delete link and the history will be gone.

Reviewers:

@JanVoracek JanVoracek self-assigned this Apr 15, 2016

@JanVoracek JanVoracek added this to the 3.0 milestone Apr 15, 2016

@borekb

This comment has been minimized.

Copy link
Member

borekb commented Apr 15, 2016

WP-CLI command would be useful. It doesn't need to be too fancy, for example, something simple like

wp vp update path-to-newer-versionpress.zip

would be enough. In the future, we should integrate with WP Upgrader and deprecate this temporary helper command.

Other than that, the code looks 👍 by me.

@octopuss

This comment has been minimized.

Copy link
Contributor

octopuss commented Apr 15, 2016

From my point of view, the code looks good too.

@unclhos

This comment has been minimized.

Copy link
Contributor

unclhos commented Apr 15, 2016

Oh PLEASE give me an update command :)

@JanVoracek JanVoracek force-pushed the 906-keep-vpids branch from a7675f1 to 75efbf3 Apr 18, 2016

Merge branch 'master' into 906-keep-vpids
# Conflicts:
#	plugins/versionpress/src/Cli/vp.php
@JanVoracek

This comment has been minimized.

Copy link
Member

JanVoracek commented Apr 18, 2016

I pushed an implementation of the wp vp update command. Feel free to comment.

@borekb

This comment has been minimized.

Copy link
Member

borekb commented Apr 19, 2016

This will be super-useful. Thanks.

namespace VersionPress\Cli;
class SilentUpgraderSkin extends \WP_Upgrader_Skin {

This comment has been minimized.

@octopuss

octopuss Apr 19, 2016

Contributor

Please add simple note what made you use this silent skin here or in vp::update() method.

This comment has been minimized.

@JanVoracek

@JanVoracek JanVoracek merged commit 4d6c99b into master Apr 19, 2016

@JanVoracek JanVoracek deleted the 906-keep-vpids branch Apr 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment