diff --git a/includes/admin/core/class-admin-columns.php b/includes/admin/core/class-admin-columns.php index 55a65adb..1607220d 100644 --- a/includes/admin/core/class-admin-columns.php +++ b/includes/admin/core/class-admin-columns.php @@ -118,6 +118,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Columns' ) ) { 'um_adm_action' => 'duplicate_form', 'post_id' => $id, 'nonce' => wp_create_nonce( "um-duplicate_form{$id}" ), + '_wpnonce' => wp_create_nonce( 'duplicate_form' ), ), admin_url( 'edit.php' ) ); diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php index f89f6f7b..75af3e22 100644 --- a/includes/admin/core/class-admin-notices.php +++ b/includes/admin/core/class-admin-notices.php @@ -369,7 +369,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { ); } - /** * Regarding page setup */ @@ -381,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(); + ?>

- +   - +

- 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; } @@ -413,23 +424,30 @@ 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' => '

' . __( 'Ultimate Member Setup Error: User page can not be a child page.', 'ultimate-member' ) . '

', - ), 25 ); + $this->add_notice( + 'wrong_user_page', + array( + 'class' => 'updated', + 'message' => '

' . esc_html__( 'Ultimate Member Setup Error: User page can not be a child page.', 'ultimate-member' ) . '

', + ), + 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' => '

' . __( 'Ultimate Member Setup Error: Account page can not be a child page.', 'ultimate-member' ) . '

', - ), 30 ); + $this->add_notice( + 'wrong_account_page', + array( + 'class' => 'updated', + 'message' => '

' . esc_html__( 'Ultimate Member Setup Error: Account page can not be a child page.', 'ultimate-member' ) . '

', + ), + 30 + ); } } - } } @@ -441,12 +459,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { $hide_exif_notice = get_option( 'um_hide_exif_notice' ); if ( ! extension_loaded( 'exif' ) && ! $hide_exif_notice ) { + $url = add_query_arg( + array( + 'um_adm_action' => 'um_hide_exif_notice', + '_wpnonce' => wp_create_nonce( 'um_hide_exif_notice' ), + ) + ); $this->add_notice( 'exif_disabled', array( 'class' => 'updated', // translators: %s: query args. - 'message' => '

' . sprintf( __( 'Exif is not enabled on your server. Mobile photo uploads will not be rotated correctly until you enable the exif extension. Hide this notice', 'ultimate-member' ), add_query_arg( 'um_adm_action', 'um_hide_exif_notice' ) ) . '

', + 'message' => '

' . sprintf( __( 'Exif is not enabled on your server. Mobile photo uploads will not be rotated correctly until you enable the exif extension. Hide this notice', 'ultimate-member' ), $url ) . '

', ), 10 ); diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index d8a7cb4e..d504b8c7 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -3072,10 +3072,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' ), + ) + ); ?>

- + 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' ), + ) +); ?> -

+

- + - +

diff --git a/includes/admin/templates/dashboard/purge.php b/includes/admin/templates/dashboard/purge.php index b1facb25..5e80926b 100644 --- a/includes/admin/templates/dashboard/purge.php +++ b/includes/admin/templates/dashboard/purge.php @@ -1,7 +1,15 @@ - 'purge_temp', + '_wpnonce' => wp_create_nonce( 'purge_temp' ), + ) +); + if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>

@@ -12,8 +20,8 @@ if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>

- - + +

diff --git a/includes/admin/templates/dashboard/upgrade-request.php b/includes/admin/templates/dashboard/upgrade-request.php index b5061d8e..0d10fd17 100644 --- a/includes/admin/templates/dashboard/upgrade-request.php +++ b/includes/admin/templates/dashboard/upgrade-request.php @@ -1,9 +1,19 @@ - + 'manual_upgrades_request', + '_wpnonce' => wp_create_nonce( 'manual_upgrades_request' ), + ) +); +?> -

+

- - + + -

\ No newline at end of file +

diff --git a/includes/core/class-permalinks.php b/includes/core/class-permalinks.php index 59f9e6cd..0bbb47bf 100644 --- a/includes/core/class-permalinks.php +++ b/includes/core/class-permalinks.php @@ -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; }