Plugin Directory

Changeset 3799640


Ignore:
Timestamp:
11/13/2026 04:24:11 AM (2 days ago)
Author:
adminkov
Message:

Improved Attack analyzer

Location:
sitewatchman
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sitewatchman/tags/1.0.0/class-swm7-analyzer.php

    r3788523 r3799640  
    44 *
    55 * @package     SiteWatchman
    6  * @subpackage  WafEngine
    76 * @author      Oleg Klenitsky <klenitskiy.oleg@mail.ru>
    87 * @copyright   2026 Oleg Klenitsky
    … …  
    1413
    1514if ( ! defined( 'ABSPATH' ) ) {
    16         exit;
     15        exit();
    1716}
    1817
    … …  
    256255                }
    257256
     257                // Do not treat SSE (Server-Sent Events) polling requests as a flood attack.
     258                // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     259                $current_action = isset( $_REQUEST['action'] ) ? sanitize_key( wp_unslash( $_REQUEST['action'] ) ) : '';
     260                $request_uri    = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
     261                $is_sse_request = (
     262                        'sse' === $current_action
     263                        && ! empty( $request_uri )
     264                        && false !== strpos( $request_uri, 'admin-ajax.php' )
     265                );
     266
     267                if ( $is_sse_request ) {
     268                        return false;
     269                }
     270
    258271                $current_time = time();
    259272                $safe_ip_key  = md5( $this->target_ip );
  • sitewatchman/tags/1.0.0/class-swm7-core.php

    r3788523 r3799640  
    852852                // WordPress core technical visits (Cron) — do not log to the DB.
    853853                if ( strpos( $page_visit, '/wp-cron.php' ) !== false ) {
     854                        return;
     855                }
     856
     857                // Skip internal SSE (Server-Sent Events) / AJAX table refresh requests.
     858                if ( strpos( $page_visit, 'action=sse' ) !== false ) {
    854859                        return;
    855860                }
  • sitewatchman/tags/1.0.0/sitewatchman.php

    r3788523 r3799640  
    1414 *
    1515 * @package     SiteWatchman
    16  * @category    class php
     16 * @category    Core Modules
    1717 * @author      Oleg Klenitsky
    1818 * @copyright   2026 Oleg Klenitsky
  • sitewatchman/trunk/class-swm7-analyzer.php

    r3788523 r3799640  
    44 *
    55 * @package     SiteWatchman
    6  * @subpackage  WafEngine
    76 * @author      Oleg Klenitsky <klenitskiy.oleg@mail.ru>
    87 * @copyright   2026 Oleg Klenitsky
    … …  
    1413
    1514if ( ! defined( 'ABSPATH' ) ) {
    16         exit;
     15        exit();
    1716}
    1817
    … …  
    256255                }
    257256
     257                // Do not treat SSE (Server-Sent Events) polling requests as a flood attack.
     258                // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     259                $current_action = isset( $_REQUEST['action'] ) ? sanitize_key( wp_unslash( $_REQUEST['action'] ) ) : '';
     260                $request_uri    = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
     261                $is_sse_request = (
     262                        'sse' === $current_action
     263                        && ! empty( $request_uri )
     264                        && false !== strpos( $request_uri, 'admin-ajax.php' )
     265                );
     266
     267                if ( $is_sse_request ) {
     268                        return false;
     269                }
     270
    258271                $current_time = time();
    259272                $safe_ip_key  = md5( $this->target_ip );
  • sitewatchman/trunk/class-swm7-core.php

    r3788523 r3799640  
    852852                // WordPress core technical visits (Cron) — do not log to the DB.
    853853                if ( strpos( $page_visit, '/wp-cron.php' ) !== false ) {
     854                        return;
     855                }
     856
     857                // Skip internal SSE (Server-Sent Events) / AJAX table refresh requests.
     858                if ( strpos( $page_visit, 'action=sse' ) !== false ) {
    854859                        return;
    855860                }
  • sitewatchman/trunk/sitewatchman.php

    r3788523 r3799640  
    1414 *
    1515 * @package     SiteWatchman
    16  * @category    class php
     16 * @category    Core Modules
    1717 * @author      Oleg Klenitsky
    1818 * @copyright   2026 Oleg Klenitsky
Note: See TracChangeset for help on using the changeset viewer.