added a few Redis options, optimizations, exceptions
added a few Redis options, optimizations, exceptions

file:a/js/redis-page-views.js (deleted)
--- a/js/redis-page-views.js
+++ /dev/null
@@ -1,9 +1,1 @@
-jQuery(document).ready(function($) {
-    var data = {
-        'id': _rpv.id
-    };
-    jQuery.get(_rpv.url, data, function(response) {
-        //TODO: window.redis_page_views callbacks
-    });
-});
 

--- /dev/null
+++ b/js/redis-post-views.js
@@ -1,1 +1,9 @@
+jQuery(document).ready(function($) {
+    var data = {
+        'id': _rpv.id
+    };
+    jQuery.get(_rpv.url, data, function(response) {
+        //TODO: window.redis_post_views callbacks
+    });
+});
 

file:a/pageview.php (deleted)
--- a/pageview.php
+++ /dev/null
@@ -1,49 +1,1 @@
-<?php
-/*
-Plugin Name: Redis Page Views
-Plugin URI: http://wordpress.org/extend/plugins/redis-page-views/
-Description: Highly optimized page views using Redis
-Version: 1.1
-Author: Razvan Stanga
-Author URI: http://git.razvi.ro/
-License: http://www.apache.org/licenses/LICENSE-2.0
-Text Domain: redis-page-views
-Network: true
 
-Copyright 2017: Razvan Stanga (email: redis-page-views@razvi.ro)
-*/
-
-include('redis-page-views.php');
-
-class Redis_Page_View extends Redis_Page_Views {
-
-    public function __construct()
-    {
-        parent::__construct();
-
-        $this->page_view();
-    }
-
-    public function page_view()
-    {
-        if (!isset($_GET['id'])) {
-            return 'Invalid ID';
-        }
-        $post_id = intval($_GET['id']);
-
-        $this->connect_redis();
-        $views = $this->redis->get("post-" . $post_id);
-
-        if ($views != null) {
-            $this->redis->incr("post-" . $post_id);
-        } else {
-            $this->redis->set("post-" . $post_id, 1);
-        }
-        $this->redis->sAdd("posts", $post_id);
-
-        echo $views++;
-    }
-}
-
-$redisPageView = new Redis_Page_View();
-

