User registration & user profile – Profile Builder - Version 2.3.0

Version Description

  • Added filter in login form so we can display html at the bottom
  • Fixed a filter in login redirect link that was broken
  • Removed 'Display name publicly as' from Registration Forms.
  • We no longer create custom directories in the WordPress uploads directory.
  • Removed notice from Manage Fields page when the WPML plugin was active.
Download this release

Release Info

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

Code changes from version 2.2.9 to 2.3.0

assets/css/style-back-end.css CHANGED
@@ -437,6 +437,10 @@
437
  clear: both;
438
  }
439
 
 
 
 
 
440
  .wppb-add-on a:focus {
441
  box-shadow: none;
442
  }
437
  clear: both;
438
  }
439
 
440
+ .wppb-add-on .spinner {
441
+ visibility: visible;
442
+ }
443
+
444
  .wppb-add-on a:focus {
445
  box-shadow: none;
446
  }
assets/lib/wck-api/fields/checkbox.php CHANGED
@@ -34,9 +34,9 @@ if( !empty( $details['options'] ) ){
34
  }
35
 
36
  $element .= '<div><label><input type="checkbox" name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) );
37
- if( $this->args['single'] ) {
38
- $element .= '[]';
39
- }
40
  $element .= '" id="';
41
 
42
  if( !empty( $frontend_prefix ) )
34
  }
35
 
36
  $element .= '<div><label><input type="checkbox" name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) );
37
+ if( $this->args['single'] && $this->args['context'] != 'option' ) {
38
+ $element .= '[]';
39
+ }
40
  $element .= '" id="';
41
 
42
  if( !empty( $frontend_prefix ) )
assets/lib/wck-api/wordpress-creation-kit.php CHANGED
@@ -1159,9 +1159,9 @@ class Wordpress_Creation_Kit_PB{
1159
  * if any of the custom fields has the 'wckwpml' prefix.
1160
  */
1161
  function wck_add_sync_translation_metabox(){
1162
- global $post;
1163
-
1164
- if( isset( $_GET['lang'] ) ){
1165
 
1166
  $has_wck_with_unserialize_fields = false;
1167
  $custom_field_keys = get_post_custom_keys( $post->ID );
1159
  * if any of the custom fields has the 'wckwpml' prefix.
1160
  */
1161
  function wck_add_sync_translation_metabox(){
1162
+ global $post;
1163
+
1164
+ if( isset( $_GET['lang'] ) && !empty( $post ) ){
1165
 
1166
  $has_wck_with_unserialize_fields = false;
1167
  $custom_field_keys = get_post_custom_keys( $post->ID );
features/email-confirmation/email-confirmation.php CHANGED
@@ -309,6 +309,8 @@ function wppb_add_meta_to_user_on_activation( $user_id, $password, $meta ){
309
  }
310
  }
311
  }
 
 
312
  }
313
 
314
 
309
  }
310
  }
311
  }
312
+
313
+ do_action( 'wppb_add_other_meta_on_user_activation', $user_id, $meta );
314
  }
315
 
316
 
