Improved load time

This commit is contained in:
ultimatemember
2014-12-20 18:02:41 +02:00
parent 11f11ea0e9
commit c7bacb91f5
37 changed files with 1710 additions and 186 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
-moz-osx-font-smoothing: grayscale;
}
.um-admin.post-type-um_form .manage-column.column-id {width: 40px}
.um-admin.post-type-um_form .manage-column.column-id {width: 60px}
.um-admin.post-type-um_form .manage-column.column-mode {width: 100px}
.um-admin.post-type-um_form .manage-column.column-title {width: 200px}
.um-admin.post-type-um_form .manage-column.column-shortcode {width: 200px}
@@ -32,7 +32,7 @@
.um-admin.post-type-um_directory td.column-shortcode,
.um-admin.post-type-um_directory td.column-id,
.um-admin.post-type-um_role td.column-count
{color: #aaa;font-size: 14px;}
{font-size: 14px;}
.um-admin.users-php td.column-um_actions {padding-top: 12px}
+11 -4
View File
@@ -1,5 +1,15 @@
/*
- Columns
- Welcome
*/
.um-badge {
color: #fff;
background: none !important;
background: #3ba1da url(../img/logo_small.png) no-repeat center 0px !important;
}
/*
- General
*/
body.um-admin-modal-open {
@@ -8,9 +18,6 @@ body.um-admin-modal-open {
.um-admin #major-publishing-actions{background-color: #fff !important;border-top:0}
.um-admin .postbox h3 {
background: #f9f9f9;
}
.um-admin .postbox h3 i {
font-size: 1.3em !important;
vertical-align: middle !important;
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

@@ -1299,6 +1299,9 @@
* @return void
*/
public function _options_page() {
$um_admin = new UM_Admin_API();
$this->import_export->in_field();
if ( $this->args['menu_type'] == 'submenu' ) {
@@ -1307,7 +1310,11 @@
add_menu_page( __('Ultimate Member', $this->slug), __('Ultimate Member', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page'), 'dashicons-admin-users', '50.78578');
add_submenu_page( '_welcome_to_um', __('Welcome to Ultimate Member!', $this->slug), __('Welcome to Ultimate Member!', $this->slug), 'manage_options', $this->slug . '-welcome', array(&$this, 'admin_page') );
foreach( $um_admin->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') );
}
add_submenu_page( $this->slug, __('Dashboard', $this->slug), __('Dashboard', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page') );
@@ -1321,12 +1328,12 @@
add_submenu_page( $this->slug, __('Forms', $this->slug), __('Forms', $this->slug), 'manage_options', 'edit.php?post_type=um_form', '', '' );
add_submenu_page( $this->slug, __('Roles', $this->slug), __('Roles', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' );
add_submenu_page( $this->slug, __('Member Levels', $this->slug), __('Member Levels', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' );
add_submenu_page( $this->slug, __('Member Directories', $this->slug), __('Member Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' );
add_submenu_page( $this->slug, __('Members', $this->slug), __('Members', $this->slug), 'manage_options', 'users.php', '', '' );
add_submenu_page( $this->slug, __('Directories', $this->slug), __('Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' );
} else {
$this->page = add_menu_page(
$this->args['page_title'],
@@ -4311,11 +4318,26 @@
public function admin_page(){
$um_admin = new UM_Admin_API();
$page = $_REQUEST['page'];
if ( $page == 'ultimatemember')
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 '<h4>' . __('Please create a team.php template in admin templates.','ultimatemember') . '</h4>';
}
}
}
+20 -15
View File
@@ -22,10 +22,10 @@ class UM_Admin_Columns {
$admin = new UM_Admin_Metabox();
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['id'] = __('ID');
$new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' );
$new_columns['title'] = __('Title');
$new_columns['mode'] = __('Type');
$new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Copy this shortcode to any post/page to display the relevant form' );
$new_columns['mode'] = __('Type') . $admin->_tooltip( 'This is the type of the form' );
$new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the form' );
$new_columns['impressions'] = __('Impressions') . $admin->_tooltip( 'The total number of times this form has been viewed' );
$new_columns['conversions'] = __('Conversions') . $admin->_tooltip( 'The total number of conversions. e.g. Successful sign-ups' );
$new_columns['date'] = __('Date');
@@ -34,6 +34,23 @@ class UM_Admin_Columns {
}
/***
*** @Custom columns for Directory
***/
function manage_edit_um_directory_columns($columns) {
$admin = new UM_Admin_Metabox();
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' );
$new_columns['title'] = __('Title');
$new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the member directory' );
$new_columns['date'] = __('Date');
return $new_columns;
}
/***
*** @Display cusom columns for Form
***/
@@ -76,18 +93,6 @@ class UM_Admin_Columns {
}
/***
*** @Custom columns for Directory
***/
function manage_edit_um_directory_columns($columns) {
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['id'] = __('ID');
$new_columns['title'] = __('Title');
$new_columns['shortcode'] = __('Shortcode');
$new_columns['date'] = __('Date');
return $new_columns;
}
/***
*** @Display cusom columns for Directory
***/
+18 -3
View File
@@ -12,8 +12,23 @@ class UM_Admin_Enqueue {
add_filter('admin_body_class', array(&$this, 'admin_body_class'), 9 );
add_filter( 'enter_title_here', array(&$this, 'enter_title_here') );
add_filter('enter_title_here', array(&$this, 'enter_title_here') );
add_filter('admin_footer_text', array(&$this, 'admin_footer_text') );
}
/***
*** @Show footer text
***/
function admin_footer_text() {
$copyright = sprintf(__('Thank you for creating with <a href="http://ultimatemember.com">Ultimate Member</a> and <a href="https://wordpress.org">WordPress</a>.','ultimatemember'));
if ( um_get_option('admin_load_time') == 1 ) {
$copyright .= '<br />' . sprintf(__('%1$s queries made in %2$s seconds','ultimatemember'), get_num_queries(), timer_stop(0) );
}
return '<span id="footer-thankyou">' . $copyright . '</span>';
}
/***
@@ -42,8 +57,8 @@ class UM_Admin_Enqueue {
if ( strstr($screen_id, 'um_form') ) $highlighted_id = 3;
if ( strstr($screen_id, 'um_role') ) $highlighted_id = 4;
if ( strstr($screen_id, 'um_directory') ) $highlighted_id = 6;
if ( strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) $highlighted_id = 5;
if ( strstr($screen_id, 'um_directory') ) $highlighted_id = 5;
if ( strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) $highlighted_id = 6;
if ( isset($highlighted_id) ) { ?>
-20
View File
@@ -5,9 +5,6 @@ class UM_Admin_Notices {
function __construct() {
add_action('admin_notices', array(&$this, 'admin_notices'));
add_action('admin_notices', array(&$this, 'um_admin_notices'));
}
/***
@@ -47,21 +44,4 @@ class UM_Admin_Notices {
}
/***
*** @For custom-styled notices
***/
function um_admin_notices() {
$notices = get_option('um_admin_notices');
if ( $notices ) {
foreach($notices as $notice){
echo "<div class='um-admin-notice'>
<div>$notice</div>
</div>";
}
}
}
}
+1 -1
View File
@@ -61,7 +61,7 @@
'google_api_key' => '', // Must be defined to add google fonts to the typography module
'async_typography' => true, // Use a asynchronous font on the front end or font string
'admin_bar' => true, // Show the panel pages on the admin bar
'admin_bar' => false, // Show the panel pages on the admin bar
'global_variable' => '', // Set a different name for your global variable other than the opt_name
'dev_mode' => false, // Show the time the page took to load, etc
'customizer' => false, // Enable basic customizer support
+99
View File
@@ -0,0 +1,99 @@
<div class="wrap about-wrap">
<?php include_once um_path . 'admin/templates/about_header.php'; ?>
<div class="changelog headline-feature">
<h2>Introducing Twenty&nbsp;Fifteen</h2>
<div class="featured-image">
</div>
<div class="feature-section">
<div class="col">
<h3>Our newest default theme, Twenty Fifteen, is a blog-focused theme designed for clarity.</h3>
<p>Twenty Fifteen has flawless language support, with help from <a href="https://www.google.com/get/noto/">Google&#8217;s Noto font family</a>.</p>
<p>The straightforward typography is readable on any screen size.</p>
<p>Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.</p>
</div>
<div class="col">
</div>
</div>
<div class="clear"></div>
</div>
<hr />
<div class="changelog headline-feature dfw">
<h2>Distraction-free writing</h2>
<div class="feature-section">
<div class="dfw-container">
</div>
<h3><em>Just write.</em></h3>
<p>Sometimes, you just need to concentrate on putting your thoughts into words. Try turning on <strong>distraction-free writing mode</strong>. When you start typing, all the distractions will fade away, letting you focus solely on your writing. All your editing tools instantly return when you need them.</p>
</div>
</div>
<hr />
<div class="changelog feature-list finer-points">
<h2>The Finer Points</h2>
<div class="feature-section col two-col">
<div>
<h4>Choose a language</h4>
<p>Right now, WordPress 4.1 is already translated into <span id="translations-count">40</span> languages, with more always in progress. You can switch to any translation on the <a href="http://localhost/wp-admin/options-general.php">General Settings</a> screen.</p>
</div>
<div class="last-feature">
<h4>Vine embeds</h4>
<p>Embedding videos from Vine is as simple as pasting a URL onto its own line in a post. See the <a href="http://codex.wordpress.org/Embeds">full list</a> of supported embeds.</p>
</div>
<div>
<h4>Log out everywhere</h4>
<p>If you&#8217;ve ever worried you forgot to sign out from a shared computer, you can now go to <a href="http://localhost/wp-admin/profile.php">your profile</a> and log out everywhere.</p>
</div>
<div class="last-feature">
<h4>Plugin recommendations</h4>
<p>The <a href="http://localhost/wp-admin/plugin-install.php?tab=recommended">plugin installer</a> suggests plugins for you to try. Recommendations are based on the plugins you and other users have installed.</p>
</div>
</div>
</div>
<hr />
<div class="changelog feature-list">
<h2>Under the Hood</h3>
<div class="feature-section col two-col">
<div>
<h4>Complex Queries</h4>
<p>Metadata, date, and term queries now support advanced conditional logic, like nested clauses and multiple operators &mdash; <code>A&nbsp;AND&nbsp;(&nbsp;B&nbsp;OR&nbsp;C&nbsp;)</code>.</p>
<h4>Customizer API</h4>
<p>Expanded JavaScript APIs in the customizer enable a new media experience as well as dynamic and contextual controls, sections, and panels.</p>
</div>
<div class="last-feature">
<h4><code>&lt;title&gt;</code> tags in themes</h4>
<p><code>add_theme_support( 'title-tag' )</code> tells WordPress to handle the complexities of document titles.</p>
<h4>Developer Reference</h4>
<p>Continued improvements to inline code documentation have made the <a href="https://developer.wordpress.org/reference/">developer reference</a> more complete than ever.</p>
</div>
</div>
<hr />
<div class="return-to-dashboard">
<a href="<?php echo admin_url('admin.php?page=ultimatemember'); ?>">Go to Plugin Dashboard &rarr;</a>
</div>
</div>
</div>
+24
View File
@@ -0,0 +1,24 @@
<h1>Welcome to Ultimate Member</h1>
<div class="about-text">Thank you for installing! Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress.</div>
<div class="wp-badge um-badge">Version <?php echo ULTIMATEMEMBER_VERSION; ?></div>
<h2 class="nav-tab-wrapper">
<?php foreach( $um_admin->about_tabs as $k => $tab ) {
if ( $k == $template ) {
$active = 'nav-tab-active';
} else {
$active = '';
}
?>
<a href="<?php echo admin_url('admin.php?page=ultimatemember-' . $k); ?>" class="nav-tab <?php echo $active; ?>"><?php echo $tab; ?></a>
<?php } ?>
</h2>
+99
View File
@@ -0,0 +1,99 @@
<div class="wrap about-wrap">
<?php include_once um_path . 'admin/templates/about_header.php'; ?>
<div class="changelog headline-feature">
<h2>Introducing Twenty&nbsp;Fifteen</h2>
<div class="featured-image">
</div>
<div class="feature-section">
<div class="col">
<h3>Our newest default theme, Twenty Fifteen, is a blog-focused theme designed for clarity.</h3>
<p>Twenty Fifteen has flawless language support, with help from <a href="https://www.google.com/get/noto/">Google&#8217;s Noto font family</a>.</p>
<p>The straightforward typography is readable on any screen size.</p>
<p>Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.</p>
</div>
<div class="col">
</div>
</div>
<div class="clear"></div>
</div>
<hr />
<div class="changelog headline-feature dfw">
<h2>Distraction-free writing</h2>
<div class="feature-section">
<div class="dfw-container">
</div>
<h3><em>Just write.</em></h3>
<p>Sometimes, you just need to concentrate on putting your thoughts into words. Try turning on <strong>distraction-free writing mode</strong>. When you start typing, all the distractions will fade away, letting you focus solely on your writing. All your editing tools instantly return when you need them.</p>
</div>
</div>
<hr />
<div class="changelog feature-list finer-points">
<h2>The Finer Points</h2>
<div class="feature-section col two-col">
<div>
<h4>Choose a language</h4>
<p>Right now, WordPress 4.1 is already translated into <span id="translations-count">40</span> languages, with more always in progress. You can switch to any translation on the <a href="http://localhost/wp-admin/options-general.php">General Settings</a> screen.</p>
</div>
<div class="last-feature">
<h4>Vine embeds</h4>
<p>Embedding videos from Vine is as simple as pasting a URL onto its own line in a post. See the <a href="http://codex.wordpress.org/Embeds">full list</a> of supported embeds.</p>
</div>
<div>
<h4>Log out everywhere</h4>
<p>If you&#8217;ve ever worried you forgot to sign out from a shared computer, you can now go to <a href="http://localhost/wp-admin/profile.php">your profile</a> and log out everywhere.</p>
</div>
<div class="last-feature">
<h4>Plugin recommendations</h4>
<p>The <a href="http://localhost/wp-admin/plugin-install.php?tab=recommended">plugin installer</a> suggests plugins for you to try. Recommendations are based on the plugins you and other users have installed.</p>
</div>
</div>
</div>
<hr />
<div class="changelog feature-list">
<h2>Under the Hood</h3>
<div class="feature-section col two-col">
<div>
<h4>Complex Queries</h4>
<p>Metadata, date, and term queries now support advanced conditional logic, like nested clauses and multiple operators &mdash; <code>A&nbsp;AND&nbsp;(&nbsp;B&nbsp;OR&nbsp;C&nbsp;)</code>.</p>
<h4>Customizer API</h4>
<p>Expanded JavaScript APIs in the customizer enable a new media experience as well as dynamic and contextual controls, sections, and panels.</p>
</div>
<div class="last-feature">
<h4><code>&lt;title&gt;</code> tags in themes</h4>
<p><code>add_theme_support( 'title-tag' )</code> tells WordPress to handle the complexities of document titles.</p>
<h4>Developer Reference</h4>
<p>Continued improvements to inline code documentation have made the <a href="https://developer.wordpress.org/reference/">developer reference</a> more complete than ever.</p>
</div>
</div>
<hr />
<div class="return-to-dashboard">
<a href="<?php echo admin_url('admin.php?page=ultimatemember'); ?>">Go to Plugin Dashboard &rarr;</a>
</div>
</div>
</div>
View File
+11
View File
@@ -8,6 +8,17 @@ class UM_Admin_API {
add_action('admin_init', array(&$this, 'admin_init'), 0);
if ( !class_exists( 'ReduxFramework' ) && file_exists( um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php' ) ) {
require_once( um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php' );
}
if ( file_exists ( um_path . 'admin/core/um-admin-redux.php' ) ) {
require_once( um_path . 'admin/core/um-admin-redux.php' );
}
$this->about_tabs['about'] = 'About';
$this->about_tabs['start'] = 'Getting Started';
}
/***
+4
View File
@@ -26,6 +26,10 @@
box-sizing: content-box;
}
.um a:focus {
outline: 0 !important;
}
/* only in admin mode */
.um.um-in-admin {
padding-top: 0;
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -127,7 +127,7 @@ class UM_Account {
$defaults = array(
'template' => 'account',
'mode' => 'account',
'form_id' => 'unique_account',
'form_id' => 'um_account_id',
);
$args = wp_parse_args( $args, $defaults );
+12
View File
@@ -43,6 +43,18 @@
<?php }
/***
*** @debug: load time and queries
***/
add_action('wp_footer', 'um_add_load_time_and_queries_num', 1111 );
function um_add_load_time_and_queries_num() {
if ( um_get_option('load_time') == 1 ) {
echo sprintf(__('%1$s queries made in %2$s seconds','ultimatemember'), get_num_queries(), timer_stop(0) );
}
}
/***
*** @empty the honeypot value
***/
+2 -2
View File
@@ -43,7 +43,7 @@
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
<div class="um-left um-half"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>" class="um-button" /></div>
<div class="um-right um-half"><a href="#" class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a></div>
<div class="um-right um-half"><a href="<?php echo um_get_core_page('register'); ?>" class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a></div>
<?php } else { ?>
@@ -65,7 +65,7 @@
function um_after_login_submit(){ ?>
<div class="um-col-alt-b">
<a href="#" class="um-link-alt">Forgot your password?</a>
<a href="<?php echo um_get_core_page('recover'); ?>" class="um-link-alt"><?php _e('Forgot your password?','ultimatemember'); ?></a>
</div>
<?php
+2 -2
View File
@@ -209,7 +209,7 @@
global $ultimatemember;
// DO NOT add when reviewing user's details
if ( $ultimatemember->user->preview == true && is_admin() ) return;
if ( isset( $ultimatemember->user->preview ) && $ultimatemember->user->preview == true && is_admin() ) return;
?>
@@ -218,7 +218,7 @@
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
<div class="um-left um-half"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>" class="um-button" /></div>
<div class="um-right um-half"><a href="#" class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a></div>
<div class="um-right um-half"><a href="<?php echo um_get_core_page('login'); ?>" class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a></div>
<?php } else { ?>
+4 -2
View File
@@ -7,8 +7,10 @@
function um_add_page_view($args){
global $ultimatemember;
extract($args);
if ( isset( $form_id ) )
$ultimatemember->form->add_pageview( $form_id );
if ( isset( $form_id ) ) {
if ( !isset( $impressions ) ) $impressions = 0;
$ultimatemember->form->add_pageview( $form_id, $impressions );
}
}
/***
+3
View File
@@ -65,6 +65,9 @@ class UM_Enqueue {
***/
function load_fileupload() {
wp_register_script('um_jquery_form', um_url . 'assets/js/um-jquery-form.js' );
wp_enqueue_script('um_jquery_form');
wp_register_script('um_fileupload', um_url . 'assets/js/um-fileupload.js' );
wp_enqueue_script('um_fileupload');
+1 -1
View File
@@ -278,7 +278,7 @@ class UM_Fields {
global $ultimatemember;
// preview in backend
if ( $ultimatemember->user->preview ) {
if ( isset( $ultimatemember->user->preview ) && $ultimatemember->user->preview ) {
$submitted = um_user('submitted');
if ( isset( $submitted[$key] ) && !empty( $submitted[$key] ) ) {
return $submitted[$key];
+2 -2
View File
@@ -88,9 +88,9 @@ class UM_Files {
$this->upload_dir = wp_upload_dir();
$this->upload_basedir = $this->upload_dir['basedir'] . '/ultimate-member/';
$this->upload_basedir = $this->upload_dir['basedir'] . '/ultimatemember/';
$this->upload_baseurl = $this->upload_dir['baseurl'] . '/ultimate-member/';
$this->upload_baseurl = $this->upload_dir['baseurl'] . '/ultimatemember/';
// create plugin uploads directory
if (!file_exists( $this->upload_basedir )) {
-1
View File
@@ -5,7 +5,6 @@
***/
function um_get_avatar($content, $id='', $size = '96', $avatar_class = '', $default = '', $alt = '') {
um_fetch_user( $id );
return um_user('profile_photo', $size);
}
+2 -7
View File
@@ -162,15 +162,10 @@ class UM_Form {
/***
*** @Adds a page view for form
***/
function add_pageview( $post_id ) {
function add_pageview( $form_id, $impressions ) {
global $ultimatemember;
$impressions = $ultimatemember->query->get_attr('impressions', $post_id);
$new_impressions = (int)$impressions+1;
$ultimatemember->query->update_attr('impressions', $post_id, $new_impressions);
return $new_impressions;
$ultimatemember->query->update_attr('impressions', $form_id, $new_impressions);
}
/***
-48
View File
@@ -1,48 +0,0 @@
<?php
/***
*** @Get a random string
***/
function um_random_string_( $length = 10 ) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$result = '';
for ($i = 0; $i < $length; $i++) {
$result .= $characters[rand(0, strlen($characters) - 1)];
}
return $result;
}
/***
*** @Get all UM roles in array
***/
function um_get_roles_( $add_default = false ) {
global $ultimatemember;
$roles = array();
if ($add_default) $roles[0] = $add_default;
$args = array(
'post_type' => 'um_role',
'posts_per_page' => -1,
'post_status' => array('publish'),
);
$results = new WP_Query($args);
if ($results->posts){
foreach($results->posts as $post) { setup_postdata($post);
if ( $ultimatemember->query->is_core( $post->ID ) ){
$roles[ $ultimatemember->query->is_core( $post->ID ) ] = $post->post_title;
} else {
$roles[ $post->post_name ] = $post->post_title;
}
}
} else {
$roles['member'] = 'Member';
$roles['admin'] = 'Admin';
}
return $roles;
}
+1 -1
View File
@@ -43,7 +43,7 @@ class UM_Query {
}
/***
*** @update data
*** @Using wpdb instead of update_post_meta
***/
function update_attr( $key, $post_id, $new_value ){
update_post_meta( $post_id, '_um_' . $key, $new_value );
-1
View File
@@ -46,7 +46,6 @@ class UM_Rewrite {
'top'
);
flush_rewrite_rules();
}
}
+3
View File
@@ -27,6 +27,7 @@ class UM_Setup {
'members' => array( 'title' => 'Members' ),
'logout' => array( 'title' => 'Logout' ),
'account' => array( 'title' => 'Account' ),
'recover' => array( 'title' => 'Password Reset'),
);
$this->core_directory_meta['members'] = array(
@@ -323,6 +324,8 @@ class UM_Setup {
$content = '';
} else if ( $slug == 'account' ) {
$content = '[ultimatemember_account]';
} else if ( $slug == 'recover' ) {
$content = '[ultimatemember_recover]';
} else if ( $slug == 'user' ){
$content = $this->setup_shortcode['profile'];
} else {
+14 -24
View File
@@ -1,5 +1,15 @@
<?php
/***
*** @Get core page url
***/
function um_get_core_page( $slug ) {
global $ultimatemember;
if ( $ultimatemember->permalinks->core[ $slug ] )
return get_permalink( $ultimatemember->permalinks->core[ $slug ] );
return '';
}
/***
*** @Check value of queried search in text input
***/
@@ -204,7 +214,7 @@
***/
function um_get_requested_user() {
global $ultimatemember;
if ( $ultimatemember->user->target_id )
if ( isset( $ultimatemember->user->target_id ) && !empty( $ultimatemember->user->target_id ) )
return $ultimatemember->user->target_id;
return false;
}
@@ -357,7 +367,8 @@
*** @Gets an option from DB
***/
function um_get_option($option_id) {
global $um_options;
global $ultimatemember;
$um_options = $ultimatemember->options;
if ( isset($um_options[$option_id]) && !empty( $um_options[$option_id] ) ) {
return $um_options[$option_id];
}
@@ -384,21 +395,6 @@
return $ultimatemember->permalinks->profile_url();
}
/***
*** @User has avatar
***/
function um_has_gravatar($email) {
$hash = md5($email);
$uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
$headers = @get_headers($uri);
if (!preg_match("|200|", $headers[0])) {
$has_valid_avatar = FALSE;
} else {
$has_valid_avatar = TRUE;
}
return $has_valid_avatar;
}
/***
*** @Get all UM roles in array
***/
@@ -552,11 +548,6 @@
break;
case 'profile_photo':
if ( um_has_gravatar( um_profile('user_email') ) ) {
return get_avatar( um_profile('ID'), $attrs);
} else {
$default_avatar_uri = um_get_option('default_avatar');
$default_avatar_uri = $default_avatar_uri['url'];
@@ -567,9 +558,8 @@
$default_avatar_uri = um_url . 'assets/img/Dollarphotoclub_57189843.jpg';
return '<img src="' . $default_avatar_uri . '" class="avatar avatar-'.$attrs.' um-avatar" width="'.$attrs.'" height="'.$attrs.'" alt="" />';
return '<img src="' . $default_avatar_uri . '" class="gravatar avatar avatar-'.$attrs.' um-avatar" width="'.$attrs.'" height="'.$attrs.'" alt="" />';
}
break;
case 'cover_photo':
+14 -14
View File
@@ -17,7 +17,7 @@ class UM_Taxonomies {
'labels' => array(
'name' => __( 'Forms' ),
'singular_name' => __( 'Form' ),
'add_new' => __( 'Add New Form' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __('Add New Form' ),
'edit_item' => __('Edit Form'),
'not_found' => __('You did not create any forms yet'),
@@ -33,14 +33,14 @@ class UM_Taxonomies {
register_post_type( 'um_role', array(
'labels' => array(
'name' => __( 'Roles' ),
'singular_name' => __( 'Role' ),
'add_new' => __( 'Add New Role' ),
'add_new_item' => __('Add New Role' ),
'edit_item' => __('Edit Role'),
'not_found' => __('You did not create any roles yet'),
'name' => __( 'Member Levels' ),
'singular_name' => __( 'Member Level' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __('Add New Member Level' ),
'edit_item' => __('Edit Member Level'),
'not_found' => __('You did not create any member levels yet'),
'not_found_in_trash' => __('Nothing found in Trash'),
'search_items' => __('Search Roles')
'search_items' => __('Search Member Levels')
),
'show_ui' => true,
'show_in_menu' => false,
@@ -51,14 +51,14 @@ class UM_Taxonomies {
register_post_type( 'um_directory', array(
'labels' => array(
'name' => __( 'Directories' ),
'singular_name' => __( 'Directory' ),
'add_new' => __( 'Add New Directory' ),
'add_new_item' => __('Add New Directory' ),
'edit_item' => __('Edit Directory'),
'name' => __( 'Member Directories' ),
'singular_name' => __( 'Member Directory' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __('Add New Member Directory' ),
'edit_item' => __('Edit Member Directory'),
'not_found' => __('You did not create any member directories yet'),
'not_found_in_trash' => __('Nothing found in Trash'),
'search_items' => __('Search Directories')
'search_items' => __('Search Member Directories')
),
'show_ui' => true,
'show_in_menu' => false,
+4 -4
View File
@@ -29,10 +29,10 @@ class UM_Uninstall {
}
$admin = $ultimatemember->query->find_post_id('um_role','_um_core','admin');
$member = $ultimatemember->query->find_post_id('um_role','_um_core','member');
wp_delete_post( $admin, 1 );
wp_delete_post( $member, 1 );
$roles = get_posts( array( 'post_type' => 'um_role', 'number' => 999 ) );
foreach( $roles as $role ) {
wp_delete_post( $role->ID, 1 );
}
if ( is_plugin_active( um_plugin ) ) {
deactivate_plugins( um_plugin );
+7 -5
View File
@@ -29,10 +29,12 @@ Author URI: http://ultimatemember.com/
update_option('um_version', ULTIMATEMEMBER_VERSION );
exit( wp_redirect( admin_url('admin.php?page=ultimatemember-welcome') ) );
exit( wp_redirect( admin_url('admin.php?page=ultimatemember-about') ) );
}
flush_rewrite_rules();
}
add_action( 'activated_plugin', 'ultimatemember_activation_hook' );
@@ -49,13 +51,13 @@ Author URI: http://ultimatemember.com/
***/
function ultimatemember_plugin_links( $links ) {
$more_links[] = '<a href="http://ultimatemember.com/docs/">' . __('Docs') . '</a>';
$more_links[] = '<a href="http://ultimatemember.com/support/">' . __('Support') . '</a>';
$more_links[] = '<a href="'.admin_url().'admin.php?page=um_options">' . __('Settings') . '</a>';
$more_links[] = '<a href="http://ultimatemember.com/docs/">' . __('Docs','ultimatemember') . '</a>';
$more_links[] = '<a href="http://ultimatemember.com/support/">' . __('Support','ultimatemember') . '</a>';
$more_links[] = '<a href="'.admin_url().'admin.php?page=um_options">' . __('Settings','ultimatemember') . '</a>';
$links = $more_links + $links;
$links[] = '<a href="'.admin_url().'?um_action=uninstall_ultimatemember" class="delete" title="'.__('Remove this plugin').'">' . __( 'Uninstall' ) . '</a>';
$links[] = '<a href="'.admin_url().'?um_action=uninstall_ultimatemember" class="delete" title="'.__('Remove this plugin','ultimatemember').'">' . __( 'Uninstall','ultimatemember' ) . '</a>';
return $links;
+32 -2
View File
@@ -29,7 +29,7 @@ $this->sections[] = array(
'title' => __( 'Default New User Role' ),
'desc' => __( 'Select the default role that will be assigned to user after registration If you did not specify custom role settings per form.' ),
'default' => 'member',
'options' => um_get_roles_(),
'options' => $ultimatemember->query->get_roles( ),
'placeholder' => __('Choose user role...'),
),
@@ -243,7 +243,7 @@ $this->sections[] = array(
'type' => 'text',
'title' => __( 'Panic Key' ),
'desc' => 'Panic Key is a random generated key that allow you to access the WordPress backend always regardless of backend settings.',
'default' => um_random_string_(),
'default' => $ultimatemember->validation->randomize(),
'desc' => trailingslashit( get_bloginfo('url') ).'wp-admin/?um_panic_key=<strong>YOUR_PANIC_KEY_VALUE</strong>'
),
@@ -1293,3 +1293,33 @@ $this->sections[] = array(
)
);
/***
*** @
***/
$this->sections[] = array(
'icon' => 'um-icon-tools',
'title' => __( 'Advanced'),
'fields' => array(
array(
'id' => 'admin_load_time',
'type' => 'switch',
'title' => __( 'Show load time in admin footer' ),
'default' => 0,
'desc' => __('Display the number of queries and load time in backend','ultimatemember'),
),
array(
'id' => 'load_time',
'type' => 'switch',
'title' => __( 'Show load time in frontend' ),
'default' => 0,
'desc' => __('Display the number of queries and load time in frontend','ultimatemember'),
),
)
);
+2 -8
View File
@@ -4,7 +4,6 @@ class UM_API {
function __construct() {
require_once um_path . 'core/um-global-functions.php';
require_once um_path . 'core/um-short-functions.php';
if (is_admin()){
@@ -15,13 +14,6 @@ class UM_API {
$this->honeypot = 'request';
if ( !class_exists( 'ReduxFramework' ) && file_exists( um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php' ) ) {
require_once( um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php' );
}
if ( file_exists ( um_path . 'admin/core/um-admin-redux.php' ) ) {
require_once( um_path . 'admin/core/um-admin-redux.php' );
}
}
/***
@@ -112,6 +104,8 @@ class UM_API {
$this->logout = new UM_Logout();
$this->modal = new UM_Modal();
$this->options = get_option('um_options');
}
}