Ultimate Member – User Profile & Membership Plugin - Version 2.0.14

Version Description

Download this release

Release Info

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

Code changes from version 2.0.17 to 2.0.14

assets/css/um-profile.css CHANGED
@@ -393,31 +393,13 @@ font-weight: normal;
393
  border-bottom: 0 !important;
394
  }
395
 
396
- .um-profile-nav-item.without-icon a {
397
- padding-left: 10px;
398
- }
399
- .um-profile-nav-item.without-icon span.title {
400
- padding-left: 0;
401
- }
402
- .um-profile-nav-item.without-icon i {
403
- display: none;
404
- }
405
 
406
- .um-profile-nav-item a:hover {
407
- background: #555;
408
- }
409
- .um-profile-nav-item i {
410
- font-size: 18px;
411
- height: 18px;
412
- line-height: 18px;
413
- position: absolute;
414
- display: block;
415
- top: 8px;
416
- left: 10px;
417
- }
418
- .um-profile-nav-item span.title {
419
- padding-left: 5px;
420
- }
421
  .um-profile-nav-item span.count {
422
  font-size: 12px;
423
  font-weight: 300;
393
  border-bottom: 0 !important;
394
  }
395
 
396
+ .um-profile-nav-item.without-icon a {padding-left: 10px}
397
+ .um-profile-nav-item.without-icon span.title {padding-left: 0}
398
+ .um-profile-nav-item.without-icon i {display: none}
 
 
 
 
 
 
399
 
400
+ .um-profile-nav-item a:hover {background: #555}
401
+ .um-profile-nav-item i {font-size: 18px;height: 18px;line-height: 18px;position: absolute;display: block;top: 8px;left: 10px}
402
+ .um-profile-nav-item span.title {padding-left: 5px}
 
 
 
 
 
 
 
 
 
 
 
 
403
  .um-profile-nav-item span.count {
404
  font-size: 12px;
405
  font-weight: 300;
assets/js/um-gdpr.min.js DELETED
@@ -1 +0,0 @@
1
- !function(t){"use strict";t(document).on("click","a.um-toggle-gdpr",function(){var e=jQuery(this);t(".um-gdpr-content").toggle("fast",function(){t(".um-gdpr-content").is(":visible")&&e.text(e.data("toggle-hide")),t(".um-gdpr-content").is(":hidden")&&e.text(e.data("toggle-show"))})})}(jQuery);
 
includes/admin/class-admin.php CHANGED
@@ -35,7 +35,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
35
 
36
  add_action( 'um_admin_do_action__user_cache', array( &$this, 'user_cache' ) );
37
  add_action( 'um_admin_do_action__purge_temp', array( &$this, 'purge_temp' ) );
38
- add_action( 'um_admin_do_action__manual_upgrades_request', array( &$this, 'manual_upgrades_request' ) );
39
  add_action( 'um_admin_do_action__duplicate_form', array( &$this, 'duplicate_form' ) );
40
  add_action( 'um_admin_do_action__um_language_downloader', array( &$this, 'um_language_downloader' ) );
41
  add_action( 'um_admin_do_action__um_hide_locale_notice', array( &$this, 'um_hide_notice' ) );
@@ -49,29 +48,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
49
  }
50
 
51
 
52
- function manual_upgrades_request() {
53
- if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
54
- die();
55
- }
56
-
57
- $last_request = get_option( 'um_last_manual_upgrades_request', false );
58
-
59
- if ( empty( $last_request ) || time() > $last_request + DAY_IN_SECONDS ) {
60
-
61
- delete_transient( 'update_plugins' );
62
- delete_site_transient( 'update_plugins' );
63
-
64
- UM()->plugin_updater()->um_checklicenses();
65
-
66
- update_option( 'um_last_manual_upgrades_request', time() );
67
-
68
- $url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'got_updates' ), admin_url( 'admin.php' ) );
69
- } else {
70
- $url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'often_updates' ), admin_url( 'admin.php' ) );
71
- }
72
- exit( wp_redirect( $url ) );
73
- }
74
-
75
 
