XML Sitemap & Google News feeds - Version 3.8

Version Description

  • qTranslate support !
  • no more Sitemap reference in robots.txt on non-public blogs
Download this release

Release Info

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

Code changes from version 3.7.4 to 3.8

Files changed (4) hide show
  1. feed-sitemap.php +1 -1
  2. readme.txt +28 -15
  3. sitemap.xsl.php +1 -1
  4. xml-sitemap.php +14 -5
feed-sitemap.php CHANGED
@@ -9,7 +9,7 @@ status_header('200'); // force header('HTTP/1.1 200 OK') for sites without posts
9
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
10
 
11
  echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?>
12
- <?xml-stylesheet type="text/xsl" href="'.XMLSF_PLUGIN_URL.'/sitemap.xsl.php?v='.XMLSF_VERSION.'&amp;url='.XMLSF_PLUGIN_URL.'"?>
13
  <!-- generated-on="'.date('Y-m-d\TH:i:s+00:00').'" -->
14
  <!-- generator="XML Sitemap Feed plugin for WordPress" -->
15
  <!-- generator-url="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" -->
9
  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
10
 
11
  echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?>
12
+ <?xml-stylesheet type="text/xsl" href="'.XMLSF_PLUGIN_URL.'/sitemap.xsl.php?v='.XMLSF_VERSION.'&amp;uri='.str_replace(get_option('home'),"",XMLSF_PLUGIN_URL).'"?>
13
  <!-- generated-on="'.date('Y-m-d\TH:i:s+00:00').'" -->
14
  <!-- generator="XML Sitemap Feed plugin for WordPress" -->
15
  <!-- generator-url="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" -->
readme.txt CHANGED
@@ -1,20 +1,24 @@
1
  === XML Sitemap Feed ===
2
  Contributors: RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
4
- Tags: sitemap, xml sitemap, sitemap.xml, google, yahoo, bing, wpmu, feed
5
  Requires at least: 2.6
6
  Tested up to: 3.0
7
- Stable tag: 3.7.4
8
 
9
- Creates a feed that complies with the XML Sitemap protocol ready for indexing by Google, Yahoo, Bing, Ask and others.
10
 
11
  == Description ==
12
 
13
  This plugin dynamically creates an feed that complies with the **XML Sitemap** protocol. There are no options to be set and the feed becomes instantly available after activation on yourblogurl.tld/sitemap.xml and on yourblogurl.tld/?feed=sitemap for if you do not use a fancy permalink structure, ready for indexing by search engines like Google, Yahoo, MSN, Ask.com and others.
14
 
15
- A reference to it is added to your (by WordPress dynamically created) **robots.txt** on yourblogurl.tld/robots.txt to tell search engines where to find your XML Sitemap.
16
 
17
- *NOTE:* If you _do not use fancy URL's_, if you have WordPress installed in a _subdirectory_ or if have _only pages_ and no posts, WordPress does **not** generate a robots.txt output. _You'll have to create your own and upload it to your site root!_ See FAQ's.
 
 
 
 
18
 
19
  = Advantages =
20
 
@@ -22,13 +26,14 @@ A reference to it is added to your (by WordPress dynamically created) **robots.t
22
  * Completely **automatic** post URL _priority_ and _change frequency_ calculation based on post age and comment/trackback activity.
23
  * Works out-of-the-box, even on **multi-site / shared codebase / multi-blog setups** like WordPress MU, WP 3.0 in MultiSite (WPMS) mode and others.
