=== Reading Tools: Word Count & View Counter with Accessibility Tools ===
Contributors: sonofgod80
Donate link: https://www.paypal.com/donate?hosted_button_id=5MGAYLG6QTUZG
Tags: reading time, word count, view counter, accessibility, font size resizer
Requires at least: 5.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Boost engagement with a reading progress bar, automatic reading time estimation, live word count, accurate post view counter for your WordPress site.

== Description ==

Did you know that displaying an **estimated reading time** can increase user engagement and significantly lower your bounce rate? [cite: 82] Readers love predictability. By giving them clear reading meta insights and powerful accessibility tools, you transform your standard WordPress layout into a premium, reader-friendly environment like Medium or Wikipedia. [cite: 83]

**LevelNetwork WRT Reading Tools** is the ultimate all-in-one engagement toolkit for content creators, bloggers, and magazine websites. [cite: 84] It effortlessly injects a beautiful, fully customizable utility bar into your posts or pages, combining data transparency with modern accessibility features. [cite: 85]

### Why Choose WRT Reading Tools?

* **Drive Higher Engagement:** Showing reading stats encourages visitors to stay and complete the article, boosting your site's SEO dwell time. [cite: 86]
* **Flawless Cache-Compatible View Tracking:** Unlike other broken statistics plugins, our advanced post view counter bypasses server-side caching (WP Rocket, Cloudflare, LiteSpeed) via dynamic AJAX tracking. [cite: 87]
* **A Visual Match For Any Theme:** Choose from **50 built-in professional color palettes** with a stunning live admin preview area to mirror your brand perfectly. [cite: 88]
* **100% GDPR Compliant & Lightweight:** No external tracking scripts, no heavy dependencies, no cookies storing personal data. [cite: 89] Just clean, optimized code. [cite: 90]

---

### Core Features Built for Modern Blogs

* **Dynamic Word Count & Reading Time:** Automatically calculates the exact words in your content and reveals the read time based on custom Words Per Minute (WPM) speed. [cite: 91]
* **Exclude Selectors (Anti-Bloat Tech):** Uniquely ignore injected ads, related post boxes, or author bios from your word count, print layouts, and font resizing for 100% accurate statistics. [cite: 92]
* **Granular Post/Page ID Exclusions:** Suppress the automatic display of the toolbar on specific individual pieces of content by entering their IDs directly in the display settings.
* **Advanced Post View Counter:** Track page popularity safely with nonces and custom cookie durations. [cite: 93] Features a custom 'Start Value' to reflect prior historic traffic. [cite: 94]
* **Interactive Font Size Resizer:** Empower readers with user-friendly `+` / `-` and Reset buttons. [cite: 95] Their text preference is saved seamlessly via LocalStorage. [cite: 96]
* **Instant Contrast / Night Mode Toggle:** Enhance readability in low-light environments. [cite: 96] Select your favorite access icon directly from the backend. [cite: 97]
* **Targeted Clean Print Engine:** Prints exclusively the core article body through a hidden background iframe, removing noisy sidebars, headers, and navigation menus. [cite: 97]

---

### Clean Admin Interface & Theme Compatibility

Managing your reader experience shouldn't be difficult. [cite: 98] The redesigned **two-column settings dashboard** provides blockquote explanations for every single field, alongside shortcode references and layout tips. [cite: 99]

* Fully works with custom CSS selectors (`.entry-content`, `#main`, etc.) to hook perfectly into any modern WordPress theme, block editor, or page builder. [cite: 100]
* Handled automatically: Excluded from homepages and catalog views, with a responsive utility layer to hide the bar on mobile screens if desired. [cite: 101]
* Dedicated **Shortcode** `[lnwrt_only_tools]` for flexible manual widget placement or structural sidebars. [cite: 102]

== Installation ==

1. Go to your WordPress Dashboard, navigate to **Plugins > Add New**. [cite: 103]
2. Click **Upload Plugin** and select the `levelnetwork-wrt-reading-tools.zip` file. [cite: 104]
3. Install and **Activate** the plugin. [cite: 104]
4. Navigate to **Settings > Reading Tools** to configure your core Target Selectors. [cite: 105]

== Frequently Asked Questions ==

