-<form action="<?php echo $form_post ?>" method="post">
-<div class="wrap">
-<h2><?php _e('Connection Information') ?></h2>
-<p><?php _e('To perform the requested action, connection information is required.') ?></p>
-
-<table class="form-table">
-<tr valign="top">
-<th scope="row"><label for="hostname"><?php _e('Hostname') ?></label></th>
-<td><input name="hostname" type="text" id="hostname" value="<?php echo attribute_escape($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php if( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td>
-</tr>
-
-<tr valign="top">
-<th scope="row"><label for="username"><?php _e('Username') ?></label></th>
-<td><input name="username" type="text" id="username" value="<?php echo attribute_escape($username) ?>"<?php if( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td>
-</tr>
-
-<tr valign="top">
-<th scope="row"><label for="password"><?php _e('Password') ?></label></th>
-<td><input name="password" type="password" id="password" value=""<?php if( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /><?php if( defined('FTP_PASS') && !empty($password) ) echo '<em>'.__('(Password not shown)').'</em>'; ?></td>
-</tr>
-
-<tr id="ssh_keys" valign="top" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>">
-<th scope="row"><?php _e('Authentication Keys') ?>
-<div class="key-labels textright">
-<label for="public_key"><?php _e('Public Key:') ?></label ><br />
-<label for="private_key"><?php _e('Private Key:') ?></label>
-</div></th>
-<td><br /><input name="public_key" type="text" id="public_key" value=""<?php if( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value=""<?php if( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" />
-<div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td>
-</tr>
-
-<tr valign="top">
-<th scope="row"><?php _e('Connection Type') ?></th>
-<td>
-<fieldset><legend class="hidden"><?php _e('Connection Type') ?></legend>
-<label><input id="ftp" name="connection_type" type="radio" value="ftp" <?php checked('ftp', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTP') ?></label><br />
-<label><input id="ftps" name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); if ( defined('FTP_SSH') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTPS (SSL)') ?></label><br />
-<?php if ( extension_loaded('ssh2') ) { ?><label><input id="ssh" name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('SSH') ?></label><?php } ?>
-</fieldset>
-</td>
-</tr>
-</table>
-
-<?php if ( isset( $_POST['version'] ) ) : ?>
-<input type="hidden" name="version" value="<?php echo attribute_escape($_POST['version']) ?>" />
-<?php endif; ?>
-<?php if ( isset( $_POST['locale'] ) ) : ?>
-<input type="hidden" name="locale" value="<?php echo attribute_escape($_POST['locale']) ?>" />
+<form action="<?php echo esc_url( $form_post ) ?>" method="post">
+<div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form">
+<h3 id="request-filesystem-credentials-title"><?php _e( 'Connection Information' ) ?></h3>
+<p id="request-filesystem-credentials-desc"><?php
+ $label_user = __('Username');
+ $label_pass = __('Password');
+ _e('To perform the requested action, WordPress needs to access your web server.');
+ echo ' ';
+ if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
+ if ( isset( $types['ssh'] ) ) {
+ _e('Please enter your FTP or SSH credentials to proceed.');
+ $label_user = __('FTP/SSH Username');
+ $label_pass = __('FTP/SSH Password');
+ } else {
+ _e('Please enter your FTP credentials to proceed.');
+ $label_user = __('FTP Username');
+ $label_pass = __('FTP Password');
+ }
+ echo ' ';
+ }
+ _e('If you do not remember your credentials, you should contact your web host.');
+?></p>
+<label for="hostname">
+ <span class="field-title"><?php _e( 'Hostname' ) ?></span>
+ <input name="hostname" type="text" id="hostname" aria-describedby="request-filesystem-credentials-desc" class="code" placeholder="<?php esc_attr_e( 'example: www.wordpress.org' ) ?>" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php disabled( defined('FTP_HOST') ); ?> />
+</label>
+<div class="ftp-username">
+ <label for="username">
+ <span class="field-title"><?php echo $label_user; ?></span>
+ <input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php disabled( defined('FTP_USER') ); ?> />
+ </label>
+</div>
+<div class="ftp-password">
+ <label for="password">
+ <span class="field-title"><?php echo $label_pass; ?></span>
+ <input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> />
+ <em><?php if ( ! defined('FTP_PASS') ) _e( 'This password will not be stored on the server.' ); ?></em>
+ </label>
+</div>
+<?php if ( isset($types['ssh']) ) : ?>
+<h4><?php _e('Authentication Keys') ?></h4>
+<label for="public_key">
+ <span class="field-title"><?php _e('Public Key:') ?></span>
+ <input name="public_key" type="text" id="public_key" aria-describedby="auth-keys-desc" value="<?php echo esc_attr($public_key) ?>"<?php disabled( defined('FTP_PUBKEY') ); ?> />
+</label>
+<label for="private_key">
+ <span class="field-title"><?php _e('Private Key:') ?></span>
+ <input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> />
+</label>
+<span id="auth-keys-desc"><?php _e('Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.') ?></span>