User registration & user profile – Profile Builder - Version 2.5.7

Version Description

  • Fixed an issue with "Display name as" field on register forms
  • Recover password form now doesn't appear for logged in users
  • Fixed a wrong variable passed to a filter in Email Confirmation
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 User registration & user profile – Profile Builder
Version 2.5.7
Comparing to
See all releases

Code changes from version 2.5.6 to 2.5.7

features/email-confirmation/email-confirmation.php CHANGED
@@ -570,7 +570,7 @@ function wppb_notify_user_registration_email( $bloginfo, $user_name, $email, $se
570
  $user_message_from = apply_filters( 'wppb_register_from_email_message_user_email', $bloginfo );
571
 
572
  $user_message_subject = sprintf( __( '[%1$s] Your new account information', 'profile-builder' ), $user_message_from, $user_name, $password );
573
- $user_message_subject = apply_filters( 'wppb_register_user_email_subject_without_admin_approval', $user_message_subject, $email, $password, $user_message_subject, 'wppb_user_emailc_default_registration_email_subject' );
574
 
575
  if ( $password === NULL ) {
576
  $password = __( 'Your selected password at signup', 'profile-builder' );
570
  $user_message_from = apply_filters( 'wppb_register_from_email_message_user_email', $bloginfo );
571
 
572
  $user_message_subject = sprintf( __( '[%1$s] Your new account information', 'profile-builder' ), $user_message_from, $user_name, $password );
573
+ $user_message_subject = apply_filters( 'wppb_register_user_email_subject_without_admin_approval', $user_message_subject, $email, $password, $user_message_from, 'wppb_user_emailc_default_registration_email_subject' );
574
 
575
  if ( $password === NULL ) {
576
  $password = __( 'Your selected password at signup', 'profile-builder' );
features/functions.php CHANGED
@@ -477,19 +477,21 @@ function wppb_resize_avatar( $userID, $userlisting_size = null, $userlisting_cro
477
  //save the newly created (resized) avatar on the disc
478
  $saved_image = $image->save( $fileName_dir );
479
 
480
- /* the image save sometimes doesn't save with the desired extension so we need to see with what extension it saved it with and
481
- if it differs replace the extension in the path and url that we save as meta */
482
- $validate_saved_image = wp_check_filetype_and_ext( $saved_image['path'], $saved_image['path'] );
483
- $ext = substr( $fileName_dir,strrpos( $fileName_dir, '.', -1 ), strlen($fileName_dir) );
484
- if( !empty( $validate_saved_image['ext'] ) && $validate_saved_image['ext'] != $ext ){
485
- $fileName_url = str_replace( $ext, '.'.$validate_saved_image['ext'], $fileName_url );
486
- $fileName_dir = str_replace( $ext, '.'.$validate_saved_image['ext'], $fileName_dir );
 
 
 
 
 
 
 
487
  }
488
-
489
- update_user_meta( $userID, 'resized_avatar_'.$avatar_field['id'], $fileName_url );
490
- update_user_meta( $userID, 'resized_avatar_'.$avatar_field['id'].'_relative_path', $fileName_dir );
491
-
492
- do_action( 'wppb_after_avatar_resizing', $image, $fileName_dir, $fileName_url );
493
  }
494
  }
495
  }
477
  //save the newly created (resized) avatar on the disc
478
  $saved_image = $image->save( $fileName_dir );
479
 
480
+ if ( !is_wp_error( $saved_image ) ) {
481
+ /* the image save sometimes doesn't save with the desired extension so we need to see with what extension it saved it with and
482
+ if it differs replace the extension in the path and url that we save as meta */
483
+ $validate_saved_image = wp_check_filetype_and_ext( $saved_image['path'], $saved_image['path'] );
484
+ $ext = substr( $fileName_dir,strrpos( $fileName_dir, '.', -1 ), strlen($fileName_dir) );
485
+ if( !empty( $validate_saved_image['ext'] ) && $validate_saved_image['ext'] != $ext ){
486
+ $fileName_url = str_replace( $ext, '.'.$validate_saved_image['ext'], $fileName_url );
487
+ $fileName_dir = str_replace( $ext, '.'.$validate_saved_image['ext'], $fileName_dir );
488
+ }
489
+
490
+ update_user_meta( $userID, 'resized_avatar_'.$avatar_field['id'], $fileName_url );
491
+ update_user_meta( $userID, 'resized_avatar_'.$avatar_field['id'].'_relative_path', $fileName_dir );
492
+
493
+ do_action( 'wppb_after_avatar_resizing', $image, $fileName_dir, $fileName_url );
494
  }
 
 
 
 
 
495
  }
