Plugin Directory

Changeset 1747647


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

Version 1.1.1

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

Legend:

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

    r1747601 r1747647  
    22/*
    33Plugin Name: Easy Lazy Loader
    4 Version: 1.1.0
     4Version: 1.1.1
    55Plugin URI: https://www.iprodev.com/go/easy-lazy-loader/
    66Author: iProDev
     
    1616
    1717    class EasyLazyLoader {
    18         const version = '1.1.0';
     18        const version = '1.1.1';
    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             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 );
    956954
    957955            // Create a new image instance
     
    10191017            global $wpdb;
    10201018
    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}'";
    10291024            $id    = $wpdb->get_var( $query );
    10301025
  • easy-lazy-loader/trunk/js/easy-lazy-loader.js

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

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

    r1747601 r1747647  
    55Requires at least: 3.2
    66Tested up to: 4.9
    7 Stable tag: 1.1.0
     7Stable tag: 1.1.1
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    102102== Changelog ==
    103103
     104= 1.1.1 =
     105
     106* **Optimized:** attachment identifier, now identify images from their URL better.
     107
    104108= 1.1.0 =
    105109
Note: See TracChangeset for help on using the changeset viewer.