<?php
/*
Plugin Name: Override Plugin and Theme Update Checks
Plugin URI: https://core.trac.wordpress.org/ticket/31011
Description: Prevents plugin and theme update checks from being run on each admin page load in WordPress 4.1. See <a href="https://core.trac.wordpress.org/ticket/31011">#31011</a> for more details.
Author: Sergey Biryukov
Author URI: http://profiles.wordpress.org/sergeybiryukov/
Version: 0.1
*/ 

class Override_Plugin_and_Theme_Update_Checks_31011 {

	function __construct() {
		add_filter( 'site_transient_update_plugins', array( $this, 'override_updated_plugins_check' ) );
		add_filter( 'site_transient_update_themes',  array( $this, 'override_updated_themes_check' ) );
	}

	function override_updated_plugins_check( $transient ) {
		$plugins = get_plugins();

		// Reset the timeout if previous requests never succeeded
		if ( ! isset( $transient->checked ) ) {
			$last_update->last_checked = time();
		}

		// Short-circuit the check for changed plugins
		foreach ( $plugins as $file => $plugin ) {
			if ( ! isset( $transient->checked[ $file ] ) ) {
				$transient->checked[ $file ] = $plugin['Version'];
			}
		}

		return $transient;
	}

	function override_updated_themes_check( $transient ) {
		$themes = wp_get_themes();

		// Reset the timeout if previous requests never succeeded
		if ( ! isset( $transient->checked ) ) {
			$last_update->last_checked = time();
		}

		// Short-circuit the check for changed themes
		foreach ( $themes as $theme ) {
			$stylesheet = $theme->get_stylesheet();
			if ( ! isset( $transient->checked[ $stylesheet ] ) ) {
				$transient->checked[ $stylesheet ] = $theme->get( 'Version' );
			}
		}

		return $transient;
	}

}

new Override_Plugin_and_Theme_Update_Checks_31011;
?>