496
  }
497
  }
front-end/default-fields/display-name/display-name.php CHANGED
@@ -57,9 +57,11 @@ add_filter( 'wppb_output_form_field_default-display-name-publicly-as', 'wppb_dis
57
 
58
  /* handle field validation */
59
  function wppb_check_display_name_value( $message, $field, $request_data, $form_location ){
60
- if( $field['required'] == 'Yes' ){
61
- if( ( isset( $request_data['display_name'] ) && ( trim( $request_data['display_name'] ) == '' ) ) || !isset( $request_data['display_name'] ) ){
62
- return wppb_required_field_error($field["field-title"]);
 
 
63
  }
64
  }
65
 
57
 
58
  /* handle field validation */
59
  function wppb_check_display_name_value( $message, $field, $request_data, $form_location ){
60
+ if( $form_location != 'register' ){
61
+ if ($field['required'] == 'Yes') {
62
+ if ((isset($request_data['display_name']) && (trim($request_data['display_name']) == '')) || !isset($request_data['display_name'])) {
63
+ return wppb_required_field_error($field["field-title"]);
64
+ }
65
  }
66
  }
67
 
front-end/recover.php CHANGED
@@ -147,6 +147,9 @@ function wppb_front_end_password_recovery(){
147
 
148
  global $wpdb;
149
 
 
 
 
150
  ob_start();
151
 
152
  //Get general settings
147
 
148
  global $wpdb;
149
 
150
+ if( is_user_logged_in() )
151
+ return __( 'You are already logged in. You can change your password on the edit profile form.', 'profile-builder' );
152
+
153
  ob_start();
154
 
155
  //Get general settings
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Profile Builder
4
  Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
- Version: 2.5.6
7
  Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8
  Author URI: https://www.cozmoslabs.com/
9
  License: GPL2
@@ -73,7 +73,7 @@ function wppb_free_plugin_init() {
73
  *
74
  *
75
  */
76
- define('PROFILE_BUILDER_VERSION', '2.5.6' );
77
  define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
78
  define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
79
  define('WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters('wppb_server_max_upload_size_byte_constant', wppb_return_bytes(ini_get('upload_max_filesize'))));
3
  Plugin Name: Profile Builder
4
  Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
+ Version: 2.5.7
7
  Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8
  Author URI: https://www.cozmoslabs.com/
9
  License: GPL2
73
  *
74
  *
75
  */
76
+ define('PROFILE_BUILDER_VERSION', '2.5.7' );
77
  define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
78
  define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
79
  define('WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters('wppb_server_max_upload_size_byte_constant', wppb_return_bytes(ini_get('upload_max_filesize'))));
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: user registration, user profile, user registration form, user fields, extr
5
 
6
  Requires at least: 3.1
7
  Tested up to: 4.7.2
8
- Stable tag: 2.5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -150,6 +150,11 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
150
  10. Profile Builder Login Widget
151
 
152
  == Changelog ==
 
 
 
 
 
153
  = 2.5.6 =
154
  * Compatibility fix with php 7.1
155
  * Redirects code refactoring which should fix some minor issues with redirects as well
5
 
6
  Requires at least: 3.1
7
  Tested up to: 4.7.2
8
+ Stable tag: 2.5.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
150
  10. Profile Builder Login Widget
151
 
152
  == Changelog ==
153
+ = 2.5.7 =
154
+ * Fixed an issue with "Display name as" field on register forms
155
+ * Recover password form now doesn't appear for logged in users
156
+ * Fixed a wrong variable passed to a filter in Email Confirmation
157
+
158
  = 2.5.6 =
159
  * Compatibility fix with php 7.1
160
  * Redirects code refactoring which should fix some minor issues with redirects as well