Plugin Directory

Changeset 3380398


Ignore:
Timestamp:
10/18/2025 06:35:12 AM (6 months ago)
Author:
winrid
Message:

3.16.1 - Improvements to prevent spam.

Location:
fastcomments
Files:
40 added
2 edited

Legend:

Unmodified
Added
Removed
  • fastcomments/trunk/README.txt

    r3142080 r3380398  
    33Tags: live comments, comments, comment spam, comment system, fast comments, live commenting
    44Requires at least: 4.6
    5 Tested up to: 6.6.2
    6 Stable tag: 3.16.0
     5Tested up to: 6.8.3
     6Stable tag: 3.16.1
    77Requires PHP: 5.2.5
    88License: GPLv2 or later
     
    8888== Changelog ==
    8989
     90= 3.16.1 =
     91* Prevent bots from submitting spam directly to the WP endpoint when the plugin is installed
     92
    9093= 3.16.0 =
    9194* Improved compatibility with some other plugins like LearnDash LMS.
  • fastcomments/trunk/fastcomments-wordpress-plugin.php

    r3142085 r3380398  
    44Plugin URI: https://fastcomments.com
    55Description: A live, fast, privacy-focused commenting system.
    6 Version: 3.16.0
     6Version: 3.16.1
    77Author: winrid @ FastComments
    88License: GPL-2.0+
     
    1414}
    1515
    16 $FASTCOMMENTS_VERSION = 3.160;
     16$FASTCOMMENTS_VERSION = 3.161;
    1717
    1818require_once plugin_dir_path(__FILE__) . 'admin/fastcomments-admin.php';
     
    9292    add_filter('wp_enqueue_scripts', 'fc_add_comment_count_scripts', 100);
    9393    add_filter('wp_footer', 'fc_add_comment_count_config', 100);
     94
     95    // Prevent spam bots from submitting to WordPress's native comment endpoints
     96    add_filter('comments_open', 'fc_block_native_comments', 10, 2);
     97    add_filter('rest_pre_insert_comment', 'fc_block_rest_comments', 10, 2);
     98}
     99
     100// Block submissions to wp-comments-post.php
     101function fc_block_native_comments($open, $post_id) {
     102    // When FastComments is active, close native WordPress comments to prevent bot spam
     103    if (get_option('fastcomments_tenant_id')) {
     104        return false;
     105    }
     106    return $open;
     107}
     108
     109// Block REST API comment submissions
     110function fc_block_rest_comments($prepared_comment, $request) {
     111    // When FastComments is active, block REST API comment submissions
     112    if (get_option('fastcomments_tenant_id')) {
     113        return new WP_Error(
     114            'fastcomments_rest_blocked',
     115            __('Comments must be submitted through FastComments.', 'fastcomments'),
     116            array('status' => 403)
     117        );
     118    }
     119    return $prepared_comment;
    94120}
    95121
Note: See TracChangeset for help on using the changeset viewer.