76
  /**
77
  * Clear all users cache
35
 
36
  add_action( 'um_admin_do_action__user_cache', array( &$this, 'user_cache' ) );
37
  add_action( 'um_admin_do_action__purge_temp', array( &$this, 'purge_temp' ) );
 
38
  add_action( 'um_admin_do_action__duplicate_form', array( &$this, 'duplicate_form' ) );
39
  add_action( 'um_admin_do_action__um_language_downloader', array( &$this, 'um_language_downloader' ) );
40
  add_action( 'um_admin_do_action__um_hide_locale_notice', array( &$this, 'um_hide_notice' ) );
48
  }
49
 
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  /**
53
  * Clear all users cache
includes/admin/core/class-admin-menu.php CHANGED
@@ -206,7 +206,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
206
  add_meta_box( 'um-metaboxes-mainbox-1', __( 'Latest from our blog', 'ultimate-member' ), array( &$this, 'um_news' ), $this->pagehook, 'normal', 'core' );
207
 
208
  add_meta_box( 'um-metaboxes-sidebox-1', __( 'Purge Temp Files', 'ultimate-member' ), array( &$this, 'purge_temp' ), $this->pagehook, 'side', 'core' );
209
-
210
  add_meta_box( 'um-metaboxes-sidebox-2', __( 'User Cache', 'ultimate-member' ), array( &$this, 'user_cache' ), $this->pagehook, 'side', 'core' );
211
 
212
  if ( $this->language_avaialable_not_installed() ) {
@@ -216,12 +215,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
216
  } else if ( $this->language_not_available() ) {
217
  add_meta_box( 'um-metaboxes-sidebox-2', __( 'Language', 'ultimate-member' ), array( &$this, 'ct_language' ), $this->pagehook, 'side', 'core' );
218
  }
219
-
220
- //If there are active and licensed extensions - show metabox for upgrade it
221
- $exts = UM()->plugin_updater()->um_get_active_plugins();
222
- if ( 0 < count( $exts ) ) {
223
- add_meta_box( 'um-metaboxes-sidebox-3', __( 'Upgrade\'s Manual Request', 'ultimate-member' ), array( &$this, 'upgrade_request' ), $this->pagehook, 'side', 'core' );
224
- }
225
  }
226
 
227
 
@@ -276,14 +269,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
276
  }
277
 
278
 
279
- /**
280
- *
281
- */
282
- function upgrade_request() {
283
- include_once UM()->admin()->templates_path . 'dashboard/upgrade-request.php';
284
- }
285
-
286
-
287
  /**
288
  *
289
  */
206
  add_meta_box( 'um-metaboxes-mainbox-1', __( 'Latest from our blog', 'ultimate-member' ), array( &$this, 'um_news' ), $this->pagehook, 'normal', 'core' );
207
 
208
  add_meta_box( 'um-metaboxes-sidebox-1', __( 'Purge Temp Files', 'ultimate-member' ), array( &$this, 'purge_temp' ), $this->pagehook, 'side', 'core' );
 
209
  add_meta_box( 'um-metaboxes-sidebox-2', __( 'User Cache', 'ultimate-member' ), array( &$this, 'user_cache' ), $this->pagehook, 'side', 'core' );
210
 
211
  if ( $this->language_avaialable_not_installed() ) {
215
  } else if ( $this->language_not_available() ) {
216
  add_meta_box( 'um-metaboxes-sidebox-2', __( 'Language', 'ultimate-member' ), array( &$this, 'ct_language' ), $this->pagehook, 'side', 'core' );
217
  }
 
 
 
 
 
 
218
  }
219
 
220
 
269
  }
270
 
271
 
 
 
 
 
 
 
 
 
272
  /**
273
  *
274
  */
includes/admin/core/class-admin-notices.php CHANGED
@@ -420,14 +420,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
420
  $messages[0]['content'] = __( 'Your user cache is now removed.', 'ultimate-member' );
421
  break;
422
 
423
- case 'got_updates':
424
- $messages[0]['content'] = __( 'You got the latest upgrades.', 'ultimate-member' );
425
- break;
426
-
427
- case 'often_updates':
428
- $messages[0]['err_content'] = __( 'Try again later. You can run this action once daily.', 'ultimate-member' );
429
- break;
430
-
431
  case 'form_duplicated':
432
  $messages[0]['content'] = __( 'The form has been duplicated successfully.', 'ultimate-member' );
433
  break;
420
  $messages[0]['content'] = __( 'Your user cache is now removed.', 'ultimate-member' );
421
  break;
422
 
 
 
 
 
 
 
 
 
423
  case 'form_duplicated':
424
  $messages[0]['content'] = __( 'The form has been duplicated successfully.', 'ultimate-member' );
425
  break;
includes/admin/core/class-admin-upgrade.php CHANGED
@@ -17,12 +17,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
17
  class Admin_Upgrade {
18
 
19
 
20
- /**
21
- * @var null
22
- */
23
- protected static $instance = null;
24
-
25
-
26
  /**
27
  * @var
28
  */
@@ -37,25 +31,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
37
  var $packages_dir;
38
 
39
 
40
- /**
41
- * Main Admin_Upgrade Instance
42
- *
43
- * Ensures only one instance of UM is loaded or can be loaded.
44
- *
45
- * @since 1.0
46
- * @static
47
- * @see UM()
48
- * @return Admin_Upgrade - Main instance
49
- */
50
- static public function instance() {
51
- if ( is_null( self::$instance ) ) {
52
- self::$instance = new self();
53
- }
54
-
55
- return self::$instance;
56
- }
57
-
58
-
59
  /**
60
  * Admin_Upgrade constructor.
61
  */
@@ -64,14 +39,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
64
  $this->necessary_packages = $this->need_run_upgrades();
65
 
66
  if ( ! empty( $this->necessary_packages ) ) {
 
67
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 0 );
68
 
69
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
70
- $this->init_packages_ajax();
71
-
72
- add_action( 'wp_ajax_um_run_package', array( $this, 'ajax_run_package' ) );
73
- add_action( 'wp_ajax_um_get_packages', array( $this, 'ajax_get_packages' ) );
74
- }
75
  }
