Version Description
Download this release
Release Info
Developer | ultimatemember |
Plugin | Ultimate Member – User Profile & Membership Plugin |
Version | 1.0.25 |
Comparing to | |
See all releases |
Code changes from version 1.0.24 to 1.0.25
- admin/core/um-admin-metabox.php +1 -1
- core/lib/mobiledetect/Mobile_Detect.php +4 -25
- core/um-actions-access.php +5 -1
- core/um-actions-account.php +5 -5
- core/um-actions-form.php +1 -1
- core/um-actions-members.php +1 -1
- core/um-actions-password.php +1 -1
- core/um-actions-profile.php +1 -1
- core/um-filters-avatars.php +39 -10
- core/um-user.php +2 -0
- index.php +1 -1
- readme.txt +10 -1
- um-config.php +8 -0
admin/core/um-admin-metabox.php
CHANGED
@@ -820,7 +820,7 @@ class UM_Admin_Metabox {
|
|
820 |
case '_force_good_pass':
|
821 |
?>
|
822 |
|
823 |
-
<p><label for="_force_good_pass">Force strong password? <?php $this->tooltip( __('Turn on to force users to create a strong password (
|
824 |
<?php if ( isset( $this->edit_mode_value ) ) $this->ui_on_off('_force_good_pass', $this->edit_mode_value ); else $this->ui_on_off('_force_good_pass', 0 ); ?>
|
825 |
</p>
|
826 |
|
820 |
case '_force_good_pass':
|
821 |
?>
|
822 |
|
823 |
+
<p><label for="_force_good_pass">Force strong password? <?php $this->tooltip( __('Turn on to force users to create a strong password (A combination of one lowercase letter, one uppercase letter, and one number). If turned on this option is only applied to register forms and not to login forms.','ultimatemember') ); ?></label>
|
824 |
<?php if ( isset( $this->edit_mode_value ) ) $this->ui_on_off('_force_good_pass', $this->edit_mode_value ); else $this->ui_on_off('_force_good_pass', 0 ); ?>
|
825 |
</p>
|
826 |
|
core/lib/mobiledetect/Mobile_Detect.php
CHANGED
@@ -1,29 +1,6 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
* =====================
|
5 |
-
*
|
6 |
-
* Motto: "Every business should have a mobile detection script to detect mobile readers"
|
7 |
-
*
|
8 |
-
* Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets).
|
9 |
-
* It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
|
10 |
-
*
|
11 |
-
* @author Current authors: Serban Ghita <serbanghita@gmail.com>
|
12 |
-
* Nick Ilyin <nick.ilyin@gmail.com>
|
13 |
-
*
|
14 |
-
* Original author: Victor Stanciu <vic.stanciu@gmail.com>
|
15 |
-
*
|
16 |
-
* @license Code and contributions have 'MIT License'
|
17 |
-
* More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt
|
18 |
-
*
|
19 |
-
* @link Homepage: http://mobiledetect.net
|
20 |
-
* GitHub Repo: https://github.com/serbanghita/Mobile-Detect
|
21 |
-
* Google Code: http://code.google.com/p/php-mobile-detect/
|
22 |
-
* README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
|
23 |
-
* HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
|
24 |
-
*
|
25 |
-
* @version 2.8.11
|
26 |
-
*/
|
27 |
|
28 |
class Mobile_Detect
|
29 |
{
|
@@ -1339,3 +1316,5 @@ class Mobile_Detect
|
|
1339 |
return self::MOBILE_GRADE_C;
|
1340 |
}
|
1341 |
}
|
|
|
|
1 |
<?php
|
2 |
+
|
3 |
+
if ( !class_exists('Mobile_Detect') ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
class Mobile_Detect
|
6 |
{
|
1316 |
return self::MOBILE_GRADE_C;
|
1317 |
}
|
1318 |
}
|
1319 |
+
|
1320 |
+
}
|
core/um-actions-access.php
CHANGED
@@ -61,12 +61,16 @@
|
|
61 |
|
62 |
$post_id = get_option('woocommerce_shop_page_id');
|
63 |
|
|
|
|
|
|
|
|
|
64 |
} else {
|
65 |
|
66 |
if ( !get_post_type() || !isset($post->ID) ) return;
|
67 |
|
68 |
}
|
69 |
-
|
70 |
if ( !isset( $post_id ) )
|
71 |
$post_id = $post->ID;
|
72 |
|
61 |
|
62 |
$post_id = get_option('woocommerce_shop_page_id');
|
63 |
|
64 |
+
} else if ( is_archive() ) {
|
65 |
+
|
66 |
+
return;
|
67 |
+
|
68 |
} else {
|
69 |
|
70 |
if ( !get_post_type() || !isset($post->ID) ) return;
|
71 |
|
72 |
}
|
73 |
+
|
74 |
if ( !isset( $post_id ) )
|
75 |
$post_id = $post->ID;
|
76 |
|
core/um-actions-account.php
CHANGED
@@ -87,7 +87,7 @@
|
|
87 |
}
|
88 |
|
89 |
if ( !$ultimatemember->validation->strong_pass( $_POST['user_password'] ) ) {
|
90 |
-
$ultimatemember->form->add_error('user_password', 'Your password must contain at least one capital letter and one number');
|
91 |
$ultimatemember->account->current_tab = 'password';
|
92 |
}
|
93 |
|
@@ -228,7 +228,7 @@
|
|
228 |
|
229 |
<div class="um-account-meta radius-<?php echo um_get_option('profile_photocorner'); ?> uimob340-show uimob500-show">
|
230 |
|
231 |
-
<div class="um-account-meta-img"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('
|
232 |
|
233 |
<div class="um-account-name"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('display_name'); ?></a></div>
|
234 |
|
@@ -250,15 +250,15 @@
|
|
250 |
|
251 |
<div class="um-account-meta radius-<?php echo um_get_option('profile_photocorner'); ?>">
|
252 |
|
253 |
-
<div class="um-account-meta-img uimob800-hide"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('
|
254 |
|
255 |
<?php if ( $ultimatemember->mobile->isMobile() ) { ?>
|
256 |
|
257 |
-
<div class="um-account-meta-img-b uimob800-show" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('
|
258 |
|
259 |
<?php } else { ?>
|
260 |
|
261 |
-
<div class="um-account-meta-img-b uimob800-show um-tip-w" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('
|
262 |
|
263 |
<?php } ?>
|
264 |
|
87 |
}
|
88 |
|
89 |
if ( !$ultimatemember->validation->strong_pass( $_POST['user_password'] ) ) {
|
90 |
+
$ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
|
91 |
$ultimatemember->account->current_tab = 'password';
|
92 |
}
|
93 |
|
228 |
|
229 |
<div class="um-account-meta radius-<?php echo um_get_option('profile_photocorner'); ?> uimob340-show uimob500-show">
|
230 |
|
231 |
+
<div class="um-account-meta-img"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
232 |
|
233 |
<div class="um-account-name"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('display_name'); ?></a></div>
|
234 |
|
250 |
|
251 |
<div class="um-account-meta radius-<?php echo um_get_option('profile_photocorner'); ?>">
|
252 |
|
253 |
+
<div class="um-account-meta-img uimob800-hide"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
254 |
|
255 |
<?php if ( $ultimatemember->mobile->isMobile() ) { ?>
|
256 |
|
257 |
+
<div class="um-account-meta-img-b uimob800-show" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
258 |
|
259 |
<?php } else { ?>
|
260 |
|
261 |
+
<div class="um-account-meta-img-b uimob800-show um-tip-w" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
262 |
|
263 |
<?php } ?>
|
264 |
|
core/um-actions-form.php
CHANGED
@@ -173,7 +173,7 @@
|
|
173 |
|
174 |
if ( isset( $array['force_good_pass'] ) && $array['force_good_pass'] == 1 ) {
|
175 |
if ( !$ultimatemember->validation->strong_pass( $args[$key] ) ) {
|
176 |
-
$ultimatemember->form->add_error($key, __('Your password must contain at least one capital letter and one number') );
|
177 |
}
|
178 |
}
|
179 |
|
173 |
|
174 |
if ( isset( $array['force_good_pass'] ) && $array['force_good_pass'] == 1 ) {
|
175 |
if ( !$ultimatemember->validation->strong_pass( $args[$key] ) ) {
|
176 |
+
$ultimatemember->form->add_error($key, __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
|
177 |
}
|
178 |
}
|
179 |
|
core/um-actions-members.php
CHANGED
@@ -227,7 +227,7 @@
|
|
227 |
$default_size = str_replace( 'px', '', um_get_option('profile_photosize') );
|
228 |
$corner = um_get_option('profile_photocorner');
|
229 |
?>
|
230 |
-
<div class="um-member-photo radius-<?php echo $corner; ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('
|
231 |
<?php } ?>
|
232 |
|
233 |
<div class="um-member-card <?php if (!$profile_photo) { echo 'no-photo'; } ?>">
|
227 |
$default_size = str_replace( 'px', '', um_get_option('profile_photosize') );
|
228 |
$corner = um_get_option('profile_photocorner');
|
229 |
?>
|
230 |
+
<div class="um-member-photo radius-<?php echo $corner; ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), $default_size ); ?></a></div>
|
231 |
<?php } ?>
|
232 |
|
233 |
<div class="um-member-card <?php if (!$profile_photo) { echo 'no-photo'; } ?>">
|
core/um-actions-password.php
CHANGED
@@ -126,7 +126,7 @@
|
|
126 |
}
|
127 |
|
128 |
if ( !$ultimatemember->validation->strong_pass( $args['user_password'] ) ) {
|
129 |
-
$ultimatemember->form->add_error('user_password', 'Your password must contain at least one capital letter and one number');
|
130 |
}
|
131 |
|
132 |
if ( !$args['confirm_user_password'] ) {
|
126 |
}
|
127 |
|
128 |
if ( !$ultimatemember->validation->strong_pass( $args['user_password'] ) ) {
|
129 |
+
$ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
|
130 |
}
|
131 |
|
132 |
if ( !$args['confirm_user_password'] ) {
|
core/um-actions-profile.php
CHANGED
@@ -244,7 +244,7 @@
|
|
244 |
|
245 |
<div class="um-profile-photo" data-user_id="<?php echo um_profile_id(); ?>">
|
246 |
|
247 |
-
<a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"><?php echo $overlay . um_user('
|
248 |
|
249 |
<?php
|
250 |
|
244 |
|
245 |
<div class="um-profile-photo" data-user_id="<?php echo um_profile_id(); ?>">
|
246 |
|
247 |
+
<a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"><?php echo $overlay . get_avatar( um_user('ID'), $default_size ); ?></a>
|
248 |
|
249 |
<?php
|
250 |
|
core/um-filters-avatars.php
CHANGED
@@ -1,22 +1,51 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/***
|
4 |
*** @Override avatars with a high priority
|
5 |
***/
|
6 |
-
|
|
|
7 |
|
8 |
-
if (
|
9 |
-
$
|
10 |
-
|
11 |
-
$
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
-
um_fetch_user( $
|
15 |
|
16 |
$avatar = um_user('profile_photo', $size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
um_reset_user();
|
18 |
return $avatar;
|
19 |
|
20 |
-
}
|
21 |
-
|
22 |
-
add_filter('get_avatar', 'um_get_avatar', 10000000, 5);
|
1 |
<?php
|
2 |
|
3 |
+
/***
|
4 |
+
*** @Do not apply to backend default avatars
|
5 |
+
***/
|
6 |
+
add_filter('avatar_defaults', 'um_avatar_defaults', 99999 );
|
7 |
+
function um_avatar_defaults($avatar_defaults) {
|
8 |
+
remove_filter('get_avatar', 'um_get_avatar', 99999, 5);
|
9 |
+
return $avatar_defaults;
|
10 |
+
}
|
11 |
+
|
12 |
/***
|
13 |
*** @Override avatars with a high priority
|
14 |
***/
|
15 |
+
add_filter('get_avatar', 'um_get_avatar', 99999, 5);
|
16 |
+
function um_get_avatar($avatar = '', $id_or_email='', $size = '96', $avatar_class = '', $default = '', $alt = '') {
|
17 |
|
18 |
+
if ( is_numeric($id_or_email) )
|
19 |
+
$user_id = (int) $id_or_email;
|
20 |
+
elseif ( is_string( $id_or_email ) && ( $user = get_user_by( 'email', $id_or_email ) ) )
|
21 |
+
$user_id = $user->ID;
|
22 |
+
elseif ( is_object( $id_or_email ) && ! empty( $id_or_email->user_id ) )
|
23 |
+
$user_id = (int) $id_or_email->user_id;
|
24 |
+
if ( empty( $user_id ) )
|
25 |
+
return $avatar;
|
26 |
|
27 |
+
um_fetch_user( $user_id );
|
28 |
|
29 |
$avatar = um_user('profile_photo', $size);
|
30 |
+
|
31 |
+
if ( !um_profile('profile_photo') && um_get_option('use_gravatars') ) {
|
32 |
+
if ( is_ssl() ) {
|
33 |
+
$protocol = 'https://';
|
34 |
+
} else {
|
35 |
+
$protocol = 'http://';
|
36 |
+
}
|
37 |
+
|
38 |
+
$default = get_option( 'avatar_default', 'mystery' );
|
39 |
+
if ( $default == 'gravatar_default' ) {
|
40 |
+
$default = '';
|
41 |
+
}
|
42 |
+
|
43 |
+
$avatar = '<img src="' . $protocol . 'gravatar.com/avatar/' . md5( um_user('user_email') ) .
|
44 |
+
'?d='. $default . '&s=' . $size . '" class="gravatar avatar avatar-'.$size.' um-avatar" width="'.$size.'" height="'.$size.'" alt="" />';
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
um_reset_user();
|
49 |
return $avatar;
|
50 |
|
51 |
+
}
|
|
|
|
core/um-user.php
CHANGED
@@ -134,6 +134,8 @@ class UM_User {
|
|
134 |
// add permissions
|
135 |
$user_role = $this->get_role();
|
136 |
$this->role_meta = $ultimatemember->query->role_data( $user_role );
|
|
|
|
|
137 |
$this->profile = array_merge( $this->profile, (array)$this->role_meta);
|
138 |
|
139 |
$this->profile['super_admin'] = ( is_super_admin( $this->id ) ) ? 1 : 0;
|
134 |
// add permissions
|
135 |
$user_role = $this->get_role();
|
136 |
$this->role_meta = $ultimatemember->query->role_data( $user_role );
|
137 |
+
$this->role_meta = apply_filters('um_user_permissions_filter', $this->role_meta, $this->id);
|
138 |
+
|
139 |
$this->profile = array_merge( $this->profile, (array)$this->role_meta);
|
140 |
|
141 |
$this->profile['super_admin'] = ( is_super_admin( $this->id ) ) ? 1 : 0;
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Ultimate Member
|
4 |
Plugin URI: http://ultimatemember.com/
|
5 |
Description: Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress
|
6 |
-
Version: 1.0.
|
7 |
Author: Ultimate Member
|
8 |
Author URI: http://ultimatemember.com/
|
9 |
*/
|
3 |
Plugin Name: Ultimate Member
|
4 |
Plugin URI: http://ultimatemember.com/
|
5 |
Description: Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress
|
6 |
+
Version: 1.0.25
|
7 |
Author: Ultimate Member
|
8 |
Author URI: http://ultimatemember.com/
|
9 |
*/
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Tags: access control, community, communities, conditional fields, conditional lo
|
|
7 |
Requires at least: 4.1
|
8 |
Tested up to: 4.1
|
9 |
|
10 |
-
Stable Tag: 1.0.
|
11 |
|
12 |
License: GNU Version 2 or Any Later Version
|
13 |
|
@@ -168,6 +168,15 @@ Yes. The plugin works fine with WordPress network / multisite now. In a recent u
|
|
168 |
|
169 |
== Changelog ==
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
= 1.0.24: January 26, 2015 =
|
172 |
|
173 |
* Tweak: predefined fields are now localized (translatable)
|
7 |
Requires at least: 4.1
|
8 |
Tested up to: 4.1
|
9 |
|
10 |
+
Stable Tag: 1.0.25
|
11 |
|
12 |
License: GNU Version 2 or Any Later Version
|
13 |
|
168 |
|
169 |
== Changelog ==
|
170 |
|
171 |
+
= 1.0.25: January 26, 2015 =
|
172 |
+
|
173 |
+
* New: addded support to use gravatars (optionally) If the user does not have a custom avatar
|
174 |
+
* New: um_user_permissions_filter hook (for developer use)
|
175 |
+
* Tweak: plugin uses get_avatar() properly now
|
176 |
+
* Fixed: user avatars in backend are fixed
|
177 |
+
* Fixed: Mobile_Detect class does not throw php error if it was previously called
|
178 |
+
* Fixed: corrected a few translations errors
|
179 |
+
|
180 |
= 1.0.24: January 26, 2015 =
|
181 |
|
182 |
* Tweak: predefined fields are now localized (translatable)
|
um-config.php
CHANGED
@@ -78,6 +78,14 @@ $this->sections[] = array(
|
|
78 |
'off' => __('Disable'),
|
79 |
),
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
)
|
82 |
|
83 |
);
|
78 |
'off' => __('Disable'),
|
79 |
),
|
80 |
|
81 |
+
array(
|
82 |
+
'id' => 'use_gravatars',
|
83 |
+
'type' => 'switch',
|
84 |
+
'title' => __( 'Use Gravatars?' ),
|
85 |
+
'default' => 0,
|
86 |
+
'desc' => __('Do you want to use gravatars instead of the default plugin profile photo (If the user did not upload a custom profile photo / avatar)','ultimatemember'),
|
87 |
+
),
|
88 |
+
|
89 |
)
|
90 |
|
91 |
);
|