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

Prevent updating plugins which are not installed. #508

Merged
merged 1 commit into from
Jan 5, 2016
Merged

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jan 5, 2016

Fixes #442

@@ -2675,7 +2675,7 @@ public function process_bulk_actions() {
}

// For updates: make sure this is a plugin we *can* update (update available and WP version ok).
if ( 'update' === $install_type && ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) {
if ( 'update' === $install_type && ( ! $this->tgmpa->is_plugin_installed( $slug ) || ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

This set of conditions is too long. It's not easy to read or understand. Please extract into a new documented method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Updated, rebased & squashed.

@GaryJones GaryJones added this to the 2.6.0 milestone Jan 5, 2016
GaryJones added a commit that referenced this pull request Jan 5, 2016
Prevent updating plugins which are not installed.
@GaryJones GaryJones merged commit 735d71b into develop Jan 5, 2016
@GaryJones GaryJones deleted the issue-442 branch January 5, 2016 23:31
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.

2 participants