PHPackages                             digitoimistodude/dude-most-read-posts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. digitoimistodude/dude-most-read-posts

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

digitoimistodude/dude-most-read-posts
=====================================

A developer-friendly plugin to count most read posts

2.2.2(5y ago)162.4k↓50%1MITPHP

Since Nov 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/digitoimistodude/dude-most-read-posts)[ Packagist](https://packagist.org/packages/digitoimistodude/dude-most-read-posts)[ Docs](https://github.com/digitoimistodude/dude-most-read-posts)[ RSS](/packages/digitoimistodude-dude-most-read-posts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Most read posts
===============

[](#most-read-posts)

*A developer-friendly plugin to count post reads and list most read content*

Plugin adds small *(332 bytes)* javascript file, which calls the counter, to every singular post and introduces two new [functions](#functions) to get most read posts. Once plugin is activated, it starts to count the times post has been read.

Only all time most read posts will be counted by default and reads made by logged-in user or more than once per hour by same user in same post will be ignored. These defaults can be changed using [filters](#filters).

Handcrafted with love at [Digitoimisto Dude Oy](https://www.dude.fi), a Finnish boutique digital agency in the center of Jyväskylä.

Table of contents
-----------------

[](#table-of-contents)

1. [Please note before using](#please-note-before-using)
2. [License](#license)
3. [Usage](#usage)
    1. [Parameters](#parameters)
4. [Filters](#filters)
5. [Composer](#composer)
6. [Contributing](#contributing)

### Please note before using

[](#please-note-before-using)

This plugin is not meant to be "plugin for everyone", it needs at least some basic knowledge about php. Plugin is in development for now, so it may update very often and things might change.

### License

[](#license)

Most read posts is released under the GNU GPL 2 or later.

### Usage

[](#usage)

This plugin does not have settings page or provide anything visible on front-end. Settings can be changed with [filters](#filters) listed below.

**Plugin introduces two new [functions](#functions) to get most read posts.**

`get_most_popular_posts( $period, $query_args, $custom_start, $custom_end )` returns default WP\_Query object containing five posts, and can be used same way as normal `new WP_Query` excluding [parameters](#parameters). Behaviour can be altered with [parameters](#parameters).

`get_most_popular_posts_ids( $period, $only_ids, $custom_start, $custom_end )` returns array containing ids of five posts, behaviour can be altered with [parameters](#parameters).

#### Parameters

[](#parameters)

Both functions accepts three basic parameters.

`$period` *(string) (optional)* Which period of most read posts to receive. Possible values are year, month, week and custom. Default value is null, which equals to all-time. If period is custom, provide start and end date to period.

`$custom_start` *(string) (optional)* If period is custom, tell from where to start counting.

`$custom_end` *(string) (optional)* If period is custom, tell from where to end counting.

`$query_args` *(array) (optional)* Can be passed as a second arg for `get_most_popular_posts` function. Array is merged to arguments set by plugin and forwarded to WP\_Query. With this you can set post type or result count with `post_per_page` for example. Default value is empty array.

`$only_ids` *(boolean) (optional)* Can be passed as a second arg for `get_most_popular_posts_ids` function. Tell if you want to get the read counts also. If true post ids will be alues, if false post ids will be keys and read count is value for those. Default value is true.

### Filters

[](#filters)

Plugin functionality can be changed with hooks.

`dmrp_dont_count_logged_in_users` when set to false, count also reads made by logged-in users. It's recommended to use [`__return_false`](https://codex.wordpress.org/Function_Reference/_return_false).

`dmrp_count_for_post_types` by default reads are counted only for posts. Change it by passing array of wanted post types for this filter.

`dmrp_cookie_timeout` by default reads more than once per hour by same user in same post will be ignored. Change the time by passing wanted cookie timeout in milliseconds or disable this functionality by passing `0`.

### Composer

[](#composer)

To use this plugin with composer, run command `composer require digitoimistodude/dude-most-read-posts` in your project directory or add `"digitoimistodude/dude-most-read-posts":"dev-master"` to your composer.json require.

### Contributing

[](#contributing)

If you have ideas about the plugin or spot an issue, please let us know. Before contributing ideas or reporting an issue about "missing" features or things regarding to the nature of that matter, please read [Please note section](#please-note-before-using). Thank you very much.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Total

2

Last Release

1924d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac8f1091787825c059e30ad39ca1f58453f45c5ae0c585ba3be00904d045b8b2?d=identicon)[ronilaukkarinen](/maintainers/ronilaukkarinen)

---

Top Contributors

[![timiwahalahti](https://avatars.githubusercontent.com/u/415544?v=4)](https://github.com/timiwahalahti "timiwahalahti (23 commits)")[![meszarosrob](https://avatars.githubusercontent.com/u/6097856?v=4)](https://github.com/meszarosrob "meszarosrob (1 commits)")

---

Tags

wordpresswordpress-developmentwordpress-pluginpluginwordpress

### Embed Badge

![Health badge](/badges/digitoimistodude-dude-most-read-posts/health.svg)

```
[![Health](https://phpackages.com/badges/digitoimistodude-dude-most-read-posts/health.svg)](https://phpackages.com/packages/digitoimistodude-dude-most-read-posts)
```

###  Alternatives

[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)[appsero/client

Appsero Client

25431.7k9](/packages/appsero-client)[boxybird/inertia-wordpress

The WordPress adapter for Inertia.js

1827.4k](/packages/boxybird-inertia-wordpress)[iceicetimmy/acf-post-type-selector

Post type selector for Advanced Custom Fields.

559.0k](/packages/iceicetimmy-acf-post-type-selector)[alexis-magina/cmb2-field-post-search-ajax

CMB2 field type to attach posts to each others. Search with Ajax.

3913.4k1](/packages/alexis-magina-cmb2-field-post-search-ajax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
