Flexi Recent Comments Logo Featured Image

Flexi Recent Comments

Introduction

Flexi Recent Comments is a free WordPress plugin developed to display comments anywhere in a flexible manner using shortcodes that comes with a number of attributes that can be selected to display comment elements.

You can customise how comments are displayed using attributes. Comment elements that you can customise using attributes are: avatar, number of comments, comment author, comment character limit, post title, and date.

You can also set the style for each parameter via the included CSS file or via additional CSS in the customizer. It’s up to you.

Flexi Recent Comments was initially developed for personal use and was later decided to be shared with all WordPress users as an option. You can use it freely, and it will remain that way. There is absolutely no intention to commercialise it as a paid plugin.

However, if you insist on donating to me and this plugin, then perhaps, just perhaps, I would feel guilty if I refused. But I don’t yet have an easy and practical way to do so. I have to ask my wife first. Any suggestions? 😁

Flexi Recent Comments: Installation and Usage

As Flexi Recent Comments is not yet available on the WordPress plugin repository, installation is carried out by uploading the plugin via the menu:

Plugin » Add Plugin » Upload Plugin

After installation, activate the plugin, then Flexi Recent Comments can be used anywhere (posts, pages, etc.) as long as you can place the shortcode. The shortcode used is:

[flexicomments]

Flexi Recent Comments: Shortcode Attribute

Along with the short code used to display the latest comments, several attributes can be added to make customisation, as follows:

AttributeUsageValue
authorComment’s author1 – All
0 – No posts author
avatarShow avatar1 – Show
0 – Don’t show
numberNumber of comments1, 2, 3, …
titlePost title1 – Show
0 – Don’t show
datePost date1 – Show
0 – Don’t show
limitComments character limit1, 2, 3, … , any number
sizeAvatar size1, 2, 3, … , any number
AtributPenggunaanNilai
Tabel Atribut kode pendek Flexi Recent Comments

If the element you want to display using a shortcode already matches the default value of that attribute, you can omit the attribute in the shortcode. However, if you still want to use the attribute to ensure the element is displayed, that’s fine.

Flexi Recent Comments: Demo

Demo 1: Default

The default shortcode will display the latest comments with attribute values set by the plugin. Note the default value of the shortcode attribute. You can ignore this attribute if it already matches what you want. However, you can also use it if you think it is necessary to ensure this.

[flexicomments]
---
Default attribute value:
• number="5"
• avatar="1"
• size="50"
• author="1"
• limit="80"
• title="1"
• date="1"

Demo 2

Use shortcodes to display 3 comments, 75px avatar size, comment content limited to 25 characters, and display post titles. Do not display comments from the author of the post.

[flexicomments number="3" size="75" author="0" limit="25" title="1" date="0"]

Demo 3

Use shortcodes to display 4 comments, without avatars, comment content limited to 50 characters, comment dates, and without displaying post titles. Include comments from the author of the post.

[flexicomments number="4" avatar="0" author="1" limit="50" title="0"]
  • Jumat, 07 November 2025
    07 November 2025. Tanggal hari ini, ponakan..…
  • Rabu, 24 September 2025
    Catatan ini memang sekadar gambaran kecil tentang…
  • Rabu, 24 September 2025
    hmm menarik. menurutku data penduduk gender masih…
  • Selasa, 23 September 2025
    Siap, Ketua. Tetap cemungud. Semoga apa yang…

Changelog

PHP 8.0+ compatibility fix for magic methods. Recommended update to eliminate PHP warnings on modern servers.

  • PHP 8.0+ COMPATIBILITY FIX: Changed magic methods `__clone()` and `__wakeup()` visibility from `private` to `public` to comply with PHP 8.0+ requirements.
  • CODE QUALITY: Added proper error messages using `_doing_it_wrong()` for singleton pattern violations.
  • CODE QUALITY: Added method documentation for magic methods with proper `@return` tags.

Minor bug fix for UTF-8 character encoding in separator. Recommended update for proper character display.

  • BUG FIX: Fixed UTF-8 encoding for bullet separator character (•) in meta section.
  • CODE QUALITY: Ensured consistent UTF-8 character encoding throughout the plugin.
  • VERIFICATION: Confirmed that post titles are properly linked to their respective post URLs.

CSS fix to prevent bullet points on certain themes. Recommended update if you see unwanted bullets.

  • CRITICAL CSS FIX: Added explicit `::marker` pseudo-element removal to prevent disc bullets on certain themes.
  • CSS: Added `list-style-position: outside` to list items for additional bullet prevention.
  • CSS: Enhanced specificity for `::marker` with multiple fallback properties (content, display, font-size, color).

