<!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>[13134] trunk/wp-admin: First pass at allowing username/
 password selection upon install.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13134">13134</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-02-14 03:07:47 +0000 (Sun, 14 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>First pass at allowing username/password selection upon install. Includes some extra cleanup of the patch. Props dancole. See <a href="http://trac.wordpress.org/ticket/10396">#10396</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincssinstallcss">trunk/wp-admin/css/install.css</a></li>
<li><a href="#trunkwpadmincssinstalldevcss">trunk/wp-admin/css/install.dev.css</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadmininstallphp">trunk/wp-admin/install.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincssinstallcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/install.css (13133 => 13134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/install.css        2010-02-14 02:47:45 UTC (rev 13133)
+++ trunk/wp-admin/css/install.css        2010-02-14 03:07:47 UTC (rev 13134)
</span><span class="lines">@@ -1 +1 @@
</span><del>-html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:&quot;Lucida Grande&quot;,Verdana,Arial,&quot;Bitstream Vera Sans&quot;,sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,&quot;Times New Roman&quot;,Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:&quot;Lucida Grande&quot;,Verdana,Arial,&quot;Bitstream Vera Sans&quot;,sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}
</del><span class="cx">\ No newline at end of file
</span><ins>+html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:&quot;Lucida Grande&quot;,Verdana,Arial,&quot;Bitstream Vera Sans&quot;,sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,&quot;Times New Roman&quot;,Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:&quot;Lucida Grande&quot;,Verdana,Arial,&quot;Bitstream Vera Sans&quot;,sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:5px;text-align:center;width:200px;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincssinstalldevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/install.dev.css (13133 => 13134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/install.dev.css        2010-02-14 02:47:45 UTC (rev 13133)
+++ trunk/wp-admin/css/install.dev.css        2010-02-14 03:07:47 UTC (rev 13134)
</span><span class="lines">@@ -131,3 +131,35 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #error-page code { font-family: Consolas, Monaco, Courier, monospace; }
</span><ins>+
+#pass-strength-result {
+        background-color: #eee;
+        border-color: #ddd !important;
+        border-style: solid;
+        border-width: 1px;
+        float: left;
+        margin: 12px 5px 5px 1px;
+        padding: 5px;
+        text-align: center;
+        width: 200px;
+}
+
+#pass-strength-result.bad {
+        background-color: #ffb78c;
+        border-color: #ff853c !important;
+}
+
+#pass-strength-result.good {
+        background-color: #ffec8b;
+        border-color: #ffcc00 !important;
+}
+
+#pass-strength-result.short {
+        background-color: #ffa0a0;
+        border-color: #f04040 !important;
+}
+
+#pass-strength-result.strong {
+        background-color: #c3ff88;
+        border-color: #8dff1c !important;
+}
</ins></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (13133 => 13134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-02-14 02:47:45 UTC (rev 13133)
+++ trunk/wp-admin/includes/upgrade.php        2010-02-14 03:07:47 UTC (rev 13134)
</span><span class="lines">@@ -31,9 +31,10 @@
</span><span class="cx">  * @param string $user_email User's email.
</span><span class="cx">  * @param bool $public Whether blog is public.
</span><span class="cx">  * @param null $deprecated Optional. Not used.
</span><ins>+ * @param string $user_password Optional. User's chosen password. Will default to a random password.
</ins><span class="cx">  * @return array Array keys 'url', 'user_id', 'password', 'password_message'.
</span><span class="cx">  */
</span><del>-function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '' ) {
</del><ins>+function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' ) {
</ins><span class="cx">         global $wp_rewrite;
</span><span class="cx"> 
</span><span class="cx">         if ( !empty( $deprecated ) )
</span><span class="lines">@@ -60,13 +61,16 @@
</span><span class="cx">         // Create default user.  If the user already exists, the user tables are
</span><span class="cx">         // being shared among blogs.  Just set the role in that case.
</span><span class="cx">         $user_id = username_exists($user_name);
</span><del>-        if ( !$user_id ) {
-                $random_password = wp_generate_password();
</del><ins>+        $user_password = trim($user_password);
+        if ( !$user_id &amp;&amp; empty($user_password) ) {
+                $user_password = wp_generate_password();
</ins><span class="cx">                 $message = __('&lt;strong&gt;&lt;em&gt;Note that password&lt;/em&gt;&lt;/strong&gt; carefully! It is a &lt;em&gt;random&lt;/em&gt; password that was generated just for you.');
</span><del>-                $user_id = wp_create_user($user_name, $random_password, $user_email);
-                update_user_option($user_id, 'default_password_nag', true, true);
</del><ins>+                $user_id = wp_create_user($user_name, $user_password, $user_email);
+                update_user_option($user_id, 'default_password_nag', true);
+        } else if ( !$user_id ) {
+                $message = __('&lt;strong&gt;&lt;em&gt;Note that password&lt;/em&gt;&lt;/strong&gt; carefully!');
+                $user_id = wp_create_user($user_name, $user_password, $user_email);
</ins><span class="cx">         } else {
</span><del>-                $random_password = '';
</del><span class="cx">                 $message =  __('User already exists.  Password inherited.');
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -77,11 +81,11 @@
</span><span class="cx"> 
</span><span class="cx">         $wp_rewrite-&gt;flush_rules();
</span><span class="cx"> 
</span><del>-        wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);
</del><ins>+        wp_new_blog_notification($blog_title, $guessurl, $user_id, $user_password);
</ins><span class="cx"> 
</span><span class="cx">         wp_cache_flush();
</span><span class="cx"> 
</span><del>-        return array('url' =&gt; $guessurl, 'user_id' =&gt; $user_id, 'password' =&gt; $random_password, 'password_message' =&gt; $message);
</del><ins>+        return array('url' =&gt; $guessurl, 'user_id' =&gt; $user_id, 'password' =&gt; $user_password, 'password_message' =&gt; $message);
</ins><span class="cx"> }
</span><span class="cx"> endif;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmininstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/install.php (13133 => 13134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/install.php        2010-02-14 02:47:45 UTC (rev 13133)
+++ trunk/wp-admin/install.php        2010-02-14 03:07:47 UTC (rev 13134)
</span><span class="lines">@@ -20,6 +20,9 @@
</span><span class="cx"> /** Load WordPress Administration Upgrade API */
</span><span class="cx"> require_once( dirname( __FILE__ ) . '/includes/upgrade.php' );
</span><span class="cx"> 
</span><ins>+/** Load wpdb */
+require_once(dirname(dirname(__FILE__)) . '/wp-includes/wp-db.php');
+
</ins><span class="cx"> $step = isset( $_GET['step'] ) ? $_GET['step'] : 0;
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -53,11 +56,19 @@
</span><span class="cx">  * @subpackage Installer
</span><span class="cx">  */
</span><span class="cx"> function display_setup_form( $error = null ) {
</span><ins>+        global $wpdb;
+        $user_table = ( $wpdb-&gt;get_var(&quot;SHOW TABLES LIKE '$wpdb-&gt;users'&quot;) != null ) ? true : false;
+
</ins><span class="cx">         // Ensure that Blogs appear in search engines by default
</span><span class="cx">         $blog_public = 1;
</span><span class="cx">         if ( isset( $_POST ) &amp;&amp; ! empty( $_POST ) )
</span><span class="cx">                 $blog_public = isset( $_POST['blog_public'] );
</span><span class="cx"> 
</span><ins>+        $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
+        $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
+        $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : '';
+        $admin_email  = isset( $_POST['admin_email']  ) ? trim( stripslashes( $_POST['admin_email'] ) ) : '';
+
</ins><span class="cx">         if ( ! is_null( $error ) ) {
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;p&gt;&lt;?php printf( __( '&lt;strong&gt;ERROR&lt;/strong&gt;: %s' ), $error ); ?&gt;&lt;/p&gt;
</span><span class="lines">@@ -66,11 +77,33 @@
</span><span class="cx">         &lt;table class=&quot;form-table&quot;&gt;
</span><span class="cx">                 &lt;tr&gt;
</span><span class="cx">                         &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;weblog_title&quot;&gt;&lt;?php _e( 'Blog Title' ); ?&gt;&lt;/label&gt;&lt;/th&gt;
</span><del>-                        &lt;td&gt;&lt;input name=&quot;weblog_title&quot; type=&quot;text&quot; id=&quot;weblog_title&quot; size=&quot;25&quot; value=&quot;&lt;?php echo ( isset( $_POST['weblog_title'] ) ? esc_attr( $_POST['weblog_title'] ) : '' ); ?&gt;&quot; /&gt;&lt;/td&gt;
</del><ins>+                        &lt;td&gt;&lt;input name=&quot;weblog_title&quot; type=&quot;text&quot; id=&quot;weblog_title&quot; size=&quot;25&quot; value=&quot;&lt;?php echo esc_attr( $weblog_title ); ?&gt;&quot; /&gt;&lt;/td&gt;
</ins><span class="cx">                 &lt;/tr&gt;
</span><span class="cx">                 &lt;tr&gt;
</span><ins>+                        &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;user_name&quot;&gt;&lt;?php _e('User Name'); ?&gt;&lt;/label&gt;&lt;/th&gt;
+                        &lt;td&gt;
+                        &lt;?php
+                        if ( $user_table ) {
+                                _e('User(s) already exists.');
+                        } else {
+                                ?&gt;&lt;input name=&quot;user_name&quot; type=&quot;text&quot; id=&quot;user_login&quot; size=&quot;25&quot; value=&quot;&lt;?php echo esc_attr( $user_name ); ?&gt;&quot; /&gt;&lt;?php
+                        } ?&gt;
+                        &lt;/td&gt;
+                &lt;/tr&gt;
+                &lt;?php if ( ! $user_table ) : ?&gt;
+                &lt;tr&gt;
+                        &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;admin_password&quot;&gt;&lt;?php _e('Password'); ?&gt;&lt;/label&gt;&lt;/th&gt;
+                        &lt;td&gt;
+                                &lt;input name=&quot;admin_password&quot; type=&quot;password&quot; id=&quot;pass1&quot; size=&quot;25&quot; value=&quot;&lt;?php  echo esc_attr( $admin_password ); ?&gt;&quot; /&gt;
+                                &lt;br /&gt;&lt;?php _e('A password will be automatically generated for you if you leave this field blank.'); ?&gt;
+                                &lt;br /&gt;&lt;div id=&quot;pass-strength-result&quot;&gt;&lt;?php _e('Strength indicator'); ?&gt;&lt;/div&gt;
+                                &lt;p class=&quot;description indicator-hint&quot;&gt;&lt;?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! &quot; ? $ % ^ &amp;amp; ).'); ?&gt;&lt;/p&gt;
+                        &lt;/td&gt;
+                &lt;/tr&gt;
+                &lt;?php endif; ?&gt;
+                &lt;tr&gt;
</ins><span class="cx">                         &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;admin_email&quot;&gt;&lt;?php _e( 'Your E-mail' ); ?&gt;&lt;/label&gt;&lt;/th&gt;
</span><del>-                        &lt;td&gt;&lt;input name=&quot;admin_email&quot; type=&quot;text&quot; id=&quot;admin_email&quot; size=&quot;25&quot; value=&quot;&lt;?php echo ( isset( $_POST['admin_email'] ) ? esc_attr( $_POST['admin_email'] ) : '' ); ?&gt;&quot; /&gt;&lt;br /&gt;
</del><ins>+                        &lt;td&gt;&lt;input name=&quot;admin_email&quot; type=&quot;text&quot; id=&quot;admin_email&quot; size=&quot;25&quot; value=&quot;&lt;?php  echo esc_attr( $admin_email ); ?&gt;&quot; /&gt;&lt;br /&gt;
</ins><span class="cx">                         &lt;?php _e( 'Double-check your email address before continuing.' ); ?&gt;&lt;/td&gt;
</span><span class="cx">                 &lt;/tr&gt;
</span><span class="cx">                 &lt;tr&gt;
</span><span class="lines">@@ -125,13 +158,19 @@
</span><span class="cx"> 
</span><span class="cx">                 display_header();
</span><span class="cx">                 // Fill in the data we gathered
</span><del>-                $weblog_title = isset( $_POST['weblog_title'] ) ? stripslashes( $_POST['weblog_title'] ) : '';
-                $admin_email  = isset( $_POST['admin_email']  ) ? stripslashes( $_POST['admin_email'] ) : '';
</del><ins>+                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
+                $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
+                $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : '';
+                $admin_email  = isset( $_POST['admin_email']  ) ?trim( stripslashes( $_POST['admin_email'] ) ) : '';
</ins><span class="cx">                 $public       = isset( $_POST['blog_public']  ) ? (int) $_POST['blog_public'] : 0;
</span><span class="cx">                 // check e-mail address
</span><span class="cx">                 $error = false;
</span><del>-                if ( empty( $admin_email ) ) {
</del><ins>+                if ( empty( $user_name ) ) {
</ins><span class="cx">                         // TODO: poka-yoke
</span><ins>+                        display_setup_form( __('you must provide a valid user name.') );
+                        $error = true;
+                } else if ( empty( $admin_email ) ) {
+                        // TODO: poka-yoke
</ins><span class="cx">                         display_setup_form( __( 'you must provide an e-mail address.' ) );
</span><span class="cx">                         $error = true;
</span><span class="cx">                 } elseif ( ! is_email( $admin_email ) ) {
</span><span class="lines">@@ -142,7 +181,7 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( $error === false ) {
</span><span class="cx">                         $wpdb-&gt;show_errors();
</span><del>-                        $result = wp_install( $weblog_title, 'admin', $admin_email, $public );
</del><ins>+                        $result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password);
</ins><span class="cx">                         extract( $result, EXTR_SKIP );
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -153,13 +192,13 @@
</span><span class="cx"> &lt;table class=&quot;form-table&quot;&gt;
</span><span class="cx">         &lt;tr&gt;
</span><span class="cx">                 &lt;th&gt;&lt;?php _e( 'Username' ); ?&gt;&lt;/th&gt;
</span><del>-                &lt;td&gt;&lt;code&gt;admin&lt;/code&gt;&lt;/td&gt;
</del><ins>+                &lt;td&gt;&lt;code&gt;&lt;?php echo esc_html($user_name); ?&gt;&lt;/code&gt;&lt;/td&gt;
</ins><span class="cx">         &lt;/tr&gt;
</span><span class="cx">         &lt;tr&gt;
</span><span class="cx">                 &lt;th&gt;&lt;?php _e( 'Password' ); ?&gt;&lt;/th&gt;
</span><span class="cx">                 &lt;td&gt;&lt;?php
</span><span class="cx">                 if ( ! empty( $password ) )
</span><del>-                        echo &quot;&lt;code&gt;$password&lt;/code&gt;&lt;br /&gt;&quot;;
</del><ins>+                        echo '&lt;code&gt;'. esc_html($password) .'&lt;/code&gt;&lt;br /&gt;';
</ins><span class="cx">                 echo &quot;&lt;p&gt;$password_message&lt;/p&gt;&quot;; ?&gt;
</span><span class="cx">                 &lt;/td&gt;
</span><span class="cx">         &lt;/tr&gt;
</span><span class="lines">@@ -173,5 +212,22 @@
</span><span class="cx"> }
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;var t = document.getElementById('weblog_title'); if (t){ t.focus(); }&lt;/script&gt;
</span><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../wp-includes/js/jquery/jquery.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;js/password-strength-meter.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;js/user-profile.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;js/utils.js&quot;&gt;&lt;/script&gt;
+&lt;script type='text/javascript'&gt;
+/* &lt;![CDATA[ */
+try{convertEntities(commonL10n);}catch(e){};
+var pwsL10n = {
+ empty: &quot;Strength indicator&quot;,
+ short: &quot;Very weak&quot;,
+ bad: &quot;Weak&quot;,
+ good: &quot;Medium&quot;,
+ strong: &quot;Strong&quot;
+};
+try{convertEntities(pwsL10n);}catch(e){};
+/* ]]&gt; */
+&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre>
</div>
</div>

</body>
</html>