Changeset 3346930
- Timestamp:
- 08/19/2025 10:55:17 AM (4 months ago)
- Location:
- shortpixel-image-optimiser
- Files:
-
- 12 edited
- 1 copied
-
tags/6.3.1 (copied) (copied from shortpixel-image-optimiser/trunk)
-
tags/6.3.1/class/Controller/Optimizer/OptimizeAiController.php (modified) (3 diffs)
-
tags/6.3.1/class/Controller/View/ListMediaViewController.php (modified) (3 diffs)
-
tags/6.3.1/class/Helper/UiHelper.php (modified) (3 diffs)
-
tags/6.3.1/readme.txt (modified) (3 diffs)
-
tags/6.3.1/res/js/screens/screen-media.js (modified) (1 diff)
-
tags/6.3.1/wp-shortpixel.php (modified) (2 diffs)
-
trunk/class/Controller/Optimizer/OptimizeAiController.php (modified) (3 diffs)
-
trunk/class/Controller/View/ListMediaViewController.php (modified) (3 diffs)
-
trunk/class/Helper/UiHelper.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/res/js/screens/screen-media.js (modified) (1 diff)
-
trunk/wp-shortpixel.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortpixel-image-optimiser/tags/6.3.1/class/Controller/Optimizer/OptimizeAiController.php
r3346588 r3346930 474 474 475 475 $replacer2 = \ShortPixel\Replacer\Replacer::getInstance(); 476 $aiData = $args['aiData']; 477 $qItem = $args['qItem']; 476 478 477 479 foreach($results as $result) … … 489 491 // @todo The result of the post, should parse the content somehow via regex, then load. 490 492 $frontImage = new \ShortPixel\Model\FrontImage($match); 491 if (isset($a rgs['alt']))493 if (isset($aiData['alt'])) 492 494 { 493 $frontImage->alt = $a rgs['alt'];495 $frontImage->alt = $aiData['alt']; 494 496 } 495 if (isset($a rgs['caption']))497 if (isset($aiData['caption'])) 496 498 { 497 $frontImage->caption = $a rgs['caption'];499 $frontImage->caption = $aiData['caption']; 498 500 } 499 501 … … 503 505 } 504 506 505 $content = $replacer2->replaceContent($ match, $sources, $replaces);507 $content = $replacer2->replaceContent($content, $sources, $replaces); 506 508 507 509 $replacer2->Updater()->updatePost($post_id, $content); -
shortpixel-image-optimiser/tags/6.3.1/class/Controller/View/ListMediaViewController.php
r3346588 r3346930 75 75 $this->view->id = $id; 76 76 $this->loadItem($id); 77 78 if (true === \wpSPIO()->settings()->enable_ai) 79 { 80 $this->loadAiItem($id); 81 // $this->loadView('view-list-ai-media', false); 82 } 83 84 } 85 86 $this->loadView(null, false); 77 $this->loadView(null, false); 78 79 } 80 87 81 88 82 … … 105 99 $list_actions = array(); 106 100 101 if (true === \wpSPIO()->settings()->enable_ai) 102 { 103 $aiDataModel = $this->loadAiItem($id); 104 } 105 else 106 { 107 $aiDataModel = null; 108 } 109 107 110 $this->view->text = UiHelper::getStatusText($mediaItem); 108 111 109 $list_actions = UiHelper::getListActions($mediaItem );112 $list_actions = UiHelper::getListActions($mediaItem, $aiDataModel); 110 113 $this->view->list_actions = $list_actions; 111 114 … … 193 196 } 194 197 198 return $AiDataModel; 199 195 200 196 201 } -
shortpixel-image-optimiser/tags/6.3.1/class/Helper/UiHelper.php
r3346588 r3346930 307 307 } 308 308 309 public static function getListActions($mediaItem )309 public static function getListActions($mediaItem, $aiDataModel = null) 310 310 { 311 311 $list_actions = array(); … … 323 323 if (! $access->imageIsEditable($mediaItem)) 324 324 { 325 return array();325 return []; 326 326 } 327 327 328 $aiDataModel = new AiDataModel($id); 329 330 if ($id === 0) 328 if ($id === 0) 331 329 { 332 330 return []; 333 331 } 332 333 //$aiDataModel = new AiDataModel($id); 334 334 335 335 if ($mediaItem->isSomethingOptimized() ) … … 438 438 } //isOptimized 439 439 440 if ($aiDataModel->isProcessable() && 'media' === $mediaItem->get('type') && in_array($mediaItem->getExtension(), $aiDataModel->supportedExtensions())) 440 441 if (false === is_null($aiDataModel) && $aiDataModel->isProcessable() && 'media' === $mediaItem->get('type') && in_array($mediaItem->getExtension(), $aiDataModel->supportedExtensions())) 441 442 { 442 443 $list_actions['shortpixel-generateai'] = self::getAction('shortpixel-generateai', $id); -
shortpixel-image-optimiser/tags/6.3.1/readme.txt
r3346588 r3346930 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 6.3. 07 Stable tag: 6.3.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 475 475 == Changelog == 476 476 477 = 6.3.1 = 478 479 🔥 The Quick Fix Update 480 481 Release Date: August 19, 2025 482 483 🛠️ Fixes & Improvements 484 485 * Draft Content Preservation: AI Image SEO data generation now respects and preserves content from draft posts. 486 * Cleaner Media Library Display: ShortPixel info is now shown only in the designated column, so no more unexpected placements. 487 * Classic Editor Compatibility: Resolved JavaScript errors appearing in the post editor when using the Classic Editor. 488 489 A focused hotfix to ensure a smoother experience after the latest major release. Update now! 🚀 490 477 491 = 6.3.0 = 478 492 … … 483 497 🌟 New Features 484 498 485 * Faster AI Model: We've upgraded to a better, faster AI model for generating image SEO data more accurate and efficient.499 * Faster AI Model: We've upgraded to a better, faster AI model for generating image SEO data more accurately and efficiently. 486 500 * Expanded SEO Tags: In addition to ALT tags, you can now automatically generate image captions and descriptions to enhance SEO and accessibility. 487 501 * Auto-Generate on Upload: Image SEO data can now be generated automatically for newly uploaded images. -
shortpixel-image-optimiser/tags/6.3.1/res/js/screens/screen-media.js
r3346588 r3346930 535 535 536 536 wp.data.subscribe(() => { 537 const { getMedia } = wp.data.select('core');537 //const { getMedia } = wp.data.select('core'); 538 538 const { getSelectedBlock } = wp.data.select('core/block-editor'); 539 539 -
shortpixel-image-optimiser/tags/6.3.1/wp-shortpixel.php
r3346588 r3346930 4 4 * Plugin URI: https://shortpixel.com/ 5 5 * Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="/wp-admin/options-general.php?page=wp-shortpixel-settings" target="_blank">Settings > ShortPixel</a> page on how to start optimizing your image library and make your website load faster. 6 * Version: 6.3. 06 * Version: 6.3.1 7 7 * Author: ShortPixel - Convert WebP/AVIF & Optimize Images 8 8 * Author URI: https://shortpixel.com … … 37 37 define('SHORTPIXEL_PLUGIN_DIR', __DIR__); 38 38 39 define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "6.3. 0");39 define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "6.3.1"); 40 40 41 41 define('SHORTPIXEL_BACKUP', 'ShortpixelBackups'); -
shortpixel-image-optimiser/trunk/class/Controller/Optimizer/OptimizeAiController.php
r3346588 r3346930 474 474 475 475 $replacer2 = \ShortPixel\Replacer\Replacer::getInstance(); 476 $aiData = $args['aiData']; 477 $qItem = $args['qItem']; 476 478 477 479 foreach($results as $result) … … 489 491 // @todo The result of the post, should parse the content somehow via regex, then load. 490 492 $frontImage = new \ShortPixel\Model\FrontImage($match); 491 if (isset($a rgs['alt']))493 if (isset($aiData['alt'])) 492 494 { 493 $frontImage->alt = $a rgs['alt'];495 $frontImage->alt = $aiData['alt']; 494 496 } 495 if (isset($a rgs['caption']))497 if (isset($aiData['caption'])) 496 498 { 497 $frontImage->caption = $a rgs['caption'];