Changeset 3486541
- Timestamp:
- 03/19/2026 01:58:57 PM (9 days ago)
- Location:
- shortpixel-adaptive-images
- Files:
-
- 18 edited
- 1 copied
-
tags/3.11.2 (copied) (copied from shortpixel-adaptive-images/trunk)
-
tags/3.11.2/includes/controllers/lqip.class.php (modified) (1 diff)
-
tags/3.11.2/includes/controllers/notice.class.php (modified) (1 diff)
-
tags/3.11.2/includes/controllers/page.class.php (modified) (2 diffs)
-
tags/3.11.2/includes/controllers/short-pixel-ai.class.php (modified) (2 diffs)
-
tags/3.11.2/includes/front/js-loader.class.php (modified) (1 diff)
-
tags/3.11.2/includes/front/vanilla-js-loader.class.php (modified) (1 diff)
-
tags/3.11.2/includes/helpers/url-tools.class.php (modified) (9 diffs)
-
tags/3.11.2/readme.txt (modified) (2 diffs)
-
tags/3.11.2/short-pixel-ai.php (modified) (2 diffs)
-
trunk/includes/controllers/lqip.class.php (modified) (1 diff)
-
trunk/includes/controllers/notice.class.php (modified) (1 diff)
-
trunk/includes/controllers/page.class.php (modified) (2 diffs)
-
trunk/includes/controllers/short-pixel-ai.class.php (modified) (2 diffs)
-
trunk/includes/front/js-loader.class.php (modified) (1 diff)
-
trunk/includes/front/vanilla-js-loader.class.php (modified) (1 diff)
-
trunk/includes/helpers/url-tools.class.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/short-pixel-ai.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortpixel-adaptive-images/tags/3.11.2/includes/controllers/lqip.class.php
r3340495 r3486541 1042 1042 ] ); 1043 1043 1044 \ShortPixelUrlTools::applyNonce('spai-lqip'); 1044 1045 wp_enqueue_script( 'spai-lqip' ); 1045 1046 } -
shortpixel-adaptive-images/tags/3.11.2/includes/controllers/notice.class.php
r3340495 r3486541 726 726 wp_register_script( 'spai-notice', $this->ctrl->plugin_url . $scripts[ 'notice' ][ 'file' ], [ 'jquery' ], $scripts[ 'notice' ][ 'version' ] ); 727 727 728 // Enqueueing scripts 728 \ShortPixelUrlTools::applyNonce('spai-notice'); 729 // Enqueueing scripts 729 730 wp_enqueue_script( 'spai-notice' ); 730 731 } -
shortpixel-adaptive-images/tags/3.11.2/includes/controllers/page.class.php
r3340495 r3486541 124 124 // Commented because of WordPress Plugins Reviewing team 125 125 // echo '<div class="shortpixel-ai-beacon"></div>'; 126 } 127 128 // Add chatbot script to settings and on-boarding pages 129 if ( self::isCurrent( 'settings' ) || self::isCurrent( 'on-boarding' ) ) { 130 ?> 131 <script> 132 (function() { 133 if (!window.chatbase || window.chatbase("getState") !== "initialized") { 134 window.chatbase = (...arguments) => { 135 if (!window.chatbase.q) { 136 window.chatbase.q = []; 137 } 138 window.chatbase.q.push(arguments); 139 }; 140 window.chatbase = new Proxy(window.chatbase, { 141 get(target, prop) { 142 if (prop === "q") { 143 return target.q; 144 } 145 return (...args) => target(prop, ...args); 146 } 147 }); 148 } 149 const onLoad = function() { 150 const script = document.createElement("script"); 151 script.src = "https://www.chatbase.co/embed.min.js"; 152 script.id = "M__c7Yk58ZL23gk7UIWY-"; 153 script.domain = "www.chatbase.co"; 154 document.body.appendChild(script); 155 }; 156 if (document.readyState === "complete") { 157 onLoad(); 158 } else { 159 window.addEventListener("load", onLoad); 160 } 161 })(); 162 </script> 163 <?php 126 164 } 127 165 } … … 170 208 ], 171 209 ] ); 210 \ShortPixelUrlTools::applyNonce('spai-settings'); 172 211 wp_enqueue_script( 'spai-settings' ); 173 212 -
shortpixel-adaptive-images/tags/3.11.2/includes/controllers/short-pixel-ai.class.php
r3367153 r3486541 906 906 ], 907 907 ] ); 908 \ShortPixelUrlTools::applyNonce('spai-sniper'); 908 909 909 910 wp_enqueue_script( 'spai-sniper'); … … 1117 1118 ['nonce' => \ShortPixel\AI\Page::_( ShortPixelAI::_() )->getNonce(),] 1118 1119 ); 1120 \ShortPixelUrlTools::applyNonce('spai-admin-scripts'); 1121 1119 1122 } 1120 1123 -
shortpixel-adaptive-images/tags/3.11.2/includes/front/js-loader.class.php
r3209129 r3486541 86 86 ], 87 87 ] ); 88 \ShortPixelUrlTools::applyNonce('spai-front-worker'); 88 89 wp_enqueue_script( 'spai-front-worker' ); 89 90 } -
shortpixel-adaptive-images/tags/3.11.2/includes/front/vanilla-js-loader.class.php
r3340495 r3486541 104 104 'eager_paths' => array_map( 'base64_encode', $this->ctrl->splitSelectors( $this->settings->exclusions->eager_paths, PHP_EOL ) ), 105 105 ]); 106 \ShortPixelUrlTools::applyNonce('spai-snip-action'); 106 107 wp_enqueue_script( 'spai-snip-action' ); 107 108 wp_add_inline_script('spai-snip-action', -
shortpixel-adaptive-images/tags/3.11.2/includes/helpers/url-tools.class.php
r3340495 r3486541 224 224 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("TAKE1: $path"); 225 225 } 226 if(! file_exists($path)) { //search in the wp-content directory too226 if(!self::spai_safe_file_exists($path)) { //search in the wp-content directory too 227 227 $baseUrlPattern = "/" . str_replace("/", "\/", preg_replace("/^http[s]{0,1}:\/\//", "^http[s]{0,1}://", dirname($updir['baseurl']))) . "/"; 228 228 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("BASE URL PATTERN2: $baseUrlPattern"); … … 231 231 ShortPixelAILogger::instance()->log("TAKE2: $path"); 232 232 } 233 if(! file_exists($path)) {233 if(!self::spai_safe_file_exists($path)) { 234 234 //that's the root folder, it will match the ABSPATH 235 235 $absPath = untrailingslashit(function_exists('get_home_path') ? get_home_path() : ABSPATH); … … 240 240 } 241 241 //cases for multisite when the URL contains an extra element but the local path doesn't (eg food here: path: https://stagegie.wpengine.com/food/wp-content/uploads/sites/5/2020/01/Healthy-Chicken-Sheet-Pan-Fajitas-Get-Inspired-Everyday-5.jpg) 242 if(! file_exists($path)) {242 if(!self::spai_safe_file_exists($path)) { 243 243 $baseDir = explode(DIRECTORY_SEPARATOR, $updir['basedir']); 244 244 $contentUploads = implode('/', array_slice($baseDir, -2, 2)); … … 247 247 $path = $updir['basedir'] . $contentSubdir[1]; 248 248 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("TAKE3BIS: $path"); 249 if(! file_exists($path) && preg_match('/https?:\/\//', $image_url) === false) {249 if(!self::spai_safe_file_exists($path) && preg_match('/https?:\/\//', $image_url) === false) { 250 250 $path = $absPath . ($image_url[0] == '/' ? '' : '/') . $image_url; 251 251 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("TAKE4: $path"); 252 if(! file_exists($path)) {252 if(!self::spai_safe_file_exists($path)) { 253 253 //for cases when the WP directory is a subdir of the root 254 254 $path = dirname($absPath) . ($image_url[0] == '/' ? '' : '/') . $image_url; … … 261 261 } 262 262 263 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("URL TO PATH TO SIZES, checking: " . $path . ' EXISTS? ' . (file_exists($path) ? 'YEE, sizes: ' . json_encode(getimagesize($path)) : 'Nope. UPLOAD url:' . $updir['baseurl'] . ' BaseUrlPattern:' . $baseUrlPattern)); 264 265 if(@file_exists($path)) { 266 return self::getimagesizeOrSvg($path); 267 } elseif (@file_exists(urldecode($path))) { 268 return self::getimagesizeOrSvg(urldecode($path)); 263 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("URL TO PATH TO SIZES, checking: " . $path . ' EXISTS? ' . (self::spai_safe_file_exists($path) ? 'YEE, sizes: ' . json_encode(getimagesize($path)) : 'Nope. UPLOAD url:' . $updir['baseurl'] . ' BaseUrlPattern:' . $baseUrlPattern)); 264 265 $abs = self::spai_normalize_fs_path($path); 266 if ($abs && self::spai_safe_file_exists($abs)) { 267 return self::getimagesizeOrSvg($abs); 268 } 269 $abs2 = $abs ? urldecode($abs) : self::spai_normalize_fs_path(urldecode($path)); 270 if ($abs2 && self::spai_safe_file_exists($abs2)) { 271 return self::getimagesizeOrSvg($abs2); 269 272 } else { 270 273 //LOG open_basedir warnings: https://secure.helpscout.net/conversation/1229180365/34854/ … … 273 276 //try the default location for cases like this one which had wrong baseurl so the replace above did not work: https://secure.helpscout.net/conversation/943639884/20602?folderId=1117588 274 277 $path = trailingslashit(ABSPATH) . 'wp-content/uploads/' . wp_basename(dirname(dirname($image_url))) . '/' . wp_basename(dirname($image_url)) . '/' . wp_basename($image_url); 275 if( @file_exists($path)) {278 if(self::spai_safe_file_exists($path)) { 276 279 return self::getimagesizeOrSvg($path); 277 } elseif ( @file_exists(urldecode($path))) {280 } elseif (self::spai_safe_file_exists(urldecode($path))) { 278 281 return self::getimagesizeOrSvg(urldecode($path)); 279 282 } … … 283 286 284 287 static function getimagesizeOrSvg($path) { 288 $abs = ShortPixelUrlTools::spai_normalize_fs_path($path); 289 if (!$abs || !ShortPixelUrlTools::check_open_basedir($abs)) { 290 return [1,1]; 291 } 292 $path = $abs; 293 285 294 if(strtolower(pathinfo($path, PATHINFO_EXTENSION)) === 'svg') { 286 295 $svg = file_get_contents($path); … … 355 364 } 356 365 return true; 366 } 367 368 /** converts any relative/absolute path to an absolute path under WP dir */ 369 private static function spai_normalize_fs_path($candidate) { 370 if (!$candidate || preg_match('#^[a-z][a-z0-9+.\-]*://#i', $candidate)) return false; // e URL, nu cale 371 $root = wp_normalize_path( untrailingslashit( function_exists('get_home_path') ? get_home_path() : ABSPATH ) ); 372 $p = wp_normalize_path($candidate); 373 374 if ($p === $root || strpos($p, $root . '/') === 0) { // BUg :)) heere i checked if it's already under root, before i didn't and gave double root path 375 return $p; 376 } 377 378 // if starts with "/" ( /wp-content/...), prefix with ABSPATH 379 if (isset($p[0]) && $p[0] === '/') { 380 return $root . $p; 381 } 382 return $root . '/' . ltrim($p, '/'); 383 } 384 385 /** check if the file exists on the disk, but only if the path is allowed by open_basedir */ 386 private static function spai_safe_file_exists($candidate): bool { 387 $abs = self::spai_normalize_fs_path($candidate); 388 if (!$abs) return false; 389 if (!self::check_open_basedir($abs)) return false; 390 return @file_exists($abs); 357 391 } 358 392 … … 606 640 return urldecode(str_replace('data-u="', '', $matches[0])); 607 641 } 642 643 public static function applyNonce($name) 644 { 645 $nonce = apply_filters( 'spai_script_nonce', '' ); 646 if($nonce) { 647 wp_scripts()->add_data( $name, 'nonce', $nonce); 648 } 649 } 608 650 } -
shortpixel-adaptive-images/tags/3.11.2/readme.txt
r3451959 r3486541 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.6.40 7 Stable tag: 3.11. 17 Stable tag: 3.11.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 249 249 250 250 == Changelog == 251 252 = 3.11.2 = 253 254 🛡️ The Compatibility & Security Update 255 256 Release Date: March 19, 2026 257 258 🛠️ Fixes 259 260 * open_basedir Warning Fix: Resolved cases where open_basedir restrictions triggered PHP warnings, including when using the "Replace in CSS" option. 261 262 ✨ Tweaks & Improvements 263 264 * Chatbot Expansion: The ShortPixel AI chatbot is now available in the Settings and onboarding pages for quicker assistance. 265 * CSP Nonce Integration: Added support for Content Security Policy (CSP) nonces to improve compatibility with stricter security setups. 266 267 Update now for improved compatibility, smoother setup, and enhanced security support! 🚀 251 268 252 269 = 3.11.1 = -
shortpixel-adaptive-images/tags/3.11.2/short-pixel-ai.php
r3367153 r3486541 4 4 * Plugin URI: https://shortpixel.com/ 5 5 * Description: Display properly sized, smart cropped and optimized images on your website. Images are processed on the fly and served from our CDN. 6 * Version: 3.11. 16 * Version: 3.11.2 7 7 * Author: ShortPixel 8 8 * GitHub Plugin URI: https://github.com/short-pixel-optimizer/shortpixel-adaptive-images … … 16 16 17 17 if ( !class_exists( 'ShortPixelAI' ) ) { 18 define( 'SHORTPIXEL_AI_VERSION', '3.11. 1' );18 define( 'SHORTPIXEL_AI_VERSION', '3.11.2' ); 19 19 define( 'SPAI_SNIP_VERSION', '3.1.0' ); 20 20 define( 'SHORTPIXEL_AI_VANILLAJS_VER', '1.1' ); -
shortpixel-adaptive-images/trunk/includes/controllers/lqip.class.php
r3340495 r3486541 1042 1042 ] ); 1043 1043 1044 \ShortPixelUrlTools::applyNonce('spai-lqip'); 1044 1045 wp_enqueue_script( 'spai-lqip' ); 1045 1046 } -
shortpixel-adaptive-images/trunk/includes/controllers/notice.class.php
r3340495 r3486541 726 726 wp_register_script( 'spai-notice', $this->ctrl->plugin_url . $scripts[ 'notice' ][ 'file' ], [ 'jquery' ], $scripts[ 'notice' ][ 'version' ] ); 727 727 728 // Enqueueing scripts 728 \ShortPixelUrlTools::applyNonce('spai-notice'); 729 // Enqueueing scripts 729 730 wp_enqueue_script( 'spai-notice' ); 730 731 } -
shortpixel-adaptive-images/trunk/includes/controllers/page.class.php
r3340495 r3486541 124 124 // Commented because of WordPress Plugins Reviewing team 125 125 // echo '<div class="shortpixel-ai-beacon"></div>'; 126 } 127 128 // Add chatbot script to settings and on-boarding pages 129 if ( self::isCurrent( 'settings' ) || self::isCurrent( 'on-boarding' ) ) { 130 ?> 131 <script> 132 (function() { 133 if (!window.chatbase || window.chatbase("getState") !== "initialized") { 134 window.chatbase = (...arguments) => { 135 if (!window.chatbase.q) { 136 window.chatbase.q = []; 137 } 138 window.chatbase.q.push(arguments); 139 }; 140 window.chatbase = new Proxy(window.chatbase, { 141 get(target, prop) { 142 if (prop === "q") { 143 return target.q; 144 } 145 return (...args) => target(prop, ...args); 146 } 147 }); 148 } 149 const onLoad = function() { 150 const script = document.createElement("script"); 151 script.src = "https://www.chatbase.co/embed.min.js"; 152 script.id = "M__c7Yk58ZL23gk7UIWY-"; 153 script.domain = "www.chatbase.co"; 154 document.body.appendChild(script); 155 }; 156 if (document.readyState === "complete") { 157 onLoad(); 158 } else { 159 window.addEventListener("load", onLoad); 160 } 161 })(); 162 </script> 163 <?php 126 164 } 127 165 } … … 170 208 ], 171 209 ] ); 210 \ShortPixelUrlTools::applyNonce('spai-settings'); 172 211 wp_enqueue_script( 'spai-settings' ); 173 212 -
shortpixel-adaptive-images/trunk/includes/controllers/short-pixel-ai.class.php
r3367153 r3486541 906 906 ], 907 907 ] ); 908 \ShortPixelUrlTools::applyNonce('spai-sniper'); 908 909 909 910 wp_enqueue_script( 'spai-sniper'); … … 1117 1118 ['nonce' => \ShortPixel\AI\Page::_( ShortPixelAI::_() )->getNonce(),] 1118 1119 ); 1120 \ShortPixelUrlTools::applyNonce('spai-admin-scripts'); 1121 1119 1122 } 1120 1123 -
shortpixel-adaptive-images/trunk/includes/front/js-loader.class.php
r3209129 r3486541 86 86 ], 87 87 ] ); 88 \ShortPixelUrlTools::applyNonce('spai-front-worker'); 88 89 wp_enqueue_script( 'spai-front-worker' ); 89 90 } -
shortpixel-adaptive-images/trunk/includes/front/vanilla-js-loader.class.php
r3340495 r3486541 104 104 'eager_paths' => array_map( 'base64_encode', $this->ctrl->splitSelectors( $this->settings->exclusions->eager_paths, PHP_EOL ) ), 105 105 ]); 106 \ShortPixelUrlTools::applyNonce('spai-snip-action'); 106 107 wp_enqueue_script( 'spai-snip-action' ); 107 108 wp_add_inline_script('spai-snip-action', -
shortpixel-adaptive-images/trunk/includes/helpers/url-tools.class.php
r3340495 r3486541 224 224 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("TAKE1: $path"); 225 225 } 226 if(! file_exists($path)) { //search in the wp-content directory too226 if(!self::spai_safe_file_exists($path)) { //search in the wp-content directory too 227 227 $baseUrlPattern = "/" . str_replace("/", "\/", preg_replace("/^http[s]{0,1}:\/\//", "^http[s]{0,1}://", dirname($updir['baseurl']))) . "/"; 228 228 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("BASE URL PATTERN2: $baseUrlPattern"); … … 231 231 ShortPixelAILogger::instance()->log("TAKE2: $path"); 232 232 } 233 if(! file_exists($path)) {233 if(!self::spai_safe_file_exists($path)) { 234 234 //that's the root folder, it will match the ABSPATH 235 235 $absPath = untrailingslashit(function_exists('get_home_path') ? get_home_path() : ABSPATH); … … 240 240 } 241 241 //cases for multisite when the URL contains an extra element but the local path doesn't (eg food here: path: https://stagegie.wpengine.com/food/wp-content/uploads/sites/5/2020/01/Healthy-Chicken-Sheet-Pan-Fajitas-Get-Inspired-Everyday-5.jpg) 242 if(! file_exists($path)) {242 if(!self::spai_safe_file_exists($path)) { 243 243 $baseDir = explode(DIRECTORY_SEPARATOR, $updir['basedir']); 244 244 $contentUploads = implode('/', array_slice($baseDir, -2, 2)); … … 247 247 $path = $updir['basedir'] . $contentSubdir[1]; 248 248 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("TAKE3BIS: $path"); 249 if(! file_exists($path) && preg_match('/https?:\/\//', $image_url) === false) {249 if(!self::spai_safe_file_exists($path) && preg_match('/https?:\/\//', $image_url) === false) { 250 250 $path = $absPath . ($image_url[0] == '/' ? '' : '/') . $image_url; 251 251 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("TAKE4: $path"); 252 if(! file_exists($path)) {252 if(!self::spai_safe_file_exists($path)) { 253 253 //for cases when the WP directory is a subdir of the root 254 254 $path = dirname($absPath) . ($image_url[0] == '/' ? '' : '/') . $image_url; … … 261 261 } 262 262 263 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("URL TO PATH TO SIZES, checking: " . $path . ' EXISTS? ' . (file_exists($path) ? 'YEE, sizes: ' . json_encode(getimagesize($path)) : 'Nope. UPLOAD url:' . $updir['baseurl'] . ' BaseUrlPattern:' . $baseUrlPattern)); 264 265 if(@file_exists($path)) { 266 return self::getimagesizeOrSvg($path); 267 } elseif (@file_exists(urldecode($path))) { 268 return self::getimagesizeOrSvg(urldecode($path)); 263 SHORTPIXEL_AI_DEBUG && ShortPixelAILogger::instance()->log("URL TO PATH TO SIZES, checking: " . $path . ' EXISTS? ' . (self::spai_safe_file_exists($path) ? 'YEE, sizes: ' . json_encode(getimagesize($path)) : 'Nope. UPLOAD url:' . $updir['baseurl'] . ' BaseUrlPattern:' . $baseUrlPattern)); 264 265 $abs = self::spai_normalize_fs_path($path); 266 if ($abs && self::spai_safe_file_exists($abs)) { 267 return self::getimagesizeOrSvg($abs); 268 } 269 $abs2 = $abs ? urldecode($abs) : self::spai_normalize_fs_path(urldecode($path)); 270 if ($abs2 && self::spai_safe_file_exists($abs2)) { 271 return self::getimagesizeOrSvg($abs2); 269 272 } else { 270 273 //LOG open_basedir warnings: https://secure.helpscout.net/conversation/1229180365/34854/ … … 273 276 //try the default location for cases like this one which had wrong baseurl so the replace above did not work: https://secure.helpscout.net/conversation/943639884/20602?folderId=1117588 274 277 $path = trailingslashit(ABSPATH) . 'wp-content/uploads/' . wp_basename(dirname(dirname($image_url))) . '/' . wp_basename(dirname($image_url)) . '/' . wp_basename($image_url); 275 if( @file_exists($path)) {278 if(self::spai_safe_file_exists($path)) { 276 279 return self::getimagesizeOrSvg($path); 277 } elseif ( @file_exists(urldecode($path))) {280 } elseif (self::spai_safe_file_exists(urldecode($path))) { 278 281 return self::getimagesizeOrSvg(urldecode($path)); 279 282 } … … 283 286 284 287 static function getimagesizeOrSvg($path) { 288 $abs = ShortPixelUrlTools::spai_normalize_fs_path($path); 289 if (!$abs || !ShortPixelUrlTools::check_open_basedir($abs)) { 290 return [1,1]; 291 } 292 $path = $abs; 293 285 294 if(strtolower(pathinfo($path, PATHINFO_EXTENSION)) === 'svg') { 286 295 $svg = file_get_contents($path); … … 355 364 } 356 365 return true; 366 } 367 368 /** converts any relative/absolute path to an absolute path under WP dir */ 369 private static function spai_normalize_fs_path($candidate) { 370 if (!$candidate || preg_match('#^[a-z][a-z0-9+.\-]*://#i', $candidate)) return false; // e URL, nu cale 371 $root = wp_normalize_path( untrailingslashit( function_exists('get_home_path') ? get_home_path() : ABSPATH ) ); 372 $p = wp_normalize_path($candidate); 373 374 if ($p === $root || strpos($p, $root . '/') === 0) { // BUg :)) heere i checked if it's already under root, before i didn't and gave double root path 375 return $p; 376 } 377 378 // if starts with "/" ( /wp-content/...), prefix with ABSPATH 379 if (isset($p[0]) && $p[0] === '/') { 380 return $root . $p; 381 } 382 return $root . '/' . ltrim($p, '/'); 383 } 384 385 /** check if the file exists on the disk, but only if the path is allowed by open_basedir */ 386 private static function spai_safe_file_exists($candidate): bool { 387 $abs = self::spai_normalize_fs_path($candidate); 388 if (!$abs) return false; 389 if (!self::check_open_basedir($abs)) return false; 390 return @file_exists($abs); 357 391 } 358 392 … … 606 640 return urldecode(str_replace('data-u="', '', $matches[0])); 607 641 } 642 643 public static function applyNonce($name) 644 { 645 $nonce = apply_filters( 'spai_script_nonce', '' ); 646 if($nonce) { 647 wp_scripts()->add_data( $name, 'nonce', $nonce); 648 } 649 } 608 650 } -
shortpixel-adaptive-images/trunk/readme.txt
r3451959 r3486541 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.6.40 7 Stable tag: 3.11. 17 Stable tag: 3.11.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 249 249 250 250 == Changelog == 251 252 = 3.11.2 = 253 254 🛡️ The Compatibility & Security Update 255 256 Release Date: March 19, 2026 257 258 🛠️ Fixes 259 260 * open_basedir Warning Fix: Resolved cases where open_basedir restrictions triggered PHP warnings, including when using the "Replace in CSS" option. 261 262 ✨ Tweaks & Improvements 263 264 * Chatbot Expansion: The ShortPixel AI chatbot is now available in the Settings and onboarding pages for quicker assistance. 265 * CSP Nonce Integration: Added support for Content Security Policy (CSP) nonces to improve compatibility with stricter security setups. 266 267 Update now for improved compatibility, smoother setup, and enhanced security support! 🚀 251 268 252 269 = 3.11.1 = -
shortpixel-adaptive-images/trunk/short-pixel-ai.php
r3367153 r3486541 4 4 * Plugin URI: https://shortpixel.com/ 5 5 * Description: Display properly sized, smart cropped and optimized images on your website. Images are processed on the fly and served from our CDN. 6 * Version: 3.11. 16 * Version: 3.11.2 7 7 * Author: ShortPixel 8 8 * GitHub Plugin URI: https://github.com/short-pixel-optimizer/shortpixel-adaptive-images … … 16 16 17 17 if ( !class_exists( 'ShortPixelAI' ) ) { 18 define( 'SHORTPIXEL_AI_VERSION', '3.11. 1' );18 define( 'SHORTPIXEL_AI_VERSION', '3.11.2' ); 19 19 define( 'SPAI_SNIP_VERSION', '3.1.0' ); 20 20 define( 'SHORTPIXEL_AI_VANILLAJS_VER', '1.1' );
Note: See TracChangeset
for help on using the changeset viewer.