Filters

replymind_send_comment_data

Decide whether a specific comment is sent to the AI for reply generation. Returning false skips the comment.

apply_filters( 'replymind_send_comment_data', $allow, $comment );
Argument Type Description
$allow bool Default true
$comment WP_Comment The comment being evaluated

Examples:

// Skip all comments on a specific post.
add_filter( 'replymind_send_comment_data', function ( $allow, $comment ) {
    if ( (int) $comment->comment_post_ID === 123 ) {
        return false;
    }
    return $allow;
}, 10, 2 );
// Skip comments from a specific email domain.
add_filter( 'replymind_send_comment_data', function ( $allow, $comment ) {
    if ( str_ends_with( $comment->comment_author_email, '@example.com' ) ) {
        return false;
    }
    return $allow;
}, 10, 2 );
// Skip very short comments.
add_filter( 'replymind_send_comment_data', function ( $allow, $comment ) {
    if ( str_word_count( $comment->comment_content ) < 5 ) {
        return false;
    }
    return $allow;
}, 10, 2 );

This filter is checked in the cron handler (new comments), the per-comment Generate AI Reply admin action, and the batch process loop. All three respect the same return value.


replymind_daily_limit

Override the daily cap on AI calls.

apply_filters( 'replymind_daily_limit', $limit );
Argument Type Description
$limit int Default 100. Set to 0 to disable the cap entirely.

Examples:

// Cap at 1000 replies per day.
add_filter( 'replymind_daily_limit', fn() => 1000 );
// Disable the cap entirely.
add_filter( 'replymind_daily_limit', fn() => 0 );
// Different cap on weekends.
add_filter( 'replymind_daily_limit', function () {
    $day = (int) wp_date( 'N' );
    return ( $day >= 6 ) ? 50 : 200;
} );

The counter is stored in a date-keyed transient (replymind_daily_YYYYMMDD) and resets at midnight server time. Only successful API calls increment the counter.


Cron events

replymind_process_comment

Fires once per submitted comment, deferred via wp_schedule_single_event. Receives the comment ID as a single argument.

add_action( 'replymind_process_comment', function ( $comment_id ) {
    // Pre-process hook — runs before ReplyMind's own callback (priority 10).
    // Note: ReplyMind's own logic does its own checks, so this is mainly
    // useful for logging or external notifications.
}, 9 );

The plugin's callback handles all the eligibility checks (enabled, allow_send_data, API key present, comment still approved at processing time). It only sends one event per comment thanks to _replymind_processed meta.


Comment meta keys

The plugin sets the following keys on the original visitor's comment:

Meta key Set when Value
_replymind_pending_reply Suggestion-mode generation succeeds reply text (may contain HTML)
_replymind_reply_generated A child reply has been posted '1'
_replymind_processed End of processing (success or error) '1'
_replymind_error Generation or post fails error message string

The plugin also sets _replymind_reply_generated = '1' on the AI-authored child comment itself.

Querying for comments with a pending draft:

$comments = get_comments( array(
    'meta_key'     => '_replymind_pending_reply',
    'meta_compare' => '!=',
    'meta_value'   => '',
    'status'       => 'approve',
    'type'         => 'comment',
) );

Cleaning up a single comment manually:

delete_comment_meta( $comment_id, '_replymind_pending_reply' );
delete_comment_meta( $comment_id, '_replymind_processed' );
delete_comment_meta( $comment_id, '_replymind_error' );

This makes the comment eligible for re-processing.


Options

Option Autoload Notes
replymind_api_key yes Single API key string
replymind_settings yes Settings group (see below)
replymind_logs no Last 200 log entries
replymind_do_activation_redirect yes One-shot post-activation flag

The replymind_settings array contains:

array(
    'enabled'         => '0' | '1',
    'mode'            => 'suggestion' | 'auto',
    'provider'        => 'openai' | 'claude',
    'model'           => 'gpt-4o-mini' | 'claude-sonnet-4-6' | etc.,
    'tone'            => 'professional' | 'friendly' | 'casual' | 'empathetic' | 'formal',
    'response_length' => 'short' | 'medium' | 'detailed',
    'language'        => 'auto' | 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'hi' | 'ar' | 'ja' | 'zh',
    'prompt'          => string,
)

Admin endpoints

All endpoints are nonce-protected. Capability requirements are listed below.

admin-post.php actions

Action HTTP Capability Nonce action
replymind_generate_reply GET edit_comment replymind_generate_reply
replymind_publish_reply GET edit_comment replymind_publish_reply
replymind_clear_logs POST manage_options replymind_clear_logs
replymind_remove_api_key GET manage_options replymind_remove_api_key

AJAX endpoints

Action Capability Returns
replymind_submit_reply edit_comment success/failure of single draft publish
replymind_batch_count manage_options { total, drafts }
replymind_batch_process manage_options { processed, errors, remaining }
replymind_batch_publish manage_options { published, errors, remaining }

All AJAX endpoints verify nonces via check_ajax_referer at the top of the handler before reading any other request data.


Privacy hooks

The plugin registers itself with WordPress's privacy framework on admin_init:

Hook Purpose
wp_add_privacy_policy_content (action) Adds a notice to the Privacy Policy guide
wp_privacy_personal_data_exporters (filter) Registers an exporter for comment AI metadata
wp_privacy_personal_data_erasers (filter) Registers an eraser for the same

Both the exporter and eraser paginate (100 comments per page) and follow WordPress's canonical return shape.


Uninstall

When the plugin is deleted via the WordPress admin, uninstall.php runs and removes:

  • Options replymind_api_key, replymind_settings, replymind_logs, replymind_do_activation_redirect.
  • All comment meta with keys starting _replymind_ (uses $wpdb->prepare with $wpdb->esc_like and the LIKE operator).

The AI reply comments themselves are not deleted — they're regular WordPress comments and the plugin doesn't track which comments it authored beyond the meta flag.


Asset versioning

All admin CSS/JS files are enqueued with REPLYMIND_VERSION as the cache-buster. To force-refresh assets in development, define a different constant:

define( 'REPLYMIND_VERSION', '1.0.0-dev-' . time() );

(in wp-config.php before the plugin loads)


File structure

replymind-ai-comment-responder/
├── replymind-ai-comment-responder.php   bootstrap, plugin headers
├── README.txt                            wp.org listing
├── uninstall.php                         cleanup on delete
├── includes/
│   ├── class-replymind-loader.php        privacy hooks
│   └── class-replymind-utils.php         settings, prompt, AI call, logging
├── admin/
│   ├── class-replymind-admin.php         admin UI + handlers
│   ├── css/replymind-admin.css           status pills + modal styles
│   └── js/
│       ├── replymind-settings.js         provider/model dropdown filter
│       ├── replymind-comments.js         inline draft modal
│       └── replymind-batch.js            batch generate + bulk publish UI
└── public/
    └── class-replymind-public.php        comment_post listener + cron callback

License

Released under GPL v2 or later (the same license as WordPress). You're free to fork, modify, and redistribute under that license. Contributions back to the upstream plugin are welcome via the WordPress.org support forum or a pull request to the public repo (when available).