From c765d03ce45a0ea28b6dc396d30e41ea98187e9d Mon Sep 17 00:00:00 2001 From: Nikita Sinelnikov Date: Fri, 30 Jul 2021 14:20:11 +0300 Subject: [PATCH] - 2.2.1 prepare to the release; --- README.md | 2 +- includes/admin/class-admin.php | 3 +++ includes/admin/core/class-admin-metabox.php | 12 ++++++------ .../admin/templates/access/restrict_content.php | 2 +- includes/core/class-access.php | 14 +++++++++++--- readme.txt | 13 +++++++++++-- ultimate-member.php | 2 +- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e490a2ac..6acd143c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ GNU Version 2 or Any Later Version ## Releases -[Official Release Version: 2.2.0](https://github.com/ultimatemember/ultimatemember/releases/tag/2.2.0). +[Official Release Version: 2.2.1](https://github.com/ultimatemember/ultimatemember/releases/tag/2.2.1). ## Changelog diff --git a/includes/admin/class-admin.php b/includes/admin/class-admin.php index 35722c97..85227d59 100644 --- a/includes/admin/class-admin.php +++ b/includes/admin/class-admin.php @@ -1373,6 +1373,9 @@ if ( ! class_exists( 'um\admin\Admin' ) ) { case 'textarea': $sanitized[ $k ] = sanitize_textarea_field( $v ); break; + case 'wp_kses': + $sanitized[ $k ] = wp_kses_post( $v ); + break; case 'key': if ( is_array( $v ) ) { $sanitized[ $k ] = array_map( 'sanitize_key', $v ); diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php index d66533c2..0877da44 100644 --- a/includes/admin/core/class-admin-metabox.php +++ b/includes/admin/core/class-admin-metabox.php @@ -416,7 +416,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_access_hide_from_queries', 'type' => 'checkbox', - 'label' => __( 'Would you like to display 404 error on term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ), + 'label' => __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ), 'description' => __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ), 'value' => 1, 'conditional' => array( '_um_accessible', '!=', '0' ), @@ -424,7 +424,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_noaccess_action', 'type' => 'select', - 'label' => __( 'What happens when users without access tries to view the term\'s post?', 'ultimate-member' ), + 'label' => __( 'What happens when users without access try to view the term\'s post?', 'ultimate-member' ), 'description' => __( 'Action when users without access tries to view the term\'s post', 'ultimate-member' ), 'value' => '0', 'options' => array( @@ -436,8 +436,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_restrict_by_custom_message', 'type' => 'select', - 'label' => __( 'Would you like to use the global default message or apply a custom message to this term\'s post?', 'ultimate-member' ), - 'description' => __( 'Action when users without access tries to view the term\'s post', 'ultimate-member' ), + 'label' => __( 'Restricted access message type', 'ultimate-member' ), + 'description' => __( 'Would you like to use the global default message or apply a custom message to this term\'s post?', 'ultimate-member' ), 'value' => '0', 'options' => array( '0' => __( 'Global default message', 'ultimate-member' ), @@ -568,7 +568,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_access_hide_from_queries', 'type' => 'checkbox', - 'label' => __( 'Would you like to display 404 error on term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ), + 'label' => __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ), 'description' => __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ), 'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '', 'conditional' => array( '_um_accessible', '!=', '0' ), @@ -576,7 +576,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_noaccess_action', 'type' => 'select', - 'label' => __( 'What happens when users without access tries to view the term\'s post?', 'ultimate-member' ), + 'label' => __( 'What happens when users without access try to view the term\'s post?', 'ultimate-member' ), 'description' => __( 'Action when users without access tries to view the term\'s post', 'ultimate-member' ), 'value' => ! empty( $data['_um_noaccess_action'] ) ? $data['_um_noaccess_action'] : '0', 'options' => array( diff --git a/includes/admin/templates/access/restrict_content.php b/includes/admin/templates/access/restrict_content.php index 239a18a7..28779908 100644 --- a/includes/admin/templates/access/restrict_content.php +++ b/includes/admin/templates/access/restrict_content.php @@ -89,7 +89,7 @@ if ( ! defined( 'ABSPATH' ) ) { array( 'id' => '_um_noaccess_action', 'type' => 'select', - 'label' => __( 'What happens when users without access tries to view the post?', 'ultimate-member' ), + 'label' => __( 'What happens when users without access try to view the post?', 'ultimate-member' ), 'tooltip' => __( 'Action when users without access tries to view the post', 'ultimate-member' ), 'value' => ! empty( $data['_um_noaccess_action'] ) ? $data['_um_noaccess_action'] : 0, 'options' => array( diff --git a/includes/core/class-access.php b/includes/core/class-access.php index 48b8f032..efcf1c00 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -850,12 +850,20 @@ if ( ! class_exists( 'um\core\Access' ) ) { * Replace titles of restricted posts * * @param string $title - * @param int $id + * @param int|null $id * * @return string */ - function filter_restricted_post_title( $title, $id ) { - if ( is_numeric( $id ) && $this->is_restricted( $id ) ) { + function filter_restricted_post_title( $title, $id = null ) { + if ( ! isset( $id ) ) { + return $title; + } + + if ( ! is_numeric( $id ) ) { + $id = absint( $id ); + } + + if ( $this->is_restricted( $id ) ) { $restricted_global_title = UM()->options()->get( 'restricted_access_post_title' ); $title = stripslashes( $restricted_global_title ); } diff --git a/readme.txt b/readme.txt index cbb340f5..3612528b 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: community, member, membership, user-profile, user-registration Requires PHP: 5.6 Requires at least: 5.0 Tested up to: 5.8 -Stable tag: 2.2.0 +Stable tag: 2.2.1 License: GNU Version 2 or Any Later Version License URI: http://www.gnu.org/licenses/gpl-3.0.txt @@ -157,11 +157,20 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = 2.2.1: August 2, 2021 = +* Enhancements: + + - Added: Extended callback functions for sanitizing data in wp-admin forms fields + - Added: Restricted Access Post Title setting + * Bugfixes: + + - Fixed: Restriction settings and related queries (comments, archives, recent posts, post navigation, etc.) - Fixed: Sanitizing `max-width` value of the Login/Registration/Profile form settings - Fixed: Sanitizing `in_group` field's data - Fixed: Restriction settings related with `Hide in queries` - - Fixed: Restriction settings and performance issues on some installations + - Fixed: Restriction settings and CPU performance issues on some installations + - Fixed: Form meta settings and handling them on PHP8 installations + - Fixed: Make it clearer the restriction settings form labels = 2.2.0: July 20, 2021 = diff --git a/ultimate-member.php b/ultimate-member.php index 0491ed80..2c6e223e 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.2.1-rc.1 +Version: 2.2.1 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member