Plugin Directory

Changeset 1747658


Ignore:
Timestamp:
10/17/2017 04:30:41 AM (8 years ago)
Author:
iprodev
Message:

Version 1.1.2

Location:
easy-lazy-loader/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • easy-lazy-loader/trunk/easy-lazy-loader.php

    r1747647 r1747658  
    22/*
    33Plugin Name: Easy Lazy Loader
    4 Version: 1.1.1
     4Version: 1.1.2
    55Plugin URI: https://www.iprodev.com/go/easy-lazy-loader/
    66Author: iProDev
     
    1616
    1717    class EasyLazyLoader {
    18         const version = '1.1.1';
     18        const version = '1.1.2';
    1919
    2020        public $MAIN;
     
    498498        public function enqueue_scripts() {
    499499            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 );
    501501
    502502            wp_localize_script( $this->SLUG, $this->SLUG, array(
     
    940940         */
    941941        public static function create_placeholder( $background = '#FFF', $width = 1, $height = 1, $text = "" ) {
    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 );
     942            if ( $width >= 30 && $height >= 30 ) {
     943                $new_dimensions = wp_constrain_dimensions( $width, $height, 30, 30 );
     944                $width = $new_dimensions[0];
     945                $height = $new_dimensions[1];
     946            }
     947            else {
     948                if ( $width >= $height ) {
     949                    $width = $ratio = round( $width / $height );
     950                    $height = 1;
     951                } else {
     952                    $height = $ratio = round( $height / $width );
     953                    $width = 1;
     954                }
     955            }
    954956
    955957            // Create a new image instance
  • easy-lazy-loader/trunk/js/easy-lazy-loader.js

    r1747647 r1747658  
    33 * http://www.iprodev.com/
    44 *
    5  * @version: 1.1.1 - October 17, 2017
     5 * @version: 1.1.2 - October 17, 2017
    66 *
    77 * @author: iProDev (Hemn Chawroka)
  • easy-lazy-loader/trunk/js/easy-lazy-loader.min.js

    r1747647 r1747658  
    33 * https://www.iprodev.com/
    44 *
    5  * @version: 1.1.1 - October 17, 2017
     5 * @version: 1.1.2 - October 17, 2017
    66 *
    77 * @author: iProDev (Hemn Chawroka)
  • easy-lazy-loader/trunk/readme.txt

    r1747647 r1747658  
    55Requires at least: 3.2
    66Tested up to: 4.9
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    102102== Changelog ==
    103103
     104= 1.1.2 =
     105
     106* **Fixed:** some bugs and stability improvements.
     107
    104108= 1.1.1 =
    105109
Note: See TracChangeset for help on using the changeset viewer.