76
 
77
  //add_action( 'in_plugin_update_message-' . um_plugin, array( $this, 'in_plugin_update_message' ) );
@@ -171,7 +143,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
171
  foreach ( $this->necessary_packages as $package ) {
172
  $hooks_file = $this->packages_dir . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'hooks.php';
173
  if ( file_exists( $hooks_file ) ) {
174
- $pack_ajax_hooks = include_once $hooks_file;
175
 
176
  foreach ( $pack_ajax_hooks as $action => $function ) {
177
  add_action( 'wp_ajax_um_' . $action, "um_upgrade_$function" );
@@ -188,7 +160,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
188
  foreach ( $this->necessary_packages as $package ) {
189
  $handlers_file = $this->packages_dir . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'functions.php';
190
  if ( file_exists( $handlers_file ) ) {
191
- include_once $handlers_file;
192
  }
193
  }
194
  }
@@ -318,7 +290,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
318
  exit('');
319
  } else {
320
  ob_start();
321
- include_once $this->packages_dir . DIRECTORY_SEPARATOR . $_POST['pack'] . DIRECTORY_SEPARATOR . 'init.php';
322
  ob_get_flush();
323
  exit;
324
  }
17
  class Admin_Upgrade {
18
 
19
 
 
 
 
 
 
 
20
  /**
21
  * @var
22
  */
31
  var $packages_dir;
32
 
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Admin_Upgrade constructor.
36
  */
39
  $this->necessary_packages = $this->need_run_upgrades();
40
 
41
  if ( ! empty( $this->necessary_packages ) ) {
42
+ $this->init_packages_ajax();
43
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 0 );
44
 
45
+ add_action( 'wp_ajax_um_run_package', array( $this, 'ajax_run_package' ) );
46
+ add_action( 'wp_ajax_um_get_packages', array( $this, 'ajax_get_packages' ) );
 
 
 
 
47
  }
48
 
49
  //add_action( 'in_plugin_update_message-' . um_plugin, array( $this, 'in_plugin_update_message' ) );
143
  foreach ( $this->necessary_packages as $package ) {
144
  $hooks_file = $this->packages_dir . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'hooks.php';
145
  if ( file_exists( $hooks_file ) ) {
146
+ $pack_ajax_hooks = include $hooks_file;
147
 
148
  foreach ( $pack_ajax_hooks as $action => $function ) {
149
  add_action( 'wp_ajax_um_' . $action, "um_upgrade_$function" );
160
  foreach ( $this->necessary_packages as $package ) {
161
  $handlers_file = $this->packages_dir . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'functions.php';
162
  if ( file_exists( $handlers_file ) ) {
163
+ include $handlers_file;
164
  }
165
  }
166
  }
290
  exit('');
291
  } else {
292
  ob_start();
293
+ include $this->packages_dir . DIRECTORY_SEPARATOR . $_POST['pack'] . DIRECTORY_SEPARATOR . 'init.php';
294
  ob_get_flush();
295
  exit;
296
  }
includes/admin/core/packages/2.0-beta1/email_templates.php CHANGED
@@ -25,8 +25,8 @@ foreach ( $emails as $email_key => $value ) {
25
  } else {
26
  $setting_value = UM()->options()->get( $email_key );
27
 
28
- $fp = @fopen( $theme_template_path, "w" );
29
- $result = @fputs( $fp, $setting_value );
30
  fclose( $fp );
31
  }
32
  } else {
25
  } else {
26
  $setting_value = UM()->options()->get( $email_key );
27
 
28
+ $fp = fopen( $theme_template_path, "w" );
29
+ $result = fputs( $fp, $setting_value );
30
  fclose( $fp );
31
  }
32
  } else {
includes/admin/templates/dashboard/upgrade-request.php DELETED
@@ -1,6 +0,0 @@
1
- <p><?php _e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ) ?></p>
2
- <p>
3
- <a href="<?php echo add_query_arg( 'um_adm_action', 'manual_upgrades_request' ); ?>" class="button">
4
- <?php _e( 'Get latest versions', 'ultimate-member' ) ?>
5
- </a>
6
- </p>
 
 
 
 
 
 
includes/class-init.php CHANGED
@@ -637,8 +637,7 @@ if ( ! class_exists( 'UM' ) ) {
637
  */
638
  function admin_upgrade() {
639
  if ( empty( $this->classes['admin_upgrade'] ) ) {
640
- $this->classes['admin_upgrade'] = um\admin\core\Admin_Upgrade::instance();
641
- //$this->classes['admin_upgrade'] = new um\admin\core\Admin_Upgrade();
642
  }
643
  return $this->classes['admin_upgrade'];
644
  }
637
  */
638
  function admin_upgrade() {
639
  if ( empty( $this->classes['admin_upgrade'] ) ) {
640
+ $this->classes['admin_upgrade'] = new um\admin\core\Admin_Upgrade();
 
641
  }
642
  return $this->classes['admin_upgrade'];
643
  }
includes/core/class-access.php CHANGED
@@ -536,7 +536,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
536
  if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) {
537
  if ( um_is_core_post( $post, 'login' ) || um_is_core_post( $post, 'register' ) ||
538
  um_is_core_post( $post, 'account' ) || um_is_core_post( $post, 'logout' ) ||
539
- um_is_core_post( $post, 'password-reset' ) || ( is_user_logged_in() && um_is_core_post( $post, 'user' ) ) )
540
  return false;
541
  }