features/upgrades/upgrades.php CHANGED
@@ -21,11 +21,12 @@ function wppb_update_patch(){
21
 
22
  if ( version_compare( PROFILE_BUILDER_VERSION, $wppb_version, '>' ) ) {
23
  if ( ( PROFILE_BUILDER == 'Profile Builder Pro' ) || ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) ){
24
- $upload_dir = wp_upload_dir();
25
-
 
26
  wp_mkdir_p( $upload_dir['basedir'].'/profile_builder' );
27
  wp_mkdir_p( $upload_dir['basedir'].'/profile_builder/attachments/' );
28
- wp_mkdir_p( $upload_dir['basedir'].'/profile_builder/avatars/' );
29
 
30
  // Flush the rewrite rules and add them, if need be, the proper way.
31
  if ( function_exists( 'wppb_flush_rewrite_rules' ) )
21
 
22
  if ( version_compare( PROFILE_BUILDER_VERSION, $wppb_version, '>' ) ) {
23
  if ( ( PROFILE_BUILDER == 'Profile Builder Pro' ) || ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) ){
24
+
25
+ /* stopped creating them on 01.02.2016 */
26
+ /*$upload_dir = wp_upload_dir();
27
  wp_mkdir_p( $upload_dir['basedir'].'/profile_builder' );
28
  wp_mkdir_p( $upload_dir['basedir'].'/profile_builder/attachments/' );
29
+ wp_mkdir_p( $upload_dir['basedir'].'/profile_builder/avatars/' );*/
30
 
31
  // Flush the rewrite rules and add them, if need be, the proper way.
32
  if ( function_exists( 'wppb_flush_rewrite_rules' ) )
front-end/class-formbuilder.php CHANGED
@@ -441,45 +441,12 @@ class Profile_Builder_Form_Creator{
441
  $wppb_general_settings = get_option( 'wppb_general_settings' );
442
 
443
  if( $this->args['form_type'] == 'register' ){
444
- if( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
445
- $userdata['user_login'] = apply_filters( 'wppb_generated_random_username', Wordpress_Creation_Kit_PB::wck_generate_slug( trim( $userdata['user_email'] ) ), $userdata['user_email'] );
446
- }
447
-
448
- if ( isset( $wppb_general_settings['emailConfirmation'] ) && ( $wppb_general_settings['emailConfirmation'] == 'yes' ) ){
449
- $new_user_signup = true;
450
- $multisite_message = true;
451
- $userdata = $this->wppb_add_custom_field_values( $global_request, $userdata, $this->args['form_fields'] );
452
-
453
- if( !isset( $userdata['role'] ) )
454
- $userdata['role'] = $this->args['role'];
455
-
456
- $userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] );
457
-
458
- if( is_multisite() ){
459
- /* since version 2.0.7 add this meta so we know on what blog the user registered */
460
- $userdata['registered_for_blog_id'] = get_current_blog_id();
461
- $userdata = wp_unslash( $userdata );
462
- }
463
-
464
- wppb_signup_user( $userdata['user_login'], $userdata['user_email'], $userdata );
465
 
466
- }else{
467
- if( !isset( $userdata['role'] ) )
468
- $userdata['role'] = $this->args['role'];
469
-
470
- $userdata = wp_unslash( $userdata );
471
 
472
- // change User Registered date and time according to timezone selected in WordPress settings
473
- $wppb_get_date = wppb_get_date_by_timezone();
474
-
475
- if( isset( $wppb_get_date ) ) {
476
- $userdata['user_registered'] = $wppb_get_date;
477
- }
478
-
479
- // insert user to database
480
- $user_id = wp_insert_user( $userdata );
481
- }
482
-
483
  }elseif( $this->args['form_type'] == 'edit_profile' ){
484
  if( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
485
  $user_info = get_userdata( $user_id );
@@ -515,6 +482,54 @@ class Profile_Builder_Form_Creator{
515
  }
516
  return $user_id;
517
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
 
519
  function wppb_add_custom_field_values( $global_request, $meta, $form_properties ){
520
  if( !empty( $this->args['form_fields'] ) ){
441
  $wppb_general_settings = get_option( 'wppb_general_settings' );
442
 
443
  if( $this->args['form_type'] == 'register' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
 
445
+ $result = $this->wppb_register_user( $global_request, $userdata );
446
+ $user_id = $result['user_id'];
447
+ $userdata = $result['userdata'];
448
+ $new_user_signup = $result['new_user_signup'];
 
449
 
 
 
 
 
 
 
 
 
 
 
 
450
  }elseif( $this->args['form_type'] == 'edit_profile' ){
451
  if( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
452
  $user_info = get_userdata( $user_id );
482
  }
483
  return $user_id;
484
  }
485
+
486
+ function wppb_register_user( $global_request, $userdata ){
487
+
488
+ $wppb_general_settings = get_option( 'wppb_general_settings' );
489
+ $user_id = null;
490
+ $new_user_signup = false;
491
+
492
+ if( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
493
+ $userdata['user_login'] = apply_filters( 'wppb_generated_random_username', Wordpress_Creation_Kit_PB::wck_generate_slug( trim( $userdata['user_email'] ) ), $userdata['user_email'] );
494
+ }
495
+
496
+ if ( isset( $wppb_general_settings['emailConfirmation'] ) && ( $wppb_general_settings['emailConfirmation'] == 'yes' ) ){
497
+ $new_user_signup = true;
498
+
499
+ $userdata = $this->wppb_add_custom_field_values( $global_request, $userdata, $this->args['form_fields'] );
500
+
501
+ if( !isset( $userdata['role'] ) )
502
+ $userdata['role'] = $this->args['role'];
503
+
504
+ $userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] );
505
+
506
+ if( is_multisite() ){
507
+ /* since version 2.0.7 add this meta so we know on what blog the user registered */
508
+ $userdata['registered_for_blog_id'] = get_current_blog_id();
509
+ $userdata = wp_unslash( $userdata );
510
+ }
511
+
512
+ wppb_signup_user( $userdata['user_login'], $userdata['user_email'], $userdata );
513
+
514
+ }else{
515
+ if( !isset( $userdata['role'] ) )
516
+ $userdata['role'] = $this->args['role'];
517
+
518
+ $userdata = wp_unslash( $userdata );
519
+
520
+ // change User Registered date and time according to timezone selected in WordPress settings
521
+ $wppb_get_date = wppb_get_date_by_timezone();
522
+
523
+ if( isset( $wppb_get_date ) ) {
524
+ $userdata['user_registered'] = $wppb_get_date;
525
+ }
526
+
527
+ // insert user to database
528
+ $user_id = wp_insert_user( $userdata );
529
+ }
530
+
531
+ return array( 'userdata' => $userdata, 'user_id' => $user_id, 'new_user_signup' => $new_user_signup );
532
+ }
533
 
534
  function wppb_add_custom_field_values( $global_request, $meta, $form_properties ){
535
  if( !empty( $this->args['form_fields'] ) ){
front-end/default-fields/email/email.php CHANGED
@@ -22,7 +22,7 @@ function wppb_email_handler( $output, $form_location, $field, $user_id, $field_c
22
 
23
  $output = '
24
  <label for="email">'.$item_title.$error_mark.'</label>
25
- <input class="text-input default_field_email" name="email" maxlength="'. apply_filters( 'wppb_maximum_character_length', 70 ) .'" type="text" id="email" value="'. esc_attr( $input_value ) .'" '. $extra_attr .' />';
26
  if( !empty( $item_description ) )
27
  $output .= '<span class="wppb-description-delimiter">'. $item_description .'</span>';
28
 
22
 
23
  $output = '
24
  <label for="email">'.$item_title.$error_mark.'</label>
25
+ <input class="text-input default_field_email" name="email" maxlength="'. apply_filters( 'wppb_maximum_character_length', 70 ) .'" type="email" id="email" value="'. esc_attr( $input_value ) .'" '. $extra_attr .' />';
26
  if( !empty( $item_description ) )
27
  $output .= '<span class="wppb-description-delimiter">'. $item_description .'</span>';
28
 
front-end/login.php CHANGED
@@ -137,7 +137,7 @@ function wppb_login_redirect( $redirect_to, $redirect_url, $user ){
137
  }
138
  }
139
  }
140
- apply_filters( 'wppb_after_login_redirect_url', $redirect_to );
141
  }
142
  }
143
 
@@ -213,6 +213,8 @@ function wppb_front_end_login( $atts ){
213
  $login_form .= '</p>';
214
  }
215
 
 
 
216
  $login_form .= '</div>';
217
  return $login_form;
218
 
137
  }
138
  }
139
  }
