WRT Reading Tools

Complete Documentation v1.1.3

Description Adds a bar with reading information (time, word count, views) and accessibility tools (font resizing, contrast, clean print) to WordPress content.
Version 1.1.3
Author LevelNetwork.it
Minimum Requirements WordPress 5.4+, PHP 7.4+

1. Introduction

WRT Reading Tools is a comprehensive plugin designed to enhance the reading experience and accessibility of content on your WordPress site. It adds an elegant, customizable bar above or below Posts and Pages, providing readers with useful metadata and interactive tools.

The plugin is lightweight, translation-ready, and offers extensive customization options via the administration panel, including a live color preview.

2. Key Features

2.1 Information Components

2.2 Accessibility and Utility Tools

2.3 Backend and Customization Features

3. Installation and Initial Configuration

  1. Upload the plugin folder to the /wp-content/plugins/ directory or install it via the dashboard (Plugins > Add New > Upload Plugin).
  2. Activate the plugin.
  3. Navigate to Settings > Reading Tools to access the configuration.
⚠️ IMPORTANT: The first fundamental step after activation is to correctly configure the Target Selectors (see section 4.2) so that the font resizer and print tools work correctly on your theme.

4. Usage Guide and Best Practices

The settings page is organized into logical sections.

4.1 Display Settings

4.2 Target Selectors - Crucial

4.3 Components & Options

4.4 Toolbar Buttons

4.5 Color Palette

5. Shortcodes

To ensure stability and data consistency, only one unified shortcode is supported:

6. View Statistics Metabox (Admin)

In the edit screen for Posts and Pages (sidebar), you will find the "WRT View Stats" box:

7. Technical Notes for Developers

Main Hooks and Constants

Word Count Calculation Method (DOM/XPath)

The plugin attempts to load filtered content into a DOMDocument, executes an XPath query based on the configured selector to extract clean text (excluding elements matching the Exclude Selector), and counts the words. If the selector is complex or DOM loading fails, it uses a fallback based on minimal cleaning of the full content via wp_strip_all_tags.