542
 
536
  if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) {
537
  if ( um_is_core_post( $post, 'login' ) || um_is_core_post( $post, 'register' ) ||
538
  um_is_core_post( $post, 'account' ) || um_is_core_post( $post, 'logout' ) ||
539
+ um_is_core_post( $post, 'password-reset' ) || um_is_core_post( $post, 'user' ) )
540
  return false;
541
  }
542
 
includes/core/class-account.php CHANGED
@@ -751,6 +751,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
751
  * ?>
752
  */
753
  do_action( "um_after_account_{$tab_id}", $args );
 
754
 
755
  if ( ! isset( $tab_data['show_button'] ) || false !== $tab_data['show_button'] ) { ?>
756
 
751
  * ?>
752
  */
753
  do_action( "um_after_account_{$tab_id}", $args );
754
+ // var_dump($args);
755
 
756
  if ( ! isset( $tab_data['show_button'] ) || false !== $tab_data['show_button'] ) { ?>
757
 
includes/core/class-fields.php CHANGED
@@ -2890,7 +2890,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2890
  $um_field_checkbox_item_title = $v;
2891
  $option_value = $v;
2892
 
2893
- if ( ! is_numeric( $k ) && in_array( $form_key, array( 'role', 'role_radio' ) ) ) {
2894
  $um_field_checkbox_item_title = $v;
2895
  $option_value = $k;
2896
  }
2890
  $um_field_checkbox_item_title = $v;
2891
  $option_value = $v;
2892
 
2893
+ if (!is_numeric( $k ) && in_array( $form_key, array( 'role' ) )) {
2894
  $um_field_checkbox_item_title = $v;
2895
  $option_value = $k;
2896
  }
includes/core/class-form.php CHANGED
@@ -465,9 +465,8 @@ if ( ! class_exists( 'um\core\Form' ) ) {
465
  $global_role = get_option( 'default_role' ); // WP Global settings
466
 
467
  $um_global_role = UM()->options()->get( 'register_role' ); // UM Settings Global settings
468
- if ( ! empty( $um_global_role ) ) {
469
  $global_role = $um_global_role; // Form Global settings
470
- }
471
 
472
 
473
  $mode = $this->form_type( $post_id );
465
  $global_role = get_option( 'default_role' ); // WP Global settings
466
 
467
  $um_global_role = UM()->options()->get( 'register_role' ); // UM Settings Global settings
468
+ if ( ! empty( $um_global_role ) )
469
  $global_role = $um_global_role; // Form Global settings
 
470
 
471
 
472
  $mode = $this->form_type( $post_id );
includes/core/class-mail.php CHANGED
@@ -124,14 +124,10 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
124
 
125
  $this->message = $this->prepare_template( $template, $args );
126
 
127
- if ( UM()->options()->get( 'email_html' ) ) {
128
- $this->headers .= "Content-Type: text/html\r\n";
129
- } else {
130
- $this->headers .= "Content-Type: text/plain\r\n";
131
- }
132
-
133
  // Send mail
134
  wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments );
 
135
  }
136
 
137
 
@@ -485,6 +481,22 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
485
  }
