hardcoded on/off VCL Generator, filters to readme
hardcoded on/off VCL Generator, filters to readme

file:a/readme.txt -> file:b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -1,10 +1,10 @@
 === Varnish Caching ===
-Donate link: www.paypal.com/use/email/razvan_stanga@yahoo.com
+Donate link: http://git.razvi.ro/
 Contributors: razvanstanga
 Tags: varnish, purge, cache, caching, optimization, performance, traffic
 Requires at least: 4.0
-Tested up to: 4.6
-Stable tag: 1.5.2
+Tested up to: 4.7
+Stable tag: 1.5.3
 License: GPLv2 or later
 
 Wordpress Varnish Cache 3.x/4.x integration
@@ -106,6 +106,14 @@
 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.
 
+= Available filters =
+
+* `vcaching_varnish_ips` - change the IPs set in Settings
+* `vcaching_varnish_hosts` - change the Hosts set in Settings
+* `vcaching_events` - add events to trigger the purge
+* `vcaching_schema` - change the schema (default is http://)
+* `vcaching_purge_urls` - add additional URLs to purge
+
 == Changelog ==
 
 = 1.5.2 =

--- a/vcaching.php
+++ b/vcaching.php
@@ -3,7 +3,7 @@
 Plugin Name: Varnish Caching
 Plugin URI: http://wordpress.org/extend/plugins/vcaching/
 Description: WordPress Varnish Cache integration.
-Version: 1.5.2
+Version: 1.5.3
 Author: Razvan Stanga
 Author URI: http://git.razvi.ro/
 License: http://www.apache.org/licenses/LICENSE-2.0
@@ -32,6 +32,7 @@
     protected $truncateNotice = false;
     protected $truncateCount = 0;
     protected $debug = 0;
+    protected $vclGeneratorTab = true;
 
     public function __construct()
     {
@@ -327,7 +328,7 @@
         } else {
             $text = $intro . ' ' . $nopermission;
         }
-        echo '<p class="varnish-galce">' . $text . '</p>';
+        echo '<p class="varnish-glance">' . $text . '</p>';
     }
 
     protected function get_register_events()
@@ -531,7 +532,9 @@
         add_action('admin_menu', array($this, 'add_menu_item'));
         add_action('admin_init', array($this, 'options_page_fields'));
         add_action('admin_init', array($this, 'console_page_fields'));
-        add_action('admin_init', array($this, 'conf_page_fields'));
+        if ($this->vclGeneratorTab) {
+            add_action('admin_init', array($this, 'conf_page_fields'));
+        }
     }
 
     public function add_menu_item()
@@ -553,7 +556,9 @@
                 <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"><?=__('VCLs Generator', $this->plugin)?></a>
+            <?php if ($this->vclGeneratorTab): ?>
+                <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"><?=__('VCLs Generator', $this->plugin)?></a>
+            <?php endif; ?>
         </h2>
 
         <?php if(!isset($_GET['tab']) || $_GET['tab'] == 'options'): ?>

comments