Plugin Directory

Changeset 3454914


Ignore:
Timestamp:
02/05/2026 07:47:38 PM (13 days ago)
Author:
shift8
Message:

Adaptive AI powered defense integration, bug fixes, new tests

Location:
atomic-edge-security/trunk
Files:
6 added
7 edited

Legend:

Unmodified
Added
Removed
  • atomic-edge-security/trunk/admin/css/admin.css

    r3449543 r3454914  
    13761376    font-size: 12px;
    13771377}
     1378
     1379/* ==========================================================================
     1380   Adaptive Defense
     1381   ========================================================================== */
     1382
     1383.atomicedge-ad-stats-grid {
     1384    display: grid;
     1385    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
     1386    gap: 20px;
     1387    margin-bottom: 25px;
     1388}
     1389
     1390.atomicedge-ad-stat-box {
     1391    background: #fff;
     1392    border: 1px solid #dcdcde;
     1393    border-radius: 4px;
     1394    padding: 20px;
     1395    text-align: center;
     1396}
     1397
     1398.atomicedge-ad-stat-value {
     1399    font-size: 32px;
     1400    font-weight: 600;
     1401    color: #1d2327;
     1402    line-height: 1.2;
     1403}
     1404
     1405.atomicedge-ad-stat-label {
     1406    font-size: 13px;
     1407    color: #646970;
     1408    margin-top: 5px;
     1409}
     1410
     1411.atomicedge-ad-badge-enabled {
     1412    display: inline-block;
     1413    background: #00a32a;
     1414    color: #fff;
     1415    padding: 3px 10px;
     1416    border-radius: 3px;
     1417    font-weight: 600;
     1418    font-size: 13px;
     1419}
     1420
     1421.atomicedge-ad-badge-disabled {
     1422    display: inline-block;
     1423    background: #d63638;
     1424    color: #fff;
     1425    padding: 3px 10px;
     1426    border-radius: 3px;
     1427    font-weight: 600;
     1428    font-size: 13px;
     1429}
     1430
     1431/* Score badges */
     1432.atomicedge-ad-score {
     1433    display: inline-block;
     1434    padding: 2px 8px;
     1435    border-radius: 3px;
     1436    font-weight: 600;
     1437    font-size: 12px;
     1438    min-width: 32px;
     1439    text-align: center;
     1440}
     1441
     1442.atomicedge-ad-score-critical {
     1443    background: #d63638;
     1444    color: #fff;
     1445}
     1446
     1447.atomicedge-ad-score-high {
     1448    background: #dba617;
     1449    color: #fff;
     1450}
     1451
     1452.atomicedge-ad-score-medium {
     1453    background: #f0c33c;
     1454    color: #1d2327;
     1455}
     1456
     1457.atomicedge-ad-score-low {
     1458    background: #c3c4c7;
     1459    color: #1d2327;
     1460}
     1461
     1462/* Settings Table */
     1463.atomicedge-ad-settings-table {
     1464    width: 100%;
     1465    border-collapse: collapse;
     1466}
     1467
     1468.atomicedge-ad-settings-table th,
     1469.atomicedge-ad-settings-table td {
     1470    padding: 10px 12px;
     1471    text-align: left;
     1472    border-bottom: 1px solid #f0f0f1;
     1473}
     1474
     1475.atomicedge-ad-settings-table th {
     1476    font-weight: 400;
     1477    color: #646970;
     1478    width: 200px;
     1479}
     1480
     1481.atomicedge-ad-settings-table td {
     1482    font-weight: 600;
     1483}
     1484
     1485/* Tab panels */
     1486.atomicedge-ad-tab-panel {
     1487    display: none;
     1488}
     1489
     1490.atomicedge-ad-tab-panel.active {
     1491    display: block;
     1492}
     1493
     1494/* Filters bar */
     1495.atomicedge-ad-filters {
     1496    background: #f6f7f7;
     1497    padding: 12px 15px;
     1498    border-radius: 4px;
     1499    margin-bottom: 15px;
     1500}
     1501
     1502.atomicedge-ad-filters label {
     1503    font-weight: 600;
     1504    margin-right: 8px;
     1505}
     1506
     1507.atomicedge-ad-filters select,
     1508.atomicedge-ad-filters input[type="text"] {
     1509    margin-right: 15px;
     1510}
     1511
     1512/* Card style for sections */
     1513.atomicedge-ad-card {
     1514    background: #fff;
     1515    border: 1px solid #dcdcde;
     1516    border-radius: 4px;
     1517    padding: 20px;
     1518    margin-bottom: 20px;
     1519}
     1520
     1521.atomicedge-ad-card h3 {
     1522    margin-top: 0;
     1523    display: flex;
     1524    align-items: center;
     1525}
     1526
     1527/* Override WordPress table styling for better appearance */
     1528#atomicedge-ad-blocked-table,
     1529#atomicedge-ad-actors-table,
     1530#atomicedge-ad-detections-table {
     1531    border-spacing: 0;
     1532}
     1533
     1534#atomicedge-ad-blocked-table td,
     1535#atomicedge-ad-actors-table td,
     1536#atomicedge-ad-detections-table td {
     1537    vertical-align: middle;
     1538}
     1539
     1540/* Action buttons in tables */
     1541#atomicedge-ad-blocked-table .button-small,
     1542#atomicedge-ad-actors-table .button-small,
     1543#atomicedge-ad-detections-table .button-small {
     1544    margin-right: 5px;
     1545}
     1546
     1547#atomicedge-ad-blocked-table .button-small:last-child,
     1548#atomicedge-ad-actors-table .button-small:last-child,
     1549#atomicedge-ad-detections-table .button-small:last-child {
     1550    margin-right: 0;
     1551}
     1552
     1553#atomicedge-ad-blocked-table .dashicons,
     1554#atomicedge-ad-actors-table .dashicons,
     1555#atomicedge-ad-detections-table .dashicons {
     1556    font-size: 16px;
     1557    width: 16px;
     1558    height: 16px;
     1559}
     1560
     1561/* Block form */
     1562.atomicedge-ad-block-form {
     1563    display: flex;
     1564    gap: 10px;
     1565    flex-wrap: wrap;
     1566    align-items: flex-end;
     1567}
     1568
     1569.atomicedge-ad-block-form .form-group {
     1570    display: flex;
     1571    flex-direction: column;
     1572}
     1573
     1574.atomicedge-ad-block-form label {
     1575    margin-bottom: 4px;
     1576    font-weight: 600;
     1577}
     1578
     1579/* Pagination styling */
     1580.atomicedge-ad-pagination .tablenav-pages {
     1581    display: flex;
     1582    align-items: center;
     1583    gap: 10px;
     1584}
     1585
     1586.atomicedge-ad-pagination .displaying-num {
     1587    color: #646970;
     1588    font-style: italic;
     1589}
     1590
     1591.atomicedge-ad-pagination .paging-input {
     1592    padding: 0 10px;
     1593}
     1594
  • atomic-edge-security/trunk/atomicedge.php

    r3452356 r3454914  
    44 * Plugin URI: https://atomicedge.io/wordpress
    55 * Description: Connect your WordPress site to Atomic Edge WAF/CDN for advanced security protection, analytics, and access control management.
    6  * Version: 2.1.0
     6 * Version: 2.2.0
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
     
    2626
    2727// Plugin constants.
    28 define( 'ATOMICEDGE_VERSION', '2.1.0' );
     28define( 'ATOMICEDGE_VERSION', '2.2.0' );
    2929define( 'ATOMICEDGE_PLUGIN_FILE', __FILE__ );
    3030define( 'ATOMICEDGE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • atomic-edge-security/trunk/includes/class-atomicedge-admin.php

    r3449543 r3454914  
    8484            'atomicedge-analytics',
    8585            array( $this, 'render_analytics_page' )
     86        );
     87
     88        // Adaptive Defense submenu.
     89        add_submenu_page(
     90            'atomic-edge-security',
     91            __( 'Adaptive Defense', 'atomic-edge-security' ),
     92            __( 'Adaptive Defense', 'atomic-edge-security' ),
     93            'manage_options',
     94            'atomicedge-adaptive-defense',
     95            array( $this, 'render_adaptive_defense_page' )
    8696        );
    8797
     
    506516
    507517        include ATOMICEDGE_PLUGIN_DIR . 'admin/views/settings.php';
     518    }
     519
     520    /**
     521     * Render Adaptive Defense page.
     522     *
     523     * AI-powered threat detection with tabbed interface.
     524     *
     525     * @return void
     526     */
     527    public function render_adaptive_defense_page() {
     528        if ( ! current_user_can( 'manage_options' ) ) {
     529            wp_die( esc_html__( 'You do not have permission to access this page.', 'atomic-edge-security' ) );
     530        }
     531
     532        if ( ! $this->api->is_connected() ) {
     533            $this->render_not_connected_notice();
     534            return;
     535        }
     536
     537        include ATOMICEDGE_PLUGIN_DIR . 'admin/views/adaptive-defense.php';
    508538    }
    509539
  • atomic-edge-security/trunk/includes/class-atomicedge-ajax.php

    r3452356 r3454914  
    9191        add_action( 'wp_ajax_atomicedge_2fa_regenerate_codes', array( $this, 'ajax_2fa_regenerate_codes' ) );
    9292        add_action( 'wp_ajax_atomicedge_2fa_get_status', array( $this, 'ajax_2fa_get_status' ) );
     93
     94        // Adaptive Defense.
     95        add_action( 'wp_ajax_atomicedge_get_adaptive_defense', array( $this, 'ajax_get_adaptive_defense' ) );
     96        add_action( 'wp_ajax_atomicedge_get_actor_profiles', array( $this, 'ajax_get_actor_profiles' ) );
     97        add_action( 'wp_ajax_atomicedge_get_threat_detections', array( $this, 'ajax_get_threat_detections' ) );
     98        add_action( 'wp_ajax_atomicedge_get_threat_detection_detail', array( $this, 'ajax_get_threat_detection_detail' ) );
     99        add_action( 'wp_ajax_atomicedge_block_ip', array( $this, 'ajax_block_ip' ) );
     100        add_action( 'wp_ajax_atomicedge_unblock_ip', array( $this, 'ajax_unblock_ip' ) );
     101        add_action( 'wp_ajax_atomicedge_delete_actor', array( $this, 'ajax_delete_actor' ) );
     102        add_action( 'wp_ajax_atomicedge_dismiss_detection', array( $this, 'ajax_dismiss_detection' ) );
    93103    }
    94104
     
    853863    }
    854864
     865    // =========================================================================
     866    // Adaptive Defense AJAX Handlers
     867    // =========================================================================
     868
     869    /**
     870     * Get Adaptive Defense status and overview data.
     871     *
     872     * @return void
     873     */
     874    public function ajax_get_adaptive_defense() {
     875        $this->get_verified_post_fields( array() );
     876
     877        $response = $this->api->get_adaptive_defense();
     878
     879        if ( $response['success'] ) {
     880            wp_send_json_success( $response['data'] );
     881        } else {
     882            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to fetch Adaptive Defense data.', 'atomic-edge-security' ) ) );
     883        }
     884    }
     885
     886    /**
     887     * Get actor profiles (paginated).
     888     *
     889     * @return void
     890     */
     891    public function ajax_get_actor_profiles() {
     892        $post = $this->get_verified_post_fields( array( 'page', 'per_page', 'filter', 'search' ) );
     893
     894        $args = array(
     895            'page'     => isset( $post['page'] ) ? absint( $post['page'] ) : 1,
     896            'per_page' => isset( $post['per_page'] ) ? absint( $post['per_page'] ) : 25,
     897            'filter'   => isset( $post['filter'] ) ? $post['filter'] : 'all',
     898        );
     899
     900        if ( ! empty( $post['search'] ) ) {
     901            $args['search'] = $post['search'];
     902        }
     903
     904        $response = $this->api->get_actor_profiles( $args );
     905
     906        if ( $response['success'] ) {
     907            wp_send_json_success( $response['data'] );
     908        } else {
     909            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to fetch actor profiles.', 'atomic-edge-security' ) ) );
     910        }
     911    }
     912
     913    /**
     914     * Get threat detections (paginated).
     915     *
     916     * @return void
     917     */
     918    public function ajax_get_threat_detections() {
     919        $post = $this->get_verified_post_fields( array( 'page', 'per_page', 'status' ) );
     920
     921        $args = array(
     922            'page'     => isset( $post['page'] ) ? absint( $post['page'] ) : 1,
     923            'per_page' => isset( $post['per_page'] ) ? absint( $post['per_page'] ) : 25,
     924            'status'   => isset( $post['status'] ) ? $post['status'] : 'all',
     925        );
     926
     927        $response = $this->api->get_threat_detections( $args );
     928
     929        if ( $response['success'] ) {
     930            wp_send_json_success( $response['data'] );
     931        } else {
     932            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to fetch threat detections.', 'atomic-edge-security' ) ) );
     933        }
     934    }
     935
     936    /**
     937     * Get threat detection detail.
     938     *
     939     * @return void
     940     */
     941    public function ajax_get_threat_detection_detail() {
     942        $post = $this->get_verified_post_fields( array( 'detection_id' ) );
     943
     944        if ( empty( $post['detection_id'] ) ) {
     945            wp_send_json_error( array( 'message' => __( 'Detection ID is required.', 'atomic-edge-security' ) ) );
     946        }
     947
     948        $response = $this->api->get_threat_detection_detail( absint( $post['detection_id'] ) );
     949
     950        if ( $response['success'] ) {
     951            wp_send_json_success( $response['data'] );
     952        } else {
     953            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to fetch detection details.', 'atomic-edge-security' ) ) );
     954        }
     955    }
     956
     957    /**
     958     * Block an IP address via Adaptive Defense.
     959     *
     960     * @return void
     961     */
     962    public function ajax_block_ip() {
     963        $post = $this->get_verified_post_fields( array( 'ip', 'duration_hours', 'permanent' ) );
     964
     965        if ( empty( $post['ip'] ) ) {
     966            wp_send_json_error( array( 'message' => __( 'IP address is required.', 'atomic-edge-security' ) ) );
     967        }
     968
     969        $ip             = $post['ip'];
     970        $duration_hours = isset( $post['duration_hours'] ) ? absint( $post['duration_hours'] ) : 24;
     971        $permanent      = isset( $post['permanent'] ) && 'true' === $post['permanent'];
     972
     973        $response = $this->api->block_ip( $ip, $duration_hours, $permanent );
     974
     975        if ( $response['success'] ) {
     976            wp_send_json_success( array(
     977                'message' => sprintf(
     978                    /* translators: %s: IP address */
     979                    __( 'IP address %s has been blocked.', 'atomic-edge-security' ),
     980                    esc_html( $ip )
     981                ),
     982                'data'    => $response['data'] ?? array(),
     983            ) );
     984        } else {
     985            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to block IP address.', 'atomic-edge-security' ) ) );
     986        }
     987    }
     988
     989    /**
     990     * Unblock an IP address via Adaptive Defense.
     991     *
     992     * @return void
     993     */
     994    public function ajax_unblock_ip() {
     995        $post = $this->get_verified_post_fields( array( 'ip' ) );
     996
     997        if ( empty( $post['ip'] ) ) {
     998            wp_send_json_error( array( 'message' => __( 'IP address is required.', 'atomic-edge-security' ) ) );
     999        }
     1000
     1001        $response = $this->api->unblock_ip( $post['ip'] );
     1002
     1003        if ( $response['success'] ) {
     1004            wp_send_json_success( array(
     1005                'message' => sprintf(
     1006                    /* translators: %s: IP address */
     1007                    __( 'IP address %s has been unblocked.', 'atomic-edge-security' ),
     1008                    esc_html( $post['ip'] )
     1009                ),
     1010            ) );
     1011        } else {
     1012            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to unblock IP address.', 'atomic-edge-security' ) ) );
     1013        }
     1014    }
     1015
     1016    /**
     1017     * Delete an actor profile.
     1018     *
     1019     * @return void
     1020     */
     1021    public function ajax_delete_actor() {
     1022        $post = $this->get_verified_post_fields( array( 'actor_id' ) );
     1023
     1024        if ( empty( $post['actor_id'] ) ) {
     1025            wp_send_json_error( array( 'message' => __( 'Actor ID is required.', 'atomic-edge-security' ) ) );
     1026        }
     1027
     1028        $response = $this->api->delete_actor_profile( absint( $post['actor_id'] ) );
     1029
     1030        if ( $response['success'] ) {
     1031            wp_send_json_success( array(
     1032                'message' => __( 'Actor profile has been deleted.', 'atomic-edge-security' ),
     1033            ) );
     1034        } else {
     1035            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to delete actor profile.', 'atomic-edge-security' ) ) );
     1036        }
     1037    }
     1038
     1039    /**
     1040     * Dismiss a threat detection.
     1041     *
     1042     * @return void
     1043     */
     1044    public function ajax_dismiss_detection() {
     1045        $post = $this->get_verified_post_fields( array( 'detection_id' ) );
     1046
     1047        if ( empty( $post['detection_id'] ) ) {
     1048            wp_send_json_error( array( 'message' => __( 'Detection ID is required.', 'atomic-edge-security' ) ) );
     1049        }
     1050
     1051        $response = $this->api->dismiss_threat_detection( absint( $post['detection_id'] ) );
     1052
     1053        if ( $response['success'] ) {
     1054            wp_send_json_success( array(
     1055                'message' => __( 'Threat detection has been dismissed.', 'atomic-edge-security' ),
     1056            ) );
     1057        } else {
     1058            wp_send_json_error( array( 'message' => $response['error'] ?? __( 'Failed to dismiss detection.', 'atomic-edge-security' ) ) );
     1059        }
     1060    }
     1061
     1062    // =========================================================================
     1063    // Two-Factor Authentication AJAX Handlers
     1064    // =========================================================================
     1065
    8551066    /**
    8561067     * Start 2FA enrollment via AJAX.
  • atomic-edge-security/trunk/includes/class-atomicedge-api.php

    r3449543 r3454914  
    408408        }
    409409
    410         $response = $this->request( 'GET', '/wp/cdn/status' );
     410        $response = $this->request( 'GET', '/cdn/status' );
    411411
    412412        if ( $response['success'] ) {
     
    424424     */
    425425    public function purge_cdn_cache() {
    426         $response = $this->request( 'POST', '/wp/cdn/purge' );
     426        $response = $this->request( 'POST', '/cdn/purge' );
    427427
    428428        if ( $response['success'] ) {
     
    441441     */
    442442    public function update_cdn_settings( $settings ) {
    443         $response = $this->request( 'PUT', '/wp/cdn/settings', $settings );
     443        $response = $this->request( 'PUT', '/cdn/settings', $settings );
    444444
    445445        if ( $response['success'] ) {
     
    449449
    450450        return $response;
     451    }
     452
     453    // =========================================================================
     454    // Adaptive Defense API Methods
     455    // =========================================================================
     456
     457    /**
     458     * Get Adaptive Defense status and overview data.
     459     *
     460     * @return array Status data or error.
     461     */
     462    public function get_adaptive_defense() {
     463        $cache_key = 'atomicedge_adaptive_defense';
     464        $cached    = get_transient( $cache_key );
     465
     466        if ( false !== $cached ) {
     467            return $cached;
     468        }
     469
     470        $response = $this->request( 'GET', '/adaptive-defense' );
     471
     472        if ( $response['success'] ) {
     473            // Cache for 2 minutes since this data can change frequently.
     474            set_transient( $cache_key, $response, 2 * MINUTE_IN_SECONDS );
     475        }
     476
     477        return $response;
     478    }
     479
     480    /**
     481     * Get paginated list of actor profiles.
     482     *
     483     * @param array $args Query arguments (page, per_page, filter, search).
     484     * @return array Actor profiles or error.
     485     */
     486    public function get_actor_profiles( $args = array() ) {
     487        $defaults = array(
     488            'page'     => 1,
     489            'per_page' => 25,
     490            'filter'   => 'all',
     491        );
     492        $args     = wp_parse_args( $args, $defaults );
     493
     494        $cache_key = 'atomicedge_actors_' . hash( 'sha256', (string) wp_json_encode( $args ) );
     495        $cached    = get_transient( $cache_key );
     496
     497        if ( false !== $cached ) {
     498            return $cached;
     499        }
     500
     501        $response = $this->request( 'GET', '/adaptive-defense/actors', $args );
     502
     503        if ( $response['success'] ) {
     504            set_transient( $cache_key, $response, 2 * MINUTE_IN_SECONDS );
     505        }
     506
     507        return $response;
     508    }
     509
     510    /**
     511     * Get paginated list of threat detections.
     512     *
     513     * @param array $args Query arguments (page, per_page, status).
     514     * @return array Threat detections or error.
     515     */
     516    public function get_threat_detections( $args = array() ) {
     517        $defaults = array(
     518            'page'     => 1,
     519            'per_page' => 25,
     520            'status'   => 'all',
     521        );
     522        $args     = wp_parse_args( $args, $defaults );
     523
     524        $cache_key = 'atomicedge_detections_' . hash( 'sha256', (string) wp_json_encode( $args ) );
     525        $cached    = get_transient( $cache_key );
     526
     527        if ( false !== $cached ) {
     528            return $cached;
     529        }
     530
     531        $response = $this->request( 'GET', '/adaptive-defense/detections', $args );
     532
     533        if ( $response['success'] ) {
     534            set_transient( $cache_key, $response, 2 * MINUTE_IN_SECONDS );
     535        }
     536
     537        return $response;
     538    }
     539
     540    /**
     541     * Get detailed information about a specific threat detection.
     542     *
     543     * @param int $detection_id The detection ID.
     544     * @return array Detection details or error.
     545     */
     546    public function get_threat_detection_detail( $detection_id ) {
     547        $response = $this->request( 'GET', '/adaptive-defense/detections/' . intval( $detection_id ) );
     548        return $response;
     549    }
     550
     551    /**
     552     * Block an IP address via Adaptive Defense.
     553     *
     554     * @param string $ip             IP address to block.
     555     * @param int    $duration_hours Duration in hours (default 24).
     556     * @param bool   $permanent      Whether the block is permanent.
     557     * @return array Result.
     558     */
     559    public function block_ip( $ip, $duration_hours = 24, $permanent = false ) {
     560        $data = array(
     561            'ip'             => $ip,
     562            'duration_hours' => $duration_hours,
     563            'permanent'      => $permanent,
     564        );
     565
     566        $response = $this->request( 'POST', '/adaptive-defense/block', $data );
     567
     568        if ( $response['success'] ) {
     569            // Clear caches.
     570            $this->clear_adaptive_defense_cache();
     571        }
     572
     573        return $response;
     574    }
     575
     576    /**
     577     * Unblock an IP address via Adaptive Defense.
     578     *
     579     * @param string $ip IP address to unblock.
     580     * @return array Result.
     581     */
     582    public function unblock_ip( $ip ) {
     583        $response = $this->request( 'POST', '/adaptive-defense/unblock', array( 'ip' => $ip ) );
     584
     585        if ( $response['success'] ) {
     586            $this->clear_adaptive_defense_cache();
     587        }
     588
     589        return $response;
     590    }
     591
     592    /**
     593     * Delete an actor profile.
     594     *
     595     * @param int $actor_id The actor profile ID.
     596     * @return array Result.
     597     */
     598    public function delete_actor_profile( $actor_id ) {
     599        $response = $this->request( 'DELETE', '/adaptive-defense/actors/' . intval( $actor_id ) );
     600
     601        if ( $response['success'] ) {
     602            $this->clear_adaptive_defense_cache();
     603        }
     604
     605        return $response;
     606    }
     607
     608    /**
     609     * Dismiss a threat detection.
     610     *
     611     * @param int $detection_id The detection ID.
     612     * @return array Result.
     613     */
     614    public function dismiss_threat_detection( $detection_id ) {
     615        $response = $this->request( 'POST', '/adaptive-defense/detections/' . intval( $detection_id ) . '/dismiss' );
     616
     617        if ( $response['success'] ) {
     618            $this->clear_adaptive_defense_cache();
     619        }
     620
     621        return $response;
     622    }
     623
     624    /**
     625     * Clear Adaptive Defense related caches.
     626     *
     627     * @return void
     628     */
     629    private function clear_adaptive_defense_cache() {
     630        global $wpdb;
     631
     632        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     633        $wpdb->query(
     634            $wpdb->prepare(
     635                "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s",
     636                '_transient_atomicedge_adaptive%',
     637                '_transient_timeout_atomicedge_adaptive%',
     638                '_transient_atomicedge_actors%',
     639                '_transient_atomicedge_detections%'
     640            )
     641        );
    451642    }
    452643
  • atomic-edge-security/trunk/includes/class-atomicedge.php

    r3449543 r3454914  
    184184        );
    185185
    186         // Localize script with data.
     186        // Localize script with data for main admin.js.
    187187        wp_localize_script(
    188188            'atomicedge-admin',
     
    204204            )
    205205        );
     206
     207        // Enqueue Adaptive Defense JavaScript on its page.
     208        if ( strpos( $hook, 'atomicedge-adaptive-defense' ) !== false ) {
     209            wp_enqueue_script(
     210                'atomicedge-adaptive-defense',
     211                ATOMICEDGE_PLUGIN_URL . 'admin/js/adaptive-defense.js',
     212                array( 'jquery' ),
     213                $version,
     214                true
     215            );
     216
     217            // Localize script with data for adaptive-defense.js.
     218            wp_localize_script(
     219                'atomicedge-adaptive-defense',
     220                'atomicedge_admin',
     221                array(
     222                    'ajax_url' => admin_url( 'admin-ajax.php' ),
     223                    'nonce'    => wp_create_nonce( 'atomicedge_ajax' ),
     224                )
     225            );
     226        }
    206227    }
    207228
  • atomic-edge-security/trunk/readme.txt

    r3452356 r3454914  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.1.0
     7Stable tag: 2.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2020* **2FA Enforcement Policies** - Require 2FA for specific user roles with configurable grace periods
    2121* **2FA Audit Logging** - Complete security audit trail for all 2FA events
     22* **Adaptive Defense** - AI-powered threat detection that automatically identifies and blocks malicious actors
    2223* **Web Application Firewall (WAF)** - Block SQL injection, XSS, and other attacks with OWASP Core Rules
    2324* **Content Delivery Network (CDN)** - Serve static assets from global edge servers for faster page loads
     
    1061077. CDN settings page for configuring content delivery and asset optimization
    1071088. Two-Factor Authentication settings for securing WordPress login with TOTP apps
     1099. Adaptive Defense dashboard showing AI-powered threat detections and automatic IP blocking
    108110
    109111== Changelog ==
     112
     113= 2.2.0 =
     114* NEW: Adaptive Defense - AI-powered threat detection and automatic IP blocking
     115* View real-time threat status and blocked IPs from the WordPress admin
     116* Actor profiles with behavioral analysis metrics
     117* Threat detection log with AI confidence scores
     118* Requires Atomic Edge Pro or Enterprise plan
     119* IMPROVED: API contract validation for better error messages
    110120
    111121= 2.1.0 =
Note: See TracChangeset for help on using the changeset viewer.