Fattami Reading Time

外掛說明

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 (supports id and label attributes).
  • 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.

安裝方式

  1. Upload the fattami-reading-time folder to the /wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the “Plugins” screen in WordPress.
  3. Go to Settings > Reading Time to choose the reading speed, the badge position and the post types.

常見問題集

How is the reading time calculated?

The plugin counts the words of the post content (after removing HTML and shortcodes) and divides the result by the reading speed set in the options (200 words per minute by default). The result is rounded up, with a minimum of 1 minute.

Can I show the badge somewhere else than before or after the content?

Yes. Set the position to “Do not insert automatically” and use the [fattami_reading_time] shortcode wherever you like, for example in a template or a Shortcode block. You can target another post with [fattami_reading_time id="123"] and change the text with [fattami_reading_time label="Read in:"].

Does it work with languages other than English?

Yes. The word counting is Unicode-aware and handles accented characters, Arabic, Cyrillic and CJK scripts. All strings displayed by the plugin are translatable.

Does it slow down my site?

No. The count is done in PHP when the page is rendered, no database table is created and the stylesheet is only loaded when a badge is actually displayed.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Fattami Reading Time〉的開發相關工作。

參與者

將〈Fattami Reading Time〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.0

  • Initial release.