1.4 readme.txt, better looking stats tab 1.4
1.4 readme.txt, better looking stats tab

file:a/readme.txt -> file:b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@
 Tags: varnish, purge, cache, caching, optimization, performance, traffic
 Requires at least: 4.0
 Tested up to: 4.4
-Stable tag: 1.3.3
+Stable tag: 1.4
 License: GPLv2 or later
 
 Wordpress Varnish Cache 3.x/4.x integration
@@ -21,6 +21,7 @@
 * supports every type of Varnish Cache implementation, see screenshots for examples
 * unlimited number of Varnish Cache servers
 * use of custom headers when communicating with Varnish Cache does not interfere with other caching plugins, cloudflare, etc
+* Varnish Cache configuration generator
 * purge key method so you don't need to setup ACLs
 * debugging
 * actively maintained
@@ -33,6 +34,7 @@
 * IPs/Hosts to clear cache to support every type of Varnish Cache implementation
 * Override default TTL in posts/pages
 * Purge key based PURGE
+* Logged in cookie
 * Debugging option
 * console for precise manual purges
 
@@ -58,7 +60,8 @@
 
 == Installation ==
 
-Use the provided config files for Varnish Cache located in /wp-content/plugins/vcaching/varnish-conf folder. Just edit the backend IP/port and ACLs.
+Use the Varnish Cache configuration generator. Fill in the backends/ACLs then download your configuration files.
+Or use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder.
 You can also use the purge key method. You must fill in lib/purge.vcl the purge key.
 
 == Frequently Asked Questions ==
@@ -89,13 +92,26 @@
 
 = How do I configure my Varnish Cache VCL? =
 
-Use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder.
+Use the Varnish Cache configuration generator. Fill in the backends/ACLs then download your configuration files.
+Or use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder.
 
 = Can I use this with a proxy service like CloudFlare? =
 
 Yes.
 
+= What is logged in cookie? =
+
+Logged in cookie is a special cookie this plugin sets upon user loggin. Varnish Cache uses this cookie to bypass caching for logged in users.
+This is a small step towards securing your site for denial of service attacks. Denial of service attacks can happen if the attacker bypasses Varnish Cache and hits the backend directly.
+With the current configuration and the way Wordpress works, this can still happen with POST/AJAX requests.
+
 == Changelog ==
+
+= 1.4 =
+* Varnish Cache configuration files generator
+* added `logged in cookie`. This replaces the logged in admin/user based on Wordpress standard cookies to bypass caching
+* moved backends to conf/backend.vcl
+* moved ACLs to conf/acl.vcl
 
 = 1.3.3 =
 * support for Varnish 4
@@ -131,9 +147,10 @@
 
 == Screenshots ==
 
-1. admin panel
-2. example integration
-3. override default TTL in posts/pages
-4. console purge
-5. varnish statistics
+1. Settings admin panel
+2. Console/manual purge admin panel
+3. Varnish Cache Statistics admin panel
+4. Varnish Cache configuration generator admin panel
+5. override default TTL in posts/pages
+6. integration example
 

--- a/vcaching.php
+++ b/vcaching.php
@@ -3,7 +3,7 @@
 Plugin Name: VCaching
 Plugin URI: http://wordpress.org/extend/plugins/vcaching/
 Description: WordPress Varnish Cache integration.
-Version: 1.3.3
+Version: 1.4
 Author: Razvan Stanga
 Author URI: http://git.razvi.ro/
 License: http://www.apache.org/licenses/LICENSE-2.0
@@ -504,7 +504,7 @@
                 <a class="nav-tab <?php if($_GET['tab'] == 'console'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=console"><?=__('Console', $this->plugin)?></a>
             <?php endif; ?>
             <a class="nav-tab <?php if($_GET['tab'] == '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($_GET['tab'] == 'conf'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=conf"><?=__('Varnish Config', $this->plugin)?></a>
