<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15867] trunk/wp-admin: Add plugin update notifications, plugin install,
  plugin update to the network admin screen.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15867">15867</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-10-20 14:16:03 +0000 (Wed, 20 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add plugin update notifications, plugin install, plugin update to the network admin screen. Props PeteMall. see <a href="http://trac.wordpress.org/ticket/15129">#15129</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpupgraderphp">trunk/wp-admin/includes/class-wp-upgrader.php</a></li>
<li><a href="#trunkwpadminincludesplugininstallphp">trunk/wp-admin/includes/plugin-install.php</a></li>
<li><a href="#trunkwpadminincludesupdatephp">trunk/wp-admin/includes/update.php</a></li>
<li><a href="#trunkwpadminnetworkmenuphp">trunk/wp-admin/network/menu.php</a></li>
<li><a href="#trunkwpadminplugininstallphp">trunk/wp-admin/plugin-install.php</a></li>
<li><a href="#trunkwpadminupdatephp">trunk/wp-admin/update.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminnetworkplugininstallphp">trunk/wp-admin/network/plugin-install.php</a></li>
<li><a href="#trunkwpadminnetworkupdatephp">trunk/wp-admin/network/update.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswpupgraderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-upgrader.php (15866 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-upgrader.php        2010-10-20 14:08:29 UTC (rev 15866)
+++ trunk/wp-admin/includes/class-wp-upgrader.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -1281,15 +1281,17 @@
</span><span class="cx">                 else
</span><span class="cx">                         $install_actions['activate_plugin'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=activate&amp;amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '&quot; title=&quot;' . esc_attr__('Activate this plugin') . '&quot; target=&quot;_parent&quot;&gt;' . __('Activate Plugin') . '&lt;/a&gt;';
</span><span class="cx"> 
</span><del>-                if ( is_multisite() &amp;&amp; current_user_can( 'manage_network_plugins' ) )
</del><ins>+                if ( is_multisite() &amp;&amp; current_user_can( 'manage_network_plugins' ) ) {
</ins><span class="cx">                         $install_actions['network_activate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=activate&amp;amp;networkwide=1&amp;amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Activate this plugin for all sites in this network') . '&quot; target=&quot;_parent&quot;&gt;' . __('Network Activate') . '&lt;/a&gt;';
</span><ins>+                        unset( $install_actions['activate_plugin'] );
+                }
</ins><span class="cx"> 
</span><span class="cx">                 if ( 'import' == $from )
</span><span class="cx">                         $install_actions['importers_page'] = '&lt;a href=&quot;' . admin_url('import.php') . '&quot; title=&quot;' . esc_attr__('Return to Importers') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Importers') . '&lt;/a&gt;';
</span><span class="cx">                 else if ( $this-&gt;type == 'web' )
</span><del>-                        $install_actions['plugins_page'] = '&lt;a href=&quot;' . admin_url('plugin-install.php') . '&quot; title=&quot;' . esc_attr__('Return to Plugin Installer') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Plugin Installer') . '&lt;/a&gt;';
</del><ins>+                        $install_actions['plugins_page'] = '&lt;a href=&quot;' . self_admin_url('plugin-install.php') . '&quot; title=&quot;' . esc_attr__('Return to Plugin Installer') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Plugin Installer') . '&lt;/a&gt;';
</ins><span class="cx">                 else
</span><del>-                        $install_actions['plugins_page'] = '&lt;a href=&quot;' . admin_url('plugins.php') . '&quot; title=&quot;' . esc_attr__('Return to Plugins page') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Plugins page') . '&lt;/a&gt;';
</del><ins>+                        $install_actions['plugins_page'] = '&lt;a href=&quot;' . self_admin_url('plugins.php') . '&quot; title=&quot;' . esc_attr__('Return to Plugins page') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Plugins page') . '&lt;/a&gt;';
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">                 if ( ! $this-&gt;result || is_wp_error($this-&gt;result) ) {
</span></span></pre></div>
<a id="trunkwpadminincludesplugininstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/plugin-install.php (15866 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/plugin-install.php        2010-10-20 14:08:29 UTC (rev 15866)
+++ trunk/wp-admin/includes/plugin-install.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">                 $tags = array();
</span><span class="cx">                 foreach ( (array)$api_tags as $tag )
</span><span class="cx">                         $tags[ $tag['name'] ] = (object) array(
</span><del>-                                                                        'link' =&gt; esc_url( admin_url('plugin-install.php?tab=search&amp;type=tag&amp;s=' . urlencode($tag['name'])) ),
</del><ins>+                                                                        'link' =&gt; esc_url( self_admin_url('plugin-install.php?tab=search&amp;type=tag&amp;s=' . urlencode($tag['name'])) ),
</ins><span class="cx">                                                                         'name' =&gt; $tag['name'],
</span><span class="cx">                                                                         'id' =&gt; sanitize_title_with_dashes($tag['name']),
</span><span class="cx">                                                                         'count' =&gt; $tag['count'] );
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> ?&gt;
</span><span class="cx">         &lt;h4&gt;&lt;?php _e('Install a plugin in .zip format') ?&gt;&lt;/h4&gt;
</span><span class="cx">         &lt;p class=&quot;install-help&quot;&gt;&lt;?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.') ?&gt;&lt;/p&gt;
</span><del>-        &lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&lt;?php echo admin_url('update.php?action=upload-plugin') ?&gt;&quot;&gt;
</del><ins>+        &lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&lt;?php echo self_admin_url('update.php?action=upload-plugin') ?&gt;&quot;&gt;
</ins><span class="cx">                 &lt;?php wp_nonce_field( 'plugin-upload') ?&gt;
</span><span class="cx">                 &lt;label class=&quot;screen-reader-text&quot; for=&quot;pluginzip&quot;&gt;&lt;?php _e('Plugin zip file'); ?&gt;&lt;/label&gt;
</span><span class="cx">                 &lt;input type=&quot;file&quot; id=&quot;pluginzip&quot; name=&quot;pluginzip&quot; /&gt;
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">                                 $update_file = $file;
</span><span class="cx">                                 $version = $plugin-&gt;new_version;
</span><span class="cx">                                 if ( current_user_can('update_plugins') )
</span><del>-                                        $url = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&amp;plugin=' . $update_file), 'upgrade-plugin_' . $update_file);
</del><ins>+                                        $url = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&amp;plugin=' . $update_file), 'upgrade-plugin_' . $update_file);
</ins><span class="cx">                                 break;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx">                         $installed_plugin = get_plugins('/' . $api-&gt;slug);
</span><span class="cx">                         if ( empty($installed_plugin) ) {
</span><span class="cx">                                 if ( current_user_can('install_plugins') )
</span><del>-                                        $url = wp_nonce_url(admin_url('update.php?action=install-plugin&amp;plugin=' . $api-&gt;slug), 'install-plugin_' . $api-&gt;slug);
</del><ins>+                                        $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&amp;plugin=' . $api-&gt;slug), 'install-plugin_' . $api-&gt;slug);
</ins><span class="cx">                         } else {
</span><span class="cx">                                 $key = array_shift( $key = array_keys($installed_plugin) ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
</span><span class="cx">                                 if ( version_compare($api-&gt;version, $installed_plugin[ $key ]['Version'], '=') ){
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         // &quot;install&quot; &amp; no directory with that slug
</span><span class="cx">                         if ( current_user_can('install_plugins') )
</span><del>-                                $url = wp_nonce_url(admin_url('update.php?action=install-plugin&amp;plugin=' . $api-&gt;slug), 'install-plugin_' . $api-&gt;slug);
</del><ins>+                                $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&amp;plugin=' . $api-&gt;slug), 'install-plugin_' . $api-&gt;slug);
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         if ( isset($_GET['from']) )
</span></span></pre></div>
<a id="trunkwpadminincludesupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/update.php (15866 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/update.php        2010-10-20 14:08:29 UTC (rev 15866)
+++ trunk/wp-admin/includes/update.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">         $plugins_allowedtags = array('a' =&gt; array('href' =&gt; array(),'title' =&gt; array()),'abbr' =&gt; array('title' =&gt; array()),'acronym' =&gt; array('title' =&gt; array()),'code' =&gt; array(),'em' =&gt; array(),'strong' =&gt; array());
</span><span class="cx">         $plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
</span><span class="cx"> 
</span><del>-        $details_url = admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $r-&gt;slug . '&amp;TB_iframe=true&amp;width=600&amp;height=800');
</del><ins>+        $details_url = self_admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $r-&gt;slug . '&amp;TB_iframe=true&amp;width=600&amp;height=800');
</ins><span class="cx"> 
</span><span class="cx">         echo '&lt;tr class=&quot;plugin-update-tr&quot;&gt;&lt;td colspan=&quot;3&quot; class=&quot;plugin-update&quot;&gt;&lt;div class=&quot;update-message&quot;&gt;';
</span><span class="cx">         if ( ! current_user_can('update_plugins') )
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">         else if ( empty($r-&gt;package) )
</span><span class="cx">                 printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot; class=&quot;thickbox&quot; title=&quot;%3$s&quot;&gt;View version %4$s details&lt;/a&gt;. &lt;em&gt;Automatic upgrade is unavailable for this plugin.&lt;/em&gt;'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r-&gt;new_version );
</span><span class="cx">         else
</span><del>-                printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot; class=&quot;thickbox&quot; title=&quot;%3$s&quot;&gt;View version %4$s details&lt;/a&gt; or &lt;a href=&quot;%5$s&quot;&gt;upgrade automatically&lt;/a&gt;.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r-&gt;new_version, wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=' . $file, 'upgrade-plugin_' . $file) );
</del><ins>+                printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot; class=&quot;thickbox&quot; title=&quot;%3$s&quot;&gt;View version %4$s details&lt;/a&gt; or &lt;a href=&quot;%5$s&quot;&gt;upgrade automatically&lt;/a&gt;.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r-&gt;new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&amp;plugin=') . $file, 'upgrade-plugin_' . $file) );
</ins><span class="cx"> 
</span><span class="cx">         do_action( &quot;in_plugin_update_message-$file&quot;, $plugin_data, $r );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminnetworkmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/menu.php (15866 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/menu.php        2010-10-20 14:08:29 UTC (rev 15866)
+++ trunk/wp-admin/network/menu.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -9,19 +9,23 @@
</span><span class="cx"> $menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div');
</span><span class="cx"> $menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
</span><span class="cx"> $menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
</span><del>-$menu[20] = array(__('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div');
</del><ins>+
+$plugin_update_count = 0; 
+$update_plugins = get_site_transient( 'update_plugins' ); 
+if ( !empty($update_plugins-&gt;response) ) 
+        $plugin_update_count = count( $update_plugins-&gt;response ); 
+$menu[20] = array(sprintf( __('Plugins %s'), &quot;&lt;span class='update-plugins count-$plugin_update_count'&gt;&lt;span class='plugin-count'&gt;&quot; . number_format_i18n($plugin_update_count) . &quot;&lt;/span&gt;&lt;/span&gt;&quot; ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div');
+$submenu['plugins.php'][5]  = array( __('Plugins'), 'manage_network_plugins', 'plugins.php' );
+$submenu['plugins.php'][10] = array( _x('Add New', 'plugin editor'), 'install_plugins', 'plugin-install.php' );
+$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
+
+
</ins><span class="cx"> $menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
</span><span class="cx"> $menu[30] = array(__('Update'), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
</span><span class="cx"> 
</span><span class="cx"> $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
</span><span class="cx"> 
</span><del>-$compat = array();
-$submenu = array();
-
-$submenu['plugins.php'][5]  = array( __('Plugins'), 'manage_network_plugins', 'plugins.php' ); 
-$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
-
-$submenu['themes.php'][5]  = array( __('Themes'), 'manage_network_themes', 'themes.php' ); 
</del><ins>+$submenu['themes.php'][5]  = array( __('Themes'), 'manage_network_themes', 'themes.php' );
</ins><span class="cx"> $submenu['themes.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_themes', 'theme-editor.php' );
</span><span class="cx"> 
</span><span class="cx"> require_once(ABSPATH . 'wp-admin/includes/menu.php');
</span></span></pre></div>
<a id="trunkwpadminnetworkplugininstallphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/plugin-install.php (0 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/plugin-install.php                                (rev 0)
+++ trunk/wp-admin/network/plugin-install.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;?php
+
+require_once( './admin.php' );
+
+require( '../plugin-install.php' );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/network/plugin-install.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworkupdatephp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/update.php (0 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/update.php                                (rev 0)
+++ trunk/wp-admin/network/update.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;?php
+
+require_once( './admin.php' );
+
+require( '../update.php' );
</ins><span class="cx">Property changes on: trunk/wp-admin/network/update.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminplugininstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugin-install.php (15866 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugin-install.php        2010-10-20 14:08:29 UTC (rev 15866)
+++ trunk/wp-admin/plugin-install.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">         '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-include('./admin-header.php');
</del><ins>+include(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;wrap&quot;&gt;
</span><span class="cx"> &lt;?php screen_icon(); ?&gt;
</span><span class="lines">@@ -47,5 +47,5 @@
</span><span class="cx"> &lt;?php do_action('install_plugins_' . $tab, $paged); ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;?php
</span><del>-include('./admin-footer.php');
</del><ins>+include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/update.php (15866 => 15867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/update.php        2010-10-20 14:08:29 UTC (rev 15866)
+++ trunk/wp-admin/update.php        2010-10-20 14:16:03 UTC (rev 15867)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">                 $title = __('Upgrade Plugin');
</span><span class="cx">                 $parent_file = 'plugins.php';
</span><span class="cx">                 $submenu_file = 'plugins.php';
</span><del>-                require_once('./admin-header.php');
</del><ins>+                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx">                 $nonce = 'upgrade-plugin_' . $plugin;
</span><span class="cx">                 $url = 'update.php?action=upgrade-plugin&amp;plugin=' . $plugin;
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">                 $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
</span><span class="cx">                 $upgrader-&gt;upgrade($plugin);
</span><span class="cx"> 
</span><del>-                include('./admin-footer.php');
</del><ins>+                include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> 
</span><span class="cx">         } elseif ('activate-plugin' == $action ) {
</span><span class="cx">                 if ( ! current_user_can('update_plugins') )
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">                 $title = __('Plugin Install');
</span><span class="cx">                 $parent_file = 'plugins.php';
</span><span class="cx">                 $submenu_file = 'plugin-install.php';
</span><del>-                require_once('./admin-header.php');
</del><ins>+                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx">                 $title = sprintf( __('Installing Plugin: %s'), $api-&gt;name . ' ' . $api-&gt;version );
</span><span class="cx">                 $nonce = 'install-plugin_' . $plugin;
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">                 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
</span><span class="cx">                 $upgrader-&gt;install($api-&gt;download_link);
</span><span class="cx"> 
</span><del>-                include('./admin-footer.php');
</del><ins>+                include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> 
</span><span class="cx">         } elseif ( 'upload-plugin' == $action ) {
</span><span class="cx"> 
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">                 $title = __('Upload Plugin');
</span><span class="cx">                 $parent_file = 'plugins.php';
</span><span class="cx">                 $submenu_file = 'plugin-install.php';
</span><del>-                require_once('./admin-header.php');
</del><ins>+                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx">                 $title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload-&gt;filename ) );
</span><span class="cx">                 $nonce = 'plugin-upload';
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">                 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
</span><span class="cx">                 $upgrader-&gt;install( $file_upload-&gt;package );
</span><span class="cx"> 
</span><del>-                include('./admin-footer.php');
</del><ins>+                include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> 
</span><span class="cx">         } elseif ( 'upgrade-theme' == $action ) {
</span><span class="cx"> 
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">                 $title = __('Upgrade Theme');
</span><span class="cx">                 $parent_file = 'themes.php';
</span><span class="cx">                 $submenu_file = 'themes.php';
</span><del>-                require_once('./admin-header.php');
</del><ins>+                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx">                 $nonce = 'upgrade-theme_' . $theme;
</span><span class="cx">                 $url = 'update.php?action=upgrade-theme&amp;theme=' . $theme;
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx">                 $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) );
</span><span class="cx">                 $upgrader-&gt;upgrade($theme);
</span><span class="cx"> 
</span><del>-                include('./admin-footer.php');
</del><ins>+                include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx">         } elseif ( 'update-selected-themes' == $action ) {
</span><span class="cx">                 if ( ! current_user_can( 'update_themes' ) )
</span><span class="cx">                         wp_die( __( 'You do not have sufficient permissions to update themes for this site.' ) );
</span><span class="lines">@@ -211,7 +211,7 @@
</span><span class="cx">                 $title = __('Install Themes');
</span><span class="cx">                 $parent_file = 'themes.php';
</span><span class="cx">                 $submenu_file = 'themes.php';
</span><del>-                require_once('./admin-header.php');
</del><ins>+                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx">                 $title = sprintf( __('Installing Theme: %s'), $api-&gt;name . ' ' . $api-&gt;version );
</span><span class="cx">                 $nonce = 'install-theme_' . $theme;
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">                 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
</span><span class="cx">                 $upgrader-&gt;install($api-&gt;download_link);
</span><span class="cx"> 
</span><del>-                include('./admin-footer.php');
</del><ins>+                include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> 
</span><span class="cx">         } elseif ( 'upload-theme' == $action ) {
</span><span class="cx"> 
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">                 $submenu_file = 'theme-install.php';
</span><span class="cx">                 add_thickbox();
</span><span class="cx">                 wp_enqueue_script('theme-preview');
</span><del>-                require_once('./admin-header.php');
</del><ins>+                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx">                 $title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload-&gt;filename ) );
</span><span class="cx">                 $nonce = 'theme-upload';
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">                 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
</span><span class="cx">                 $upgrader-&gt;install( $file_upload-&gt;package );
</span><span class="cx"> 
</span><del>-                include('./admin-footer.php');
</del><ins>+                include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> 
</span><span class="cx">         } else {
</span><span class="cx">                 do_action('update-custom_' . $action);
</span></span></pre>
</div>
</div>

</body>
</html>