486
 
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  /**
489
  * Ajax copy template to the theme
490
  *
124
 
125
  $this->message = $this->prepare_template( $template, $args );
126
 
127
+ add_filter( 'wp_mail_content_type', array( &$this, 'set_content_type' ) );
 
 
 
 
 
128
  // Send mail
129
  wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments );
130
+ remove_filter( 'wp_mail_content_type', array( &$this, 'set_content_type' ) );
131
  }
132
 
133
 
481
  }
482
 
483
 
484
+ /**
485
+ * Set email content type
486
+ *
487
+ *
488
+ * @param $content_type
489
+ * @return string
490
+ */
491
+ function set_content_type( $content_type ) {
492
+ if ( UM()->options()->get( 'email_html' ) ) {
493
+ return 'text/html';
494
+ } else {
495
+ return 'text/plain';
496
+ }
497
+ }
498
+
499
+
500
  /**
501
  * Ajax copy template to the theme
502
  *
includes/core/class-profile.php CHANGED
@@ -115,21 +115,14 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
115
  'icon' => 'um-faicon-comment'
116
  )
117
  ) );
118
-
119
  // disable private tabs
120
  if ( ! is_admin() ) {
121
- if( is_user_logged_in() ) {
122
- $user_id = um_user('ID');
123
- um_fetch_user( get_current_user_id() );
124
- }
125
  foreach ( $tabs as $id => $tab ) {
126
  if ( ! $this->can_view_tab( $id ) ) {
127
  unset( $tabs[$id] );
128
  }
129
  }
130
- if( is_user_logged_in() ) {
131
- um_fetch_user( $user_id );
132
- }
133
  }
134
 
135
  return $tabs;
115
  'icon' => 'um-faicon-comment'
116
  )
117
  ) );
118
+ um_fetch_user(get_current_user_id());
119
  // disable private tabs
120
  if ( ! is_admin() ) {
 
 
 
 
121
  foreach ( $tabs as $id => $tab ) {
122
  if ( ! $this->can_view_tab( $id ) ) {
123
  unset( $tabs[$id] );
124
  }
125
  }
 
 
 
126
  }
127
 
128
  return $tabs;
includes/core/class-user.php CHANGED
@@ -1661,29 +1661,23 @@ if ( ! class_exists( 'um\core\User' ) ) {
1661
  }
1662
 
1663
  }
1664
-
1665
-
1666
  // update user
1667
  if ( count( $args ) > 1 ) {
 
 
1668
 
1669
- //if isset roles argument validate role to properly for security reasons
1670
- if ( isset( $args['role'] ) ) {
1671
- global $wp_roles;
1672
- $um_roles = get_option( 'um_roles' );
1673
-
1674
- if ( ! empty( $um_roles ) ) {
1675
- $role_keys = array_map( function( $item ) {
1676
- return 'um_' . $item;
1677
- }, get_option( 'um_roles' ) );
1678
- } else {
1679
- $role_keys = array();
1680
- }
1681
 
1682
- $exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
1683
 
1684
- if ( in_array( $args['role'], $exclude_roles ) ) {
1685
- unset( $args['role'] );
1686
- }
1687
  }
1688
 
1689
  wp_update_user( $args );
1661
  }
1662
 
1663
  }
 
 
1664
  // update user
1665
  if ( count( $args ) > 1 ) {
1666
+ global $wp_roles;
1667
+ $um_roles = get_option( 'um_roles' );
1668
 
1669
+ if ( ! empty( $um_roles ) ) {
1670
+ $role_keys = array_map( function( $item ) {
1671
+ return 'um_' . $item;
1672
+ }, get_option( 'um_roles' ) );
1673
+ } else {
1674
+ $role_keys = array();
1675
+ }
 
 
 
 
 
1676
 
1677
+ $exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
1678
 
1679
+ if ( isset( $args['role'] ) && in_array( $args['role'], $exclude_roles ) ) {
1680
+ unset( $args['role'] );
 
1681
  }
1682
 
1683
  wp_update_user( $args );
includes/core/um-actions-form.php CHANGED
@@ -314,9 +314,8 @@ function um_submit_form_errors_hook_( $args ) {
314
  foreach ( $array['conditions'] as $condition ) {
315
  list( $visibility, $parent_key, $op, $parent_value ) = $condition;
316
 
317
- if ( ! isset( $args[ $parent_key ] ) ) {
318
  continue;
319
- }
320
 
321
  $cond_value = ( $fields[ $parent_key ]['type'] == 'radio' ) ? $args[ $parent_key ][0] : $args[ $parent_key ];
322
 
@@ -338,11 +337,11 @@ function um_submit_form_errors_hook_( $args ) {
338
  continue 2;
339
  }
340
  } elseif ( $op == 'greater than' ) {
341
- if ( $cond_value > $parent_value ) {
342
  continue 2;
343
  }
344
  } elseif ( $op == 'less than' ) {
345
- if ( $cond_value < $parent_value ) {
346
  continue 2;
347
  }
348
  } elseif ( $op == 'contains' ) {
@@ -368,11 +367,11 @@ function um_submit_form_errors_hook_( $args ) {
368
  continue 2;
369
  }
370
  } elseif ( $op == 'greater than' ) {
371
- if ( $cond_value <= $parent_value ) {
372
  continue 2;
373
  }
374
  } elseif ( $op == 'less than' ) {
375
- if ( $cond_value >= $parent_value ) {
376
  continue 2;
377
  }
378
  } elseif ( $op == 'contains' ) {
314
  foreach ( $array['conditions'] as $condition ) {
315
  list( $visibility, $parent_key, $op, $parent_value ) = $condition;
316
 
317
+ if ( ! isset( $args[ $parent_key ] ) )
318
  continue;
 
319
 
320
  $cond_value = ( $fields[ $parent_key ]['type'] == 'radio' ) ? $args[ $parent_key ][0] : $args[ $parent_key ];
321
 
337
  continue 2;
338
  }
339
  } elseif ( $op == 'greater than' ) {
340
+ if ( $cond_value > $op ) {
341
  continue 2;
342
  }
343
  } elseif ( $op == 'less than' ) {
344
+ if ( $cond_value < $op ) {
345
  continue 2;
346
  }
347
  } elseif ( $op == 'contains' ) {
367
  continue 2;
368
  }
369
  } elseif ( $op == 'greater than' ) {
370
+ if ( $cond_value <= $op ) {
371
  continue 2;
372
  }
373
  } elseif ( $op == 'less than' ) {
374
+ if ( $cond_value >= $op ) {
375
  continue 2;
376
  }
377
  } elseif ( $op == 'contains' ) {
includes/core/um-actions-profile.php CHANGED
@@ -1377,46 +1377,40 @@ function um_profile_menu( $args ) {
1377
 
1378
  <div class="um-profile-nav-item um-profile-nav-<?php echo $id . ' ' . $profile_nav_class; ?>">
1379
  <?php if ( UM()->options()->get( 'profile_menu_icons' ) ) { ?>
1380
- <a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
1381
  title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1382
 
1383
  <i class="<?php echo $tab['icon']; ?>"></i>
1384
 
1385
  <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1386
- <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1387
  <?php } ?>
1388
 
1389
- <span class="uimob800-hide uimob500-hide uimob340-hide title"><?php echo $tab['name']; ?></span>
1390
- </a>
1391
- <a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
1392
- title="<?php echo esc_attr( $tab['name'] ); ?>">
1393
-
1394
- <i class="<?php echo $tab['icon']; ?>"></i>
1395
-
1396
- <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1397
- <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1398
- <?php } ?>
1399
 
1400
- <span class="title"><?php echo $tab['name']; ?></span>
1401
  </a>
1402
- <?php } else { ?>
1403
- <a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
1404
  title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1405
 
1406
  <i class="<?php echo $tab['icon']; ?>"></i>
1407
 
1408
  <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1409
- <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1410
  <?php } ?>
 
 
 
1411
  </a>
1412
- <a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
1413
- title="<?php echo esc_attr( $tab['name'] ); ?>">
 
1414
 
1415
  <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
1416
- <span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
1417
  <?php } ?>
1418
 
1419
- <span class="title"><?php echo $tab['name']; ?></span>
 
1420
  </a>
1421
  <?php } ?>
1422
  </div>
1377
 
1378
  <div class="um-profile-nav-item um-profile-nav-<?php echo $id . ' ' . $profile_nav_class; ?>">
1379
  <?php if ( UM()->options()->get( 'profile_menu_icons' ) ) { ?>
1380
+ <a href="<?php echo $nav_link; ?>" class="um-tip-n uimob500-show uimob340-show uimob800-show"
1381
  title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1382
 
1383
  <i class="<?php echo $tab['icon']; ?>"></i>
1384
 
1385
  <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1386
+ <span class="um-tab-notifier uimob500-show uimob340-show uimob800-show"><?php echo $tab['notifier']; ?></span>
1387
  <?php } ?>
1388
 
1389
+ <span class="uimob500-hide uimob340-hide uimob800-hide title"><?php echo $tab['name']; ?></span>
 
 
 
 
 
 
 
 
 
1390
 
 
1391
  </a>
1392
+ <a href="<?php echo $nav_link; ?>" class="uimob500-hide uimob340-hide uimob800-hide"
 
1393
  title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1394
 
1395
  <i class="<?php echo $tab['icon']; ?>"></i>
1396
 
1397
  <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
1398
+ <span class="um-tab-notifier uimob500-show uimob340-show uimob800-show"><?php echo $tab['notifier']; ?></span>
1399
  <?php } ?>
1400
+
1401
+ <span class="uimob500-hide uimob340-hide uimob800-hide title"><?php echo $tab['name']; ?></span>
1402
+
1403
  </a>
1404
+ <?php } else { ?>
1405
+ <a href="<?php echo $nav_link; ?>" title="<?php echo esc_attr( $tab['name'] ); ?>"
1406
+ original-title="<?php echo esc_attr( $tab['name'] ); ?>">
1407
 
1408
  <?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
1409
+ <span class="um-tab-notifier uimob500-show uimob340-show uimob800-show"><?php echo $tab['notifier']; ?></span>
1410
  <?php } ?>
1411
 
1412
+ <span class="uimob500-hide uimob340-hide uimob800-hide title"><?php echo $tab['name']; ?></span>
1413
+
1414
  </a>
1415
  <?php } ?>
1416
  </div>
includes/core/um-actions-register.php CHANGED
@@ -55,7 +55,7 @@ function um_after_insert_user( $user_id, $args ) {
55
  UM()->user()->remove_cached_queue();
56
 
57
  um_fetch_user( $user_id );
58
- UM()->user()->set_status( um_user( 'status' ) );
59
  if ( ! empty( $args['submitted'] ) ) {
60
  UM()->user()->set_registration_details( $args['submitted'] );
61
  }
@@ -369,30 +369,6 @@ function um_submit_form_register( $args ) {
369
  $args['submitted'] = array_merge( $args['submitted'], $credentials );
370
  $args = array_merge( $args, $credentials );
371
 
372
- //get user role from global or form's settings
373
- $user_role = UM()->form()->assigned_role( UM()->form()->form_id );
374
-
375
- //get user role from field Role dropdown or radio
376
- if ( isset( $args['role'] ) ) {
377
- global $wp_roles;
378
- $um_roles = get_option( 'um_roles' );
379
-
380
- if ( ! empty( $um_roles ) ) {
381
- $role_keys = array_map( function( $item ) {
382
- return 'um_' . $item;
383
- }, get_option( 'um_roles' ) );
384
- } else {
385
- $role_keys = array();
386
- }
387
-
388
- $exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
389
-
390
- //if role is properly set it
391
- if ( ! in_array( $args['role'], $exclude_roles ) ) {
392
- $user_role = $args['role'];
393
- }
394
- }
395
-
396
  /**
397
  * UM hook
398
  *
@@ -415,7 +391,7 @@ function um_submit_form_register( $args ) {
415
  * }
416
  * ?>
417
  */
