Changeset 1954139
- Timestamp:
- 10/09/2018 06:34:50 PM (7 years ago)
- Location:
- piio-image-optimization
- Files:
-
- 6 edited
- 1 copied
-
tags/0.9.7 (copied) (copied from piio-image-optimization/trunk)
-
tags/0.9.7/piio-image-optimization.php (modified) (2 diffs)
-
tags/0.9.7/public/class-piio-image-optimization-public.php (modified) (5 diffs)
-
tags/0.9.7/readme.txt (modified) (2 diffs)
-
trunk/piio-image-optimization.php (modified) (2 diffs)
-
trunk/public/class-piio-image-optimization-public.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
piio-image-optimization/tags/0.9.7/piio-image-optimization.php
r1953367 r1954139 13 13 * Plugin URI: https://piio.co/wordpress 14 14 * Description: Generates responsive and optimized images, so you don't have to. 15 * Version: 0.9. 615 * Version: 0.9.7 16 16 * Author: Piio, Inc. 17 17 * Author URI: https://piio.co … … 30 30 * Currently plugin version. 31 31 */ 32 define( 'PIIO_IMAGE_OPTIMIZATION_VERSION', '0.9. 6' );32 define( 'PIIO_IMAGE_OPTIMIZATION_VERSION', '0.9.7' ); 33 33 34 34 /** -
piio-image-optimization/tags/0.9.7/public/class-piio-image-optimization-public.php
r1931963 r1954139 130 130 $in_footer = isset($position[0]) ? ($position[0] === "0") : false; 131 131 132 $jsVars = [132 $jsVars = array( 133 133 'appKey' => $api_key, 134 134 'domain' => $domain, 135 135 'lazyLoadingMode' => $lazy_mode, 136 136 'disableWebP' => !$enable_webp 137 ];137 ); 138 138 139 139 $piio_vars = "var piioData = " . json_encode($jsVars); … … 188 188 $srcAttr = urlencode($src); 189 189 190 $breakpoints = ["576", "768", "992", "1200"];190 $breakpoints = array("576", "768", "992", "1200"); 191 191 $srcset_values = array(); 192 192 foreach ($breakpoints as $width) { … … 239 239 } 240 240 241 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?)(background-image:.*?url\(['\"](\s*.*?\s*)['\"]\));?(.*?['\"])/is", function($matches) use ($api_key, $params){ 242 $srcAttr = urlencode($matches[3]); 243 return $matches[1] . "background-image:url('https://pcdn.piiojs.com/i/" . $api_key . (($params != '') ? '/' . $params : '') . "/" . $srcAttr . "');" . $matches[4]; 244 }, $bckHTML); 245 246 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?background:.*?url\(['\"])(\s*.*?\s*)(['\"]\);?.*?['\"])/is", function($matches) use ($api_key, $params){ 247 $srcAttr = urlencode($matches[2]); 248 return $matches[1] . "https://pcdn.piiojs.com/i/" . $api_key . (($params != '') ? '/' . $params : '') . "/" . $srcAttr . $matches[3]; 249 }, $replaceHTML); 241 $callback = new Piio_Image_Callback($api_key, $params); 242 243 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?)(background-image:.*?url\(['\"](\s*.*?\s*)['\"]\));?(.*?['\"])/is", array($callback, 'callback_background_image'), $bckHTML); 244 245 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?background:.*?url\(['\"])(\s*.*?\s*)(['\"]\);?.*?['\"])/is", array($callback, 'callback_background'), $replaceHTML); 250 246 } 251 247 … … 339 335 $url = ''; 340 336 if ( !empty( $parts['scheme'] ) ) 341 $url .= $parts['scheme'] . ':'; 337 { 338 $url .= $parts['scheme'] . ':'; 339 } 342 340 if ( isset( $parts['host'] ) ) 343 341 { … … 392 390 } 393 391 } 392 if ( !class_exists( 'Piio_Image_Callback' ) ) { 393 class Piio_Image_Callback { 394 private $api_key; 395 private $params; 396 397 function __construct($api_key, $params) { 398 $this->$api_key = $api_key; 399 $this->$params = $params; 400 } 401 402 public function callback_background_image($matches) { 403 $srcAttr = urlencode($matches[3]); 404 return $matches[1] . "background-image:url('https://pcdn.piiojs.com/i/" . $this->api_key . (($this->params != '') ? '/' . $this->params : '') . "/" . $srcAttr . "');" . $matches[4]; 405 } 406 407 public function callback_background($matches) { 408 $srcAttr = urlencode($matches[2]); 409 return $matches[1] . "https://pcdn.piiojs.com/i/" . $this->api_key . (($this->params != '') ? '/' . $this->params : '') . "/" . $srcAttr . $matches[3]; 410 } 411 } 412 } -
piio-image-optimization/tags/0.9.7/readme.txt
r1953367 r1954139 4 4 Tags: image optimization, responsive, lazy loading, image compressor, image compression, cdn 5 5 Requires at least: 4.6 6 Requires PHP: 5. 2.47 Tested up to: 4.9. 78 Stable tag: 0.9. 66 Requires PHP: 5.3.0 7 Tested up to: 4.9.8 8 Stable tag: 0.9.7 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 121 121 122 122 == Changelog == 123 = 0.9.7 = 124 * Added older PHP versions support. 123 125 = 0.9.6 = 124 126 * Set advanced optimization as default -
piio-image-optimization/trunk/piio-image-optimization.php
r1953367 r1954139 13 13 * Plugin URI: https://piio.co/wordpress 14 14 * Description: Generates responsive and optimized images, so you don't have to. 15 * Version: 0.9. 615 * Version: 0.9.7 16 16 * Author: Piio, Inc. 17 17 * Author URI: https://piio.co … … 30 30 * Currently plugin version. 31 31 */ 32 define( 'PIIO_IMAGE_OPTIMIZATION_VERSION', '0.9. 6' );32 define( 'PIIO_IMAGE_OPTIMIZATION_VERSION', '0.9.7' ); 33 33 34 34 /** -
piio-image-optimization/trunk/public/class-piio-image-optimization-public.php
r1931963 r1954139 130 130 $in_footer = isset($position[0]) ? ($position[0] === "0") : false; 131 131 132 $jsVars = [132 $jsVars = array( 133 133 'appKey' => $api_key, 134 134 'domain' => $domain, 135 135 'lazyLoadingMode' => $lazy_mode, 136 136 'disableWebP' => !$enable_webp 137 ];137 ); 138 138 139 139 $piio_vars = "var piioData = " . json_encode($jsVars); … … 188 188 $srcAttr = urlencode($src); 189 189 190 $breakpoints = ["576", "768", "992", "1200"];190 $breakpoints = array("576", "768", "992", "1200"); 191 191 $srcset_values = array(); 192 192 foreach ($breakpoints as $width) { … … 239 239 } 240 240 241 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?)(background-image:.*?url\(['\"](\s*.*?\s*)['\"]\));?(.*?['\"])/is", function($matches) use ($api_key, $params){ 242 $srcAttr = urlencode($matches[3]); 243 return $matches[1] . "background-image:url('https://pcdn.piiojs.com/i/" . $api_key . (($params != '') ? '/' . $params : '') . "/" . $srcAttr . "');" . $matches[4]; 244 }, $bckHTML); 245 246 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?background:.*?url\(['\"])(\s*.*?\s*)(['\"]\);?.*?['\"])/is", function($matches) use ($api_key, $params){ 247 $srcAttr = urlencode($matches[2]); 248 return $matches[1] . "https://pcdn.piiojs.com/i/" . $api_key . (($params != '') ? '/' . $params : '') . "/" . $srcAttr . $matches[3]; 249 }, $replaceHTML); 241 $callback = new Piio_Image_Callback($api_key, $params); 242 243 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?)(background-image:.*?url\(['\"](\s*.*?\s*)['\"]\));?(.*?['\"])/is", array($callback, 'callback_background_image'), $bckHTML); 244 245 $replaceHTML = preg_replace_callback("/(\sstyle=['\"][^>]*?background:.*?url\(['\"])(\s*.*?\s*)(['\"]\);?.*?['\"])/is", array($callback, 'callback_background'), $replaceHTML); 250 246 } 251 247 … … 339 335 $url = ''; 340 336 if ( !empty( $parts['scheme'] ) ) 341 $url .= $parts['scheme'] . ':'; 337 { 338 $url .= $parts['scheme'] . ':'; 339 } 342 340 if ( isset( $parts['host'] ) ) 343 341 { … … 392 390 } 393 391 } 392 if ( !class_exists( 'Piio_Image_Callback' ) ) { 393 class Piio_Image_Callback { 394 private $api_key; 395 private $params; 396 397 function __construct($api_key, $params) { 398 $this->$api_key = $api_key; 399 $this->$params = $params; 400 } 401 402 public function callback_background_image($matches) { 403 $srcAttr = urlencode($matches[3]); 404 return $matches[1] . "background-image:url('https://pcdn.piiojs.com/i/" . $this->api_key . (($this->params != '') ? '/' . $this->params : '') . "/" . $srcAttr . "');" . $matches[4]; 405 } 406 407 public function callback_background($matches) { 408 $srcAttr = urlencode($matches[2]); 409 return $matches[1] . "https://pcdn.piiojs.com/i/" . $this->api_key . (($this->params != '') ? '/' . $this->params : '') . "/" . $srcAttr . $matches[3]; 410 } 411 } 412 } -
piio-image-optimization/trunk/readme.txt
r1953367 r1954139 4 4 Tags: image optimization, responsive, lazy loading, image compressor, image compression, cdn 5 5 Requires at least: 4.6 6 Requires PHP: 5. 2.47 Tested up to: 4.9. 78 Stable tag: 0.9. 66 Requires PHP: 5.3.0 7 Tested up to: 4.9.8 8 Stable tag: 0.9.7 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 121 121 122 122 == Changelog == 123 = 0.9.7 = 124 * Added older PHP versions support. 123 125 = 0.9.6 = 124 126 * Set advanced optimization as default
Note: See TracChangeset
for help on using the changeset viewer.