<!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>[48455] trunk/src/wp-admin/includes: Upgrade/Install: Simplify compatibility checks for uploaded plugins and themes for better readability.</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 { white-space: pre-line; 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/48455">48455</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/48455","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-07-13 13:33:32 +0000 (Mon, 13 Jul 2020)</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: Simplify compatibility checks for uploaded plugins and themes for better readability.

Use `$new_plugin_data` and `$new_theme_data` as a shorthand for the corresponding `$this->upgrader` properties.

Follow-up to <a href="https://core.trac.wordpress.org/changeset/48390">[48390]</a>, <a href="https://core.trac.wordpress.org/changeset/48448">[48448]</a>.

Props afragen.
See <a href="https://core.trac.wordpress.org/ticket/9757">#9757</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclassplugininstallerskinphp">trunk/src/wp-admin/includes/class-plugin-installer-skin.php</a></li>
<li><a href="#trunksrcwpadminincludesclassthemeinstallerskinphp">trunk/src/wp-admin/includes/class-theme-installer-skin.php</a></li>
<li><a href="#trunksrcwpadminincludesclassthemeupgraderphp">trunk/src/wp-admin/includes/class-theme-upgrader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclassplugininstallerskinphp"></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-plugin-installer-skin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-plugin-installer-skin.php       2020-07-12 21:18:38 UTC (rev 48454)
+++ trunk/src/wp-admin/includes/class-plugin-installer-skin.php 2020-07-13 13:33:32 UTC (rev 48455)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $folder = ltrim( substr( $folder, strlen( WP_PLUGIN_DIR ) ), '/' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $current_plugin_data = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                foreach ( get_plugins() as $plugin => $plugin_data ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $all_plugins         = get_plugins();
+
+               foreach ( $all_plugins as $plugin => $plugin_data ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( strrpos( $plugin, $folder ) !== 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,13 +196,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $current_plugin_data = $plugin_data;
</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">-                if ( empty( $current_plugin_data ) || empty( $this->upgrader->new_plugin_data ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $new_plugin_data = $this->upgrader->new_plugin_data;
+
+               if ( ! $current_plugin_data || ! $new_plugin_data ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         return false;
</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">                echo '<h2 class="update-from-upload-heading">' . esc_html( __( 'This plugin is already installed.' ) ) . '</h2>';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->is_downgrading = version_compare( $current_plugin_data['Version'], $this->upgrader->new_plugin_data['Version'], '>' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->is_downgrading = version_compare( $current_plugin_data['Version'], $new_plugin_data['Version'], '>' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $rows = array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'Name'        => __( 'Plugin name' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +222,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $rows as $field => $label ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $old_value = ! empty( $current_plugin_data[ $field ] ) ? (string) $current_plugin_data[ $field ] : '-';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $new_value = ! empty( $this->upgrader->new_plugin_data[ $field ] ) ? (string) $this->upgrader->new_plugin_data[ $field ] : '-';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $new_value = ! empty( $new_plugin_data[ $field ] ) ? (string) $new_plugin_data[ $field ] : '-';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $is_same_plugin = $is_same_plugin && ( $old_value === $new_value );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -241,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array  $current_plugin_data Array with current plugin data.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array  $new_plugin_data     Array with uploaded plugin data.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                echo apply_filters( 'install_plugin_ovewrite_comparison', $table, $current_plugin_data, $this->upgrader->new_plugin_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         echo apply_filters( 'install_plugin_ovewrite_comparison', $table, $current_plugin_data, $new_plugin_data );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $install_actions = array();
</span><span class="cx" style="display: block; padding: 0 10px">                $can_update      = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,14 +253,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $blocked_message  = '<p>' . esc_html( __( 'The plugin cannot be updated due to the following:' ) ) . '</p>';
</span><span class="cx" style="display: block; padding: 0 10px">                $blocked_message .= '<ul class="ul-disc">';
</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 ( ! empty( $this->upgrader->new_plugin_data['RequiresPHP'] )
-                       && ! is_php_version_compatible( $this->upgrader->new_plugin_data['RequiresPHP'] )
-               ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null;
+               $requires_wp  = isset( $new_plugin_data['RequiresWP'] ) ? $new_plugin_data['RequiresWP'] : null;
+
+               if ( ! is_php_version_compatible( $requires_php ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $error = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: 1: Current PHP version, 2: Version required by the uploaded plugin. */
</span><span class="cx" style="display: block; padding: 0 10px">                                __( 'The PHP version on your server is %1$s, however the uploaded plugin requires %2$s.' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                phpversion(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $this->upgrader->new_plugin_data['RequiresPHP']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $requires_php
</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">                        $blocked_message .= '<li>' . esc_html( $error ) . '</li>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -263,14 +268,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $can_update       = false;
</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">-                if ( ! empty( $this->upgrader->new_plugin_data['RequiresWP'] )
-                       && ! is_wp_version_compatible( $this->upgrader->new_plugin_data['RequiresWP'] )
-               ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! is_wp_version_compatible( $requires_wp ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $error = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: 1: Current WordPress version, 2: Version required by the uploaded plugin. */
</span><span class="cx" style="display: block; padding: 0 10px">                                __( 'Your WordPress version is %1$s, however the uploaded plugin requires %2$s.' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $GLOBALS['wp_version'],
-                               $this->upgrader->new_plugin_data['RequiresWP']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         get_bloginfo( 'version' ),
+                               $requires_wp
</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">                        $blocked_message .= '<li>' . esc_html( $error ) . '</li>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,7 +327,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param object   $api             Object containing WordPress.org API plugin data.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array    $new_plugin_data Array with uploaded plugin data.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $install_actions = apply_filters( 'install_plugin_ovewrite_actions', $install_actions, $this->api, $this->upgrader->new_plugin_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $install_actions = apply_filters( 'install_plugin_ovewrite_actions', $install_actions, $this->api, $new_plugin_data );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! empty( $install_actions ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        printf(
</span></span></pre></div>
<a id="trunksrcwpadminincludesclassthemeinstallerskinphp"></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-theme-installer-skin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-theme-installer-skin.php        2020-07-12 21:18:38 UTC (rev 48454)
+++ trunk/src/wp-admin/includes/class-theme-installer-skin.php  2020-07-13 13:33:32 UTC (rev 48455)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $current_theme_data = $theme;
</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">-                if ( empty( $current_theme_data ) || empty( $this->upgrader->new_theme_data ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $new_theme_data = $this->upgrader->new_theme_data;
+
+               if ( ! $current_theme_data || ! $new_theme_data ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         return false;
</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">@@ -218,11 +220,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->feedback( 'current_theme_has_errors', $current_theme_data->errors()->get_error_message() );
</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">-                $this->is_downgrading = version_compare( $current_theme_data['Version'], $this->upgrader->new_theme_data['Version'], '>' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->is_downgrading = version_compare( $current_theme_data['Version'], $new_theme_data['Version'], '>' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $is_invalid_parent = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! empty( $this->upgrader->new_theme_data['Template'] ) ) {
-                       $is_invalid_parent = ! in_array( $this->upgrader->new_theme_data['Template'], array_keys( $all_themes ), true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! empty( $new_theme_data['Template'] ) ) {
+                       $is_invalid_parent = ! in_array( $new_theme_data['Template'], array_keys( $all_themes ), true );
</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">                $rows = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $old_value = $current_theme_data->display( $field, false );
</span><span class="cx" style="display: block; padding: 0 10px">                        $old_value = $old_value ? (string) $old_value : '-';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $new_value = ! empty( $this->upgrader->new_theme_data[ $field ] ) ? (string) $this->upgrader->new_theme_data[ $field ] : '-';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $new_value = ! empty( $new_theme_data[ $field ] ) ? (string) $new_theme_data[ $field ] : '-';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $old_value === $new_value && '-' === $new_value && 'Template' === $field ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,7 +278,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array  $current_theme_data Array with current theme data.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array  $new_theme_data     Array with uploaded theme data.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                echo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $this->upgrader->new_theme_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         echo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $new_theme_data );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $install_actions = array();
</span><span class="cx" style="display: block; padding: 0 10px">                $can_update      = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,14 +286,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $blocked_message  = '<p>' . esc_html( __( 'The theme cannot be updated due to the following:' ) ) . '</p>';
</span><span class="cx" style="display: block; padding: 0 10px">                $blocked_message .= '<ul class="ul-disc">';
</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 ( ! empty( $this->upgrader->new_theme_data['RequiresPHP'] )
-                       && ! is_php_version_compatible( $this->upgrader->new_theme_data['RequiresPHP'] )
-               ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null;
+               $requires_wp  = isset( $new_theme_data['RequiresWP'] ) ? $new_theme_data['RequiresWP'] : null;
+
+               if ( ! is_php_version_compatible( $requires_php ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $error = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: 1: Current PHP version, 2: Version required by the uploaded theme. */
</span><span class="cx" style="display: block; padding: 0 10px">                                __( 'The PHP version on your server is %1$s, however the uploaded theme requires %2$s.' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                phpversion(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $this->upgrader->new_theme_data['RequiresPHP']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $requires_php
</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">                        $blocked_message .= '<li>' . esc_html( $error ) . '</li>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,14 +301,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $can_update       = false;
</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">-                if ( ! empty( $this->upgrader->new_theme_data['RequiresWP'] )
-                       && ! is_wp_version_compatible( $this->upgrader->new_theme_data['RequiresWP'] )
-               ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! is_wp_version_compatible( $requires_wp ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $error = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */
</span><span class="cx" style="display: block; padding: 0 10px">                                __( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $GLOBALS['wp_version'],
-                               $this->upgrader->new_theme_data['RequiresWP']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         get_bloginfo( 'version' ),
+                               $requires_wp
</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">                        $blocked_message .= '<li>' . esc_html( $error ) . '</li>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,7 +360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param object   $api             Object containing WordPress.org API theme data.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array    $new_theme_data  Array with uploaded theme data.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $install_actions = apply_filters( 'install_theme_ovewrite_actions', $install_actions, $this->api, $this->upgrader->new_theme_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $install_actions = apply_filters( 'install_theme_ovewrite_actions', $install_actions, $this->api, $new_theme_data );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! empty( $install_actions ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        printf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -371,5 +372,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return true;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclassthemeupgraderphp"></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-theme-upgrader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-theme-upgrader.php      2020-07-12 21:18:38 UTC (rev 48454)
+++ trunk/src/wp-admin/includes/class-theme-upgrader.php        2020-07-13 13:33:32 UTC (rev 48455)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,9 +273,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                         *
</span><span class="cx" style="display: block; padding: 0 10px">                         * @since 5.5.0
</span><span class="cx" style="display: block; padding: 0 10px">                         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                         * @param string  $package          The package file.
-                        * @param array   $new_plugin_data  The new theme data.
-                        * @param string  $package_type     The package type (plugin or theme).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                  * @param string  $package        The package file.
+                        * @param array   $new_theme_data The new theme data.
+                        * @param string  $package_type   The package type (plugin or theme).
</ins><span class="cx" style="display: block; padding: 0 10px">                          */
</span><span class="cx" style="display: block; padding: 0 10px">                        do_action( 'upgrader_overwrote_package', $package, $this->new_theme_data, 'theme' );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre>
</div>
</div>

</body>
</html>