I got below error message. With this I show you the error:
$purge_varnish_action = get_option(‘purge_varnish_action’, ”);
print_r($purge_varnish_action);
result= Array ( [post_insert_update] => post_updated [post_status] => transition_post_status [post_trash] => wp_trash_post [comment_insert] => wp_insert_comment [comment_update] => edit_comment [navmenu_insert_update] => wp_update_nav_menu [theme_switch] => after_switch_theme )
unserialize() will not work here.
How to solve this issue?
[27-Dec-2024 16:48:12 UTC] PHP Fatal error:
Uncaught TypeError: unserialize():
Argument #1 ($data) must be of type string, array given in C:\xampp\htdocs\bizz247\wp-content\plugins\purge-varnish\class_purge_varnish.php:968
Stack trace: 0 C:\xampp\htdocs\bizz247\wp-content\plugins\purge-varnish\class_purge_varnish.php(968): unserialize(Array) 1 C:\xampp\htdocs\bizz247\wp-settings.php(526): include_once(‘C:\xampp\htdocs…’) 2 C:\xampp\htdocs\bizz247\wp-config.php(88): require_once(‘C:\xampp\htdocs…’) 3 C:\xampp\htdocs\bizz247\wp-load.php(50): require_once(‘C:\xampp\htdocs…’) 4 C:\xampp\htdocs\bizz247\wp-admin\admin.php(34): require_once(‘C:\xampp\htdocs…’)
Hello everyone,
I’ve been working with the?Easy Form Builder?plugin and encountered some challenges with page caching. To address these, we’ve implemented the following function to manage the interaction between Easy Form Builder and various page caching plugins:
public function cache_cleaner_Efb($page_id, $plugins) {
$page_id = intval($page_id);
$cache_plugins = json_decode($plugins);
foreach ($cache_plugins as $plugin) {
switch ($plugin->slug) {
case 'litespeed-cache':
if (defined('LSCWP_V') || defined('LSCWP_BASENAME')) do_action('litespeed_purge_post', $page_id);
break;
case 'wp-rocket':
if (function_exists('rocket_clean_post')) $r = rocket_clean_post($page_id);
break;
.
.
.
}
}
}
While this works, we’re looking for a more streamlined or integrated solution, ideally similar to how other plugins handle caching. Any suggestions on best practices or methods to improve this would be greatly appreciated.
Thank you for your time and insights!
Best regards,
]]>Could you, please, fix this? It’s easy fix, just replace ‘2.2.9’ at 42nd line in class_purge_varnish.php for valid numeric value, or remove it completely (it’s ignored anyway right now). Thanks.
]]>Hello,
After updating my php from 7.4 to 8.1 This issues started happening on plugin page & when updating content:
E_ERROR (Line 129)
file: /wp-content/plugins/purge-varnish/class_purge_varnish.php.
Uncaught TypeError: socket_connect(): Argument #3 ($port) must be of type ?int, string given in /wp-content/plugins/purge-varnish/class_purge_varnish.php:129
Stack trace:
#0 /wp-content/plugins/purge-varnish/class_purge_varnish.php(129):?
Hello I noticed when I upgraded to wordpress 6.0.0 This issue appearing.Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position.
at:
wp-content/plugins/purge-varnish/class_purge_varnish.php:42
Hello,
I have Varnish running on my server and it is caching correctly, but your plugin cannot connect to Varnish terminal. I already tried so many different VCls, googling hours and days and read all your support forum posts but nothing works.
I really don’t know what I’m doing wrong.
My vcl config is the following:
backend default {
.host = "111.11.111.11"; (My site IP)
.port = "8080";
.first_byte_timeout = 5000s;
.connect_timeout = 1s;
.between_bytes_timeout = 2s;
}
acl purge {
"111.11.111.11";
"mydomain.com";
"localhost";
"127.0.0.1";
}
varnish.params file:
VARNISH_LISTEN_PORT=6081
# Admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082
My nginx setup:
if ($host = "mydomain.com") {
set $PROXY_SCHEME "http";
set $PROXY_TO_PORT 6081;
set $PROXY_DOMAIN_OR_IP "111.11.111.11";
}
Varnish Control Terminal: 111.11.111.11:8080 111.11.111.11:6081 0.0.0.0:6081 127.0.0.1:6082
Please, can you help me in figuring this out?
Thanks!
]]>I get this warning in php 8:
Undefined array key “path” in /var/www/mywebsite/wp-content/plugins/purge-varnish/class_purge_varnish.php on line 291
]]>Would I be able to purge Cachewall cache from WP backend without logging to cPanel?
]]>The folks at NitroPack are saying that in order to be compatible with DreamPress, the settings listed in this post need to be available (particularly the first one, with the “purgeAll” setting.
When asking the DreamPress support people, they referred me to you.
How do you recommend these NitroPack settings?
Nitro is saying that if these settings arent supported they will have to declare DreamPress as incompatible.
https://help.nitropack.io/en/articles/4201462-reverse-proxy-integration-varnish-nginx-etc
]]>Hi,
The plugin installed and proper configured but it’s not working. My hosting developer checked and found 2 errors in class_purge_varnish.php
Line 22
const PURGE_VARNISH_DEFAULT_TREMINAL = ‘127.0.0.1:6082’;
You have defaulted the port to 6082, while some hosting environment may have use other port(s)
Besides, there was an extra information in
Line 147
Original
$pack = $challenge . “\x0A” . $secret . “\x0A” . $challenge . “\x0A”;
Edited
$pack = $challenge . “\x0A” . $secret . $challenge . “\x0A”;
Now it works.
Please verify from your end.
Thanks.
]]>Hey DP Singh,
Many thanks for this plugin, it works great!
Could I please request that you update the purge_varnish.css file so the styles are only applied to elements in the purge_varnish class?
At the moment I have to manually update the css file after each update to stop the styles across the whole admin area changing.
Best wishes, Peter
]]>Is Purge Varnish Cache compatible with Accelerated Mobile Pages? Would you recommend to use both?
]]>Hello guys, I use beaver builder and varnish plugin on my site and I have a problem with beaver that doesn’t save the updates.
I asked to Beaver support and they answer that the problems seem related to Varnish plugin, here the support answer:
The issue appears to be due to the following errors coming from the Purge Varnish plugin:
Notice: Undefined index: url in …/plugins/purge-varnish/class_purge_varnish.php on line 394
Notice: Undefined index: path in …/plugins/purge-varnish/class_purge_varnish.php on line 293
Notice: Undefined index: path in …/plugins/purge-varnish/class_purge_varnish.php on line 393
Notice: Undefined index: url in …/plugins/purge-varnish/class_purge_varnish.php on line 397
Notice: Undefined index: path in …/plugins/purge-varnish/class_purge_varnish.php on line 397
Could you please take a look?
Thank you
I just installed this plugin. On the settings, at status, I see “The Varnish control terminal is not responding at”. In the “Varnish Control Terminal” cell, I have not inserted my server IP or my hostname yet. And I don’t know where to find these. FYI I am on Windows 10.
]]>The only working plugin for my varnish server (6.0)+php 7.2-fpm+Apache.
Everything works, but there are errors in the log。
Will you check this error log:
AH01071: Got error ‘PHP message: Recieved status code <i>106</i> running ban req.http.host == “” && req.url ~ “^$”. Full response text: <i>Wrong number of arguments\n</i>\nPHP message: Recieved status code <i>106</i> running ban req.http.host == “” && req.url ~ “^$”. Full response text: <i>Wrong number of arguments\n</i>\nPHP message: Recieved status code <i>106</i> running ban req.http.host == “” && req.url ~ “^$”. Full response text: <i>Wrong number of arguments\n</i>\nPHP message: Recieved status code <i>106</i> running ban req.http.host == “” && req.url ~ “^$”. Full response text: <i>Wrong number of arguments\n</i>\n’, referer: https://www.mysite.com/wp-admin/post.php?post=14&action=edit&classic-editor
Hello,
I would like to give the capability to “Purge all” also to the Editor level’s users.
Is it possible? and how?
Thanks in advance
]]>Hello DP Singh,
Your plugin works excellent. There is only a little something that bugs me. In your plugin there is CSS included that overwrites the standard admin CSS. I’ve included an image link as an example:
The dark gray blocks comes from your included CSS file.
Is it possible that you remove this from your CSS because it’s a bit unwanted?
With kind regards,
Rolf
]]>Notice
Array to string conversion
1
wp-content/plugins/purge-varnish/class_purge_varnish.php:167
–
do_action(‘purge-varnish_page_purge-varnish-all’)
wp-admin/admin.php:224
Purge_Varnish->purge_varnish_page_file_path()
wp-includes/class-wp-hook.php:286
Purge_Varnish->purge_varnish_all_cache_manually()
wp-content/plugins/purge-varnish/includes/purge_all.php:12
Purge_Varnish->purge_varnish_terminal_run()
wp-content/plugins/purge-varnish/class_purge_varnish.php:314
Plugin: purge-varnish
Notice
Undefined index: url
1
wp-content/plugins/purge-varnish/class_purge_varnish.php:326
–
do_action(‘purge-varnish_page_purge-varnish-all’)
wp-admin/admin.php:224
Purge_Varnish->purge_varnish_page_file_path()
wp-includes/class-wp-hook.php:286
Purge_Varnish->purge_varnish_all_cache_manually()
wp-content/plugins/purge-varnish/includes/purge_all.php:12
Plugin: purge-varnish
Notice
Undefined index: path
1
wp-content/plugins/purge-varnish/class_purge_varnish.php:326
–
do_action(‘purge-varnish_page_purge-varnish-all’)
wp-admin/admin.php:224
Purge_Varnish->purge_varnish_page_file_path()
wp-includes/class-wp-hook.php:286
Purge_Varnish->purge_varnish_all_cache_manually()
wp-content/plugins/purge-varnish/includes/purge_all.php:12
We’ve got a similar issue to the one reported in this topic.
Our log is filled with these errors, about 10 or so whenever a page is edited:
[Thu Feb 22 12:55:40.661046 2018] [:error] [pid 6119] [client 172.17.0.5:58076] Recieved status code <i>106</i> running ban req.http.host == "" && req.url ~ "^$". Full response text: <i>Wrong number of arguments\n</i>, referer: https://website.com/wp-admin/post.php?post=12345&action=edit
[Thu Feb 22 12:55:40.668571 2018] [:error] [pid 6119] [client 172.17.0.5:58076] Recieved status code <i>106</i> running ban req.http.host == "" && req.url ~ "^$". Full response text: <i>Wrong number of arguments\n</i>, referer: https://website.com/wp-admin/post.php?post=12345&action=edit
[Thu Feb 22 12:55:40.673434 2018] [:error] [pid 6119] [client 172.17.0.5:58076] Recieved status code <i>106</i> running ban req.http.host == "" && req.url ~ "^$". Full response text: <i>Wrong number of arguments\n</i>, referer: https://website.com/wp-admin/post.php?post=12345&action=edit
We’ve tried the fix in the linked topic but the errors are still happening. Unlike the OP of that topic we have noticed that the purge plugin still works normally, and is purging the relevant URLs on page updates – it’s just filling up our logs!
]]>I have a cache server (Varnish) on IP 192.168.1.10 and a web server on IP 192.168.1.12. The admin port of varnish is 6082 and the varnish listen port is 8080. Every thing is OK and my wordpress site’s URLs are cached properly. I have installed Purge Varnish Plugin to automatically purge the new and updated posts. I have filled all the necessary fields in Terminal section of the plugin but I get the following error:
The Varnish control terminal is not responding at 192.168.1.10:6082
The port 6082 is also open in firewall.
I can Telnet from web server to my cache server:
[root@cp2 ~]# telnet 192.168.1.10 6082
Trying 192.168.1.10…
Connected to 192.168.1.10.
Escape character is ‘^]’.
107 59
cjeaygjpftuwttgvekgftuaqhxdysqru
Authentication required.
Any help is appreciated.
]]>Hello,
Do you know the cause? Thank you.
I am on Ubuntu 16.04+apache+php7.1-fpm+Varnish 5.1.3
[07-Sep-2017 01:08:28 UTC] Recieved status code <i>HTT</i> running status. Full response text: <i>B</i>
[07-Sep-2017 01:08:28 UTC] PHP Notice: Array to string conversion in /var/www/default/wp-content/plugins/purge-varnish/class_purge_varnish.php on line 167
When you connect multiple terminals you get wrong connection message:
https://prntscr.com/gezy7w
As you can see it just duplicates both terminals twice.
To fix this inside class_purge_varnish.php, lines 136/139 – need to use $terminal variable instead of full string.
]]>On PHP 5.4 I got fatal error from file “class_purge_varnish.php”, line 254.
You can’t call functions inside empty() statement. Please use temp variable for this,
]]>If i configure the plugin with a false “Varnish Control Terminal”, the page shows correctly “The Varnish control terminal is not responding at 127.0.0.1:6082” But when i setup the correct address, there is a white page showing.
It also doesn’t matter if i setup the control key or not.
The debug log shows every time a refresh just “status” on a single line.
]]>Hello,
I’m using the plugin on WP 4.8 and php7 but I’m receiving some errors like:
Deprecated: Non-static method Purge_Varnish::purge_varnish_page_file_path() should not be called statically in /home/keycreat/public_html/wp-includes/class-wp-hook.php on line 298
Notice: Undefined variable: log in /home/keycreat/public_html/wp-content/plugins/purge-varnish/class_purge_varnish.php on line 111
Would you update the plugin?
Do you have any time-prevision?
Let me know, Nicola.
]]>I can purge links with the “Purge URLs” page without any problem.
However, the plugin does not appear to be properly purging anything automatically.
When I enable debug mode, all I see is this entry, repeated hundreds and hundreds of times:
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
ban req.http.host == "mysite.com" && req.url ~ "^/$"
{"code":"200","msg":"\n"}
ban req.http.host == "" && req.url ~ "^$"
{"code":"106","msg":"Wrong number of arguments\n"}
…over and over and over again. It’s like the plugin is failing to extract the proper URL for the content to be purged, and uses “^/$” instead.
I have no idea how to fix this. Any advice?
]]>If I just one server and sexret it checks out fine, but if I add all three with spaces in between it fails. Each of our servers has a different secret. I tried adding all three secrets with spaces in between, but didn’t work.
]]>