Merge pull request #1252 from ultimatemember/development/2.6.9

Version 2.6.9
This commit is contained in:
Mykyta Synelnikov
2023-07-25 13:47:24 +03:00
committed by GitHub
28 changed files with 580 additions and 351 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ GNU Version 2 or Any Later Version
### IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
[Official Release Version: 2.6.8](https://github.com/ultimatemember/ultimatemember/releases/tag/2.6.8).
[Official Release Version: 2.6.9](https://github.com/ultimatemember/ultimatemember/releases/tag/2.6.9).
## Changelog
+54 -25
View File
@@ -383,6 +383,32 @@ p.um-notice.warning a {
word-wrap: break-word;
}
.um-field-area-password {
position: relative;
}
.um-toggle-password {
cursor: pointer;
display: block;
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 40px;
text-align: center;
box-sizing: border-box;
font-size: 20px;
line-height: 2;
}
.um-toggle-password i {
transition: all .2s linear;
}
.um-toggle-password:hover i {
color: #44b0ec;
}
.um-field-value p {
margin: 0 0 6px 0 !important;
padding: 0;
@@ -432,11 +458,11 @@ p.um-notice.warning a {
line-height: 1.7em;
}
.um-form input[type=text],
.um-form input[type=search],
.um-form input[type=tel],
.um-form input[type=number],
.um-form input[type=password] {
.um-form input[type="text"],
.um-form input[type="search"],
.um-form input[type="tel"],
.um-form input[type="number"],
.um-form input[type="password"] {
padding: 0 12px !important;
width: 100%;
display: block !important;
@@ -451,32 +477,35 @@ p.um-notice.warning a {
box-shadow: none !important;
margin: 0 !important;
position: static;
outline: none !important;
}
.um-form input[type=number] {
.um-form .um-field-area-password input[type="password"] {
padding-right: 40px !important;
}
.um-form input[type="number"] {
width: auto;
padding: 0 0 0 5px !important;
height: 30px !important;
}
.um-form input[type=text]:focus,
.um-form input[type=search]:focus,
.um-form input[type=tel]:focus,
.um-form input[type=number]:focus,
.um-form input[type=password]:focus,
.um-form input[type="text"]:focus,
.um-form input[type="search"]:focus,
.um-form input[type="tel"]:focus,
.um-form input[type="number"]:focus,
.um-form input[type="password"]:focus,
.um-form textarea:focus {
box-shadow: none !important;
outline: none !important;
}
.um-form input[type=text].um-iconed,
.um-form input[type=tel].um-iconed,
.um-form input[type=password].um-iconed { padding-left: 44px !important }
.um-form input[type="text"].um-iconed,
.um-form input[type="tel"].um-iconed,
.um-form input[type="password"].um-iconed { padding-left: 44px !important }
.um-form input[type=text].um-error,
.um-form input[type=tel].um-error,
.um-form input[type=password].um-error { border-color: #C74A4A !important }
.um-form input[type="text"].um-error,
.um-form input[type="tel"].um-error,
.um-form input[type="password"].um-error { border-color: #C74A4A !important }
.um-form textarea {
width: 100%;
@@ -633,15 +662,15 @@ p.um-notice.warning a {
.um div.disabled,
.um-disabled,
.um input[type=submit]:disabled,
.um input[type=text]:disabled,
.um input[type=number]:disabled {
.um input[type="submit"]:disabled,
.um input[type="text"]:disabled,
.um input[type="number"]:disabled {
opacity: 0.6 !important;
cursor: no-drop !important;
}
input[type=submit].um-button,
input[type=submit].um-button:focus {
input[type="submit"].um-button,
input[type="submit"].um-button:focus {
vertical-align: middle !important;
height: auto !important;
font-size: 15px;
@@ -656,7 +685,7 @@ input[type=submit].um-button:focus {
-webkit-appearance: none;
}
input[type=submit].um-button:hover {
input[type="submit"].um-button:hover {
opacity: 1;
}
@@ -1098,4 +1127,4 @@ small.um-max-filesize span{
.um-field-area .wp-switch-editor{
float: none;
height: auto;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

+20 -4
View File
@@ -107,10 +107,11 @@ jQuery(document).ready(function() {
//jQuery( 'textarea[id="um-meta-bio"]' ).on('change', um_update_bio_countdown ).keyup( um_update_bio_countdown ).trigger('change');
// Bio characters limit
jQuery( document.body ).on( 'change, keyup', 'textarea[id="um-meta-bio"]', function() {
jQuery( document.body ).on( 'change keyup', '#um-meta-bio', function() {
if ( typeof jQuery(this).val() !== 'undefined' ) {
var um_bio_limit = jQuery(this).attr( "data-character-limit" );
var um_bio_limit = jQuery(this).data( 'character-limit' );
var remaining = um_bio_limit - jQuery(this).val().length;
jQuery( 'span.um-meta-bio-character span.um-bio-limit' ).text( remaining );
if ( remaining < 5 ) {
jQuery('span.um-meta-bio-character').css('color','red');
@@ -119,7 +120,22 @@ jQuery(document).ready(function() {
}
}
});
jQuery( 'textarea[id="um-meta-bio"]' ).trigger('change');
jQuery( '#um-meta-bio' ).trigger('change');
// Biography (description) fields syncing.
jQuery( '.um-profile form' ).each( function () {
let descKey = jQuery(this).data('description_key');
if ( jQuery(this).find( 'textarea[name="' + descKey + '"]' ).length ) {
jQuery( document.body ).on( 'change input', 'textarea[name="' + descKey + '"]', function ( e ) {
jQuery(this).parents( 'form' ).find( 'textarea[name="' + descKey + '"]' ).each( function() {
jQuery(this).val( e.currentTarget.value );
if ( jQuery('#um-meta-bio')[0] !== e.currentTarget && jQuery('#um-meta-bio')[0] === jQuery(this)[0] ) {
jQuery(this).trigger('change');
}
});
});
}
});
jQuery( '.um-profile-edit a.um_delete-item' ).on( 'click', function(e) {
@@ -138,4 +154,4 @@ jQuery(document).ready(function() {
jQuery( e.currentTarget).trigger( "click" );
});
});
});
+1 -1
View File
@@ -1 +1 @@
jQuery(document).ready(function(){jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&&(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&&0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&&(jQuery(".um-profile.um-viewing .um-profile-body").find(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document.body).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").trigger("submit"),!1}),jQuery(document.body).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document.body).on("click",".um-cover a.um-cover-add, .um-photo a",function(e){e.preventDefault()}),jQuery(document.body).on("click",".um-photo-modal",function(e){e.preventDefault();e=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,e),!1}),jQuery(document.body).on("click",".um-reset-profile-photo",function(e){return jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",UM.dropdown.hideAll(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_profile_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce}}),jQuery(this).parents("li").hide(),!1}),jQuery(document.body).on("click",".um-reset-cover-photo",function(e){var r=jQuery(this);return jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html('<a href="javascript:void(0);" class="um-cover-add" style="height: 370px;"><span class="um-cover-add-i"><i class="um-icon-plus um-tip-n" original-title="Upload a cover photo"></i></span></a>'),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_cover_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce},success:function(e){r.hide()}}),UM.dropdown.hideAll(),!1}),jQuery(document.body).on("change, keyup",'textarea[id="um-meta-bio"]',function(){var e;void 0!==jQuery(this).val()&&(e=jQuery(this).attr("data-character-limit")-jQuery(this).val().length,jQuery("span.um-meta-bio-character span.um-bio-limit").text(e),e<5?jQuery("span.um-meta-bio-character").css("color","red"):jQuery("span.um-meta-bio-character").css("color",""))}),jQuery('textarea[id="um-meta-bio"]').trigger("change"),jQuery(".um-profile-edit a.um_delete-item").on("click",function(e){if(e.preventDefault(),!confirm(wp.i18n.__("Are you sure that you want to delete this user?","ultimate-member")))return!1}),jQuery(".um-profile-nav a").on("touchend",function(e){jQuery(e.currentTarget).trigger("click")})});
jQuery(document).ready(function(){jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&&(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&&0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&&(jQuery(".um-profile.um-viewing .um-profile-body").find(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document.body).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").trigger("submit"),!1}),jQuery(document.body).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document.body).on("click",".um-cover a.um-cover-add, .um-photo a",function(e){e.preventDefault()}),jQuery(document.body).on("click",".um-photo-modal",function(e){e.preventDefault();e=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,e),!1}),jQuery(document.body).on("click",".um-reset-profile-photo",function(e){return jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",UM.dropdown.hideAll(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_profile_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce}}),jQuery(this).parents("li").hide(),!1}),jQuery(document.body).on("click",".um-reset-cover-photo",function(e){var r=jQuery(this);return jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html('<a href="javascript:void(0);" class="um-cover-add" style="height: 370px;"><span class="um-cover-add-i"><i class="um-icon-plus um-tip-n" original-title="Upload a cover photo"></i></span></a>'),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_cover_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce},success:function(e){r.hide()}}),UM.dropdown.hideAll(),!1}),jQuery(document.body).on("change keyup","#um-meta-bio",function(){var e;void 0!==jQuery(this).val()&&(e=jQuery(this).data("character-limit")-jQuery(this).val().length,jQuery("span.um-meta-bio-character span.um-bio-limit").text(e),e<5?jQuery("span.um-meta-bio-character").css("color","red"):jQuery("span.um-meta-bio-character").css("color",""))}),jQuery("#um-meta-bio").trigger("change"),jQuery(".um-profile form").each(function(){let r=jQuery(this).data("description_key");jQuery(this).find('textarea[name="'+r+'"]').length&&jQuery(document.body).on("change input",'textarea[name="'+r+'"]',function(e){jQuery(this).parents("form").find('textarea[name="'+r+'"]').each(function(){jQuery(this).val(e.currentTarget.value),jQuery("#um-meta-bio")[0]!==e.currentTarget&&jQuery("#um-meta-bio")[0]===jQuery(this)[0]&&jQuery(this).trigger("change")})})}),jQuery(".um-profile-edit a.um_delete-item").on("click",function(e){if(e.preventDefault(),!confirm(wp.i18n.__("Are you sure that you want to delete this user?","ultimate-member")))return!1}),jQuery(".um-profile-nav a").on("touchend",function(e){jQuery(e.currentTarget).trigger("click")})});
+12
View File
@@ -713,4 +713,16 @@ jQuery(document).ready(function() {
}
}
jQuery( document.body ).on('click', '.um-toggle-password', function (){
let parent = jQuery(this).closest('.um-field-area-password');
let passwordField = parent.find('input');
let type = passwordField.attr('type');
if ( 'text' === type ) {
passwordField.attr('type', 'password');
parent.find('i').toggleClass('um-icon-eye um-icon-eye-disabled');
} else {
passwordField.attr('type', 'text');
parent.find('i').toggleClass('um-icon-eye um-icon-eye-disabled');
}
});
});
+1 -1
View File
File diff suppressed because one or more lines are too long
+90 -117
View File
@@ -61,21 +61,18 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
public function __construct() {
parent::__construct();
$this->templates_path = um_path . 'includes/admin/templates/';
$this->templates_path = UM_PATH . 'includes/admin/templates/';
add_action( 'admin_init', array( &$this, 'admin_init' ), 0 );
$prefix = is_network_admin() ? 'network_admin_' : '';
add_filter( "{$prefix}plugin_action_links_" . um_plugin, array( &$this, 'plugin_links' ) );
add_filter( "{$prefix}plugin_action_links_" . UM_PLUGIN, array( &$this, 'plugin_links' ) );
add_action( 'um_admin_do_action__user_cache', array( &$this, 'user_cache' ) );
add_action( 'um_admin_do_action__user_status_cache', array( &$this, 'user_status_cache' ) );
add_action( 'um_admin_do_action__purge_temp', array( &$this, 'purge_temp' ) );
add_action( 'um_admin_do_action__manual_upgrades_request', array( &$this, 'manual_upgrades_request' ) );
add_action( 'um_admin_do_action__duplicate_form', array( &$this, 'duplicate_form' ) );
add_action( 'um_admin_do_action__um_hide_locale_notice', array( &$this, 'um_hide_notice' ) );
add_action( 'um_admin_do_action__um_can_register_notice', array( &$this, 'um_hide_notice' ) );
add_action( 'um_admin_do_action__um_hide_exif_notice', array( &$this, 'um_hide_notice' ) );
add_action( 'um_admin_do_action__user_action', array( &$this, 'user_action' ) );
add_action( 'um_admin_do_action__check_templates_version', array( &$this, 'check_templates_version' ) );
@@ -764,16 +761,16 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
'sanitize' => 'bool',
),
'_max_selections' => array(
'sanitize' => 'empty_int',
'sanitize' => 'empty_absint',
),
'_min_selections' => array(
'sanitize' => 'empty_int',
'sanitize' => 'empty_absint',
),
'_max_entries' => array(
'sanitize' => 'absint',
'sanitize' => 'empty_absint',
),
'_max_words' => array(
'sanitize' => 'absint',
'sanitize' => 'empty_absint',
),
'_min' => array(
'sanitize' => 'empty_int',
@@ -782,10 +779,10 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
'sanitize' => 'empty_int',
),
'_min_chars' => array(
'sanitize' => 'absint',
'sanitize' => 'empty_absint',
),
'_max_chars' => array(
'sanitize' => 'absint',
'sanitize' => 'empty_absint',
),
'_html' => array(
'sanitize' => 'bool',
@@ -1606,22 +1603,17 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
return $classes;
}
/**
*
*/
public function manual_upgrades_request() {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
die();
}
$last_request = get_option( 'um_last_manual_upgrades_request', false );
if ( empty( $last_request ) || time() > $last_request + DAY_IN_SECONDS ) {
if ( is_multisite() ) {
$blogs_ids = get_sites();
foreach( $blogs_ids as $b ) {
foreach ( $blogs_ids as $b ) {
switch_to_blog( $b->blog_id );
wp_clean_update_cache();
@@ -1638,22 +1630,30 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
update_option( 'um_last_manual_upgrades_request', time() );
}
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'um_got_updates' ), admin_url( 'admin.php' ) );
$url = add_query_arg(
array(
'page' => 'ultimatemember',
'update' => 'um_got_updates',
),
admin_url( 'admin.php' )
);
} else {
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'um_often_updates' ), admin_url( 'admin.php' ) );
$url = add_query_arg(
array(
'page' => 'ultimatemember',
'update' => 'um_often_updates',
),
admin_url( 'admin.php' )
);
}
exit( wp_redirect( $url ) );
wp_safe_redirect( $url );
exit;
}
/**
* Core pages installation
* Core pages installation.
*/
function install_core_pages() {
if ( ! is_admin() ) {
die();
}
public function install_core_pages() {
UM()->setup()->install_default_pages();
//check empty pages in settings
@@ -1664,7 +1664,7 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
foreach ( $pages as $slug => $page_id ) {
$page = get_post( $page_id );
if ( ! isset( $page->ID ) && in_array( $slug, array_keys( UM()->config()->core_pages ) ) ) {
if ( ! isset( $page->ID ) && array_key_exists( $slug, UM()->config()->core_pages ) ) {
$empty_pages[] = $slug;
}
}
@@ -1672,27 +1672,22 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
//if there aren't empty pages - then hide pages notice
if ( empty( $empty_pages ) ) {
$hidden_notices = get_option( 'um_hidden_admin_notices', array() );
$hidden_notices = get_option( 'um_hidden_admin_notices', array() );
$hidden_notices[] = 'wrong_pages';
update_option( 'um_hidden_admin_notices', $hidden_notices );
}
$url = add_query_arg( array( 'page' => 'um_options' ), admin_url( 'admin.php' ) );
exit( wp_redirect( $url ) );
wp_safe_redirect( $url );
exit;
}
/**
* Clear all users cache
*
* @param $action
* Clear all users cache.
*/
function user_cache( $action ) {
public function user_cache() {
global $wpdb;
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
die();
}
$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'um_cache_userdata_%'" );
@@ -1703,21 +1698,14 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
),
admin_url( 'admin.php' )
);
wp_redirect( $url );
wp_safe_redirect( $url );
exit;
}
/**
* Clear all users statuses count cache
*
* @param $action
* Clear all users statuses count cache.
*/
function user_status_cache( $action ) {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
die();
}
public function user_status_cache() {
$statuses = array(
'approved',
'awaiting_admin_review',
@@ -1741,43 +1729,37 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
),
admin_url( 'admin.php' )
);
wp_redirect( $url );
wp_safe_redirect( $url );
exit;
}
/**
* Purge temp uploads dir
* @param $action
* Purge temp uploads dir.
*/
function purge_temp( $action ) {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
die();
}
public function purge_temp() {
UM()->files()->remove_dir( UM()->files()->upload_temp );
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'um_purged_temp' ), admin_url( 'admin.php' ) );
exit( wp_redirect( $url ) );
$url = add_query_arg(
array(
'page' => 'ultimatemember',
'update' => 'um_purged_temp',
),
admin_url( 'admin.php' )
);
wp_safe_redirect( $url );
exit;
}
/**
* Duplicate form
*
* @param $action
*/
public function duplicate_form( $action ) {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
die();
}
if ( empty( $_REQUEST['post_id'] ) || empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], "um-duplicate_form{$_REQUEST['post_id']}" ) ) {
die();
public function duplicate_form() {
if ( empty( $_REQUEST['post_id'] ) || empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], "um-duplicate_form{$_REQUEST['post_id']}" ) ) {
die( esc_html__( 'Security check', 'ultimate-member' ) );
}
if ( ! is_numeric( $_REQUEST['post_id'] ) ) {
die();
die( esc_html__( 'Wrong ID', 'ultimate-member' ) );
}
$post_id = absint( $_REQUEST['post_id'] );
@@ -1817,26 +1799,10 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
}
/**
* Action to hide notices in admin
*
* @param $action
* Various user actions.
*/
function um_hide_notice( $action ) {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
die();
}
update_option( $action, 1 );
exit( wp_redirect( remove_query_arg( 'um_adm_action' ) ) );
}
/**
* Various user actions
*
* @param $action
*/
function user_action( $action ) {
if ( ! is_admin() || ! current_user_can( 'edit_users' ) ) {
public function user_action() {
if ( ! current_user_can( 'edit_users' ) ) {
die();
}
if ( ! isset( $_REQUEST['sub'] ) ) {
@@ -1891,17 +1857,14 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
um_reset_user();
wp_redirect( add_query_arg( 'update', 'um_user_updated', admin_url( '?page=ultimatemember' ) ) );
wp_safe_redirect( add_query_arg( 'update', 'um_user_updated', admin_url( '?page=ultimatemember' ) ) );
exit;
}
/**
* Manual check templates versions
*
* @param $action
* Manual check templates versions.
*/
public function check_templates_version( $action ) {
public function check_templates_version() {
$templates = UM()->admin_settings()->get_override_templates( true );
$out_date = false;
@@ -1928,30 +1891,42 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
}
/**
* Add any custom links to plugin page
* Add any custom links to plugin page.
*
* @param array $links
*
* @return array
*/
function plugin_links( $links ) {
$more_links[] = '<a href="http://docs.ultimatemember.com/">' . __( 'Docs', 'ultimate-member' ) . '</a>';
$more_links[] = '<a href="'.admin_url().'admin.php?page=um_options">' . __( 'Settings', 'ultimate-member' ) . '</a>';
public function plugin_links( $links ) {
$more_links[] = '<a href="http://docs.ultimatemember.com/">' . esc_html__( 'Docs', 'ultimate-member' ) . '</a>';
$more_links[] = '<a href="' . admin_url() . 'admin.php?page=um_options">' . esc_html__( 'Settings', 'ultimate-member' ) . '</a>';
$links = $more_links + $links;
return $links;
}
/**
* Init admin action/filters + request handlers
*/
function admin_init() {
public function admin_init() {
$this->init_variables();
if ( is_admin() && current_user_can( 'manage_options' ) && ! empty( $_REQUEST['um_adm_action'] ) ) {
if ( ! empty( $_REQUEST['um_adm_action'] ) && is_admin() && current_user_can( 'manage_options' ) ) {
$action = sanitize_key( $_REQUEST['um_adm_action'] );
$individual_nonce_actions = array(
'user_action',
'duplicate_form',
);
$individual_nonce_actions = apply_filters( 'um_adm_action_individual_nonce_actions', $individual_nonce_actions );
// Some actions have their own nonce. Verify individually.
if ( ! in_array( $action, $individual_nonce_actions, true ) ) {
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], $action ) ) {
wp_die( esc_attr__( 'Security Check', 'ultimate-member' ) );
}
}
/**
* UM hook
*
@@ -1995,7 +1970,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
}
}
/**
* Updated post messages
*
@@ -2003,31 +1977,30 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
*
* @return array
*/
function post_updated_messages( $messages ) {
public function post_updated_messages( $messages ) {
global $post_ID;
$post_type = get_post_type( $post_ID );
if ( $post_type == 'um_form' ) {
if ( 'um_form' === $post_type ) {
$messages['um_form'] = array(
0 => '',
1 => __( 'Form updated.', 'ultimate-member' ),
2 => __( 'Custom field updated.', 'ultimate-member' ),
3 => __( 'Custom field deleted.', 'ultimate-member' ),
4 => __( 'Form updated.', 'ultimate-member' ),
5 => isset( $_GET['revision'] ) ? __( 'Form restored to revision.', 'ultimate-member' ) : false,
6 => __( 'Form created.', 'ultimate-member' ),
7 => __( 'Form saved.', 'ultimate-member' ),
8 => __( 'Form submitted.', 'ultimate-member' ),
9 => __( 'Form scheduled.', 'ultimate-member' ),
10 => __( 'Form draft updated.', 'ultimate-member' ),
0 => '',
1 => __( 'Form updated.', 'ultimate-member' ),
2 => __( 'Custom field updated.', 'ultimate-member' ),
3 => __( 'Custom field deleted.', 'ultimate-member' ),
4 => __( 'Form updated.', 'ultimate-member' ),
5 => isset( $_GET['revision'] ) ? __( 'Form restored to revision.', 'ultimate-member' ) : false,
6 => __( 'Form created.', 'ultimate-member' ),
7 => __( 'Form saved.', 'ultimate-member' ),
8 => __( 'Form submitted.', 'ultimate-member' ),
9 => __( 'Form scheduled.', 'ultimate-member' ),
10 => __( 'Form draft updated.', 'ultimate-member' ),
);
}
return $messages;
}
/**
* Gettext filters
*
+1 -1
View File
@@ -117,7 +117,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Columns' ) ) {
'post_type' => 'um_form',
'um_adm_action' => 'duplicate_form',
'post_id' => $id,
'nonce' => wp_create_nonce( "um-duplicate_form{$id}" ),
'_wpnonce' => wp_create_nonce( "um-duplicate_form{$id}" ),
),
admin_url( 'edit.php' )
);
+12 -18
View File
@@ -1062,24 +1062,23 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
do_action( 'um_admin_custom_login_metaboxes' );
}
/**
* Save directory metabox
*
* @param $post_id
* @param $post
*/
function save_metabox_directory( $post_id, $post ) {
public function save_metabox_directory( $post_id, $post ) {
global $wpdb;
// validate nonce
if ( ! isset( $_POST['um_admin_save_metabox_directory_nonce'] ) ||
! wp_verify_nonce( $_POST['um_admin_save_metabox_directory_nonce'], basename( __FILE__ ) ) ) {
! wp_verify_nonce( $_POST['um_admin_save_metabox_directory_nonce'], basename( __FILE__ ) ) ) {
return;
}
// validate post type
if ( $post->post_type != 'um_directory' ) {
if ( 'um_directory' !== $post->post_type ) {
return;
}
@@ -1089,15 +1088,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
return;
}
$where = array( 'ID' => $post_id );
if ( empty( $_POST['post_title'] ) ) {
$where = array( 'ID' => $post_id );
// translators: %s: Directory id.
$_POST['post_title'] = sprintf( __( 'Directory #%s', 'ultimate-member' ), $post_id );
$wpdb->update( $wpdb->posts, array( 'post_title' => sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) ), $where );
}
$wpdb->update( $wpdb->posts, array( 'post_title' => sanitize_text_field( $_POST['post_title'] ) ), $where );
do_action( 'um_before_member_directory_save', $post_id );
// save
@@ -1119,17 +1116,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$metadata = UM()->admin()->sanitize_member_directory_meta( $_POST['um_metadata'] );
foreach ( $metadata as $k => $v ) {
if ( $k == '_um_show_these_users' && trim( $v ) ) {
if ( '_um_show_these_users' === $k && trim( $v ) ) {
$v = preg_split( '/[\r\n]+/', $v, -1, PREG_SPLIT_NO_EMPTY );
}
if ( $k == '_um_exclude_these_users' && trim( $v ) ) {
if ( '_um_exclude_these_users' === $k && trim( $v ) ) {
$v = preg_split( '/[\r\n]+/', $v, -1, PREG_SPLIT_NO_EMPTY );
}
if ( strstr( $k, '_um_' ) ) {
if ( $k === '_um_is_default' ) {
if ( '_um_is_default' === $k ) {
$mode = UM()->query()->get_attr( 'mode', $post_id );
@@ -1145,9 +1142,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
foreach ( $posts as $p_id ) {
delete_post_meta( $p_id, '_um_is_default' );
}
}
}
$v = apply_filters( 'um_member_directory_meta_value_before_save', $v, $k, $post_id );
@@ -1160,14 +1155,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
update_post_meta( $post_id, '_um_search_filters_gmt', (int) $_POST['um-gmt-offset'] );
}
/**
* Save form metabox
*
* @param $post_id
* @param $post
*/
function save_metabox_form( $post_id, $post ) {
public function save_metabox_form( $post_id, $post ) {
global $wpdb;
// validate nonce
@@ -1177,7 +1171,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
}
// validate post type
if ( $post->post_type != 'um_form' ) {
if ( 'um_form' !== $post->post_type ) {
return;
}
@@ -1187,12 +1181,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
return;
}
$where = array( 'ID' => $post_id );
if ( empty( $_POST['post_title'] ) ) {
$where = array( 'ID' => $post_id );
// translators: %s: Form id.
$_POST['post_title'] = sprintf( __( 'Form #%s', 'ultimate-member' ), $post_id );
$wpdb->update( $wpdb->posts, array( 'post_title' => sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) ), $where );
}
$wpdb->update( $wpdb->posts, array( 'post_title' => sanitize_text_field( $_POST['post_title'] ) ), $where );
// save
delete_post_meta( $post_id, '_um_profile_metafields' );
+54 -39
View File
@@ -7,7 +7,6 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
/**
* Class Admin_Notices
* @package um\admin\core
@@ -19,16 +18,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
*
* @var array
*/
var $list = array();
private $list = array();
/**
* Admin_Notices constructor.
*/
function __construct() {
public function __construct() {
add_action( 'admin_init', array( &$this, 'create_languages_folder' ) );
add_action( 'admin_init', array( &$this, 'create_list' ), 10 );
add_action( 'admin_init', array( &$this, 'create_list' ) );
add_action( 'admin_notices', array( &$this, 'render_notices' ), 1 );
add_action( 'wp_ajax_um_dismiss_notice', array( &$this, 'dismiss_notice' ) );
@@ -37,11 +35,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
add_action( 'current_screen', array( &$this, 'create_list_for_screen' ) );
}
/**
*
*/
function create_list() {
public function create_list() {
$this->old_extensions_notice();
$this->install_core_page_notice();
$this->exif_extension_notice();
@@ -93,7 +90,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
/**
* @return array
*/
function get_admin_notices() {
public function get_admin_notices() {
return $this->list;
}
@@ -372,7 +369,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
);
}
/**
* Regarding page setup
*/
@@ -384,9 +380,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
foreach ( $pages as $slug => $page_id ) {
$page = get_post( $page_id );
if ( ! isset( $page->ID ) && in_array( $slug, array_keys( UM()->config()->core_pages ) ) ) {
if ( ! isset( $page->ID ) && array_key_exists( $slug, UM()->config()->core_pages ) ) {
$url = add_query_arg(
array(
'um_adm_action' => 'install_core_pages',
'_wpnonce' => wp_create_nonce( 'install_core_pages' ),
)
);
ob_start(); ?>
ob_start();
?>
<p>
<?php
@@ -396,18 +399,23 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
</p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'install_core_pages' ) ); ?>" class="button button-primary"><?php _e( 'Create Pages', 'ultimate-member' ) ?></a>
<a href="<?php echo esc_url( $url ); ?>" class="button button-primary"><?php esc_html_e( 'Create Pages', 'ultimate-member' ); ?></a>
&nbsp;
<a href="javascript:void(0);" class="button-secondary um_secondary_dimiss"><?php _e( 'No thanks', 'ultimate-member' ) ?></a>
<a href="javascript:void(0);" class="button-secondary um_secondary_dimiss"><?php esc_html_e( 'No thanks', 'ultimate-member' ); ?></a>
</p>
<?php $message = ob_get_clean();
<?php
$message = ob_get_clean();
$this->add_notice( 'wrong_pages', array(
'class' => 'updated',
'message' => $message,
'dismissible' => true
), 20 );
$this->add_notice(
'wrong_pages',
array(
'class' => 'updated',
'message' => $message,
'dismissible' => true,
),
20
);
break;
}
@@ -416,42 +424,46 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
if ( isset( $pages['user'] ) ) {
$test = get_post( $pages['user'] );
if ( isset( $test->post_parent ) && $test->post_parent > 0 ) {
$this->add_notice( 'wrong_user_page', array(
'class' => 'updated',
'message' => '<p>' . __( 'Ultimate Member Setup Error: User page can not be a child page.', 'ultimate-member' ) . '</p>',
), 25 );
$this->add_notice(
'wrong_user_page',
array(
'class' => 'updated',
'message' => '<p>' . esc_html__( 'Ultimate Member Setup Error: User page can not be a child page.', 'ultimate-member' ) . '</p>',
),
25
);
}
}
if ( isset( $pages['account'] ) ) {
$test = get_post( $pages['account'] );
if ( isset( $test->post_parent ) && $test->post_parent > 0 ) {
$this->add_notice( 'wrong_account_page', array(
'class' => 'updated',
'message' => '<p>' . __( 'Ultimate Member Setup Error: Account page can not be a child page.', 'ultimate-member' ) . '</p>',
), 30 );
$this->add_notice(
'wrong_account_page',
array(
'class' => 'updated',
'message' => '<p>' . esc_html__( 'Ultimate Member Setup Error: Account page can not be a child page.', 'ultimate-member' ) . '</p>',
),
30
);
}
}
}
}
/**
* EXIF library notice
*/
public function exif_extension_notice() {
$hide_exif_notice = get_option( 'um_hide_exif_notice' );
if ( ! extension_loaded( 'exif' ) && ! $hide_exif_notice ) {
if ( ! extension_loaded( 'exif' ) ) {
$this->add_notice(
'exif_disabled',
array(
'class' => 'updated',
'class' => 'updated',
// translators: %s: query args.
'message' => '<p>' . sprintf( __( 'Exif is not enabled on your server. Mobile photo uploads will not be rotated correctly until you enable the exif extension. <a href="%s">Hide this notice</a>', 'ultimate-member' ), add_query_arg( 'um_adm_action', 'um_hide_exif_notice' ) ) . '</p>',
),
10
'message' => '<p>' . esc_html__( 'Exif is not enabled on your server. Mobile photo uploads will not be rotated correctly until you enable the exif extension.', 'ultimate-member' ) . '</p>',
'dismissible' => true,
)
);
}
}
@@ -885,7 +897,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
}
$global_role = get_option( 'default_role' ); // WP Global settings
$caps = get_role( $global_role )->capabilities;
$global_role = get_role( $global_role );
$caps = ( null !== $global_role && ! empty( $global_role->capabilities ) ) ? $global_role->capabilities : array();
foreach ( array_keys( $caps ) as $cap ) {
if ( in_array( $cap, $arr_banned_caps, true ) ) {
ob_start();
@@ -910,7 +923,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
$um_global_role = UM()->options()->get( 'register_role' ); // UM Settings Global settings
if ( ! empty( $um_global_role ) ) {
$caps = get_role( $um_global_role )->capabilities;
$um_global_role = get_role( $um_global_role );
$caps = ( null !== $um_global_role && ! empty( $um_global_role->capabilities ) ) ? $um_global_role->capabilities : array();
foreach ( array_keys( $caps ) as $cap ) {
if ( in_array( $cap, $arr_banned_caps, true ) ) {
ob_start();
@@ -966,7 +980,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
continue;
}
$caps = get_role( $role )->capabilities;
$role = get_role( $role );
$caps = ( null !== $role && ! empty( $role->capabilities ) ) ? $role->capabilities : array();
foreach ( array_keys( $caps ) as $cap ) {
if ( in_array( $cap, $arr_banned_caps, true ) ) {
$content .= '<br /><a target="_blank" href="' . get_edit_post_link( $form_id ) . '">' . get_the_title( $form_id ) . '</a> contains <strong>administrative role</strong>.';
+17 -1
View File
@@ -689,6 +689,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'use_um_gravatar_default_image' => array(
'sanitize' => 'bool',
),
'toggle_password' => array(
'sanitize' => 'bool',
),
'require_strongpass' => array(
'sanitize' => 'bool',
),
@@ -1088,6 +1091,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'tooltip' => __( '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)', 'ultimate-member' ),
'conditional' => array( 'use_um_gravatar_default_builtin_image', '=', 'default' ),
),
array(
'id' => 'toggle_password',
'type' => 'checkbox',
'label' => __( 'Show/hide password button', 'ultimate-member' ),
'tooltip' => __( 'Enable visibility for show/hide password button for the password field-type.', 'ultimate-member' ),
),
array(
'id' => 'require_strongpass',
'type' => 'checkbox',
@@ -3072,10 +3081,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
*/
public function settings_override_templates_tab() {
$um_check_version = get_transient( 'um_check_template_versions' );
$check_url = add_query_arg(
array(
'um_adm_action' => 'check_templates_version',
'_wpnonce' => wp_create_nonce( 'check_templates_version' ),
)
);
?>
<p class="description" style="margin: 20px 0 0 0;">
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'check_templates_version' ) ); ?>" class="button" style="margin-right: 10px;">
<a href="<?php echo esc_url( $check_url ); ?>" class="button" style="margin-right: 10px;">
<?php esc_html_e( 'Re-check templates', 'ultimate-member' ); ?>
</a>
<?php
+19 -4
View File
@@ -1,4 +1,5 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -9,18 +10,32 @@ $count = $wpdb->get_var(
FROM {$wpdb->options}
WHERE option_name LIKE 'um_cache_userdata_%'"
);
$url_user_cache = add_query_arg(
array(
'um_adm_action' => 'user_cache',
'_wpnonce' => wp_create_nonce( 'user_cache' ),
)
);
$url_user_status_cache = add_query_arg(
array(
'um_adm_action' => 'user_status_cache',
'_wpnonce' => wp_create_nonce( 'user_status_cache' ),
)
);
?>
<p><?php _e( 'Run this task from time to time to keep your DB clean.', 'ultimate-member' ) ?></p>
<p><?php esc_html_e( 'Run this task from time to time to keep your DB clean.', 'ultimate-member' ); ?></p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'user_cache' ) ); ?>" class="button">
<a href="<?php echo esc_url( $url_user_cache ); ?>" class="button">
<?php
// translators: %s: users number.
echo esc_html( sprintf( __( 'Clear cache of %s users', 'ultimate-member' ), $count ) );
?>
</a>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'user_status_cache' ) ); ?>" class="button">
<a href="<?php echo esc_url( $url_user_status_cache ); ?>" class="button">
<?php esc_html_e( 'Clear user statuses cache', 'ultimate-member' ); ?>
</a>
</p>
+11 -3
View File
@@ -1,7 +1,15 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$url = add_query_arg(
array(
'um_adm_action' => 'purge_temp',
'_wpnonce' => wp_create_nonce( 'purge_temp' ),
)
);
if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>
<p>
@@ -12,8 +20,8 @@ if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>
</p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'purge_temp' ) ); ?>" class="button">
<?php _e( 'Purge Temp', 'ultimate-member' ); ?>
<a href="<?php echo esc_url( $url ); ?>" class="button">
<?php esc_html_e( 'Purge Temp', 'ultimate-member' ); ?>
</a>
</p>
@@ -1,9 +1,19 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$url = add_query_arg(
array(
'um_adm_action' => 'manual_upgrades_request',
'_wpnonce' => wp_create_nonce( 'manual_upgrades_request' ),
)
);
?>
<p><?php _e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ) ?></p>
<p><?php esc_html_e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ); ?></p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'manual_upgrades_request' ) ); ?>" class="button">
<?php _e( 'Get latest versions', 'ultimate-member' ) ?>
<a href="<?php echo esc_url( $url ); ?>" class="button">
<?php esc_html_e( 'Get latest versions', 'ultimate-member' ); ?>
</a>
</p>
</p>
+7
View File
@@ -163,6 +163,13 @@ $premium['profile-tabs'] = array(
'desc' => 'Add custom tabs to profiles',
);
$premium['stripe'] = array(
'url' => 'https://ultimatemember.com/extensions/stripe/',
'img' => 'stripe.png',
'name' => 'Stripe',
'desc' => 'Sell paid memberships to access your website via Stripe subscriptions',
);
$free['jobboardwp'] = array(
'url' => 'https://wordpress.org/plugins/um-jobboardwp',
'img' => 'jobboardwp.png',
+1
View File
@@ -520,6 +520,7 @@ if ( ! class_exists( 'um\Config' ) ) {
'use_gravatars' => 0,
'use_um_gravatar_default_builtin_image' => 'default',
'use_um_gravatar_default_image' => 0,
'toggle_password' => false,
'require_strongpass' => 0,
'password_min_chars' => 8,
'password_max_chars' => 30,
+23 -4
View File
@@ -180,8 +180,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
*
* @since 1.3.x
* @hook um_account_shortcode_args_filter
* @deprecated 2.6.8
* @todo Fully deprecate since 2.6.9. Use `shortcode_atts_ultimatemember_account` instead.
* @deprecated 2.6.9
*
* @param {array} $args Shortcode arguments.
*
@@ -194,13 +193,33 @@ if ( ! class_exists( 'um\core\Account' ) ) {
* }
* add_filter( 'um_account_shortcode_args_filter', 'my_account_shortcode_args' );
*/
$args = apply_filters( 'um_account_shortcode_args_filter', $args );
$args = apply_filters_deprecated( 'um_account_shortcode_args_filter', array( $args ), '2.6.9', 'shortcode_atts_ultimatemember_account' );
$account_hash = md5( wp_json_encode( $args ) );
if ( in_array( $account_hash, $this->account_exist, true ) ) {
/**
* Filters variable for enable singleton shortcode loading on the same page.
* Note: Set it to `false` if you don't need to render the same form twice or more on the same page.
*
* @since 2.6.9
*
* @hook um_ultimatemember_account_shortcode_disable_singleton
*
* @param {bool} $disable Disabled singleton. By default, it's `true`.
* @param {array} $args Shortcode arguments.
*
* @return {bool} Disabled singleton or not.
*
* @example <caption>Turn off ability to use ultimatemember_account shortcode twice.</caption>
* add_filter( 'um_ultimatemember_account_shortcode_disable_singleton', '__return_false' );
*/
$disable_singleton_shortcode = apply_filters( 'um_ultimatemember_account_shortcode_disable_singleton', true, $args );
if ( false === $disable_singleton_shortcode && in_array( $account_hash, $this->account_exist, true ) ) {
return '';
}
ob_start();
if ( ! empty( $args['tab'] ) ) {
if ( 'account' === $args['tab'] ) {
+33 -6
View File
@@ -2437,9 +2437,17 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$field_name = $key . $form_suffix;
$field_value = $this->field_value( $key, $default, $data );
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
if ( UM()->options()->get( 'toggle_password' ) ) {
$output .= '<div class="um-field-area-password">
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
</div>
</div>';
} else {
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
</div>';
}
if ( $this->is_error( $key ) ) {
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2467,9 +2475,17 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$field_name = $key . $form_suffix;
$field_value = $this->field_value( $key, $default, $data );
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
if ( UM()->options()->get( 'toggle_password' ) ) {
$output .= '<div class="um-field-area-password">
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
</div>
</div>';
} else {
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
</div>';
}
if ( $this->is_error( $key ) ) {
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2507,10 +2523,17 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
}
$field_value = $this->field_value( $key, $default, $data );
if ( UM()->options()->get( 'toggle_password' ) ) {
$output .= '<div class="um-field-area-password">
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
</div>
</div>';
} else {
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
</div>';
</div>';
}
if ( $this->is_error( $key ) ) {
$output .= $this->field_error( $this->show_error( $key ) );
@@ -2555,7 +2578,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$placeholder = sprintf( __( 'Confirm %s', 'ultimate-member' ), $data['label'] );
}
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />';
if ( UM()->options()->get( 'toggle_password' ) ) {
$output .= '<div class="um-field-area-password"><input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" /><span class="um-toggle-password"><i class="um-icon-eye"></i></span></div>';
} else {
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />';
}
$output .= '</div>';
+11 -4
View File
@@ -482,13 +482,20 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
* @param $action
* @param $subaction
*
* @deprecated 2.6.9
*
* @return mixed|string|void
*/
public function admin_act_url( $action, $subaction ) {
$url = $this->get_current_url();
$url = add_query_arg( 'um_adm_action', $action, $url );
$url = add_query_arg( 'sub', $subaction, $url );
$url = add_query_arg( 'user_id', um_user( 'ID' ), $url );
_deprecated_function( __METHOD__, '2.6.9' );
$url = add_query_arg(
array(
'um_adm_action' => $action,
'sub' => $subaction,
'user_id' => um_user( 'ID' ),
'_wpnonce' => wp_create_nonce( $action ),
)
);
return $url;
}
+31 -36
View File
@@ -21,7 +21,7 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
function __construct() {
//cron request to UM()->store_url;
add_action( 'um_daily_scheduled_events', array( &$this, 'um_checklicenses' ) );
// clean update plugin cache
add_action( 'upgrader_process_complete', array( &$this, 'clean_update_plugins_cache' ), 20, 2 );
@@ -56,10 +56,10 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
return $should_update;
}
/**
* This action is documented in wp-admin/includes/class-wp-upgrader.php
*
*
* @see file /wp-admin/includes/class-plugin-upgrader.php method bulk_upgrade()
* @since 2.1.1 [2019-11-15]
*
@@ -71,118 +71,113 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
wp_clean_plugins_cache( true );
}
}
/**
* Get all paid UM extensions
*
* @return array
*/
function get_active_plugins() {
public function get_active_plugins() {
$paid_extensions = array(
'um-bbpress/um-bbpress.php' => array(
'um-bbpress/um-bbpress.php' => array(
'key' => 'bbpress',
'title' => 'bbPress',
),
'um-followers/um-followers.php' => array(
'um-followers/um-followers.php' => array(
'key' => 'followers',
'title' => 'Followers',
),
'um-friends/um-friends.php' => array(
'um-friends/um-friends.php' => array(
'key' => 'friends',
'title' => 'Friends',
),
'um-groups/um-groups.php' => array(
'um-groups/um-groups.php' => array(
'key' => 'groups',
'title' => 'Groups',
),
'um-instagram/um-instagram.php' => array(
'um-instagram/um-instagram.php' => array(
'key' => 'instagram',
'title' => 'Instagram',
),
'um-mailchimp/um-mailchimp.php' => array(
'um-mailchimp/um-mailchimp.php' => array(
'key' => 'mailchimp',
'title' => 'MailChimp',
),
'um-messaging/um-messaging.php' => array(
'um-messaging/um-messaging.php' => array(
'key' => 'messaging',
'title' => 'Private Messages',
),
'um-mycred/um-mycred.php' => array(
'um-mycred/um-mycred.php' => array(
'key' => 'mycred',
'title' => 'myCRED',
),
'um-notices/um-notices.php' => array(
'um-notices/um-notices.php' => array(
'key' => 'notices',
'title' => 'Notices',
),
'um-notifications/um-notifications.php' => array(
'um-notifications/um-notifications.php' => array(
'key' => 'notifications',
'title' => 'Real-time Notifications',
),
'um-profile-completeness/um-profile-completeness.php' => array(
'um-profile-completeness/um-profile-completeness.php' => array(
'key' => 'profile_completeness',
'title' => 'Profile Completeness',
),
'um-reviews/um-reviews.php' => array(
'um-reviews/um-reviews.php' => array(
'key' => 'reviews',
'title' => 'User Reviews',
),
'um-social-activity/um-social-activity.php' => array(
'um-social-activity/um-social-activity.php' => array(
'key' => 'activity',
'title' => 'Social Activity',
),
'um-social-login/um-social-login.php' => array(
'um-social-login/um-social-login.php' => array(
'key' => 'social_login',
'title' => 'Social Login',
),
'um-user-tags/um-user-tags.php' => array(
'um-user-tags/um-user-tags.php' => array(
'key' => 'user_tags',
'title' => 'User Tags',
),
'um-verified-users/um-verified-users.php' => array(
'um-verified-users/um-verified-users.php' => array(
'key' => 'verified',
'title' => 'Verified Users',
),
'um-woocommerce/um-woocommerce.php' => array(
'um-woocommerce/um-woocommerce.php' => array(
'key' => 'woocommerce',
'title' => 'WooCommerce',
),
'um-user-photos/um-user-photos.php' => array(
'um-user-photos/um-user-photos.php' => array(
'key' => 'user_photos',
'title' => 'User Photos',
),
'um-private-content/um-private-content.php' => array(
'um-private-content/um-private-content.php' => array(
'key' => 'private_content',
'title' => 'Private Content',
),
'um-user-bookmarks/um-user-bookmarks.php' => array(
'um-user-bookmarks/um-user-bookmarks.php' => array(
'key' => 'user_bookmarks',
'title' => 'User Bookmarks',
),
'um-unsplash/um-unsplash.php' => array(
'um-unsplash/um-unsplash.php' => array(
'key' => 'unsplash',
'title' => 'Unsplash',
),
'um-user-locations/um-user-locations.php' => array(
'um-user-locations/um-user-locations.php' => array(
'key' => 'user_locations',
'title' => 'User Locations',
),
'um-profile-tabs/um-profile-tabs.php' => array(
'um-profile-tabs/um-profile-tabs.php' => array(
'key' => 'profile_tabs',
'title' => 'Profile tabs',
),
'um-user-notes/um-user-notes.php' => array(
'um-user-notes/um-user-notes.php' => array(
'key' => 'user_notes',
'title' => 'User Notes',
),
'um-frontend-posting/um-frontend-posting.php' => array(
'key' => 'frontend_posting',
'title' => 'Frontend Posting',
),
'um-google-authenticator/um-google-authenticator.php' => array(
'key' => 'google_authenticator',
'title' => 'Google Authenticator',
'um-stripe/um-stripe.php' => array(
'key' => 'stripe',
'title' => 'Stripe',
),
);
+8 -6
View File
@@ -603,21 +603,23 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
*/
public function ultimatemember( $args = array() ) {
/**
* Filters variable for disable singleton shortcode loading on the same page.
* Note: Set it to `true` if you need to render the same form twice or more on the same page.
* Filters variable for enable singleton shortcode loading on the same page.
* Note: Set it to `false` if you don't need to render the same form twice or more on the same page.
*
* @since 2.6.8
* @since 2.6.9 $disable argument set to `true` by default
*
* @hook um_ultimatemember_shortcode_disable_singleton
*
* @param {bool} $disable Disabled singleton. By default, it's `false`.
* @param {bool} $disable Disabled singleton. By default, it's `true`.
* @param {array} $args Shortcode arguments.
*
* @return {bool} Disabled singleton or not.
*
* @example <caption>Turn on ability to use ultimatemember shortcode twice.</caption>
* add_filter( 'um_ultimatemember_shortcode_disable_singleton', '__return_true' );
* @example <caption>Turn off ability to use ultimatemember shortcode twice.</caption>
* add_filter( 'um_ultimatemember_shortcode_disable_singleton', '__return_false' );
*/
$disable_singleton_shortcode = apply_filters( 'um_ultimatemember_shortcode_disable_singleton', false, $args );
$disable_singleton_shortcode = apply_filters( 'um_ultimatemember_shortcode_disable_singleton', true, $args );
if ( false === $disable_singleton_shortcode ) {
if ( isset( $args['form_id'] ) ) {
$id = $args['form_id'];
+86 -54
View File
@@ -1,8 +1,8 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Validate for errors in account form
*
@@ -278,7 +278,7 @@ function um_submit_account_details( $args ) {
* ?>
*/
$redirect_url = apply_filters( 'um_delete_account_redirect_url', um_user( 'delete_redirect_url' ), $user_id );
exit( wp_redirect( $redirect_url ) );
um_safe_redirect( $redirect_url );
} else {
um_redirect_home();
}
@@ -588,55 +588,71 @@ function um_after_account_privacy( $args ) {
<label>
<?php esc_html_e( 'Download your data', 'ultimate-member' ); ?>
</label>
<span class="um-tip um-tip-<?php echo is_rtl() ? 'e' : 'w' ?>" original-title="<?php esc_attr_e( 'You can request a file with the information that we believe is most relevant and useful to you.', 'ultimate-member' ); ?>">
<span class="um-tip um-tip-<?php echo is_rtl() ? 'e' : 'w'; ?>" title="<?php esc_attr_e( 'You can request a file with the information that we believe is most relevant and useful to you.', 'ultimate-member' ); ?>">
<i class="um-icon-help-circled"></i>
</span>
<div class="um-clear"></div>
</div>
<?php $completed = $wpdb->get_row(
"SELECT ID
FROM $wpdb->posts
WHERE post_author = $user_id AND
post_type = 'user_request' AND
post_name = 'export_personal_data' AND
post_status = 'request-completed'
ORDER BY ID DESC
LIMIT 1",
ARRAY_A );
<?php
$completed = $wpdb->get_row(
$wpdb->prepare(
"SELECT ID
FROM $wpdb->posts
WHERE post_author = %d AND
post_type = 'user_request' AND
post_name = 'export_personal_data' AND
post_status = 'request-completed'
ORDER BY ID DESC
LIMIT 1",
$user_id
),
ARRAY_A
);
if ( ! empty( $completed ) ) {
$exports_url = wp_privacy_exports_url();
echo '<p>' . esc_html__( 'You could download your previous data:', 'ultimate-member' ) . '</p>';
echo '<a href="'.esc_attr( $exports_url . get_post_meta( $completed['ID'], '_export_file_name', true ) ) . '">' . esc_html__( 'Download Personal Data', 'ultimate-member' ) . '</a>';
echo '<a href="' . esc_attr( $exports_url . get_post_meta( $completed['ID'], '_export_file_name', true ) ) . '">' . esc_html__( 'Download Personal Data', 'ultimate-member' ) . '</a>';
echo '<p>' . esc_html__( 'You could send a new request for an export of personal your data.', 'ultimate-member' ) . '</p>';
}
$pending = $wpdb->get_row(
"SELECT ID, post_status
FROM $wpdb->posts
WHERE post_author = $user_id AND
post_type = 'user_request' AND
post_name = 'export_personal_data' AND
post_status != 'request-completed'
ORDER BY ID DESC
LIMIT 1",
ARRAY_A );
$wpdb->prepare(
"SELECT ID, post_status
FROM $wpdb->posts
WHERE post_author = %d AND
post_type = 'user_request' AND
post_name = 'export_personal_data' AND
post_status != 'request-completed'
ORDER BY ID DESC
LIMIT 1",
$user_id
),
ARRAY_A
);
if ( ! empty( $pending ) && $pending['post_status'] == 'request-pending' ) {
if ( ! empty( $pending ) && 'request-pending' === $pending['post_status'] ) {
echo '<p>' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '</p>';
} elseif ( ! empty( $pending ) && $pending['post_status'] == 'request-confirmed' ) {
} elseif ( ! empty( $pending ) && 'request-confirmed' === $pending['post_status'] ) {
echo '<p>' . esc_html__( 'The administrator has not yet approved downloading the data. Please expect an email with a link to your data.', 'ultimate-member' ) . '</p>';
} else {
if ( UM()->account()->current_password_is_required( 'privacy_download_data' ) ) { ?>
if ( UM()->account()->current_password_is_required( 'privacy_download_data' ) ) {
?>
<label name="um-export-data">
<?php esc_html_e( 'Enter your current password to confirm a new export of your personal data.', 'ultimate-member' ); ?>
</label>
<div class="um-field-area">
<input id="um-export-data" type="password" placeholder="<?php esc_attr_e( 'Password', 'ultimate-member' )?>">
<?php if ( UM()->options()->get( 'toggle_password' ) ) { ?>
<div class="um-field-area-password">
<input id="um-export-data" type="password" placeholder="<?php esc_attr_e( 'Password', 'ultimate-member' ); ?>">
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
</div>
<?php } else { ?>
<input id="um-export-data" type="password" placeholder="<?php esc_attr_e( 'Password', 'ultimate-member' ); ?>">
<?php } ?>
<div class="um-field-error um-export-data">
<span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span><?php esc_html_e( 'You must enter a password', 'ultimate-member' ); ?>
</div>
@@ -664,22 +680,27 @@ function um_after_account_privacy( $args ) {
<label>
<?php esc_html_e( 'Erase of your data', 'ultimate-member' ); ?>
</label>
<span class="um-tip um-tip-<?php echo is_rtl() ? 'e' : 'w' ?>" original-title="<?php esc_attr_e( 'You can request erasing of the data that we have about you.', 'ultimate-member' ); ?>">
<span class="um-tip um-tip-<?php echo is_rtl() ? 'e' : 'w'; ?>" title="<?php esc_attr_e( 'You can request erasing of the data that we have about you.', 'ultimate-member' ); ?>">
<i class="um-icon-help-circled"></i>
</span>
<div class="um-clear"></div>
</div>
<?php $completed = $wpdb->get_row(
"SELECT ID
FROM $wpdb->posts
WHERE post_author = $user_id AND
post_type = 'user_request' AND
post_name = 'remove_personal_data' AND
post_status = 'request-completed'
ORDER BY ID DESC
LIMIT 1",
ARRAY_A );
<?php
$completed = $wpdb->get_row(
$wpdb->prepare(
"SELECT ID
FROM $wpdb->posts
WHERE post_author = %d AND
post_type = 'user_request' AND
post_name = 'remove_personal_data' AND
post_status = 'request-completed'
ORDER BY ID DESC
LIMIT 1",
$user_id
),
ARRAY_A
);
if ( ! empty( $completed ) ) {
@@ -689,26 +710,37 @@ function um_after_account_privacy( $args ) {
}
$pending = $wpdb->get_row(
"SELECT ID, post_status
FROM $wpdb->posts
WHERE post_author = $user_id AND
post_type = 'user_request' AND
post_name = 'remove_personal_data' AND
post_status != 'request-completed'
ORDER BY ID DESC
LIMIT 1",
ARRAY_A );
$wpdb->prepare(
"SELECT ID, post_status
FROM $wpdb->posts
WHERE post_author = %d AND
post_type = 'user_request' AND
post_name = 'remove_personal_data' AND
post_status != 'request-completed'
ORDER BY ID DESC
LIMIT 1",
$user_id
),
ARRAY_A
);
if ( ! empty( $pending ) && $pending['post_status'] == 'request-pending' ) {
if ( ! empty( $pending ) && 'request-pending' === $pending['post_status'] ) {
echo '<p>' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your deletion request.', 'ultimate-member' ) . '</p>';
} elseif ( ! empty( $pending ) && $pending['post_status'] == 'request-confirmed' ) {
} elseif ( ! empty( $pending ) && 'request-confirmed' === $pending['post_status'] ) {
echo '<p>' . esc_html__( 'The administrator has not yet approved deleting your data. Please expect an email with a link to your data.', 'ultimate-member' ) . '</p>';
} else {
if ( UM()->account()->current_password_is_required( 'privacy_erase_data' ) ) { ?>
if ( UM()->account()->current_password_is_required( 'privacy_erase_data' ) ) {
?>
<label name="um-erase-data">
<?php esc_html_e( 'Enter your current password to confirm the erasure of your personal data.', 'ultimate-member' ); ?>
<input id="um-erase-data" type="password" placeholder="<?php esc_attr_e( 'Password', 'ultimate-member' )?>">
<?php if ( UM()->options()->get( 'toggle_password' ) ) { ?>
<div class="um-field-area-password">
<input id="um-erase-data" type="password" placeholder="<?php esc_attr_e( 'Password', 'ultimate-member' ); ?>">
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
</div>
<?php } else { ?>
<input id="um-erase-data" type="password" placeholder="<?php esc_attr_e( 'Password', 'ultimate-member' ); ?>">
<?php } ?>
<div class="um-field-error um-erase-data">
<span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span><?php esc_html_e( 'You must enter a password', 'ultimate-member' ); ?>
</div>
+3 -1
View File
@@ -573,7 +573,9 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) {
}
if ( isset( $array['max_words'] ) && $array['max_words'] > 0 ) {
if ( str_word_count( $submitted_data[ $key ], 0, "éèàôù" ) > $array['max_words'] ) {
// count words without html tags
$without_tags = wp_strip_all_tags( $submitted_data[ $key ] );
if ( str_word_count( $without_tags, 0, 'éèàôù' ) > $array['max_words'] ) {
// translators: %s: max words.
UM()->form()->add_error( $key, sprintf( __( 'You are only allowed to enter a maximum of %s words', 'ultimate-member' ), $array['max_words'] ) );
}
+24 -7
View File
@@ -235,6 +235,14 @@ function um_user_edit_profile( $args, $form_data ) {
continue;
}
if ( is_array( $array ) ) {
$origin_data = UM()->fields()->get_field( $key );
if ( is_array( $origin_data ) ) {
// Merge data passed with original field data.
$array = array_merge( $origin_data, $array );
}
}
// required option? 'required_opt' - it's field attribute predefined in the field data in code
// @todo can be unnecessary. it's used in 1 place (user account).
if ( isset( $array['required_opt'] ) ) {
@@ -283,8 +291,7 @@ function um_user_edit_profile( $args, $form_data ) {
*/
$has_custom_source = apply_filters( "um_has_dropdown_options_source__{$key}", false );
if ( isset( $array['options'] ) && in_array( $array['type'], array( 'select', 'multiselect' ), true ) ) {
$options = array();
$options = $array['options'];
if ( ! empty( $array['custom_dropdown_options_source'] ) && function_exists( $array['custom_dropdown_options_source'] ) && ! $has_custom_source ) {
if ( ! UM()->fields()->is_source_blacklisted( $array['custom_dropdown_options_source'] ) ) {
$callback_result = call_user_func( $array['custom_dropdown_options_source'], $array['options'] );
@@ -293,7 +300,6 @@ function um_user_edit_profile( $args, $form_data ) {
}
}
}
$array['options'] = apply_filters( "um_custom_dropdown_options__{$key}", $options );
}
@@ -318,8 +324,20 @@ function um_user_edit_profile( $args, $form_data ) {
//the user cannot set invalid value in the hidden input at the page
if ( in_array( $array['type'], array( 'multiselect', 'checkbox', 'radio' ), true ) ) {
if ( ! empty( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) ) {
$args['submitted'][ $key ] = array_map( 'stripslashes', array_map( 'trim', $args['submitted'][ $key ] ) );
$args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array_map( 'trim', $array['options'] ) );
if ( is_array( $args['submitted'][ $key ] ) ) {
$args['submitted'][ $key ] = array_map( 'stripslashes', array_map( 'trim', $args['submitted'][ $key ] ) );
if ( is_array( $array['options'] ) ) {
$args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array_map( 'trim', $array['options'] ) );
} else {
$args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array( trim( $array['options'] ) ) );
}
} else {
if ( is_array( $array['options'] ) ) {
$args['submitted'][ $key ] = array_intersect( array( stripslashes( trim( $args['submitted'][ $key ] ) ) ), array_map( 'trim', $array['options'] ) );
} else {
$args['submitted'][ $key ] = array_intersect( array( stripslashes( trim( $args['submitted'][ $key ] ) ) ), array( trim( $array['options'] ) ) );
}
}
}
// update empty user meta
@@ -1225,8 +1243,7 @@ function um_profile_header( $args ) {
<textarea id="um-meta-bio"
data-character-limit="<?php echo esc_attr( UM()->options()->get( 'profile_bio_maxchars' ) ); ?>"
placeholder="<?php esc_attr_e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
name="<?php echo esc_attr( $description_key . '-' . $args['form_id'] ); ?>"
id="<?php echo esc_attr( $description_key . '-' . $args['form_id'] ); ?>"><?php echo UM()->fields()->field_value( $description_key ) ?></textarea>
name="<?php echo esc_attr( $description_key ); ?>"><?php echo UM()->fields()->field_value( $description_key ) ?></textarea>
<span class="um-meta-bio-character um-right"><span
class="um-bio-limit"><?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?></span></span>
+26 -1
View File
@@ -7,7 +7,7 @@ Tags: community, member, membership, user-profile, user-registration
Requires PHP: 5.6
Requires at least: 5.5
Tested up to: 6.2
Stable tag: 2.6.8
Stable tag: 2.6.9
License: GNU Version 2 or Any Later Version
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -166,6 +166,31 @@ No specific extensions are needed. But we highly recommended keep active these P
IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
= 2.6.9: July 26, 2023 =
* Enhancements:
- Added: Compatibility with UM:Stripe extension
- Added: Show/hide password button for toggle password visibility
- Added: JS scripts for syncing biography fields if there are the 1st field in the profile header and the 2nd field in the profile form
* Bugfixes:
- Fixed: Using allowed hosts for safe redirect after profile deletion
- Fixed: Nonce validation for the admin actions handler
- Fixed: Using singleton for UM Forms and UM Account shortcodes. Empty pages issue
- Fixed: PHP errors in admin notices
- Fixed: PHP errors on UM Profile update when there is multiselect field
- Fixed: UM Form and UM Member Directories titles un-slashed. Please re-update the entities where you have extra-slashes
- Fixed: Maximum allowed words option for textarea where you may insert HTML tags. Ignore HTML tags symbols when count
- Fixed: Sanitize for fields (Min characters, Max characters, etc.) where can be empty string or absint value
* Templates required update:
- profile.php
* Cached and optimized/minified assets(JS/CSS) must be flushed/re-generated after upgrade
= 2.6.8: July 19, 2023 =
* Enhancements:
+5 -3
View File
@@ -6,7 +6,7 @@
*
* Page: "Profile"
*
* @version 2.6.1
* @version 2.6.9
*
* @var string $mode
* @var int $form_id
@@ -14,7 +14,9 @@
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
}
$description_key = UM()->profile()->get_show_bio_key( $args );
?>
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?> um-role-<?php echo esc_attr( um_user( 'role' ) ); ?> ">
@@ -43,7 +45,7 @@ if ( ! defined( 'ABSPATH' ) ) {
do_action( 'um_profile_before_header', $args );
if ( um_is_on_edit_profile() ) { ?>
<form method="post" action="">
<form method="post" action="" data-description_key="<?php echo esc_attr( $description_key ); ?>">
<?php }
/**
+14 -9
View File
@@ -1,13 +1,18 @@
<?php
/*
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: 2.6.8
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member
*/
/**
* 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: 2.6.9
* Author: Ultimate Member
* Author URI: http://ultimatemember.com/
* Text Domain: ultimate-member
* Domain Path: /languages
* Requires at least: 5.5
* Requires PHP: 5.6
*
* @package UM
*/
defined( 'ABSPATH' ) || exit;