if ( ! WP_Upgrader::
create_lock( 'auto_updater'
) ) { return;
} // Don't automatically run these things, as we'll handle it ourselves.
remove_action( 'upgrader_process_complete', array
( 'Language_Pack_Upgrader', 'async_upgrade'
), 20
);
remove_action( 'upgrader_process_complete', 'wp_version_check'
);
remove_action( 'upgrader_process_complete', 'wp_update_plugins'
);
remove_action( 'upgrader_process_complete', 'wp_update_themes'
);
// Next, plugins.
wp_update_plugins(); // Check for plugin updates.
$plugin_updates =
get_site_transient( 'update_plugins'
);
if ( $plugin_updates && !
empty( $plugin_updates->response
) ) { foreach ( $plugin_updates->response
as $plugin ) { $this->
update( 'plugin',
$plugin );
} // Force refresh of plugin update information.
wp_clean_plugins_cache();
} // Next, those themes we all love.
wp_update_themes(); // Check for theme updates.