Ultimate Member – User Profile & Membership Plugin - Version 2.1.20

Version Description

Download this release

Release Info

Developer nsinelnikov
Plugin Icon 128x128 Ultimate Member – User Profile & Membership Plugin
Version 2.1.20
Comparing to
See all releases

Code changes from version 2.1.19 to 2.1.20

includes/admin/core/class-admin-menu.php CHANGED
@@ -275,6 +275,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
275
  $size = 0;
276
 
277
  foreach( new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $directory ) ) as $file ) {
 
 
 
 
 
278
  $size += $file->getSize();
279
  }
280
  return round ( $size / 1048576, 2);
275
  $size = 0;
276
 
277
  foreach( new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $directory ) ) as $file ) {
278
+ $filename = $file->getFilename();
279
+ if ( $filename == '.' || $filename == '..' ) {
280
+ continue;
281
+ }
282
+
283
  $size += $file->getSize();
284
  }
285
  return round ( $size / 1048576, 2);
includes/admin/core/class-admin-settings.php CHANGED
@@ -652,7 +652,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
652
  'id' => 'activation_link_expiry_time',
653
  'type' => 'number',
654
  'label' => __( 'Activation link lifetime', 'ultimate-member' ),
655
- 'tooltip' => __( 'How long does an activation link live? Leave empty for endless links.', 'ultimate-member' ),
656
  'size' => 'small',
657
  ),
658
  )
652
  'id' => 'activation_link_expiry_time',
653
  'type' => 'number',
654
  'label' => __( 'Activation link lifetime', 'ultimate-member' ),
655
+ 'tooltip' => __( 'How long does an activation link live in seconds? Leave empty for endless links.', 'ultimate-member' ),
656
  'size' => 'small',
657
  ),
658
  )
includes/core/class-fields.php CHANGED
@@ -4346,14 +4346,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
4346
  if ( UM()->options()->get( 'profile_empty_text' ) ) {
4347
 
4348
  $emo = UM()->options()->get( 'profile_empty_text_emo' );
4349
- if ($emo) {
4350
  $emo = '<i class="um-faicon-frown-o"></i>';
4351
  } else {
4352
  $emo = false;
4353
  }
4354
 
4355
- if (um_is_myprofile()) {
4356
- $output .= '<p class="um-profile-note">' . $emo . '<span>' . sprintf( __( 'Your profile is looking a little empty. Why not <a href="%s">add</a> some information!', 'ultimate-member' ), um_edit_profile_url() ) . '</span></p>';
4357
  } else {
4358
  $output .= '<p class="um-profile-note">' . $emo . '<span>' . __( 'This user has not added any information to their profile yet.', 'ultimate-member' ) . '</span></p>';
4359
  }
4346
  if ( UM()->options()->get( 'profile_empty_text' ) ) {
4347
 
4348
  $emo = UM()->options()->get( 'profile_empty_text_emo' );
4349
+ if ( $emo ) {
4350
  $emo = '<i class="um-faicon-frown-o"></i>';
4351
  } else {
4352
  $emo = false;
4353
  }
4354
 
4355
+ if ( um_is_myprofile() ) {
4356
+ $output .= '<p class="um-profile-note">' . $emo . '<span>' . sprintf( __( 'Your profile is looking a little empty. Why not <a href="%s">add</a> some information!', 'ultimate-member' ), esc_url( um_edit_profile_url() ) ) . '</span></p>';
4357
  } else {
4358
  $output .= '<p class="um-profile-note">' . $emo . '<span>' . __( 'This user has not added any information to their profile yet.', 'ultimate-member' ) . '</span></p>';
4359
  }
includes/core/class-permalinks.php CHANGED
@@ -88,14 +88,14 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
88
  if ( !$id = $wp_the_query->get_queried_object_id() )
89
  return;
90
 
91
- if( UM()->config()->permalinks['user'] == $id ) {
92
- $link = $this->get_current_url();
93
  echo "<link rel='canonical' href='$link' />\n";
94
  return;
95
  }
96
 
97
  $link = get_permalink( $id );
98
- if ( $page = get_query_var('cpage') ){
99
  $link = get_comments_pagenum_link( $page );
100
  echo "<link rel='canonical' href='$link' />\n";
101
  }
@@ -303,7 +303,7 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
303
  * @return string
304
  */
305
  function add_query( $key, $value ) {
306
- $this->current_url = add_query_arg( $key, $value, $this->get_current_url() );
307
  return $this->current_url;
308
  }
309
 
88
  if ( !$id = $wp_the_query->get_queried_object_id() )
89
  return;
90
 
91
+ if ( UM()->config()->permalinks['user'] == $id ) {
92
+ $link = esc_url( $this->get_current_url() );
93
  echo "<link rel='canonical' href='$link' />\n";
94
  return;
95
  }
96
 
97
  $link = get_permalink( $id );
98
+ if ( $page = get_query_var( 'cpage' ) ){
99
  $link = get_comments_pagenum_link( $page );
100
  echo "<link rel='canonical' href='$link' />\n";
101
  }
303
  * @return string
304
  */
305
  function add_query( $key, $value ) {
306
+ $this->current_url = add_query_arg( $key, $value, $this->get_current_url() );
307
  return $this->current_url;
308
  }
309
 
includes/core/class-profile.php CHANGED
@@ -96,14 +96,14 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
96
  * @return array
97
  */
98
  function tabs_privacy() {
99
- $privacy = array(
100
  0 => __( 'Anyone', 'ultimate-member' ),
101
  1 => __( 'Guests only', 'ultimate-member' ),
102
  2 => __( 'Members only', 'ultimate-member' ),
103
  3 => __( 'Only the owner', 'ultimate-member' ),
104
  4 => __( 'Only specific roles', 'ultimate-member' ),
105
  5 => __( 'Owner and specific roles', 'ultimate-member' ),
106
- );
107
 
108
  return $privacy;
109
  }
@@ -249,7 +249,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
249
  break;
250
 
251
  default:
252
- $can_view = true;
253
  break;
254
  }
255
 
96
  * @return array
97
  */
98
  function tabs_privacy() {
99
+ $privacy = apply_filters( 'um_profile_tabs_privacy_list', array(
100
  0 => __( 'Anyone', 'ultimate-member' ),
101
  1 => __( 'Guests only', 'ultimate-member' ),
102
  2 => __( 'Members only', 'ultimate-member' ),
103
  3 => __( 'Only the owner', 'ultimate-member' ),
104
  4 => __( 'Only specific roles', 'ultimate-member' ),
105
  5 => __( 'Owner and specific roles', 'ultimate-member' ),
106
+ ) );
107
 
108
  return $privacy;
109
  }
249
  break;
250
 
251
  default:
252
+ $can_view = apply_filters( 'um_profile_menu_can_view_tab', true, $privacy, $tab, $tab_data, $target_id );
253
  break;
254
  }