418
- $user_role = apply_filters( 'um_registration_user_role', $user_role, $args );
419
 
420
  $userdata = array(
421
  'user_login' => $user_login,
@@ -750,18 +726,4 @@ function um_registration_set_profile_full_name( $user_id, $args ) {
750
  */
751
  do_action( 'um_update_profile_full_name', $user_id, $args );
752
  }
753
- add_action( 'um_registration_set_extra_data', 'um_registration_set_profile_full_name', 10, 2 );
754
-
755
-
756
- /**
757
- * Redirect from default registration to UM registration page
758
- */
759
- function um_form_register_redirect() {
760
- $page_id = UM()->options()->get( UM()->options()->get_core_page_id( 'register' ) );
761
- $register_post = get_post( $page_id );
762
- if ( ! empty( $register_post ) ) {
763
- wp_safe_redirect( get_permalink( $page_id ) );
764
- exit();
765
- }
766
- }
767
- add_action( 'login_form_register', 'um_form_register_redirect', 10 );
55
  UM()->user()->remove_cached_queue();
56
 
57
  um_fetch_user( $user_id );
58
+ UM()->user()->set_status( um_user('status') );
59
  if ( ! empty( $args['submitted'] ) ) {
60
  UM()->user()->set_registration_details( $args['submitted'] );
61
  }
369
  $args['submitted'] = array_merge( $args['submitted'], $credentials );
370
  $args = array_merge( $args, $credentials );
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  /**
373
  * UM hook
374
  *
391
  * }
392
  * ?>
393
  */
394
+ $user_role = apply_filters( 'um_registration_user_role', UM()->form()->assigned_role( UM()->form()->form_id ), $args );
395
 
396
  $userdata = array(
397
  'user_login' => $user_login,
726
  */
727
  do_action( 'um_update_profile_full_name', $user_id, $args );
728
  }
729
+ add_action( 'um_registration_set_extra_data', 'um_registration_set_profile_full_name', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/core/um-filters-fields.php CHANGED
@@ -392,11 +392,11 @@ function um_get_custom_field_array( $array, $fields ) {
392
  $array['required'] = 0;
393
  }
394
  } elseif ( $op == 'greater than' ) {
395
- if ( $cond_value > $parent_value ) {
396
  $array['required'] = 0;
397
  }
398
  } elseif ( $op == 'less than' ) {
399
- if ( $cond_value < $parent_value ) {
400
  $array['required'] = 0;
401
  }
402
  } elseif ( $op == 'contains' ) {
@@ -422,11 +422,11 @@ function um_get_custom_field_array( $array, $fields ) {
422
  $array['required'] = 0;
423
  }
424
  } elseif ( $op == 'greater than' ) {
425
- if ( $cond_value <= $parent_value ) {
426
  $array['required'] = 0;
427
  }
428
  } elseif ( $op == 'less than' ) {
429
- if ( $cond_value >= $parent_value ) {
430
  $array['required'] = 0;
431
  }
432
  } elseif ( $op == 'contains' ) {
392
  $array['required'] = 0;
393
  }
394
  } elseif ( $op == 'greater than' ) {
395
+ if ( $cond_value > $op ) {
396
  $array['required'] = 0;
397
  }
398
  } elseif ( $op == 'less than' ) {
399
+ if ( $cond_value < $op ) {
400
  $array['required'] = 0;
401
  }
402
  } elseif ( $op == 'contains' ) {
422
  $array['required'] = 0;
423
  }
