Tivy Site Stats

By tivy

0+ active installationsVersion 1.2.1

Show your total words, posts, photos, years blogging and reading time as a rotating ticker, count-up cards or a single figure.

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 them
  • mode: ticker (default), inline or grid
  • link: URL to link to, or none (ticker and inline)
  • interval: seconds per item (ticker)
  • columns: 1–6 (grid; automatic if omitted)
  • countup: no to turn off the grid’s count-up animation
  • font_size: e.g. 16px, 1rem
  • label_size: e.g. 0.75em, 1em
  • label_case: uppercase or none
  • label_position: before, after, above or below
  • format: full or short
  • label: yes or no
  • separator: separator for inline mode
  • color: hex colour, e.g. #ffffff
  • class: extra CSS classes

Single figure

[tivy_stat type="words"]
[tivy_stat type="terms" taxonomy="country" label="yes"]
  • type: any key above, or terms with taxonomy
  • format: full, short or raw (raw = bare number, no markup)
  • label: yes to include the label (default no)
  • label_position: before, after, above or below
  • countup: yes to animate
  • plus link, font_size, label_size, color, class

Template tags

<?php tivy_ss_stat( 'reading' ); ?>
<?php $words = tivy_ss_get_stat( 'words' ); ?>

Installation

  1. Install and activate the plugin.
  2. Go to Settings → Site Stats to choose your statistics, labels and look.
  3. 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.

The ticker doesn’t line up with my menu

Set Font size to match your menu (or leave it empty to inherit) and Label size to 1em if 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 a tivy-ss__ class for styling.

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.