Plugin Directory

Changeset 3487458


Ignore:
Timestamp:
03/20/2026 08:32:21 PM (9 days ago)
Author:
freelancebo
Message:

v2.2.1: Fix critical event queue flush bug - events were never cleared from WP option cache after successful server delivery

Location:
freelancebo-sentra-control
Files:
4 edited
20 copied

Legend:

Unmodified
Added
Removed
  • freelancebo-sentra-control/tags/2.2.1/freelancebo-sentra-control.php

    r3485789 r3487458  
    44 * Plugin URI: https://freelancebo.it
    55 * Description: WordPress security agent - connects to FreelanceBo Sentra Control central console for WAF, malware scanning, brute force protection, and file integrity monitoring.
    6  * Version: 2.1.9
     6 * Version: 2.2.1
    77 * Author: Freelancebo
    88 * License: GPL-2.0-or-later
     
    1212if (!defined('ABSPATH')) exit;
    1313
    14 define("SENTRA_VERSION", "2.1.9");
     14define("SENTRA_VERSION", "2.2.1");
    1515define('SENTRA_PLUGIN_DIR', plugin_dir_path(__FILE__));
    1616define('SENTRA_PLUGIN_URL', plugin_dir_url(__FILE__));
  • freelancebo-sentra-control/tags/2.2.1/includes/class-sentra-event-queue.php

    r3485648 r3487458  
    66    private $queue = [];
    77    private $option_key = 'sentra_event_queue';
     8    private $loaded = false;
    89
    910    public function __construct(Sentra_API_Client $api) {
     
    5758        }
    5859
    59         $this->save_queue();
     60        // Save directly without reloading from DB
     61        $this->do_save();
    6062    }
    6163
    6264    public function save_queue() {
    6365        $this->load_queue();
     66        $this->do_save();
     67    }
     68
     69    /**
     70     * Persist current in-memory queue to the database.
     71     */
     72    private function do_save() {
    6473        if (!empty($this->queue)) {
    6574            update_option($this->option_key, $this->queue, false);
     
    7079
    7180    private function load_queue() {
    72         if (empty($this->queue)) {
    73             $this->queue = get_option($this->option_key, []);
    74             if (!is_array($this->queue)) {
    75                 $this->queue = [];
     81        if (!$this->loaded) {
     82            $this->loaded = true;
     83            $stored = get_option($this->option_key, []);
     84            if (!is_array($stored)) {
     85                $stored = [];
    7686            }
     87            // Merge any stored events with in-memory events (e.g. pushed before load)
     88            $this->queue = array_merge($stored, $this->queue);
    7789        }
    7890    }
  • freelancebo-sentra-control/tags/2.2.1/includes/modules/class-sentra-malware-scanner.php

    r3485775 r3487458  
    156156                // Check signature patterns
    157157                foreach ($this->signatures as $pattern => $info) {
    158                     if (@preg_match('/' . $pattern . '/is', $content)) {
     158                    if (@preg_match('/' . $pattern . '/im', $content)) {
    159159                        $findings[] = [
    160160                            'file' => $rel_path,
  • freelancebo-sentra-control/tags/2.2.1/readme.txt

    r3485789 r3487458  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.1.9
     7Stable tag: 2.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     77= 2.2.1 =
     78* Fixed critical bug: event queue flush never cleared events from database (save_queue reloaded stale data from WP option cache)
     79* Fixed missing WP-cron schedule: sentra_flush_events could become unscheduled, stopping all event delivery
     80* Improved load_queue with loaded flag to prevent redundant database reads
     81
    7782= 2.1.9 =
    7883* Fixed WAF blocking legitimate REST API calls from admin users (AIOSEO, Gutenberg, etc.)
     
    160165== Upgrade Notice ==
    161166
     167= 2.2.1 =
     168Critical fix: event queue was not properly flushing to server. All users should update immediately.
     169
    162170= 2.1.4 =
    163171* Renamed plugin slug, folder and main file to freelancebo-sentra-control per WordPress.org guidelines
  • freelancebo-sentra-control/trunk/freelancebo-sentra-control.php

    r3486680 r3487458  
    44 * Plugin URI: https://freelancebo.it
    55 * Description: WordPress security agent - connects to FreelanceBo Sentra Control central console for WAF, malware scanning, brute force protection, and file integrity monitoring.
    6  * Version: 2.2.0
     6 * Version: 2.2.1
    77 * Author: Freelancebo
    88 * License: GPL-2.0-or-later
     
    1212if (!defined('ABSPATH')) exit;
    1313
    14 define("SENTRA_VERSION", "2.2.0");
     14define("SENTRA_VERSION", "2.2.1");
    1515define('SENTRA_PLUGIN_DIR', plugin_dir_path(__FILE__));
    1616define('SENTRA_PLUGIN_URL', plugin_dir_url(__FILE__));
  • freelancebo-sentra-control/trunk/includes/class-sentra-event-queue.php

    r3485648 r3487458  
    66    private $queue = [];
    77    private $option_key = 'sentra_event_queue';
     8    private $loaded = false;
    89
    910    public function __construct(Sentra_API_Client $api) {
     
    5758        }
    5859
    59         $this->save_queue();
     60        // Save directly without reloading from DB
     61        $this->do_save();
    6062    }
    6163
    6264    public function save_queue() {
    6365        $this->load_queue();
     66        $this->do_save();
     67    }
     68
     69    /**
     70     * Persist current in-memory queue to the database.
     71     */
     72    private function do_save() {
    6473        if (!empty($this->queue)) {
    6574            update_option($this->option_key, $this->queue, false);
     
    7079
    7180    private function load_queue() {
    72         if (empty($this->queue)) {
    73             $this->queue = get_option($this->option_key, []);
    74             if (!is_array($this->queue)) {
    75                 $this->queue = [];
     81        if (!$this->loaded) {
     82            $this->loaded = true;
     83            $stored = get_option($this->option_key, []);
     84            if (!is_array($stored)) {
     85                $stored = [];
    7686            }
     87            // Merge any stored events with in-memory events (e.g. pushed before load)
     88            $this->queue = array_merge($stored, $this->queue);
    7789        }
    7890    }
  • freelancebo-sentra-control/trunk/readme.txt

    r3486680 r3487458  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.2.0
     7Stable tag: 2.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     77= 2.2.1 =
     78* Fixed critical bug: event queue flush never cleared events from database (save_queue reloaded stale data from WP option cache)
     79* Fixed missing WP-cron schedule: sentra_flush_events could become unscheduled, stopping all event delivery
     80* Improved load_queue with loaded flag to prevent redundant database reads
     81
    7782= 2.1.9 =
    7883* Fixed WAF blocking legitimate REST API calls from admin users (AIOSEO, Gutenberg, etc.)
     
    160165== Upgrade Notice ==
    161166
     167= 2.2.1 =
     168Critical fix: event queue was not properly flushing to server. All users should update immediately.
     169
    162170= 2.1.4 =
    163171* Renamed plugin slug, folder and main file to freelancebo-sentra-control per WordPress.org guidelines
Note: See TracChangeset for help on using the changeset viewer.