424
  } elseif ( $op == 'greater than' ) {
425
+ if ( $cond_value <= $op ) {
426
  $array['required'] = 0;
427
  }
428
  } elseif ( $op == 'less than' ) {
429
+ if ( $cond_value >= $op ) {
430
  $array['required'] = 0;
431
  }
432
  } elseif ( $op == 'contains' ) {
includes/core/um-navmenu.php CHANGED
@@ -47,7 +47,7 @@ if ( ! class_exists( 'UM_Menu_Item_Custom_Fields_Editor' ) ) {
47
  if ( empty( $_POST['menu-item-db-id'] ) || ! in_array( $menu_item_db_id, $_POST['menu-item-db-id'] ) ) {
48
  return;
49
  }
50
-
51
  foreach ( self::$fields as $_key => $label ) {
52
 
53
  $key = sprintf( 'menu-item-%s', $_key );
47
  if ( empty( $_POST['menu-item-db-id'] ) || ! in_array( $menu_item_db_id, $_POST['menu-item-db-id'] ) ) {
48
  return;
49
  }
50
+ //var_dump($_POST['menu-item-um_nav_roles']); exit;
51
  foreach ( self::$fields as $_key => $label ) {
52
 
53
  $key = sprintf( 'menu-item-%s', $_key );
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: community, member, membership, user-profile, user-registration
7
  Requires at least: 4.1
8
  Tested up to: 4.9
9
- Stable tag: 2.0.17
10
  License: GNU Version 2 or Any Later Version
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
 
@@ -131,47 +131,6 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
131
 
132
  = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
133
 
134
- = 2.0.17: May 30, 2018 =
135
-
136
- * Enhancements:
137
- - Added UM dashboard widget for getting latest extension's upgrades
138
-
139
- * Bugfixes:
140
- - Fixed User Profile restriction when the user isn't logged in
141
- - Fixed Profile Tabs displaying on desktop/mobile
142
- - Fixed set user status after registration on some installs
143
- - Fixed PHP memory limit issue on some installs with small PHP memory limit
144
- - Fixed PHP validation on submit UM Forms with conditional fields logic
145
-
146
- = 2.0.16: May 23, 2018 =
147
-
148
- * Bugfixes:
149
- - Fixed Profile Tabs issues
150
-
151
- = 2.0.15: May 22, 2018 =
152
-
153
- * Bugfixes:
154
- - Fixed GDPR min.js script
155
-
156
- = 2.0.14: May 22, 2018 =
157
-
158
- * Enhancements:
159
- - Added support for GDPR Personal Data Exporter
160
- - Added support for GDPR Personal Data Eraser
161
- - Added new privacy field to form builder for GDPR consent collection
162
- - Added GDPR privacy policy guide text
163
- - Added GDPR compatibility on delete user process
164
- - Added security to Restricted posts comments
165
- - Added security to custom field type `Password`
166
- - Deprecated time checking spam bot
167
-
168
- * Bugfixes:
169
- - Fixed settings tabs for PHP7.1
170
- - Fixed issues with Profile Tabs
171
- - Fixed User Avatars
172
- - Fixed set user status on Registration process
173
- - Fixed Account Privacy tab content
174
-
175
  = 2.0.13: May 2, 2018 =
176
 
177
  * Bugfixes:
6
  Tags: community, member, membership, user-profile, user-registration
7
  Requires at least: 4.1
8
  Tested up to: 4.9
9
+ Stable tag: 2.0.13
10
  License: GNU Version 2 or Any Later Version
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
 
131
 
132
  = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  = 2.0.13: May 2, 2018 =
135
 
136
  * 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.0.17
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.0.14
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  Text Domain: ultimate-member