Google XML Sitemap for Images - Version 2.1.2

Version Description

Download this release

Release Info

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

Code changes from version 2.1.1 to 2.1.2

Files changed (2) hide show
  1. image-sitemap.php +3 -5
  2. readme.txt +2 -2
image-sitemap.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google XML Sitemap for Images
4
  Plugin URI: http://www.labnol.org/internet/google-image-sitemap-for-wordpress/14125/
5
  Description: This plugin will generate a XML Image Sitemap for your WordPress blog. Open the <a href="tools.php?page=image-sitemap-generate-page">settings page</a> to create your image sitemap.
6
  Author: Amit Agarwal
7
- Version: 2.1.1
8
  Author URI: http://www.labnol.org/
9
  */
10
 
@@ -31,8 +31,7 @@ function IsImageSitemapWritable($filename) {
31
  }
32
 
33
  function EscapeXMLEntities($xml) {
34
- return strtr($xml,
35
- array("<" => "&lt;", ">" => "&gt;", "\"" => "&quot;", "'" => "&apos;", "&" => "&amp;"));
36
  }
37
 
38
  function image_sitemap_generate () {
@@ -109,8 +108,7 @@ function image_sitemap_loop () {
109
 
110
  foreach($images as $k => $v) {
111
  $permalink = get_permalink($k);
112
- $url = EscapeXMLEntities($v);
113
- $img = "<image:image><image:loc>".implode("</image:loc></image:image><image:image><image:loc>", $url)."</image:loc></image:image>";
114
  $xml .= "<url><loc>" . EscapeXMLEntities($permalink) . "</loc>" . $img . "</url>";
115
  }
116
  $xml .= "\n</urlset>";
4
  Plugin URI: http://www.labnol.org/internet/google-image-sitemap-for-wordpress/14125/
5
  Description: This plugin will generate a XML Image Sitemap for your WordPress blog. Open the <a href="tools.php?page=image-sitemap-generate-page">settings page</a> to create your image sitemap.
6
  Author: Amit Agarwal
7
+ Version: 2.1.2
8
  Author URI: http://www.labnol.org/
9
  */
10
 
31
  }
32
 
33
  function EscapeXMLEntities($xml) {
34
+ return str_replace(array('&', '<', '>', '\'', '"'), array('&amp;', '&lt;', '&gt;', '&apos;', '&quot;'), $xml);
 
35
  }
36
 
37
  function image_sitemap_generate () {
108
 
109
  foreach($images as $k => $v) {
110
  $permalink = get_permalink($k);
111
+ $img = "<image:image><image:loc>".implode("</image:loc></image:image><image:image><image:loc>", $v)."</image:loc></image:image>";
 
112
  $xml .= "<url><loc>" . EscapeXMLEntities($permalink) . "</loc>" . $img . "</url>";
113
  }
114
  $xml .= "\n</urlset>";
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: labnol
3
  Tags: xml sitemaps, google sitemaps, bing, images, seo, search engines, sitemap, pictures
4
  Requires at least: 2.9.2
5
  Tested up to: 3.5
6
- Stable tag: 2.1.1
7
 
8
  The Image Sitemap plugin will generate an XML Sitemap for Images that exist in your WordPress blog.
9
 
@@ -36,7 +36,7 @@ Here's how you can install the plugin:
36
  1. Once you have created your Sitemap, you can submit it to Google using Webmaster Tools.
37
 
38
  == Changelog ==
39
- [v2.1.1] Compatible with WordPress 3.5
40
 
41
  [v2.1] Data values (including URLs) now use entity escape codes for certain characters.
42
 
3
  Tags: xml sitemaps, google sitemaps, bing, images, seo, search engines, sitemap, pictures
4
  Requires at least: 2.9.2
5
  Tested up to: 3.5
6
+ Stable tag: 2.1.2
7
 
8
  The Image Sitemap plugin will generate an XML Sitemap for Images that exist in your WordPress blog.
9
 
36
  1. Once you have created your Sitemap, you can submit it to Google using Webmaster Tools.
37
 
38
  == Changelog ==
39
+ [v2.1.2] Compatible with WordPress 3.5
40
 
41
  [v2.1] Data values (including URLs) now use entity escape codes for certain characters.
42