plugin-icon

Init Recent Comments – Templated, Modern, Minimal

作者 Init HTML·
Display recent comments with customizable templates and clean CSS. Lightweight, flexible, and built for modern WordPress sites.
版本
1.5
活躍安裝總數
70
最近更新:
Jul 21, 2026
Init Recent Comments – Templated, Modern, Minimal

Init Recent Comments is a developer-friendly plugin that lets you display the latest comments anywhere via a simple shortcode. It uses clean HTML, minimal CSS, and fully customizable templates.

No widgets, no bloated options. Just lightweight, extendable code — made for real sites.

Key design goals:

  • Templated rendering with override support from themes
  • Clean CSS you can disable or replace
  • REST-ready architecture (future-proof)
  • No jQuery, no nonsense

Perfect for blogs, news sites, or anyone who wants a better way to show active discussions.

This plugin is part of the Init Plugin Suite — a collection of minimalist, fast, and developer-focused tools for WordPress.

GitHub repository: https://github.com/brokensmile2103/init-recent-comments

Features

  • Simple shortcode: [init_plugin_suite_recent_comments] (legacy alias: [init_recent_comments])
  • Shortcode for displaying recent reviews: [init_plugin_suite_recent_reviews] (legacy alias: [init_recent_reviews])
  • Shortcode for displaying recent comments of a specific user: [init_plugin_suite_user_recent_comments] (legacy alias: [init_user_recent_comments])
  • Shortcode for displaying recent reviews of a specific user: [init_plugin_suite_user_recent_reviews] (legacy alias: [init_user_recent_reviews])
  • Template-based rendering (comment-item.php, wrapper.php)
  • CSS can be disabled to use your theme’s design
  • No widgets, no jQuery, no frontend bloat
  • Developer-ready: extend with filters, REST, and lazy loading (planned)
  • Translation-ready (.pot included)

Usage

Use the shortcode anywhere:

[init_plugin_suite_recent_comments number="5" maxheight="400px"]

Recent reviews:

[init_plugin_suite_recent_reviews number="5"]

Recent comments of a specific user:

[init_plugin_suite_user_recent_comments user_id="123"]

Recent reviews of a specific user:

[init_plugin_suite_user_recent_reviews user_id="123"]

The legacy tags [init_recent_comments], [init_recent_reviews], [init_user_recent_comments], and [init_user_recent_reviews] still work exactly the same way, for backward compatibility with existing content.

Attributes:

  • number – Total items to show (default: 5)
  • maxheight – Optional max height with scroll and hidden scrollbar (example: 300px)
  • paged – Optional pagination
  • theme – Light or dark (example: theme="dark")
  • For user shortcodes: user_id, user_login, or user_email can be used to target the user

To override templates, create the folder in your theme:

your-theme/ └── init-recent-comments/ ├── wrapper.php ├── review-wrapper.php ├── comment-item.php └── review-item.php<h3>Filters for Developers</h3>

This plugin provides multiple filters to help developers customize caching behavior and performance for recent comments, reviews, and total comment count queries.

By default, comment/review queries are NOT cached (TTL = 0) so newly posted comments always show up immediately — this is intentional, since most sites using this plugin expect real-time freshness. If your site has heavy traffic and you’re fine with a short delay before new comments appear, you can enable caching yourself using the filters below (a value like 60 for 60 seconds is a reasonable starting point). Total comment count queries default to a 5-minute TTL instead, since counts are less time-sensitive.

init_plugin_suite_recent_comments_ttl

Control the cache TTL (in seconds) for recent comments. Applies to: Recent Comments Query Params: int $ttl

init_plugin_suite_recent_comments_query_args

Allows developers to modify or extend the WP_Comment query arguments before the query runs. Applies to: Recent Comments Query Params: array $args

init_plugin_suite_recent_reviews_ttl

Control the cache TTL (in seconds) for recent reviews. Applies to: Recent Reviews Query Params: int $ttl

init_plugin_suite_user_recent_comments_ttl

Control cache TTL (in seconds) for recent comments by a specific user. Applies to: [init_user_recent_comments] Params: int $ttl, array $args

init_plugin_suite_user_recent_reviews_ttl

Control cache TTL (in seconds) for recent reviews by a specific user. Applies to: [init_user_recent_reviews] Params: int $ttl, array $args

init_plugin_suite_total_comments_ttl

Control the cache TTL (in seconds) for total approved comment counts by post type. Applies to: Total Comments Query Params: int $ttl, array $post_types

init_plugin_suite_total_by_posts_ttl

Control the cache TTL (in seconds) for total approved comment counts across multiple post IDs. Applies to: Total by Post IDs Query Params: int $ttl, array $post_ids

License

This plugin is licensed under the GPLv2 or later. You are free to use, modify, and distribute it under the same license.

目前已測試版本
WordPress 7.0.2
此外掛程式已可供下載,並可用於你 系統。