- fixed issue with lack of the nonces in the um_adm_action handler;

This commit is contained in:
Mykyta Synelnikov
2023-07-24 12:57:18 +03:00
parent 2ac7324f77
commit fa2108172f
7 changed files with 110 additions and 38 deletions
+19 -4
View File
@@ -1,4 +1,5 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -9,18 +10,32 @@ $count = $wpdb->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' ),
)
);
?>
<p><?php _e( 'Run this task from time to time to keep your DB clean.', 'ultimate-member' ) ?></p>
<p><?php esc_html_e( 'Run this task from time to time to keep your DB clean.', 'ultimate-member' ); ?></p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'user_cache' ) ); ?>" class="button">
<a href="<?php echo esc_url( $url_user_cache ); ?>" class="button">
<?php
// translators: %s: users number.
echo esc_html( sprintf( __( 'Clear cache of %s users', 'ultimate-member' ), $count ) );
?>
</a>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'user_status_cache' ) ); ?>" class="button">
<a href="<?php echo esc_url( $url_user_status_cache ); ?>" class="button">
<?php esc_html_e( 'Clear user statuses cache', 'ultimate-member' ); ?>
</a>
</p>
+11 -3
View File
@@ -1,7 +1,15 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$url = add_query_arg(
array(
'um_adm_action' => 'purge_temp',
'_wpnonce' => wp_create_nonce( 'purge_temp' ),
)
);
if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>
<p>
@@ -12,8 +20,8 @@ if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>
</p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'purge_temp' ) ); ?>" class="button">
<?php _e( 'Purge Temp', 'ultimate-member' ); ?>
<a href="<?php echo esc_url( $url ); ?>" class="button">
<?php esc_html_e( 'Purge Temp', 'ultimate-member' ); ?>
</a>
</p>
@@ -1,9 +1,19 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$url = add_query_arg(
array(
'um_adm_action' => 'manual_upgrades_request',
'_wpnonce' => wp_create_nonce( 'manual_upgrades_request' ),
)
);
?>
<p><?php _e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ) ?></p>
<p><?php esc_html_e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ); ?></p>
<p>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'manual_upgrades_request' ) ); ?>" class="button">
<?php _e( 'Get latest versions', 'ultimate-member' ) ?>
<a href="<?php echo esc_url( $url ); ?>" class="button">
<?php esc_html_e( 'Get latest versions', 'ultimate-member' ); ?>
</a>
</p>
</p>