Changeset 3350061
- Timestamp:
- 08/26/2025 05:35:33 AM (7 months ago)
- Location:
- image-video-xml-sitemap
- Files:
-
- 32 added
- 3 edited
-
tags/1.0.6 (added)
-
tags/1.0.6/assets (added)
-
tags/1.0.6/assets/css (added)
-
tags/1.0.6/assets/css/ivxs-admin-css.css (added)
-
tags/1.0.6/assets/css/ivxs-pdf-sitemap.xsl (added)
-
tags/1.0.6/assets/js (added)
-
tags/1.0.6/assets/js/ivxs-admin-js.js (added)
-
tags/1.0.6/documenation.html (added)
-
tags/1.0.6/image-video-xml-sitemap.php (added)
-
tags/1.0.6/includes (added)
-
tags/1.0.6/includes/class-image-video-xml-sitemap.php (added)
-
tags/1.0.6/languages (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-ar.l10n.php (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-ar.mo (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-ar.po (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-de_DE.l10n.php (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-de_DE.mo (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-de_DE.po (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-en_US.l10n.php (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-en_US.mo (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-en_US.po (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-ja.l10n.php (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-ja.mo (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-ja.po (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-nl_NL.l10n.php (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-nl_NL.mo (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-nl_NL.po (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-zh_CN.l10n.php (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-zh_CN.mo (added)
-
tags/1.0.6/languages/image-video-xml-sitemap-zh_CN.po (added)
-
tags/1.0.6/languages/image-video-xml-sitemap.pot (added)
-
tags/1.0.6/readme.txt (added)
-
trunk/image-video-xml-sitemap.php (modified) (1 diff)
-
trunk/includes/class-image-video-xml-sitemap.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
image-video-xml-sitemap/trunk/image-video-xml-sitemap.php
r3344069 r3350061 3 3 Plugin Name: Image & Video XML Sitemap 4 4 Description: Enhance your website's media SEO by creating separate sitemaps for images and videos. Fully compatible with Yoast SEO, with advanced customization options. 5 Version: 1.0. 55 Version: 1.0.6 6 6 Requires at least: 5.2 7 7 Requires PHP: 7.4 -
image-video-xml-sitemap/trunk/includes/class-image-video-xml-sitemap.php
r3344069 r3350061 14 14 add_filter('query_vars', [$this, 'ivxs_add_query_vars']); 15 15 add_action('template_redirect', [$this, 'ivxs_generate_custom_sitemap']); 16 add_filter('redirect_canonical', [$this, 'ivxs_disable_trailing_slash_redirect'], 10, 2); 16 17 } 17 18 … … 312 313 while ( $query->have_posts() ) { 313 314 $query->the_post(); 314 $url = wp_get_attachment_url(get_the_ID()); 315 $attachment_id = get_the_ID(); 316 $url = wp_get_attachment_url( $attachment_id ); 317 $page_url = get_attachment_link( $attachment_id ); 315 318 $lastmod = $this->ivxs_get_post_datetime_string( get_the_ID() ); 316 319 317 320 echo '<url>'; 318 echo '<loc>' . esc_url( $ url ) . '</loc>';321 echo '<loc>' . esc_url( $page_url ) . '</loc>'; 319 322 if ( $lastmod ) { 320 323 echo '<lastmod>' . esc_html( $lastmod ) . '</lastmod>'; … … 323 326 echo '<image:image><image:loc>' . esc_url( $url ) . '</image:loc></image:image>'; 324 327 } elseif ( $media_type === 'video' ) { 325 $thumbnail = esc_url( wp_get_attachment_url( get_post_thumbnail_id() ) );326 $ attachment_id = get_the_ID();328 329 $thumbnail = esc_url( wp_get_attachment_url( get_post_thumbnail_id( $attachment_id ) ) ); 327 330 328 331 // Title fallback … … 347 350 echo '<video:thumbnail_loc>' . esc_url( $thumbnail ) . '</video:thumbnail_loc>'; 348 351 echo '<video:title>' . esc_html( $title ) . '</video:title>'; 349 echo '<video:description>' . esc_html( $description) . '</video:description>';352 echo '<video:description>' . esc_html( $description ) . '</video:description>'; 350 353 echo '<video:content_loc>' . esc_url( $url ) . '</video:content_loc>'; 351 354 echo '</video:video>'; 352 355 } 356 353 357 echo '</url>'; 354 358 } … … 359 363 exit; 360 364 } 365 366 public function ivxs_disable_trailing_slash_redirect($redirect_url, $requested_url) { 367 $image_sitemap_filename = get_option('ivxs_image_sitemap_filename', 'image'); 368 $video_sitemap_filename = get_option('ivxs_video_sitemap_filename', 'video'); 369 370 if (preg_match('/(' . preg_quote($image_sitemap_filename, '/') . '|' . preg_quote($video_sitemap_filename, '/') . ')\.xml$/', $requested_url)) { 371 return false; 372 } 373 return $redirect_url; 374 } 375 361 376 } 362 377 ?> -
image-video-xml-sitemap/trunk/readme.txt
r3344069 r3350061 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 57 Stable tag: 1.0.6 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 79 79 == Changelog == 80 80 81 = 1.0.6 = 82 - Fixed: Trailing slash issue on custom image and video sitemap URLs. 83 - Improved: Prevented unnecessary redirects to ensure faster sitemap loading. 84 - Updated: Added clarification that filenames must not contain the word sitemap due to conflicts with SEO plugins (Yoast, RankMath, etc.). 85 - Enhanced: Translation-ready error notice for invalid sitemap filename usage. 86 81 87 = 1.0.5 = 82 88 - Fixed: Sitemap generation was unintentionally triggering on non-sitemap URLs when only one sitemap type was enabled. … … 118 124 == Upgrade Notice == 119 125 126 = 1.0.6 = 127 - Fixed: Trailing slash issue on custom image and video sitemap URLs. 128 - Improved: Prevented unnecessary redirects to ensure faster sitemap loading. 129 - Updated: Added clarification that filenames must not contain the word sitemap due to conflicts with SEO plugins (Yoast, RankMath, etc.). 130 - Enhanced: Translation-ready error notice for invalid sitemap filename usage. 131 120 132 = 1.0.5 = 121 133 - Fixed: Sitemap generation was unintentionally triggering on non-sitemap URLs when only one sitemap type was enabled.
Note: See TracChangeset
for help on using the changeset viewer.