PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
← All changes | front-end/recover.php +17 -12 3.16.3 → 4.0.3 View file →
@@ -48,9 +48,9 @@
48 48 *
49 49 */
50 50 function wppb_create_recover_password_form( $user, $post_data, $is_ajax_form = false ){
51 51 ?>
52 - <form enctype="multipart/form-data" method="post" id="wppb-recover-password" class="wppb-user-forms<?php echo ($is_ajax_form ? ' wppb-ajax-form' : ''); ?>" action="<?php echo esc_url( wppb_curpageurl() ); ?>">
52 + <form enctype="multipart/form-data" method="post" novalidate id="wppb-recover-password" class="wppb-user-forms<?php echo ($is_ajax_form ? ' wppb-ajax-form' : ''); ?>" action="<?php echo esc_url( wppb_curpageurl() ); ?>">
53 53 <ul>
54 54 <?php
55 55
56 56 if( !empty( $post_data['passw1'] ) )
@@ -109,9 +109,9 @@
109 109 *
110 110 */
111 111 function wppb_create_generate_password_form( $post_data, $is_ajax_form = false ){
112 112 ?>
113 - <form enctype="multipart/form-data" method="post" id="wppb-recover-password" class="wppb-user-forms<?php echo ($is_ajax_form ? ' wppb-ajax-form' : ''); ?>" action="<?php echo esc_url( wppb_curpageurl() ); ?>">
113 + <form enctype="multipart/form-data" method="post" novalidate id="wppb-recover-password" class="wppb-user-forms<?php echo ($is_ajax_form ? ' wppb-ajax-form' : ''); ?>" action="<?php echo esc_url( wppb_curpageurl() ); ?>">
114 114 <?php
115 115 $wppb_generalSettings = get_option( 'wppb_general_settings' );
116 116
117 117 if( !empty( $wppb_generalSettings['loginWith'] ) && $wppb_generalSettings['loginWith'] == 'email' ){
@@ -130,9 +130,9 @@
130 130
131 131 $recover_input = '<ul>
132 132 <li class="wppb-form-field wppb-username-email'. apply_filters( 'wppb_recover_field_extra_css_class', '', 'username_email') .'">
133 133 <label for="username_email">'. esc_html( $username_email_label ) .'</label>
134 - <input class="text-input" name="username_email" type="text" id="username_email" value="'.esc_attr( trim( $username_email ) ).'" '. apply_filters( 'wppb_recover_password_extra_attr', '', esc_html( $username_email_label ), 'username_email' ) .' />
134 + <input class="text-input" name="username_email" type="text" id="username_email" value="'.esc_attr( trim( $username_email ) ).'" required '. apply_filters( 'wppb_recover_password_extra_attr', '', esc_html( $username_email_label ), 'username_email' ) .' />
135 135 </li><!-- .username_email --></ul>';
136 136 echo apply_filters( 'wppb_recover_password_generate_password_input', $recover_input, trim( $username_email ) ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
137 137 ?>
138 138 <p class="form-submit">
@@ -304,10 +304,17 @@
304 304 $username_email = '';
305 305
306 306 //check to see if it's an e-mail (and if this is valid/present in the database) or is a username
307 307
308 - // if we do not have an email in the posted date we try to get the email for that user
309 - if( !is_email( $username_email ) ){
308 + if( $username_email === '' ){
309 + if( !empty( $wppb_generalSettings['loginWith'] ) && $wppb_generalSettings['loginWith'] == 'email' )
310 + $warning = __( 'Please enter your email address.', 'profile-builder' );
311 + else
312 + $warning = __( 'Please enter your username or email address.', 'profile-builder' );
313 + $warning = apply_filters( 'wppb_recover_password_sent_message_empty', $warning );
314 + $output .= wppb_password_recovery_warning( $warning, 'wppb_recover_password_displayed_message1' );
315 + } elseif ( !is_email( $username_email ) ){
316 + // if we do not have an email in the posted date we try to get the email for that user
310 317 // When filter is enabled and login is set to email only, do not allow username for password reset
311 318 if ( apply_filters( 'wppb_recover_password_require_email_when_login_with_email', false ) && !empty( $wppb_generalSettings['loginWith'] ) && $wppb_generalSettings['loginWith'] == 'email' ) {
312 319 $warning = __( 'Please enter your email address to request a password reset.', 'profile-builder' );
313 320 $warning = apply_filters( 'wppb_recover_password_sent_message_username_not_allowed', $warning );
@@ -405,9 +412,9 @@
405 412 // if there is no reCAPTCHA error show the invalid email address error
406 413 if( $warning === '' ) {
407 414 $warning = __('The email address entered wasn\'t found in the database!', 'profile-builder').'<br/>'.__('Please check that you entered the correct email address.', 'profile-builder');
408 415 $warning = apply_filters('wppb_recover_password_sent_message2', $warning);
409 - $output .= '<p class="wppb-warning">'.$warning.'</p>';
416 + $output .= '<p class="wppb-warning" role="alert">'.$warning.'</p>';
410 417 } else {
411 418 $output .= $warning;
412 419 }
413 420 }
@@ -499,10 +506,8 @@
499 506 $redirect_url = wppb_get_redirect_url( 'normal', 'after_success_password_reset', '', sanitize_user( $user_info->user_login ) );
500 507
501 508 //log the user in if the option was selected
502 509 if ( apply_filters( 'wppb_recover_password_autologin', false ) ){
503 - $nonce = wp_create_nonce( 'autologin-'. sanitize_user( $user_info->ID ) .'-'. (int)( time() / 60 ) );
504 -
505 510 //use the after_login redirect if no after_success_password_reset redirect is set
506 511 if( empty( $redirect_url ) ) {
507 512 $redirect_url = wppb_get_redirect_url( 'normal', 'after_login', '', sanitize_user( $user_info->user_login ) );
508 513 $redirect_url = apply_filters( 'wppb_after_recover_and_login', $redirect_url );
@@ -510,9 +515,9 @@
510 515 if( empty( $redirect_url ) ) {
511 516 $redirect_url = remove_query_arg( 'key', wppb_curpageurl() );
512 517 }
513 518
514 - $redirect_url = add_query_arg( array( 'autologin' => 'true', 'uid' => sanitize_user( $user_info->ID ), '_wpnonce' => $nonce ), $redirect_url );
519 + $redirect_url = add_query_arg( wppb_get_autologin_query_args( $user_info->ID ), $redirect_url );
515 520 }
516 521
517 522 $redirect_delay = apply_filters( 'wppb_success_password_reset_redirect_delay', 3, sanitize_user( $user_info->user_login ) );
518 523 $redirect_message = wppb_build_redirect( $redirect_url, $redirect_delay, 'after_success_password_reset' );
@@ -577,15 +582,15 @@
577 582 }
578 583
579 584 /* function for displaying success messages on the recover password page */
580 585 function wppb_password_recovery_success( $message, $filter ){
581 - return apply_filters( $filter, '<p class="wppb-success">'.$message.'</p>', $message );
586 + return apply_filters( $filter, '<p class="wppb-success" role="alert">'.$message.'</p>', $message );
582 587 }
583 588
584 589 /* function for displaying warning messages on the recover password page */
585 590 function wppb_password_recovery_warning( $message, $filter ){
586 591 if( $message !== '' ) {
587 - return apply_filters( $filter, '<p class="wppb-warning">'.$message.'</p>', $message );
592 + return apply_filters( $filter, '<p class="wppb-warning" role="alert">'.$message.'</p>', $message );
588 593 } else {
589 594 return apply_filters( $filter, '', $message );
590 595 }
591 596 }
@@ -591,9 +596,9 @@
591 596 }
592 597
593 598 /* function for displaying error messages on the recover password page */
594 599 function wppb_password_recovery_error( $message, $filter ){
595 - return apply_filters( $filter, '<p class="wppb-error">'.$message.'</p>', $message );
600 + return apply_filters( $filter, '<p class="wppb-error" role="alert">'.$message.'</p>', $message );
596 601 }
597 602
598 603
599 604 // include missing scripts needed on Elementor Pages (Form inside an Elementor Popup)