Changeset 2513631
- Timestamp:
- 04/12/2021 11:11:40 PM (5 years ago)
- Location:
- optipic
- Files:
-
- 15 added
- 4 edited
-
tags/1.13.1 (added)
-
tags/1.13.1/images (added)
-
tags/1.13.1/images/op_logo.png (added)
-
tags/1.13.1/includes (added)
-
tags/1.13.1/includes/functions.php (added)
-
tags/1.13.1/includes/optipic-cdn-php (added)
-
tags/1.13.1/includes/optipic-cdn-php/ImgUrlConverter.php (added)
-
tags/1.13.1/includes/settings.php (added)
-
tags/1.13.1/includes/template_loader.php (added)
-
tags/1.13.1/optipic-ru_RU.mo (added)
-
tags/1.13.1/optipic-ru_RU.po (added)
-
tags/1.13.1/optipic.php (added)
-
tags/1.13.1/optipic.pot (added)
-
tags/1.13.1/readme.txt (added)
-
tags/1.13.1/uninstall.php (added)
-
trunk/includes/optipic-cdn-php/ImgUrlConverter.php (modified) (2 diffs)
-
trunk/includes/settings.php (modified) (1 diff)
-
trunk/optipic.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
optipic/trunk/includes/optipic-cdn-php/ImgUrlConverter.php
r2468687 r2513631 292 292 $replaceWithoutOptiPic = $matches[0]; 293 293 294 // skip images from json (json-encoded) 295 if(stripos($replaceWithoutOptiPic, "\\/")!==false) { 296 return $replaceWithoutOptiPic; 297 } 298 294 299 $urlOriginal = $matches[2]; 295 300 … … 299 304 if(!in_array($parseUrl['host'], self::$domains)) { 300 305 self::log($urlOriginal, 'callbackForPregReplace -> url original:'); 301 self::log($replaceWith OptiPic, 'callbackForPregReplace -> url with optipic:');306 self::log($replaceWithoutOptiPic, 'callbackForPregReplace -> url with optipic:'); 302 307 return $replaceWithoutOptiPic; 303 308 } -
optipic/trunk/includes/settings.php
r2468687 r2513631 85 85 86 86 <? 87 $siteId = !empty($optipic_options['cdn_site_id'])? $optipic_options['cdn_site_id']: ''; 87 $siteId = !empty($optipic_options['cdn_site_id'])? $optipic_options['cdn_site_id']: ''; 88 88 ?> 89 <script src="https://optipic.io/api/cp/stat?domain=<?=$_SERVER["HTTP_HOST"]?>&sid=<?=$siteId?>&cms=wordpress&stype=cdn&append_to=<?=urlencode("#optipic-settings-form-wrap")?>&version=1.13. 0"></script>89 <script src="https://optipic.io/api/cp/stat?domain=<?=$_SERVER["HTTP_HOST"]?>&sid=<?=$siteId?>&cms=wordpress&stype=cdn&append_to=<?=urlencode("#optipic-settings-form-wrap")?>&version=1.13.1"></script> -
optipic/trunk/optipic.php
r2468687 r2513631 54 54 } 55 55 56 add_filter( 'template_include', 'optipic_load_template' );56 //add_filter( 'template_include', 'optipic_load_template' ); 57 57 function optipic_load_template( $template ) { 58 58 define('OPTIPIC_LOAD_TEMPLATE_PATH', $template); … … 67 67 } 68 68 69 function optipic_shutdown_action() { 70 $final = ''; 71 72 // We'll need to get the number of ob levels we're in, so that we can iterate over each, collecting 73 // that buffer's output into the final output. 74 $levels = ob_get_level(); 75 76 for ($i = 0; $i < $levels; $i++) { 77 $final .= ob_get_clean(); 78 } 79 80 // Apply any filters to the final output 81 //echo apply_filters('final_output', $final); 82 echo optipic_change_content($final); 83 } 84 85 // https://stackoverflow.com/questions/772510/wordpress-filter-to-modify-final-html-output 86 if(!is_admin() && !defined('DOING_CRON')) { 87 ob_start(); 88 add_action('shutdown', 'optipic_shutdown_action', 0); 89 } 90 91 /*add_filter( 'the_content', 'optipic_change_content', 999999 );*/ 92 93 94 /*function optipic_the_content($content) { 95 require_once OPTIPIC_LOAD_TEMPLATE_PATH; 96 }*/ 97 98 //add_filter( 'woocommerce_after_single_product', 'optipic_woocommerce_after_single_product' ); 99 100 /*add_filter( 'woocommerce_product_thumbnails', 'optipic_ob_change_content' ); 101 add_filter( 'woocommerce_after_single_product_summary', 'optipic_ob_change_content' ); 102 add_filter( 'woocommerce_after_single_product', 'optipic_ob_change_content' ); 103 add_filter( 'theme_mod_storefront_sticky_add_to_cart', 'optipic_ob_change_content' ); 104 add_filter( 'woocommerce_product_thumbnails', 'optipic_ob_change_content' ); 105 add_filter( 'woocommerce_product_thumbnails', 'optipic_ob_change_content' ); 106 107 108 function optipic_ob_change_content() { 109 //die("Q"); 110 //ob_start(); 111 $content = ob_get_contents(); 112 ob_end_clean(); 113 114 //die("Q"); 115 //var_dump($content); 116 //exit; 117 118 //change content 119 $content = optipic_change_content($content); 120 //$content = str_replace('<head>', '<head test="test">', $content); 121 122 echo $content; 123 } 124 125 function optipic_woocommerce_after_single_product() { 126 //die("Q"); 127 //ob_start(); 128 $content = ob_get_contents(); 129 ob_end_clean(); 130 131 //die("Q"); 132 var_dump($content); 133 exit; 134 135 //change content 136 $content = optipic_change_content($content); 137 //$content = str_replace('<head>', '<head test="test">', $content); 138 139 echo $content; 140 }*/ 69 141 ?> -
optipic/trunk/readme.txt
r2468687 r2513631 3 3 Tags: optimize images, compress images, convert webp, webp, image optimizer, performance, seo, pagespeed, image size, page speed, page speed insights, speed up wordpress, google page speed, speed, speedup, speed up 4 4 Requires at least: 4.0 5 Tested up to: 5. 5.36 Stable tag: 1.13. 05 Tested up to: 5.7 6 Stable tag: 1.13.1 7 7 License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 8 8 … … 64 64 = 1.13.0 = 65 65 * Optimized images replacing logic. 66 67 = 1.13.1 = 68 * Fix for WooCommerce
Note: See TracChangeset
for help on using the changeset viewer.