Directory / plugin
Fattami Reading Time
v1.0.0 · by Ayoub Fattami
Shows an estimated reading time badge on your posts, with Unicode-aware word counting (Arabic, French, CJK) and a simple shortcode.
About this plugin
Fattami Reading Time adds a small, elegant “Reading time: 4 minutes” badge to your posts so visitors know what to expect before they start reading.
Most reading time plugins rely on PHP’s str_word_count(), which only understands ASCII letters and therefore undercounts French accented words, and completely ignores Arabic, Cyrillic, Chinese, Japanese or Korean text. Fattami Reading Time uses Unicode-aware counting instead:
- Latin, Cyrillic, Arabic, Hebrew and similar scripts are counted word by word (accents and apostrophes included).
- Chinese, Japanese and Korean characters are counted individually.
- Shortcodes, HTML tags, scripts and styles are stripped before counting.
Features
- Automatic badge before or after the content of the post types you choose.
- Adjustable reading speed (words per minute).
- Custom label, or no label at all.
- Optional word count next to the reading time.
[fattami_reading_time]shortcode to place the badge anywhere (supportsidandlabelattributes).- Lightweight: one small stylesheet, loaded only on pages where a badge is displayed. No JavaScript, no external requests.
- Translation ready and compatible with block themes and classic themes.
- Removes its own settings when uninstalled.
Developer hooks
fattami_reading_time_word_count– filter the word count of a post.fattami_reading_time_badge_html– filter the final badge markup.