HK Reading Time
Lightweight WordPress plugin that adds an estimated reading time to posts (filters, i18n, no bloat).
by HK Web Production Solution · github.com/dimitrihokonmoy/hk-reading-time · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/dimitrihokonmoy/hk-reading-time/archive/refs/heads/main.zipReadme
HK Reading Time
A lightweight WordPress plugin that adds an estimated reading time to your posts — no settings screen, no database bloat, fully customizable via filters.
Un plugin WordPress léger qui ajoute un temps de lecture estimé à vos articles — sans page de réglages, sans surcharge de base de données, entièrement personnalisable via des filtres.
English
What it does
Prepends a simple X min read notice to the top of single posts. It hooks into
the_content only on the main query of single posts, so it never runs in feeds,
archives or widgets.
Installation
- Copy the
hk-reading-timefolder intowp-content/plugins/. - Activate HK Reading Time in the Plugins screen.
- Open any post — the reading time shows at the top.
Developer filters
// Change the reading speed (default: 200 words per minute).
add_filter( 'hk_reading_time_words_per_minute', fn() => 230 );
// Customize the label.
add_filter( 'hk_reading_time_label', function ( string $label, int $minutes ): string {
return sprintf( '⏱ %d min de lecture', $minutes );
}, 10, 2 );
Quality & standards
strict_types, namespaced, single-responsibility class.- WordPress Coding Standards: output escaped (
esc_html),ABSPATHguard, i18n (_n, text domain). - Multibyte-safe word counting.
- Clean
uninstall.php, no leftover data.
Français
Ce que fait le plugin
Ajoute une mention X min read en haut de vos articles. Il s'accroche à
the_content uniquement sur la requête principale des articles, donc jamais
dans les flux, archives ou widgets.
Installation
- Copiez le dossier
hk-reading-timedanswp-content/plugins/. - Activez HK Reading Time dans l'écran Extensions.
- Ouvrez un article — le temps de lecture s'affiche en haut.
Filtres pour développeurs
// Changer la vitesse de lecture (défaut : 200 mots/minute).
add_filter( 'hk_reading_time_words_per_minute', fn() => 230 );
// Personnaliser le libellé.
add_filter( 'hk_reading_time_label', function ( string $label, int $minutes ): string {
return sprintf( '⏱ %d min de lecture', $minutes );
}, 10, 2 );
Qualité & standards
strict_types, code dans un namespace, classe à responsabilité unique.- WordPress Coding Standards : sorties échappées (
esc_html), gardeABSPATH, i18n (_n, text domain). - Comptage des mots compatible multi-octets (multibyte).
uninstall.phppropre, aucune donnée résiduelle.
Author / Auteur
HK Web Production Solution — Dimitri Ho Kon Moy 📧 dimitrihokonmoy@gmail.com
License / Licence
GNU General Public License v2.0 or later — see LICENSE.txt.