{"id":15292278,"url":"https://github.com/digitoimistodude/dude-most-read-posts","last_synced_at":"2025-04-13T11:11:13.150Z","repository":{"id":56968974,"uuid":"67485940","full_name":"digitoimistodude/dude-most-read-posts","owner":"digitoimistodude","description":"A developer-friendly plugin to count post reads and list most read content","archived":false,"fork":false,"pushed_at":"2021-02-02T16:03:34.000Z","size":36,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T02:21:30.373Z","etag":null,"topics":["wordpress","wordpress-development","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitoimistodude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-06T07:49:41.000Z","updated_at":"2024-11-15T05:23:11.000Z","dependencies_parsed_at":"2022-08-21T10:20:35.798Z","dependency_job_id":null,"html_url":"https://github.com/digitoimistodude/dude-most-read-posts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fdude-most-read-posts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fdude-most-read-posts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fdude-most-read-posts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fdude-most-read-posts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitoimistodude","download_url":"https://codeload.github.com/digitoimistodude/dude-most-read-posts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351394,"owners_count":21089272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-development","wordpress-plugin"],"created_at":"2024-09-30T16:17:14.911Z","updated_at":"2025-04-13T11:11:13.131Z","avatar_url":"https://github.com/digitoimistodude.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Most read posts\n\n_A developer-friendly plugin to count post reads and list most read content_\n\nPlugin 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.\n\nOnly 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).\n\nHandcrafted with love at [Digitoimisto Dude Oy](https://www.dude.fi), a Finnish boutique digital agency in the center of Jyväskylä.\n\n## Table of contents\n\n1. [Please note before using](#please-note-before-using)\n2. [License](#license)\n3. [Usage](#usage)\n   1. [Parameters](#parameters)\n4. [Filters](#filters)\n5. [Composer](#composer)\n6. [Contributing](#contributing)\n\n### Please note before using\n\nThis 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.\n\n### License\n\nMost read posts is released under the GNU GPL 2 or later.\n\n### Usage\n\nThis plugin does not have settings page or provide anything visible on front-end. Settings can be changed with [filters](#filters) listed below.\n\n**Plugin introduces two new [functions](#functions) to get most read posts.**\n\n`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).\n\n`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).\n\n#### Parameters\n\nBoth functions accepts three basic parameters.\n\n`$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.\n\n`$custom_start` _(string) (optional)_ If period is custom, tell from where to start counting.\n\n`$custom_end` _(string) (optional)_ If period is custom, tell from where to end counting.\n\n`$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.\n\n`$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.\n\n### Filters\n\nPlugin functionality can be changed with hooks.\n\n`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).\n\n`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.\n\n`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`.\n\n### Composer\n\nTo 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.\n\n### Contributing\n\nIf 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitoimistodude%2Fdude-most-read-posts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitoimistodude%2Fdude-most-read-posts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitoimistodude%2Fdude-most-read-posts/lists"}