Version Description
- added styling to the xml feed to make it human readable
Download this release
Release Info
Developer | RavanH |
Plugin | XML Sitemap & Google News feeds |
Version | 3.0 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 3.0
- readme.txt +16 -5
- template.php → template-xml.php +10 -5
- template-xsl.php +105 -0
- xml-sitemap.php +18 -6
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravan
|
|
4 |
Tags: xml sitemap, sitemap, google sitemap, yahoo sitemap, msn sitemap, ask sitemap, search engine, feed
|
5 |
Requires at least: 2.5
|
6 |
Tested up to: 2.8
|
7 |
-
Stable tag:
|
8 |
|
9 |
Creates a feed that complies to the XML Sitemap protocol ready to be submitted to Google, Yahoo, MSN, Ask.com and others.
|
10 |
|
@@ -22,7 +22,7 @@ An entry `Sitemap: http://yourblogurl.tld/sitemap.xml` is added to the (by WordP
|
|
22 |
= Limitations =
|
23 |
|
24 |
* The feed contains the front page and all posts and pages but (still) excludes category, tag and other dynamic archive pages.
|
25 |
-
* There is no way (yet) to manually
|
26 |
* The number of posts listed in the sitemap is limited to 1000. This should satisfy most blogs while limiting the sitemap size on bigger blogs by stripping of the oldest posts. Please let me know if you need more than your most recent 1000 posts listed in your sitemap.xml :)
|
27 |
|
28 |
= Translations =
|
@@ -53,11 +53,19 @@ Done! Check your sparkling new XML Sitemap by adapting the url yourblogurl.tld/s
|
|
53 |
|
54 |
The plugin also works from the /mu-plugins/ folder where it runs quietly in the background without bothering any blog owner with new options or the need for extra knowledge of XML Sitemap submission. Just upload the complete package content and move the file xml-sitemap.php from /mu-plugins/xml-sitemap-feed/ to /mu-plugins/.
|
55 |
|
56 |
-
== Frequently Asked Questions ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
= How are the values for priority and changefreq calculated? =
|
59 |
|
60 |
-
The front page has a priority of 1.0, pages are always 0.6 and posts
|
61 |
|
62 |
Dynamic pages like category pages, tag pages and archive pages are not listed in this version yet.
|
63 |
|
@@ -107,6 +115,9 @@ Disallow:
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
|
|
|
|
|
|
110 |
= 2.1 =
|
111 |
* bugfix: lastmod timezone offset displayed wrong (extra space and missing double-colon)
|
112 |
|
@@ -116,7 +127,7 @@ Disallow:
|
|
116 |
|
117 |
= 1.0 =
|
118 |
* changed feed template location to avoid the need to relocate files outside the plugins folder
|
119 |
-
* bugfix: get_post_modified_time instead of get_post_time
|
120 |
* bugfix: rewrite rules causing unlimited amount of sitemap feeds on any url ending with sitemap.xml instead of just one in the root
|
121 |
|
122 |
= 0.1 =
|
4 |
Tags: xml sitemap, sitemap, google sitemap, yahoo sitemap, msn sitemap, ask sitemap, search engine, feed
|
5 |
Requires at least: 2.5
|
6 |
Tested up to: 2.8
|
7 |
+
Stable tag: 3.0
|
8 |
|
9 |
Creates a feed that complies to the XML Sitemap protocol ready to be submitted to Google, Yahoo, MSN, Ask.com and others.
|
10 |
|
22 |
= Limitations =
|
23 |
|
24 |
* The feed contains the front page and all posts and pages but (still) excludes category, tag and other dynamic archive pages.
|
25 |
+
* There is no way (yet) to manually set the priority of posts/pages in the sitemap but since version 2.0 there is some basic automatic priority calculation (based on post age and comment activity) doing the work for you. However, by resaving older posts/pages from time to time, keeping the lastmod date fairly recent, you can ensure high priority for those urls.
|
26 |
* The number of posts listed in the sitemap is limited to 1000. This should satisfy most blogs while limiting the sitemap size on bigger blogs by stripping of the oldest posts. Please let me know if you need more than your most recent 1000 posts listed in your sitemap.xml :)
|
27 |
|
28 |
= Translations =
|
53 |
|
54 |
The plugin also works from the /mu-plugins/ folder where it runs quietly in the background without bothering any blog owner with new options or the need for extra knowledge of XML Sitemap submission. Just upload the complete package content and move the file xml-sitemap.php from /mu-plugins/xml-sitemap-feed/ to /mu-plugins/.
|
55 |
|
56 |
+
== Frequently Asked Questions ==
|
57 |
+
|
58 |
+
= Can I manipulate values for priority and changefreq? =
|
59 |
+
|
60 |
+
Yes and No. Since this plugin has no options page there is no way (yet) to manually set the priority of urls in the sitemap. Since version 2.0 there is some basic automatic priority calculation (based on post age and comment activity) doing the work for you.
|
61 |
+
|
62 |
+
This feature can be used to your advantage: by resaving older posts from time to time, keeping the lastmod date fairly recent, you can ensure a priority of 70% (0.7) for those urls. And if you have comments on on those pages, the priority can even go up to 90% (0.9).
|
63 |
+
|
64 |
+
If you cannot live with these rules, edit the values $post_priority, $minpost_priority, $maxpost_priority, $page_priority, $frontpage_priority in xml-sitemap-feed/template-xml.php
|
65 |
|
66 |
= How are the values for priority and changefreq calculated? =
|
67 |
|
68 |
+
The front page has a fixed priority of 100% (1.0), pages are always 60% (0.6) and posts have a default priority of 70% (0.7) but can vary between 30% (0.3) and 90% (0.9) depending on comments and post age. the cangefreq of the frontpage is set to daily, monthly for pages and either monthly or weekly for posts depending on comments.
|
69 |
|
70 |
Dynamic pages like category pages, tag pages and archive pages are not listed in this version yet.
|
71 |
|
115 |
|
116 |
== Changelog ==
|
117 |
|
118 |
+
= 3.0 =
|
119 |
+
* added styling to the xml feed to make it human readable
|
120 |
+
|
121 |
= 2.1 =
|
122 |
* bugfix: lastmod timezone offset displayed wrong (extra space and missing double-colon)
|
123 |
|
127 |
|
128 |
= 1.0 =
|
129 |
* changed feed template location to avoid the need to relocate files outside the plugins folder
|
130 |
+
* bugfix: `get_post_modified_time` instead of `get_post_time`
|
131 |
* bugfix: rewrite rules causing unlimited amount of sitemap feeds on any url ending with sitemap.xml instead of just one in the root
|
132 |
|
133 |
= 0.1 =
|
template.php → template-xml.php
RENAMED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* XML Sitemap Feed Template
|
4 |
**/
|
5 |
|
6 |
-
if (!empty($_SERVER['SCRIPT_FILENAME']) && '
|
7 |
die ('Please do not load this page directly. Thanks!');
|
8 |
|
9 |
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
|
@@ -18,13 +18,18 @@ $page_priority = 0.6;
|
|
18 |
$frontpage_priority = 1.0;
|
19 |
|
20 |
?>
|
21 |
-
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
23 |
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
24 |
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
|
25 |
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
26 |
<url>
|
27 |
-
<loc><?php bloginfo_rss('url')
|
28 |
<lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $lastpostmodified, false); ?></lastmod>
|
29 |
<changefreq>daily</changefreq>
|
30 |
<priority>1.0</priority>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* XML Sitemap Feed Template
|
4 |
**/
|
5 |
|
6 |
+
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'template-xml.php' == basename($_SERVER['SCRIPT_FILENAME']))
|
7 |
die ('Please do not load this page directly. Thanks!');
|
8 |
|
9 |
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
|
18 |
$frontpage_priority = 1.0;
|
19 |
|
20 |
?>
|
21 |
+
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>
|
22 |
+
<?xml-stylesheet type="text/xsl" href="'.get_option('siteurl').'/sitemap.xsl"?>
|
23 |
+
<!-- generated-on="'.date('Y-m-d\TH:i:s+00:00').'" -->
|
24 |
+
<!-- generator="XML Sitemap Feed plugin for WordPress" -->
|
25 |
+
<!-- generator-url="http://4visions.nl/en/index.php?section=57" -->
|
26 |
+
<!-- generator-version="'.XMLSFVERSION.'" -->
|
27 |
+
'; ?>
|
28 |
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
29 |
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
|
30 |
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
31 |
<url>
|
32 |
+
<loc><?php bloginfo_rss('url') ?>/</loc>
|
33 |
<lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $lastpostmodified, false); ?></lastmod>
|
34 |
<changefreq>daily</changefreq>
|
35 |
<priority>1.0</priority>
|
template-xsl.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* XML Sitemap Feed Styleheet Template
|
4 |
+
**/
|
5 |
+
|
6 |
+
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'template-xsl.php' == basename($_SERVER['SCRIPT_FILENAME']))
|
7 |
+
die ('Please do not load this page directly. Thanks!');
|
8 |
+
|
9 |
+
header('Content-Type: text/xsl; charset=' . get_option('blog_charset'), true);
|
10 |
+
|
11 |
+
echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
|
12 |
+
<xsl:stylesheet version="2.0"
|
13 |
+
xmlns:html="http://www.w3.org/TR/REC-html40"
|
14 |
+
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
|
15 |
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
16 |
+
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
|
17 |
+
<xsl:template match="/">
|
18 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
19 |
+
<head>
|
20 |
+
<title>XML Sitemap Feed</title>
|
21 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
22 |
+
<style type="text/css">
|
23 |
+
body {
|
24 |
+
font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana;
|
25 |
+
font-size:13px;
|
26 |
+
}
|
27 |
+
|
28 |
+
td {
|
29 |
+
font-size:11px;
|
30 |
+
}
|
31 |
+
|
32 |
+
th {
|
33 |
+
text-align:left;
|
34 |
+
padding-right:30px;
|
35 |
+
font-size:11px;
|
36 |
+
}
|
37 |
+
|
38 |
+
tr.high {
|
39 |
+
background-color:whitesmoke;
|
40 |
+
}
|
41 |
+
|
42 |
+
#header, #footer {
|
43 |
+
padding:2px;
|
44 |
+
margin:10px;
|
45 |
+
font-size:8pt;
|
46 |
+
color:gray;
|
47 |
+
}
|
48 |
+
|
49 |
+
a {
|
50 |
+
color:black;
|
51 |
+
}
|
52 |
+
</style>
|
53 |
+
</head>
|
54 |
+
<body>
|
55 |
+
<h1>XML Sitemap Feed</h1>
|
56 |
+
<div id="header">
|
57 |
+
This is an XML Sitemap to aid search engines like <a href="http://www.google.com">Google</a>, <a href="http://search.msn.com">MSN Search</a>, <a href="http://www.yahoo.com">Yahoo!</a> and <a href="http://www.ask.com">Ask.com</a> indexing your site better. Read more about XML sitemaps on <a href="http://sitemaps.org">Sitemaps.org</a>.
|
58 |
+
</div>
|
59 |
+
<div id="content">
|
60 |
+
<table cellpadding="5">
|
61 |
+
<tr style="border-bottom:1px black solid;">
|
62 |
+
<th>#</th>
|
63 |
+
<th>URL</th>
|
64 |
+
<th>Priority</th>
|
65 |
+
<th>Change Frequency</th>
|
66 |
+
<th>Last Changed</th>
|
67 |
+
</tr>
|
68 |
+
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
|
69 |
+
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
|
70 |
+
<xsl:for-each select="sitemap:urlset/sitemap:url">
|
71 |
+
<tr>
|
72 |
+
<xsl:if test="position() mod 2 != 1">
|
73 |
+
<xsl:attribute name="class">high</xsl:attribute>
|
74 |
+
</xsl:if>
|
75 |
+
<td>
|
76 |
+
<xsl:value-of select="position()"/>
|
77 |
+
</td>
|
78 |
+
<td>
|
79 |
+
<xsl:variable name="itemURL">
|
80 |
+
<xsl:value-of select="sitemap:loc"/>
|
81 |
+
</xsl:variable>
|
82 |
+
<a href="{$itemURL}">
|
83 |
+
<xsl:value-of select="sitemap:loc"/>
|
84 |
+
</a>
|
85 |
+
</td>
|
86 |
+
<td>
|
87 |
+
<xsl:value-of select="concat(sitemap:priority*100,'%')"/>
|
88 |
+
</td>
|
89 |
+
<td>
|
90 |
+
<xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
|
91 |
+
</td>
|
92 |
+
<td>
|
93 |
+
<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
</xsl:for-each>
|
97 |
+
</table>
|
98 |
+
</div>
|
99 |
+
<div id="footer">
|
100 |
+
Generated by <a href="http://4visions.nl/en/index.php?section=57" title="XML Sitemap Feed plugin for WordPress">XML Sitemap Feed plugin</a> running on <a href="http://wordpress.org/">WordPress</a>.<br />
|
101 |
+
</div>
|
102 |
+
</body>
|
103 |
+
</html>
|
104 |
+
</xsl:template>
|
105 |
+
</xsl:stylesheet>
|
xml-sitemap.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: XML Sitemap Feed
|
4 |
Plugin URI: http://4visions.nl/en/index.php?section=57
|
5 |
Description: Creates a dynamic XML feed that complies to the XML Sitemap protocol ready be submitted to Google, Yahoo, MSN, Ask.com and others. Based on the Standard XML Sitemap Generator by Patrick Chia.
|
6 |
-
Version:
|
7 |
Author: RavanH
|
8 |
Author URI: http://4visions.nl/
|
9 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=2%2e6%2e2%2e9&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
|
@@ -26,6 +26,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravan
|
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
|
|
|
|
29 |
function xml_sitemap_flush_rules() {
|
30 |
global $wp_rewrite;
|
31 |
$wp_rewrite->flush_rules();
|
@@ -35,7 +37,8 @@ add_action('init', 'xml_sitemap_flush_rules');
|
|
35 |
function xml_sitemap_feed_rewrite($wp_rewrite) {
|
36 |
$feed_rules = array(
|
37 |
'^sitemap.xml$' => 'index.php?feed=sitemap',
|
38 |
-
'^feed/sitemap$' => 'index.php?feed=sitemap'
|
|
|
39 |
);
|
40 |
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
|
41 |
}
|
@@ -43,15 +46,24 @@ add_filter('generate_rewrite_rules', 'xml_sitemap_feed_rewrite');
|
|
43 |
|
44 |
function xml_sitemap_do_feed() {
|
45 |
$dir = dirname(__FILE__);
|
46 |
-
if (file_exists($dir.'/xml-sitemap-feed')) //
|
47 |
-
load_template( $dir . '/xml-sitemap-feed/template.php' );
|
48 |
else
|
49 |
-
load_template( $dir . '/template.php' );
|
50 |
}
|
51 |
add_action('do_feed_sitemap', 'xml_sitemap_do_feed', 10, 1);
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
function xml_sitemap_robots() {
|
54 |
-
echo "\nSitemap: ".get_option('siteurl')."/sitemap.xml\n
|
55 |
}
|
56 |
add_action('do_robotstxt', 'xml_sitemap_robots');
|
57 |
?>
|
3 |
Plugin Name: XML Sitemap Feed
|
4 |
Plugin URI: http://4visions.nl/en/index.php?section=57
|
5 |
Description: Creates a dynamic XML feed that complies to the XML Sitemap protocol ready be submitted to Google, Yahoo, MSN, Ask.com and others. Based on the Standard XML Sitemap Generator by Patrick Chia.
|
6 |
+
Version: 3.0
|
7 |
Author: RavanH
|
8 |
Author URI: http://4visions.nl/
|
9 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=2%2e6%2e2%2e9&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
+
define('XMLSFVERSION','3.0');
|
30 |
+
|
31 |
function xml_sitemap_flush_rules() {
|
32 |
global $wp_rewrite;
|
33 |
$wp_rewrite->flush_rules();
|
37 |
function xml_sitemap_feed_rewrite($wp_rewrite) {
|
38 |
$feed_rules = array(
|
39 |
'^sitemap.xml$' => 'index.php?feed=sitemap',
|
40 |
+
'^feed/sitemap$' => 'index.php?feed=sitemap',
|
41 |
+
'^sitemap.xsl$' => 'index.php?feed=sitemapxsl'
|
42 |
);
|
43 |
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
|
44 |
}
|
46 |
|
47 |
function xml_sitemap_do_feed() {
|
48 |
$dir = dirname(__FILE__);
|
49 |
+
if (file_exists($dir.'/xml-sitemap-feed')) // check if xml-sitemap.php was moved one dir up (wpmu)
|
50 |
+
load_template( $dir . '/xml-sitemap-feed/template-xml.php' );
|
51 |
else
|
52 |
+
load_template( $dir . '/template-xml.php' );
|
53 |
}
|
54 |
add_action('do_feed_sitemap', 'xml_sitemap_do_feed', 10, 1);
|
55 |
|
56 |
+
function xml_sitemap_xsl_do_feed() {
|
57 |
+
$dir = dirname(__FILE__);
|
58 |
+
if (file_exists($dir.'/xml-sitemap-feed')) // check if xml-sitemap.php was moved one dir up (wpmu)
|
59 |
+
load_template( $dir . '/xml-sitemap-feed/template-xsl.php' );
|
60 |
+
else
|
61 |
+
load_template( $dir . '/template-xsl.php' );
|
62 |
+
}
|
63 |
+
add_action('do_feed_sitemapxsl', 'xml_sitemap_xsl_do_feed', 10, 1);
|
64 |
+
|
65 |
function xml_sitemap_robots() {
|
66 |
+
echo "\nSitemap: ".get_option('siteurl')."/sitemap.xml\n";
|
67 |
}
|
68 |
add_action('do_robotstxt', 'xml_sitemap_robots');
|
69 |
?>
|