Google XML Sitemap for Videos - Version 2.6

Version Description

  • fixed - XSL stylesheet to fit more videos
Download this release

Release Info

Developer labnol
Plugin Icon wp plugin Google XML Sitemap for Videos
Version 2.6
Comparing to
See all releases

Code changes from version 2.5.1 to 2.6

Files changed (3) hide show
  1. readme.txt +15 -7
  2. video-sitemap.php +31 -26
  3. video-sitemap.xsl +62 -66
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: labnol
3
  Tags: youtube, xml sitemaps, google sitemaps, videos, seo, sitemaps, video sitemap
4
  Requires at least: 2.9.2
5
- Tested up to: 3.3.1
6
- Stable tag: 2.5.1
7
 
8
  This plugin will help you generate Google Video Sitemaps (XML) for your WordPress blog.
9
 
@@ -15,13 +15,18 @@ The Video Sitemap plugin will generate an XML Sitemap for your WordPress blog us
15
 
16
  Your Video Sitemap will includes web pages which embed videos from YouTube or which links to videos on YouTube. If a YouTube video that you have in your blog has been removed from YouTube, the record in the Sitemap file will be ignored by Googlebot.
17
 
18
- **Related links:**
 
19
 
20
  * [Google XML Sitemap for Mobile](http://wordpress.org/extend/plugins/google-mobile-sitemap/)
21
  * [Google XML Sitemap for Images](http://wordpress.org/extend/plugins/google-image-sitemap/)
22
- * [Must have WordPress Plug-ins](http://www.labnol.org/software/must-have-wordpress-plugins/14034/) on [Digital Inspiration](http://www.labnol.org/ "Technology Blog")
23
 
24
- For updates, you can follow the [author](http://www.labnol.org/about/ "Amit Agarwal") on [Twitter](http://twitter.com/labnol) and [Facebook](http://www.facebook.com/digital.inspiration).
 
 
 
 
 
25
 
26
  == Installation ==
27
 
@@ -62,7 +67,10 @@ The Sitemaps protocol enables you to let search engines know what content you wo
62
 
63
  == Changelog ==
64
 
65
- = 2.5 =
 
 
 
66
  * added - Your sitemaps now look gorgeous in the browser. Just open the sitemap-video.xml file directly in any modern browser.
67
  * added - Sitemap now renders higher quality image thumbnails for YouTube videos
68
 
@@ -85,4 +93,4 @@ The Sitemaps protocol enables you to let search engines know what content you wo
85
  * More error handling included.
86
 
87
  = 2.0.1 =
88
- * Better Error Handline
2
  Contributors: labnol
3
  Tags: youtube, xml sitemaps, google sitemaps, videos, seo, sitemaps, video sitemap
4
  Requires at least: 2.9.2
5
+ Tested up to: 3.4.1
6
+ Stable tag: 2.6
7
 
8
  This plugin will help you generate Google Video Sitemaps (XML) for your WordPress blog.
9
 
15
 
16
  Your Video Sitemap will includes web pages which embed videos from YouTube or which links to videos on YouTube. If a YouTube video that you have in your blog has been removed from YouTube, the record in the Sitemap file will be ignored by Googlebot.
17
 
18
+
19
+ **Related WordPress plugins:**
20
 
21
  * [Google XML Sitemap for Mobile](http://wordpress.org/extend/plugins/google-mobile-sitemap/)
22
  * [Google XML Sitemap for Images](http://wordpress.org/extend/plugins/google-image-sitemap/)
 
23
 
24
+ **WordPress Resources:**
25
+
26
+ * [Must have WordPress Plug-ins](http://www.labnol.org/software/must-have-wordpress-plugins/14034/)
27
+ * [Improving WordPress Security](http://www.labnol.org/internet/improve-wordpress-security/24639/)
28
+
29
+ The Sitemap plugins are written by [Amit Agarwal](http://www.labnol.org/about/ "Amit Agarwal") of [Digital Inspiration](http://www.labnol.org/ "Tech Blog"). For support, you can leave a comment in the [WordPress forum](http://wordpress.org/support/plugin/xml-sitemaps-for-videos) or send a tweet to [@labnol](http://twitter.com/labnol).
30
 
31
  == Installation ==
32
 
67
 
68
  == Changelog ==
69
 
70
+ = 2.6 =
71
+ * fixed - XSL stylesheet to fit more videos
72
+
73
+ = 2.5 =
74
  * added - Your sitemaps now look gorgeous in the browser. Just open the sitemap-video.xml file directly in any modern browser.
75
  * added - Sitemap now renders higher quality image thumbnails for YouTube videos
76
 
93
  * More error handling included.
94
 
95
  = 2.0.1 =
96
+ * Better Error Handling
video-sitemap.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google XML Sitemap for Videos
4
  Plugin URI: http://www.labnol.org/software/xml-video-sitemaps-for-google/14085/
5
  Description: This plugin will generate a XML Video Sitemap for your WordPress blog. Open the <a href="tools.php?page=video-sitemap-generate-page">settings page</a> to create your video sitemap.
6
  Author: Amit Agarwal
7
- Version: 2.5.1
8
  Author URI: http://www.labnol.org/
9
  */
10
 
@@ -57,32 +57,37 @@ exit();
57
 
58
  ?>
59
 
60
- <div class="wrap">
61
- <h2>XML Sitemap for Videos</h2>
62
- <?php $sitemapurl = get_bloginfo('home') . "/sitemap-video.xml"; ?>
63
- <p>The XML Sitemap was generated successfully. Please open the <a target="_blank" href="<?php echo $sitemapurl; ?>">Sitemap file</a> in your favorite web browser to confirm that there are no errors.</p>
64
- <p>You can submit your Video XML Sitemap through <a href="http://www.google.com/webmasters/tools/" target="_blank">Webmaster Tools</a> or you can directly <a target="_blank" href="http://www.google.com/webmasters/sitemaps/ping?sitemap=<?php echo $sitemapurl; ?>">ping Google</a>.</p>
65
- <h3>Stay Connected</h3>
66
- <p><a href="https://twitter.com/labnol" class="twitter-follow-button" data-show-count="true" data-lang="en" >Follow @labnol</a></p>
67
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
68
- <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fdigital.inspiration&amp;send=false&amp;layout=standard&amp;width=500&amp;show_faces=true&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=80&amp;appId=197498283654348" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:80px;" allowTransparency="true"></iframe>
69
- <hr />
70
- <p>Please email your suggestions to Amit Agarwal at amit@labnol.org. You can also connect with <a href="http://www.labnol.org/" target="_blank">Digital Inspiration</a> on <a href="http://twitter.com/labnol" target="_blank">Twitter</a>, <a href="http://www.youtube.com/labnol" target="_blank">YouTube</a> and <a href="http://www.facebook.com/digital.inspiration" target="_blank">Facebook</a>. </p>
71
- <hr />
 
72
  <?php } else { ?>
73
- <div class="wrap">
74
- <h2>XML Sitemap for Videos</h2>
75
- <p>Sitemaps are a way to tell Google and other search engines about web pages, images and video content on your site that they may otherwise not discover. </p>
76
- <h3>Create Video Sitemap</h3>
77
- <form id="options_form" method="post" action="">
78
- <input type="checkbox" id="sboption" name="time" value="1" />
79
- <label for="sboption">Include video length? (Not recommended for sites will large number of videos)</label>
80
- <div class="submit">
81
- <input type="submit" name="submit" id="sb_submit" value="Generate Video Sitemap" />
82
- </div>
83
- </form>
84
- <p>You can click the button above to generate a Video Sitemap for your website. Once you have created your Sitemap, you should submit it to Google using Webmaster Tools. </p>
85
- <code>This WordPress plugin was developed by <a href="http://www.labnol.org/about/">Amit Agarwal</a> of <a href="http://www.labnol.org/">Digital Inspiration</a>.</code> </div>
 
 
 
 
86
  <?php }
87
  }
88
 
4
  Plugin URI: http://www.labnol.org/software/xml-video-sitemaps-for-google/14085/
5
  Description: This plugin will generate a XML Video Sitemap for your WordPress blog. Open the <a href="tools.php?page=video-sitemap-generate-page">settings page</a> to create your video sitemap.
6
  Author: Amit Agarwal
7
+ Version: 2.6
8
  Author URI: http://www.labnol.org/
9
  */
10
 
57
 
58
  ?>
59
 
60
+ <div class="wrap">
61
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
62
+ if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
63
+ <div style="width:800px; padding:10px 20px; background-color:#eee; font-size:.95em; font-family:Georgia;margin:20px">
64
+ <h2>XML Sitemap for Vidoes</h2>
65
+ <?php $sitemapurl = get_bloginfo('url') . "/sitemap-video.xml"; ?>
66
+ <p>The <a target="_blank" href="<?php echo $sitemapurl; ?>">XML Sitemap</a> was generated successfully and you can <a target="_blank" href="http://www.google.com/webmasters/sitemaps/ping?sitemap=<?php echo $sitemapurl; ?>">ping Google</a> to inform them about your updated sitemap.</p>
67
+ <p>This WordPress Plugin is written by <a href="http://www.labnol.org/about/">Amit Agarwal</a> of <a href="http://www.labnol.org/">Digital Inspiration</a>. For feedback or suggestions on improving this plugin, please send me an email at amit@labnol.org</p>
68
+ <p><a href="https://twitter.com/labnol" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow @labnol</a>
69
+ <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fdigital.inspiration&amp;send=false&amp;layout=button_count&amp;width=300&amp;show_faces=false&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=24&amp;appId=197498283654348" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:20px;" allowTransparency="true"></iframe>
70
+ </p>
71
+ </div>
72
+ </div>
73
  <?php } else { ?>
74
+ <div class="wrap">
75
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
76
+ <div style="width:800px; padding:10px 20px; background-color:#eee; font-size:.95em; font-family:Georgia;margin:20px">
77
+ <h2>XML Sitemap for Videos</h2>
78
+ <p>Sitemaps are a way to tell Google and other search engines about web pages, images and video content on your site that they may otherwise not discover. </p>
79
+ <form id="options_form" method="post" action="">
80
+ <input type="checkbox" id="sboption" name="time" value="1" />
81
+ <label for="sboption">Include video length? (Not recommended for sites will large number of videos)</label>
82
+ <div class="submit">
83
+ <input type="submit" name="submit" id="sb_submit" value="Generate Video Sitemap" />
84
+ </div>
85
+ </form>
86
+ <p>Click the button above to generate a Video Sitemap for your website. Once you have created your Sitemap, you can submit it to Google using Webmaster Tools. </p>
87
+ <p>You may also want to create separate <a href="http://wordpress.org/extend/plugins/google-image-sitemap/">Image Sitemap</a> and <a href="http://wordpress.org/extend/plugins/google-mobile-sitemap/">Mobile Sitemap</a> for improving your site's visibility in Google.</p>
88
+ <p>This WordPress Plugin is written by <a href="http://www.labnol.org/about/">Amit Agarwal</a> of <a href="http://www.labnol.org/">Digital Inspiration</a>. </p>
89
+ </div>
90
+ </div>
91
  <?php }
92
  }
93
 
video-sitemap.xsl CHANGED
@@ -1,5 +1,5 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
  xmlns:html="http://www.w3.org/TR/REC-html40"
4
  xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
  xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"
@@ -7,70 +7,66 @@
7
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
8
  <xsl:template match="/">
9
  <html xmlns="http://www.w3.org/1999/xhtml">
10
- <head>
11
- <title>XML Video Sitemap</title>
12
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
13
- <style type="text/css">
14
- body {
15
- font-family:Georgia, "Times New Roman", Times, serif;
16
- font-size:11px;
17
- background: url(http://img.labnol.org/files/qcpgwkr.png) repeat;
18
- margin: 10px;
19
- }
20
- a {
21
- border:none;
22
- }
23
- a:link {
24
- color:#fff;
25
- text-decoration:none;
26
- }
27
- .labnol {
28
- position: relative;
29
- float:left;
30
- border: 2px solid #000;
31
- margin: 5px;
32
- }
33
- p {
34
- position: absolute;
35
- top: 215px;
36
- width: 90%;
37
- color: #ddd;
38
- padding: 10px;
39
- background: #222;
40
- font-style: italic;
41
- line-height: 18px;
42
- opacity:0.9;
43
- filter:alpha(opacity=90);
44
- }
45
- p strong {
46
- font-size: 16px;
47
- color: #FFF;
48
- line-height: 30px;
49
- font-style: normal;
50
- }
51
- </style>
52
- </head>
53
- <body>
54
- <xsl:for-each select="sitemap:urlset/sitemap:url">
55
- <xsl:variable name="u"> <xsl:value-of select="sitemap:loc"/> </xsl:variable>
56
- <xsl:variable name="t"> <xsl:value-of select="video:video/video:thumbnail_loc"/> </xsl:variable>
57
- <a href="{$u}" target="_blank">
58
- <div class="labnol"><img src="{$t}" width="480" height="360" />
59
- <p><strong><xsl:value-of select="video:video/video:title"/></strong><br />
60
- <xsl:variable name="d"><xsl:value-of select="video:video/video:description"/> </xsl:variable>
61
- <xsl:choose>
62
- <xsl:when test="string-length($d) &lt; 100">
63
- <xsl:value-of select="$d"/>
64
- </xsl:when>
65
- <xsl:otherwise>
66
- <xsl:value-of select="concat(substring($d,1,100),' ...')"/>
67
- </xsl:otherwise>
68
- </xsl:choose>
69
- </p>
70
- </div>
71
- </a>
72
- </xsl:for-each>
73
- </body>
74
  </html>
75
  </xsl:template>
76
- </xsl:stylesheet>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet version="2.0"
3
  xmlns:html="http://www.w3.org/TR/REC-html40"
4
  xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
  xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"
7
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
8
  <xsl:template match="/">
9
  <html xmlns="http://www.w3.org/1999/xhtml">
10
+ <head>
11
+ <title>XML Video Sitemap</title>
12
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
13
+ <style type="text/css">body {
14
+ font-family:Georgia, serif;
15
+ font-size:12px;
16
+ background-color:#eee;
17
+ width:1030px;
18
+ margin:20px auto;
19
+ }
20
+
21
+ a {
22
+ border:none;
23
+ }
24
+
25
+ a:link {
26
+ color:#fff;
27
+ text-decoration:none;
28
+ }
29
+
30
+ .labnol {
31
+ position:relative;
32
+ float:left;
33
+ border:2px solid #000;
34
+ margin:5px;
35
+ }
36
+
37
+ p {
38
+ position:absolute;
39
+ top:130px;
40
+ width:200px;
41
+ color:#ddd;
42
+ background:#222;
43
+ font-style:italic;
44
+ line-height:18px;
45
+ opacity:0.9;
46
+ filter:alpha(opacity=90);
47
+ margin:0;
48
+ padding:0 5px;
49
+ }
50
+ </style>
51
+ </head>
52
+ <body>
53
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
54
+ <xsl:variable name="u">
55
+ <xsl:value-of select="sitemap:loc"/>
56
+ </xsl:variable>
57
+ <xsl:variable name="t">
58
+ <xsl:value-of select="video:video/video:thumbnail_loc"/>
59
+ </xsl:variable>
60
+ <a href="{$u}" target="_blank">
61
+ <div class="labnol">
62
+ <img src="{$t}" width="240" height="180" />
63
+ <p>
64
+ <xsl:value-of select="video:video/video:title"/>
65
+ </p>
66
+ </div>
67
+ </a>
68
+ </xsl:for-each>
69
+ </body>
 
 
 
 
70
  </html>
71
  </xsl:template>
72
+ </xsl:stylesheet>