Changeset 3379473
- Timestamp:
- 10/16/2025 12:54:49 PM (5 months ago)
- Location:
- shortpixel-image-optimiser
- Files:
-
- 2 added
- 38 edited
- 1 copied
-
tags/6.3.5 (copied) (copied from shortpixel-image-optimiser/trunk)
-
tags/6.3.5/build/shortpixel/replacer2/src/Classes/Finder.php (modified) (2 diffs)
-
tags/6.3.5/build/shortpixel/replacer2/src/Classes/Updater.php (modified) (2 diffs)
-
tags/6.3.5/build/shortpixel/replacer2/src/Modules/SmartSlider.php (modified) (1 diff)
-
tags/6.3.5/class/BuildAutoLoader.php (modified) (2 diffs)
-
tags/6.3.5/class/Controller/AdminController.php (modified) (2 diffs)
-
tags/6.3.5/class/Controller/AjaxController.php (modified) (8 diffs)
-
tags/6.3.5/class/Controller/Api/AiController.php (modified) (2 diffs)
-
tags/6.3.5/class/Controller/Api/ApiController.php (modified) (1 diff)
-
tags/6.3.5/class/Controller/Front/CDNController.php (modified) (3 diffs)
-
tags/6.3.5/class/Controller/Front/PictureController.php (modified) (1 diff)
-
tags/6.3.5/class/Controller/View/SettingsViewController.php (modified) (1 diff)
-
tags/6.3.5/class/Model.php (modified) (1 diff)
-
tags/6.3.5/class/ViewController.php (modified) (1 diff)
-
tags/6.3.5/class/external/offload/InfiniteUploads.php (added)
-
tags/6.3.5/class/external/offload/Offloader.php (modified) (1 diff)
-
tags/6.3.5/class/external/offload/wp-offload-media.php (modified) (1 diff)
-
tags/6.3.5/class/plugin.json (modified) (1 diff)
-
tags/6.3.5/class/view/shortpixel-feedback.php (modified) (4 diffs)
-
tags/6.3.5/readme.txt (modified) (2 diffs)
-
tags/6.3.5/wp-shortpixel.php (modified) (2 diffs)
-
trunk/build/shortpixel/replacer2/src/Classes/Finder.php (modified) (2 diffs)
-
trunk/build/shortpixel/replacer2/src/Classes/Updater.php (modified) (2 diffs)
-
trunk/build/shortpixel/replacer2/src/Modules/SmartSlider.php (modified) (1 diff)
-
trunk/class/BuildAutoLoader.php (modified) (2 diffs)
-
trunk/class/Controller/AdminController.php (modified) (2 diffs)
-
trunk/class/Controller/AjaxController.php (modified) (8 diffs)
-
trunk/class/Controller/Api/AiController.php (modified) (2 diffs)
-
trunk/class/Controller/Api/ApiController.php (modified) (1 diff)
-
trunk/class/Controller/Front/CDNController.php (modified) (3 diffs)
-
trunk/class/Controller/Front/PictureController.php (modified) (1 diff)
-
trunk/class/Controller/View/SettingsViewController.php (modified) (1 diff)
-
trunk/class/Model.php (modified) (1 diff)
-
trunk/class/ViewController.php (modified) (1 diff)
-
trunk/class/external/offload/InfiniteUploads.php (added)
-
trunk/class/external/offload/Offloader.php (modified) (1 diff)
-
trunk/class/external/offload/wp-offload-media.php (modified) (1 diff)
-
trunk/class/plugin.json (modified) (1 diff)
-
trunk/class/view/shortpixel-feedback.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-shortpixel.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortpixel-image-optimiser/tags/6.3.5/build/shortpixel/replacer2/src/Classes/Finder.php
r3346588 r3379473 48 48 49 49 $rs = $wpdb->get_results($posts_sql, ARRAY_A); 50 $number_of_updates = 0;51 50 52 51 … … 54 53 call_user_func_array($this->callback, ['results' => $rs, 'args' => $this->return_data]); 55 54 56 /*if (! empty($rs)) {57 foreach ($rs as $rows) {58 $number_of_updates = $number_of_updates + 1;59 // replace old URLs with new URLs.60 61 $post_content = $rows["post_content"];62 $post_id = $rows['ID'];63 $replaced_content = $this->replaceContent($post_content, $search_urls, $replace_urls, false, true);64 65 if ($replaced_content !== $post_content) {66 67 // $result = wp_update_post($post_ar);68 $sql = 'UPDATE ' . $wpdb->posts . ' SET post_content = %s WHERE ID = %d';69 $sql = $wpdb->prepare($sql, $replaced_content, $post_id);70 71 $result = $wpdb->query($sql);72 73 if ($result === false) {74 // Notice::addError('Something went wrong while replacing' . $result->get_error_message() );75 Log::addError('WP-Error during post update', $result);76 }77 }78 }79 } */80 81 // $number_of_updates += $this->handleMetaData($base_url, $search_urls, $replace_urls);82 // return $number_of_updates;83 55 } 84 56 -
shortpixel-image-optimiser/tags/6.3.5/build/shortpixel/replacer2/src/Classes/Updater.php
r3348311 r3379473 7 7 } 8 8 9 9 10 10 11 … … 21 22 $sql = $wpdb->prepare($sql, $content, $post_id); 22 23 23 $result = $wpdb->query($sql); 24 25 //Also flush object cache to ensure the content is updated properly 26 wp_cache_delete($post_id, 'posts'); 24 $result = $wpdb->query($sql); 27 25 28 26 if ($result === false) { 29 27 // Notice::addError('Something went wrong while replacing' . $result->get_error_message() ); 30 28 Log::addError('WP-Error during post update', $result); 29 31 30 } 32 31 33 32 self::$updatesNumber++; 33 34 34 } 35 35 -
shortpixel-image-optimiser/tags/6.3.5/build/shortpixel/replacer2/src/Modules/SmartSlider.php
r3346588 r3379473 26 26 } 27 27 28 add_action('shortpixel/replacer/replace_urls', [$this, 'doReplaceQueries'] , 10, 2);28 add_action('shortpixel/replacer/replace_urls', [$this, 'doReplaceQueries']); 29 29 } 30 30 -
shortpixel-image-optimiser/tags/6.3.5/class/BuildAutoLoader.php
r3080349 r3379473 48 48 'class/external/offload/wp-offload-media.php', 49 49 'class/external/offload/virtual-filesystem.php', 50 50 51 'class/external/wp-cli/wp-cli-base.php', 51 52 'class/external/wp-cli/wp-cli-single.php', … … 61 62 'class/external/MediaFileRenamer.php', 62 63 'class/external/formidable.php', 64 63 65 ); 64 66 -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/AdminController.php
r3363822 r3379473 211 211 public function processCronHook($bulk) 212 212 { 213 214 215 216 217 213 218 214 219 $args = array( … … 246 251 247 252 $queueArgs = []; 248 if ( $args['bulk'] === true)253 if () 249 254 { 250 255 $queueArgs['is_bulk'] = true; 251 256 } 257 252 258 253 259 $control = new QueueController($queueArgs); -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/AjaxController.php
r3363822 r3379473 276 276 $json = $this->startRestoreAll($json, $data); 277 277 break; 278 279 280 281 278 282 case 'startMigrateAll': 279 283 $this->checkActionAccess($action, 'is_admin_user'); … … 335 339 default: 336 340 case 'settings/getAiExample': 341 337 342 $this->getSettingsAiExample($data); 338 343 break; 339 344 case 'settings/setAiImageId': 345 340 346 $this->setSettingsAiImage($data); 341 347 break; … … 468 474 protected function purgeCDNCache($json, $data) 469 475 { 476 477 470 478 $purge = isset($_POST['purge']) ? sanitize_text_field($_POST['purge']) : 'cssjs'; 471 472 479 473 480 $CDNController = new \ShortPixel\Controller\Front\CDNController(); … … 478 485 479 486 return $json; 480 481 482 487 } 483 488 … … 486 491 { 487 492 $action = (isset($_POST['actionType'])) ? sanitize_text_field($_POST['actionType']) : 'export'; 493 488 494 $settings = \wpSPIO()->settings(); 489 495 … … 781 787 } 782 788 783 784 789 $json->$type = (object) $metadata; 785 790 $json->$type->results = null; … … 929 934 930 935 return $json; 936 937 938 939 940 941 942 943 944 945 946 947 931 948 } 932 949 … … 1037 1054 if (property_exists($result, 'is_done') && true === $result->is_done) 1038 1055 { 1056 1057 1058 1059 1060 1061 1039 1062 if ('requestAlt' === $state) 1040 1063 { -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/Api/AiController.php
r3363822 r3379473 27 27 public function __construct() 28 28 { 29 $this->main_url = 'https://capi-gpt.shortpixel.com/';29 $this->main_url = 'https://capi-gpt.shortpixel.com/'; 30 30 } 31 31 … … 144 144 if ($qItem->data()->action == 'requestAlt') 145 145 { 146 if (false === $id )146 if (false === $id) 147 147 { 148 148 return $this->returnRetry(RequestManager::STATUS_WAITING, __('Response without result object', 'shortpixel-image-optimiser')); -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/Api/ApiController.php
r3363822 r3379473 409 409 410 410 // Prevent this check if smartcrop is active on this image. 411 if (isset($data['resize']) && 4 ==$data['resize'] )411 if (isset($data['resize']) && 4 $data['resize'] ) 412 412 { 413 413 $image['image']['status'] = self::STATUS_OPTIMIZED_BIGGER; -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/Front/CDNController.php
r3363822 r3379473 361 361 $background_inline_found = true; 362 362 } 363 363 364 364 // ** DO IMAGE MATCHES **/ 365 365 $image_matches = $this->fetchImageMatches($content, $args); … … 369 369 $replaceBlocks = $this->filterRegexExclusions($replaceBlocks); 370 370 $replaceBlocks = $this->filterOtherDomains($replaceBlocks); 371 372 371 373 372 … … 719 718 { 720 719 $raw_url = $replaceBlock->raw_url; 720 721 722 723 724 725 726 727 728 729 730 731 721 732 // Rebuild the matches url: pattern ( easier than $1 getting it back ) 722 $replace_urls[] = 'url( \'' . $replaceBlock->replace_url . '\')';733 $replace_urls[] = 'url(')'; 723 734 $patterns[] = str_replace('%%replace%%', "" . preg_quote($raw_url, '/') . "", $pattern); 724 735 -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/Front/PictureController.php
r3262795 r3379473 392 392 $converted[] = $target_urldef; 393 393 // Fix: The originals are not being put anymore because this would lead to double images and that's not a good thing. 394 $new_urldef = "url('" . $checkedFile . "') $image_data ";394 $new_urldef = "url('" . $checkedFile . "') $image_data "; 395 395 $content = str_replace($target_urldef, $new_urldef, $content); 396 396 } -
shortpixel-image-optimiser/tags/6.3.5/class/Controller/View/SettingsViewController.php
r3363822 r3379473 429 429 AdminNoticesController::resetIntegrationNotices(); 430 430 } 431 432 433 431 434 432 // If the compression type setting changes, remove all queued items to prevent further optimizing with a wrong type. -
shortpixel-image-optimiser/tags/6.3.5/class/Model.php
r3348311 r3379473 155 155 } 156 156 157 return max($value, $this->model[$name]['max']); 157 if ($value > $this->model[$name]['max']) 158 { 159 return $this->model[$name]['max']; 160 } 161 162 return $value; 158 163 } 159 164 -
shortpixel-image-optimiser/tags/6.3.5/class/ViewController.php
r3289850 r3379473 72 72 elseif (! isset($_POST['sp-nonce']) || ! wp_verify_nonce( sanitize_key($_POST['sp-nonce']), $this->form_action)) 73 73 { 74 75 76 77 78 79 74 80 Log::addInfo('Check Post fails nonce check, action : ' . $this->form_action, array($_POST) ); 75 81 exit('Nonce Failed'); 76 return false;82 return e; 77 83 } 78 84 elseif (isset($_POST) && count($_POST) > 0) -
shortpixel-image-optimiser/tags/6.3.5/class/external/offload/Offloader.php
r3346588 r3379473 55 55 { 56 56 $this->offloadName = 'infinite-uploads'; 57 58 59 60 57 61 return true; 58 62 } -
shortpixel-image-optimiser/tags/6.3.5/class/external/offload/wp-offload-media.php
r3363822 r3379473 176 176 $itemHandler = $this->as3cf->get_item_handler($remove); 177 177 178 $result = $itemHandler->handle($a3cfItem, array('verify_exists_on_local' => false)); //handle it then. 179 return $result; 178 180 179 } 181 180 -
shortpixel-image-optimiser/tags/6.3.5/class/plugin.json
r3080349 r3379473 1 {"name":"ShortPixel\/Plugin","description":"ShortPixel AutoLoader","type":"function","autoload":{"psr-4":{"ShortPixel":"class"},"files":["class\/wp-shortpixel-settings.php","class\/front\/img-to-picture-webp.php","class\/external\/cloudflare.php","class\/external\/nextgen\/nextGenController.php","class\/external\/nextgen\/nextGenViewController.php","class\/external\/visualcomposer.php","class\/external\/offload\/Offloader.php","class\/external\/offload\/wp-offload-media.php","class\/external\/offload\/virtual-filesystem.php","class\/external\/ wp-cli\/wp-cli-base.php","class\/external\/wp-cli\/wp-cli-single.php","class\/external\/wp-cli\/wp-cli-bulk.php","class\/external\/image-galleries.php","class\/external\/pantheon.php","class\/external\/spai.php","class\/external\/cache.php","class\/external\/uncode.php","class\/external\/query-monitor.php","class\/external\/Woocommerce.php","class\/external\/themes\/total-theme.php","class\/external\/MediaFileRenamer.php","class\/external\/formidable.php"]}}1 {"name":"ShortPixel\/Plugin","description":"ShortPixel AutoLoader","type":"function","autoload":{"psr-4":{"ShortPixel":"class"},"files":["class\/wp-shortpixel-settings.php","class\/front\/img-to-picture-webp.php","class\/external\/cloudflare.php","class\/external\/nextgen\/nextGenController.php","class\/external\/nextgen\/nextGenViewController.php","class\/external\/visualcomposer.php","class\/external\/offload\/Offloader.php","class\/external\/offload\/wp-offload-media.php","class\/external\/offload\/virtual-filesystem.php","class\/external\/wp-cli\/wp-cli-base.php","class\/external\/wp-cli\/wp-cli-single.php","class\/external\/wp-cli\/wp-cli-bulk.php","class\/external\/image-galleries.php","class\/external\/pantheon.php","class\/external\/spai.php","class\/external\/cache.php","class\/external\/uncode.php","class\/external\/query-monitor.php","class\/external\/Woocommerce.php","class\/external\/themes\/total-theme.php","class\/external\/MediaFileRenamer.php","class\/external\/formidable.php"]}} -
shortpixel-image-optimiser/tags/6.3.5/class/view/shortpixel-feedback.php
r3289850 r3379473 68 68 $form = $this->getFormInfo(); 69 69 70 71 70 72 // Build the HTML to go in the form 71 $html = '<div class="shortpixel-deactivate-form-head"><strong>' . esc_html ( $form['heading'] ) . '</strong></div>';73 $html = '<div class="shortpixel-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>'; 72 74 $html .= '<div class="shortpixel-deactivate-form-body">'; 73 75 if( is_array( $form['options'] ) ) { 74 76 $html .= '<div class="shortpixel-deactivate-options">'; 75 $html .= '<p><strong>' . esc_html ( $form['body'] ) . '</strong></p><p>';77 $html .= '<p><strong>' . esc_html( $form['body'] ) . '</strong></p><p>'; 76 78 foreach( $form['options'] as $key => $option ) { 77 79 $html .= '<input type="radio" name="shortpixel-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>'; 78 80 } 79 $html .= '</p><label id="shortpixel-deactivate-details-label" for="shortpixel-deactivate-reasons"><strong>' . esc_html ( $form['details'] ) .'</strong></label><textarea name="shortpixel-deactivate-details" id="shortpixel-deactivate-details" rows="2" style="width:100%"></textarea>';81 $html .= '</p><label id="shortpixel-deactivate-details-label" for="shortpixel-deactivate-reasons"><strong>' . esc_html( $form['details'] ) .'</strong></label><textarea name="shortpixel-deactivate-details" id="shortpixel-deactivate-details" rows="2" style="width:100%"></textarea>'; 80 82 $html .= '</div><!-- .shortpixel-deactivate-options -->'; 81 83 } … … 83 85 $html .= '<span title="' . __( 'Un-check this if you don\\\'t plan to use ShortPixel in the future on this website. You might also want to run a Bulk Delete SP Metadata before removing the plugin (Media Library -> Bulk ShortPixel).', 'shortpixel-image-optimiser' ) 84 86 . '">' 85 . sprintf( __( 'If you want to completely uninstall ShortPIxel from your site, please go to %s Settings → ShortPixel → Tools %s.', 'shortpixel-image-optimiser' ),'<a href="' . esc_url(admin_url('/options-general.php?page=wp-shortpixel-settings&part=tools')) . '">', '</a>') . '</span><br>';87 . sprintf(xel from your site, please go to %s Settings → ShortPixel → Tools %s.', 'shortpixel-image-optimiser' ),'<a href="' . esc_url(admin_url('/options-general.php?page=wp-shortpixel-settings&part=tools')) . '">', '</a>') . '</span><br>'; 86 88 $html .= '<hr/>'; 87 89 $html .= '</div><!-- .shortpixel-deactivate-form-body -->'; 88 $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'shortpixel-image-optimiser' ) . '</p>';90 $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'shortpixel-image-optimiser' ) . '</p>'; 89 91 $html .= '<div class="shortpixel-deactivate-form-footer"><p>'; 90 92 $html .= '<label for="anonymous" title="' 91 . __("If you UNCHECK this then your email address will be sent along with your feedback. This can be used by ShortPixel to get back to you for more info or a solution.",'shortpixel-image-optimiser')93 . __("If you UNCHECK this then your email address will be sent along with your feedback. This can be used by ShortPixel to get back to you for more info or a solution.",'shortpixel-image-optimiser') 92 94 . '"><input type="checkbox" name="shortpixel-deactivate-tracking" checked="checked" id="anonymous" value="1"> ' . esc_html__( 'Send anonymous', 'shortpixel-image-optimiser' ) . '</label><br>'; 93 95 $html .= '<a id="shortpixel-deactivate-submit-form" class="button button-primary" href="#">' … … 266 268 reason: formContainer.find('input[name="shortpixel-deactivate-reason"]:checked').val(), 267 269 details: formContainer.find('#shortpixel-deactivate-details').val() 268 //anonymous: formContainer.find('#anonymous:checked').length,269 270 }; 270 271 if (formContainer.find('#anonymous').is(':checked')) … … 280 281 formContainer.on('click', '#shortpixel-deactivate-submit-form', function(e){ 281 282 e.preventDefault(); 282 // if( formContainer.find('#shortpixel-keep-settings:checked').length ) {283 283 window.location.href = url; 284 /* } else { 285 SubmitFeedback({}, formContainer); 286 } */ 284 287 285 }); 288 286 -
shortpixel-image-optimiser/tags/6.3.5/readme.txt
r3363822 r3379473 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 6.3. 47 Stable tag: 6.3. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 474 474 475 475 == Changelog == 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 476 496 477 497 = 6.3.4 = -
shortpixel-image-optimiser/tags/6.3.5/wp-shortpixel.php
r3363822 r3379473 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. 46 * Version: 6.3. 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. 4");39 define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "6.3."); 40 40 41 41 define('SHORTPIXEL_BACKUP', 'ShortpixelBackups'); -
shortpixel-image-optimiser/trunk/build/shortpixel/replacer2/src/Classes/Finder.php
r3346588 r3379473 48 48 49 49 $rs = $wpdb->get_results($posts_sql, ARRAY_A); 50 $number_of_updates = 0;51 50 52 51 … … 54 53 call_user_func_array($this->callback, ['results' => $rs, 'args' => $this->return_data]); 55 54 56 /*if (! empty($rs)) {57 foreach ($rs as $rows) {58 $number_of_updates = $number_of_updates + 1;59 // replace old URLs with new URLs.60 61 $post_content = $rows["post_content"];62 $post_id = $rows['ID'];63 $replaced_content = $this->replaceContent($post_content, $search_urls, $replace_urls, false, true);64 65 if ($replaced_content !== $post_content) {66 67 // $result = wp_update_post($post_ar);68 $sql = 'UPDATE ' . $wpdb->posts . ' SET post_content = %s WHERE ID = %d';69 $sql = $wpdb->prepare($sql, $replaced_content, $post_id);70 71 $result = $wpdb->query($sql);72 73 if ($result === false) {74 // Notice::addError('Something went wrong while replacing' . $result->get_error_message() );75 Log::addError('WP-Error during post update', $result);76 }77 }78 }79 } */80 81 // $number_of_updates += $this->handleMetaData($base_url, $search_urls, $replace_urls);82 // return $number_of_updates;83 55 } 84 56 -
shortpixel-image-optimiser/trunk/build/shortpixel/replacer2/src/Classes/Updater.php
r3348311 r3379473 7 7 } 8 8 9 9 10 10 11 … … 21 22 $sql = $wpdb->prepare($sql, $content, $post_id); 22 23 23 $result = $wpdb->query($sql); 24 25 //Also flush object cache to ensure the content is updated properly 26 wp_cache_delete($post_id, 'posts'); 24 $result = $wpdb->query($sql); 27 25 28 26 if ($result === false) { 29 27 // Notice::addError('Something went wrong while replacing' . $result->get_error_message() ); 30 28 Log::addError('WP-Error during post update', $result); 29 31 30 } 32 31 33 32 self::$updatesNumber++; 33 34 34 } 35 35 -
shortpixel-image-optimiser/trunk/build/shortpixel/replacer2/src/Modules/SmartSlider.php
r3346588 r3379473 26 26 } 27 27 28 add_action('shortpixel/replacer/replace_urls', [$this, 'doReplaceQueries'] , 10, 2);28 add_action('shortpixel/replacer/replace_urls', [$this, 'doReplaceQueries']); 29 29 } 30 30 -
shortpixel-image-optimiser/trunk/class/BuildAutoLoader.php
r3080349 r3379473 48 48 'class/external/offload/wp-offload-media.php', 49 49 'class/external/offload/virtual-filesystem.php', 50 50 51 'class/external/wp-cli/wp-cli-base.php', 51 52 'class/external/wp-cli/wp-cli-single.php', … … 61 62 'class/external/MediaFileRenamer.php', 62 63 'class/external/formidable.php', 64 63 65 ); 64 66 -
shortpixel-image-optimiser/trunk/class/Controller/AdminController.php
r3363822 r3379473 211 211 public function processCronHook($bulk) 212 212 { 213 214 215 216 217 213 218 214 219 $args = array( … … 246 251 247 252 $queueArgs = []; 248 if ( $args['bulk'] === true)253 if () 249 254 { 250 255 $queueArgs['is_bulk'] = true; 251 256 } 257 252 258 253 259 $control = new QueueController($queueArgs); -
shortpixel-image-optimiser/trunk/class/Controller/AjaxController.php
r3363822 r3379473 276 276 $json = $this->startRestoreAll($json, $data); 277 277 break; 278 279 280 281 278 282 case 'startMigrateAll': 279 283 $this->checkActionAccess($action, 'is_admin_user'); … … 335 339 default: 336 340 case 'settings/getAiExample': 341 337 342 $this->getSettingsAiExample($data); 338 343 break; 339 344 case 'settings/setAiImageId': 345 340 346 $this->setSettingsAiImage($data); 341 347 break; … … 468 474 protected function purgeCDNCache($json, $data) 469 475 { 476 477 470 478 $purge = isset($_POST['purge']) ? sanitize_text_field($_POST['purge']) : 'cssjs'; 471 472 479 473 480 $CDNController = new \ShortPixel\Controller\Front\CDNController(); … … 478 485 479 486 return $json; 480 481 482 487 } 483 488 … … 486 491 { 487 492 $action = (isset($_POST['actionType'])) ? sanitize_text_field($_POST['actionType']) : 'export'; 493 488 494 $settings = \wpSPIO()->settings(); 489 495 … … 781 787 } 782 788 783 784 789 $json->$type = (object) $metadata; 785 790 $json->$type->results = null; … … 929 934 930 935 return $json; 936 937 938 939 940 941 942 943 944 945 946 947 931 948 } 932 949 … … 1037 1054 if (property_exists($result, 'is_done') && true === $result->is_done) 1038 1055 { 1056 1057 1058 1059 1060 1061 1039 1062 if ('requestAlt' === $state) 1040 1063 { -
shortpixel-image-optimiser/trunk/class/Controller/Api/AiController.php
r3363822 r3379473 27 27 public function __construct() 28 28 { 29 $this->main_url = 'https://capi-gpt.shortpixel.com/';29 $this->main_url = 'https://capi-gpt.shortpixel.com/'; 30 30 } 31 31 … … 144 144 if ($qItem->data()->action == 'requestAlt') 145 145 { 146 if (false === $id )146 if (false === $id) 147 147 { 148 148 return $this->returnRetry(RequestManager::STATUS_WAITING, __('Response without result object', 'shortpixel-image-optimiser')); -
shortpixel-image-optimiser/trunk/class/Controller/Api/ApiController.php
r3363822 r3379473 409 409 410 410 // Prevent this check if smartcrop is active on this image. 411 if (isset($data['resize']) && 4 ==$data['resize'] )411 if (isset($data['resize']) && 4 $data['resize'] ) 412 412 { 413 413 $image['image']['status'] = self::STATUS_OPTIMIZED_BIGGER; -
shortpixel-image-optimiser/trunk/class/Controller/Front/CDNController.php
r3363822 r3379473 361 361 $background_inline_found = true; 362 362 } 363 363 364 364 // ** DO IMAGE MATCHES **/ 365 365 $image_matches = $this->fetchImageMatches($content, $args); … … 369 369 $replaceBlocks = $this->filterRegexExclusions($replaceBlocks); 370 370 $replaceBlocks = $this->filterOtherDomains($replaceBlocks); 371 372 371 373 372 … … 719 718 { 720 719 $raw_url = $replaceBlock->raw_url; 720 721 722 723 724 725 726 727 728 729 730 731 721 732 // Rebuild the matches url: pattern ( easier than $1 getting it back ) 722 $replace_urls[] = 'url( \'' . $replaceBlock->replace_url . '\')';733 $replace_urls[] = 'url(')'; 723 734 $patterns[] = str_replace('%%replace%%', "" . preg_quote($raw_url, '/') . "", $pattern); 724 735 -
shortpixel-image-optimiser/trunk/class/Controller/Front/PictureController.php
r3262795 r3379473 392 392 $converted[] = $target_urldef; 393 393 // Fix: The originals are not being put anymore because this would lead to double images and that's not a good thing. 394 $new_urldef = "url('" . $checkedFile . "') $image_data ";394 $new_urldef = "url('" . $checkedFile . "') $image_data "; 395 395 $content = str_replace($target_urldef, $new_urldef, $content); 396 396 } -
shortpixel-image-optimiser/trunk/class/Controller/View/SettingsViewController.php
r3363822 r3379473 429 429 AdminNoticesController::resetIntegrationNotices(); 430 430 } 431 432 433 431 434 432 // If the compression type setting changes, remove all queued items to prevent further optimizing with a wrong type. -
shortpixel-image-optimiser/trunk/class/Model.php
r3348311 r3379473 155 155 } 156 156 157 return max($value, $this->model[$name]['max']); 157 if ($value > $this->model[$name]['max']) 158 { 159 return $this->model[$name]['max']; 160 } 161 162 return $value; 158 163 } 159 164 -
shortpixel-image-optimiser/trunk/class/ViewController.php
r3289850 r3379473 72 72 elseif (! isset($_POST['sp-nonce']) || ! wp_verify_nonce( sanitize_key($_POST['sp-nonce']), $this->form_action)) 73 73 { 74 75 76 77 78 79 74 80 Log::addInfo('Check Post fails nonce check, action : ' . $this->form_action, array($_POST) ); 75 81 exit('Nonce Failed'); 76 return false;82 return e; 77 83 } 78 84 elseif (isset($_POST) && count($_POST) > 0) -
shortpixel-image-optimiser/trunk/class/external/offload/Offloader.php
r3346588 r3379473 55 55 { 56 56 $this->offloadName = 'infinite-uploads'; 57 58 59 60 57 61 return true; 58 62 } -
shortpixel-image-optimiser/trunk/class/external/offload/wp-offload-media.php
r3363822 r3379473 176 176 $itemHandler = $this->as3cf->get_item_handler($remove); 177 177 178 $result = $itemHandler->handle($a3cfItem, array('verify_exists_on_local' => false)); //handle it then. 179 return $result; 178 180 179 } 181 180 -
shortpixel-image-optimiser/trunk/class/plugin.json
r3080349 r3379473 1 {"name":"ShortPixel\/Plugin","description":"ShortPixel AutoLoader","type":"function","autoload":{"psr-4":{"ShortPixel":"class"},"files":["class\/wp-shortpixel-settings.php","class\/front\/img-to-picture-webp.php","class\/external\/cloudflare.php","class\/external\/nextgen\/nextGenController.php","class\/external\/nextgen\/nextGenViewController.php","class\/external\/visualcomposer.php","class\/external\/offload\/Offloader.php","class\/external\/offload\/wp-offload-media.php","class\/external\/offload\/virtual-filesystem.php","class\/external\/ wp-cli\/wp-cli-base.php","class\/external\/wp-cli\/wp-cli-single.php","class\/external\/wp-cli\/wp-cli-bulk.php","class\/external\/image-galleries.php","class\/external\/pantheon.php","class\/external\/spai.php","class\/external\/cache.php","class\/external\/uncode.php","class\/external\/query-monitor.php","class\/external\/Woocommerce.php","class\/external\/themes\/total-theme.php","class\/external\/MediaFileRenamer.php","class\/external\/formidable.php"]}}1 {"name":"ShortPixel\/Plugin","description":"ShortPixel AutoLoader","type":"function","autoload":{"psr-4":{"ShortPixel":"class"},"files":["class\/wp-shortpixel-settings.php","class\/front\/img-to-picture-webp.php","class\/external\/cloudflare.php","class\/external\/nextgen\/nextGenController.php","class\/external\/nextgen\/nextGenViewController.php","class\/external\/visualcomposer.php","class\/external\/offload\/Offloader.php","class\/external\/offload\/wp-offload-media.php","class\/external\/offload\/virtual-filesystem.php","class\/external\/wp-cli\/wp-cli-base.php","class\/external\/wp-cli\/wp-cli-single.php","class\/external\/wp-cli\/wp-cli-bulk.php","class\/external\/image-galleries.php","class\/external\/pantheon.php","class\/external\/spai.php","class\/external\/cache.php","class\/external\/uncode.php","class\/external\/query-monitor.php","class\/external\/Woocommerce.php","class\/external\/themes\/total-theme.php","class\/external\/MediaFileRenamer.php","class\/external\/formidable.php"]}} -
shortpixel-image-optimiser/trunk/class/view/shortpixel-feedback.php
r3289850 r3379473 68 68 $form = $this->getFormInfo(); 69 69 70 71 70 72 // Build the HTML to go in the form 71 $html = '<div class="shortpixel-deactivate-form-head"><strong>' . esc_html ( $form['heading'] ) . '</strong></div>';73 $html = '<div class="shortpixel-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>'; 72 74 $html .= '<div class="shortpixel-deactivate-form-body">'; 73 75 if( is_array( $form['options'] ) ) { 74 76 $html .= '<div class="shortpixel-deactivate-options">'; 75 $html .= '<p><strong>' . esc_html ( $form['body'] ) . '</strong></p><p>';77 $html .= '<p><strong>' . esc_html( $form['body'] ) . '</strong></p><p>'; 76 78 foreach( $form['options'] as $key => $option ) { 77 79 $html .= '<input type="radio" name="shortpixel-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>'; 78 80 } 79 $html .= '</p><label id="shortpixel-deactivate-details-label" for="shortpixel-deactivate-reasons"><strong>' . esc_html ( $form['details'] ) .'</strong></label><textarea name="shortpixel-deactivate-details" id="shortpixel-deactivate-details" rows="2" style="width:100%"></textarea>';81 $html .= '</p><label id="shortpixel-deactivate-details-label" for="shortpixel-deactivate-reasons"><strong>' . esc_html( $form['details'] ) .'</strong></label><textarea name="shortpixel-deactivate-details" id="shortpixel-deactivate-details" rows="2" style="width:100%"></textarea>'; 80 82 $html .= '</div><!-- .shortpixel-deactivate-options -->'; 81 83 } … … 83 85 $html .= '<span title="' . __( 'Un-check this if you don\\\'t plan to use ShortPixel in the future on this website. You might also want to run a Bulk Delete SP Metadata before removing the plugin (Media Library -> Bulk ShortPixel).', 'shortpixel-image-optimiser' ) 84 86 . '">' 85 . sprintf( __( 'If you want to completely uninstall ShortPIxel from your site, please go to %s Settings → ShortPixel → Tools %s.', 'shortpixel-image-optimiser' ),'<a href="' . esc_url(admin_url('/options-general.php?page=wp-shortpixel-settings&part=tools')) . '">', '</a>') . '</span><br>';87 . sprintf(xel from your site, please go to %s Settings → ShortPixel → Tools %s.', 'shortpixel-image-optimiser' ),'<a href="' . esc_url(admin_url('/options-general.php?page=wp-shortpixel-settings&part=tools')) . '">', '</a>') . '</span><br>'; 86 88 $html .= '<hr/>'; 87 89 $html .= '</div><!-- .shortpixel-deactivate-form-body -->'; 88 $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'shortpixel-image-optimiser' ) . '</p>';90 $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'shortpixel-image-optimiser' ) . '</p>'; 89 91 $html .= '<div class="shortpixel-deactivate-form-footer"><p>'; 90 92 $html .= '<label for="anonymous" title="' 91 . __("If you UNCHECK this then your email address will be sent along with your feedback. This can be used by ShortPixel to get back to you for more info or a solution.",'shortpixel-image-optimiser')93 . __("If you UNCHECK this then your email address will be sent along with your feedback. This can be used by ShortPixel to get back to you for more info or a solution.",'shortpixel-image-optimiser') 92 94 . '"><input type="checkbox" name="shortpixel-deactivate-tracking" checked="checked" id="anonymous" value="1"> ' . esc_html__( 'Send anonymous', 'shortpixel-image-optimiser' ) . '</label><br>'; 93 95 $html .= '<a id="shortpixel-deactivate-submit-form" class="button button-primary" href="#">' … … 266 268 reason: formContainer.find('input[name="shortpixel-deactivate-reason"]:checked').val(), 267 269 details: formContainer.find('#shortpixel-deactivate-details').val() 268 //anonymous: formContainer.find('#anonymous:checked').length,269 270 }; 270 271 if (formContainer.find('#anonymous').is(':checked')) … … 280 281 formContainer.on('click', '#shortpixel-deactivate-submit-form', function(e){ 281 282 e.preventDefault(); 282 // if( formContainer.find('#shortpixel-keep-settings:checked').length ) {283 283 window.location.href = url; 284 /* } else { 285 SubmitFeedback({}, formContainer); 286 } */ 284 287 285 }); 288 286 -
shortpixel-image-optimiser/trunk/readme.txt
r3363822 r3379473 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 6.3. 47 Stable tag: 6.3. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 474 474 475 475 == Changelog == 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 476 496 477 497 = 6.3.4 = -
shortpixel-image-optimiser/trunk/wp-shortpixel.php
r3363822 r3379473 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. 46 * Version: 6.3. 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. 4");39 define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "6.3."); 40 40 41 41 define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
Note: See TracChangeset
for help on using the changeset viewer.