24
  * Also works when **Network Activated** or placed in **/mu-plugins/** on WP 3.0 in MS mode and WPMU and even takes care to exclude any tags blogs to avoid malus points for link spamming.
 
25
 
26
  = Limitations =
27
 
28
- * The feed contains the front page and all posts and pages but _excludes_ category, tag and other dynamic archive pages. This should not be a problem and by most it is even advised. There even are SEO plugins around that actively make these archive pages non-index-able by search engines.
29
  * Except by _re-saving_ older posts from time to time (keeping the lastmod date fairly recent to ensure automatic high priority calculation for those urls) there is no way to manually set the priority of individual posts/pages in the sitemap. See the Faq's for more.
30
  * This plugin does not ping any search engines. But then, WordPress does this by default already via the Ping-o-Matic service so why bother? See the Faq's for more.
31
- * Since the feed is dynamically created, on _very_ large sites the creation process might take a while. Search engines are said to have a short fuse about waiting for a sitemap, so if your site is huge you may want to consider using a cache plugin that also (pre)caches feeds. If you are unfamiliar with caching and server setup start with a simple plugin such as Quick Cache but if you are looking for more options you might find solace in WP Super Cache or W3 Total Cache.
32
 
33
  = Translations =
34
 
@@ -155,13 +160,19 @@ The sitemap is dynamically generated just like a feed. There is no actual file c
155
 
156
  = I do see a sitemap.xml file in site root but it does not seem to get updated! =
157
 
158
- You are most likely looking at a sitemap.xml file that has been created by you or another XML Sitemap plugin before you started using this plugin. Just remove it and let the plugin dynamically generate it just like a feed. There is no actual file created.
 
 
 
 
 
 
159
 
160
- = I get a 404 page instead of my sitemap.xml! =
161
 
162
  Try to refresh the Permalink structure in WordPress. Go to Settings > Permalinks and re-save them. Then reload the XML Sitemap in your browser with a clean browser cache. ( Try Ctrl+R to bypass the browser cache -- this works on most but not all browsers. )
163
 
164
- = I still get a 404 page instead of both sitemap.xml and robots.txt! =
165
 
166
  There are plugins like Event Calendar (at least v.3.2.beta2) known to mess with rewrite rules, causing problems with WordPress internal feeds and robots.txt generation and thus conflict with the XML Sitemap Feed plugin. Deactivate all plugins and see if you get a basic robots.txt file showing:
167
  `
@@ -170,7 +181,7 @@ Disallow:
170
  `
171
  Reactivate your plugins one by one to find out which one is causing the problem. Then report the bug to the plugin developer.
172
 
173
- = I get a 404 page instead of robots.txt while sitemap.xml works fine! =
174
 
175
  There is a know issue with WordPress (at least up to 2.8) not generating a robots.txt when there are _no posts_ with _published_ status. If you use WordPress as a CMS with only _pages_, this will affect you.
176
 
@@ -198,6 +209,10 @@ Yes.
198
 
199
  == Changelog ==
200
 
 
 
 
 
201
  = 3.7.4 =
202
  * switch from `add_feed` (on init) to the `do_feed_$feed` hook
203
  * BUGFIX: `is_404()` condition TRUE and Response Header 404 on sites without posts
@@ -251,8 +266,6 @@ Yes.
251
 
252
  == Upgrade Notice ==
253
 
254
- = 3.7.4 =
255
- Hook improvement and bugfix release.
256
 
257
- = 3.7 =
258
- Massive changefreq calculation improvement and further priority calculation improvement taking last comment date into account.
1
  === XML Sitemap Feed ===
2
  Contributors: RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
4
+ Tags: xml, sitemap, xml sitemap, sitemap.xml, Google, Yahoo, Bing, Live, MSN, wpmu, feed
5
  Requires at least: 2.6
6
  Tested up to: 3.0
7
+ Stable tag: 3.8
8
 
9
+ Creates a feed (or more when using qTranlate) that complies with the XML Sitemap protocol for indexing by Google, Yahoo, Bing, Ask and others.
10
 
11
  == Description ==
12
 
13
  This plugin dynamically creates an feed that complies with the **XML Sitemap** protocol. There are no options to be set and the feed becomes instantly available after activation on yourblogurl.tld/sitemap.xml and on yourblogurl.tld/?feed=sitemap for if you do not use a fancy permalink structure, ready for indexing by search engines like Google, Yahoo, MSN, Ask.com and others.
14
 
15
+ **Now qTranslate compatible!** Tested in Pre-Path and Query Modus. Each language on your site will have its own XML Sitemap.
16
 
17
+ A reference to it (or them when using qTranslate) is added to the dynamically created **robots.txt** on yourblogurl.tld/robots.txt to tell search engines where to find your XML Sitemap(s).
18
+
19
+ *NOTES:*
20
+ 1. If you _do not use fancy URL's_ or you have WordPress installed in a _subdirectory_, a dynamic robots.txt will **not** be generated. _You'll have to create your own and upload it to your site root!_ See FAQ's.
21
+ 2. On large sites, it is advised to use a good caching plugin like **Quick Cache**, **WP Super Cache** or **W3 Total Cache** to improve your site _and_ sitemap performance.
22
 
23
  = Advantages =
24
 
26
  * Completely **automatic** post URL _priority_ and _change frequency_ calculation based on post age and comment/trackback activity.
27
  * Works out-of-the-box, even on **multi-site / shared codebase / multi-blog setups** like WordPress MU, WP 3.0 in MultiSite (WPMS) mode and others.
28
  * Also works when **Network Activated** or placed in **/mu-plugins/** on WP 3.0 in MS mode and WPMU and even takes care to exclude any tags blogs to avoid malus points for link spamming.
29
+ * Now **qTranslate** compatible to allow all your languages to be indexed equally.
30
 
31
  = Limitations =
32
 
33
+ * The feed contains the front page and all posts and pages but _excludes_ category, tag and other dynamic archive pages. This should not be a problem and by most it is advised to exclude them. There even are SEO plugins around that actively block these archive pages from search engines.
34
  * Except by _re-saving_ older posts from time to time (keeping the lastmod date fairly recent to ensure automatic high priority calculation for those urls) there is no way to manually set the priority of individual posts/pages in the sitemap. See the Faq's for more.
35
  * This plugin does not ping any search engines. But then, WordPress does this by default already via the Ping-o-Matic service so why bother? See the Faq's for more.
36
+ * Because the feed is dynamically created, on _very_ large sites the creation process might take a while. Search engines are said to have a short fuse about waiting for a sitemap, so you may want to consider using a cache plugin that also (pre)caches feeds. If you are unfamiliar with caching and server setup start with a simple plugin such as **Quick Cache**. For more options you might find solace in **WP Super Cache** or **W3 Total Cache**.
37
 
38
  = Translations =
39
 
160
 
161
  = I do see a sitemap.xml file in site root but it does not seem to get updated! =
162
 
163
+ You are most likely looking at a sitemap.xml file that has been created by another XML Sitemap plugin before you started using this plugin. Just remove it and let the plugin dynamically generate it just like a feed. There is no actual file created.
164
+
165
+ If that's not the case, you are probably using a caching plugin or your browser does not update to the latest feed output. Please verify.
166
+
167
+ = I get an ERROR when opening the sitemap or robots.txt ! =
168
+
169
+ The following errors might be encountered:
170
 
171
+ **404 page instead of my sitemap.xml**
172
 
173
  Try to refresh the Permalink structure in WordPress. Go to Settings > Permalinks and re-save them. Then reload the XML Sitemap in your browser with a clean browser cache. ( Try Ctrl+R to bypass the browser cache -- this works on most but not all browsers. )
174
 
175
+ **404 page instead of both sitemap.xml and robots.txt**
176
 
177
  There are plugins like Event Calendar (at least v.3.2.beta2) known to mess with rewrite rules, causing problems with WordPress internal feeds and robots.txt generation and thus conflict with the XML Sitemap Feed plugin. Deactivate all plugins and see if you get a basic robots.txt file showing:
178
  `
181
  `
182
  Reactivate your plugins one by one to find out which one is causing the problem. Then report the bug to the plugin developer.
183
 
184
+ **404 page instead of robots.txt while sitemap.xml works fine**
185
 
186
  There is a know issue with WordPress (at least up to 2.8) not generating a robots.txt when there are _no posts_ with _published_ status. If you use WordPress as a CMS with only _pages_, this will affect you.
187
 
209
 
210
  == Changelog ==
211
 
212
+ = 3.8 =
213
+ * qTranslate support !
214
+ * no more Sitemap reference in robots.txt on non-public blogs
215
+
216
  = 3.7.4 =
217
  * switch from `add_feed` (on init) to the `do_feed_$feed` hook
218
  * BUGFIX: `is_404()` condition TRUE and Response Header 404 on sites without posts
266
 
267
  == Upgrade Notice ==
268
 
269
+ = 3.8 =
270
+ Now support for **qTranslate**: one XML Sitemap for each language! Plus no more sitemap when site is set to block spidering.
271
 
 
 
sitemap.xsl.php CHANGED
@@ -69,7 +69,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>
69
  </table>
70
  </div>
71
  <div id="footer">
72
- <img src="<?php echo $_GET['url'] ?>/sitemapxml.gif" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="http://4visions.nl/en/index.php?section=57" title="XML Sitemap Feed plugin for WordPress">XML Sitemap Feed <?php echo $_GET['v'] ?></a> running on <a href="http://wordpress.org/">WordPress</a>.
73
  </div>
74
  </body>
75
  </html>
69
  </table>
70
  </div>
71
  <div id="footer">
72
+ <img src="<?php echo $_GET['uri'] ?>/sitemapxml.gif" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="http://4visions.nl/en/index.php?section=57" title="XML Sitemap Feed plugin for WordPress">XML Sitemap Feed <?php echo $_GET['v'] ?></a> running on <a href="http://wordpress.org/">WordPress</a>.
73
  </div>
74
  </body>
75
  </html>
xml-sitemap.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: XML Sitemap Feed
4
  Plugin URI: http://4visions.nl/wordpress-plugins/xml-sitemap-feed/
5
  Description: Creates a feed that complies with the XML Sitemap protocol ready for indexing by Google, Yahoo, Bing, Ask and others. Happy with it? 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&item_number=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8">Tip</a></strong> for development and support time. Thanks :)
6
- Version: 3.7.4
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=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
@@ -37,7 +37,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravan
37
  -------------------- */