140
+ $redirect_to = apply_filters( 'wppb_after_login_redirect_url', $redirect_to );
141
  }
142
  }
143
 
213
  $login_form .= '</p>';
214
  }
215
 
216
+ $login_form .= apply_filters( 'wppb_login_form_bottom', '', $form_args );
217
+
218
  $login_form .= '</div>';
219
  return $login_form;
220
 
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Profile Builder
4
  Plugin URI: http://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.2.9
7
  Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8
  Author URI: http://www.cozmoslabs.com/
9
  License: GPL2
@@ -73,7 +73,7 @@ function wppb_free_plugin_init() {
73
  *
74
  *
75
  */
76
- define('PROFILE_BUILDER_VERSION', '2.2.9' );
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: http://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.3.0
7
  Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8
  Author URI: http://www.cozmoslabs.com/
9
  License: GPL2
73
  *
74
  *
75
  */
76
+ define('PROFILE_BUILDER_VERSION', '2.3.0' );
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
@@ -4,8 +4,8 @@ Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
4
  Tags: registration, user profile, user registration, custom field registration, customize profile, user fields, extra user fields, builder, profile builder, custom user profile, user profile page, edit profile, custom registration, custom registration form, custom registration page, registration page, user custom fields, user listing, front-end user listing, user login, user registration form, front-end login, login redirect, login widget, front-end register, front-end registration, front-end edit profile, front-end user registration, custom redirects, user email, avatar upload, email confirmation, user approval, customize registration email, minimum password length, minimum password strength, password strength meter, multiple registration forms, register, register form, register user, register users, login form, member directory, redirect user
5
 
6
  Requires at least: 3.1
7
- Tested up to: 4.4.1
8
- Stable tag: 2.2.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -115,6 +115,13 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
115
  10. Profile Builder Login Widget
116
 
117
  == Changelog ==
 
 
 
 
 
 
 
118
  = 2.2.9 =
119
  * Fixed compatibility with Yoast and Page Builder by SiteOrigin that caused our shortcodes to be executed multiple times
120
 
4
  Tags: registration, user profile, user registration, custom field registration, customize profile, user fields, extra user fields, builder, profile builder, custom user profile, user profile page, edit profile, custom registration, custom registration form, custom registration page, registration page, user custom fields, user listing, front-end user listing, user login, user registration form, front-end login, login redirect, login widget, front-end register, front-end registration, front-end edit profile, front-end user registration, custom redirects, user email, avatar upload, email confirmation, user approval, customize registration email, minimum password length, minimum password strength, password strength meter, multiple registration forms, register, register form, register user, register users, login form, member directory, redirect user
5
 
6
  Requires at least: 3.1
7
+ Tested up to: 4.4.2
8
+ Stable tag: 2.3.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
115
  10. Profile Builder Login Widget
116
 
117
  == Changelog ==
118
+ = 2.3.0 =
119
+ * Added filter in login form so we can display html at the bottom
120
+ * Fixed a filter in login redirect link that was broken
121
+ * Removed 'Display name publicly as' from Registration Forms.
122
+ * We no longer create custom directories in the WordPress uploads directory.
123
+ * Removed notice from Manage Fields page when the WPML plugin was active.
124
+
125
  = 2.2.9 =
126
  * Fixed compatibility with Yoast and Page Builder by SiteOrigin that caused our shortcodes to be executed multiple times
127