Skip to content
This repository has been archived by the owner on Jul 3, 2022. It is now read-only.

Commit

Permalink
Sitemap default priority change
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
amiga-500 committed Sep 23, 2016
1 parent 902afeb commit 290c50f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/W3/Plugin/PgCacheAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function parse_sitemap($url) {

foreach ($url_matches[1] as $url_match) {
$loc = '';
$priority = 0;
$priority = 0.5;

if (preg_match('~<loc>(.*?)</loc>~is', $url_match, $loc_matches)) {
$loc = trim($loc_matches[1]);
Expand Down

0 comments on commit 290c50f

Please sign in to comment.