AJAX POST request to avoid cacheing, optimizations
AJAX POST request to avoid cacheing, optimizations

--- a/js/redis-post-views.js
+++ b/js/redis-post-views.js
@@ -2,7 +2,7 @@
     var data = {
         'id': _rpv.id
     };
-    jQuery.get(_rpv.url, data, function(response) {
+    jQuery.post(_rpv.url, data, function(response) {
         //TODO: window.redis_post_views callbacks
     });
 });

--- a/post-view.php
+++ b/post-view.php
@@ -81,7 +81,7 @@
      */
     public function post_view()
     {
-        if (!isset($_GET['id'])) {
+        if (!isset($_POST['id'])) {
             echo 'Invalid ID';
             return;
         }

--- a/redis-post-views.php
+++ b/redis-post-views.php
@@ -129,8 +129,8 @@
                     <?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>Post</strong></td>
+                                <td class="manage-column"><strong>Views</strong></td>
                                 <!--td class="manage-column"><strong>Description</strong></td-->
                                 <!--td class="manage-column"><strong>Sync</strong></td-->
                             </tr>
@@ -147,7 +147,7 @@
                     <?php else: ?>
                         <tr>
                             <td>
-                                <?=$this->redisException?>
+                                <?=$this->redisException;?>
                             </td>
                         </tr>
                     <?php endif; ?>
@@ -212,7 +212,7 @@
                     <?php else: ?>
                         <tr>
                             <td>
-                                <?=$this->redisException?>
+                                <?=$this->redisException;?>
                             </td>
                         </tr>
                     <?php endif; ?>

comments