Estimated Read Time

Plugin Description

The Estimated Read Time plugin for ClassicPress allows you to display expected reading times on your articles and summaries. The average person reads at 200 words per minute, so, that’s the default setting. You can change it with a simple filter to suit your own audience and content.

This plugin is multisite compatible; each site will need settings to be configured in the admin dashboard.

Installation

  • Download the latest release of the plugin from GitHub.
  • Upload the entire zip file using the Plugins upload function in your ClassicPress admin panel.
  • Activate the plugin.

To provide the most versatile placement options, the estimated read time display is implemented with a shortcode that is designed to be placed in your theme template files. It may require some experimenting to find just the right templates for your particular theme, but you can try the content.php, single.php, archive.php, and page.php templates as a starting point.

Note that the shortcode is designed to work in templates that are in the loop, so you won’t be able to place the shortcode in, say, your header.php or footer.php files. See the examples below and place one or the other into your theme’s template file(s) where you would like the estimated read time to be displayed.

Example 1: Minimal template shortcode

<?php echo do_shortcode('[estimated-read-time words="'.str_word_count(strip_tags($post->post_content)).'"]'); ?>

Example 2: Template shortcode with dashicon

<?php echo do_shortcode('[estimated-read-time words="'.str_word_count(strip_tags($post->post_content)).'"]'); ?>

There is only a single setting, you can use this filter in a functionality plugin or functions.php file:
`
<?php

// Define reading speed of your audience. 200 WPM is average; adjust to suit.
add_filter('codepotent_estimated_read_time_speed', 'codepotent_estimated_read_time_speed');
function codepotent_estimated_read_time_speed($reading_speed) {
	return 125;
}

`

If you are using a theme that is a parent theme (as opposed to a child theme) you will need to be cautious about updating your theme because the update will overwrite all the theme files. To avoid this, you have several options, as follows. Options are listed in the order of preference.

  1. use a child theme and add your shortcodes to your child theme’s templates, or
  2. use a theme that you built yourself to avoid surprise updates, or
  3. carefully copy your shortcodes out of your theme files before updating, then replacing them afterward, or
  4. continue using the parent theme, but don’t update it.

Frequently Asked Questions

Can I translate this plugin?

Yes, the .pot file is in the plugins languages folder and can also be downloaded from the plugin page on https://development.azurecurve.co.uk; if you do translate this plugin, please sent the .po and .mo files to [email protected] for inclusion in the next version (full credit will be given).

Is this plugin compatible with both WordPress and ClassicPress?

This plugin is developed for ClassicPress, but will likely work on WordPress.

Changelog

Version 1.0.0

2022-02-04

  • Change plugin text domain.
  • Add azurecurve menu.
  • Add plugin action link.
  • Add options page.
  • Add option to set estimated read time (filter remains available for use ad will override the option).
  • Update readme file for compatibility with ClassicPress Directory.

Version 0.2.1

JUN-04-2021

  1. Fix missing constants

Version 0.2.0

JUN-03-2021

  1. Update plugin directory and slug name
  2. Update README.md
  3. Update footer credits
  4. Update plugin header details
  5. Add UpdateClient.class.php v 2.1.0
  6. Add constants.php file
  7. Add adoption notice
  8. Remove public-facing Code Potent links
  9. Replace Code Potent graphics with new vendor graphics

Other Notes

azurecurve was one of the first plugin developers to start developing for ClassicPress; all plugins are available from azurecurve Development and are integrated with the Update Manager plugin for fully integrated, no hassle, updates.

Some of the top plugins available from azurecurve are: