Download the PHP package digitoimistodude/dude-most-read-posts without Composer

On this page you can find all versions of the php package digitoimistodude/dude-most-read-posts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dude-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 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.

Handcrafted with love at Digitoimisto Dude Oy, a Finnish boutique digital agency in the center of Jyväskylä.

Table of contents

  1. Please note before using
  2. License
  3. Usage
    1. Parameters
  4. Filters
  5. Composer
  6. Contributing

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

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

Usage

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

Plugin introduces two new 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.

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

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

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.

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

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

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. Thank you very much.


All versions of dude-most-read-posts with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package digitoimistodude/dude-most-read-posts contains the following files

Loading the files please wait ....