XML Sitemap & Google News feeds - Version 3.3

Version Description

  • automatic exclusion of tags blog in wpmu
Download this release

Release Info

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

Code changes from version 3.2 to 3.3

Files changed (3) hide show
  1. feed-xsl.php +8 -34
  2. readme.txt +16 -10
  3. xml-sitemap.php +17 -10
feed-xsl.php CHANGED
@@ -9,10 +9,7 @@ if (!empty($_SERVER['SCRIPT_FILENAME']) && 'feed-xsl.php' == basename($_SERVER['
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">
@@ -20,35 +17,12 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
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>
@@ -97,7 +71,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
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 <?php echo XMLSFVERSION ?></a> running on <a href="http://wordpress.org/">WordPress</a>.<br />
101
  </div>
102
  </body>
103
  </html>
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" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
 
 
13
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
14
  <xsl:template match="/">
15
  <html xmlns="http://www.w3.org/1999/xhtml">
17
  <title>XML Sitemap Feed</title>
18
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
19
  <style type="text/css">
20
+ body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}
21
+ #header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}
22
+ a{color:black}
23
+ td{font-size:11px}
24
+ th{text-align:left;padding-right:30px;font-size:11px}
25
+ tr.high{background-color:whitesmoke}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  </style>
27
  </head>
28
  <body>
71
  </table>
72
  </div>
73
  <div id="footer">
74
+ Generated by <a href="http://4visions.nl/en/index.php?section=57" title="XML Sitemap Feed plugin for WordPress">XML Sitemap Feed <?php echo XMLSFVERSION ?></a> running on <a href="http://wordpress.org/">WordPress</a>.
75
  </div>
76
  </body>
77
  </html>
readme.txt CHANGED
@@ -1,16 +1,16 @@
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&item_number=2%2e6%2e2%2e9&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
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.2
8
 
9
  Creates a feed that complies with the XML Sitemap protocol ready for indexing by Google, Yahoo, MSN, Ask.com and others.
10
 
11
  == Description ==
12
 
13
- This plugin dynamically creates an XML 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 (or yourblogurl.tld/index.php?feed=sitemap.xml if you do not use a fancy permalink structure) ready to be submitted to search engines like Google, Yahoo, MSN, Ask.com and others.
14
 
15
  An entry `Sitemap: http://yourblogurl.tld/sitemap.xml` is added to the (by WordPress dynamically created) robots.txt on yourblogurl.tld/robots.txt to tell search engines where to find your XML Sitemap. If you do not use fancy URL's in WordPress, you will have to create your own robots.txt file. See FAQ's.
16
 
@@ -18,11 +18,12 @@ An entry `Sitemap: http://yourblogurl.tld/sitemap.xml` is added to the (by WordP
18
 
19
  * The main advantage of this plugin over other XML Sitemap plugins is **simplicity**. No need to change file or folder permissions or move files. In fact, no options at all!
20
  * Works out-of-the-box on **shared codebase / multi-blog setups** like [WordPress MU](http://mu.wordpress.org/), [WP_OneInstall](http://wordpress.org/extend/plugins/wp-oneinstall/), [WP Hive](http://wordpress.org/extend/plugins/wp-hive/) and others.
 
21
 
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 =
@@ -43,17 +44,19 @@ Just use that slick installation and auto update feature on your Pugins page
43
 
44
  follow these simple steps:
45
 
46
- 1. Download archive and unpack.
47
 
48
- 2. Upload the unpacked folder and its content to the /plugins/ folder.
49
 
50
  3. Activate the plugin on the Plug-ins page.
51
 
52
- Done! Check your sparkling new XML Sitemap by adapting the url yourblogurl.tld/sitemap.xml to your blog and visiting it with a browser or online XML Sitemap validator. You might also want to see if the sitemap is listed in your yourblogurl.tld/robots.txt file.
53
 
54
  = Wordpress MU =
55
 
56
- 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/.
 
 
57
 
58
  == Frequently Asked Questions ==
59
 
@@ -80,7 +83,7 @@ Dynamic pages like category pages, tag pages and archive pages are not listed in
80
 
81
  = Do I need to submit the sitemap to search engines? =
82
 
83
- No. In normal circumstances, your WordPress site will be indexed by the major search engines before you know it. The search engines will be looking for a robots.txt file and (with this plugin activated) find a pointer in it to the XML Sitemap on your blog. The search engines will return on a regular basis to see if your site has updates.
84
 
85
  = Does this plugin ping search engines? =
86
 
@@ -105,7 +108,7 @@ Sitemap: http://yourblogurl.tld/?feed=sitemap.xml
105
  User-agent: *
106
  Disallow:
107
  `
108
- You can also choose to notify major search engines of your new XML sitemap manually.
109
 
110
  = Can I change the sitemap name/URL? =
111
 
@@ -136,6 +139,9 @@ Reactivate your plugins one by one to find out which one is causing the problem.
136
 
137
  == Changelog ==
138
 
 
 
 
139
  = 3.2 =
140
  * rewrite and add_feed calls improvements
141
  * bugfix: double entry when static page is frontpage
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&item_number=2%2e6%2e2%2e9&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
4
+ Tags: xml sitemap, sitemap, google sitemap, yahoo sitemap, msn sitemap, ask sitemap, search engine, feed, wordpressmu, wpmu
5
  Requires at least: 2.5
6
  Tested up to: 2.8
7
+ Stable tag: 3.3
8
 
9
  Creates a feed that complies with the XML Sitemap protocol ready for indexing by Google, Yahoo, MSN, Ask.com and others.
10
 
11
  == Description ==
12
 
13
+ This plugin dynamically creates an XML 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 (or yourblogurl.tld/index.php?feed=sitemap.xml 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
  An entry `Sitemap: http://yourblogurl.tld/sitemap.xml` is added to the (by WordPress dynamically created) robots.txt on yourblogurl.tld/robots.txt to tell search engines where to find your XML Sitemap. If you do not use fancy URL's in WordPress, you will have to create your own robots.txt file. See FAQ's.
16
 
18
 
19
  * The main advantage of this plugin over other XML Sitemap plugins is **simplicity**. No need to change file or folder permissions or move files. In fact, no options at all!
20
  * Works out-of-the-box on **shared codebase / multi-blog setups** like [WordPress MU](http://mu.wordpress.org/), [WP_OneInstall](http://wordpress.org/extend/plugins/wp-oneinstall/), [WP Hive](http://wordpress.org/extend/plugins/wp-hive/) and others.
21
+ * Automatic priority calculation based on post age and comment/trackback activity.
22
 
23
  = Limitations =
24
 
25
  * The feed contains the front page and all posts and pages but (still) excludes category, tag and other dynamic archive pages.
26
+ * There is no way (yet) to manually set the priority of posts/pages in the sitemap but by resaving older posts from time to time, keeping the lastmod date fairly recent, you can ensure high priority for those urls.
27
  * 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 :)
28
 
29
  = Translations =
44
 
45
  follow these simple steps:
46
 
47
+ 1. Download archive.
48
 
49
+ 2. Upload the zip file via the Plugins > Add New > Upload page &hellip; OR &hellip; unpack and upload with your favourite FTP client to the /plugins/ folder.
50
 
51
  3. Activate the plugin on the Plug-ins page.
52
 
53
+ Done! Check your sparkling new XML Sitemap by visiting yourblogurl.tld/sitemap.xml (adapted to your domain name ofcourse) with a browser or any online XML Sitemap validator. You might also want to check if the sitemap is listed in your yourblogurl.tld/robots.txt file.
54
 
55
  = Wordpress MU =
56
 
57
+ 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 special knowledge of XML Sitemap submission. Just upload the complete package content to /mu-plugins/ and move the file xml-sitemap.php from the new /mu-plugins/xml-sitemap-feed/ to /mu-plugins/.
58
+
59
+ Installed in /mu-plugins/ alongside [WordPress MU Sitewide Tags Pages](http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/), XML Sitemap Feed will not create a sitemap.xml nor change robots.txt for any tag blogs. They would be full of links outside the tags blogs own domain and subsequently ignored (or worse: penalized) by Google anyway.
60
 
61
  == Frequently Asked Questions ==
62
 
83
 
84
  = Do I need to submit the sitemap to search engines? =
85
 
86
+ No. In normal circumstances, your site will be indexed by the major search engines before you know it. The search engines will be looking for a robots.txt file and (with this plugin activated) find a pointer in it to the XML Sitemap on your blog. The search engines will return on a regular basis to see if your site has updates.
87
 
88
  = Does this plugin ping search engines? =
89
 
108
  User-agent: *
109
  Disallow:
110
  `
111
+ You can also choose to notify major search engines of your new XML sitemap manually. Start with getting a [Google Webmaster Tools account](https://www.google.com/webmasters/tools/).
112
 
113
  = Can I change the sitemap name/URL? =
114
 
139
 
140
  == Changelog ==
141
 
142
+ = 3.3 =
143
+ * automatic exclusion of tags blog in wpmu
144
+
145
  = 3.2 =
146
  * rewrite and add_feed calls improvements
147
  * bugfix: double entry when static page is frontpage
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 with the XML Sitemap protocol to aid Google, Yahoo, MSN, Ask.com indexing your blog. Based on the Standard XML Sitemap Generator by Patrick Chia.
6
- Version: 3.2
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
@@ -31,10 +31,12 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravan
31
  -------------------- */
32
 
33
  // set version
34
- define('XMLSFVERSION','3.2');
35
 
36
- // check if xml-sitemap.php was moved one dir up to mu-plugins in wpmu
37
  $xmlsf_dir = dirname(__FILE__);
 
 
38
  if (file_exists($xmlsf_dir.'/xml-sitemap-feed'))
39
  $xmlsf_dir = $xmlsf_dir . '/xml-sitemap-feed';
40
 
@@ -64,8 +66,6 @@ function xml_sitemap_xsl_do_feed() {
64
  // add the rewrite rules
65
  function xml_sitemap_feed_rewrite($wp_rewrite) {
66
  $feed_rules = array(
67
- //'feed/(.+)' => 'index.php?feed='.$wp_rewrite->preg_index(1),
68
- //'^feed/sitemap$' => 'index.php?feed=sitemap',
69
  '^sitemap.xml$' => 'index.php?feed=sitemap.xml',
70
  '^sitemap.xsl$' => 'index.php?feed=sitemap.xsl'
71
  );
@@ -79,12 +79,19 @@ function xml_sitemap_robots() {
79
  }
80
 
81
  /* --------------------
82
- HOOKS
83
  -------------------- */
84
 
85
- // FEEDS
86
- add_action('init', 'xml_sitemap_add_feeds');
 
 
 
 
 
 
87
 
88
- // ROBOTSTXT
89
- add_action('do_robotstxt', 'xml_sitemap_robots');
 
90
  ?>
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 with the XML Sitemap protocol to aid Google, Yahoo, MSN, Ask.com indexing your blog. Based on the Standard XML Sitemap Generator by Patrick Chia.
6
+ Version: 3.3
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
31
  -------------------- */
32
 
33
  // set version
34
+ define('XMLSFVERSION','3.3');
35
 
36
+ // dir
37
  $xmlsf_dir = dirname(__FILE__);
38
+
39
+ // check if xml-sitemap.php is moved one dir up like in WPMU's /mu-plugins/
40
  if (file_exists($xmlsf_dir.'/xml-sitemap-feed'))
41
  $xmlsf_dir = $xmlsf_dir . '/xml-sitemap-feed';
42
 
66
  // add the rewrite rules
67
  function xml_sitemap_feed_rewrite($wp_rewrite) {
68
  $feed_rules = array(
 
 
69
  '^sitemap.xml$' => 'index.php?feed=sitemap.xml',
70
  '^sitemap.xsl$' => 'index.php?feed=sitemap.xsl'
71
  );
79
  }
80
 
81
  /* --------------------
82
+ HOOKS
83
  -------------------- */
84
 
85
+ if ( $wpdb->blogid && function_exists('get_site_option') && get_site_option('tags_blog_id') == $wpdb->blogid ) {
86
+ // we are on wpmu and this is a tags blog!
87
+ // create NO sitemap since it will be full
88
+ // of links outside the blogs own domain...
89
+ return;
90
+ } else {
91
+ // FEEDS
92
+ add_action('init', 'xml_sitemap_add_feeds');
93
 
94
+ // ROBOTSTXT
95
+ add_action('do_robotstxt', 'xml_sitemap_robots');
96
+ }
97
  ?>