255
 
includes/core/class-shortcodes.php CHANGED
@@ -677,7 +677,10 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
677
 
678
  //not display on admin preview
679
  if ( empty( $_POST['act_id'] ) || $_POST['act_id'] != 'um_admin_preview_form' ) {
680
- if ( 'register' == $mode && is_user_logged_in() ) {
 
 
 
681
  ob_get_clean();
682
  return __( 'You are already registered', 'ultimate-member' );
683
  }
677
 
678
  //not display on admin preview
679
  if ( empty( $_POST['act_id'] ) || $_POST['act_id'] != 'um_admin_preview_form' ) {
680
+
681
+ $enable_loggedin_registration = apply_filters( 'um_registration_for_loggedin_users', false, $args );
682
+
683
+ if ( 'register' == $mode && is_user_logged_in() && ! $enable_loggedin_registration ) {
684
  ob_get_clean();
685
  return __( 'You are already registered', 'ultimate-member' );
686
  }
includes/core/um-actions-profile.php CHANGED
@@ -363,6 +363,9 @@ function um_user_edit_profile( $args ) {
363
 
364
  }
365
 
 
 
 
366
  }
367
  }
368
  }
363
 
364
  }
365
 
366
+ // use this filter after all validations has been completed and we can extends data based on key
367
+ $to_update = apply_filters( 'um_change_usermeta_for_update', $to_update, $args, $fields, $key );
368
+
369
  }
370
  }
371
  }
includes/um-short-functions.php CHANGED
@@ -31,7 +31,7 @@ function um_dynamic_login_page_redirect( $redirect_to = '' ) {
31
 
32
  $uri = um_get_core_page( 'login' );
33
 
34
- if (!$redirect_to) {
35
  $redirect_to = UM()->permalinks()->get_current_url();
36
  }
37
 
31
 
32
  $uri = um_get_core_page( 'login' );
33
 
34
+ if ( ! $redirect_to ) {
35
  $redirect_to = UM()->permalinks()->get_current_url();
36
  }
37
 
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: community, member, membership, user-profile, user-registration
7
  Requires PHP: 5.6
8
  Requires at least: 5.0
9
  Tested up to: 5.7
10
- Stable tag: 2.1.19
11
  License: GNU Version 2 or Any Later Version
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
13
 
@@ -155,6 +155,17 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
155
  * To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
156
  * UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
157
 
 
 
 
 
 
 
 
 
 
 
 
158
  = 2.1.19: April 20, 2021 =
159
 
160
  * Bugfixes:
7
  Requires PHP: 5.6
8
  Requires at least: 5.0
9
  Tested up to: 5.7
10
+ Stable tag: 2.1.20
11
  License: GNU Version 2 or Any Later Version
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
13
 
155
  * To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
156
  * UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
157
 
158
+ = 2.1.20: May 7, 2021 =
159
+
160
+ * Enhancements:
161
+ - Added: Hook `um_registration_for_loggedin_users` to unlock the ability to add new users through the registration form
162
+ - Added: Filter hook 'um_change_usermeta_for_update' for extending `$to_update` usermeta array after all profile fields validations
163
+ - Added: Filter hook 'um_profile_tabs_privacy_list' and 'um_profile_menu_can_view_tab' for extending privacy options for Profile Tabs
164
+
165
+ * Bugfixes:
166
+ - Fixed: XSS vulnerability when getting user profile URL
167
+ - Fixed: Temp directory size calculation
168
+
169
  = 2.1.19: April 20, 2021 =
170
 
171
  * Bugfixes:
ultimate-member.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ultimate Member
4
  Plugin URI: http://ultimatemember.com/
5
  Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
- Version: 2.1.19
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  Text Domain: ultimate-member
3
  Plugin Name: Ultimate Member
4
  Plugin URI: http://ultimatemember.com/
5
  Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
+ Version: 2.1.20
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  Text Domain: ultimate-member