Google XML Sitemap for Videos - Version 1.0.4

Version Description

Download this release

Release Info

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

Code changes from version 1.0.3 to 1.0.4

Files changed (2) hide show
  1. readme.txt +1 -1
  2. video-sitemap.php +5 -5
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: labnol
3
  Tags: youtube, xml sitemaps, google sitemaps, bing, videos, seo, search engines, sitemap
4
  Requires at least: 2.9.2
5
  Tested up to: 3.0
6
- Stable tag: 1.0.3
7
 
8
  This plugin will help WordPress publishers generate Google XML Sitemaps for YouTube videos.
9
 
3
  Tags: youtube, xml sitemaps, google sitemaps, bing, videos, seo, search engines, sitemap
4
  Requires at least: 2.9.2
5
  Tested up to: 3.0
6
+ Stable tag: 1.0.4
7
 
8
  This plugin will help WordPress publishers generate Google XML Sitemaps for YouTube videos.
9
 
video-sitemap.php CHANGED
@@ -75,7 +75,7 @@ function video_sitemap_loop () {
75
 
76
  $xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
77
  $xml .= '<?xml-stylesheet type="text/xsl" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/xml-sitemaps-for-videos/video-sitemap.xsl"?>' . "\n" ;
78
- $xml .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">' . "\n";
79
 
80
  foreach ($posts as $post) {
81
  if (preg_match_all ("(<embed[^>]*src=['\"]http:\/\/www.youtube.com\/v\/([a-zA-Z0-9\-_]*)|youtube.com\/watch\?v=([a-zA-Z0-9\-_]*))",
@@ -98,10 +98,10 @@ function video_sitemap_loop () {
98
  $xml .= " <video:description>" . htmlspecialchars($excerpt) . "</video:description>\n";
99
 
100
  if ($_POST['time'] == 1) {
101
- $duration = youtube_duration ($id);
102
- if ($duration != 0)
103
- $xml .= " <video:duration>".youtube_duration ($id)."</video:duration>\n";
104
- }
105
 
106
  $xml .= " <video:publication_date>".date (DATE_W3C, strtotime ($post->post_date_gmt))."</video:publication_date>\n";
107
 
75
 
76
  $xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
77
  $xml .= '<?xml-stylesheet type="text/xsl" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/xml-sitemaps-for-videos/video-sitemap.xsl"?>' . "\n" ;
78
+ $xml .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">' . "\n";
79
 
80
  foreach ($posts as $post) {
81
  if (preg_match_all ("(<embed[^>]*src=['\"]http:\/\/www.youtube.com\/v\/([a-zA-Z0-9\-_]*)|youtube.com\/watch\?v=([a-zA-Z0-9\-_]*))",
98
  $xml .= " <video:description>" . htmlspecialchars($excerpt) . "</video:description>\n";
99
 
100
  if ($_POST['time'] == 1) {
101
+ $duration = youtube_duration ($id);
102
+ if ($duration != 0)
103
+ $xml .= " <video:duration>".youtube_duration ($id)."</video:duration>\n";
104
+ }
105
 
106
  $xml .= " <video:publication_date>".date (DATE_W3C, strtotime ($post->post_date_gmt))."</video:publication_date>\n";
107