function wpupdate_cron()
{
    include 'includes/wp-update-class.php';
    include 'includes/wp-update-functions.php';
    $wpupdate = new WP_Update();
    $plugins = wpupdate_get_plugins();
    foreach ((array) $plugins as $plugin_file => $plugin_info) {
        $result = $wpupdate->checkPluginUpdate($plugin_file, false, false);
        if (is_array($result['Errors']) && in_array('Not Cached', $result['Errors'])) {
            //We want to force an update on this item
            $result = $wpupdate->checkPluginUpdate($plugin_file, true, true);
        }
    }
    //Now that we've updated every plugins details, we want to update the notices, this will also have the effect of sending the email if theres new updates.
    $wpupdate->updateNotifications();
}
<?php

require_once 'admin.php';
require_once 'includes/wp-update-class.php';
global $wp_update;
if (!$wp_update || !is_object($wp_update)) {
    $wp_update = new WP_Update();
}
if (isset($_GET['action'])) {
    check_admin_referer('switch-theme_' . $_GET['template']);
    if ('activate' == $_GET['action']) {
        if (isset($_GET['template'])) {
            update_option('template', $_GET['template']);
        }
        if (isset($_GET['stylesheet'])) {
            update_option('stylesheet', $_GET['stylesheet']);
        }
        do_action('switch_theme', get_current_theme());
        wp_redirect('themes.php?activated=true');
        exit;
    }
}
$title = __('Manage Themes');
$parent_file = 'themes.php';
require_once 'admin-header.php';
?>

