WP Manifestindependent plugin directory
manifest / analytics / wp-most-popular-custom

WP Most Popular Custom

This Plugin based on WP Most Popular by Matt Geri

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/sectsect/wp-most-popular-custom/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This Plugin based on WP Most Popular by Matt Geri

Installation

1. Clone this Repo into your wp-content/plugins directory.
$ cd /path-to-your/wp-content/plugins/
$ git clone git@github.com:sectsect/wp-most-popular-custom.git
2. Activate the plugin through the 'Plugins' menu in WordPress.

:memo: NOTE: If you are a on a multi-site, you must be activated on the child-site.
You can access the some setting by going to Settings -> WP Most Popular Custom.

Added Feature

  • Settings page
  • button to delete all count data
  • Setting for exclude the login user access (optional)
  • Setting for exclude access to the split single page (optional)
  • Add the Date range biweekly (2w)
    • All time
    • monthly (1month)
    • biweekly (2weeks)
    • weekly (1week)
    • daily (1day)

Usage Example

<ul>
  <?php if ( class_exists( 'WMP_system' ) ): ?>
  <?php
  $wmpposts = wmp_get_popular( array(
    'limit'     => 5,
    'post_type' => array('post'),
    'range'     => get_option('wmp_range')
  ));
  $i = 1;
  if ( count( $wmpposts ) > 0 ): foreach ( $wmpposts as $post ): setup_postdata( $post );
  ?>
    <li id="rank-<?php echo sprintf( "%02d", $i ); ?>">
      <a href="<?php the_permalink(); ?>">
        <?php the_title(); ?>
      </a>
    </li>
    <?php $i++; ?>
    <?php endforeach; endif; wp_reset_postdata(); ?>
  <?php endif; ?>
</ul>

Translations

  • Japanese (ja)