file:b/post-view.php (new)
--- /dev/null
+++ b/post-view.php
@@ -1,1 +1,110 @@
+<?php
+/*
+Plugin Name: Redis Post Views
+Plugin URI: http://wordpress.org/extend/plugins/redis-post-views/
+Description: Highly optimized post views using Redis
+Version: 1.1
+Author: Razvan Stanga
+Author URI: http://git.razvi.ro/
+License: http://www.apache.org/licenses/LICENSE-2.0
+Text Domain: redis-post-views
+Network: true
 
+Copyright 2017: Razvan Stanga (email: redis-post-views@razvi.ro)
+*/
+
+include("redis-post-views.php");
+
+class Redis_Post_View extends Redis_Post_Views {
+
+    public function __construct()
+    {
+        parent::__construct();
+
+        $this->post_view();
+    }
+
+    /**
+     * TODO: Exclude bots
+     *
+     * @return bool
+     */
+    public function exclude_bots()
+    {
+        if (defined("RPV_EXCLUDE_BOTS") && RPV_EXCLUDE_BOTS == true) {
+            $bots = array(
+                'Google Bot' => 'google'
+                ,'MSN' => 'msnbot'
+                ,'Alex' => 'ia_archiver'
+                ,'Lycos' => 'lycos'
+                ,'Ask Jeeves' => 'jeeves'
+                ,'Altavista' => 'scooter'
+                ,'AllTheWeb' => 'fast-webcrawler'
+                ,'Inktomi' => 'slurp@inktomi'
+                ,'Turnitin.com' => 'turnitinbot'
+                ,'Technorati' => 'technorati'
+                ,'Yahoo' => 'yahoo'
+                ,'Findexa' => 'findexa'
+                ,'NextLinks' => 'findlinks'
+                ,'Gais' => 'gaisbo'
+                ,'WiseNut' => 'zyborg'
+                ,'WhoisSource' => 'surveybot'
+                ,'Bloglines' => 'bloglines'
+                ,'BlogSearch' => 'blogsearch'
+                ,'PubSub' => 'pubsub'
+                ,'Syndic8' => 'syndic8'
+                ,'RadioUserland' => 'userland'
+                ,'Gigabot' => 'gigabot'
+                ,'Become.com' => 'become.com'
+                ,'Baidu' => 'baiduspider'
+                ,'so.com' => '360spider'
+                ,'Sogou' => 'spider'
+                ,'soso.com' => 'sosospider'
+                ,'Yandex' => 'yandex'
+            );
+            $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
+            foreach ($bots as $name => $lookfor) {
+                if (!empty($useragent) && (false !== stripos($useragent, $lookfor))) {
+                    return true;
+                    break;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Increment post view count
+     *
+     * @return void
+     */
+    public function post_view()
+    {
+        if (!isset($_GET['id'])) {
+            echo 'Invalid ID';
+            return;
+        }
+        if ($this->exclude_bots()) {
+            echo 'Bot detected';
+            return;
+        }
+        $post_id = intval($_GET['id']);
+
+        if ($this->redis_connect()) {
+            $views = $this->redis->get("post-" . $post_id);
+
+            if ($views != null) {
+                $this->redis->incr("post-" . $post_id);
+            } else {
+                $this->redis->set("post-" . $post_id, 1);
+            }
+            $this->redis->sAdd("posts", $post_id);
+            if (defined("RPV_AJAX_RETURN_VIEWS") && RPV_AJAX_RETURN_VIEWS == true) {
+                echo $views++;
+            }
+        }
+    }
+}
+
+$redisPostView = new Redis_Post_View();
+

file:a/readme.txt -> file:b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -1,31 +1,52 @@
-=== Redis Page Views ===
+=== Redis Post Views ===
 Donate link: https://www.paypal.me/razvanstanga
 Contributors: razvanstanga
-Tags: pageview, redis, cache, caching, optimization, performance, traffic
+Tags: postviews, redis, cache, caching, optimization, performance, traffic
 Requires at least: 4.5
-Tested up to: 4.7
-Stable tag: 1.0
+Tested up to: 4.9
+Requires PHP: 5.2.4
+Stable tag: 1.1
 License: GPLv2 or later
 
-Highly optimized page views using Redis
+Highly optimized post views using Redis
 
 == Description ==
 
+This plugin was born out of necessity. Imagine a high traffic website that needs post views as an algorithm to display posts on the homepage.
+This website also uses <a href="https://wordpress.org/plugins/vcaching/" target="_blank">Varnish Caching</a>. So we need an AJAX based post view counter.
+Now imagine a minimum 5000 concurrent users browsing the website, so we can't use the default "AJAX in Plugins" as live updates on the backend
+using update_post_meta will be very painful for the backend.
+
+So what can we do ?
+
+What if all these increments will be done in memory using Redis ?
+Then we run a cornjob using WP-CLI to sync the post views count in Redis to the Wordpress database.
+
+Redis Post Views is born.
 
 == Installation ==
 
+* You must install Redis on your server(s)
 
 == Frequently Asked Questions ==
 
-= Question? =
+= How can I display the post views in a template? =
 
-answer
+You can do this with get_post_meta(get_the_ID(), RPV_POST_META_KEY, true); php function
 
 == Changelog ==
 
+= 1.1 =
+* added wp-admin backend including stats
+* added posibility to override settings in wp-config.php
+
 = 1.0 =
-* text
+* in production testing done
 
 == Screenshots ==
 
 1. Settings admin panel
+2. Stats admin panel
+3. Posts queue admin panel
+4. Configuration info admin panel
+

file:a/redis-page-views.php (deleted)
--- a/redis-page-views.php
+++ /dev/null
@@ -1,168 +1,1 @@
-<?php
-/*
-Plugin Name: Redis Page Views
-Plugin URI: http://wordpress.org/extend/plugins/redis-page-views/
-Description: Highly optimized page views using Redis
-Version: 1.1
-Author: Razvan Stanga
-Author URI: http://git.razvi.ro/
-License: http://www.apache.org/licenses/LICENSE-2.0
-Text Domain: redis-page-views
-Network: true
 
-Copyright 2017: Razvan Stanga (email: redis-page-views@razvi.ro)
-*/
-
-class Redis_Page_Views {
-    private $data = [];
-
-    public function __set($name, $value)
-    {
-        $this->data[$name] = $value;
-    }
-
-    public function __get($name)
-    {
-        if (array_key_exists($name, $this->data)) {
-            return $this->data[$name];
-        }
-        return null;
-    }
-
-    public function __construct()
-    {
-        $this->post_meta_key = defined("RPV_POST_META_KEY") ? constant("RPV_POST_META_KEY") : 'redis_pageviews_count';
-        $this->plugin = 'redis-page-views';
-        $this->version = '1.1';
-        $this->redisHost = defined("RPV_REDIS_HOST") ? constant("RPV_REDIS_HOST") : '127.0.0.1';
-        $this->redisPort = defined("RPV_REDIS_PORT") ? constant("RPV_REDIS_PORT") : 6379;
-        $this->redisPass = defined("RPV_REDIS_PASS") ? constant("RPV_REDIS_PASS") : null;
-        $this->redisPrefix = defined("RPV_REDIS_PREFIX") ? constant("RPV_REDIS_PREFIX") : $this->plugin;
-
-        if (function_exists('add_action')) {
-            add_action('init', array($this, 'init'));
-            if (is_admin()) {
-                add_action('admin_menu', array($this, 'add_menu_item'));
-                $this->currentTab = isset($_GET['tab']) ? $_GET['tab'] : 'stats';
-            }
-        }
-    }
-
-    public function init()
-    {
-        add_action('wp_enqueue_scripts', array($this, 'enqueue_js'));
-    }
-
-    public function connect_redis()
-    {
-        $this->redis = new Redis();
-        $this->redis->connect($this->redisHost, $this->redisPort);
-        if ($this->redisPass) {
-            $this->redis->auth($this->redisPass);
-        }
-        $this->redis->setOption(Redis::OPT_PREFIX, $this->redisPrefix . ':');
-    }
-
-    public function enqueue_js()
-    {
-        if (is_page() || is_single()) {
-            $post_id = get_the_ID();
-            wp_enqueue_script($this->plugin, plugins_url('/js/redis-page-views.js', __FILE__), array('jquery'), $this->version);
-            wp_add_inline_script($this->plugin, "var _rpv = {id: " . $post_id . ", url: '" . plugins_url('/pageview.php', __FILE__) . "'};");
-        }
-    }
-
-    public function add_menu_item()
-    {
-        add_menu_page(__('Redis Page Views', $this->plugin), __('Redis Page Views', $this->plugin), 'manage_options', $this->plugin . '-plugin', array($this, 'settings_page'), plugins_url() . '/' . $this->plugin . '/icon.png', 100);
-    }
-
-    public function settings_page()
-    {
-    ?>
-        <div class="wrap">
-        <h1><?=__('Redis Page Views', $this->plugin)?></h1>
-
-        <h2 class="nav-tab-wrapper">
-            <a class="nav-tab <?php if($this->currentTab == 'stats'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=stats"><?=__('Statistics', $this->plugin)?></a>
-            <a class="nav-tab <?php if($this->currentTab == 'posts-views'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=posts-views"><?=__('Posts views', $this->plugin)?></a>
-            <a class="nav-tab <?php if($this->currentTab == 'conf'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=conf"><?=__('Configuration info', $this->plugin)?></a>
-        </h2>
-
-        <?php if($this->currentTab == 'stats'): ?>
-            <h2><?= __('Statistics', $this->plugin) ?></h2>
-
-            <div class="wrap">
-                <table class="wp-list-table widefat fixed striped">
-                    <thead>
-                        <tr>
-                            <td class="manage-column"><strong>Key</strong></td>
-                            <td class="manage-column"><strong>Value</strong></td>
-                            <!--td class="manage-column"><strong>Description</strong></td-->
-                        </tr>
-                    </thead>
-                    <tbody>
-                    <?php $this->connect_redis(); ?>
-                    <?php foreach($data = $this->redis->info() as $key => $value): ?>
-                        <tr>
-                            <td><?=$key?></td>
-                            <td><?=$value?></td>
-                            <!--td></td-->
-                        </tr>
-                    <?php endforeach; ?>
-                    </tbody>
-                </table>
-            </div>
-        <?php elseif($this->currentTab == 'conf'): ?>
-            <h2><?= __('Configuration info', $this->plugin) ?></h2>
-
-            <div class="wrap">
-                <table class="wp-list-table widefat fixed striped">
-                    <tbody>
-                        <tr>
-                            <td>
-                                <?php
-                                    echo sprintf('<h4>' . __('You can override in wp-config.php redis default connection data' . '</h4>', $this->plugin));
-                                ?>
-                                <textarea cols="100" rows="5"><?php
-                                    echo __("DEFINE('RPV_POST_META_KEY', 'redis_pageviews_count');", $this->plugin); echo "\r\n";
-                                    echo __("DEFINE('RPV_REDIS_HOST', '127.0.0.1');", $this->plugin); echo "\r\n";
-                                    echo __("DEFINE('RPV_REDIS_PORT', 6379);", $this->plugin); echo "\r\n";
-                                    echo __("DEFINE('RPV_REDIS_PASS', '');", $this->plugin); echo "\r\n";
-                                    echo __("DEFINE('RPV_REDIS_PREFIX', 'redis-page-views'); // use custom prefix on all keys", $this->plugin);
-                                ?></textarea>
-                                <br /><br />
-                                <?php
-                                    echo __("You can use get_post_meta(\$post_id, RPV_POST_META_KEY, true); to get the post views");
-                                ?>
-                            </td>
-                        </tr>
-                    </tbody>
-                </table>
-            </div>
-        <?php elseif($this->currentTab == 'posts'): ?>
-            <h2><?= __('Posts views in memory', $this->plugin) ?></h2>
-
-            <div class="wrap">
-                <table class="wp-list-table widefat fixed striped">
-                    <tbody>
-                        <tr>
-                            <td>
-                            </td>
-                        </tr>
-                    </tbody>
-                </table>
-            </div>
-        <?php endif; ?>
-        </div>
-    <?php
-    }
-}
-
-$redisPageViews = new Redis_Page_Views();
-
-// WP-CLI
-if (defined('WP_CLI') && WP_CLI) {
-    include('wp-cli.php');
-}
-

--- /dev/null
+++ b/redis-post-views.php
@@ -1,1 +1,213 @@
-
+<?php
+/*
+Plugin Name: Redis Post Views
+Plugin URI: http://wordpress.org/extend/plugins/redis-post-views/
+Description: Highly optimized post views using Redis
+Version: 1.1
+Author: Razvan Stanga
+Author URI: http://git.razvi.ro/
+License: http://www.apache.org/licenses/LICENSE-2.0
+Text Domain: redis-post-views
+Network: true
+
+Copyright 2017: Razvan Stanga (email: redis-post-views@razvi.ro)
+*/
+
+class Redis_Post_Views {
+    private $data = [];
+
+    public function __set($name, $value)
+    {
+        $this->data[$name] = $value;
+    }
+
+    public function __get($name)
+    {
+        if (array_key_exists($name, $this->data)) {
+            return $this->data[$name];
+        }
+        return null;
+    }
+
+    public function __construct()
+    {
+        $this->post_meta_key = defined("RPV_POST_META_KEY") ? constant("RPV_POST_META_KEY") : "redis_post_views_count";
+        $this->plugin = "redis-post-views";
+        $this->version = 1.1;
+        $this->redisHost = defined("RPV_REDIS_HOST") ? constant("RPV_REDIS_HOST") : "127.0.0.1";
+        $this->redisPort = defined("RPV_REDIS_PORT") ? constant("RPV_REDIS_PORT") : 6379;
+        $this->redisPass = defined("RPV_REDIS_PASS") ? constant("RPV_REDIS_PASS") : null;
+        $this->redisPrefix = defined("RPV_REDIS_PREFIX") ? constant("RPV_REDIS_PREFIX") : $this->plugin;
+        $this->redisDatabase = defined("RPV_REDIS_DATABASE") ? constant("RPV_REDIS_DATABASE") : 0;
+
+        $this->redisConnected = false;
+        $this->redisException = false;
+
+        if (function_exists('add_action')) {
+            add_action('init', array($this, 'init'));
+            if (is_admin()) {
+                add_action('admin_menu', array($this, 'add_menu_item'));
+                $this->currentTab = isset($_GET['tab']) ? $_GET['tab'] : 'stats';
+            }
+        }
+    }
+
+    public function init()
+    {
+        add_action('wp_enqueue_scripts', array($this, 'enqueue_js'));
+    }
+
+    public function redis_connect()
+    {
+        $this->redis = new Redis();
+        try {
+            $this->redisConnected = $this->redis->connect($this->redisHost, $this->redisPort);
+            $this->redis->auth($this->redisPass);
+            if ($this->redisDatabase) {
+                $this->redis->select($this->redisDatabase);
+            }
+        } catch(RedisException $ex) {
+            $this->redisException = $ex->getMessage();
+        }
+        if ($this->redisException == false) $this->redis->setOption(Redis::OPT_PREFIX, $this->redisPrefix . ':');
+        return ($this->redisException ? false : true);
+    }
+
+    protected function redis_info()
+    {
+        try {
+            $this->redisInfo = $this->redis->info();
+        } catch(RedisException $ex) {
+            $this->redisException = $ex->getMessage();
+        }
+        return ($this->redisException ? false : true);
+    }
+
+    public function enqueue_js()
+    {
+        if ((is_page() || is_single()) && $post_id = get_the_ID()) {
+            wp_enqueue_script($this->plugin, plugins_url('/js/redis-post-views.js', __FILE__), array('jquery'), $this->version);
+            wp_add_inline_script($this->plugin, "var _rpv = {id: " . $post_id . ", url: '" . plugins_url('/post-view.php', __FILE__) . "'};");
+        }
+    }
+
+    public function the_views($display = true, $prefix = '', $postfix = '', $always = false)
+    {
+        $post_views = (int) get_post_meta(get_the_ID(), $this->post_meta_key, true);
+        $views_options = get_option('views_options');
+        $output = $prefix . str_replace( array( '%VIEW_COUNT%', '%VIEW_COUNT_ROUNDED%' ), array( number_format_i18n( $post_views ), postviews_round_number( $post_views) ), stripslashes( $views_options['template'] ) ) . $postfix;
+        if($display) {
+            echo apply_filters('rpv_the_views', $output);
+        } else {
+            return apply_filters('rpv_the_views', $output);
+        }
+    }
+
+    public function add_menu_item()
+    {
+        add_menu_page(__('Redis Post Views', $this->plugin), __('Redis Post Views', $this->plugin), 'manage_options', $this->plugin . '-plugin', array($this, 'settings_page'), plugins_url() . '/' . $this->plugin . '/icon.png', 100);
+    }
+
+    public function settings_page()
+    {
+    ?>
+        <div class="wrap">
+        <h1><?=__('Redis Post Views', $this->plugin)?></h1>
+
+        <h2 class="nav-tab-wrapper">
+            <a class="nav-tab <?php if($this->currentTab == 'stats'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=stats"><?=__('Statistics', $this->plugin)?></a>
+            <a class="nav-tab <?php if($this->currentTab == 'posts-queue'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=posts-queue"><?=__('Posts queue', $this->plugin)?></a>
+            <a class="nav-tab <?php if($this->currentTab == 'conf'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=conf"><?=__('Configuration info', $this->plugin)?></a>
+        </h2>
+
+        <?php if($this->currentTab == 'stats'): ?>
+            <h2><?= __('Statistics', $this->plugin) ?></h2>
+
+            <div class="wrap">
+                <table class="wp-list-table widefat fixed striped">
+                    <?php if ($this->redis_connect() && $this->redis_info()): ?>
+                        <thead>
+                            <tr>
+                                <td class="manage-column"><strong>Key</strong></td>
+                                <td class="manage-column"><strong>Value</strong></td>
+                                <!--td class="manage-column"><strong>Description</strong></td-->
+                            </tr>
+                        </thead>
+                        <tbody>
+                        <?php foreach($this->redisInfo as $key => $value): ?>
+                            <tr>
+                                <td><?=$key?></td>
+                                <td><?=$value?></td>
+                                <!--td></td-->
+                            </tr>
+                        <?php endforeach; ?>
+                    <?php else: ?>
+                        <tr>
+                            <td>
+                                <?=$this->redisException?>
+                            </td>
+                        </tr>
+                    <?php endif; ?>
+                    </tbody>
+                </table>
+            </div>
+        <?php elseif($this->currentTab == 'conf'): ?>
+            <h2><?= __('Configuration info', $this->plugin) ?></h2>
+
+            <div class="wrap">
+                <table class="wp-list-table widefat fixed striped">
+                    <tbody>
+                        <tr>
+                            <td>
+                                <?php
+                                    echo sprintf('<h4>' . __('You can override in wp-config.php Redis default connection data and other options' . '</h4>', $this->plugin));
+                                ?>
+                                <textarea cols="100" rows="11">
+/**
+ * Redis Post Views plugin
+ */
+<?php
+                                    echo __("define('RPV_REDIS_HOST', '127.0.0.1');", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_REDIS_PORT', 6379);", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_REDIS_PASS', '');", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_REDIS_PREFIX', 'redis-post-views'); // use custom prefix on all keys", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_REDIS_DATABASE', 0); // dbindex, the database number to switch to", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_POST_META_KEY', 'redis_post_views_count');", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_EXCLUDE_BOTS', true); // exclude bots like Google ?", $this->plugin); echo "\r\n";
+                                    echo __("define('RPV_AJAX_RETURN_VIEWS', true); // does the AJAX request return post views count ?", $this->plugin);
+                                ?></textarea>
+                                <br /><br />
+                                <?php
+                                    echo __("You can use get_post_meta(\$post_id, RPV_POST_META_KEY, true); to get the post views");
+                                ?>
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+        <?php elseif($this->currentTab == 'posts-queue'): ?>
+            <h2><?= __('Posts queue in Redis', $this->plugin) ?></h2>
+
+            <div class="wrap">
+                <table class="wp-list-table widefat fixed striped">
+                    <tbody>
+                        <tr>
+                            <td>
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+        <?php endif; ?>
+        </div>
+    <?php
+    }
+}
+
+$redisPostViews = new Redis_Post_Views();
+
+// WP-CLI
+if (defined('WP_CLI') && WP_CLI) {
+    include('wp-cli.php');
+}
+

file:a/wp-cli.php -> file:b/wp-cli.php
--- a/wp-cli.php
+++ b/wp-cli.php
@@ -7,13 +7,13 @@
 if (!defined('WP_CLI')) return;
 
 /**
- * Redis Page Views
+ * Redis Post Views
  */
-class WP_CLI_Redis_Page_Views_Purge_Command extends WP_CLI_Command {
+class WP_CLI_Redis_Post_Views_Purge_Command extends WP_CLI_Command {
 
     public function __construct()
     {
-        $this->rpv = new Redis_Page_Views();
+        $this->rpv = new Redis_Post_Views();
     }
 
     /**
@@ -63,5 +63,5 @@
 
 }
 
-WP_CLI::add_command('rpv', 'WP_CLI_Redis_Page_Views_Purge_Command');
+WP_CLI::add_command('rpv', 'WP_CLI_Redis_Post_Views_Purge_Command');
 

comments