diff --git a/admin/AdminClass.php b/admin/AdminClass.php index b8bbd16..8fe5ed4 100755 --- a/admin/AdminClass.php +++ b/admin/AdminClass.php @@ -113,10 +113,10 @@ public function form_settings_general() { public function custom_404_pro_admin_init() { global $wpdb; - if ( current_user_can( 'administrator' ) && wp_verify_nonce( $_REQUEST['form-logs-options'], 'form-logs-options' ) ) { + if ( current_user_can( 'administrator' ) ) { if ( array_key_exists( 'action', $_REQUEST ) ) { $action = sanitize_text_field( $_REQUEST['action'] ); - if ( $action === 'c4p-logs--delete' ) { + if ( $action === 'c4p-logs--delete' && wp_verify_nonce( $_REQUEST['_wpnonce'], 'c4p-logs--delete' ) ) { if ( array_key_exists( 'path', $_REQUEST ) ) { $this->helpers->delete_logs( $_REQUEST['path'] ); $message = urlencode( 'Log(s) successfully deleted!' ); diff --git a/admin/LogsClass.php b/admin/LogsClass.php index 6f641a4..6f8ff23 100755 --- a/admin/LogsClass.php +++ b/admin/LogsClass.php @@ -140,8 +140,9 @@ public function get_sortable_columns() { } public function column_ip( $item ) { + $nonce = wp_create_nonce( 'c4p-logs--delete' ); $actions = array( - 'c4p-logs--delete' => sprintf( 'Delete', esc_html( $_REQUEST['page'] ), 'c4p-logs--delete', $item['id'] ), + 'c4p-logs--delete' => sprintf( 'Delete', esc_html( $_REQUEST['page'] ), 'c4p-logs--delete', $item['id'], $nonce ), ); return sprintf( '%1$s %2$s', diff --git a/admin/views/logs.php b/admin/views/logs.php index 964725d..bd54ffe 100755 --- a/admin/views/logs.php +++ b/admin/views/logs.php @@ -12,7 +12,6 @@
-