Init Recent Comments – Display latest comments with clean design and customizable templates

Version: 1.4 Tiếng Việt

Init Recent Comments – Display latest comments with clean design and customizable templates
Init Recent Comments is a WordPress plugin that lets you display the most recent comments anywhere on your site using a simple shortcode. No widgets, no jQuery, no clutter — just clean, lightweight, and flexible code, perfect for blogs, news sites, or any website looking to highlight user engagement in a professional way.

Key Features

  • Simple shortcode [init_recent_comments] — use anywhere
  • Shortcode [init_recent_reviews] to display recent reviews
  • User-specific shortcodes:
    • [init_user_recent_comments] — recent comments by a specific user (supports user_id, user_login, user_email)
    • [init_user_recent_reviews] — recent reviews by a specific user
  • Separated templates — override from theme (like WooCommerce)
  • Minimal, clean CSS — can be disabled to use theme styling
  • No widget, no jQuery, no frontend bloat
  • Supports caching (TTL) and query filters — developer friendly

Display comments via shortcode

Use the shortcode anywhere — post, page, block editor, or widget:

[init_recent_comments number="5" maxheight="300px"]

Supported attributes:

  • number — number of comments to show (default: 5)
  • maxheight — enables max height + scrollbar
  • paged — enable pagination (example: paged="2")
  • themelight or dark

Display recent reviews

[init_recent_reviews number="5"]

Display comments / reviews of a specific user

Display recent comments by a user (you can use ID / login / email):

[init_user_recent_comments user_id="123"]

Display recent reviews by a user:

[init_user_recent_reviews user_id="123"]

Additional user-specific parameters:

  • user_id / user_login / user_email (for user comments shortcode)
  • user_id (for user reviews shortcode)

Easy template override

Fully customize the output by adding templates to your theme:

your-theme/init-recent-comments/
├── wrapper.php
├── review-wrapper.php
├── comment-item.php
└── review-item.php

No hooks, no complicated actions — just copy and edit.

Quick Installation

  1. Upload the plugin to /wp-content/plugins/init-recent-comments/
  2. Activate it from the Plugins menu in WordPress
  3. Add the shortcode where you want to display comments or reviews
  4. Optional: go to Settings → Init Recent Comments to disable default CSS

Compatibility & Performance

  • Compatible with WordPress 5.5+
  • Tested on WordPress 6.9
  • Supports PHP 7.4+
  • Works with any theme
  • No jQuery — powered 100% by core WordPress API
  • Includes caching layer + TTL filter for performance

Developer Filters

Built-in developer filters (WordPress standard):

  • init_recent_comments_disable_css — enable/disable CSS
  • init_plugin_suite_recent_comments_query_args — modify get_comments() query args
  • init_plugin_suite_recent_comments_ttl — cache TTL for recent comments
  • init_plugin_suite_recent_reviews_ttl — cache TTL for recent reviews
  • init_plugin_suite_user_recent_comments_ttl — TTL for user comments
  • init_plugin_suite_user_recent_reviews_ttl — TTL for user reviews

Get Started

Want a clean, modern, and fully customizable way to show recent activity?

Init Recent Comments is the perfect drop-in solution — lightweight, flexible, and theme-friendly.

Review

5.0/5 (1)

Changelog

  • 1.4 – User-specific comment & review shortcodes
    • Added 2 new shortcodes to display data for a specific user:
      • [init_user_recent_comments] — displays recent comments from a user.
      • [init_user_recent_reviews] — displays recent reviews from a user.
    • Reuses existing templates wrapper.php and review-wrapper.php (still theme-overrideable).
    • Fully supports shortcode attributes: number, paged, theme, maxheight, and allows overriding query via filters.
    • Added helper functions for fetching data by user:
      • init_plugin_suite_recent_comments_get_user_comments()
      • init_plugin_suite_recent_comments_get_user_reviews()
    • Added separate cache groups for User Comments & User Reviews; TTL configurable via filters.
    • Updated review item template: resolve author name & avatar directly from user_id (with anonymous fallback).
    • Internal enhancements: code cleanup and naming consistency without breaking compatibility.
  • 1.3 – Query argument filter & Reply-to UI
    • Added new filter init_plugin_suite_recent_comments_query_args to modify arguments before get_comments() executes.
    • Improved recent comments retrieval:
      • Supports overriding parameters (post_type filtering, changing number, adding meta_query, etc.).
      • Maintains full backward compatibility.
    • Reply-to UI improvements:
      • Shows “Replying to {Author}” when the comment has a parent.
      • Added lightweight CSS for reply context (no background overlap).
    • Minor refactor: cleanup and consistent filter naming across features.
  • 1.2 – Enhanced caching flexibility
    • Improved cache customization for existing functions:
      • Added TTL filter support to init_plugin_suite_recent_comments_get_comments().
      • Added TTL filter support to init_plugin_suite_recent_comments_get_reviews().
      • Added TTL filter support to init_plugin_suite_recent_comments_get_total_comments().
    • Introduced new helper function init_plugin_suite_recent_comments_get_total_by_posts() for counting total approved comments across multiple post IDs.
    • Separated cache group for comment totals (init_comment_totals) to improve isolation and performance.
    • Developers can now adjust cache duration via filters.
    • Default TTL values remain unchanged (0 for comments/reviews, 5 minutes for totals).
    • Minor internal optimizations for better stability and consistency.
  • 1.1 – Recent Reviews Shortcode
    • Added new shortcode [init_recent_reviews] to display recent reviews.
    • Introduced prefixed shortcodes [init_plugin_suite_recent_comments] and [init_plugin_suite_recent_reviews] for consistent naming.
    • Maintained backward compatibility: legacy shortcodes [init_recent_comments] and [init_recent_reviews] still work.
    • Added template override support for the review wrapper (init-recent-comments/review-wrapper.php).
    • Unified CSS handling and options across both comments and reviews shortcodes.
  • 1.0 – Initial release of Init Recent Comments
    • Initial release with shortcode [init_recent_comments] to display recent comments.
    • Separated templates: wrapper.php and comment-item.php, overridable from theme.
    • Optional maxheight attribute to limit height (adds scroll if needed).
    • Clean, lightweight CSS with option to disable via settings page.
    • Added filter init_recent_comments_disable_css to let developers disable CSS via code.
    • No jQuery, no widgets, no custom tables – runs fully on native WordPress features.
Made with in HCMC.

Comments


1 comments
  • Admin

    17/06/2025 lúc 23:37

    Demo available in the Recent Comments section on the sidebar of this page! 👍

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login