Google Sitemap by BestWebSoft - Version 3.1.9

Version Description

  • 1.07.2019 =
  • Bugfix : The bug the possibility of using image title in the image_sitemap.xml file has been fixed.
Download this release

Release Info

Developer bestwebsoft
Plugin Icon 128x128 Google Sitemap by BestWebSoft
Version 3.1.9
Comparing to
See all releases

Code changes from version 3.1.8 to 3.1.9

google-sitemap-plugin.php CHANGED
@@ -6,7 +6,7 @@ Description: Generate and add XML sitemap to WordPress website. Help search engi
6
  Author: BestWebSoft
7
  Text Domain: google-sitemap-plugin
8
  Domain Path: /languages
9
- Version: 3.1.8
10
  Author URI: https://bestwebsoft.com/
11
  License: GPLv2 or later
12
  */
@@ -453,11 +453,14 @@ if ( ! function_exists( 'gglstmp_prepare_sitemap' ) ) {
453
  }
454
 
455
  if ( $gglstmp_options['media_sitemap'] ) {
 
456
  /* Prepear video_list and image_list data for sitemap */
457
  $video_list = get_attached_media( 'video', $post );
458
  $image_list = get_attached_media( 'image', $post );
 
459
  /* Add image to list */
460
  $image_item = [];
 
461
  if ( ! empty( $image_list ) ) {
462
  $image_count = 0;
463
  foreach ( $image_list as $image ) {
@@ -474,13 +477,13 @@ if ( ! function_exists( 'gglstmp_prepare_sitemap' ) ) {
474
  $image_guid = basename( $image->guid );
475
  $check_img_exists = gglstmp_if_file_exists( $image_guid, $image_upload_date );
476
  if ( $check_img_exists ) {
477
- $image_item[] = $image->guid;
478
  }
479
  }
480
  /* Add array image_elements of one post */
481
  $image_elements[] = array(
482
  'url' => get_permalink( $post ),
483
- 'image_list_url' => $image_item
484
  );
485
  }
486
  /* Add video to list */
@@ -801,11 +804,17 @@ if ( ! function_exists( 'gglstmp_create_image_sitemap' ) ) {
801
  $link->setAttribute( "href", $lang_link( $args_links ) );
802
  }
803
 
804
- if ( isset( $element['image_list_url'] ) ) {
805
- foreach ( $element['image_list_url'] as $image_it ) {
806
  $image = $url->appendChild( $xml->createElement( 'image:image' ) );
807
- $imagecont = $image->appendChild( $xml->createElement( 'image:loc' ) );
808
- $imagecont->appendChild( $xml->createTextNode( $image_it ) );
 
 
 
 
 
 
809
  }
810
  }
811
  }
@@ -814,11 +823,18 @@ if ( ! function_exists( 'gglstmp_create_image_sitemap' ) ) {
814
  $loc = $url->appendChild( $xml->createElement( 'loc' ) );
815
  $loc->appendChild( $xml->createTextNode( $element['url'] ) );
816
 
817
- if ( isset( $element['image_list_url'] ) ) {
818
- foreach ( $element['image_list_url'] as $image_it ) {
819
- $image = $url->appendChild( $xml->createElement( 'image:image' ) );
820
- $imagecont = $image->appendChild( $xml->createElement( 'image:loc' ) );
821
- $imagecont->appendChild( $xml->createTextNode( $image_it ) );
 
 
 
 
 
 
 
822
  }
823
  }
824
  }
6
  Author: BestWebSoft
7
  Text Domain: google-sitemap-plugin
8
  Domain Path: /languages
9
+ Version: 3.1.9
10
  Author URI: https://bestwebsoft.com/
11
  License: GPLv2 or later
12
  */
453
  }
454
 
455
  if ( $gglstmp_options['media_sitemap'] ) {
456
+
457
  /* Prepear video_list and image_list data for sitemap */
458
  $video_list = get_attached_media( 'video', $post );
459
  $image_list = get_attached_media( 'image', $post );
460
+
461
  /* Add image to list */
462
  $image_item = [];
463
+
464
  if ( ! empty( $image_list ) ) {
465
  $image_count = 0;
466
  foreach ( $image_list as $image ) {
477
  $image_guid = basename( $image->guid );
478
  $check_img_exists = gglstmp_if_file_exists( $image_guid, $image_upload_date );
479
  if ( $check_img_exists ) {
480
+ $image_item[] = array( 'guid' => $image->guid, 'image_title' => $image->post_title );
481
  }
482
  }
483
  /* Add array image_elements of one post */
484
  $image_elements[] = array(
485
  'url' => get_permalink( $post ),
486
+ 'image_list' => $image_item
487
  );
488
  }
489
  /* Add video to list */
804
  $link->setAttribute( "href", $lang_link( $args_links ) );
805
  }
