XML Sitemap & Google News feeds - Version 5.2.2

Version Description

Bugfix release.

=

Download this release

Release Info

Developer deployer
Plugin Icon 128x128 XML Sitemap & Google News feeds
Version 5.2.2
Comparing to
See all releases

Code changes from version 5.2.1 to 5.2.2

assets/styles/sitemap-custom.xsl CHANGED
@@ -29,7 +29,7 @@
29
<tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
30
<td><xsl:value-of select="position()"/></td>
31
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
32
- <td><xsl:value-of select="concat(sitemap:priority*100,'%')"/></td>
33
</tr>
34
</xsl:for-each>
35
</table>
29
<tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
30
<td><xsl:value-of select="position()"/></td>
31
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
32
+ <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
33
</tr>
34
</xsl:for-each>
35
</table>
assets/styles/sitemap-index.xsl CHANGED
@@ -32,7 +32,7 @@
32
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
33
<a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a>
34
</td>
35
- <td><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</td>
36
</tr>
37
</xsl:for-each>
38
</table>
32
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
33
<a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a>
34
</td>
35
+ <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
36
</tr>
37
</xsl:for-each>
38
</table>
assets/styles/sitemap-taxonomy.xsl CHANGED
@@ -30,8 +30,8 @@
30
<tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
31
<td><xsl:value-of select="position()"/></td>
32
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
33
- <td><xsl:value-of select="concat(sitemap:priority*100,'%')"/></td>
34
- <td><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</td>
35
</tr>
36
</xsl:for-each>
37
</table>
30
<tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
31
<td><xsl:value-of select="position()"/></td>
32
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
33
+ <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
34
+ <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
35
</tr>
36
</xsl:for-each>
37
</table>
assets/styles/sitemap.xsl CHANGED
@@ -32,9 +32,9 @@
32
<tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
33
<td><xsl:value-of select="position()"/></td>
34
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
35
- <td><xsl:value-of select="count(image:image)"/></td>
36
- <td><xsl:value-of select="concat(sitemap:priority*100,'%')"/></td>
37
- <td><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</td>
38
</tr>
39
</xsl:for-each>
40
</table>
32
<tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
33
<td><xsl:value-of select="position()"/></td>
34
<td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
35
+ <td><xsl:if test="image:image"><xsl:value-of select="count(image:image)"/></xsl:if></td>
36
+ <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
37
+ <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
38
</tr>
39
</xsl:for-each>
40
</table>
controllers/class.xmlsf-sitemap-news.php CHANGED
@@ -64,11 +64,9 @@ class XMLSF_Sitemap_News
64
65
$news_tags = (array) get_option('xmlsf_news_tags');
66
67
- error_log('6');
68
// is this an active post type?
69
if ( empty( $news_tags['post_type'] ) || ! in_array( $post->post_type, (array) $news_tags['post_type'] ) ) return;
70
71
- error_log('7');
72
// are categories limited and is not in correct category?
73
if ( ! empty( $news_tags['categories'] ) ) {
74
$cats = wp_get_post_categories( $post->ID, array( 'fields' => 'ids' ) );
64
65
$news_tags = (array) get_option('xmlsf_news_tags');
66
67
// is this an active post type?
68
if ( empty( $news_tags['post_type'] ) || ! in_array( $post->post_type, (array) $news_tags['post_type'] ) ) return;
69
70
// are categories limited and is not in correct category?
71
if ( ! empty( $news_tags['categories'] ) ) {
72
$cats = wp_get_post_categories( $post->ID, array( 'fields' => 'ids' ) );
controllers/functions.php CHANGED
@@ -52,10 +52,6 @@ function xmlsf_init() {
52
add_filter( 'xmlsf_post_types', 'xmlsf_filter_post_types' );
53
54
xmlsf_sitemap( $sitemaps['sitemap'] );
55
-
56
- // add feed type, index can now be accessed via /feed/sitemap too
57
- add_feed( 'sitemap', 'xmlsf_load_template_index' );
58
- //add_filter( 'feed_content_type', 'xmlsf_content_type', 10, 2 );
59
}
60
61
// common sitemap element filters
52
add_filter( 'xmlsf_post_types', 'xmlsf_filter_post_types' );
53
54
xmlsf_sitemap( $sitemaps['sitemap'] );
55
}
56
57
// common sitemap element filters
models/functions.admin.php CHANGED
@@ -79,7 +79,7 @@ class XMLSF_Admin_Sanitize
79
$new = array_filter($new);
80
$new = reset($new);
81
}
82
- $input = $new ? explode( PHP_EOL, sanitize_textarea_field( $new ) ) : array();
83
84
// build sanitized output
85
$sanitized = array();
@@ -122,6 +122,6 @@ class XMLSF_Admin_Sanitize
122
if ( empty($old) && !empty($new) )
123
set_transient('xmlsf_check_static_files','');
124
125
- return sanitize_textarea_field( $new );
126
}
127
}
79
$new = array_filter($new);
80
$new = reset($new);
81
}
82
+ $input = $new ? explode( PHP_EOL, strip_tags( $new ) ) : array();
83
84
// build sanitized output
85
$sanitized = array();
122
if ( empty($old) && !empty($new) )
123
set_transient('xmlsf_check_static_files','');
124
125
+ return strip_tags( $new );
126
}
127
}
models/functions.public-sitemap.php CHANGED
@@ -17,7 +17,7 @@ function xmlsf_get_root_data() {
17
$url = pll_home_url( $language['slug'] );
18
$data[$url] = array(
19
'priority' => '1.0',
20
- 'lastmod' => mysql2date( 'c', get_lastpostdate('blog') )
21
// TODO make lastmod date language specific
22
);
23
}
@@ -27,7 +27,7 @@ function xmlsf_get_root_data() {
27
$url = $sitepress->language_url($term);
28
$data[$url] = array(
29
'priority' => '1.0',
30
- 'lastmod' => mysql2date( 'c', get_lastpostdate('blog') )
31
// TODO make lastmod date language specific
32
);
33
}
@@ -36,7 +36,7 @@ function xmlsf_get_root_data() {
36
$data = array(
37
trailingslashit( home_url() ) => array(
38
'priority' => '1.0',
39
- 'lastmod' => mysql2date( 'c', get_lastpostdate('blog') )
40
)
41
);
42
}
@@ -178,7 +178,7 @@ function xmlsf_get_post_modified() {
178
179
}
180
181
- return ! empty( $lastmod ) ? mysql2date( 'c', $lastmod ) : false;
182
183
}
184
@@ -232,7 +232,7 @@ function xmlsf_get_term_modified( $term ) {
232
233
}
234
235
- return ! empty( $lastmod ) ? mysql2date( 'c', $lastmod ) : false;
236
237
}
238
@@ -258,7 +258,7 @@ function xmlsf_get_taxonomy_modified( $taxonomy ) {
258
$lastmodified = array_filter( $lastmodified );
259
$lastmod = end( $lastmodified );
260
261
- return mysql2date( 'c', $lastmod );
262
263
}
264
17
$url = pll_home_url( $language['slug'] );
18
$data[$url] = array(
19
'priority' => '1.0',
20
+ 'lastmod' => mysql2date( DATE_W3C, get_lastpostdate('blog') )
21
// TODO make lastmod date language specific
22
);
23
}
27
$url = $sitepress->language_url($term);
28
$data[$url] = array(
29
'priority' => '1.0',
30
+ 'lastmod' => mysql2date( DATE_W3C, get_lastpostdate('blog') )
31
// TODO make lastmod date language specific
32
);
33
}
36
$data = array(
37
trailingslashit( home_url() ) => array(
38
'priority' => '1.0',
39
+ 'lastmod' => mysql2date( DATE_W3C, get_lastpostdate('blog') )
40
)
41
);
42
}
178
179
}
180
181
+ return ! empty( $lastmod ) ? mysql2date( DATE_W3C, $lastmod ) : false;
182
183
}
184
232
233
}
234
235
+ return ! empty( $lastmod ) ? mysql2date( DATE_W3C, $lastmod ) : false;
236
237
}
238
258
$lastmodified = array_filter( $lastmodified );
259
$lastmod = end( $lastmodified );
260
261
+ return mysql2date( DATE_W3C, $lastmod );
262
263
}
264
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: sitemap, xml sitemap, news sitemap, sitemap.xml, robots.txt, Google, Googl
5
Requires at least: 4.4
6
Requires PHP: 5.4
7
Tested up to: 5.2
8
- Stable tag: 5.2.1
9
10
XML and Google News Sitemaps to feed the hungry spiders. Multisite, WP Super Cache, Polylang and WPML compatible.
11
5
Requires at least: 4.4
6
Requires PHP: 5.4
7
Tested up to: 5.2
8
+ Stable tag: 5.2.2
9
10
XML and Google News Sitemaps to feed the hungry spiders. Multisite, WP Super Cache, Polylang and WPML compatible.
11
views/feed-sitemap-news.php CHANGED
@@ -50,7 +50,7 @@ if ( have_posts() ) :
50
echo apply_filters( 'the_title_xmlsitemap', get_bloginfo('name') ); ?></news:name>
51
<news:language><?php echo xmlsf_get_language( $post->ID ); ?></news:language>
52
</news:publication>
53
- <news:publication_date><?php echo mysql2date( 'c', $post->post_date ); ?></news:publication_date>
54
<news:title><?php echo apply_filters( 'the_title_xmlsitemap', get_the_title() ); ?></news:title>
55
<news:keywords><?php echo implode( ', ', apply_filters( 'xmlsf_news_keywords', array() ) ); ?></news:keywords>
56
<news:stock_tickers><?php echo implode( ', ', apply_filters( 'xmlsf_news_stock_tickers', array() ) ); ?></news:stock_tickers>
50
echo apply_filters( 'the_title_xmlsitemap', get_bloginfo('name') ); ?></news:name>
51
<news:language><?php echo xmlsf_get_language( $post->ID ); ?></news:language>
52
</news:publication>
53
+ <news:publication_date><?php echo mysql2date( DATE_W3C, $post->post_date ); ?></news:publication_date>
54
<news:title><?php echo apply_filters( 'the_title_xmlsitemap', get_the_title() ); ?></news:title>
55
<news:keywords><?php echo implode( ', ', apply_filters( 'xmlsf_news_keywords', array() ) ); ?></news:keywords>
56
<news:stock_tickers><?php echo implode( ', ', apply_filters( 'xmlsf_news_stock_tickers', array() ) ); ?></news:stock_tickers>
views/feed-sitemap.php CHANGED
@@ -18,7 +18,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
18
http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd">
19
<sitemap>
20
<loc><?php echo xmlsf_get_index_url('home'); ?></loc>
21
- <lastmod><?php echo mysql2date( 'c', get_lastpostdate( 'blog' ) ); ?></lastmod>
22
</sitemap>
23
<?php
24
// add rules for public post types
@@ -34,7 +34,7 @@ if ( is_array($post_types) ) :
34
?>
35
<sitemap>
36
<loc><?php echo $url; ?></loc>
37
- <lastmod><?php echo mysql2date( 'c', get_lastmodified( 'blog', $post_type, $m ) ); ?></lastmod>
38
</sitemap>
39
<?php
40
}
18
http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd">
19
<sitemap>
20
<loc><?php echo xmlsf_get_index_url('home'); ?></loc>
21
+ <lastmod><?php echo mysql2date( DATE_W3C, get_lastpostdate( 'blog' ) ); ?></lastmod>
22
</sitemap>
23
<?php
24
// add rules for public post types
34
?>
35
<sitemap>
36
<loc><?php echo $url; ?></loc>
37
+ <lastmod><?php echo mysql2date( DATE_W3C, get_lastmodified( 'blog', $post_type, $m ) ); ?></lastmod>
38
</sitemap>
39
<?php
40
}
xml-sitemap.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: XML Sitemap & Google News
4
Plugin URI: http://status301.net/wordpress-plugins/xml-sitemap-feed/
5
Description: Feed the hungry spiders in compliance with the XML Sitemap and Google News protocols. Happy with the results? Please leave me a <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed">tip</a></strong> for continued development and support. Thanks :)
6
- Version: 5.2.1
7
Text Domain: xml-sitemap-feed
8
Requires at least: 4.6
9
Requires PHP: 5.4
@@ -11,7 +11,7 @@ Author: RavanH
11
Author URI: http://status301.net/
12
*/
13
14
- define( 'XMLSF_VERSION', '5.2.1' );
15
16
/* Copyright 2019 RavanH
17
http://status301.net/
3
Plugin Name: XML Sitemap & Google News
4
Plugin URI: http://status301.net/wordpress-plugins/xml-sitemap-feed/
5
Description: Feed the hungry spiders in compliance with the XML Sitemap and Google News protocols. Happy with the results? Please leave me a <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed">tip</a></strong> for continued development and support. Thanks :)
6
+ Version: 5.2.2
7
Text Domain: xml-sitemap-feed
8
Requires at least: 4.6
9
Requires PHP: 5.4
11
Author URI: http://status301.net/
12
*/
13
14
+ define( 'XMLSF_VERSION', '5.2.2' );
15
16
/* Copyright 2019 RavanH
17
http://status301.net/