<?php 
if (!validate_current_theme()) {
    ?>
<div id="message1" class="updated fade"><p><?php 
<?php

require_once '../../../wp-config.php';
require_once '../../../wp-admin/admin.php';
include_once 'includes/wp-update-class.php';
include_once 'includes/wp-update-functions.php';
$wp_update = new WP_Update();
switch ($_GET['action']) {
    case 'checkPluginUpdate':
        echo $wp_update->getPluginUpdateText($_GET['file'], true, true, true);
        break;
    case 'themeSearch':
        $searchOptions = array();
        $searchOptions['searchOptions'] = explode(',', $_POST['searchOptions']);
        $searchOptions['order'] = $_POST['order'];
        $searchOptions['sortby'] = $_POST['sortby'];
        $searchOptions['andor'] = $_POST['andor'];
        $page = $_POST['page'];
        if (empty($page) || !is_numeric($page)) {
            $page = 1;
        }
        $searchResults = $wp_update->search('themes', $searchOptions, $page);
        if (!isset($searchResults['results']) || empty($searchResults['results'])) {
            die(__('no more results'));
        }
        foreach ($searchResults['results'] as $theme) {
            echo wpupdate_themeSearchHTML($theme);
        }
        break;
    case 'pluginSearch':
        $page = (int) $_POST['page'];
<?php

if (!get_option('update_plugin_search_enable')) {
    echo '<div class="error"><h1>Not Enabled</h1></div>';
    return;
}
require_once 'includes/wp-update-class.php';
require_once 'includes/wp-update-functions.php';
global $wp_update, $pagenow;
if (!$wp_update || !is_object($wp_update)) {
    $wp_update = new WP_Update();
}
if (isset($_POST['term']) || isset($_GET['tag'])) {
    if (isset($_POST['term'])) {
        $searchTerm = $_POST['term'];
    } else {
        $tagSearch = $_GET['tag'];
    }
}
?>
<style type="text/css">
	.taglist {
		font-size:1.8em; /* overriden by the individual links, this is mainly to give it a higher lineheight */
	}

	.plugin{
		display:inline;
		width:320px;
		text-align:center;
		vertical-align:top;
	}
<?php

if (!get_option('update_install_enable')) {
    echo '<div class="error"><h1>Not Enabled</h1></div>';
    return;
}
require_once 'includes/wp-update-class.php';
global $wp_update;
if (!$wp_update || !is_object($wp_update)) {
    $wp_update = new WP_Update();
}
?>
<style>
	.section{
		margin-left:2em;
	}
</style>
<div class="wrap">
	<h2><?php 
_e('Install a Theme');
?>
</h2>
<?php 
if (!empty($_FILES) || !empty($_GET['url'])) {
    check_admin_referer('wpupdate-theme-install');
    if (isset($_GET['url'])) {
        //Download file
        $filename = attribute_escape($_GET['url']);
        //TODO?
    } elseif (!empty($_FILES['themefile']['tmp_name'])) {
        $filename = $_FILES['themefile']['name'];
<?php

if (!get_option('update_theme_search_enable')) {
    echo '<div class="error"><h1>Not Enabled</h1></div>';
    return;
}
require_once 'includes/wp-update-class.php';
require_once 'includes/wp-update-functions.php';
global $wp_update;
$wp_update = new WP_Update();
?>
<div class="wrap">
<h2><?php 
_e('Search Themes');
?>
</h2>
<form id="searchoptions" name="sortoptions" method="post" action="<?php 
echo $pagenow . '?page=' . $_GET['page'];
?>
">
<?php 
$searchOptions = apply_filters('update_themeSearchOptions', array('sections' => array()));
//Calculate total number of options:
$options_count = 0;
foreach ($searchOptions['sections'] as $section => $options) {
    $options_count += count($options);
}
$average_items_per_section = $options_count / count($searchOptions['sections']);
foreach ($searchOptions['sections'] as $section => $options) {
    if (count($options) > $average_items_per_section) {
        //How many columns?
<?php

require_once 'admin.php';
require_once 'includes/wp-update-class.php';
require_once 'includes/wp-update-functions.php';
global $wp_update;
if (!$wp_update || !is_object($wp_update)) {
    $wp_update = new WP_Update();
}
if (isset($_GET['action'])) {
    if ('hidenotifications' == $_GET['action']) {
        check_admin_referer('wpupdate-hide-notice');
        $notices = get_option('wpupdate_notifications');
        foreach ($notices as $plugin_file => $plugin_info) {
            $notices[$plugin_file]['HideUpdate'] = true;
            //Hide all the updates available.
        }
        update_option('wpupdate_notifications', $notices);
        wp_redirect($_SERVER["HTTP_REFERER"]);
        //Redirect back to where they came from.
    } elseif ('activate' == $_GET['action']) {
        check_admin_referer('activate-plugin_' . $_GET['plugin']);
        $current = get_option('active_plugins');
        $plugin = trim($_GET['plugin']);
        if (validate_file($plugin)) {
            wp_die(__('Invalid plugin.'));
        }
        if (!file_exists(ABSPATH . PLUGINDIR . '/' . $plugin)) {
            wp_die(__('Plugin file does not exist.'));
        }
        if (!in_array($plugin, $current)) {
<?php

if (!get_option('update_install_enable') || !defined('ABSPATH')) {
    echo '<div class="error"><h1>Not Enabled</h1></div>';
    return;
}
require_once 'includes/wp-update-class.php';
global $wp_update;
if (!$wp_update || !is_object($wp_update)) {
    $wp_update = new WP_Update();
}
if (isset($_GET['upgrade']) || isset($_POST['upgrade'])) {
    //Lets rely on a sepate file for upgrade proceedure
    include 'wp-update-plugins-upgrade.php';
    return;
}
?>
<div class="wrap">
	<h2><?php 
_e('Install a Plugin');
?>
</h2>
	<?php 
//First we check to see if this is a WordPress.org plugin, We'll have some requirements to check first :)
if (isset($_GET['wp-id']) && !empty($_GET['wp-id']) && !isset($_GET['proceed'])) {
    check_admin_referer('wpupdate-install-plugin');
    $id = $_GET['wp-id'];
    $pluginInfo = apply_filters('wpupdate_checkPluginUpdate-wordpress.org', $id);
    ?>
				<p>
					<?php