806
 
807
+ if ( ! empty( $element['image_list'] ) ) {
808
+ foreach ( $element['image_list'] as $image_it ) {
809
  $image = $url->appendChild( $xml->createElement( 'image:image' ) );
810
+
811
+ /* image title */
812
+ $image_title = $image->appendChild( $xml->createElement( 'image:title' ) );
813
+ $image_title->appendChild( $xml->createTextNode( $image_it['image_title'] ) );
814
+
815
+ /* image loc */
816
+ $image_loc = $image->appendChild( $xml->createElement( 'image:loc' ) );
817
+ $image_loc->appendChild( $xml->createTextNode( $image_it['guid'] ) );
818
  }
819
  }
820
  }
823
  $loc = $url->appendChild( $xml->createElement( 'loc' ) );
824
  $loc->appendChild( $xml->createTextNode( $element['url'] ) );
825
 
826
+ if ( ! empty( $element['image_list'] ) ) {
827
+ foreach ( $element['image_list'] as $image_it ) {
828
+
829
+ $image = $url->appendChild( $xml->createElement( 'image:image' ) );
830
+
831
+ /* image title */
832
+ $image_title = $image->appendChild( $xml->createElement( 'image:title' ) );
833
+ $image_title->appendChild( $xml->createTextNode( $image_it['image_title'] ) );
834
+
835
+ /* image loc */
836
+ $image_loc = $image->appendChild( $xml->createElement( 'image:loc' ) );
837
+ $image_loc->appendChild( $xml->createTextNode( $image_it['guid'] ) );
838
  }
839
  }
840
  }
image_sitemap.xsl CHANGED
@@ -114,6 +114,7 @@
114
  <tr id="table-header">
115
  <th>URL</th>
116
  <th>Image URL</th>
 
117
  <th>Thumbnail</th>
118
  </tr>
119
  <xsl:for-each select="sitemap:urlset/sitemap:url">
@@ -138,6 +139,11 @@
138
  <xsl:value-of select="substring(image:loc, 0, 100)"/>
139
  </a>
140
  </td>
 
 
 
 
 
141
  <td>
142
  <xsl:variable name="itemURL">
143
  <xsl:value-of select="image:loc"/>
114
  <tr id="table-header">
115
  <th>URL</th>
116
  <th>Image URL</th>
117
+ <th>Image title</th>
118
  <th>Thumbnail</th>
119
  </tr>
120
  <xsl:for-each select="sitemap:urlset/sitemap:url">
139
  <xsl:value-of select="substring(image:loc, 0, 100)"/>
140
  </a>
141
  </td>
142
+ <td>
143
+ <span>
144
+ <xsl:value-of select="image:title"/>
145
+ </span>
146
+ </td>
147
  <td>
148
  <xsl:variable name="itemURL">
149
  <xsl:value-of select="image:loc"/>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bestwebsoft
3
  Donate link: https://bestwebsoft.com/donate/
4
  Tags: add pages to sitemap, add posts to sitemap, add sitemap, google, google sitemap, google sitemap plugin, sitemap file path, update sitemap, google webmaster tools, site map, sitemaps, webmaster tools
5
  Requires at least: 3.9
6
- Tested up to: 5.1.1
7
- Stable tag: 3.1.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -149,6 +149,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<https
149
 
150
  == Changelog ==
151
 
 
 
 
152
  = V3.1.8 - 02.05.2019 =
153
  * PRO : Ability to add multiple URLs at once has been added.
154
  * Bugfix : Small bugs have been fixed.
@@ -359,6 +362,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<https
359
 
360
  == Upgrade Notice ==
361
 
 
 
 
362
  = V3.1.8 =
363
  * Functionality expanded.
364
  * Bugs fixed.
3
  Donate link: https://bestwebsoft.com/donate/
4
  Tags: add pages to sitemap, add posts to sitemap, add sitemap, google, google sitemap, google sitemap plugin, sitemap file path, update sitemap, google webmaster tools, site map, sitemaps, webmaster tools
5
  Requires at least: 3.9
6
+ Tested up to: 5.2.2
7
+ Stable tag: 3.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
149
 
150
  == Changelog ==
151
 
152
+ = V3.1.9 - 1.07.2019 =
153
+ * Bugfix : The bug the possibility of using image title in the image_sitemap.xml file has been fixed.
154
+
155
  = V3.1.8 - 02.05.2019 =
156
  * PRO : Ability to add multiple URLs at once has been added.
157
  * Bugfix : Small bugs have been fixed.
362
 
363
  == Upgrade Notice ==
364
 
365
+ = V3.1.9 =
366
+ * Bugs fixed.
367
+
368
  = V3.1.8 =
369
  * Functionality expanded.
370
  * Bugs fixed.
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file