Ultimate Member – User Profile & Membership Plugin - Version 1.0.48

Version Description

Download this release

Release Info

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

Code changes from version 1.0.47 to 1.0.48

admin/assets/css/um-admin-columns.css CHANGED
@@ -54,10 +54,20 @@
54
line-height: 34px;
55
}
56
.um-admin-tag.small {font-size: 13px;height:28px;line-height: 28px;display:inline;padding: 4px 10px;background: transparent;color: #666;border-radius:0;}
57
- .um-admin-tag.ok {border-left: 2px solid #93ba37}
58
.um-admin-tag.pending {border-left: 2px solid #b76767}
59
60
.um-admin-txtspace {margin: 0 0 0 10px;}
61
62
- .um-adm-ico {font-size: 20px;margin-top: 5px;display:inline-block;color:#3ba1da}
63
.um-adm-ico.pointer {cursor: pointer}
54
line-height: 34px;
55
}
56
.um-admin-tag.small {font-size: 13px;height:28px;line-height: 28px;display:inline;padding: 4px 10px;background: transparent;color: #666;border-radius:0;}
57
+ .um-admin-tag.approved {border-left: 2px solid #7ACF58}
58
.um-admin-tag.pending {border-left: 2px solid #b76767}
59
60
.um-admin-txtspace {margin: 0 0 0 10px;}
61
62
+ .um-adm-ico {
63
+ font-size: 20px;
64
+ width: 20px;
65
+ text-align: center;
66
+ margin-top: 5px;
67
+ display: inline-block;
68
+ color: #7ACF58;
69
+ }
70
+
71
+ .um-adm-ico.inactive {color: #b76767}
72
+
73
.um-adm-ico.pointer {cursor: pointer}
admin/assets/css/um-admin-dashboard.css CHANGED
@@ -3,7 +3,7 @@
3
}
4
5
.wrap a.red,
6
- .wrap span.red {color:#A00}
7
8
.wrap span.ok {color:#7ACF58}
9
3
}
4
5
.wrap a.red,
6
+ .wrap span.red {color:#b76767}
7
8
.wrap span.ok {color:#7ACF58}
9
admin/assets/css/um-admin-misc.css CHANGED
@@ -115,9 +115,11 @@ body.um-admin-modal-open {
115
margin: 0 0 8px 0 !important;
116
padding: 0!important;
117
font-size: 13px;
118
- color: #888;
119
}
120
121
.um-admin-metabox input[type=text]:disabled{
122
opacity: 0.7 !important;
123
color: #aaa !important;
115
margin: 0 0 8px 0 !important;
116
padding: 0!important;
117
font-size: 13px;
118
+ color: #666;
119
}
120
121
+ .um-admin-metabox label strong {color: #222}
122
+
123
.um-admin-metabox input[type=text]:disabled{
124
opacity: 0.7 !important;
125
color: #aaa !important;
admin/core/um-admin-actions.php CHANGED
@@ -67,7 +67,6 @@
67
68
$locale = get_option('WPLANG');
69
if ( !$locale ) return;
70
- if ( file_exists( WP_LANG_DIR . '/plugins/ultimatemember-'.$locale.'.mo' ) ) return;
71
if ( !isset( $ultimatemember->available_languages[$locale] ) ) return;
72
73
$path = $ultimatemember->files->upload_basedir;
@@ -86,7 +85,9 @@
86
copy( $remote2_tmp, $path . 'ultimatemember-' . $locale . '.mo' );
87
unlink( $remote2_tmp );
88
89
- exit( wp_redirect( remove_query_arg('um_adm_action') ) );
90
91
}
92
67
68
$locale = get_option('WPLANG');
69
if ( !$locale ) return;
70
if ( !isset( $ultimatemember->available_languages[$locale] ) ) return;
71
72
$path = $ultimatemember->files->upload_basedir;
85
copy( $remote2_tmp, $path . 'ultimatemember-' . $locale . '.mo' );
86
unlink( $remote2_tmp );
87
88
+ $url = remove_query_arg('um_adm_action', $ultimatemember->permalinks->get_current_url() );
89
+ $url = add_query_arg('update','language_updated',$url);
90
+ exit( wp_redirect($url) );
91
92
}
93
admin/core/um-admin-dashboard.php CHANGED
@@ -50,7 +50,8 @@ class UM_Admin_Dashboard {
50
*** @load metabox stuff
51
***/
52
function on_load_page() {
53
-
54
wp_enqueue_script('common');
55
wp_enqueue_script('wp-lists');
56
wp_enqueue_script('postbox');
@@ -62,7 +63,33 @@ class UM_Admin_Dashboard {
62
add_meta_box('um-metaboxes-contentbox-1', __('Users Overview','ultimatemember'), array(&$this, 'users_overview'), $this->pagehook, 'normal', 'core');
63
64
add_meta_box('um-metaboxes-sidebox-1', __('Purge Temp Files','ultimatemember'), array(&$this, 'purge_temp'), $this->pagehook, 'side', 'core');
65
-
66
}
67
68
function users_overview() {
@@ -75,6 +102,38 @@ class UM_Admin_Dashboard {
75
include_once um_path . 'admin/templates/dashboard/purge.php';
76
}
77
78
/***
79
*** @get a directory size
80
***/
50
*** @load metabox stuff
51
***/
52
function on_load_page() {
53
+ global $ultimatemember;
54
+
55
wp_enqueue_script('common');
56
wp_enqueue_script('wp-lists');
57
wp_enqueue_script('postbox');
63
add_meta_box('um-metaboxes-contentbox-1', __('Users Overview','ultimatemember'), array(&$this, 'users_overview'), $this->pagehook, 'normal', 'core');
64
65
add_meta_box('um-metaboxes-sidebox-1', __('Purge Temp Files','ultimatemember'), array(&$this, 'purge_temp'), $this->pagehook, 'side', 'core');
66
+
67
+ if ( $this->language_avaialable_not_installed() ) {
68
+ add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'dl_language'), $this->pagehook, 'side', 'core');
69
+ } else if ( $this->language_avaialable_installed() ) {
70
+ add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'up_language'), $this->pagehook, 'side', 'core');
71
+ } else if ( $this->language_not_available() ) {
72
+ add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'ct_language'), $this->pagehook, 'side', 'core');
73
+ }
74
+
75
+ }
76
+
77
+ function up_language() {
78
+ global $ultimatemember;
79
+ $locale = get_option('WPLANG');
80
+ include_once um_path . 'admin/templates/dashboard/language-update.php';
81
+ }
82
+
83
+ function dl_language() {
84
+ global $ultimatemember;
85
+ $locale = get_option('WPLANG');
86
+ include_once um_path . 'admin/templates/dashboard/language-download.php';
87
+ }
88
+
89
+ function ct_language() {
90
+ global $ultimatemember;
91
+ $locale = get_option('WPLANG');
92
+ include_once um_path . 'admin/templates/dashboard/language-contrib.php';
93
}
94
95
function users_overview() {
102
include_once um_path . 'admin/templates/dashboard/purge.php';
103
}
104
105
+ /***
106
+ *** @language not available
107
+ ***/
108
+ function language_not_available() {
109
+ $locale = get_option('WPLANG');
110
+ if ( $locale && !isset( $ultimatemember->available_languages[$locale] ) && !file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
111
+ return true;
112
+ return false;
113
+ }
114
+
115
+ /***
116
+ *** @language available but not installed
117
+ ***/
118
+ function language_avaialable_not_installed() {
119
+ global $ultimatemember;
120
+ $locale = get_option('WPLANG');
121
+ if ( $locale && isset( $ultimatemember->available_languages[$locale] ) && !file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
122
+ return true;
123
+ return false;
124
+ }
125
+
126
+ /***
127
+ *** @language available and installed
128
+ ***/
129
+ function language_avaialable_installed() {
130
+ global $ultimatemember;
131
+ $locale = get_option('WPLANG');
132
+ if ( $locale && isset( $ultimatemember->available_languages[$locale] ) && file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
133
+ return true;
134
+ return false;
135
+ }
136
+
137
/***
138
*** @get a directory size
139
***/
admin/core/um-admin-metabox.php CHANGED
@@ -122,7 +122,10 @@ class UM_Admin_Metabox {
122
***/
123
function ui_on_off( $id, $default=0, $is_conditional=false, $cond1='', $cond1_show='', $cond1_hide='', $yes='', $no='' ) {
124
125
- $meta = get_post_meta( get_the_ID(), $id, true );
126
127
$yes = ( !empty( $yes ) ) ? $yes : __('Yes');
128
$no = ( !empty( $no ) ) ? $no : __('No');
122
***/
123
function ui_on_off( $id, $default=0, $is_conditional=false, $cond1='', $cond1_show='', $cond1_hide='', $yes='', $no='' ) {
124
125
+ $meta = (string)get_post_meta( get_the_ID(), $id, true );
126
+ if ( $meta === '0' && $default > 0 ) {
127
+ $default = $meta;
128
+ }
129
130
$yes = ( !empty( $yes ) ) ? $yes : __('Yes');
131
$no = ( !empty( $no ) ) ? $no : __('No');
admin/core/um-admin-notices.php CHANGED
@@ -27,7 +27,9 @@ class UM_Admin_Notices {
27
$path = str_replace('//','/',$path);
28
29
if ( !file_exists( $path ) ) {
30
@mkdir( $path, 0777, true);
31
}
32
33
}
@@ -111,6 +113,10 @@ class UM_Admin_Notices {
111
$update = $_REQUEST['update'];
112
switch($update) {
113
114
case 'purged_temp':
115
$messages[0]['content'] = __('Your temp uploads directory is now clean.','ultimatemember');
116
break;
27
$path = str_replace('//','/',$path);
28
29
if ( !file_exists( $path ) ) {
30
+ $old = umask(0);
31
@mkdir( $path, 0777, true);
32
+ umask($old);
33
}
34
35
}
113
$update = $_REQUEST['update'];
114
switch($update) {
115
116
+ case 'language_updated':
117
+ $messages[0]['content'] = __('Your translation files have been updated successfully.','ultimatemember');
118
+ break;
119
+
120
case 'purged_temp':
121
$messages[0]['content'] = __('Your temp uploads directory is now clean.','ultimatemember');
122
break;
admin/core/um-admin-users.php CHANGED
@@ -248,7 +248,7 @@ class UM_Admin_Users {
248
249
um_fetch_user( $user_id );
250
if ( um_user('account_status') == 'approved' ) {
251
- $output = '<span class="um-admin-tag small ok">'.um_user('account_status_name').'</span>';
252
} else {
253
$output = '<span class="um-admin-tag small pending">'.um_user('account_status_name').'</span>';
254
}
248
249
um_fetch_user( $user_id );
250
if ( um_user('account_status') == 'approved' ) {
251
+ $output = '<span class="um-admin-tag small approved">'.um_user('account_status_name').'</span>';
252
} else {
253
$output = '<span class="um-admin-tag small pending">'.um_user('account_status_name').'</span>';
254
}
admin/templates/dashboard/language-contrib.php ADDED
@@ -0,0 +1,3 @@
1
+ <p><?php printf(__('Ultimate Member is not yet available in your language: <strong>%1$s</strong>.','ultimatemember'), $locale); ?></p>
2
+
3
+ <p><?php _e('If you want to contribute this translation to the plugin, please add it on our <a href="https://ultimatemember.com/forums/"><forums</a>.','ultimatemember'); ?></p>
admin/templates/dashboard/language-download.php ADDED
@@ -0,0 +1,3 @@
1
+ <p><?php printf(__('Ultimate Member is available in your language: <strong>%1$s (%2$s)</strong>.','ultimatemember'), $ultimatemember->available_languages[$locale], $locale); ?></p>
2
+
3
+ <p><a href="<?php echo add_query_arg( 'um_adm_action', 'um_language_downloader' ); ?>" class="button"><?php _e('Download Translation','ultimatemember'); ?></a></p>
admin/templates/dashboard/language-update.php ADDED
@@ -0,0 +1,3 @@
1
+ <p><?php printf(__('You are currently using Ultimate Member in your language: <strong>%1$s (%2$s)</strong>.','ultimatemember'), $ultimatemember->available_languages[$locale], $locale); ?></p>
2
+
3
+ <p><a href="<?php echo add_query_arg( 'um_adm_action', 'um_language_downloader' ); ?>" class="button"><?php _e('Force Update Translation','ultimatemember'); ?></a></p>
core/lib/upload/um-image-upload.php CHANGED
@@ -16,7 +16,7 @@ if(isset($_FILES[$id]['name'])) {
16
17
$temp = $_FILES[$id]["tmp_name"];
18
$file = $_FILES[$id]["name"];
19
-
20
21
$error = $ultimatemember->files->check_image_upload( $temp, $id );
22
if ( $error ){
16
17
$temp = $_FILES[$id]["tmp_name"];
18
$file = $_FILES[$id]["name"];
19
+ $file = str_replace(array('(',')','+','&','?','%','{','}','[',']','=',',',';',' '),'',$file);
20
21
$error = $ultimatemember->files->check_image_upload( $temp, $id );
22
if ( $error ){
core/um-access.php CHANGED
@@ -15,15 +15,19 @@ class UM_Access {
15
*** @do actions based on priority
16
***/
17
function template_redirect() {
18
-
19
do_action('um_access_homepage_per_role');
20
21
do_action('um_access_global_settings');
22
23
do_action('um_access_post_settings');
24
25
- if ( $this->redirect_handler && !$this->allow_access )
26
exit( wp_redirect( $this->redirect_handler ) );
27
28
}
29
15
*** @do actions based on priority
16
***/
17
function template_redirect() {
18
+ global $ultimatemember;
19
+
20
do_action('um_access_homepage_per_role');
21
22
do_action('um_access_global_settings');
23
24
do_action('um_access_post_settings');
25
26
+ if ( $this->redirect_handler && !$this->allow_access ) {
27
+ $curr = $ultimatemember->permalinks->get_current_url();
28
+ $this->redirect_handler = add_query_arg('redirect_to', $curr, $this->redirect_handler);
29
exit( wp_redirect( $this->redirect_handler ) );
30
+ }
31
32
}
33
core/um-account.php CHANGED
@@ -114,30 +114,56 @@ class UM_Account {
114
function get_tab_output( $id ) {
115
global $ultimatemember;
116
117
switch( $id ) {
118
- case 'privacy' :
119
$args = 'profile_privacy,hide_in_members';
120
break;
121
- case 'delete' :
122
$args = 'single_user_password';
123
break;
124
- case 'general' :
125
$args = 'user_login,first_name,last_name,user_email';
126
break;
127
- case 'password' :
128
$args = 'user_password';
129
break;
130
default :
131
$args = null;
132
break;
133
}
134
-
135
- $fields = $ultimatemember->builtin->get_specific_fields( $args );
136
- $output = null;
137
- foreach( $fields as $key => $data ){
138
- $output .= $ultimatemember->fields->edit_field( $key, $data );
139
- }
140
- return $output;
141
}
142
143
/***
114
function get_tab_output( $id ) {
115
global $ultimatemember;
116
117
+ $output = null;
118
+
119
switch( $id ) {
120
+
121
+ case 'notifications':
122
+ $output = apply_filters("um_account_content_hook_{$id}", $output);
123
+ return $output;
124
+ break;
125
+
126
+ case 'privacy':
127
$args = 'profile_privacy,hide_in_members';
128
+ $fields = $ultimatemember->builtin->get_specific_fields( $args );
129
+ foreach( $fields as $key => $data ){
130
+ $output .= $ultimatemember->fields->edit_field( $key, $data );
131
+ }
132
+ return $output;
133
break;
134
+
135
+ case 'delete':
136
$args = 'single_user_password';
137
+ $fields = $ultimatemember->builtin->get_specific_fields( $args );
138
+ foreach( $fields as $key => $data ){
139
+ $output .= $ultimatemember->fields->edit_field( $key, $data );
140
+ }
141
+ return $output;
142
break;
143
+
144
+ case 'general':
145
$args = 'user_login,first_name,last_name,user_email';
146
+ $fields = $ultimatemember->builtin->get_specific_fields( $args );
147
+ foreach( $fields as $key => $data ){
148
+ $output .= $ultimatemember->fields->edit_field( $key, $data );
149
+ }
150
+ return $output;
151
break;
152
+
153
+ case 'password':
154
$args = 'user_password';
155
+ $fields = $ultimatemember->builtin->get_specific_fields( $args );
156
+ foreach( $fields as $key => $data ){
157
+ $output .= $ultimatemember->fields->edit_field( $key, $data );
158
+ }
159
+ return $output;
160
break;
161
+
162
default :
163
$args = null;
164
break;
165
+
166
}
167
}
168
169
/***
core/um-actions-access.php CHANGED
@@ -114,7 +114,7 @@
114
case 2:
115
116
if ( !is_user_logged_in() ){
117
- if ( !$access_redirect ) $access_redirect = home_url();
118
$redirect_to = $access_redirect;
119
}
120
114
case 2:
115
116
if ( !is_user_logged_in() ){
117
+ if ( !$access_redirect ) $access_redirect = um_get_core_page('login');
118
$redirect_to = $access_redirect;
119
}
120
core/um-actions-account.php CHANGED
@@ -38,6 +38,8 @@
38
}
39
}
40
41
$tab = ( get_query_var('um_tab') ) ? get_query_var('um_tab') : 'general';
42
43
exit( wp_redirect( $ultimatemember->account->tab_link( $tab ) ) );
@@ -218,6 +220,30 @@
218
}
219
}
220
221
/***
222
*** @display account photo and username
223
***/
38
}
39
}
40
41
+ do_action('um_pre_account_update');
42
+
43
$tab = ( get_query_var('um_tab') ) ? get_query_var('um_tab') : 'general';
44
45
exit( wp_redirect( $ultimatemember->account->tab_link( $tab ) ) );
220
}
221
}
222
223
+ /***
224
+ *** @display tab "Notifications"
225
+ ***/
226
+ add_action('um_account_tab__notifications', 'um_account_tab__notifications');
227
+ function um_account_tab__notifications( $info ) {
228
+ global $ultimatemember;
229
+ extract( $info );
230
+ extract( $info );
231
+
232
+ $output = $ultimatemember->account->get_tab_output('notifications');
233
+
234
+ if ( $output ) { ?>
235
+
236
+ <div class="um-account-heading uimob340-hide uimob500-hide"><i class="<?php echo $icon; ?>"></i><?php echo $title; ?></div>
237
+
238
+ <?php echo $output; ?>
239
+
240
+ <div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Notifications','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
241
+
242
+ <?php
243
+
244
+ }
245
+ }
246
+
247
/***
248
*** @display account photo and username
249
***/
core/um-mail.php CHANGED
@@ -11,7 +11,7 @@ class UM_Mail {
11
/***
12
*** @mandrill compatibility
13
***/
14
- function mandrill_nl2br($nl2br, $message) {
15
16
// text emails
17
$nl2br = true;
11
/***
12
*** @mandrill compatibility
13
***/
14
+ function mandrill_nl2br($nl2br, $message = '') {
15
16
// text emails
17
$nl2br = true;
core/um-query.php CHANGED
@@ -181,7 +181,7 @@ class UM_Query {
181
$real_role_slug = $role_slug;
182
}
183
} else {
184
- $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_name = '$role_slug'");
185
$real_role_slug = $role_slug;
186
}
187
181
$real_role_slug = $role_slug;
182
}
183
} else {
184
+ $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_name = '$role_slug'");
185
$real_role_slug = $role_slug;
186
}
187
core/um-shortcodes.php CHANGED
@@ -98,12 +98,14 @@ class UM_Shortcodes {
98
}
99
100
$args = apply_filters('um_shortcode_args_filter', $args );
101
-
102
- if ( um_profile_id() && isset( $args['role'] ) && $args['role'] && $args['role'] != $ultimatemember->query->get_role_by_userid( um_profile_id() ) )
103
- return;
104
105
extract( $args, EXTR_SKIP );
106
107
do_action("um_pre_{$mode}_shortcode", $args);
108
109
do_action("um_before_form_is_loaded", $args);
98
}
99
100
$args = apply_filters('um_shortcode_args_filter', $args );
101
102
extract( $args, EXTR_SKIP );
103
104
+ // for profiles only
105
+ if ( $mode == 'profile' && um_profile_id() && isset( $args['role'] ) && $args['role'] &&
106
+ $args['role'] != $ultimatemember->query->get_role_by_userid( um_profile_id() ) )
107
+ return;
108
+
109
do_action("um_pre_{$mode}_shortcode", $args);
110
111
do_action("um_before_form_is_loaded", $args);
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.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: 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.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.1
9
10
- Stable Tag: 1.0.47
11
12
License: GNU Version 2 or Any Later Version
13
@@ -186,6 +186,18 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
186
187
== Changelog ==
188
189
= 1.0.47: February 9, 2015 =
190
191
* New: A more native dashboard for Ultimate Member
7
Requires at least: 4.1
8
Tested up to: 4.1
9
10
+ Stable Tag: 1.0.48
11
12
License: GNU Version 2 or Any Later Version
13
186
187
== Changelog ==
188
189
+ = 1.0.48: February 10, 2015 =
190
+
191
+ * New: added translation downloader/updater in plugin dashboard
192
+ * New: added admin notice when language is updated or downloaded
193
+ * Tweak: redirect to login page by default if content is restricted
194
+ * Tweak: redirect back to the protected content after successful login
195
+ * Tweak: small modifications to plugin admin css
196
+ * Fixed: issue with registration form per role not appearing (when logged in)
197
+ * Fixed: image and file uploads strip illegal characters from file name
198
+ * Fixed: small issue with mandrill plugin
199
+ * Fixed: bug with role creation that have used slugs that exist in database
200
+
201
= 1.0.47: February 9, 2015 =
202
203
* New: A more native dashboard for Ultimate Member