= How do I prevent the plugin from counting or resizing ads, related posts, or author boxes? = [cite: 106]
Go to `Settings > Reading Tools > Target Selectors` and use the "Exclude Selector CSS" field. [cite: 107] Enter the CSS classes or IDs (separated by commas, e.g., `.ad-banner, .related-posts, #author-box`) of the elements you want the plugin to completely ignore. [cite: 108]

= How do I hide the toolbar on specific posts or pages? =
Go to `Settings > Reading Tools > Display Settings` and locate the "Exclude IDs" field. Enter the numeric IDs separated by commas (e.g., `12, 45, 102`). This option is automatically disabled if you set "Show On" to "Manual Placement Only".

= The Font Resizer (+/- buttons) doesn't work. = [cite: 109]
Go to `Settings > Reading Tools > Target Selectors`. [cite: 109] Ensure the "Font Resizer Target" field contains the correct CSS selector for your theme's main text container (e.g., `.entry-content`). [cite: 110]

= The Print button prints the wrong content or the whole page. = [cite: 111]
Go to `Settings > Reading Tools > Target Selectors`. Ensure the "Clean Print Target" field contains the correct CSS selector for the *specific* content block you want to print. [cite: 112]

= The bar appears in unwanted places (widgets, etc.). = [cite: 113]
Go to Appearance > Customize > Additional CSS in your WordPress dashboard to hide the bar in specific locations using standard CSS. [cite: 113] Use browser "Inspect Element" to find a unique parent selector for the unwanted area (e.g., `#sidebar .widget .lnwrt-reading-tools-bar { display: none; }`). [cite: 114]

= View Counter shows 0 or doesn't update? = [cite: 115]
1. **Enable It:** Check "View Count" under `Settings > Reading Tools > Components & Options`. [cite: 115]
2. **Clear Caches:** Crucial! Clear all caches (plugin, server, CDN, browser) and test in an Incognito window. [cite: 116]
3. **Admins Ignored:** Logged-in admins are not counted. Test logged out. [cite: 117]
4. **Cookie Expiry:** Wait for the cookie (check setting) or use Incognito. [cite: 118]
5. **Check Console:** Look for JS errors or failed AJAX requests (F12 > Console / Network). [cite: 119]

= How do I reset the View Count? = [cite: 120]
Edit the post/page, find the "WRT View Stats" metabox, click "Reset". [cite: 120] The count updates after refresh. [cite: 121]

= How does the "Start Value" for views work? = [cite: 122]
Sets the base number *before* the first view is counted. [cite: 122] Example: Start Value 100 -> first visitor makes count 101. A per-post override (set via metabox *before* first view) takes precedence. [cite: 123]

= Can I change the Reading Speed (WPM) / View Count Cookie Duration? = [cite: 124]
Yes, under `Settings > Reading Tools > Components & Options`. [cite: 125]

= Why might the Word Count/Read Time seem slightly off compared to other tools? = [cite: 126]
By default, the calculation is based on the text content after WordPress filters have run. [cite: 127] For perfect accuracy, use the "Word Count Target" and "Exclude Selector CSS" settings to define exactly which areas should and shouldn't be counted. [cite: 128]

= What shortcodes are available? = [cite: 129]
* `[lnwrt_only_tools]`: Displays only the interactive buttons (Resizer, Reset, Contrast, Print) based on enabled settings. [cite: 129] Useful for manual placement. Requires plugin assets (JS/CSS) to be loaded on the page. [cite: 130]

== Screenshots ==

1. The reading tools bar displayed on a sample post. [cite: 131]
2. Admin Settings: Display and Target Settings. [cite: 131]
3. Admin Settings: Components & Options (showing WPM, View Count options, Cookie Expiry). [cite: 132]
4. Admin Settings: Toolbar Buttons section (showing button toggles and Contrast Icon select). [cite: 133]
5. Admin Settings: Color Palette selection with Live Preview area above. [cite: 134]
6. Admin Settings: Shortcodes (Showing available ones) and Tips & Tricks sections. [cite: 135]
7. The "WRT View Stats" metabox in the post editor with Reset button. [cite: 136]

== Changelog ==