38
 
39
  // set version
40
- define('XMLSF_VERSION','3.7.4');
41
 
42
  // dir
43
  $xmlsf_dir = dirname(__FILE__);
@@ -80,8 +80,14 @@ function xml_sitemap_flush_rewrite_rules() {
80
  // ROBOTSTXT //
81
  // add sitemap location in robots.txt generated by WP
82
  function xml_sitemap_robots() {
83
- if ( '0' != get_option( 'blog_public' ) )
84
- echo "\nSitemap: ".get_option('home')."/sitemap.xml\n\n";
 
 
 
 
 
 
85
  }
86
 
87
  // DE/ACTIVATION
@@ -404,7 +410,10 @@ if (get_option('xml-sitemap-feed-version') != XMLSF_VERSION) {
404
  update_option('xml-sitemap-feed-version', XMLSF_VERSION);
405
  }
406
 
407
- if ( $wpdb->blogid && function_exists('get_site_option') && get_site_option('tags_blog_id') == $wpdb->blogid ) {
 
 
 
408
  // we are on wpmu and this is a tags blog!
409
  // create NO sitemap since it will be full
410
  // of links outside the blogs own domain...
3
  Plugin Name: XML Sitemap Feed
4
  Plugin URI: http://4visions.nl/wordpress-plugins/xml-sitemap-feed/
5
  Description: Creates a feed that complies with the XML Sitemap protocol ready for indexing by Google, Yahoo, Bing, Ask and others. Happy with it? 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&item_number=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8">Tip</a></strong> for development and support time. Thanks :)
6
+ Version: 3.8
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=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
37
  -------------------- */
38
 
39
  // set version
40
+ define('XMLSF_VERSION','3.8');
41
 
42
  // dir
43
  $xmlsf_dir = dirname(__FILE__);
80
  // ROBOTSTXT //
81
  // add sitemap location in robots.txt generated by WP
82
  function xml_sitemap_robots() {
83
+ echo "\nSitemap: ".trailingslashit(get_option('home'))."sitemap.xml";
84
+ if (function_exists('qtrans_convertURL')) {
85
+ global $q_config;
86
+ foreach($q_config['enabled_languages'] as $language)
87
+ if($language != $q_config['default_language'])
88
+ echo "\nSitemap: ".qtrans_convertURL(trailingslashit(get_option('home'))."sitemap.xml",$language);
89
+ }
90
+ echo "\n\n";
91
  }
92
 
93
  // DE/ACTIVATION
410
  update_option('xml-sitemap-feed-version', XMLSF_VERSION);
411
  }
412
 
413
+ if ( '0' == get_option( 'blog_public' ) || ( $wpdb->blogid && function_exists('get_site_option') && get_site_option('tags_blog_id') == $wpdb->blogid ) ) {
414
+ // we are on a blog that blocks spiders!
415
+ // create NO sitemap
416
+ // - OR -
417
  // we are on wpmu and this is a tags blog!
418
  // create NO sitemap since it will be full
419
  // of links outside the blogs own domain...