Ultimate Member – User Profile & Membership Plugin - Version 2.0.27

Version Description

Download this release

Release Info

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

Code changes from version 2.0.28 to 2.0.27

includes/core/class-fields.php CHANGED
@@ -2313,13 +2313,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2313
} else {
2314
$file_url = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) );
2315
$file_dir = UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $this->field_value( $key, $default, $data );
2316
-
2317
- if ( ! file_exists( $file_dir ) ) {
2318
- if ( is_multisite() ) {
2319
- //multisite fix for old customers
2320
- $file_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_dir );
2321
- }
2322
- }
2323
}
2324
2325
if ( file_exists( $file_dir ) ) {
2313
} else {
2314
$file_url = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) );
2315
$file_dir = UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $this->field_value( $key, $default, $data );
2316
}
2317
2318
if ( file_exists( $file_dir ) ) {
includes/core/class-files.php CHANGED
@@ -161,19 +161,11 @@ if ( ! class_exists( 'um\core\Files' ) ) {
161
*/
162
function image_download( $user_id, $field_key, $field_value ) {
163
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
164
- if ( ! file_exists( $file_path ) ) {
165
- if ( is_multisite() ) {
166
- //multisite fix for old customers
167
- $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_path );
168
- }
169
- }
170
-
171
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
172
173
- $pathinfo = pathinfo( $file_path );
174
$size = filesize( $file_path );
175
- $originalname = ! empty( $file_info['original_name'] ) ? $file_info['original_name'] : $pathinfo['basename'];
176
- $type = ! empty( $file_info['type'] ) ? $file_info['type'] : $pathinfo['extension'];
177
178
header('Content-Description: File Transfer');
179
header('Content-Type: ' . $type );
@@ -195,19 +187,11 @@ if ( ! class_exists( 'um\core\Files' ) ) {
195
*/
196
function file_download( $user_id, $field_key, $field_value ) {
197
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
198
- if ( ! file_exists( $file_path ) ) {
199
- if ( is_multisite() ) {
200
- //multisite fix for old customers
201
- $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_path );
202
- }
203
- }
204
-
205
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
206
207
- $pathinfo = pathinfo( $file_path );
208
$size = filesize( $file_path );
209
- $originalname = ! empty( $file_info['original_name'] ) ? $file_info['original_name'] : $pathinfo['basename'];
210
- $type = ! empty( $file_info['type'] ) ? $file_info['type'] : $pathinfo['extension'];
211
212
header('Content-Description: File Transfer');
213
header('Content-Type: ' . $type );
161
*/
162
function image_download( $user_id, $field_key, $field_value ) {
163
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
164
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
165
166
$size = filesize( $file_path );
167
+ $originalname = $file_info['original_name'];
168
+ $type = $file_info['type'];
169
170
header('Content-Description: File Transfer');
171
header('Content-Type: ' . $type );
187
*/
188
function file_download( $user_id, $field_key, $field_value ) {
189
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
190
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
191
192
$size = filesize( $file_path );
193
+ $originalname = $file_info['original_name'];
194
+ $type = $file_info['type'];
195
196
header('Content-Description: File Transfer');
197
header('Content-Type: ' . $type );
includes/core/class-user.php CHANGED
@@ -1214,14 +1214,12 @@ if ( ! class_exists( 'um\core\User' ) ) {
1214
?>
1215
*
1216
*/
1217
- function approve( $repeat = true ) {
1218
$user_id = um_user('ID');
1219
1220
- if ( ! $repeat ) {
1221
- $status = get_user_meta( $user_id, 'account_status', true );
1222
- if ( 'approved' === $status ) {
1223
- return;
1224
- }
1225
}
1226
1227
delete_option( "um_cache_userdata_{$user_id}" );
1214
?>
1215
*
1216
*/
1217
+ function approve() {
1218
$user_id = um_user('ID');
1219
1220
+ $status = get_user_meta( $user_id, 'account_status', true );
1221
+ if ( 'approved' === $status ) {
1222
+ return;
1223
}
1224
1225
delete_option( "um_cache_userdata_{$user_id}" );
includes/core/um-actions-login.php CHANGED
@@ -47,18 +47,16 @@ function um_submit_form_errors_hook_login( $args ) {
47
$user_name = $args['user_login'];
48
}
49
50
- /*if ( !username_exists( $user_name ) ) {
51
if ( $is_email ) {
52
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimate-member') );
53
} else {
54
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that username','ultimate-member') );
55
}
56
} else {
57
-
58
- }*/
59
-
60
- if ( $args['user_password'] == '' ) {
61
- UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
62
}
63
64
$user = get_user_by( 'login', $user_name );
@@ -102,29 +100,26 @@ add_action( 'um_submit_form_errors_hook_login', 'um_submit_form_errors_hook_logi
102
*/
103
function um_display_login_errors( $args ) {
104
$error = '';
105
-
106
- if ( UM()->form()->count_errors() > 0 ) {
107
$errors = UM()->form()->errors;
108
// hook for other plugins to display error
109
$error_keys = array_keys( $errors );
110
- }
111
112
- if ( isset( $args['custom_fields'] ) ) {
113
- $custom_fields = $args['custom_fields'];
114
- }
115
116
- if ( ! empty( $error_keys ) && ! empty( $custom_fields ) ) {
117
- foreach ( $error_keys as $error ) {
118
- if ( trim( $error ) && ! isset( $custom_fields[ $error ] ) && ! empty( $errors[ $error ] ) ) {
119
- $error_message = apply_filters( 'login_errors', $errors[ $error ], $error );
120
- if ( empty( $error_message ) ) {
121
- return;
122
}
123
- echo '<p class="um-notice err um-error-code-' . esc_attr( $error ) . '"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>' . $error_message . '</p>';
124
}
125
}
126
}
127
- }
128
add_action( 'um_before_login_fields', 'um_display_login_errors' );
129
130
@@ -426,12 +421,12 @@ function um_add_submit_button_to_login( $args ) {
426
427
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
428
429
- <div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $primary_btn_word, 'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" /></div>
430
- <div class="um-right um-half"><a href="<?php echo esc_attr( $secondary_btn_url ); ?>" class="um-button um-alt"><?php esc_attr_e( $secondary_btn_word,'ultimate-member'); ?></a></div>
431
432
<?php } else { ?>
433
434
- <div class="um-center"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'],'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" /></div>
435
436
<?php } ?>
437
47
$user_name = $args['user_login'];
48
}
49
50
+ if ( !username_exists( $user_name ) ) {
51
if ( $is_email ) {
52
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimate-member') );
53
} else {
54
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that username','ultimate-member') );
55
}
56
} else {
57
+ if ( $args['user_password'] == '' ) {
58
+ UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
59
+ }
60
}
61
62
$user = get_user_by( 'login', $user_name );
100
*/
101
function um_display_login_errors( $args ) {
102
$error = '';
103
+
104
+ if( UM()->form()->count_errors() > 0 ) {
105
$errors = UM()->form()->errors;
106
// hook for other plugins to display error
107
$error_keys = array_keys( $errors );
108
+ }
109
110
+ if( isset( $args['custom_fields'] ) ){
111
+ $custom_fields = $args['custom_fields'];
112
+ }
113
114
+ if( ! empty( $error_keys ) && ! empty( $custom_fields ) ){
115
+ foreach( $error_keys as $error ){
116
+ if( trim( $error ) && ! isset( $custom_fields[ $error ] ) && ! empty( $errors[ $error ] ) ){
117
+ $error_message = apply_filters( 'login_errors', $errors[ $error ] );
118
+ echo '<p class="um-notice err um-error-code-'.$error.'"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>' . $error_message . '</p>';
119
}
120
}
121
}
122
}
123
add_action( 'um_before_login_fields', 'um_display_login_errors' );
124
125
421
422
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
423
424
+ <div class="um-left um-half"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
425
+ <div class="um-right um-half"><a href="<?php echo $secondary_btn_url; ?>" class="um-button um-alt"><?php echo __( $secondary_btn_word,'ultimate-member'); ?></a></div>
426
427
<?php } else { ?>
428
429
+ <div class="um-center"><input type="submit" value="<?php echo __( $args['primary_btn_word'],'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
430
431
<?php } ?>
432
includes/core/um-actions-profile.php CHANGED
@@ -1195,15 +1195,15 @@ function um_add_submit_button_to_profile( $args ) {
1195
1196
<?php if (isset( $args['secondary_btn'] ) && $args['secondary_btn'] != 0) { ?>
1197
1198
- <div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'], 'ultimate-member' ); ?>"
1199
class="um-button"/></div>
1200
- <div class="um-right um-half"><a href="<?php echo esc_attr( um_edit_my_profile_cancel_uri() ); ?>"
1201
- class="um-button um-alt"><?php esc_attr_e( $args['secondary_btn_word'], 'ultimate-member' ); ?></a>
1202
</div>
1203
1204
<?php } else { ?>
1205
1206
- <div class="um-center"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'], 'ultimate-member' ); ?>"
1207
class="um-button"/></div>
1208
1209
<?php } ?>
1195
1196
<?php if (isset( $args['secondary_btn'] ) && $args['secondary_btn'] != 0) { ?>
1197
1198
+ <div class="um-left um-half"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>"
1199
class="um-button"/></div>
1200
+ <div class="um-right um-half"><a href="<?php echo um_edit_my_profile_cancel_uri(); ?>"
1201
+ class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a>
1202
</div>
1203
1204
<?php } else { ?>
1205
1206
+ <div class="um-center"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>"
1207
class="um-button"/></div>
1208
1209
<?php } ?>
includes/core/um-actions-register.php CHANGED
@@ -585,12 +585,12 @@ function um_add_submit_button_to_register( $args ) {
585
586
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
587
588
- <div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $primary_btn_word,'ultimate-member' ) ?>" class="um-button" id="um-submit-btn" /></div>
589
- <div class="um-right um-half"><a href="<?php echo esc_attr( $secondary_btn_url ); ?>" class="um-button um-alt"><?php esc_attr_e( $secondary_btn_word,'ultimate-member'); ?></a></div>
590
591
<?php } else { ?>
592
593
- <div class="um-center"><input type="submit" value="<?php esc_attr_e( $primary_btn_word,'ultimate-member' ) ?>" class="um-button" id="um-submit-btn" /></div>
594
595
<?php } ?>
596
585
586
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
587
588
+ <div class="um-left um-half"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
589
+ <div class="um-right um-half"><a href="<?php echo $secondary_btn_url; ?>" class="um-button um-alt"><?php echo __( $secondary_btn_word,'ultimate-member'); ?></a></div>
590
591
<?php } else { ?>
592
593
+ <div class="um-center"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
594
595
<?php } ?>
596
includes/core/um-filters-fields.php CHANGED
@@ -226,20 +226,7 @@ function um_profile_field_filter_hook__file( $value, $data ) {
226
$file_type = wp_check_filetype( $value );
227
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
228
229
- $removed = false;
230
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
231
- if ( is_multisite() ) {
232
- //multisite fix for old customers
233
- $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value );
234
- if ( ! file_exists( $file_path ) ) {
235
- $removed = true;
236
- }
237
- } else {
238
- $removed = true;
239
- }
240
- }
241
-
242
- if ( $removed ) {
243
$value = __( 'This file has been removed.', 'ultimate-member' );
244
} else {
245
$file_info = um_user( $data['metakey'] . "_metadata" );
@@ -273,24 +260,11 @@ function um_profile_field_filter_hook__image( $value, $data ) {
273
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
274
$title = ( isset( $data['title'] ) ) ? $data['title'] : __( 'Untitled photo', 'ultimate-member' );
275
276
- $removed = false;
277
- if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
278
- if ( is_multisite() ) {
279
- //multisite fix for old customers
280
- $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value );
281
- if ( ! file_exists( $file_path ) ) {
282
- $removed = true;
283
- }
284
- } else {
285
- $removed = true;
286
- }
287
- }
288
-
289
// if value is an image tag
290
if( preg_match( '/\<img.*src=\"([^"]+).*/', $value, $matches ) ) {
291
$uri = $matches[1];
292
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
293
- } else if ( ! $removed ) {
294
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
295
} else {
296
$value = '';
@@ -663,26 +637,6 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
663
add_filter( 'um_profile_field_filter_hook__','um_profile_field_filter_xss_validation', 10, 3 );
664
665
666
- /**
667
- * Trim All form POST submitted data
668
- *
669
- * @param $post_form
670
- * @param $mode
671
- *
672
- * @return mixed
673
- */
674
- function um_submit_form_data_trim_fields( $post_form, $mode ) {
675
- foreach ( $post_form as $key => $field ) {
676
- if ( is_string( $field ) ) {
677
- $post_form[ $key ] = trim( $field );
678
- }
679
- }
680
-
681
- return $post_form;
682
- }
683
- add_filter( 'um_submit_form_data', 'um_submit_form_data_trim_fields', 9, 2 );
684
-
685
-
686
/**
687
* add role_select and role_radio to the $post_form
688
* It is necessary for that if on these fields the conditional logic
226
$file_type = wp_check_filetype( $value );
227
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
228
229
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
230
$value = __( 'This file has been removed.', 'ultimate-member' );
231
} else {
232
$file_info = um_user( $data['metakey'] . "_metadata" );
260
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
261
$title = ( isset( $data['title'] ) ) ? $data['title'] : __( 'Untitled photo', 'ultimate-member' );
262
263
// if value is an image tag
264
if( preg_match( '/\<img.*src=\"([^"]+).*/', $value, $matches ) ) {
265
$uri = $matches[1];
266
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
267
+ } else if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
268
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
269
} else {
270
$value = '';
637
add_filter( 'um_profile_field_filter_hook__','um_profile_field_filter_xss_validation', 10, 3 );
638
639
640
/**
641
* add role_select and role_radio to the $post_form
642
* It is necessary for that if on these fields the conditional logic
includes/um-short-functions.php CHANGED
@@ -556,19 +556,10 @@ function um_user_submitted_registration( $style = false ) {
556
if ( UM()->fields()->get_field_type( $k ) == 'image' || UM()->fields()->get_field_type( $k ) == 'file' ) {
557
$file = basename( $v );
558
$filedata = get_user_meta( um_user( 'ID' ), $k . "_metadata", true );
559
-
560
- $baseurl = UM()->uploader()->get_upload_base_url();
561
- if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $file ) ) {
562
- if ( is_multisite() ) {
563
- //multisite fix for old customers
564
- $baseurl = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $baseurl );
565
- }
566
- }
567
-
568
if ( ! empty( $filedata['original_name'] ) ) {
569
- $v = '<a href="' . esc_attr( $baseurl . um_user( 'ID' ) . '/' . $file ) . '">' . $filedata['original_name'] . '</a>';
570
} else {
571
- $v = $baseurl . um_user( 'ID' ) . '/' . $file;
572
}
573
}
574
@@ -1668,27 +1659,8 @@ function um_closest_num( $array, $number ) {
1668
*/
1669
function um_get_cover_uri( $image, $attrs ) {
1670
$uri = false;
1671
- $uri_common = false;
1672
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1673
1674
- if ( is_multisite() ) {
1675
- //multisite fix for old customers
1676
- $multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
1677
- $multisite_fix_url = UM()->uploader()->get_upload_base_url();
1678
- $multisite_fix_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $multisite_fix_dir );
1679
- $multisite_fix_url = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $multisite_fix_url );
1680
-
1681
- if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
1682
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
1683
- }
1684
-
1685
- if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1686
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$attrs}{$ext}?". current_time( 'timestamp' );
1687
- } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
1688
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
1689
- }
1690
- }
1691
-
1692
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
1693
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
1694
}
@@ -1698,11 +1670,6 @@ function um_get_cover_uri( $image, $attrs ) {
1698
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
1699
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
1700
}
1701
-
1702
- if ( ! empty( $uri_common ) && empty( $uri ) ) {
1703
- $uri = $uri_common;
1704
- }
1705
-
1706
return $uri;
1707
}
1708
@@ -1732,64 +1699,8 @@ function um_get_avatar_url( $get_avatar ) {
1732
*/
1733
function um_get_avatar_uri( $image, $attrs ) {
1734
$uri = false;
1735
- $uri_common = false;
1736
$find = false;
1737
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1738
-
1739
- if ( is_multisite() ) {
1740
- //multisite fix for old customers
1741
- $multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
1742
- $multisite_fix_url = UM()->uploader()->get_upload_base_url();
1743
- $multisite_fix_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $multisite_fix_dir );
1744
- $multisite_fix_url = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $multisite_fix_url );
1745
-
1746
- if ( $attrs == 'original' && file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1747
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo{$ext}";
1748
- } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1749
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
1750
- } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
1751
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
1752
- } else {
1753
- $sizes = UM()->options()->get( 'photo_thumb_sizes' );
1754
- if ( is_array( $sizes ) ) {
1755
- $find = um_closest_num( $sizes, $attrs );
1756
- }
1757
-
1758
- if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
1759
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
1760
- } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
1761
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
1762
- } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1763
- $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo{$ext}";
1764
- }
1765
- }
1766
- }
1767
-
1768
- if ( $attrs == 'original' && file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1769
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1770
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1771
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
1772
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
1773
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
1774
- } else {
1775
- $sizes = UM()->options()->get( 'photo_thumb_sizes' );
1776
- if ( is_array( $sizes ) ) {
1777
- $find = um_closest_num( $sizes, $attrs );
1778
- }
1779
-
1780
- if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
1781
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
1782
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
1783
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
1784
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1785
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1786
- }
1787
- }
1788
-
1789
- if ( ! empty( $uri_common ) && empty( $uri ) ) {
1790
- $uri = $uri_common;
1791
- }
1792
-
1793
/**
1794
* UM hook
1795
*
@@ -1812,10 +1723,30 @@ function um_get_avatar_uri( $image, $attrs ) {
1812
* ?>
1813
*/
1814
$cache_time = apply_filters( 'um_filter_avatar_cache_time', current_time( 'timestamp' ), um_user( 'ID' ) );
1815
if ( ! empty( $cache_time ) ) {
1816
$uri .= "?{$cache_time}";
1817
}
1818
-
1819
return $uri;
1820
}
1821
556
if ( UM()->fields()->get_field_type( $k ) == 'image' || UM()->fields()->get_field_type( $k ) == 'file' ) {
557
$file = basename( $v );
558
$filedata = get_user_meta( um_user( 'ID' ), $k . "_metadata", true );
559
if ( ! empty( $filedata['original_name'] ) ) {
560
+ $v = '<a href="' . esc_attr( UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $file ) . '">' . $filedata['original_name'] . '</a>';
561
} else {
562
+ $v = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $file;
563
}
564
}
565
1659
*/
1660
function um_get_cover_uri( $image, $attrs ) {
1661
$uri = false;
1662
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1663
1664
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
1665
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
1666
}
1670
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
1671
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
1672
}
1673
return $uri;
1674
}
1675
1699
*/
1700
function um_get_avatar_uri( $image, $attrs ) {
1701
$uri = false;
1702
$find = false;
1703
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1704
/**
1705
* UM hook
1706
*
1723
* ?>
1724
*/
1725
$cache_time = apply_filters( 'um_filter_avatar_cache_time', current_time( 'timestamp' ), um_user( 'ID' ) );
1726
+ if ( $attrs == 'original' && file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1727
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1728
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1729
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
1730
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
1731
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
1732
+ } else {
1733
+ $sizes = UM()->options()->get( 'photo_thumb_sizes' );
1734
+ if ( is_array( $sizes ) ) {
1735
+ $find = um_closest_num( $sizes, $attrs );
1736
+ }
1737
+
1738
+ if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
1739
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
1740
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
1741
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
1742
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1743
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1744
+ }
1745
+ }
1746
+
1747
if ( ! empty( $cache_time ) ) {
1748
$uri .= "?{$cache_time}";
1749
}
1750
return $uri;
1751
}
1752
languages/ultimate-member-en_US.mo CHANGED
Binary file
languages/ultimate-member-en_US.po CHANGED
@@ -1,8 +1,8 @@
1
msgid ""
2
msgstr ""
3
"Project-Id-Version: Ultimate Member\n"
4
- "POT-Creation-Date: 2018-10-05 10:16+0300\n"
5
- "PO-Revision-Date: 2018-10-05 10:16+0300\n"
6
"Last-Translator: \n"
7
"Language-Team: \n"
8
"Language: en_US\n"
@@ -115,7 +115,7 @@ msgstr ""
115
116
#: includes/admin/core/class-admin-builder.php:609
117
#: includes/admin/core/class-admin-builder.php:763
118
- #: includes/core/class-fields.php:4033
119
msgid "Please login as administrator"
120
msgstr ""
121
@@ -3526,7 +3526,7 @@ msgstr ""
3526
#: includes/admin/templates/modal/dynamic_new_group.php:14
3527
#: includes/admin/templates/modal/fonticons.php:11
3528
#: includes/admin/templates/role/publish.php:24
3529
- #: includes/core/class-fields.php:2272 includes/core/class-fields.php:2369
3530
#: includes/core/um-actions-profile.php:554
3531
#: includes/core/um-actions-profile.php:693
3532
#: includes/core/um-actions-profile.php:726
@@ -4165,7 +4165,7 @@ msgstr ""
4165
msgid "You must add a shortcode to the content area"
4166
msgstr ""
4167
4168
- #: includes/core/class-builtin.php:663 includes/core/class-user.php:1538
4169
msgid "Only me"
4170
msgstr ""
4171
@@ -6294,7 +6294,7 @@ msgstr ""
6294
msgid "Change photo"
6295
msgstr ""
6296
6297
- #: includes/core/class-fields.php:2271 includes/core/class-fields.php:2368
6298
msgid "Processing..."
6299
msgstr ""
6300
@@ -6302,58 +6302,58 @@ msgstr ""
6302
msgid "Upload File"
6303
msgstr ""
6304
6305
- #: includes/core/class-fields.php:2335 includes/core/um-filters-fields.php:243
6306
msgid "This file has been removed."
6307
msgstr ""
6308
6309
- #: includes/core/class-fields.php:2338 includes/core/class-fields.php:2368
6310
msgid "Change file"
6311
msgstr ""
6312
6313
- #: includes/core/class-fields.php:2368
6314
msgid "Save"
6315
msgstr ""
6316
6317
- #: includes/core/class-fields.php:3791
6318
#, php-format
6319
msgid ""
6320
"Your profile is looking a little empty. Why not <a href=\"%s\">add</a> some "
6321
"information!"
6322
msgstr ""
6323
6324
- #: includes/core/class-fields.php:3793
6325
msgid "This user has not added any information to their profile yet."
6326
msgstr ""
6327
6328
- #: includes/core/class-files.php:256
6329
msgid "Invalid parameters"
6330
msgstr ""
6331
6332
- #: includes/core/class-files.php:261
6333
msgid "Invalid coordinates"
6334
msgstr ""
6335
6336
- #: includes/core/class-files.php:266
6337
msgid "Invalid file ownership"
6338
msgstr ""
6339
6340
- #: includes/core/class-files.php:319
6341
msgid "Invalid nonce"
6342
msgstr ""
6343
6344
- #: includes/core/class-files.php:339 includes/core/class-files.php:424
6345
msgid "A theme or plugin compatibility issue"
6346
msgstr ""
6347
6348
- #: includes/core/class-files.php:967
6349
msgid "Ultimate Member: Not a valid temp file"
6350
msgstr ""
6351
6352
- #: includes/core/class-files.php:1095
6353
msgid "Invalid user ID: "
6354
msgstr ""
6355
6356
- #: includes/core/class-files.php:1104 includes/core/class-files.php:1132
6357
msgid "Unauthorized to do this attempt."
6358
msgstr ""
6359
@@ -6778,23 +6778,31 @@ msgstr ""
6778
msgid "Please enter your email"
6779
msgstr ""
6780
6781
- #: includes/core/um-actions-login.php:61
6782
msgid "Please enter your password"
6783
msgstr ""
6784
6785
- #: includes/core/um-actions-login.php:68
6786
msgid "Password is incorrect. Please try again."
6787
msgstr ""
6788
6789
- #: includes/core/um-actions-login.php:199
6790
msgid "This action has been prevented for security measures."
6791
msgstr ""
6792
6793
- #: includes/core/um-actions-login.php:423
6794
msgid "Keep me signed in"
6795
msgstr ""
6796
6797
- #: includes/core/um-actions-login.php:458
6798
msgid "Forgot your password?"
6799
msgstr ""
6800
@@ -6944,7 +6952,7 @@ msgstr ""
6944
msgid "Last login: %s"
6945
msgstr ""
6946
6947
- #: includes/core/um-filters-fields.php:274
6948
msgid "Untitled photo"
6949
msgstr ""
6950
@@ -6969,11 +6977,11 @@ msgstr ""
6969
msgid "Login as this user"
6970
msgstr ""
6971
6972
- #: includes/um-short-functions.php:580
6973
msgid "date submitted"
6974
msgstr ""
6975
6976
- #: includes/um-short-functions.php:586
6977
msgid "(empty)"
6978
msgstr ""
6979
1
msgid ""
2
msgstr ""
3
"Project-Id-Version: Ultimate Member\n"
4
+ "POT-Creation-Date: 2018-10-02 21:48+0300\n"
5
+ "PO-Revision-Date: 2018-10-02 21:48+0300\n"
6
"Last-Translator: \n"
7
"Language-Team: \n"
8
"Language: en_US\n"
115
116
#: includes/admin/core/class-admin-builder.php:609
117
#: includes/admin/core/class-admin-builder.php:763
118
+ #: includes/core/class-fields.php:4026
119
msgid "Please login as administrator"
120
msgstr ""
121
3526
#: includes/admin/templates/modal/dynamic_new_group.php:14
3527
#: includes/admin/templates/modal/fonticons.php:11
3528
#: includes/admin/templates/role/publish.php:24
3529
+ #: includes/core/class-fields.php:2272 includes/core/class-fields.php:2362
3530
#: includes/core/um-actions-profile.php:554
3531
#: includes/core/um-actions-profile.php:693
3532
#: includes/core/um-actions-profile.php:726
4165
msgid "You must add a shortcode to the content area"
4166
msgstr ""
4167
4168
+ #: includes/core/class-builtin.php:663 includes/core/class-user.php:1536
4169
msgid "Only me"
4170
msgstr ""
4171
6294
msgid "Change photo"
6295
msgstr ""
6296
6297
+ #: includes/core/class-fields.php:2271 includes/core/class-fields.php:2361
6298
msgid "Processing..."
6299
msgstr ""
6300
6302
msgid "Upload File"
6303
msgstr ""
6304
6305
+ #: includes/core/class-fields.php:2328 includes/core/um-filters-fields.php:230
6306
msgid "This file has been removed."
6307
msgstr ""
6308
6309
+ #: includes/core/class-fields.php:2331 includes/core/class-fields.php:2361
6310
msgid "Change file"
6311
msgstr ""
6312
6313
+ #: includes/core/class-fields.php:2361
6314
msgid "Save"
6315
msgstr ""
6316
6317
+ #: includes/core/class-fields.php:3784
6318
#, php-format
6319
msgid ""
6320
"Your profile is looking a little empty. Why not <a href=\"%s\">add</a> some "
6321
"information!"
6322
msgstr ""
6323
6324
+ #: includes/core/class-fields.php:3786
6325
msgid "This user has not added any information to their profile yet."
6326
msgstr ""
6327
6328
+ #: includes/core/class-files.php:240
6329
msgid "Invalid parameters"
6330
msgstr ""
6331
6332
+ #: includes/core/class-files.php:245
6333
msgid "Invalid coordinates"
6334
msgstr ""
6335
6336
+ #: includes/core/class-files.php:250
6337
msgid "Invalid file ownership"
6338
msgstr ""
6339
6340
+ #: includes/core/class-files.php:303
6341
msgid "Invalid nonce"
6342
msgstr ""
6343
6344
+ #: includes/core/class-files.php:323 includes/core/class-files.php:408
6345
msgid "A theme or plugin compatibility issue"
6346
msgstr ""
6347
6348
+ #: includes/core/class-files.php:951
6349
msgid "Ultimate Member: Not a valid temp file"
6350
msgstr ""
6351
6352
+ #: includes/core/class-files.php:1079
6353
msgid "Invalid user ID: "
6354
msgstr ""
6355
6356
+ #: includes/core/class-files.php:1088 includes/core/class-files.php:1116
6357
msgid "Unauthorized to do this attempt."
6358
msgstr ""
6359
6778
msgid "Please enter your email"
6779
msgstr ""
6780
6781
+ #: includes/core/um-actions-login.php:52
6782
+ msgid " Sorry, we can't find an account with that email address"
6783
+ msgstr ""
6784
+
6785
+ #: includes/core/um-actions-login.php:54
6786
+ msgid " Sorry, we can't find an account with that username"
6787
+ msgstr ""
6788
+
6789
+ #: includes/core/um-actions-login.php:58
6790
msgid "Please enter your password"
6791
msgstr ""
6792
6793
+ #: includes/core/um-actions-login.php:66
6794
msgid "Password is incorrect. Please try again."
6795
msgstr ""
6796
6797
+ #: includes/core/um-actions-login.php:194
6798
msgid "This action has been prevented for security measures."
6799
msgstr ""
6800
6801
+ #: includes/core/um-actions-login.php:418
6802
msgid "Keep me signed in"
6803
msgstr ""
6804
6805
+ #: includes/core/um-actions-login.php:453
6806
msgid "Forgot your password?"
6807
msgstr ""
6808
6952
msgid "Last login: %s"
6953
msgstr ""
6954
6955
+ #: includes/core/um-filters-fields.php:261
6956
msgid "Untitled photo"
6957
msgstr ""
6958
6977
msgid "Login as this user"
6978
msgstr ""
6979
6980
+ #: includes/um-short-functions.php:571
6981
msgid "date submitted"
6982
msgstr ""
6983
6984
+ #: includes/um-short-functions.php:577
6985
msgid "(empty)"
6986
msgstr ""
6987
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
Tags: community, member, membership, user-profile, user-registration
7
Requires at least: 4.7
8
Tested up to: 4.9
9
- Stable tag: 2.0.28
10
License: GNU Version 2 or Any Later Version
11
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
@@ -133,16 +133,6 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
133
134
= 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 =
135
136
- = 2.0.28: October 5, 2018 =
137
-
138
- * Bugfixes:
139
- - Fixed Email notifications
140
- - Fixed Download files/images for multisites
141
- - Fixed Profile/Cover image for multisites
142
- - Fixed XSS vulnerabilities (detected by @Serhack)
143
- - Fixed trim fields on submit forms
144
- - Fixed submitted info
145
-
146
= 2.0.27: October 2, 2018 =
147
148
* Bugfixes:
6
Tags: community, member, membership, user-profile, user-registration
7
Requires at least: 4.7
8
Tested up to: 4.9
9
+ Stable tag: 2.0.27
10
License: GNU Version 2 or Any Later Version
11
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
133
134
= 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 =
135
136
= 2.0.27: October 2, 2018 =
137
138
* 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.28
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.27
7
Author: Ultimate Member
8
Author URI: http://ultimatemember.com/
9
Text Domain: ultimate-member