fixed wp-cli calling an older method name
fixed wp-cli calling an older method name

file:b/.gitignore (new)
--- /dev/null
+++ b/.gitignore
@@ -1,1 +1,2 @@
+/vcaching-svn
 

file:a/readme.txt -> file:b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,8 @@
 Tags: varnish, purge, cache, caching, optimization, performance, traffic
 Requires at least: 4.0
 Tested up to: 4.9
-Stable tag: 1.6.6
+Requires PHP: 5.2.4
+Stable tag: 1.6.8
 License: GPLv2 or later
 
 Wordpress Varnish Cache 3.x/4.x/5.x integration
@@ -116,6 +117,12 @@
 
 == Changelog ==
 
+= 1.6.8 =
+* fixed wp-cli calling an older method name
+
+= 1.6.7 =
+* use sys_get_temp_dir() to address open_basedir restictions to /tmp. thanks @maltfield
+
 = 1.6.6 =
 * no more SSl auto detection. If you use SSL with Varnish use the option 'Use SSL (https://) for purge requests.'
 * there are cases where the website uses SSL, but the Varnish servers do not

--- 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.6.6
+Version: 1.6.8
 Author: Razvan Stanga
 Author URI: http://git.razvi.ro/
 License: http://www.apache.org/licenses/LICENSE-2.0
@@ -374,7 +374,7 @@
         add_action('admin_notices' , array($this, 'purge_message'));
     }
 
-    protected function purge_url($url)
+    public function purge_url($url)
     {
         $p = parse_url($url);
 
@@ -912,7 +912,7 @@
 
         if(isset($_POST['option_page']) && $_POST['option_page'] == $this->prefix . 'download') {
             $version = in_array($_POST['varnish_caching_varnish_version'], array(3,4,5)) ? $_POST['varnish_caching_varnish_version'] : 3;
-            $tmpfile = tempnam("tmp", "zip");
+            $tmpfile = tempnam(sys_get_temp_dir(), "zip");
             $zip = new ZipArchive();
             $zip->open($tmpfile, ZipArchive::OVERWRITE);
             $files = array(

file:a/wp-cli.php -> file:b/wp-cli.php
--- a/wp-cli.php
+++ b/wp-cli.php
@@ -25,7 +25,7 @@
      */
     public function purge() {
         wp_create_nonce('vcaching-purge-cli');
-        $this->vcaching->purgeUrl(home_url() .'/?vc-regex');
+        $this->vcaching->purge_url(home_url() .'/?vc-regex');
         WP_CLI::success('ALL Varnish cache was purged.');
     }
 

comments