From ea95fd213b1cf6a60462b6c56334334d7c443afc Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 26 May 2012 03:52:14 +0000 Subject: [PATCH] Do not spawn cron or trigger update checks when running the customizer. Both can slow down the experience. The alternate cron will issue a redirect which creates more work for the customizer, but not exit immediately, which means shutdown will be delayed (see future changeset from koopersmith in #20507 where we check for a token printed on shutdown to ensure the response came from the customizer). The update checks could also cause bad data to be sent. In particular, the currently active theme would be incorrect. see #20507. git-svn-id: http://core.svn.wordpress.org/trunk@20924 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index f9698984e6..fda9f2f4ce 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -37,6 +37,14 @@ final class WP_Customize_Manager { // Run wp_redirect_status late to make sure we override the status last. add_action( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 ); + // Do not spawn cron (especially the alternate cron) while running the customizer. + remove_action( 'init', 'wp_cron' ); + + // Do not run update checks when rendering the controls. + remove_action( 'admin_init', '_maybe_update_core' ); + remove_action( 'admin_init', '_maybe_update_plugins' ); + remove_action( 'admin_init', '_maybe_update_themes' ); + add_action( 'wp_ajax_customize_save', array( $this, 'save' ) ); add_action( 'customize_register', array( $this, 'register_controls' ) );