=== Readlyte - Reading Time ===
Contributors: munizasultan
Tags: reading time, read time, blog, content, gutenberg
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically calculates and displays estimated reading time for blog posts, with a shortcode, a Gutenberg block, and an Elementor widget.

== Description ==

Readlyte estimates how long it will take a visitor to read a post, based on its word count and a configurable words-per-minute rate, and displays it as a small badge.

**Features**

* Automatic display before or after post content — no template edits required.
* `[rdlt_reading_time]` shortcode for manual placement, including `[rdlt_reading_time id="123"]` for another post.
* A "Reading Time (Readlyte)" Gutenberg block, server-rendered so it always matches your current settings.
* An Elementor widget (when Elementor is active), with per-instance overrides for words-per-minute/text/icon and full Style tab controls (color, typography, icon gap).
* Configurable words-per-minute, display text (`{time}` / `{unit}` placeholders), and which post types it applies to.
* Word count strips HTML tags, shortcodes, and block-editor comments so the estimate reflects visible text only.
* Theme-friendly: styled entirely with CSS classes and custom properties (`--rdlt-color`, `--rdlt-icon-color`, `--rdlt-font-size`, `--rdlt-gap`), so a theme can restyle the badge from its own stylesheet.
* Developer filters: `rdlt_word_count`, `rdlt_calculated_read_time`, `rdlt_read_time_text`, `rdlt_read_time_icon`.

== Installation ==

1. Upload the `readlyte-reading-time` folder to `/wp-content/plugins/`.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to Settings → Readlyte to configure words-per-minute, display text, position, and enabled post types.

== Frequently Asked Questions ==

= Can I place the read time somewhere specific in my template? =

Yes. Set "Display mode" to "Shortcode / block only" in Settings → Readlyte, then use the `[rdlt_reading_time]` shortcode or the "Reading Time (Readlyte)" block wherever you like, or call `RDLT_Display::instance()->render_badge( $post_id )` directly in a theme template.

= Does it work with Gutenberg and the Classic Editor? =

Yes. The shortcode works with both. The block requires the block editor (Gutenberg / WordPress 5.8+).

= How is word count calculated? =

HTML tags, shortcodes, and block-editor comments are stripped before counting whitespace-separated words in the visible text.

= Can I change the icon shown next to the read time? =

Yes, with the `rdlt_read_time_icon` filter. Return your own HTML (inline SVG, a `<i>` icon-font tag, or an `<img>`), or return an empty string to remove the icon entirely.

    // Swap in a Font Awesome icon.
    add_filter( 'rdlt_read_time_icon', function( $icon, $post_id ) {
        return '<i class="fa-regular fa-clock" aria-hidden="true"></i>';
    }, 10, 2 );

    // Remove the icon.
    add_filter( 'rdlt_read_time_icon', '__return_empty_string' );

The icon is sanitized with `wp_kses` (svg/path/circle/i/span/img only), so only presentational markup gets through.

== Changelog ==

= 1.0.0 =
* Initial release as Readlyte (previously submitted under the name "Read Time Calculator"; renamed at the request of the WordPress.org Plugin Review Team for name distinctiveness — all identifiers, the shortcode tag, CSS classes, and the option name were updated accordingly).
* Automatic display, `[rdlt_reading_time]` shortcode, Gutenberg block, and Elementor widget.
* Developer filters: `rdlt_word_count`, `rdlt_calculated_read_time`, `rdlt_read_time_text`, `rdlt_read_time_icon`.
