diff --git a/README.md b/README.md index 98b5b271..45be3ce8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 2.0.20 | WordPress 4.9 or higher| 2.0.20 | +| 2.0.21 | WordPress 4.9 or higher| 2.0.21 | Features of the plugin include: @@ -48,7 +48,7 @@ GNU Version 2 or Any Later Version Releases ==================== -[Official Release Version: 2.0.20](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.20). +[Official Release Version: 2.0.21](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.21). [Official Release Version: 1.3.88](https://github.com/ultimatemember/ultimatemember/releases). diff --git a/includes/admin/assets/js/um-admin-global.js b/includes/admin/assets/js/um-admin-global.js index a7b28e39..a6b5273c 100644 --- a/includes/admin/assets/js/um-admin-global.js +++ b/includes/admin/assets/js/um-admin-global.js @@ -30,6 +30,7 @@ jQuery(document).ready(function() { jQuery(document).on('click', '#um_opt_in_start', function (e) { + var obj = jQuery(this); var dismiss = jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ); jQuery(this).prop('disabled', true).attr('disabled', 'disabled'); @@ -39,10 +40,10 @@ jQuery(document).ready(function() { }, success: function( data ) { dismiss.trigger('click'); - jQuery(this).prop('disabled', false); + obj.prop('disabled', false).removeAttr( 'disabled' ); }, error: function( data ) { - jQuery(this).prop('disabled', false); + obj.prop('disabled', false).removeAttr( 'disabled' ); return false; } }); diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index 8e6643a7..1b8babc3 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -359,11 +359,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { * ?> */ $localize_data = apply_filters('um_admin_enqueue_localize_data', array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ) + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( "um-admin-nonce" ) ) ); - wp_localize_script( 'um_admin_scripts', 'um_admin_scripts', $localize_data ); + wp_localize_script( 'um_admin_global', 'um_admin_scripts', $localize_data ); } @@ -427,6 +428,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { } else { $this->load_global_scripts(); + $this->load_localize_scripts(); } diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php index d26ef853..75577290 100644 --- a/includes/admin/core/class-admin-notices.php +++ b/includes/admin/core/class-admin-notices.php @@ -698,6 +698,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { function dismiss_notice() { + $nonce = isset( $_POST["nonce"] ) ? $_POST["nonce"] : ""; + if ( ! wp_verify_nonce( $nonce, "um-admin-nonce" ) ) { + wp_send_json_error( esc_js( __( "Wrong Nonce", 'ultimate-member' ) ) ); + } + + if ( empty( $_POST['key'] ) ) { wp_send_json_error( __( 'Wrong Data', 'ultimate-member' ) ); } @@ -712,6 +718,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { function opt_in_notice() { + $nonce = isset( $_POST["nonce"] ) ? $_POST["nonce"] : ""; + if ( ! wp_verify_nonce( $nonce, "um-admin-nonce" ) ) { + wp_send_json_error( esc_js( __( "Wrong Nonce", 'ultimate-member' ) ) ); + } + // Send a maximum of once per period $last_send = get_option( 'um_opt_in_last_send', false ); if ( $last_send && $last_send > strtotime( '-1 day' ) ) { diff --git a/includes/core/um-filters-members.php b/includes/core/um-filters-members.php index 1f2235f5..3dbcf99c 100644 --- a/includes/core/um-filters-members.php +++ b/includes/core/um-filters-members.php @@ -160,6 +160,11 @@ function um_add_search_to_query( $query_args, $args ){ 'value' => serialize( strval( trim( $value ) ) ), 'compare' => 'LIKE', ), + array( + 'key' => $field, + 'value' => serialize( intval( trim( $value ) ) ), + 'compare' => 'LIKE', + ) ) ); } } else { diff --git a/readme.txt b/readme.txt index c3a12074..0a4bb583 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: Tags: community, member, membership, user-profile, user-registration Requires at least: 4.1 Tested up to: 4.9 -Stable tag: 2.0.20 +Stable tag: 2.0.21 License: GNU Version 2 or Any Later Version License URI: http://www.gnu.org/licenses/gpl-3.0.txt @@ -131,6 +131,11 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin = += 2.0.21: July 9, 2018 = + +* Bugfixes: + - Fixed search in members directory by User Tags field (other case) + = 2.0.20: July 6, 2018 = * Bugfixes: diff --git a/ultimate-member.php b/ultimate-member.php index a906476f..5d5c23ef 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -3,7 +3,7 @@ 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.0.20 +Version: 2.0.21 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member