= 1.1.4 =
* Feature: Added "Exclude IDs" option to skip automatic toolbar injection on specified individual post/page IDs.
* UX: Implemented real-time jQuery toggles to natively disable and fade the "Exclude IDs" input container when "Manual Placement Only" is selected.
* Performance: Optimized frontend script handling to avoid asset loading entirely on excluded content IDs.
* Fix: Adjusted form button attributes in the administration page to prevent accidental backend form submission when interacting with the live layout preview.

= 1.1.3 =
* Feature: Added new Color Palettes, bringing the total to 50 beautifully crafted options! [cite: 137]
* Refinement: Redesigned the settings page with a professional two-column layout and a sidebar for support and resources. [cite: 138]
* Compliance/Security: Removed the Custom CSS field to comply with strict WordPress.org security guidelines (users should now use the native Appearance > Customize > Additional CSS). [cite: 139]
* Fix: Fully un-minified and formatted frontend JavaScript to meet WordPress.org human-readable source code requirements. [cite: 140]

= 1.1.2 =
* Refinement: Complete codebase refactoring (prefixes, text domain, styles updated to `lnwrt_` and `LevelNetwork`) to comply with strict WordPress.org guidelines. [cite: 141]
* Feature: Added powerful "Exclude Selector CSS" to perfectly ignore specific elements (ads, related posts) from word count, resizing, and printing. [cite: 142]
* Feature: Added Contrast Button Icon selection. [cite: 143]
* Feature: Added Live Preview for Palettes/Icons in settings. [cite: 143]
* Feature: Added specific CSS Selector setting for Word Count calculation. [cite: 144]
* Fix: Resolved AJAX, JS initialization, and PHP Deprecated errors. [cite: 144]
* Refinement: Shortcodes updated; removed unstable single-data ones, kept `[lnwrt_only_tools]`. [cite: 145]

= 1.1.1 =
* Fix: Corrected CSS variable usage for button backgrounds with dark palettes. [cite: 146]
* Fix: Ensured JS initializes correctly regardless of enabled components. [cite: 147]
* Fix: Resolved PHP warnings/notices (duplicate constants, deprecated functions). [cite: 147]
* Refinement: Centralized constant definitions. [cite: 148]

= 1.1.0 =
* Feature: Added Font Size Reset button. [cite: 148]
* Feature: Added Contrast/Night Mode toggle button. [cite: 149]
* Feature: Added Clean Print button. [cite: 149]
* Feature: Added Configurable Print Area CSS Selector setting. [cite: 150]
* Feature: Added Configurable Words Per Minute (WPM) setting. [cite: 150]
* Feature: Added Configurable Cookie Expiry setting for view counter. [cite: 151]
* Feature: Added View Count Reset button in Post Editor Metabox. [cite: 152]
* Feature: Added Global and Per-Post Start Value options for View Counter. [cite: 153]
* Update: View Counter calculation now respects start values. [cite: 154]
* Fix: Improved context checking to prevent bar display in widgets. [cite: 154]

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.4 =
Introduced granular Post and Page ID exclusions to block automatic toolbar rendering where unwanted, and corrected interactive admin preview button events.

= 1.1.3 =
Introduced 50 built-in color palettes and a redesigned, professional settings page layout! [cite: 155] To comply with WordPress.org security standards, the Custom CSS field has been removed (please use the native WP Customizer instead). [cite: 156] JavaScript files have also been reformatted for compliance. [cite: 157]

= 1.1.2 =
Major update! Full WP.org directory compliance (code refactored to lnwrt_). [cite: 157] Added CSS Exclude selectors (ignore ads/boxes), live admin previews, new contrast icons, and word count target selector. [cite: 158] Fixed AJAX and PHP bugs. Use [lnwrt_only_tools] shortcode. [cite: 159]

= 1.1.1 =
Minor fixes and refinements for styles and JS. [cite: 159]

= 1.1.0 =
Major feature update! Adds Reset/Contrast/Print buttons, advanced View Counter options, and configurable WPM/Cookie settings. [cite: 160] Note: Several shortcodes were removed in v1.1.2. Review new settings under Settings > Reading Tools. [cite: 161]

= 1.0.0 =
Initial release. [cite: 161] Configure options under Settings > Reading Tools. Ensure "Target Selectors" are set correctly.