Plugin Directory

Changeset 3401115


Ignore:
Timestamp:
11/23/2025 01:03:19 AM (4 months ago)
Author:
etruel
Message:

2.1.2 – Nov 19, 2025 - Add security to reset function

Location:
wpecounter
Files:
40 added
4 edited

Legend:

Unmodified
Added
Removed
  • wpecounter/trunk/includes/class-views.php

    r3368930 r3401115  
    438438        // AJAX handler to reset views
    439439        public function ajax_reset_views() {
    440             if (
    441                 !isset($_POST['post_id'], $_POST['nonce']) ||
    442                 !wp_verify_nonce($_POST['nonce'], 'wpecounter_reset_views_' . absint($_POST['post_id']))
    443             ) {
    444                 wp_send_json_error(array('message' => __('Invalid request.', 'wpecounter')));
    445             }
     440
     441            if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['nonce'], 'wpecounter_reset_views_' . absint($_POST['post_id']))) {
     442                wp_send_json_error(array('message' => __('Invalid permissions.', 'wpecounter')));
     443            }
     444
    446445            $post_id = absint($_POST['post_id']);
    447446            if ($post_id) {
  • wpecounter/trunk/includes/settings.php

    r3311724 r3401115  
    484484        public function sanitize_options($input) {
    485485            global $wpdb;
     486
     487            if(current_user_can('manage_options')===false){
     488                return $input;
     489            }
    486490            // Initialize the new array that will hold the sanitize values
    487491            $new_input = array();
  • wpecounter/trunk/readme.txt

    r3368930 r3401115  
    66Tested up to: 6.8.2
    77Requires PHP: 5.6
    8 Stable tag: 2.1.1
     8Stable tag: 2.1.2
    99License: GPLv2
    1010
     
    5555
    5656== Changelog ==
     57
     58= 2.1.2 – Nov 19, 2025 =
     59* Add security to reset function
    5760
    5861= 2.1.1 – Sep 25, 2025 =
  • wpecounter/trunk/wpecounter.php

    r3368930 r3401115  
    44 * Plugin URI:   https://etruel.com/downloads/wpecounter
    55 * Description:  Counts visits on post lists, pages and/or custom post types. It also displays them in posts, pages or text widget content, shortcode [WPeCounter].
    6  * Version:      2.1.1
     6 * Version:      2.1.2
    77 * Author:       Etruel Developments LLC
    88 * Author URI:   https://etruel.com
     
    1515// Plugin version
    1616if (!defined('WPECOUNTER_VERSION'))
    17     define('WPECOUNTER_VERSION', '2.1.1');
     17    define('WPECOUNTER_VERSION', '2.1.2');
    1818
    1919if (!class_exists('WPeCounter')) :
Note: See TracChangeset for help on using the changeset viewer.