Ultimate Member – User Profile & Membership Plugin - Version 1.3.48

Version Description

Download this release

Release Info

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

Code changes from version 1.3.47 to 1.3.48

core/um-actions-login.php CHANGED
@@ -78,7 +78,9 @@
78
  add_action( 'um_before_login_fields', 'um_display_login_errors' );
79
  function um_display_login_errors( $args ) {
80
  global $ultimatemember;
81
-
 
 
82
  if( $ultimatemember->form->count_errors() > 0 ) {
83
  $error = array_values( $ultimatemember->form->errors );
84
  $error = array_shift( $error );
@@ -155,7 +157,7 @@
155
 
156
  $rememberme = ( isset($args['rememberme']) ) ? 1 : 0;
157
 
158
- if ( um_get_option('deny_admin_frontend_login') && strstr( um_user('wp_roles' ), 'administrator' ) )
159
  wp_die( __('This action has been prevented for security measures.','ultimatemember') );
160
 
161
  $ultimatemember->user->auto_login( um_user('ID'), $rememberme );
78
  add_action( 'um_before_login_fields', 'um_display_login_errors' );
79
  function um_display_login_errors( $args ) {
80
  global $ultimatemember;
81
+
82
+ $error = '';
83
+
84
  if( $ultimatemember->form->count_errors() > 0 ) {
85
  $error = array_values( $ultimatemember->form->errors );
86
  $error = array_shift( $error );
157
 
158
  $rememberme = ( isset($args['rememberme']) ) ? 1 : 0;
159
 
160
+ if ( um_get_option('deny_admin_frontend_login') && ! isset( $_GET['provider'] ) && strstr( um_user('wp_roles' ), 'administrator' ) )
161
  wp_die( __('This action has been prevented for security measures.','ultimatemember') );
162
 
163
  $ultimatemember->user->auto_login( um_user('ID'), $rememberme );
core/um-actions-profile.php CHANGED
@@ -380,10 +380,23 @@
380
  <?php if ( $ultimatemember->fields->viewing == true && um_user('description') && $args['show_bio'] ) { ?>
381
 
382
  <div class="um-meta-text">
383
- <?php if( um_get_option( 'profile_show_html_bio' ) ) : ?>
384
- <?php echo um_clickable_links( strip_tags( um_filtered_value('description'), '<p><a><img><br><strong><b><em><i><quote><sub><sup>') ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  <?php else : ?>
386
- <?php echo um_clickable_links( wp_strip_all_tags( um_filtered_value('description') ) ); ?>
387
  <?php endif; ?>
388
  </div>
389
 
380
  <?php if ( $ultimatemember->fields->viewing == true && um_user('description') && $args['show_bio'] ) { ?>
381
 
382
  <div class="um-meta-text">
383
+ <?php
384
+ $allowed_tags = array(
385
+ 'a' => array(
386
+ 'href' => array(),
387
+ 'title' => array()
388
+ ),
389
+ 'br' => array(),
390
+ 'em' => array(),
391
+ 'strong' => array(),
392
+ );
393
+
394
+ $description = get_user_meta( um_user('ID') , 'description', true);
395
+
396
+ if( um_get_option( 'profile_show_html_bio' ) ) : ?>
397
+ <?php echo make_clickable( wp_kses( $description, $allowed_tags) ); ?>
398
  <?php else : ?>
399
+ <?php echo esc_html( $description ); ?>
400
  <?php endif; ?>
401
  </div>
402
 
core/um-fields.php CHANGED
@@ -1587,7 +1587,7 @@ class UM_Fields {
1587
  if ( $this->is_selected($form_key, $option_value, $data) ) {
1588
  $output.= 'selected';
1589
  }
1590
- $output .= '>'.$v.'</option>';
1591
 
1592
  }
1593
 
@@ -1657,7 +1657,7 @@ class UM_Fields {
1657
  if ( $this->is_selected($key, $opt_value, $data) ) {
1658
  $output.= 'selected';
1659
  }
1660
- $output .= '>'.$v.'</option>';
1661
 
1662
  }
1663
 
@@ -1743,7 +1743,7 @@ class UM_Fields {
1743
 
1744
  $output .= ' />';
1745
  $output .= '<span class="um-field-radio-state"><i class="'.$class.'"></i></span>';
1746
- $output .= '<span class="um-field-radio-option">'.$v.'</span>';
1747
  $output .= '</label>';
1748
 
1749
  if ($i % 2 == 0) {
@@ -1811,7 +1811,7 @@ class UM_Fields {
1811
  $output .= ' />';
1812
 
1813
  $output .= '<span class="um-field-checkbox-state"><i class="'.$class.'"></i></span>';
1814
- $output .= '<span class="um-field-checkbox-option">'. $v .'</span>';
1815
  $output .= '</label>';
1816
 
1817
  if ($i % 2 == 0) {
@@ -1855,7 +1855,7 @@ class UM_Fields {
1855
  if ( !empty( $fields ) ) {
1856
 
1857
  $output .= '<div class="um-field-group" data-max_entries="'.$max_entries.'">
1858
- <div class="um-field-group-head"><i class="um-icon-plus"></i>'.$label.'</div>';
1859
  $output .= '<div class="um-field-group-body"><a href="#" class="um-field-group-cancel"><i class="um-icon-close"></i></a>';
1860
 
1861
  foreach($fields as $subkey => $subdata) {
1587
  if ( $this->is_selected($form_key, $option_value, $data) ) {
1588
  $output.= 'selected';
1589
  }
1590
+ $output .= '>'.__($v, UM_TEXTDOMAIN).'</option>';
1591
 
1592
  }
1593
 
1657
  if ( $this->is_selected($key, $opt_value, $data) ) {
1658
  $output.= 'selected';
1659
  }
1660
+ $output .= '>'.__($v,UM_TEXTDOMAIN).'</option>';
1661
 
1662
  }
1663
 
1743
 
1744
  $output .= ' />';
1745
  $output .= '<span class="um-field-radio-state"><i class="'.$class.'"></i></span>';
1746
+ $output .= '<span class="um-field-radio-option">'.__($v,UM_TEXTDOMAIN).'</span>';
1747
  $output .= '</label>';
1748
 
1749
  if ($i % 2 == 0) {
1811
  $output .= ' />';
1812
 
1813
  $output .= '<span class="um-field-checkbox-state"><i class="'.$class.'"></i></span>';
1814
+ $output .= '<span class="um-field-checkbox-option">'. __($v,UM_TEXTDOMAIN) .'</span>';
1815
  $output .= '</label>';
1816
 
1817
  if ($i % 2 == 0) {
1855
  if ( !empty( $fields ) ) {
1856
 
1857
  $output .= '<div class="um-field-group" data-max_entries="'.$max_entries.'">
1858
+ <div class="um-field-group-head"><i class="um-icon-plus"></i>'.__($label,UM_TEXTDOMAIN).'</div>';
1859
  $output .= '<div class="um-field-group-body"><a href="#" class="um-field-group-cancel"><i class="um-icon-close"></i></a>';
1860
 
1861
  foreach($fields as $subkey => $subdata) {
core/um-files.php CHANGED
@@ -540,15 +540,21 @@ class UM_Files {
540
  }
541
 
542
  $ext = '.' . pathinfo($source, PATHINFO_EXTENSION);
543
- $name = $key;
544
- $filename = $name . $ext;
545
-
546
  // copy & overwrite file
 
 
 
 
 
 
 
 
547
  if ( file_exists( $this->upload_basedir . $user_id . '/' . $filename ) ) {
548
  unlink( $this->upload_basedir . $user_id . '/' . $filename );
549
  }
550
  copy( $source, $this->upload_basedir . $user_id . '/' . $filename );
551
-
552
  $info = @getimagesize( $source );
553
 
554
  // thumbs
@@ -596,9 +602,7 @@ class UM_Files {
596
  // removes a synced profile photo
597
  delete_user_meta( $user_id, 'synced_profile_photo' );
598
 
599
- }
600
-
601
- if ( $key == 'cover_photo' ) {
602
 
603
  list($w, $h) = @getimagesize( $source );
604
 
540
  }
541
 
542
  $ext = '.' . pathinfo($source, PATHINFO_EXTENSION);
543
+
 
 
544
  // copy & overwrite file
545
+
546
+ if( in_array( $key , array('profile_photo','cover_photo') ) ){
547
+ $filename = $key . $ext;
548
+ $name = $key;
549
+ }else{
550
+ $filename = basename( $source );
551
+ }
552
+
553
  if ( file_exists( $this->upload_basedir . $user_id . '/' . $filename ) ) {
554
  unlink( $this->upload_basedir . $user_id . '/' . $filename );
555
  }
556
  copy( $source, $this->upload_basedir . $user_id . '/' . $filename );
557
+
558
  $info = @getimagesize( $source );
559
 
560
  // thumbs
602
  // removes a synced profile photo
603
  delete_user_meta( $user_id, 'synced_profile_photo' );
604
 
605
+ }else if ( $key == 'cover_photo' ) {
 
 
606
 
607
  list($w, $h) = @getimagesize( $source );
608
 
core/um-filters-members.php CHANGED
@@ -238,13 +238,38 @@
238
  /***
239
  *** @sorting random
240
  ***/
241
- add_filter('pre_user_query', function($query) {
242
- if($query->query_vars["orderby"] == 'random') {
243
- $query->query_orderby = 'ORDER by RAND()';
244
- }
245
 
246
- return $query;
247
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
  /***
250
  *** @hook in the member results array
238
  /***
239
  *** @sorting random
240
  ***/
241
+ add_filter('pre_user_query','um_modify_sortby_randomly');
242
+ function um_modify_sortby_randomly( $query ){
 
 
243
 
244
+ if( um_is_session_started() === FALSE ){
245
+ session_start();
246
+ }
247
+
248
+ // Reset seed on load of initial
249
+ if( ! isset( $_REQUEST['members_page'] ) || $_REQUEST['members_page'] == 0 || $_REQUEST['members_page'] == 1 ) {
250
+ if( isset( $_SESSION['seed'] ) ) {
251
+ unset( $_SESSION['seed'] );
252
+ }
253
+ }
254
+
255
+ // Get seed from session variable if it exists
256
+ $seed = false;
257
+ if( isset( $_SESSION['seed'] ) ) {
258
+ $seed = $_SESSION['seed'];
259
+ }
260
+
261
+ // Set new seed if none exists
262
+ if ( ! $seed ) {
263
+ $seed = rand();
264
+ $_SESSION['seed'] = $seed;
265
+ }
266
+
267
+ if($query->query_vars["orderby"] == 'random') {
268
+ $query->query_orderby = 'ORDER by RAND('. $seed.')';
269
+ }
270
+
271
+ return $query;
272
+ }
273
 
274
  /***
275
  *** @hook in the member results array
core/um-short-functions.php CHANGED
@@ -1319,7 +1319,24 @@ function um_fetch_user( $user_id ) {
1319
 
1320
  return $full_name;
1321
 
1322
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1323
 
1324
  case 'display_name':
1325
 
@@ -1385,14 +1402,23 @@ function um_fetch_user( $user_id ) {
1385
  }
1386
  }
1387
 
 
1388
  if ( $op == 'field' && um_get_option('display_name_field') != '' ) {
1389
  $fields = array_filter(preg_split('/[,\s]+/', um_get_option('display_name_field') ));
1390
  $name = '';
 
1391
  foreach( $fields as $field ) {
1392
- $name .= um_profile( $field ) . ' ';
 
 
 
 
 
1393
  }
1394
  }
1395
 
 
 
1396
  return apply_filters('um_user_display_name_filter', $name, um_user('ID'), ( $attrs == 'html' ) ? 1 : 0 );
1397
 
1398
  break;
@@ -1488,6 +1514,20 @@ function um_fetch_user( $user_id ) {
1488
  return $protocol;
1489
  }
1490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1491
  /**
1492
  * Check if meta_value exists
1493
  * @param string $key
1319
 
1320
  return $full_name;
1321
 
1322
+ break;
1323
+
1324
+ case 'first_and_last_name_initial':
1325
+
1326
+ $f_and_l_initial = '';
1327
+
1328
+ if ( um_user('first_name') && um_user('last_name') ) {
1329
+ $initial = um_user('last_name');
1330
+ $f_and_l_initial = um_user('first_name').' '.$initial[0];
1331
+ }else{
1332
+ $f_and_l_initial = um_profile( $data );
1333
+ }
1334
+
1335
+ $f_and_l_initial = $ultimatemember->validation->safe_name_in_url( $f_and_l_initial );
1336
+
1337
+ return $f_and_l_initial;
1338
+
1339
+ break;
1340
 
1341
  case 'display_name':
1342
 
1402
  }
1403
  }
1404
 
1405
+
1406
  if ( $op == 'field' && um_get_option('display_name_field') != '' ) {
1407
  $fields = array_filter(preg_split('/[,\s]+/', um_get_option('display_name_field') ));
1408
  $name = '';
1409
+
1410
  foreach( $fields as $field ) {
1411
+ if( um_profile( $field ) ){
1412
+ $name .= um_profile( $field ) . ' ';
1413
+ }else if( um_user( $field ) ){
1414
+ $name .= um_user( $field ) . ' ';
1415
+ }
1416
+
1417
  }
1418
  }
1419
 
1420
+
1421
+
1422
  return apply_filters('um_user_display_name_filter', $name, um_user('ID'), ( $attrs == 'html' ) ? 1 : 0 );
1423
 
1424
  break;
1514
  return $protocol;
1515
  }
1516
 
1517
+ /**
1518
+ * Set SSL to media URI
1519
+ * @param string $url
1520
+ * @return string
1521
+ */
1522
+ function um_secure_media_uri( $url ){
1523
+
1524
+ if( is_ssl() ){
1525
+ $url = str_replace('http:', 'https:', $url );
1526
+ }
1527
+
1528
+ return $url;
1529
+ }
1530
+
1531
  /**
1532
  * Check if meta_value exists
1533
  * @param string $key
core/um-user.php CHANGED
@@ -116,6 +116,12 @@ class UM_User {
116
  }
117
 
118
  function get_cached_data( $user_id ) {
 
 
 
 
 
 
119
  if ( is_numeric( $user_id ) && $user_id > 0 ) {
120
  $find_user = get_option("um_cache_userdata_{$user_id}");
121
  if ( $find_user ) {
116
  }
117
 
118
  function get_cached_data( $user_id ) {
119
+
120
+ $disallow_cache = get_option('um_profile_object_cache_stop');
121
+ if( $disallow_cache ){
122
+ return '';
123
+ }
124
+
125
  if ( is_numeric( $user_id ) && $user_id > 0 ) {
126
  $find_user = get_option("um_cache_userdata_{$user_id}");
127
  if ( $find_user ) {
index.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: 1.3.47
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  */
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: 1.3.48
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  */
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm
7
  Requires at least: 4.1
8
  Tested up to: 4.4
9
 
10
- Stable Tag: 1.3.46
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
@@ -148,6 +148,20 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
148
  16. Screenshot 16
149
 
150
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  = 1.3.47: April 6, 2016 =
153
  * Fixed: Fatal errors with language filter file
7
  Requires at least: 4.1
8
  Tested up to: 4.4
9
 
10
+ Stable Tag: 1.3.48
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
148
  16. Screenshot 16
149
 
150
  == Changelog ==
151
+ = 1.3.48: April 11, 2016 =
152
+ * New: advanced option to disable profile object caching
153
+ * Added: ssl media uri function
154
+ * Added: first and last name initial as meta key
155
+ * Fixed: order by random and pagination
156
+ * Fixed: user sort by random
157
+ * Fixed: status message encoding
158
+ * Fixed: image upload and file name
159
+ * Fixed: user login with other provider
160
+ * Fixed: translation strings
161
+ * Fixed: dependencies fatal errors
162
+ * Fixed: remove notices
163
+
164
+
165
 
166
  = 1.3.47: April 6, 2016 =
167
  * Fixed: Fatal errors with language filter file
um-config.php CHANGED
@@ -1934,6 +1934,16 @@ $this->sections[] = array(
1934
  'full_width' => true,
1935
  ),
1936
 
 
 
 
 
 
 
 
 
 
 
1937
  array(
1938
  'id' => 'um_flush_stop',
1939
  'type' => 'switch',
1934
  'full_width' => true,
1935
  ),
1936
 
1937
+ array(
1938
+ 'id' => 'um_profile_object_cache_stop',
1939
+ 'type' => 'switch',
1940
+ 'title' => __( 'Stop caching user\'s profile data','ultimatemember' ),
1941
+ 'default' => 0,
1942
+ 'desc' => __('Turn off If you have performance issue.','ultimatemember'),
1943
+ 'on' => __('On','ultimatemember'),
1944
+ 'off' => __('Off','ultimatemember'),
1945
+ ),
1946
+
1947
  array(
1948
  'id' => 'um_flush_stop',
1949
  'type' => 'switch',