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

Docker: disable Jetpack update notices #9500

Merged
merged 3 commits into from
May 24, 2018

Conversation

simison
Copy link
Member

@simison simison commented May 7, 2018

  • Disables notices for Jetpack plugin in Docker environment.
  • Disables plugin deletions

Deleting or updating the plugin would cause your complete development folder being erased. Not cool.

Previous version of the plugin was already removing the delete link but this disables the actual deletion.

Testing

Probably the easiest way to test is to download older version of Gutenberg: https://downloads.wordpress.org/plugin/gutenberg.2.7.0.zip

...and add it to the list at docker/mu-plugins/avoid-plugin-deletion.php:

$jetpack_docker_avoided_plugins = array(
	'jetpack/jetpack.php',
	'gutenberg/gutenberg.php',
);

Just ensure your gutenberg folder is gutenberg, not gutenberg-2.7.0

Confirm that:

  • Update notice dissapears from wp-admin and the Activity log:
    screen shot 2018-05-07 at 10 25 06
    screen shot 2018-05-07 at 10 30 11
  • Bring back plugin deletion link by commenting out unset( $actions['delete'] ); in the code and press delete Gutenberg from /wp-admin/plugins.php. You should see this error:
    screen shot 2018-05-07 at 11 07 00

CLI

Sadly deleting the plugin via cli still works: yarn docker:wp plugin delete gutenberg

Notes for future reference:

if ( class_exists( 'WP_CLI' ) && method_exists( 'WP_CLI', 'add_hook' ) ) {
	WP_CLI::add_hook( 'before_invoke:plugin delete', function () {
			// How to recognize which plugin is about to be deleted?
			WP_CLI::error( 'Nope!' );
	} );
}

Disables notices for Jetpack plugin in Docker environment.

Deleting or updating the plugin would cause your complete development folder being erased. Not cool.
@simison simison added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Docker labels May 7, 2018
@simison simison requested review from oskosk and a team May 7, 2018 08:28
@simison simison requested a review from a team as a code owner May 7, 2018 08:28
@oskosk oskosk added this to the 6.2 milestone May 8, 2018
Copy link
Contributor

@oskosk oskosk left a comment

Choose a reason for hiding this comment

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

LGTM!

@oskosk
Copy link
Contributor

oskosk commented May 24, 2018

Thank you!

@oskosk oskosk added the [Status] Ready to Merge Go ahead, you can push that green button! label May 24, 2018
@oskosk oskosk merged commit 76ae03c into master May 24, 2018
@oskosk oskosk deleted the docker/disable-jetpack-update-notices branch May 24, 2018 16:57
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docker [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants