mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added deprecated info text to Install Info;
- transfer Secure tab to Advanced > Secure subtab;
This commit is contained in:
@@ -583,7 +583,7 @@ final class Enqueue extends \um\common\Enqueue {
|
|||||||
wp_enqueue_style( 'um_admin_roles' );
|
wp_enqueue_style( 'um_admin_roles' );
|
||||||
} elseif ( 'ultimate-member_page_um_options' === $hook ) {
|
} elseif ( 'ultimate-member_page_um_options' === $hook ) {
|
||||||
// phpcs:ignore WordPress.Security.NonceVerification
|
// 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_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_set_script_translations( 'um_admin_secure', 'ultimate-member' );
|
||||||
wp_enqueue_script( 'um_admin_secure' );
|
wp_enqueue_script( 'um_admin_secure' );
|
||||||
|
|||||||
@@ -91,8 +91,7 @@ if ( ! class_exists( 'um\admin\Secure' ) ) {
|
|||||||
public function admin_init() {
|
public function admin_init() {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
// Dismiss admin notice after the first visit to Secure settings page.
|
// Dismiss admin notice after the first visit to Secure settings page.
|
||||||
if ( isset( $_REQUEST['page'] ) && isset( $_REQUEST['tab'] ) &&
|
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_options' === sanitize_key( $_REQUEST['page'] ) && 'secure' === sanitize_key( $_REQUEST['tab'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
|
||||||
UM()->admin()->notices()->dismiss( 'secure_settings' );
|
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' ),
|
'title' => __( 'Secure', 'ultimate-member' ),
|
||||||
'fields' => $secure_fields,
|
'fields' => $secure_fields,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
|||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
foreach ( $this->form_data['fields'] as $field_data ) {
|
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 );
|
echo $this->render_form_row( $field_data );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -849,7 +849,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
|
|||||||
<?php esc_html_e( 'Ultimate Member has a new additional feature to secure your Ultimate Member forms to prevent attacks from injecting accounts with administrative roles & capabilities.', 'ultimate-member' ); ?>
|
<?php esc_html_e( 'Ultimate Member has a new additional feature to secure your Ultimate Member forms to prevent attacks from injecting accounts with administrative roles & capabilities.', 'ultimate-member' ); ?>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a class="button button-primary" href="<?php echo esc_attr( admin_url( 'admin.php?page=um_options&tab=secure&um_dismiss_notice=secure_settings&um_admin_nonce=' . wp_create_nonce( 'um-admin-nonce' ) ) ); ?>"><?php esc_html_e( 'Manage Security Settings', 'ultimate-member' ); ?></a>
|
<a class="button button-primary" href="<?php echo esc_attr( admin_url( 'admin.php?page=um_options&tab=advanced§ion=secure&um_dismiss_notice=secure_settings&um_admin_nonce=' . wp_create_nonce( 'um-admin-nonce' ) ) ); ?>"><?php esc_html_e( 'Manage Security Settings', 'ultimate-member' ); ?></a>
|
||||||
<a class="button" target="_blank" href="https://docs.ultimatemember.com/article/1869-security-feature"><?php esc_html_e( 'Read the documentation', 'ultimate-member' ); ?></a>
|
<a class="button" target="_blank" href="https://docs.ultimatemember.com/article/1869-security-feature"><?php esc_html_e( 'Read the documentation', 'ultimate-member' ); ?></a>
|
||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
|||||||
|
|
||||||
//custom content for licenses tab
|
//custom content for licenses tab
|
||||||
add_filter( 'um_settings_section_licenses__custom_content', array( $this, 'settings_licenses_tab' ), 10, 3 );
|
add_filter( 'um_settings_section_licenses__custom_content', array( $this, 'settings_licenses_tab' ), 10, 3 );
|
||||||
add_filter( 'um_settings_section_advanced_override_templates_custom_content', array( $this, 'settings_override_templates_tab' ), 10, 3 );
|
add_filter( 'um_settings_section_advanced_override_templates_custom_content', array( $this, 'settings_override_templates_tab' ) );
|
||||||
|
|
||||||
|
// @todo remove since 2.9.0
|
||||||
|
add_filter( 'um_settings_section_install_info__custom_content', array( $this, 'settings_install_info' ) );
|
||||||
|
|
||||||
//custom content for override templates tab
|
//custom content for override templates tab
|
||||||
add_action( 'plugins_loaded', array( $this, 'um_check_template_version' ), 10 );
|
add_action( 'plugins_loaded', array( $this, 'um_check_template_version' ), 10 );
|
||||||
@@ -420,7 +423,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
|||||||
$duplicates = array();
|
$duplicates = array();
|
||||||
$taxonomies_options = array();
|
$taxonomies_options = array();
|
||||||
$exclude_taxonomies = UM()->excluded_taxonomies();
|
$exclude_taxonomies = UM()->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 ) {
|
foreach ( $all_taxonomies as $key => $taxonomy ) {
|
||||||
if ( in_array( $key, $exclude_taxonomies, true ) ) {
|
if ( in_array( $key, $exclude_taxonomies, true ) ) {
|
||||||
continue;
|
continue;
|
||||||
@@ -446,7 +455,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$restricted_access_taxonomy_metabox_value = array();
|
$restricted_access_taxonomy_metabox_value = array();
|
||||||
$restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' );
|
$restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' );
|
||||||
if ( ! empty( $restricted_access_taxonomy_metabox ) && is_array( $restricted_access_taxonomy_metabox ) ) {
|
if ( ! empty( $restricted_access_taxonomy_metabox ) && is_array( $restricted_access_taxonomy_metabox ) ) {
|
||||||
@@ -1891,13 +1899,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
|||||||
'type' => 'install_info',
|
'type' => 'install_info',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
), // @todo remove since 2.9.0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $settings
|
* @param array $settings
|
||||||
*
|
*
|
||||||
@@ -2980,10 +2986,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTML for Settings > Override Templates tab.
|
* HTML for Settings > Advanced > Override Templates tab.
|
||||||
* @return void
|
*
|
||||||
|
* @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' );
|
$um_check_version = get_transient( 'um_check_template_versions' );
|
||||||
|
|
||||||
$check_url = add_query_arg(
|
$check_url = add_query_arg(
|
||||||
@@ -3022,6 +3029,35 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
|||||||
return ob_get_clean();
|
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();
|
||||||
|
?>
|
||||||
|
<p class="description" style="margin: 20px 0 0 0;">
|
||||||
|
<?php
|
||||||
|
/** @noinspection HtmlUnknownTarget */
|
||||||
|
// translators: %s: Link to the Site Health > 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 <a href="%s">there</a>.', 'ultimate-member' ), add_query_arg( 'tab', 'debug', admin_url( 'site-health.php' ) ) ), UM()->get_allowed_html( 'admin_notice' ) );
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<p class="description" style="margin: 20px 0 0 0;">
|
||||||
|
<?php
|
||||||
|
/** @noinspection HtmlUnknownTarget */
|
||||||
|
// translators: %s: Link to the Site Health article.
|
||||||
|
echo wp_kses( sprintf( __( 'Check more information about Site Health and how to get the Installation Info <a href="%s" target="_blank">here</a>.', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/1879-ultimate-member-site-health' ), UM()->get_allowed_html( 'admin_notice' ) );
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
return ob_get_clean();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $get_list boolean
|
* @param $get_list boolean
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ class Secure {
|
|||||||
|
|
||||||
$content .= $br . '<div style="padding:10px; border:1px solid #ccc;">' . wp_kses( __( '<strong style="color:red">WARNING:</strong> 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' ) ) . '</div>';
|
$content .= $br . '<div style="padding:10px; border:1px solid #ccc;">' . wp_kses( __( '<strong style="color:red">WARNING:</strong> 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' ) ) . '</div>';
|
||||||
if ( $suspicious_accounts_count > 0 ) {
|
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 .= $br . esc_html__( '1. Please temporarily lock all your active Register forms.', 'ultimate-member' );
|
||||||
$content .= ' <a href="' . esc_attr( $lock_register_forms_url ) . '" target="_blank">' . esc_html__( 'Click here to lock them now.', 'ultimate-member' ) . '</a>';
|
$content .= ' <a href="' . esc_attr( $lock_register_forms_url ) . '" target="_blank">' . esc_html__( 'Click here to lock them now.', 'ultimate-member' ) . '</a>';
|
||||||
$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' );
|
$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' );
|
||||||
|
|||||||
Reference in New Issue
Block a user