From e69506ef326a9c3d9e87a9aa41ee5c9f90100296 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Sat, 2 Apr 2016 16:58:20 +0800 Subject: [PATCH 01/11] Fix user page redirection --- core/um-rewrite.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/um-rewrite.php b/core/um-rewrite.php index 8c44d94e..c60ebaa8 100644 --- a/core/um-rewrite.php +++ b/core/um-rewrite.php @@ -165,6 +165,8 @@ class UM_Rewrite { } exit( wp_redirect( $url ) ); + }else{ + exit( wp_redirect( home_url() ) ); } } From dd4fe917e9f8d0dc163a5783abe86c2145b5982b Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Mon, 4 Apr 2016 21:22:38 +0800 Subject: [PATCH 02/11] Add option to change gravatar images --- core/um-filters-avatars.php | 11 +++++++++-- core/um-short-functions.php | 11 +++++++++-- um-config.php | 22 +++++++++++++++++++++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/core/um-filters-avatars.php b/core/um-filters-avatars.php index c58d5ca5..f9483565 100644 --- a/core/um-filters-avatars.php +++ b/core/um-filters-avatars.php @@ -43,9 +43,16 @@ if( um_get_option('use_gravatars') && ! um_user('synced_profile_photo') && ! $has_profile_photo ){ $avatar_url = um_get_domain_protocol().'gravatar.com/avatar/'.um_user('synced_gravatar_hashed_id'); $avatar_url = add_query_arg('s',400, $avatar_url); - if( um_get_option('use_um_gravatar_default_image') ){ - $avatar_url = add_query_arg('d', um_get_default_avatar_uri(), $avatar_url ); + $gravatar_type = um_get_option('use_um_gravatar_default_builtin_image'); + + if( $gravatar_type == 'default' ){ + if( um_get_option('use_um_gravatar_default_image') ){ + $avatar_url = add_query_arg('d', um_get_default_avatar_uri(), $avatar_url ); + } + }else{ + $avatar_url = add_query_arg('d', $gravatar_type, $avatar_url ); } + } $avatar = ''; diff --git a/core/um-short-functions.php b/core/um-short-functions.php index a402fbd0..090dfcbf 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -1429,9 +1429,16 @@ function um_fetch_user( $user_id ) { if( um_get_option('use_gravatars') && ! um_user('synced_profile_photo') && ! $has_profile_photo ){ $avatar_uri = um_get_domain_protocol().'gravatar.com/avatar/'.um_user('synced_gravatar_hashed_id'); $avatar_uri = add_query_arg('s',400, $avatar_uri); - if( um_get_option('use_um_gravatar_default_image') ){ - $avatar_uri = add_query_arg('d', um_get_default_avatar_uri(), $avatar_uri ); + $gravatar_type = um_get_option('use_um_gravatar_default_builtin_image'); + + if( $gravatar_type == 'default' ){ + if( um_get_option('use_um_gravatar_default_image') ){ + $avatar_uri = add_query_arg('d', um_get_default_avatar_uri(), $avatar_uri ); + } + }else{ + $avatar_uri = add_query_arg('d', $gravatar_type, $avatar_uri ); } + } return ''; diff --git a/um-config.php b/um-config.php index 5e09c729..1231ca26 100644 --- a/um-config.php +++ b/um-config.php @@ -181,6 +181,26 @@ $this->sections[] = array( 'off' => __('No','ultimatemember'), ), + array( + 'id' => 'use_um_gravatar_default_builtin_image', + 'type' => 'select', + 'title' => __( 'Use Gravatar builtin image','ultimatemember' ), + 'desc' => __( 'Gravatar has a number of built in options which you can also use as defaults','ultimatemember' ), + 'default' => 'default', + 'options' => array( + 'default' => __('Default','ultimatemember'), + '404' => __('404 ( File Not Found response )','ultimatemember'), + 'mm' => __('Mystery Man','ultimatemember'), + 'identicon' => __('Identicon','ultimatemember'), + 'monsterid' => __('Monsterid','ultimatemember'), + 'wavatar' => __('Wavatar','ultimatemember'), + 'retro' => __('Retro','ultimatemember'), + 'blank' => __('Blank ( a transparent PNG image )','ultimatemember'), + + ), + 'required' => array( 'use_gravatars', '=', 1 ), + 'select2' => array( 'allowClear' => 0, 'minimumResultsForSearch' => -1 ), + ), array( 'id' => 'use_um_gravatar_default_image', 'type' => 'switch', @@ -189,7 +209,7 @@ $this->sections[] = array( 'desc' => __('Do you want to use the plugin default avatar instead of the gravatar default photo (If the user did not upload a custom profile photo / avatar)','ultimatemember'), 'on' => __('Yes','ultimatemember'), 'off' => __('No','ultimatemember'), - 'required' => array( 'use_gravatars', '=', 1 ), + 'required' => array( 'use_um_gravatar_default_builtin_image', '=', 'default' ), ), array( From 778a97c6c2813637167bd0cf83a7d12b8a3aaf4e Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Tue, 5 Apr 2016 13:13:41 +0800 Subject: [PATCH 03/11] Fix permalink base format --- core/um-filters-user.php | 34 ++++++++++++++++++++++++++-------- core/um-permalinks.php | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/core/um-filters-user.php b/core/um-filters-user.php index c11b89c4..b4311010 100644 --- a/core/um-filters-user.php +++ b/core/um-filters-user.php @@ -107,45 +107,61 @@ $value = $slugname; } + $value = apply_filters("um_permalink_base_before_filter", $value ); + $raw_value = $value; + switch( $permalink_base ){ case 'name': - - if( ! empty( $value ) && strrpos( $value ,".") > -1 ){ - $value = str_replace( '.', ' ', $value ); - } - // Checks if last name has a dash + if( ! empty( $value ) && strrpos( $value ,"_") > -1 ){ $value = str_replace( '_', '. ', $value ); } + + if( ! empty( $value ) && strrpos( $value ,"_") > -1 ){ + $value = str_replace( '_', '-', $value ); + } + + if( ! empty( $value ) && strrpos( $value ,".") > -1 && strrpos( $raw_value ,"_" ) <= -1 ){ + $value = str_replace( '.', ' ', $value ); + } + + $value = apply_filters("um_permalink_base_after_filter_name", $value, $raw_value ); break; case 'name_dash': - + if( ! empty( $value ) && strrpos( $value ,"-") > -1 ){ $value = str_replace( '-', ' ', $value ); } + if( ! empty( $value ) && strrpos( $value ,"_") > -1 ){ + $value = str_replace( '_', '-', $value ); + } + // Checks if last name has a dash if( ! empty( $value ) && strrpos( $value ,"_") > -1 ){ $value = str_replace( '_', '-', $value ); } + $value = apply_filters("um_permalink_base_after_filter_name_dash", $value, $raw_value ); + break; case 'name_plus': - + if( ! empty( $value ) && strrpos( $value ,"+") > -1 ){ $value = str_replace( '+', ' ', $value ); } - // Checks if last name has a dash if( ! empty( $value ) && strrpos( $value ,"_") > -1 ){ $value = str_replace( '_', '+', $value ); } + $value = apply_filters("um_permalink_base_after_filter_name_plus", $value, $raw_value ); + break; default: @@ -155,6 +171,8 @@ $value = str_replace( '_', '-', $value ); } + $value = apply_filters("um_permalink_base_after_filter", $value, $raw_value ); + break; } diff --git a/core/um-permalinks.php b/core/um-permalinks.php index ed452140..0aac2ea5 100644 --- a/core/um-permalinks.php +++ b/core/um-permalinks.php @@ -221,9 +221,11 @@ class UM_Permalinks { { $full_name = um_user( 'full_name' ); $last_name = um_user( 'last_name' ); - $count = intval( um_is_meta_value_exists( 'full_name', $full_name ) ); + $first_name = um_user( 'first_name' ); + + $count = intval( um_is_meta_value_exists( 'full_name', $full_name ) ); + - if( $count > 1 ) { $full_name .= ' ' . um_user( 'ID' ); @@ -231,7 +233,7 @@ class UM_Permalinks { switch( um_get_option('permalink_base') ) { - case 'name': + case 'name': // dotted $full_name_slug = $full_name; $difficulties = 0; @@ -248,11 +250,17 @@ class UM_Permalinks { $full_name = str_replace('_.', '_', $full_name ); $difficulties++; } - + $full_name_slug = str_replace( '-' , '.', $full_name_slug ); $full_name_slug = str_replace( ' ' , '.', $full_name_slug ); $full_name_slug = str_replace( '..' , '.', $full_name_slug ); + if( strpos( $full_name, '.' ) > -1 ){ + $full_name = str_replace('.', ' ', $full_name ); + $difficulties++; + } + + if( $difficulties > 0 ){ update_user_meta( um_user('ID'), 'um_user_profile_url_slug_name_'.$full_name_slug, $full_name ); } @@ -262,17 +270,22 @@ class UM_Permalinks { break; - case 'name_dash': + case 'name_dash': // dashed $difficulties = 0; $full_name_slug = strtolower( $full_name ); - // if name has dashed replace with underscore + // if last name has dashed replace with underscore if( strpos( $last_name, '-') > -1 && strpos( $full_name, '-' ) > -1 ){ $difficulties++; $full_name = str_replace('-', '_', $full_name ); } + // if first name has dashed replace with underscore + if( strpos( $first_name, '-') > -1 && strpos( $full_name, '-' ) > -1 ){ + $difficulties++; + $full_name = str_replace('-', '_', $full_name ); + } // if name has space, replace with dash $full_name_slug = str_replace( ' ' , '-', $full_name_slug ); @@ -292,20 +305,29 @@ class UM_Permalinks { break; - case 'name_plus': + case 'name_plus': // plus $difficulties = 0; $full_name_slug = strtolower( $full_name ); - // if name has dashed replace with underscore + // if last name has dashed replace with underscore if( strpos( $last_name, '+') > -1 && strpos( $full_name, '+' ) > -1 ){ $difficulties++; $full_name = str_replace('-', '_', $full_name ); } + // if first name has dashed replace with underscore + if( strpos( $first_name, '+') > -1 && strpos( $full_name, '+' ) > -1 ){ + $difficulties++; + $full_name = str_replace('-', '_', $full_name ); + } + if( strpos( $last_name, '-') > -1 || strpos( $first_name, '-') > -1 || strpos( $full_name, '-') > -1 ){ + $difficulties++; + } // if name has space, replace with dash $full_name_slug = str_replace( ' ' , '+', $full_name_slug ); - + $full_name_slug = str_replace( '-' , '+', $full_name_slug ); + // if name has period if( strpos( $last_name, '.') > -1 && strpos( $full_name, '.' ) > -1 ){ $difficulties++; From 3c0f57442d125dcd93fe7fb51aa88e53c596f111 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Tue, 5 Apr 2016 14:09:33 +0800 Subject: [PATCH 04/11] Fix edit profile redirect --- core/um-actions-profile.php | 3 ++- core/um-short-functions.php | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/um-actions-profile.php b/core/um-actions-profile.php index 1366d4af..32e7a826 100644 --- a/core/um-actions-profile.php +++ b/core/um-actions-profile.php @@ -120,7 +120,8 @@ do_action('um_user_after_updating_profile', $to_update ); if ( !isset( $args['is_signup'] ) ) { - exit( wp_redirect( um_edit_my_profile_cancel_uri() ) ); + $url = $ultimatemember->permalinks->profile_url(); + exit( wp_redirect( um_edit_my_profile_cancel_uri( $url ) ) ); } } diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 090dfcbf..ccc0d2da 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -803,10 +803,15 @@ function um_reset_user() { /*** *** @remove edit profile args from url ***/ - function um_edit_my_profile_cancel_uri() { - $url = remove_query_arg( 'um_action' ); - $url = remove_query_arg( 'profiletab', $url ); - $url = add_query_arg('profiletab', 'main', $url ); + function um_edit_my_profile_cancel_uri( $url = '' ) { + global $ultimatemember; + + if( empty( $url ) ){ + $url = remove_query_arg( 'um_action' ); + $url = remove_query_arg( 'profiletab', $url ); + $url = add_query_arg('profiletab', 'main', $url ); + } + return $url; } From 83c602b18fa56abe07b4c6995100328b7e781021 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Tue, 5 Apr 2016 21:25:39 +0800 Subject: [PATCH 05/11] Fix image png upload transparency --- core/um-files.php | 94 ++++++++++++++----------------------- core/um-short-functions.php | 25 +++++----- 2 files changed, 48 insertions(+), 71 deletions(-) diff --git a/core/um-files.php b/core/um-files.php index 92e5320e..46ef1c2d 100644 --- a/core/um-files.php +++ b/core/um-files.php @@ -481,7 +481,7 @@ class UM_Files { $info = @getimagesize( $file ); - + if ( $info['mime'] == 'image/gif' ){ $img_r = imagecreatefromgif( $file ); @@ -491,12 +491,12 @@ class UM_Files { } else if ( $info['mime'] == 'image/png' ){ - $srcImage = imagecreatefrompng( $file ); - $targetImage = imagecreatetruecolor( $targ_x2, $targ_y2 ); - imagealphablending( $targetImage, false ); - imagesavealpha( $targetImage, true ); - imagecopyresampled( $targetImage, $srcImage, 0, 0, 0, 0, $targ_x1, $targ_y1, $targ_x2, $targ_y2 ); - imagepng( $srcImage, $this->path_only( $file ) . basename( $file ) ); + $img_r = imagecreatefrompng( $file ); + $dst_r = imagecreatetruecolor( $targ_x2, $targ_y2 ); + imagealphablending( $dst_r, false); + imagesavealpha( $dst_r, true); + imagecopy( $dst_r, $img_r, 0, 0, $targ_x1, $targ_y1, $targ_x2, $targ_y2 ); + imagepng( $dst_r, $this->path_only( $file ) . basename( $file ) ); }else{ @@ -539,19 +539,8 @@ class UM_Files { wp_die( __('Unauthorized to do this attempt.','ultimatemember') ); } - // name and extension stuff - $source_name = basename( $source ); - - if ( $key == 'profile_photo' ) { - $source_name = 'profile_photo.jpg'; - } - - if ( $key == 'cover_photo' ) { - $source_name = 'cover_photo.jpg'; - } - - $ext = '.' . pathinfo($source_name, PATHINFO_EXTENSION); - $name = str_replace( $ext, '', $source_name ); + $ext = '.' . pathinfo($source, PATHINFO_EXTENSION); + $name = $key; $filename = $name . $ext; // copy & overwrite file @@ -565,11 +554,14 @@ class UM_Files { // thumbs if ( $key == 'profile_photo' ) { - list($w, $h) = @getimagesize( $source ); + list($w, $h) = @getimagesize( $source ); $sizes = um_get_option('photo_thumb_sizes'); foreach( $sizes as $size ) { + + $ratio = round( $w / $h, 2 ); + $height = round( $size / $ratio, 2 ); if ( file_exists( $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ) ) { unlink( $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ); @@ -581,30 +573,21 @@ class UM_Files { $thumb_s = imagecreatefromjpeg( $source ); $thumb = imagecreatetruecolor( $size, $size ); imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $size, $w, $h ); - + imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100); + imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . $ext, 100); + }else if ( $info['mime'] == 'image/png' ){ + $thumb_s = imagecreatefrompng( $source ); + $thumb = imagecreatetruecolor( $size, $size ); + imagealphablending( $thumb, false); + imagesavealpha( $thumb, true); + imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $size, $w, $h ); + imagepng( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ); }else if ( $info['mime'] == 'image/gif' ){ $thumb_s = imagecreatefromgif( $source ); $thumb = imagecreatetruecolor( $size, $size ); imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $size, $w, $h ); - - } - - - if ( $info['mime'] == 'image/jpeg' ){ - imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100); - }else if ( $info['mime'] == 'image/png' ){ - - $srcImage = imagecreatefrompng( $source ); - $targetImage = imagecreatetruecolor( $size, $size ); - imagealphablending( $targetImage, false ); - imagesavealpha( $targetImage, true ); - imagecopyresampled( $targetImage, $srcImage, 0, 0, 0, 0, $size, $size, $w, $h ); - imagepng( $srcImage, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 0 ,PNG_ALL_FILTERS); - - }else if ( $info['mime'] == 'image/gif' ){ - imagegif( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext); - + imagegif( $thumb, $this->upload_basedir . $user_id . '/' . $name . $ext); } } @@ -632,28 +615,21 @@ class UM_Files { if ( $size < $w ) { if ( $info['mime'] == 'image/jpeg' ){ - $thumb = imagecreatetruecolor( $size, $height ); - imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); - $thumb_s = imagecreatefromjpeg( $source ); - }else if ( $info['mime'] == 'image/gif' ){ - $thumb = imagecreatetruecolor( $size, $height ); - imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); - $thumb_s = imagecreatefromgif( $source ); - } - - - if ( $info['mime'] == 'image/jpeg' ){ + $thumb = imagecreatetruecolor( $size, $height ); + imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); + $thumb_s = imagecreatefromjpeg( $source ); imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100); }else if ( $info['mime'] == 'image/png' ){ - - $srcImage = imagecreatefrompng( $source ); - $targetImage = imagecreatetruecolor( $size, $height ); - imagealphablending( $targetImage, false ); - imagesavealpha( $targetImage, true ); - imagecopyresampled( $targetImage, $srcImage, 0, 0, 0, 0, $size, $height, $w, $h ); - - imagepng($srcImage, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 0 ,PNG_ALL_FILTERS); + $thumb_s = imagecreatefrompng( $source ); + $thumb = imagecreatetruecolor( $size, $height ); + imagealphablending( $thumb, false); + imagesavealpha( $thumb, true); + imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); + imagepng( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ); }else if ( $info['mime'] == 'image/gif' ){ + $thumb = imagecreatetruecolor( $size, $height ); + imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); + $thumb_s = imagecreatefromgif( $source ); imagegif( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext); } } diff --git a/core/um-short-functions.php b/core/um-short-functions.php index ccc0d2da..c6872eb0 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -1192,11 +1192,12 @@ function um_fetch_user( $user_id ) { function um_get_cover_uri( $image, $attrs ) { global $ultimatemember; $uri = false; - if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/cover_photo.jpg' ) ) { - $uri = um_user_uploads_uri() . 'cover_photo.jpg?' . current_time( 'timestamp' ); + $ext = '.' . pathinfo($image, PATHINFO_EXTENSION); + if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/cover_photo'.$ext ) ) { + $uri = um_user_uploads_uri() . 'cover_photo'.$ext.'?' . current_time( 'timestamp' ); } - if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/cover_photo-' . $attrs. '.jpg' ) ){ - $uri = um_user_uploads_uri() . 'cover_photo-'.$attrs.'.jpg?' . current_time( 'timestamp' ); + if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/cover_photo-' .$attrs.$ext ) ){ + $uri = um_user_uploads_uri() . 'cover_photo-'.$attrs.$ext.'?' . current_time( 'timestamp' ); } return $uri; } @@ -1216,28 +1217,28 @@ function um_fetch_user( $user_id ) { global $ultimatemember; $uri = false; $find = false; + $ext = '.' . pathinfo($image, PATHINFO_EXTENSION); + if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $attrs. $ext ) ) { - if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $attrs. '.jpg' ) ) { - - $uri = um_user_uploads_uri() . 'profile_photo-'.$attrs.'.jpg?' . current_time( 'timestamp' ); + $uri = um_user_uploads_uri() . 'profile_photo-'.$attrs.$ext.'?' . current_time( 'timestamp' ); } else { $sizes = um_get_option('photo_thumb_sizes'); if ( is_array( $sizes ) ) $find = um_closest_num( $sizes, $attrs ); - if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $find. '.jpg' ) ) { + if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $find.$ext ) ) { - $uri = um_user_uploads_uri() . 'profile_photo-'.$find.'.jpg?' . current_time( 'timestamp' ); + $uri = um_user_uploads_uri() . 'profile_photo-'.$find.$ext.'?' . current_time( 'timestamp' ); - } else if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo.jpg' ) ) { + } else if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo'.$ext ) ) { - $uri = um_user_uploads_uri() . 'profile_photo.jpg?' . current_time( 'timestamp' ); + $uri = um_user_uploads_uri() . 'profile_photo'.$ext.'?' . current_time( 'timestamp' ); } if ( $attrs == 'original' ) { - $uri = um_user_uploads_uri() . 'profile_photo.jpg?' . current_time( 'timestamp' ); + $uri = um_user_uploads_uri() . 'profile_photo'.$ext.'?' . current_time( 'timestamp' ); } } From 800d9d86e0c6f44feda1ded0500882b0177fd393 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 6 Apr 2016 10:15:29 +0800 Subject: [PATCH 06/11] Tagging 1.3.45 --- README.md | 4 ++-- index.php | 2 +- readme.txt | 25 ++++++++++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index abfb056a..ef6c36ad 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Ultimate Member is a powerful and flexible WordPress plugin that makes it a bree | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 1.3.44| WordPress 4.1 or higher| 1.3.38 | +| 1.3.45| WordPress 4.1 or higher| 1.3.38 | ##Features of the plugin include: @@ -47,7 +47,7 @@ GNU Version 2 or Any Later Version Releases ==================== -[Latest Release: Ultimate Member v1.3.44](https://github.com/ultimatemember/ultimatemember/releases). +[Latest Release: Ultimate Member v1.3.45](https://github.com/ultimatemember/ultimatemember/releases). Changelog ==================== diff --git a/index.php b/index.php index e50c8c4e..c7eb232f 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 1.3.44 +Version: 1.3.45 Author: Ultimate Member Author URI: http://ultimatemember.com/ */ diff --git a/readme.txt b/readme.txt index 29e2def7..b2909b9f 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm Requires at least: 4.1 Tested up to: 4.4 -Stable Tag: 1.3.44 +Stable Tag: 1.3.45 License: GNU Version 2 or Any Later Version @@ -148,6 +148,29 @@ The plugin works with popular caching plugins by automatically excluding Ultimat 16. Screenshot 16 == Changelog == += 1.3.45: April 6, 2016 = +* New: support for wordfence and limit login +* New: search widget +* New: secondary email address +* Added: hook to password reset form fields +* Added: privacy options for profile menu tabs +* Added: option to allow primary email editable in profile view +* Added: member directory sort randomly +* Fixed: user page redirection +* Fixed: admin script error +* Fixed: invalid image path +* Fixed: upload image png with transparency +* Fixed: permalink basename fallback +* Fixed: casting variable and add new filter +* Fixed: remove notices +* Fixed: search users by tag +* Fixed: force UT8 encoding option +* Fixed: email content type +* Fixed: WPML compatibility +* Fixed: permalink base name format and redirect loop in profile page +* Fixed: form labels textdomain +* Fixed: edit profile redirect +* Tweak: accept period in profile url = 1.3.44: March 11, 2016 = * New: an option to force Strings to use UTF-8 encoding From 6df0e1bfedca91c6316d10dcde87d44e9c8944e1 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 6 Apr 2016 11:24:11 +0800 Subject: [PATCH 07/11] Fix image jpg upload --- core/um-files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/um-files.php b/core/um-files.php index 46ef1c2d..8dcc33c0 100644 --- a/core/um-files.php +++ b/core/um-files.php @@ -616,8 +616,8 @@ class UM_Files { if ( $info['mime'] == 'image/jpeg' ){ $thumb = imagecreatetruecolor( $size, $height ); - imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); $thumb_s = imagecreatefromjpeg( $source ); + imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100); }else if ( $info['mime'] == 'image/png' ){ $thumb_s = imagecreatefrompng( $source ); @@ -628,8 +628,8 @@ class UM_Files { imagepng( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ); }else if ( $info['mime'] == 'image/gif' ){ $thumb = imagecreatetruecolor( $size, $height ); - imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); $thumb_s = imagecreatefromgif( $source ); + imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h ); imagegif( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext); } } From be859cbb8ce6714258be877009ca883dbb1ab60f Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 6 Apr 2016 11:49:23 +0800 Subject: [PATCH 08/11] Tagging 1.3.46 --- README.md | 2 +- index.php | 2 +- readme.txt | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef6c36ad..13b742a8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Ultimate Member is a powerful and flexible WordPress plugin that makes it a bree | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 1.3.45| WordPress 4.1 or higher| 1.3.38 | +| 1.3.46| WordPress 4.1 or higher| 1.3.38 | ##Features of the plugin include: diff --git a/index.php b/index.php index c7eb232f..584dce32 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 1.3.45 +Version: 1.3.46 Author: Ultimate Member Author URI: http://ultimatemember.com/ */ diff --git a/readme.txt b/readme.txt index b2909b9f..cd479e37 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm Requires at least: 4.1 Tested up to: 4.4 -Stable Tag: 1.3.45 +Stable Tag: 1.3.46 License: GNU Version 2 or Any Later Version @@ -148,6 +148,10 @@ The plugin works with popular caching plugins by automatically excluding Ultimat 16. Screenshot 16 == Changelog == += 1.3.46: April 6, 2016 = +* Fixed: Search widget fatal error +* Fixed: image jpeg upload sizes + = 1.3.45: April 6, 2016 = * New: support for wordfence and limit login * New: search widget From 561e2433a1e4dbabf184dc21149a1f02feb01f3f Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 6 Apr 2016 12:34:57 +0800 Subject: [PATCH 09/11] Tagging 1.3.47 --- README.md | 2 +- index.php | 2 +- readme.txt | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13b742a8..745fb606 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Ultimate Member is a powerful and flexible WordPress plugin that makes it a bree | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 1.3.46| WordPress 4.1 or higher| 1.3.38 | +| 1.3.47| WordPress 4.1 or higher| 1.3.38 | ##Features of the plugin include: diff --git a/index.php b/index.php index 584dce32..8c3cb2da 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 1.3.46 +Version: 1.3.47 Author: Ultimate Member Author URI: http://ultimatemember.com/ */ diff --git a/readme.txt b/readme.txt index cd479e37..72a147dc 100644 --- a/readme.txt +++ b/readme.txt @@ -148,6 +148,10 @@ The plugin works with popular caching plugins by automatically excluding Ultimat 16. Screenshot 16 == Changelog == + += 1.3.47: April 6, 2016 = +* Fixed: Fatal errors with language filter file + = 1.3.46: April 6, 2016 = * Fixed: Search widget fatal error * Fixed: image jpeg upload sizes From fce2e486ea79640bdc0728970fdcf7b84b3ba7ae Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 6 Apr 2016 13:58:32 +0800 Subject: [PATCH 10/11] Fix user sort by random --- core/um-filters-members.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/um-filters-members.php b/core/um-filters-members.php index 62c777a4..47e372f9 100644 --- a/core/um-filters-members.php +++ b/core/um-filters-members.php @@ -238,13 +238,13 @@ /*** *** @sorting random ***/ - add_filter('pre_user_query', function($query) { - if($query->query_vars["orderby"] == 'random') { + add_filter('pre_user_query','um_modify_sortby_randomly'); + function um_modify_sortby_randomly( $query ){ + if($query->query_vars["orderby"] == 'random') { $query->query_orderby = 'ORDER by RAND()'; - } - - return $query; - }); + } + return $query; + } /*** *** @hook in the member results array From 9dcf9c2c7e59128b6463074141dece1a3cd3dd86 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 6 Apr 2016 14:26:21 +0800 Subject: [PATCH 11/11] Remove notice --- core/um-actions-login.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/um-actions-login.php b/core/um-actions-login.php index 3ba247af..bf77e4d4 100644 --- a/core/um-actions-login.php +++ b/core/um-actions-login.php @@ -78,7 +78,9 @@ add_action( 'um_before_login_fields', 'um_display_login_errors' ); function um_display_login_errors( $args ) { global $ultimatemember; - + + $error = ''; + if( $ultimatemember->form->count_errors() > 0 ) { $error = array_values( $ultimatemember->form->errors ); $error = array_shift( $error );