diff --git a/admin/assets/css/um-admin-dashboard.css b/admin/assets/css/um-admin-dashboard.css index 6f530367..1ef798fa 100644 --- a/admin/assets/css/um-admin-dashboard.css +++ b/admin/assets/css/um-admin-dashboard.css @@ -1,110 +1,11 @@ -/* - - General -*/ - -.um-admin.toplevel_page_ultimatemember div.error, -.um-admin.toplevel_page_ultimatemember div.updated -{ - margin: 18px 20px 0 2px !important; +.wrap h2 sup { + font-size: 15px; } -.um-admin-dash-container { - box-sizing: border-box; - margin: 18px 20px 20px 2px !important; - background: none !important; - overflow: hidden; -} +.wrap a.red, +.wrap span.red {color:#A00} -.um-admin-dash-container * { - -webkit-font-smoothing: antialiased !important; - -moz-osx-font-smoothing: grayscale !important; -} - -.um-admin-dash-container a.ok {color: #7ACF58} -.um-admin-dash-container a.red {color: #C74A4A} - -.um-admin-dash-count { - background: #7ACF58; - color: #fff; - padding: 2px 6px; - border-radius: 3px; - font-family: Open Sans; - font-weight: 700; - font-size: 12px; - margin-left: 10px; - display: none; -} -.um-admin-dash-count.count-0 {background: #ddd !important} -.um-admin-dash-count.red {background:#C74A4A} - -.um-admin-dash-head { - background: #3ba1da; - padding: 0 0 0 20px; -} - -.um-admin-dash-foot { - border-radius: 0; - background: none !important; - padding: 10px 0; - border-top: 1px solid #D8D8D8; -} - -/* - - Header -*/ - -.um-admin-dash-head-logo { - float: left; - margin: 20px 10px; -} - -.um-admin-dash-head h2 { - color: #fff; - font-size: 24px !important; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - background: url(../img/logo-header.png) no-repeat left 8px; - padding: 10px 10px 10px 80px; - margin: 0 !important; - display: inline-block; - font-style: normal; - padding-right: 5px; - line-height: 29px; -} - -.um-admin-dash-head span { - color: #fff !important; - font-size: 14px; - position: relative; - top: -10px; - font-weight: 600; - padding-left: 4px; -} - -/* - - Main -*/ - -.um-admin-dash-main { - margin-left: 201px; - border-left: 1px solid #D8D8D8; - padding: 0 30px 30px 30px; - box-shadow: 0px 1px 0px #FFF inset; - border-left: none; - margin-left: 0; -} - -.um-admin-dash-main h3{ - font-weight: 500; - padding: 30px 0 10px 0; - margin: 0 !important; -} - -.um-admin-dash-main h4{ - font-weight: 500; - padding: 30px 0 10px 0; - margin: 0 !important; -} +.wrap span.ok {color:#7ACF58} .um-admin-dash-review { text-decoration: none !important; @@ -114,9 +15,10 @@ right: 4px; } -/* - - Share icons -*/ +.um-admin-dash-content h4 { + margin: 10px 0 3px 0; + padding: 0; +} .um-admin-dash-share { margin-top: 11px !important; @@ -133,10 +35,6 @@ } .um-admin-dash-share a:hover {color: #3ba1da !important} -/* - - Dashboard styles -*/ - .um-admin-dash-four-col .um-admin-dash-col { float: left; width: 25%; @@ -161,17 +59,10 @@ .um-admin-dash-col a:hover {text-decoration: underline} .um-admin-dash-col a {text-decoration: none} -.um-admin-dash-num { - display: inline-block; - margin: 8px 0 0 0; - font-size: 28px; - font-weight: 300; -} - .um-admin-dash-item { padding: 5px 0; vertical-align: middle; - border-top: 1px solid #e5e5e5; + border-top: 1px solid #eee; display: inline-block; width: 100%; box-sizing: border-box; diff --git a/admin/assets/css/um-admin-misc.css b/admin/assets/css/um-admin-misc.css index 8b9c49cc..cddd6eb0 100644 --- a/admin/assets/css/um-admin-misc.css +++ b/admin/assets/css/um-admin-misc.css @@ -183,7 +183,7 @@ body.um-admin-modal-open { } .um-admin-success-block { - background: #7ACE5A; + background: #7ACF58; } /* diff --git a/admin/core/um-admin-actions.php b/admin/core/um-admin-actions.php index d944374f..a3b604e6 100644 --- a/admin/core/um-admin-actions.php +++ b/admin/core/um-admin-actions.php @@ -1,5 +1,20 @@ files->remove_dir( $ultimatemember->files->upload_temp ); + + $url = remove_query_arg('um_adm_action', $ultimatemember->permalinks->get_current_url() ); + $url = add_query_arg('update','purged_temp',$url); + exit( wp_redirect($url) ); + } + /*** *** @duplicate form ***/ diff --git a/admin/core/um-admin-dashboard.php b/admin/core/um-admin-dashboard.php new file mode 100644 index 00000000..e2b54913 --- /dev/null +++ b/admin/core/um-admin-dashboard.php @@ -0,0 +1,159 @@ +slug = 'ultimatemember'; + + $this->about_tabs['about'] = 'About'; + $this->about_tabs['start'] = 'Getting Started'; + + add_action('admin_menu', array(&$this, 'primary_admin_menu'), 0); + add_action('admin_menu', array(&$this, 'secondary_menu_items'), 1000); + + } + + /*** + *** @setup admin menu + ***/ + function primary_admin_menu() { + + $this->pagehook = add_menu_page( __('Ultimate Member', $this->slug), __('Ultimate Member', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page'), 'dashicons-admin-users', '66.78578'); + add_action('load-'.$this->pagehook, array(&$this, 'on_load_page')); + + add_submenu_page( $this->slug, __('Dashboard', $this->slug), __('Dashboard', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page') ); + + foreach( $this->about_tabs as $k => $tab ) { + add_submenu_page( '_'. $k . '_um', sprintf(__('%s | Ultimate Member', $this->slug), $tab), sprintf(__('%s | Ultimate Member', $this->slug), $tab), 'manage_options', $this->slug . '-' . $k, array(&$this, 'admin_page') ); + } + + } + + /*** + *** @secondary admin menu (after settings) + ***/ + function secondary_menu_items() { + + add_submenu_page( $this->slug, __('Forms', $this->slug), __('Forms', $this->slug), 'manage_options', 'edit.php?post_type=um_form', '', '' ); + add_submenu_page( $this->slug, __('User Roles', $this->slug), __('User Roles', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' ); + + if ( um_get_option('members_page' ) || !get_option('um_options') ){ + add_submenu_page( $this->slug, __('Member Directories', $this->slug), __('Member Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' ); + } + + do_action('um_extend_admin_menu'); + + } + + /*** + *** @load metabox stuff + ***/ + function on_load_page() { + + wp_enqueue_script('common'); + wp_enqueue_script('wp-lists'); + wp_enqueue_script('postbox'); + + add_screen_option('layout_columns', array('max' => 2, 'default' => 2) ); + + /** custom metaboxes for dashboard defined here **/ + + add_meta_box('um-metaboxes-contentbox-1', __('Users Overview','ultimatemember'), array(&$this, 'users_overview'), $this->pagehook, 'normal', 'core'); + + add_meta_box('um-metaboxes-sidebox-1', __('Purge Temp Files','ultimatemember'), array(&$this, 'purge_temp'), $this->pagehook, 'side', 'core'); + + } + + function users_overview() { + global $ultimatemember; + include_once um_path . 'admin/templates/dashboard/users.php'; + } + + function purge_temp() { + global $ultimatemember; + include_once um_path . 'admin/templates/dashboard/purge.php'; + } + + /*** + *** @get a directory size + ***/ + function dir_size( $directory ) { + global $ultimatemember; + if ( $directory == 'temp' ) { + $directory = $ultimatemember->files->upload_temp; + $size = 0; + foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file){ + $size+=$file->getSize(); + } + return round ( $size / 1048576, 2); + } + return 0; + } + + /*** + *** @which admin page to show? + ***/ + function admin_page() { + + $page = $_REQUEST['page']; + if ( $page == 'ultimatemember' ) { + + ?> + +
+ +

Ultimate Member

+ +
+ + + + + + + +
+ +
+ +
pagehook,'normal',null); ?>
+
pagehook,'side',null); ?>
+ +
+ +
+ +
+
+ +
args['share_icons'] as $k => $arr ) { ?> +
+ + + + - -
- -
- -
- -
- -
- -
- -
- - - -
- -
- -
- -
-
- - args['share_icons'] as $k => $arr ) { ?> - -
-
- -
\ No newline at end of file diff --git a/admin/templates/dashboard/overview.php b/admin/templates/dashboard/overview.php deleted file mode 100644 index 12d0e415..00000000 --- a/admin/templates/dashboard/overview.php +++ /dev/null @@ -1,158 +0,0 @@ -
- -
- -

- - query->get_users_by_status('approved') as $user_id ) { um_fetch_user( $user_id ); ?> - -
- -
- -
- -
- -
- -
- - '; - - } - - ?> - -
- -
- -
- -
- - - -
- -
- - query->get_users_by_status('awaiting_admin_review'); ?> -

0

- - - -
- -
- -
- -
- -
- -
- - '; - - } - - ?> - -
- -
- Approve  |  Reject -
- -
- - - - -
- - -
- -
- -
- -
- - query->get_users_by_status('awaiting_email_confirmation'); ?> -

0

- - - -
- -
- -
- -
- -
- -
- - - -
- - - - -
- - -
- -
- - query->get_users_by_status('inactive'); ?> -

0

- - - -
- -
- -
- -
- -
- -
- -
- Re-activate  |  Delete -
- -
- - - - -
- - -
- -
\ No newline at end of file diff --git a/admin/templates/dashboard/purge.php b/admin/templates/dashboard/purge.php new file mode 100644 index 00000000..44fc55cc --- /dev/null +++ b/admin/templates/dashboard/purge.php @@ -0,0 +1,11 @@ +dir_size('temp') > 0.1 ) { ?> + +

You can free up dir_size('temp'); ?>MB by purging your temp upload directory.

+ +

Purge Temp

+ + + +

Your temp uploads directory is clean. There is nothing to purge.

+ + \ No newline at end of file diff --git a/admin/templates/dashboard/users.php b/admin/templates/dashboard/users.php new file mode 100644 index 00000000..365e7684 --- /dev/null +++ b/admin/templates/dashboard/users.php @@ -0,0 +1,162 @@ +
+ +
+ +
+ +

+ + query->get_users_by_status('approved') as $user_id ) { um_fetch_user( $user_id ); ?> + +
+ +
+ +
+ +
+ +
+ +
+ + '; + + } + + ?> + +
+ +
+ +
+ +
+ + + +
+ +
+ + query->get_users_by_status('awaiting_admin_review'); ?> +

+ + + +
+ +
+ +
+ +
+ +
+ +
+ + '; + + } + + ?> + +
+ +
+ Approve  |  Reject +
+ +
+ + + + +
+ + +
+ +
+ +
+ +
+ + query->get_users_by_status('awaiting_email_confirmation'); ?> +

+ + + +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ + + + +
+ + +
+ +
+ + query->get_users_by_status('inactive'); ?> +

+ + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ Re-activate  |  Delete +
+ +
+ + + + +
+ + +
+ +
+ +
\ No newline at end of file diff --git a/admin/templates/directory/profile.php b/admin/templates/directory/profile.php index b515d48d..4fe83c78 100644 --- a/admin/templates/directory/profile.php +++ b/admin/templates/directory/profile.php @@ -60,7 +60,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/admin/templates/directory/search.php b/admin/templates/directory/search.php index a9956c31..8b44ac18 100644 --- a/admin/templates/directory/search.php +++ b/admin/templates/directory/search.php @@ -46,7 +46,7 @@ - + diff --git a/admin/templates/about.php b/admin/templates/welcome/about.php similarity index 96% rename from admin/templates/about.php rename to admin/templates/welcome/about.php index 761a8eaa..92c16b8b 100644 --- a/admin/templates/about.php +++ b/admin/templates/welcome/about.php @@ -1,5 +1,5 @@ - +

Introducing Ultimate Member

@@ -71,4 +71,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/admin/templates/about_footer.php b/admin/templates/welcome/about_footer.php similarity index 100% rename from admin/templates/about_footer.php rename to admin/templates/welcome/about_footer.php diff --git a/admin/templates/about_header.php b/admin/templates/welcome/about_header.php similarity index 100% rename from admin/templates/about_header.php rename to admin/templates/welcome/about_header.php diff --git a/admin/templates/start.php b/admin/templates/welcome/start.php similarity index 96% rename from admin/templates/start.php rename to admin/templates/welcome/start.php index aa353919..97f8f35b 100644 --- a/admin/templates/start.php +++ b/admin/templates/welcome/start.php @@ -1,5 +1,5 @@ - +

Getting Started

@@ -63,4 +63,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/admin/um-admin-init.php b/admin/um-admin-init.php index 47522c73..1a1f1239 100644 --- a/admin/um-admin-init.php +++ b/admin/um-admin-init.php @@ -4,15 +4,7 @@ class UM_Admin_API { function __construct() { - $this->slug = 'ultimatemember'; - - $this->about_tabs['about'] = 'About'; - $this->about_tabs['start'] = 'Getting Started'; - add_action('admin_init', array(&$this, 'admin_init'), 0); - - add_action('admin_menu', array(&$this, 'admin_menu'), 0 ); - add_action('admin_menu', array(&$this, 'secondary_menu_items'), 1000 ); $_redux_tracker['dev_mode'] = false; $_redux_tracker['hash'] = md5( network_site_url() . '-' . $_SERVER['REMOTE_ADDR'] ); @@ -26,64 +18,8 @@ class UM_Admin_API { require_once( um_path . 'admin/core/um-admin-redux.php' ); } - } - - /*** - *** @Creates menu - ***/ - function admin_menu() { + require_once um_path . 'admin/core/um-admin-dashboard.php'; - add_menu_page( __('Ultimate Member', $this->slug), __('Ultimate Member', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page'), 'dashicons-admin-users', '66.78578'); - - add_submenu_page( $this->slug, __('Dashboard', $this->slug), __('Dashboard', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page') ); - - foreach( $this->about_tabs as $k => $tab ) { - add_submenu_page( '_'. $k . '_um', sprintf(__('%s | Ultimate Member', $this->slug), $tab), sprintf(__('%s | Ultimate Member', $this->slug), $tab), 'manage_options', $this->slug . '-' . $k, array(&$this, 'admin_page') ); - } - - } - - /*** - *** @After "settings" menu - ***/ - function secondary_menu_items() { - - add_submenu_page( $this->slug, __('Forms', $this->slug), __('Forms', $this->slug), 'manage_options', 'edit.php?post_type=um_form', '', '' ); - - add_submenu_page( $this->slug, __('User Roles', $this->slug), __('User Roles', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' ); - - if ( um_get_option('members_page' ) || !get_option('um_options') ){ - add_submenu_page( $this->slug, __('Member Directories', $this->slug), __('Member Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' ); - } - - do_action('um_extend_admin_menu'); - - } - - /*** - *** @Admin page function - ***/ - function admin_page() { - - $page = $_REQUEST['page']; - - if ( $page == 'ultimatemember' ) { - include_once um_path . 'admin/templates/dashboard.php'; - } - - if ( strstr( $page, 'ultimatemember-' ) ) { - - $template = str_replace('ultimatemember-','',$page); - $file = um_path . 'admin/templates/'. $template . '.php'; - - if ( file_exists( $file ) ){ - include_once um_path . 'admin/templates/'. $template . '.php'; - } else { - echo '

' . __('Please create a team.php template in admin templates.','ultimatemember') . '

'; - } - - } - } /*** diff --git a/core/um-actions-profile.php b/core/um-actions-profile.php index c4711dc6..8837e014 100644 --- a/core/um-actions-profile.php +++ b/core/um-actions-profile.php @@ -87,6 +87,8 @@ $ultimatemember->user->update_files( $files ); } + do_action('um_after_user_upload', um_user('ID') ); + do_action('um_user_after_updating_profile', $to_update ); if ( !isset( $args['is_signup'] ) ) { diff --git a/core/um-actions-user.php b/core/um-actions-user.php index 76cdf7a4..9daf6df4 100644 --- a/core/um-actions-user.php +++ b/core/um-actions-user.php @@ -6,15 +6,18 @@ add_action('um_after_user_upload','um_remove_unused_uploads', 10); function um_remove_unused_uploads( $user_id ) { global $ultimatemember; + um_fetch_user( $user_id ); + $array = $ultimatemember->user->profile; + $files = glob( um_user_uploads_dir() . '*', GLOB_BRACE); foreach($files as $file) { $str = basename($file); if ( !strstr( $str, 'profile_photo') && !strstr( $str, 'cover_photo') && !preg_grep('/' . $str . '/', $array ) ) unlink( $file ); } - um_reset_user(); + } /*** diff --git a/core/um-builtin.php b/core/um-builtin.php index fb4c0a63..a9b19a84 100644 --- a/core/um-builtin.php +++ b/core/um-builtin.php @@ -555,7 +555,7 @@ class UM_Builtin { 'required' => 0, 'public' => 1, 'editable' => 1, - 'options' => array('Male','Female') + 'options' => array( __('Male','ultimatemember'), __('Female','ultimatemember') ) ), 'country' => array( @@ -563,7 +563,7 @@ class UM_Builtin { 'metakey' => 'country', 'type' => 'select', 'label' => __('Country','ultimatemember'), - 'placeholder' => 'Choose a Country', + 'placeholder' => __('Choose a Country','ultimatemember'), 'required' => 0, 'public' => 1, 'editable' => 1, diff --git a/core/um-files.php b/core/um-files.php index 833f7e44..3cc907ed 100644 --- a/core/um-files.php +++ b/core/um-files.php @@ -504,9 +504,6 @@ class UM_Files { // update user's meta update_user_meta( $user_id, $key, $filename ); - // this action is executed after upload - do_action('um_after_user_upload', $user_id ); - // the url of upload return $this->upload_baseurl . $user_id . '/' . $filename; @@ -518,7 +515,7 @@ class UM_Files { function remove_dir($dir) { if ( file_exists( $dir ) ) { foreach(glob($dir . '/*') as $file) { - if(is_dir($file)) remove_dir($file); else unlink($file); + if(is_dir($file)) $this->remove_dir($file); else unlink($file); } rmdir($dir); } } diff --git a/core/um-filters-members.php b/core/um-filters-members.php index bcd4f268..531bba41 100644 --- a/core/um-filters-members.php +++ b/core/um-filters-members.php @@ -80,6 +80,11 @@ if ( !in_array( $field, $ultimatemember->members->core_search_fields ) ) { + if ( strstr($field, 'role_' ) ) { + $field = 'role'; + $operator = '='; + } + $query_args['meta_query'][] = array( 'key' => $field, 'value' => $value, diff --git a/core/um-members.php b/core/um-members.php index cdb3851c..5fbf18f1 100644 --- a/core/um-members.php +++ b/core/um-members.php @@ -61,6 +61,7 @@ class UM_Members { global $ultimatemember; $fields = $ultimatemember->builtin->all_user_fields; + $attrs = $fields[$filter]; if ( $ultimatemember->builtin->is_dropdown_field( $filter ) ) { @@ -79,9 +80,18 @@ class UM_Members { - $v ) { $v = stripslashes($v); ?> + $v ) { + + $v = stripslashes($v); + + $opt = $v; + + if ( strstr($filter, 'role_') ) + $opt = $k; + + ?> - + diff --git a/index.php b/index.php index 70b7c092..66255f26 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress -Version: 1.0.46 +Version: 1.0.47 Author: Ultimate Member Author URI: http://ultimatemember.com/ */ diff --git a/readme.txt b/readme.txt index f086789e..301aeb0d 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.1 -Stable Tag: 1.0.46 +Stable Tag: 1.0.47 License: GNU Version 2 or Any Later Version @@ -186,6 +186,15 @@ The plugin works with popular caching plugins by automatically excluding Ultimat == Changelog == += 1.0.47: February 9, 2015 = + +* New: A more native dashboard for Ultimate Member +* New: view your temp uploads directory size and purge it from dashboard +* Fixed: user uploads bug with handling photo uploads at once +* Fixed: issue with using UM role as search filter in directory +* Fixed: a little icon issue with directory backend +* Fixed: localized a few words from predefined fields + = 1.0.46: February 8, 2015 = (Update Recommended)