Make WordPress Core

Ticket #36010: 36010.3.diff

File 36010.3.diff, 3.8 KB (added by dcavins, 9 months ago)

Refreshed patch.

  • src/js/_enqueues/admin/user-profile.js

    diff --git src/js/_enqueues/admin/user-profile.js src/js/_enqueues/admin/user-profile.js
    index 5614078bb5..04d72117e1 100644
     
    3535                        $pass1.val( $pass1.data( 'pw' ) );
    3636                        $pass1.trigger( 'pwupdate' );
    3737                        showOrHideWeakPasswordCheckbox();
     38                        showOrHidePasswordHint();
    3839                } else {
    3940                        // zxcvbn loaded after the user entered password, check strength.
    4041                        check_pass_strength();
    4142                        showOrHideWeakPasswordCheckbox();
     43                        showOrHidePasswordHint();
    4244                }
    4345
    4446                /*
    … …  
    8385                        // Refresh password strength area.
    8486                        $pass1.removeClass( 'short bad good strong' );
    8587                        showOrHideWeakPasswordCheckbox();
     88                        showOrHidePasswordHint();
    8689                } );
    8790
    8891                bindCapsLockWarning( $pass1 );
    … …  
    439442                }
    440443        }
    441444
     445        function showOrHidePasswordHint() {
     446                var passStrengthResult = $('#pass-strength-result');
     447
     448                if ( passStrengthResult.length ) {
     449                        var passStrength = passStrengthResult[0];
     450
     451                        if ( passStrength.className ) {
     452                                var isWeak = $( passStrength ).is( '.short, .bad' );
     453
     454                                $( '.indicator-hint' ).toggle( isWeak );
     455                        }
     456                }
     457        }
     458
    442459        // Debug information copy section.
    443460        clipboard.on( 'success', function( e ) {
    444461                var triggerElement = $( e.trigger ),
  • src/wp-admin/css/login.css

    diff --git src/wp-admin/css/login.css src/wp-admin/css/login.css
    index bd14b6db22..7666f9a117 100644
    p {  
    374374
    375375.login #pass-strength-result {
    376376        font-weight: 600;
    377         margin: -1px 5px 16px 0;
     377        margin: 8px 5px 16px 0;
    378378        padding: 6px 5px;
    379379        text-align: center;
    380380        width: 100%;
  • src/wp-login.php

    diff --git src/wp-login.php src/wp-login.php
    index c9db31826b..a279556049 100644
    switch ( $action ) {  
    911911                        ?>
    912912                        <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    913913                        <p class="submit">
    914                                 <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Get New Password' ); ?>" />
     914                                <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Start Password Reset' ); ?>" />
    915915                        </p>
    916916                </form>
    917917
    … … switch ( $action ) {  
    10011001                if ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {
    10021002                        reset_password( $user, $_POST['pass1'] );
    10031003                        setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
     1004                        $new_pass_login_url = add_query_arg( array( 'reset-pass' => 'success' ), wp_login_url() );
    10041005                        login_header(
    10051006                                __( 'Password Reset' ),
    10061007                                wp_get_admin_notice(
    1007                                         __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a>',
     1008                                        __( 'Your password has been reset.' ) . ' <a href="' . esc_url( $new_pass_login_url ) . '">' . __( 'Log in' ) . '</a>',
    10081009                                        array(
    10091010                                                'type'               => 'info',
    10101011                                                'additional_classes' => array( 'message', 'reset-pass' ),
    … … switch ( $action ) {  
    14471448                                $errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' );
    14481449                        } elseif ( isset( $_GET['registration'] ) && 'disabled' === $_GET['registration'] ) {
    14491450                                $errors->add( 'registerdisabled', __( '<strong>Error:</strong> User registration is currently not allowed.' ) );
     1451                        } elseif ( isset( $_GET['reset-pass'] ) && 'success' === $_GET['reset-pass'] ) {
     1452                                $errors->add( 'passreset', __( 'Using your new password, log in below.' ), 'message' );
    14501453                        } elseif ( str_contains( $redirect_to, 'about.php?updated' ) ) {
    14511454                                $errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what&#8217;s new.' ), 'message' );
    14521455                        } elseif ( WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED === $action ) {