IMPORTANT UPDATE: This version fixes critical N+1 query performance issues, UTF-8 encoding bugs, and adds automatic cache invalidation. Highly recommended update for all users.

  • CRITICAL BUG FIX : Fixed UTF-8 ellipsis character encoding issue (was displaying as …).
  • CRITICAL PERFORMANCE FIX : Eliminated N+1 queries by implementing batch post loading with `get_posts_batch()`.
  • PERFORMANCE : Added automatic cache invalidation on comment actions (post, edit, delete, status change).
  • PERFORMANCE : Disabled unnecessary meta and post caching in comment queries with `update_comment_meta_cache` and `update_comment_post_cache`.
  • PERFORMANCE : Added proper cache key normalization to prevent duplicate cached entries.
  • PERFORMANCE : Cache constants for better maintainability.
  • SECURITY : Enhanced XSS protection by using `strip_tags()` instead of `wp_kses()` for comment content.
  • SECURITY : Added URL validation for comment links to prevent javascript: URLs.
  • SECURITY : Added `rel=”nofollow noopener”` to all external links.
  • SECURITY : Added integer casting for author IDs to prevent type juggling issues.
  • CODE QUALITY : Added `loading=”lazy”` attribute to avatars for better page performance.
  • CODE QUALITY : Improved comment truncation to remove incomplete words at the end.
  • CODE QUALITY : Added proper translators comment for sprintf placeholders.
  • CODE QUALITY : Using `get_option(‘date_format’)` for consistent date formatting.
  • CODE QUALITY : Added method documentation with proper type hints.
  • CODE QUALITY : Added minimum value validation (e.g., avatar size minimum 20px).
  • CODE QUALITY : Added semantic CSS classes for better styling control.
  • CODE QUALITY : Replaced custom SQL with WordPress query builder where possible.
  • CSS : Increased CSS specificity to prevent theme overrides on list styling.
  • CSS : Added explicit removal of pseudo-elements (::before, ::after) that themes might inject.
  • CSS : Added styles for new semantic classes (flexicomments_item, flexicomments_date, flexicomments_post_title, flexicomments_separator).
  • CSS : Enhanced focus states for keyboard navigation accessibility (outline styling).
  • CSS : Added smooth transitions for hover/focus effects (0.2s ease).
  • CSS : Improved responsive layout with flexbox gap property.
  • CSS : Added empty state styling for “No comments found” message.
  • CSS : Added print media query for printer-friendly output.
  • CSS : Added `user-select: none` for separator character.
  • BUGFIX : Fixed potential issue with invalid comment links falling back to post permalink.

Bug fixes for avatar display and function parameters.

  • Fixed avatar display for guest comments.
  • Improved parameter handling in WordPress functions.

IMPORTANT UPDATE: This version fixes critical deprecated function usage and adds comprehensive security and performance improvements. Update immediately.

  • CRITICAL BUG FIX : Fixed deprecated `get_users()` parameter `’who’ => ‘authors’` replaced with `’capability’`.
  • BUG FIX : Fixed incorrect parameter usage in `get_comment_author()` and `get_comment_date()`.
  • SECURITY : Added comprehensive escaping for all outputs using `esc_html()`, `esc_url()`, `wp_kses_post()`.
  • SECURITY : Added post existence validation before rendering comments.
  • PERFORMANCE : Implemented Singleton pattern to prevent multiple instances.
  • PERFORMANCE : Added object caching with `wp_cache_*` for shortcode output (5 min cache).
  • PERFORMANCE : Added object caching for comment queries (10 min cache).
  • PERFORMANCE : Added static caching for author IDs to reduce function calls.
  • PERFORMANCE : Added `’no_found_rows’ => true` to comment query for speed.
  • PERFORMANCE : Implemented output buffering for efficient string building.
  • CODE QUALITY : Refactored into smaller, focused methods with proper visibility.
  • CODE QUALITY : Added method documentation and type hints.
  • CODE QUALITY : Added input validation with maximum value limits.
  • CSS : Added responsive design for mobile devices.
  • CSS : Added `box-sizing` and `overflow-wrap` for better layout stability.

Improved security and performance:

  • Changes to the implementation of get_post_authors_ids() with a version that uses get_users() and transient caching.
  • Renaming the get_post_authors_ids() function to frc_get_post_authors_ids() and updating its call.
  • Moving CSS registration to the wp_enqueue_scripts hook using wp_register_style().

Improved security, sanitation, caching, and best practices.

Download Flexi Recent Comments

  • 🔌Plugin NameFlexi Recent Comments
  • 📇Version1.5.2.3
  • 📥File Size14.70 KB
  • 📅Release Date14-11-2025

Tinggalkan sebuah Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

Gulir Ke Atas