<!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" />
<title>[38199] trunk/src/wp-admin: Upgrade/Install: Make some install/update failures more verbose.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/38199">38199</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/38199","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-08-04 22:17:44 +0000 (Thu, 04 Aug 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Upgrade/Install: Make some install/update failures more verbose.
An upgrader class is used in conjunction with an upgrader skin class. A skin class handles the logging for an upgrade and informs a user about the progress and failures.
The current Ajax install/update handlers are using the `Automatic_Upgrader_Skin` class because during an Ajax request no output is intended. The difference between Ajax updates and automatic updates is that you will see the full log (usually by email) while Ajax updates focus only on success or failure. For that `Automatic_Upgrader_Skin` has one disadvantage: It doesn't provide a way to retrieve failure messages which were passed through `WP_Upgrader_Skin::error()` by the upgrader.
To solve this issue a new skin `WP_Ajax_Upgrader_Skin` has been introduced. The skin extends `Automatic_Upgrader_Skin` and overrides the `error()` and `feedback()` methods to intercept all errors, which can be a `WP_Error` object or a string.
This updates all four Ajax handler for installing/updating themes/plugins to use the new skin. They now also check the skin for any intercepted errors and pass them on to the user.
Props flixos90, obenland, ocean90.
Props DrewAPicture, pento for review.
Fixes <a href="https://core.trac.wordpress.org/ticket/37531">#37531</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpupgraderskinsphp">trunk/src/wp-admin/includes/class-wp-upgrader-skins.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpupgraderphp">trunk/src/wp-admin/includes/class-wp-upgrader.php</a></li>
<li><a href="#trunksrcwpadminjsupdatesjs">trunk/src/wp-admin/js/updates.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpajaxupgraderskinphp">trunk/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2016-08-04 22:12:21 UTC (rev 38198)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2016-08-04 22:17:44 UTC (rev 38199)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3345,16 +3345,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_error( $status );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upgrader = new Theme_Upgrader( new Automatic_Upgrader_Skin() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Theme_Upgrader( $skin );
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = $upgrader->install( $api->download_link );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status['debug'] = $upgrader->skin->get_upgrade_messages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status['debug'] = $skin->get_upgrade_messages();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $result ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status['errorCode'] = $result->get_error_code();
</ins><span class="cx" style="display: block; padding: 0 10px"> $status['errorMessage'] = $result->get_error_message();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_error( $status );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->get_error_code() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_null( $result ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_filesystem;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3437,14 +3446,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_themes();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upgrader = new Theme_Upgrader( new Automatic_Upgrader_Skin() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Theme_Upgrader( $skin );
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = $upgrader->bulk_upgrade( array( $stylesheet ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status['debug'] = $upgrader->skin->get_upgrade_messages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status['debug'] = $skin->get_upgrade_messages();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $result ) && ! empty( $result[ $stylesheet ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->get_error_code() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
+ } elseif ( is_array( $result ) && ! empty( $result[ $stylesheet ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Theme is already at the latest version.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === $result[ $stylesheet ] ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3458,10 +3475,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_success( $status );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( is_wp_error( $upgrader->skin->result ) ) {
- $status['errorCode'] = $upgrader->skin->result->get_error_code();
- $status['errorMessage'] = $upgrader->skin->result->get_error_message();
- wp_send_json_error( $status );
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( false === $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_filesystem;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3594,16 +3607,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $status['pluginName'] = $api->name;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Plugin_Upgrader( $skin );
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = $upgrader->install( $api->download_link );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status['debug'] = $upgrader->skin->get_upgrade_messages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status['debug'] = $skin->get_upgrade_messages();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $result ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status['errorCode'] = $result->get_error_code();
</ins><span class="cx" style="display: block; padding: 0 10px"> $status['errorMessage'] = $result->get_error_message();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_error( $status );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->get_error_code() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_null( $result ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_filesystem;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3680,19 +3702,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_plugins();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $skin = new Automatic_Upgrader_Skin();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skin = new WP_Ajax_Upgrader_Skin();
</ins><span class="cx" style="display: block; padding: 0 10px"> $upgrader = new Plugin_Upgrader( $skin );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $upgrader->bulk_upgrade( array( $plugin ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $status['debug'] = $upgrader->skin->get_upgrade_messages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $status['debug'] = $skin->get_upgrade_messages();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $result ) && empty( $result[ $plugin ] ) && is_wp_error( $skin->result ) ) {
- $result = $skin->result;
- }
-
- if ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->get_error_code() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
+ } elseif ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugin_update_data = current( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3716,9 +3741,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_success( $status );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( is_wp_error( $result ) ) {
- $status['errorMessage'] = $result->get_error_message();
- wp_send_json_error( $status );
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( false === $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_filesystem;
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpajaxupgraderskinphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php (rev 0)
+++ trunk/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php 2016-08-04 22:17:44 UTC (rev 38199)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,132 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Upgrader API: WP_Ajax_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Upgrader Skin for Ajax WordPress upgrades.
+ *
+ * This skin is designed to be used for Ajax updates.
+ *
+ * @since 4.6.0
+ *
+ * @see Automatic_Upgrader_Skin
+ */
+class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
+
+ /**
+ * Holds the WP_Error object.
+ *
+ * @since 4.6.0
+ * @access protected
+ * @var null|WP_Error
+ */
+ protected $errors = null;
+
+ /**
+ * Constructor.
+ *
+ * @since 4.6.0
+ * @access public
+ *
+ * @param array $args Options for the upgrader, see WP_Upgrader_Skin::__construct().
+ */
+ public function __construct( $args = array() ) {
+ parent::__construct( $args );
+
+ $this->errors = new WP_Error();
+ }
+
+ /**
+ * Retrieves the list of errors.
+ *
+ * @since 4.6.0
+ * @access public
+ *
+ * @return WP_Error Errors during an upgrade.
+ */
+ public function get_errors() {
+ return $this->errors;
+ }
+
+ /**
+ * Retrieves a string for error messages.
+ *
+ * @since 4.6.0
+ * @access public
+ *
+ * @return string Error messages during an upgrade.
+ */
+ public function get_error_messages() {
+ $messages = array();
+
+ foreach ( $this->errors->get_error_codes() as $error_code ) {
+ if ( $this->errors->get_error_data( $error_code ) && is_string( $this->errors->get_error_data( $error_code ) ) ) {
+ $messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $this->errors->get_error_data( $error_code ) ) );
+ } else {
+ $messages[] = $this->errors->get_error_message( $error_code );
+ }
+ }
+
+ return implode( ', ', $messages );
+ }
+
+ /**
+ * Stores a log entry for an error.
+ *
+ * @since 4.6.0
+ * @access public
+ *
+ * @param string|WP_Error $errors Errors.
+ */
+ public function error( $errors ) {
+ if ( is_string( $errors ) ) {
+ $string = $errors;
+ if ( ! empty( $this->upgrader->strings[ $string ] ) ) {
+ $string = $this->upgrader->strings[ $string ];
+ }
+
+ if ( false !== strpos( $string, '%' ) ) {
+ $args = func_get_args();
+ $args = array_splice( $args, 1 );
+ if ( ! empty( $args ) ) {
+ $string = vsprintf( $string, $args );
+ }
+ }
+
+ // Count existing errors to generate an unique error code.
+ $errors_count = count( $errors->get_error_codes() );
+ $this->errors->add( 'unknown_upgrade_error_' . $errors_count + 1 , $string );
+ } elseif ( is_wp_error( $errors ) ) {
+ foreach ( $errors->get_error_codes() as $error_code ) {
+ $this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) );
+ }
+ }
+
+ $args = func_get_args();
+ call_user_func_array( array( $this, 'parent::error' ), $args );
+ }
+
+ /**
+ * Stores a log entry.
+ *
+ * @since 4.6.0
+ * @access public
+ *
+ * @param string|array|WP_Error $data Log entry data.
+ */
+ public function feedback( $data ) {
+ if ( is_wp_error( $data ) ) {
+ foreach ( $data->get_error_codes() as $error_code ) {
+ $this->errors->add( $error_code, $data->get_error_message( $error_code ), $data->get_error_data( $error_code ) );
+ }
+ }
+
+ $args = func_get_args();
+ call_user_func_array( array( $this, 'parent::feedback' ), $args );
+ }
+}
</ins></span></pre></div>
<a id="trunksrcwpadminincludesclasswpupgraderskinsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-upgrader-skins.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-upgrader-skins.php 2016-08-04 22:12:21 UTC (rev 38198)
+++ trunk/src/wp-admin/includes/class-wp-upgrader-skins.php 2016-08-04 22:17:44 UTC (rev 38199)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,3 +36,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Automatic_Upgrader_Skin class */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/** WP_Ajax_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
</ins></span></pre></div>
<a id="trunksrcwpadminincludesclasswpupgraderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-upgrader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-upgrader.php 2016-08-04 22:12:21 UTC (rev 38198)
+++ trunk/src/wp-admin/includes/class-wp-upgrader.php 2016-08-04 22:17:44 UTC (rev 38199)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,6 +39,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Automatic_Upgrader_Skin class */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** WP_Ajax_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Core class used for upgrading/installing a local set of files via
</span><span class="cx" style="display: block; padding: 0 10px"> * the Filesystem Abstraction classes from a Zip file.
</span></span></pre></div>
<a id="trunksrcwpadminjsupdatesjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/updates.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/updates.js 2016-08-04 22:12:21 UTC (rev 38198)
+++ trunk/src/wp-admin/js/updates.js 2016-08-04 22:17:44 UTC (rev 38199)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {string=} response.errorCode Optional. Error code for an error that occurred.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> wp.updates.ajaxAlways = function( response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! response.errorCode && 'unable_to_connect_to_filesystem' !== response.errorCode ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! response.errorCode || 'unable_to_connect_to_filesystem' !== response.errorCode ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp.updates.ajaxLocked = false;
</span><span class="cx" style="display: block; padding: 0 10px"> wp.updates.queueChecker();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1533,7 +1533,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {boolean} Whether there is an error that needs to be handled or not.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> wp.updates.maybeHandleCredentialError = function( response, action ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( response.errorCode && 'unable_to_connect_to_filesystem' === response.errorCode ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp.updates.shouldRequestFilesystemCredentials && response.errorCode && 'unable_to_connect_to_filesystem' === response.errorCode ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp.updates.credentialError( response, action );
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>