Description
You’ve put years into your site. Tivy Site Stats turns all that effort into numbers your visitors will notice: “Words: 359,226” fades into “Photos: 14,232” fades into “Years blogging: 17”.
Statistics
- Words: across all your published posts, counted properly (no HTML, block markup or shortcodes), with accented characters handled correctly
- Posts, photos, videos and approved comments
- Years blogging and Blogging since, worked out from your first post
- Reading time: how long it would take to read everything you’ve written (“26 hours”, “3.5 days”)
- Terms in any taxonomy, such as categories, tags or your own (Countries visited: 47, Recipes: 212, Books reviewed: 96)
Four ways to show them
- Rotating ticker: one figure at a time, fading smoothly. Made for headers and menu bars.
- Inline list: everything on one line: Words: 359,226 | Posts: 639 | Photos: 14,232
- Grid: big-number cards that count up from zero when scrolled into view. A ready-made stats page.
- Single figure: one number inside a sentence: “I’ve written [tivy_stat type=”words”] words so far.”
Built to be fast and friendly
- Figures are cached and refreshed in the background when you publish, edit, delete, upload or approve a comment, so visitors never wait for a recount
- Use it with shortcodes, the Site Stats block or PHP template tags
- Font size, label size, label style, labels, link, rotation speed, number format (359,226 or 359K), columns and reading speed are all configurable, globally or per use
- Choose which post types count
- Accessible: screen readers get the full text, the ticker pauses on hover and focus, and visitors who prefer reduced motion see a static list
- No jQuery, no external requests, no tracking, no cookies
Usage
Statistic keys
words, `posts`, `photos`, `videos`, `comments`, `years`, `since`, `reading`, and `terms:{taxonomy}` (e.g. `terms:category`, `terms:post_tag`).
Ticker, inline list or grid
[tivy_site_stats]
[tivy_site_stats mode="inline"]
[tivy_site_stats mode="grid" columns="4" items="years,words,reading,photos"]
Attributes (all optional, defaults come from Settings Site Stats):
items: comma list of keys, in the order you want themmode:ticker(default),inlineorgridlink: URL to link to, ornone(ticker and inline)interval: seconds per item (ticker)columns: 1–6 (grid; automatic if omitted)countup:noto turn off the grid’s count-up animationfont_size: e.g.16px,1remlabel_size: e.g.0.75em,1emlabel_case:uppercaseornonelabel_position:before,after,aboveorbelowformat:fullorshortlabel:yesornoseparator: separator for inline modecolor: hex colour, e.g.#ffffffclass: extra CSS classes
Single figure
[tivy_stat type="words"]
[tivy_stat type="terms" taxonomy="country" label="yes"]
type: any key above, ortermswithtaxonomyformat:full,shortorraw(raw = bare number, no markup)label:yesto include the label (defaultno)label_position:before,after,aboveorbelowcountup:yesto animate- plus
link,font_size,label_size,color,class
Template tags
<?php tivy_ss_stat( 'reading' ); ?>
<?php $words = tivy_ss_get_stat( 'words' ); ?>
Blocks
This plugin provides 1 block.
- Site Stats Words, posts, photos, years blogging, reading time and more – as a rotating ticker, inline list, count-up grid or single figure.
Installation
- Install and activate the plugin.
- Go to Settings Site Stats to choose your statistics, labels and look.
- Add the Site Stats block, or a shortcode such as
[tivy_site_stats], wherever you want the figures to appear.
FAQ
-
How are words counted?
-
Published content of the selected post types is stripped of HTML, block markup and shortcodes, then runs of letters and digits are counted. Hyphenated words and words with apostrophes count as one. Languages written without spaces between words (such as Chinese or Japanese) are not counted accurately.
-
How is reading time worked out?
-
Total words divided by a reading speed of 230 words per minute. You can change the speed in the settings. It’s shown in minutes, hours or days, whichever reads best.
-
What counts as a photo or video?
-
Every image or video in the Media Library. WordPress’s resized copies aren’t counted separately.
-
Which terms are counted?
-
Only terms used by at least one published post, so empty categories don’t inflate the figure.
-
My figures haven’t updated
-
Updates run in the background via WP-Cron about 30 seconds after a change. If your site has WP-Cron disabled without a real cron job, use Settings Site Stats Recalculate now.
-
Set Font size to match your menu (or leave it empty to inherit) and Label size to
1emif you want labels the same size as the numbers. -
Can developers change things?
-
Yes. Filters:
tivy_ss_stats(all cached figures),tivy_ss_count_text(words in one piece of content),tivy_ss_photo_count,tivy_ss_label. Every output element has ativy-ss__class for styling.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Tivy Site Stats” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Tivy Site Stats” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.2.1
- Settings: each statistic now shows its shortcode key.
- Settings: a live shortcode builder with a Copy button, updated as you tick statistics.
1.2.0
- New: label position – before, after, above or below the number, with separate defaults for the grid.
- Grid cards no longer rely on flexbox, so themes can’t squash the number and label together.
- A space now always separates a number and its label when side by side.
1.1.2
- Database queries simplified to one fully prepared query per post type.
- Shorter readme summary.
1.1.1
- Settings: taxonomies now show their slug and content type, so two with the same name (e.g. two “Tags”) can be told apart.
1.1.0
- New statistics: videos, comments, years blogging, blogging since, total reading time and terms in any taxonomy.
- New grid display with count-up animation.
- Custom labels for taxonomy counts and a configurable reading speed.
1.0.0
- Initial release.