word Count Plugin
A lightweight WordPress plugin that displays word count, character count, and estimated reading time with configurable admin settings and Persian translation support.
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/atta3554/wp-word-count-plugin/archive/refs/heads/main.zipReadme
Word Count Plugin
A lightweight WordPress plugin that displays useful post statistics, including word count, character count, and estimated reading time.
This project demonstrates the use of WordPress hooks, the Settings API, plugin internationalization, input sanitization, and configurable frontend output.
Features
- Displays the number of words in a blog post
- Displays the number of characters in a blog post
- Estimates reading time based on an average reading speed of 225 words per minute
- Lets administrators enable or disable each statistic
- Supports a custom statistics heading
- Allows the statistics box to appear before or after post content
- Uses the WordPress Settings API
- Includes Persian translation files
- Loads translations through the WordPress internationalization system
Installation
-
Download or clone this repository.
-
Copy the plugin folder to:
wp-content/plugins/word-count-plugin -
Log in to the WordPress admin dashboard.
-
Go to Plugins and activate Word Count Plugin.
-
Open Settings → Word Count to configure the plugin.
Configuration
The settings page allows administrators to:
- Change the statistics heading
- Enable or disable word count
- Enable or disable character count
- Enable or disable estimated reading time
- Display statistics at the beginning or end of a post
Example Output
Post Statistics
This post has 640 words.
This post has 3,721 characters.
This post takes 3 minutes to read.
Project Structure
wordCount/
├── ata-first-plugin.php
├── languages/
│ ├── wcpdomain-fa_IR.mo
│ ├── wcpdomain-fa_IR.po
│ └── wcpdomain.pot
└── README.md
WordPress Concepts Demonstrated
- Plugin headers
- Actions and filters
- WordPress Settings API
- Admin settings pages
- Option registration and sanitization
- Content filtering with
the_content - Conditional frontend output
- Internationalization and localization
- Translation files using PO, MO, and POT formats
- Object-oriented plugin structure
Notes
This is a small educational WordPress plugin created as a portfolio project. The reading-time estimate uses an average speed of 225 words per minute.
License
This project is available for educational and portfolio purposes.