moved wp-config-rpv.php wo wp-config for improved compatibility
moved wp-config-rpv.php wo wp-config for improved compatibility

--- a/classes/redis_post_views.php
+++ b/classes/redis_post_views.php
@@ -411,7 +411,7 @@
                         <tr>
                             <td>
                                 <?php
-                                    echo sprintf('<h4>' . __('You must create wp-config-rpv.php in WP root containing Redis default connection data and other options' . '</h4>', $this->plugin));
+                                    echo sprintf('<h4>' . __('You must create wp-config-rpv.php in wp-content containing Redis default connection data and other options:' . '</h4>', $this->plugin));
                                 ?>
                                 <textarea cols="100" rows="10">
 <?php
@@ -425,14 +425,6 @@
                                     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>
-                                <?php
-                                    echo sprintf('<h4>' . __("Then you must include wp-config-rpv.php in wp-config.php after <em>define('ABSPATH', dirname(__FILE__) . '/');</em>" . '</h4>', $this->plugin));
-                                ?>
-                                <textarea cols="100" rows="5">
-/**
- * Redis Post Views plugin
- */
-include(ABSPATH . 'wp-config-rpv.php');</textarea>
                                 <br /><br />
                                 <?php
                                     echo __("You can use get_post_meta(\$post_id, RPV_POST_META_KEY, true); to get the post views");
@@ -447,3 +439,4 @@
     <?php
     }
 }
+

file:a/init.php -> file:b/init.php
--- a/init.php
+++ b/init.php
@@ -15,6 +15,7 @@
 define('RPV_VERSION', 1.5);
 define('RPV_PATH', dirname( __FILE__ ));
 
+include(WP_CONTENT_DIR  . '/wp-config-rpv.php');
 include(RPV_PATH . '/classes/redis_post_views.php');
 
 $redis_post_views = new Redis_Post_Views();

--- a/post-view.php
+++ b/post-view.php
@@ -12,7 +12,7 @@
 
 Copyright 2017: Razvan Stanga (email: redis-post-views@razvi.ro)
 */
-@include('../../../wp-config-rpv.php');
+@include('../../wp-config-rpv.php');
 
 define('RPV_VERSION', 1.5);
 define('RPV_PATH', dirname( __FILE__ ));

file:a/wp-cli.php -> file:b/wp-cli.php
--- a/wp-cli.php
+++ b/wp-cli.php
@@ -55,7 +55,7 @@
                 $this->rpv->redis->delete('post-' . $post_id);
             }
             $this->rpv->redis->delete('posts');
-            WP_CLI::success('Redis Page Views cache flushed.');
+            WP_CLI::success('Redis Post Views cache flushed.');
         } else {
             WP_CLI::success('Cannot connect to Redis server.');
         }

comments