Version Description
- Fix bug caused by a too aggressive cleanup
Download this release
Release Info
| Developer | wp_media |
| Plugin | |
| Version | 1.4.1 |
| Comparing to | |
| See all releases | |
Code changes from version 1.4 to 1.4.1
- readme.txt +4 -1
- rocket-lazy-load.php +19 -12
- vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom.php +1 -1
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: creativejuiz, tabrisrp, wp_media
|
|
| 3 |
Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar
|
| 4 |
Requires at least: 3.0
|
| 5 |
Tested up to: 4.8.1
|
| 6 |
-
Stable tag: 1.4
|
| 7 |
|
| 8 |
The tiny Lazy Load script for WordPress without jQuery, works for images and iframes.
|
| 9 |
|
|
@@ -51,6 +51,9 @@ Some plugins are not compatible without lazy loading. Please open a support thre
|
|
| 51 |
|
| 52 |
== Changelog ==
|
| 53 |
|
|
|
|
|
|
|
|
|
|
| 54 |
= 1.4 =
|
| 55 |
* New option: replace Youtube videos by thumbnail. This option can improve your loading time a lot, especially if you have multiple videos on the same page
|
| 56 |
|
| 3 |
Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar
|
| 4 |
Requires at least: 3.0
|
| 5 |
Tested up to: 4.8.1
|
| 6 |
+
Stable tag: 1.4.1
|
| 7 |
|
| 8 |
The tiny Lazy Load script for WordPress without jQuery, works for images and iframes.
|
| 9 |
|
| 51 |
|
| 52 |
== Changelog ==
|
| 53 |
|
| 54 |
+
= 1.4.1 =
|
| 55 |
+
* Fix bug caused by a too aggressive cleanup
|
| 56 |
+
|
| 57 |
= 1.4 =
|
| 58 |
* New option: replace Youtube videos by thumbnail. This option can improve your loading time a lot, especially if you have multiple videos on the same page
|
| 59 |
|
rocket-lazy-load.php
CHANGED
|
@@ -1,17 +1,9 @@
|
|
| 1 |
<?php
|
| 2 |
-
require_once realpath( plugin_dir_path( __FILE__ ) ) . '/vendor/autoload.php';
|
| 3 |
-
|
| 4 |
-
use PHPHtmlParser\Dom;
|
| 5 |
-
use PHPHtmlParser\Dom\HtmlNode;
|
| 6 |
-
use PHPHtmlParser\Dom\Tag;
|
| 7 |
-
|
| 8 |
-
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
| 9 |
-
|
| 10 |
/**
|
| 11 |
* Plugin Name: Lazy Load by WP Rocket
|
| 12 |
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
| 13 |
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
| 14 |
-
* Version: 1.4
|
| 15 |
* Requires PHP: 5.4
|
| 16 |
* Author: WP Media
|
| 17 |
* Author URI: https://wp-rocket.me
|
|
@@ -33,7 +25,16 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
| 33 |
* You should have received a copy of the GNU General Public License
|
| 34 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 35 |
*/
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
define( 'ROCKET_LL_PATH', realpath( plugin_dir_path( __FILE__ ) ) . '/' );
|
| 38 |
define( 'ROCKET_LL_3RD_PARTY_PATH', ROCKET_LL_PATH . '3rd-party/' );
|
| 39 |
define( 'ROCKET_LL_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets/' );
|
|
@@ -212,7 +213,10 @@ function rocket_lazyload_images( $html ) {
|
|
| 212 |
$dom = new Dom();
|
| 213 |
$dom->setOptions(
|
| 214 |
[
|
| 215 |
-
'
|
|
|
|
|
|
|
|
|
|
| 216 |
]
|
| 217 |
);
|
| 218 |
$dom->load( $html );
|
|
@@ -479,7 +483,10 @@ function rocket_lazyload_iframes( $html ) {
|
|
| 479 |
$dom = new Dom();
|
| 480 |
$dom->setOptions(
|
| 481 |
[
|
| 482 |
-
'
|
|
|
|
|
|
|
|
|
|
| 483 |
]
|
| 484 |
);
|
| 485 |
$dom->load( $html );
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
/**
|
| 3 |
* Plugin Name: Lazy Load by WP Rocket
|
| 4 |
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
| 5 |
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
| 6 |
+
* Version: 1.4.1
|
| 7 |
* Requires PHP: 5.4
|
| 8 |
* Author: WP Media
|
| 9 |
* Author URI: https://wp-rocket.me
|
| 25 |
* You should have received a copy of the GNU General Public License
|
| 26 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 27 |
*/
|
| 28 |
+
|
| 29 |
+
require_once realpath( plugin_dir_path( __FILE__ ) ) . '/vendor/autoload.php';
|
| 30 |
+
|
| 31 |
+
use PHPHtmlParser\Dom;
|
| 32 |
+
use PHPHtmlParser\Dom\HtmlNode;
|
| 33 |
+
use PHPHtmlParser\Dom\Tag;
|
| 34 |
+
|
| 35 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
| 36 |
+
|
| 37 |
+
define( 'ROCKET_LL_VERSION', '1.4.1' );
|
| 38 |
define( 'ROCKET_LL_PATH', realpath( plugin_dir_path( __FILE__ ) ) . '/' );
|
| 39 |
define( 'ROCKET_LL_3RD_PARTY_PATH', ROCKET_LL_PATH . '3rd-party/' );
|
| 40 |
define( 'ROCKET_LL_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets/' );
|
| 213 |
$dom = new Dom();
|
| 214 |
$dom->setOptions(
|
| 215 |
[
|
| 216 |
+
'removeScripts' => false,
|
| 217 |
+
'removeStyles' => false,
|
| 218 |
+
'preserveLineBreaks' => true,
|
| 219 |
+
'removeDoubleSpace' => false,
|
| 220 |
]
|
| 221 |
);
|
| 222 |
$dom->load( $html );
|
| 483 |
$dom = new Dom();
|
| 484 |
$dom->setOptions(
|
| 485 |
[
|
| 486 |
+
'removeScripts' => false,
|
| 487 |
+
'removeStyles' => false,
|
| 488 |
+
'preserveLineBreaks' => true,
|
| 489 |
+
'removeDoubleSpace' => false,
|
| 490 |
]
|
| 491 |
);
|
| 492 |
$dom->load( $html );
|
vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom.php
CHANGED
|
@@ -509,7 +509,7 @@ class Dom
|
|
| 509 |
}
|
| 510 |
|
| 511 |
// strip smarty scripts
|
| 512 |
-
|
| 513 |
|
| 514 |
return $str;
|
| 515 |
}
|
| 509 |
}
|
| 510 |
|
| 511 |
// strip smarty scripts
|
| 512 |
+
//$str = mb_eregi_replace("(\{\w)(.*?)(\})", '', $str);
|
| 513 |
|
| 514 |
return $str;
|
| 515 |
}
|
