diff --git a/includes/admin/class-enqueue.php b/includes/admin/class-enqueue.php index 20c6e3da..981fba3a 100644 --- a/includes/admin/class-enqueue.php +++ b/includes/admin/class-enqueue.php @@ -583,7 +583,7 @@ final class Enqueue extends \um\common\Enqueue { wp_enqueue_style( 'um_admin_roles' ); } elseif ( 'ultimate-member_page_um_options' === $hook ) { // phpcs:ignore WordPress.Security.NonceVerification - if ( isset( $_GET['tab'] ) && 'secure' === $_GET['tab'] ) { + if ( isset( $_GET['tab'], $_GET['section'] ) && 'advanced' === $_GET['tab'] && 'secure' === $_GET['section'] ) { wp_register_script( 'um_admin_secure', $js_url . 'admin/secure' . $suffix . '.js', array( 'jquery', 'wp-i18n' ), UM_VERSION, true ); wp_set_script_translations( 'um_admin_secure', 'ultimate-member' ); wp_enqueue_script( 'um_admin_secure' ); diff --git a/includes/admin/class-secure.php b/includes/admin/class-secure.php index 09a65790..80cc3c1e 100644 --- a/includes/admin/class-secure.php +++ b/includes/admin/class-secure.php @@ -91,8 +91,7 @@ if ( ! class_exists( 'um\admin\Secure' ) ) { public function admin_init() { global $wpdb; // Dismiss admin notice after the first visit to Secure settings page. - if ( isset( $_REQUEST['page'] ) && isset( $_REQUEST['tab'] ) && - 'um_options' === sanitize_key( $_REQUEST['page'] ) && 'secure' === sanitize_key( $_REQUEST['tab'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification + if ( isset( $_REQUEST['page'], $_REQUEST['tab'], $_REQUEST['section'] ) && 'um_options' === sanitize_key( $_REQUEST['page'] ) && 'advanced' === sanitize_key( $_REQUEST['tab'] ) && 'secure' === sanitize_key( $_REQUEST['section'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification UM()->admin()->notices()->dismiss( 'secure_settings' ); } @@ -297,7 +296,7 @@ if ( ! class_exists( 'um\admin\Secure' ) ) { ) ); - $settings['secure'] = array( + $settings['advanced']['sections']['secure'] = array( 'title' => __( 'Secure', 'ultimate-member' ), 'fields' => $secure_fields, ); diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index 6e1e3816..e04d986d 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -64,7 +64,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { ob_start(); foreach ( $this->form_data['fields'] as $field_data ) { - if ( isset( $field_data['type'] ) && 'hidden' == $field_data['type'] ) { + if ( isset( $field_data['type'] ) && 'hidden' === $field_data['type'] ) { echo $this->render_form_row( $field_data ); } } diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php index a10294a4..9a251f81 100644 --- a/includes/admin/core/class-admin-notices.php +++ b/includes/admin/core/class-admin-notices.php @@ -849,7 +849,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {

- +

excluded_taxonomies(); - $all_taxonomies = get_taxonomies( array( 'public' => true, 'show_ui' => true ), 'objects' ); + $all_taxonomies = get_taxonomies( + array( + 'public' => true, + 'show_ui' => true, + ), + 'objects' + ); foreach ( $all_taxonomies as $key => $taxonomy ) { if ( in_array( $key, $exclude_taxonomies, true ) ) { continue; @@ -446,7 +455,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { } } - $restricted_access_taxonomy_metabox_value = array(); $restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' ); if ( ! empty( $restricted_access_taxonomy_metabox ) && is_array( $restricted_access_taxonomy_metabox ) ) { @@ -1789,7 +1797,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'licenses' => array( 'title' => __( 'Licenses', 'ultimate-member' ), ), - 'advanced' => array( + 'advanced' => array( 'title' => __( 'Advanced', 'ultimate-member' ), 'sections' => array( '' => array( @@ -1851,7 +1859,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { ), ), ), - 'misc' => array( + 'misc' => array( 'title' => __( 'Misc', 'ultimate-member' ), 'fields' => array( array( @@ -1891,13 +1899,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'type' => 'install_info', ), ), - ), + ), // @todo remove since 2.9.0 ) ); - } - /** * @param array $settings * @@ -2980,10 +2986,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { } /** - * HTML for Settings > Override Templates tab. - * @return void + * HTML for Settings > Advanced > Override Templates tab. + * + * @return string */ - public function settings_override_templates_tab( $html, $current_tab, $current_subtab ) { + public function settings_override_templates_tab() { $um_check_version = get_transient( 'um_check_template_versions' ); $check_url = add_query_arg( @@ -3022,6 +3029,35 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { return ob_get_clean(); } + /** + * HTML for Settings > Install Info tab. + * + * @todo remove since 2.9.0 + * + * @return string + */ + public function settings_install_info() { + ob_start(); + ?> +

+ Info. + echo wp_kses( sprintf( __( 'This settings tab is deprecated. And it will be fully removed since 2.9.0 version. Please get the installation info from there.', 'ultimate-member' ), add_query_arg( 'tab', 'debug', admin_url( 'site-health.php' ) ) ), UM()->get_allowed_html( 'admin_notice' ) ); + ?> +

+

+ here.', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/1879-ultimate-member-site-health' ), UM()->get_allowed_html( 'admin_notice' ) ); + ?> +

+ + ' . wp_kses( __( 'WARNING: Ensure that you\'ve created a full backup of your site as your restoration point before changing anything on your site with our recommendations.', 'ultimate-member' ), UM()->get_allowed_html( 'admin_notice' ) ) . ''; if ( $suspicious_accounts_count > 0 ) { - $lock_register_forms_url = admin_url( 'admin.php?page=um_options&tab=secure&um_secure_lock_register_forms=1&_wpnonce=' . wp_create_nonce( 'um_secure_lock_register_forms' ) ); + $lock_register_forms_url = admin_url( 'admin.php?page=um_options&tab=advanced§ion=secure&um_secure_lock_register_forms=1&_wpnonce=' . wp_create_nonce( 'um_secure_lock_register_forms' ) ); $content .= $br . esc_html__( '1. Please temporarily lock all your active Register forms.', 'ultimate-member' ); $content .= ' ' . esc_html__( 'Click here to lock them now.', 'ultimate-member' ) . ''; $content .= ' ' . esc_html__( 'You can unblock the Register forms later. Just go to Ultimate Member > Settings > Secure > uncheck the option "Lock All Register Forms".', 'ultimate-member' );