+            <a class="nav-tab <?php if($_GET['tab'] == 'conf'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=conf"><?=__('Varnish VCLs', $this->plugin)?></a>
         </h2>
 
         <?php if(!isset($_GET['tab']) || $_GET['tab'] == 'options'): ?>
@@ -587,13 +587,9 @@
                             jQuery.getJSON("<?=$ipToHost['statsJson']?>", function(data) {
                                 var server = '#server_<?=$server?>';
                                 jQuery(server).html('');
-                                jQuery(server).append("<?= __('Stats generated on', $this->plugin) ?> " + data.timestamp);
-                                jQuery(server).append('<table class="fixed server_<?=$server?>">');
-                                jQuery(server).append('<thead><tr><td><strong><?= __('Description', $this->plugin) ?></strong></td><td><strong><?= __('Value', $this->plugin) ?></strong></td><td><strong><?= __('Key', $this->plugin) ?></strong></td></tr></thead>');
-                                jQuery(server).append('<tbody id="varnishstats_<?=$server?>"></tbody>');
-                                jQuery(server).append('</table>');
+                                jQuery(server).append('<p><?= __('Stats generated on', $this->plugin) ?> ' + data.timestamp + '</p>');
+                                jQuery(server).append('<table class="wp-list-table widefat fixed striped server_<?=$server?>"><thead><tr><td class="manage-column"><strong><?= __('Description', $this->plugin) ?></strong></td><td class="manage-column"><strong><?= __('Value', $this->plugin) ?></strong></td><td class="manage-column"><strong><?= __('Key', $this->plugin) ?></strong></td></tr></thead><tbody id="varnishstats_<?=$server?>"></tbody></table>');
                                 delete data.timestamp;
-                                console.log(data);
                                 jQuery.each(data, function(key, val) {
                                     jQuery('#varnishstats_<?=$server?>').append('<tr><td>'+val.description+'</td><td>'+val.value+'</td><td>'+key+'</td></tr>');
                                 });
@@ -727,7 +723,7 @@
     public function varnish_caching_purge_key()
     {
         ?>
-            <input type="text" name="varnish_caching_purge_key" id="varnish_caching_purge_key" size="100" value="<?php echo get_option($this->prefix . 'purge_key', 'ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4'); ?>" />
+            <input type="text" name="varnish_caching_purge_key" id="varnish_caching_purge_key" size="100" value="<?php echo get_option($this->prefix . 'purge_key'); ?>" />
             <span onclick="generateHash(64, 0, 'varnish_caching_purge_key'); return false;" class="dashicons dashicons-image-rotate" title="<?=__('Generate')?>"></span>
             <p class="description">
                 <?=__('Key used to purge Varnish cache. It is sent to Varnish as X-VC-Purge-Key header. Use a SHA-256 hash.<br />If you can\'t use ACL\'s, use this option. You can set the `purge key` in lib/purge.vcl.<br />Search the default value ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4 to find where to replace it.', $this->plugin)?>
@@ -738,7 +734,7 @@
     public function varnish_caching_cookie()
     {
         ?>
-            <input type="text" name="varnish_caching_cookie" id="varnish_caching_cookie" size="10" maxlength="10" value="<?php echo get_option($this->prefix . 'cookie', 'c005492c65'); ?>" />
+            <input type="text" name="varnish_caching_cookie" id="varnish_caching_cookie" size="10" maxlength="10" value="<?php echo get_option($this->prefix . 'cookie'); ?>" />
             <span onclick="generateHash(10, 0, 'varnish_caching_cookie'); return false;" class="dashicons dashicons-image-rotate" title="<?=__('Generate')?>"></span>
             <p class="description">
                 <?=__('This module sets a special cookie to tell Varnish that the user is logged in. This should be a random 10 chars string [0-9a-z]. You can set the `logged in cookie` in default.vcl.<br />Search the default value <i>c005492c65</i> to find where to replace it.', $this->plugin)?>

comments