Changeset 1747647
- Timestamp:
- 10/17/2017 03:41:54 AM (8 years ago)
- Location:
- easy-lazy-loader/trunk
- Files:
-
- 4 edited
-
easy-lazy-loader.php (modified) (5 diffs)
-
js/easy-lazy-loader.js (modified) (1 diff)
-
js/easy-lazy-loader.min.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-lazy-loader/trunk/easy-lazy-loader.php
r1747601 r1747647 2 2 /* 3 3 Plugin Name: Easy Lazy Loader 4 Version: 1.1. 04 Version: 1.1.1 5 5 Plugin URI: https://www.iprodev.com/go/easy-lazy-loader/ 6 6 Author: iProDev … … 16 16 17 17 class EasyLazyLoader { 18 const version = '1.1. 0';18 const version = '1.1.1'; 19 19 20 20 public $MAIN; … … 498 498 public function enqueue_scripts() { 499 499 wp_enqueue_script( 'jquery-sonar', self::get_url( $this->OPTIONS['debug_mode'] ? 'js/jquery.sonar.js' : 'js/jquery.sonar.min.js' ), array( 'jquery' ), '3.0.0', true ); 500 wp_enqueue_script( $this->SLUG, self::get_url( $this->OPTIONS['debug_mode'] ? 'js/easy-lazy-loader.js' : 'js/easy-lazy-loader.min.js' ), array( 'jquery', 'jquery-sonar' ), self::version, true );500 //wp_enqueue_script( $this->SLUG, self::get_url( $this->OPTIONS['debug_mode'] ? 'js/easy-lazy-loader.js' : 'js/easy-lazy-loader.min.js' ), array( 'jquery', 'jquery-sonar' ), self::version, true ); 501 501 502 502 wp_localize_script( $this->SLUG, $this->SLUG, array( … … 940 940 */ 941 941 public static function create_placeholder( $background = '#FFF', $width = 1, $height = 1, $text = "" ) { 942 if ( !$text ) { 943 $factor = min( 1 / $width, 1 / $height ); 944 $width_new = round( $width * $factor ); 945 $height_new = round( $height * $factor ); 946 947 if ( $width_new <= 0 ) { 948 $factor = 1 / $width; 949 } else if ( $height_new <= 0 ) { 950 $factor = 1 / $height; 951 } 952 953 $width = round( $width * $factor ); 954 $height = round( $height * $factor ); 955 } 942 $factor = min( 1 / $width, 1 / $height ); 943 $width_new = round( $width * $factor ); 944 $height_new = round( $height * $factor ); 945 946 if ( $width_new <= 0 ) { 947 $factor = 1 / $width; 948 } else if ( $height_new <= 0 ) { 949 $factor = 1 / $height; 950 } 951 952 $width = round( $width * $factor ); 953 $height = round( $height * $factor ); 956 954 957 955 // Create a new image instance … … 1019 1017 global $wpdb; 1020 1018 1021 $reg = "/-[0-9]+x[0-9]+?.(jpg|jpeg|png|gif)$/i"; 1022 $src = preg_replace( $reg, '', $image_src ); 1023 if ( $src != $image_src ) { 1024 $ext = pathinfo( $image_src, PATHINFO_EXTENSION ); 1025 $image_src = $src . '.' .$ext; 1026 } 1027 1028 $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'"; 1019 $uploads_directory = wp_upload_dir(); 1020 $image_src = preg_replace( "/-[0-9]+x[0-9]+./i", '.', $image_src ); 1021 $image_src = str_replace( $uploads_directory['baseurl'] . "/", "", $image_src ); 1022 1023 $query = "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value='{$image_src}'"; 1029 1024 $id = $wpdb->get_var( $query ); 1030 1025 -
easy-lazy-loader/trunk/js/easy-lazy-loader.js
r1747601 r1747647 3 3 * http://www.iprodev.com/ 4 4 * 5 * @version: 1.1. 0- October 17, 20175 * @version: 1.1.1 - October 17, 2017 6 6 * 7 7 * @author: iProDev (Hemn Chawroka) -
easy-lazy-loader/trunk/js/easy-lazy-loader.min.js
r1747601 r1747647 3 3 * https://www.iprodev.com/ 4 4 * 5 * @version: 1.1. 0- October 17, 20175 * @version: 1.1.1 - October 17, 2017 6 6 * 7 7 * @author: iProDev (Hemn Chawroka) -
easy-lazy-loader/trunk/readme.txt
r1747601 r1747647 5 5 Requires at least: 3.2 6 6 Tested up to: 4.9 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl.html … … 102 102 == Changelog == 103 103 104 = 1.1.1 = 105 106 * **Optimized:** attachment identifier, now identify images from their URL better. 107 104 108 = 1.1.0 = 105 109
Note: See TracChangeset
for help on using the changeset viewer.