Changeset 3248106
- Timestamp:
- 02/27/2025 09:19:18 PM (13 months ago)
- Location:
- picture-tag
- Files:
-
- 6 edited
- 10 copied
-
tags/1.3.1 (copied) (copied from picture-tag/trunk)
-
tags/1.3.1/README.md (copied) (copied from picture-tag/trunk/README.md) (1 diff)
-
tags/1.3.1/includes (copied) (copied from picture-tag/trunk/includes)
-
tags/1.3.1/includes/helpers.php (modified) (1 diff)
-
tags/1.3.1/includes/settings.php (copied) (copied from picture-tag/trunk/includes/settings.php)
-
tags/1.3.1/includes/shortcode.php (copied) (copied from picture-tag/trunk/includes/shortcode.php)
-
tags/1.3.1/includes/template-functions.php (copied) (copied from picture-tag/trunk/includes/template-functions.php) (3 diffs)
-
tags/1.3.1/index.php (copied) (copied from picture-tag/trunk/index.php)
-
tags/1.3.1/picture-tag.php (copied) (copied from picture-tag/trunk/picture-tag.php) (2 diffs)
-
tags/1.3.1/readme.txt (copied) (copied from picture-tag/trunk/readme.txt) (2 diffs)
-
tags/1.3.1/screenshot-1.png (copied) (copied from picture-tag/trunk/screenshot-1.png)
-
trunk/README.md (modified) (1 diff)
-
trunk/includes/helpers.php (modified) (1 diff)
-
trunk/includes/template-functions.php (modified) (3 diffs)
-
trunk/picture-tag.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
picture-tag/tags/1.3.1/README.md
r3238162 r3248106 1 1 # Picture Tag 2 2 3 **Version:** 1.3. 03 **Version:** 1.3.1 4 4 **Author:** Artilab 5 5 -
picture-tag/tags/1.3.1/includes/helpers.php
r3209252 r3248106 28 28 } 29 29 30 // Check if a file exists at a given URL 31 function arti_check_if_file_exists( $url ) { 32 $response = wp_remote_head( $url ); 30 /** 31 * Global cache for storing file check results 32 */ 33 global $arti_file_exists_cache; 34 if (!isset($arti_file_exists_cache)) { 35 $arti_file_exists_cache = []; 36 } 33 37 34 if ( is_wp_error( $response ) ) { 35 return false; 38 /** 39 * Optimized function for checking if a file exists 40 * 41 * @param string $url File URL to check 42 * @param bool $force_check Force check, ignoring cache 43 * @return bool True if file exists, false if not 44 */ 45 function arti_check_if_file_exists($url, $force_check = false) { 46 global $arti_file_exists_cache; 47 48 // Return cached result if available and not forcing a check 49 if (!$force_check && isset($arti_file_exists_cache[$url])) { 50 return $arti_file_exists_cache[$url]; 36 51 } 52 53 // Check if this is a local file 54 $upload_dir = wp_get_upload_dir(); 55 $base_url = $upload_dir['baseurl']; 56 $base_dir = $upload_dir['basedir']; 57 58 // Convert URL to local path 59 $file_path = str_replace( 60 [site_url(), $base_url], 61 [ABSPATH, $base_dir], 62 $url 63 ); 64 65 // Use quick check for local file 66 $exists = file_exists($file_path); 67 68 // Store result in cache 69 $arti_file_exists_cache[$url] = $exists; 70 71 return $exists; 72 } 37 73 38 $status_code = wp_remote_retrieve_response_code( $response ); 74 /** 75 * Batch check existence of multiple files simultaneously 76 * 77 * @param array $urls Array of URLs to check 78 * @return array Array with results where keys are URLs and values are boolean results 79 */ 80 function arti_batch_check_files_exist($urls) { 81 global $arti_file_exists_cache; 82 83 $uncached_urls = []; 84 $results = []; 85 86 // First check cache 87 foreach ($urls as $url) { 88 if (isset($arti_file_exists_cache[$url])) { 89 $results[$url] = $arti_file_exists_cache[$url]; 90 } else { 91 $uncached_urls[] = $url; 92 } 93 } 94 95 if (empty($uncached_urls)) { 96 return $results; 97 } 98 99 // Process local URLs 100 $upload_dir = wp_get_upload_dir(); 101 $base_url = $upload_dir['baseurl']; 102 $base_dir = $upload_dir['basedir']; 103 $site_url = site_url(); 104 105 // Check local files 106 foreach ($uncached_urls as $url) { 107 $file_path = str_replace( 108 [$site_url, $base_url], 109 [ABSPATH, $base_dir], 110 $url 111 ); 112 $exists = file_exists($file_path); 113 $results[$url] = $exists; 114 $arti_file_exists_cache[$url] = $exists; 115 } 116 117 return $results; 118 } 39 119 40 return $status_code === 200; 120 /** 121 * Clear the file exists check cache 122 */ 123 function arti_clear_file_exists_cache() { 124 global $arti_file_exists_cache; 125 $arti_file_exists_cache = []; 41 126 } -
picture-tag/tags/1.3.1/includes/template-functions.php
r3238162 r3248106 8 8 */ 9 9 function arti_generate_picture_tag( $image_id, $sizes, $attr ) { 10 static $transient_cache = []; 11 12 // Create a unique key for caching the result 13 $cache_key = 'arti_picture_' . $image_id . '_' . md5(serialize($sizes) . serialize($attr)); 14 15 // Check local cache (within a single request) 16 if (isset($transient_cache[$cache_key])) { 17 return $transient_cache[$cache_key]; 18 } 19 20 // Check transient in database (between requests) 21 $cached_html = get_transient($cache_key); 22 if ($cached_html !== false) { 23 $transient_cache[$cache_key] = $cached_html; 24 return $cached_html; 25 } 26 10 27 $upload_dir = wp_get_upload_dir(); 11 12 $webp_base_url = str_replace( $upload_dir['baseurl'], $upload_dir['baseurl'] . get_option( 'arti_webp_path', '/../compressx-nextgen/uploads' ), $upload_dir['baseurl'] ); 13 $avif_base_url = str_replace( $upload_dir['baseurl'], $upload_dir['baseurl'] . get_option( 'arti_avif_path', '/../compressx-nextgen/uploads' ), $upload_dir['baseurl'] ); 14 28 $webp_base_url = str_replace($upload_dir['baseurl'], $upload_dir['baseurl'] . get_option('arti_webp_path', '/../compressx-nextgen/uploads'), $upload_dir['baseurl']); 29 $avif_base_url = str_replace($upload_dir['baseurl'], $upload_dir['baseurl'] . get_option('arti_avif_path', '/../compressx-nextgen/uploads'), $upload_dir['baseurl']); 30 31 $webp_urls = []; 32 $avif_urls = []; 33 $original_srcset = []; 15 34 $webp_srcset = []; 16 35 $avif_srcset = []; 17 $original_srcset = []; 18 19 foreach ( $sizes as $scale => $size ) { 20 $image_src = wp_get_attachment_image_src( $image_id, $size ); 21 if ( $image_src ) { 36 $scale_mapping = []; 37 38 // First collect all URLs that need to be checked 39 foreach ($sizes as $scale => $size) { 40 $image_src = wp_get_attachment_image_src($image_id, $size); 41 if ($image_src) { 22 42 $image_url_size = $image_src[0]; 23 $image_webp_url = str_replace( $upload_dir['baseurl'], $webp_base_url, $image_url_size ) . '.webp'; 24 $image_avif_url = str_replace( $upload_dir['baseurl'], $avif_base_url, $image_url_size ) . '.avif'; 25 26 if ( arti_check_if_file_exists( $image_webp_url ) ) { 27 $webp_srcset[] = esc_url( $image_webp_url ) . " {$scale}"; 43 $image_webp_url = str_replace($upload_dir['baseurl'], $webp_base_url, $image_url_size) . '.webp'; 44 $image_avif_url = str_replace($upload_dir['baseurl'], $avif_base_url, $image_url_size) . '.avif'; 45 46 $webp_urls[$image_webp_url] = $scale; 47 $avif_urls[$image_avif_url] = $scale; 48 $original_srcset[] = esc_url($image_url_size) . " {$scale}"; 49 50 $scale_mapping[$image_webp_url] = $scale; 51 $scale_mapping[$image_avif_url] = $scale; 52 } 53 } 54 55 // Batch check all WebP files 56 if (!empty($webp_urls)) { 57 $webp_results = arti_batch_check_files_exist(array_keys($webp_urls)); 58 foreach ($webp_results as $url => $exists) { 59 if ($exists) { 60 $scale = $scale_mapping[$url]; 61 $webp_srcset[] = esc_url($url) . " {$scale}"; 28 62 } 29 if ( arti_check_if_file_exists( $image_avif_url ) ) { 30 $avif_srcset[] = esc_url( $image_avif_url ) . " {$scale}"; 63 } 64 } 65 66 // Batch check all AVIF files 67 if (!empty($avif_urls)) { 68 $avif_results = arti_batch_check_files_exist(array_keys($avif_urls)); 69 foreach ($avif_results as $url => $exists) { 70 if ($exists) { 71 $scale = $scale_mapping[$url]; 72 $avif_srcset[] = esc_url($url) . " {$scale}"; 31 73 } 32 $original_srcset[] = esc_url( $image_url_size ) . " {$scale}";33 74 } 34 75 } … … 36 77 ob_start(); ?> 37 78 <picture> 38 <?php if ( ! empty( $avif_srcset )) : ?>39 <source srcset="<?php echo esc_attr( implode( ', ', $avif_srcset )); ?>" type="image/avif" />79 <?php if (!empty($avif_srcset)) : ?> 80 <source srcset="<?php echo esc_attr(implode(', ', $avif_srcset)); ?>" type="image/avif" /> 40 81 <?php endif; ?> 41 <?php if ( ! empty( $webp_srcset )) : ?>42 <source srcset="<?php echo esc_attr( implode( ', ', $webp_srcset )); ?>" type="image/webp" />82 <?php if (!empty($webp_srcset)) : ?> 83 <source srcset="<?php echo esc_attr(implode(', ', $webp_srcset)); ?>" type="image/webp" /> 43 84 <?php endif; ?> 44 <source srcset="<?php echo esc_attr( implode( ', ', $original_srcset )); ?>" type="image/jpeg" />45 <?php echo wp_get_attachment_image( $image_id, $sizes['1x'], false, arti_render_custom_attributes( $attr )); ?>85 <source srcset="<?php echo esc_attr(implode(', ', $original_srcset)); ?>" type="image/jpeg" /> 86 <?php echo wp_get_attachment_image($image_id, $sizes['1x'], false, arti_render_custom_attributes($attr)); ?> 46 87 </picture> 47 88 <?php 48 return ob_get_clean(); 89 $html = ob_get_clean(); 90 91 // Save result in cache for 12 hours 92 set_transient($cache_key, $html, 12 * HOUR_IN_SECONDS); 93 $transient_cache[$cache_key] = $html; 94 95 return $html; 49 96 } 50 97 … … 126 173 echo wp_kses( $html, $allowed_tags ); 127 174 } 175 176 /** 177 * Clear cache when media files are updated 178 */ 179 function arti_clear_picture_cache($attachment_id) { 180 global $wpdb; 181 182 // Delete all transients related to this image 183 $wpdb->query($wpdb->prepare( 184 "DELETE FROM $wpdb->options WHERE option_name LIKE %s", 185 '_transient_arti_picture_' . $attachment_id . '_%' 186 )); 187 188 // Also clear expired transients 189 $wpdb->query($wpdb->prepare( 190 "DELETE FROM $wpdb->options WHERE option_name LIKE %s", 191 '_transient_timeout_arti_picture_' . $attachment_id . '_%' 192 )); 193 194 // Clear global file check cache 195 arti_clear_file_exists_cache(); 196 } 197 198 // Add hooks for clearing cache when media is updated 199 add_action('edit_attachment', 'arti_clear_picture_cache'); 200 add_action('add_attachment', 'arti_clear_picture_cache'); 201 add_action('delete_attachment', 'arti_clear_picture_cache'); -
picture-tag/tags/1.3.1/picture-tag.php
r3238162 r3248106 3 3 * Plugin Name: Picture Tag 4 4 * Description: Picture Tag with Custom Path Settings 5 * Version: 1.3. 05 * Version: 1.3.1 6 6 * Author: Artilab 7 7 * Author URI: https://artilab.pro/ … … 17 17 18 18 define( 'ARTI_PICTURE_TAG_PLUGIN', __FILE__ ); 19 define( 'ARTI_PICTURE_TAG_PLUGIN_DIR', untrailingslashit( dirname( ARTI_PICTURE_TAG_PLUGIN )) );20 define( 'ARTI_PICTURE_TAG_PLUGIN_VERSION', '1.3. 0' );19 define( 'ARTI_PICTURE_TAG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 20 define( 'ARTI_PICTURE_TAG_PLUGIN_VERSION', '1.3.1' ); 21 21 22 22 23 23 // Include plugin files 24 require_once plugin_dir_path( __FILE__ ). 'includes/settings.php';25 require_once plugin_dir_path( __FILE__ ). 'includes/helpers.php';26 require_once plugin_dir_path( __FILE__ ). 'includes/template-functions.php';27 require_once plugin_dir_path( __FILE__ ). 'includes/shortcode.php';24 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/settings.php'; 25 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/helpers.php'; 26 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/template-functions.php'; 27 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/shortcode.php'; 28 28 29 29 // Initialize plugin -
picture-tag/tags/1.3.1/readme.txt
r3238162 r3248106 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 07 Stable tag: 1.3.1 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 49 49 == Changelog == 50 50 51 = 1.3.1 = 52 * Improved performance by focusing only on local file operations 53 * Improved code readability with clearer documentation 54 * Fixed potential timeout issues when checking image formats 55 51 56 = 1.3.0 = 52 57 * Added support for custom data-* attributes in ```[arti_picture]``` shortcode. -
picture-tag/trunk/README.md
r3238162 r3248106 1 1 # Picture Tag 2 2 3 **Version:** 1.3. 03 **Version:** 1.3.1 4 4 **Author:** Artilab 5 5 -
picture-tag/trunk/includes/helpers.php
r3209252 r3248106 28 28 } 29 29 30 // Check if a file exists at a given URL 31 function arti_check_if_file_exists( $url ) { 32 $response = wp_remote_head( $url ); 30 /** 31 * Global cache for storing file check results 32 */ 33 global $arti_file_exists_cache; 34 if (!isset($arti_file_exists_cache)) { 35 $arti_file_exists_cache = []; 36 } 33 37 34 if ( is_wp_error( $response ) ) { 35 return false; 38 /** 39 * Optimized function for checking if a file exists 40 * 41 * @param string $url File URL to check 42 * @param bool $force_check Force check, ignoring cache 43 * @return bool True if file exists, false if not 44 */ 45 function arti_check_if_file_exists($url, $force_check = false) { 46 global $arti_file_exists_cache; 47 48 // Return cached result if available and not forcing a check 49 if (!$force_check && isset($arti_file_exists_cache[$url])) { 50 return $arti_file_exists_cache[$url]; 36 51 } 52 53 // Check if this is a local file 54 $upload_dir = wp_get_upload_dir(); 55 $base_url = $upload_dir['baseurl']; 56 $base_dir = $upload_dir['basedir']; 57 58 // Convert URL to local path 59 $file_path = str_replace( 60 [site_url(), $base_url], 61 [ABSPATH, $base_dir], 62 $url 63 ); 64 65 // Use quick check for local file 66 $exists = file_exists($file_path); 67 68 // Store result in cache 69 $arti_file_exists_cache[$url] = $exists; 70 71 return $exists; 72 } 37 73 38 $status_code = wp_remote_retrieve_response_code( $response ); 74 /** 75 * Batch check existence of multiple files simultaneously 76 * 77 * @param array $urls Array of URLs to check 78 * @return array Array with results where keys are URLs and values are boolean results 79 */ 80 function arti_batch_check_files_exist($urls) { 81 global $arti_file_exists_cache; 82 83 $uncached_urls = []; 84 $results = []; 85 86 // First check cache 87 foreach ($urls as $url) { 88 if (isset($arti_file_exists_cache[$url])) { 89 $results[$url] = $arti_file_exists_cache[$url]; 90 } else { 91 $uncached_urls[] = $url; 92 } 93 } 94 95 if (empty($uncached_urls)) { 96 return $results; 97 } 98 99 // Process local URLs 100 $upload_dir = wp_get_upload_dir(); 101 $base_url = $upload_dir['baseurl']; 102 $base_dir = $upload_dir['basedir']; 103 $site_url = site_url(); 104 105 // Check local files 106 foreach ($uncached_urls as $url) { 107 $file_path = str_replace( 108 [$site_url, $base_url], 109 [ABSPATH, $base_dir], 110 $url 111 ); 112 $exists = file_exists($file_path); 113 $results[$url] = $exists; 114 $arti_file_exists_cache[$url] = $exists; 115 } 116 117 return $results; 118 } 39 119 40 return $status_code === 200; 120 /** 121 * Clear the file exists check cache 122 */ 123 function arti_clear_file_exists_cache() { 124 global $arti_file_exists_cache; 125 $arti_file_exists_cache = []; 41 126 } -
picture-tag/trunk/includes/template-functions.php
r3238162 r3248106 8 8 */ 9 9 function arti_generate_picture_tag( $image_id, $sizes, $attr ) { 10 static $transient_cache = []; 11 12 // Create a unique key for caching the result 13 $cache_key = 'arti_picture_' . $image_id . '_' . md5(serialize($sizes) . serialize($attr)); 14 15 // Check local cache (within a single request) 16 if (isset($transient_cache[$cache_key])) { 17 return $transient_cache[$cache_key]; 18 } 19 20 // Check transient in database (between requests) 21 $cached_html = get_transient($cache_key); 22 if ($cached_html !== false) { 23 $transient_cache[$cache_key] = $cached_html; 24 return $cached_html; 25 } 26 10 27 $upload_dir = wp_get_upload_dir(); 11 12 $webp_base_url = str_replace( $upload_dir['baseurl'], $upload_dir['baseurl'] . get_option( 'arti_webp_path', '/../compressx-nextgen/uploads' ), $upload_dir['baseurl'] ); 13 $avif_base_url = str_replace( $upload_dir['baseurl'], $upload_dir['baseurl'] . get_option( 'arti_avif_path', '/../compressx-nextgen/uploads' ), $upload_dir['baseurl'] ); 14 28 $webp_base_url = str_replace($upload_dir['baseurl'], $upload_dir['baseurl'] . get_option('arti_webp_path', '/../compressx-nextgen/uploads'), $upload_dir['baseurl']); 29 $avif_base_url = str_replace($upload_dir['baseurl'], $upload_dir['baseurl'] . get_option('arti_avif_path', '/../compressx-nextgen/uploads'), $upload_dir['baseurl']); 30 31 $webp_urls = []; 32 $avif_urls = []; 33 $original_srcset = []; 15 34 $webp_srcset = []; 16 35 $avif_srcset = []; 17 $original_srcset = []; 18 19 foreach ( $sizes as $scale => $size ) { 20 $image_src = wp_get_attachment_image_src( $image_id, $size ); 21 if ( $image_src ) { 36 $scale_mapping = []; 37 38 // First collect all URLs that need to be checked 39 foreach ($sizes as $scale => $size) { 40 $image_src = wp_get_attachment_image_src($image_id, $size); 41 if ($image_src) { 22 42 $image_url_size = $image_src[0]; 23 $image_webp_url = str_replace( $upload_dir['baseurl'], $webp_base_url, $image_url_size ) . '.webp'; 24 $image_avif_url = str_replace( $upload_dir['baseurl'], $avif_base_url, $image_url_size ) . '.avif'; 25 26 if ( arti_check_if_file_exists( $image_webp_url ) ) { 27 $webp_srcset[] = esc_url( $image_webp_url ) . " {$scale}"; 43 $image_webp_url = str_replace($upload_dir['baseurl'], $webp_base_url, $image_url_size) . '.webp'; 44 $image_avif_url = str_replace($upload_dir['baseurl'], $avif_base_url, $image_url_size) . '.avif'; 45 46 $webp_urls[$image_webp_url] = $scale; 47 $avif_urls[$image_avif_url] = $scale; 48 $original_srcset[] = esc_url($image_url_size) . " {$scale}"; 49 50 $scale_mapping[$image_webp_url] = $scale; 51 $scale_mapping[$image_avif_url] = $scale; 52 } 53 } 54 55 // Batch check all WebP files 56 if (!empty($webp_urls)) { 57 $webp_results = arti_batch_check_files_exist(array_keys($webp_urls)); 58 foreach ($webp_results as $url => $exists) { 59 if ($exists) { 60 $scale = $scale_mapping[$url]; 61 $webp_srcset[] = esc_url($url) . " {$scale}"; 28 62 } 29 if ( arti_check_if_file_exists( $image_avif_url ) ) { 30 $avif_srcset[] = esc_url( $image_avif_url ) . " {$scale}"; 63 } 64 } 65 66 // Batch check all AVIF files 67 if (!empty($avif_urls)) { 68 $avif_results = arti_batch_check_files_exist(array_keys($avif_urls)); 69 foreach ($avif_results as $url => $exists) { 70 if ($exists) { 71 $scale = $scale_mapping[$url]; 72 $avif_srcset[] = esc_url($url) . " {$scale}"; 31 73 } 32 $original_srcset[] = esc_url( $image_url_size ) . " {$scale}";33 74 } 34 75 } … … 36 77 ob_start(); ?> 37 78 <picture> 38 <?php if ( ! empty( $avif_srcset )) : ?>39 <source srcset="<?php echo esc_attr( implode( ', ', $avif_srcset )); ?>" type="image/avif" />79 <?php if (!empty($avif_srcset)) : ?> 80 <source srcset="<?php echo esc_attr(implode(', ', $avif_srcset)); ?>" type="image/avif" /> 40 81 <?php endif; ?> 41 <?php if ( ! empty( $webp_srcset )) : ?>42 <source srcset="<?php echo esc_attr( implode( ', ', $webp_srcset )); ?>" type="image/webp" />82 <?php if (!empty($webp_srcset)) : ?> 83 <source srcset="<?php echo esc_attr(implode(', ', $webp_srcset)); ?>" type="image/webp" /> 43 84 <?php endif; ?> 44 <source srcset="<?php echo esc_attr( implode( ', ', $original_srcset )); ?>" type="image/jpeg" />45 <?php echo wp_get_attachment_image( $image_id, $sizes['1x'], false, arti_render_custom_attributes( $attr )); ?>85 <source srcset="<?php echo esc_attr(implode(', ', $original_srcset)); ?>" type="image/jpeg" /> 86 <?php echo wp_get_attachment_image($image_id, $sizes['1x'], false, arti_render_custom_attributes($attr)); ?> 46 87 </picture> 47 88 <?php 48 return ob_get_clean(); 89 $html = ob_get_clean(); 90 91 // Save result in cache for 12 hours 92 set_transient($cache_key, $html, 12 * HOUR_IN_SECONDS); 93 $transient_cache[$cache_key] = $html; 94 95 return $html; 49 96 } 50 97 … … 126 173 echo wp_kses( $html, $allowed_tags ); 127 174 } 175 176 /** 177 * Clear cache when media files are updated 178 */ 179 function arti_clear_picture_cache($attachment_id) { 180 global $wpdb; 181 182 // Delete all transients related to this image 183 $wpdb->query($wpdb->prepare( 184 "DELETE FROM $wpdb->options WHERE option_name LIKE %s", 185 '_transient_arti_picture_' . $attachment_id . '_%' 186 )); 187 188 // Also clear expired transients 189 $wpdb->query($wpdb->prepare( 190 "DELETE FROM $wpdb->options WHERE option_name LIKE %s", 191 '_transient_timeout_arti_picture_' . $attachment_id . '_%' 192 )); 193 194 // Clear global file check cache 195 arti_clear_file_exists_cache(); 196 } 197 198 // Add hooks for clearing cache when media is updated 199 add_action('edit_attachment', 'arti_clear_picture_cache'); 200 add_action('add_attachment', 'arti_clear_picture_cache'); 201 add_action('delete_attachment', 'arti_clear_picture_cache'); -
picture-tag/trunk/picture-tag.php
r3238162 r3248106 3 3 * Plugin Name: Picture Tag 4 4 * Description: Picture Tag with Custom Path Settings 5 * Version: 1.3. 05 * Version: 1.3.1 6 6 * Author: Artilab 7 7 * Author URI: https://artilab.pro/ … … 17 17 18 18 define( 'ARTI_PICTURE_TAG_PLUGIN', __FILE__ ); 19 define( 'ARTI_PICTURE_TAG_PLUGIN_DIR', untrailingslashit( dirname( ARTI_PICTURE_TAG_PLUGIN )) );20 define( 'ARTI_PICTURE_TAG_PLUGIN_VERSION', '1.3. 0' );19 define( 'ARTI_PICTURE_TAG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 20 define( 'ARTI_PICTURE_TAG_PLUGIN_VERSION', '1.3.1' ); 21 21 22 22 23 23 // Include plugin files 24 require_once plugin_dir_path( __FILE__ ). 'includes/settings.php';25 require_once plugin_dir_path( __FILE__ ). 'includes/helpers.php';26 require_once plugin_dir_path( __FILE__ ). 'includes/template-functions.php';27 require_once plugin_dir_path( __FILE__ ). 'includes/shortcode.php';24 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/settings.php'; 25 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/helpers.php'; 26 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/template-functions.php'; 27 require_once ARTI_PICTURE_TAG_PLUGIN_DIR . 'includes/shortcode.php'; 28 28 29 29 // Initialize plugin -
picture-tag/trunk/readme.txt
r3238162 r3248106 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 07 Stable tag: 1.3.1 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 49 49 == Changelog == 50 50 51 = 1.3.1 = 52 * Improved performance by focusing only on local file operations 53 * Improved code readability with clearer documentation 54 * Fixed potential timeout issues when checking image formats 55 51 56 = 1.3.0 = 52 57 * Added support for custom data-* attributes in ```[arti_picture]``` shortcode.
Note: See TracChangeset
for help on using the changeset viewer.