From 290c50fa81c5a46309b79f581b24c5868d8b243b Mon Sep 17 00:00:00 2001 From: amiga-500 Date: Fri, 23 Sep 2016 11:11:19 -0400 Subject: [PATCH] Sitemap default priority change Although plugins like Yoast have dropped the use of the priority attribute w3tc required that the priority existed for each url entry in a sitemap. If such priority did not exist (despite a correlating url) it would ignore the entry entirely, and features like prime caching would no longer work for all entries that did not have a priority, which in most cases would be the entire sitemap. By simply modifying the default priority to 0.5 (the standard default value for this attribute) it corrects this problem and allows urls with no priority to continue to be processed. --- lib/W3/Plugin/PgCacheAdmin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/W3/Plugin/PgCacheAdmin.php b/lib/W3/Plugin/PgCacheAdmin.php index 11d2bae..83d1455 100644 --- a/lib/W3/Plugin/PgCacheAdmin.php +++ b/lib/W3/Plugin/PgCacheAdmin.php @@ -175,7 +175,7 @@ function parse_sitemap($url) { foreach ($url_matches[1] as $url_match) { $loc = ''; - $priority = 0; + $priority = 0.5; if (preg_match('~(.*?)~is', $url_match, $loc_matches)) { $loc = trim($loc_matches[1]);