Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 71f748a

Browse files
authored
Merge pull request #30 from shinsenter/develop
Fixed CVE-2019-18888, updated library
2 parents ec87f9d + 72adff9 commit 71f748a

File tree

7 files changed

+47
-153
lines changed

7 files changed

+47
-153
lines changed

README.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ Lazy loading content on web page can help reduce resource contention and improve
103103

104104
== Changelog ==
105105

106-
1.1.10+4 Removed external resources
106+
1.1.11 Fixed security issue (Fixed CVE-2019-18888)
107+
108+
1.1.10+5 Removed external resources
107109

108110
1.1.10 Bug fixes and improvements
109111

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.10+4
1+
1.1.11

admin/class-defer-js-admin.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,22 @@ public function register_options()
6767

6868
public function register_menu()
6969
{
70-
// Remove old menu
71-
remove_menu_page(DEFER_JS_PLUGIN_NAME);
72-
73-
// Create new top-level menu
74-
add_menu_page(
75-
__('Configure defer.js settings'),
76-
__('My defer.js'),
77-
'administrator',
78-
DEFER_JS_PLUGIN_NAME,
79-
array($this, 'options_page'),
80-
plugins_url('/icon.jpg', __FILE__),
81-
$this->get_menu_position()
82-
);
70+
// Temporary disable icon on menu
71+
return null;
72+
73+
// // Remove old menu
74+
// remove_menu_page(DEFER_JS_PLUGIN_NAME);
75+
76+
// // Create new top-level menu
77+
// add_menu_page(
78+
// __('Configure defer.js settings'),
79+
// __('My defer.js'),
80+
// 'administrator',
81+
// DEFER_JS_PLUGIN_NAME,
82+
// array($this, 'options_page'),
83+
// plugins_url('/icon.jpg', __FILE__),
84+
// $this->get_menu_position()
85+
// );
8386
}
8487

8588
public function register_menu_plugin_options($links)

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
22
"license": "MIT",
33
"type": "project",
4-
"scripts":
5-
{
4+
"scripts": {
65
"fixer": "php-cs-fixer fix --show-progress=estimating --verbose",
76
"deploy": [
87
"bash ./_dist_/deploy.sh"
98
]
109
},
1110
"require": {
1211
"php": ">=5.6",
13-
"symfony/http-foundation": "3.4.36",
14-
"shinsenter/defer.php": "^1.0.0"
12+
"symfony/http-foundation": "3.3.18",
13+
"shinsenter/defer.php": "^1.0"
1514
},
1615
"config": {
1716
"preferred-install": "dist",

composer.lock

Lines changed: 15 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

defer-wordpress.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
* Currently plugin version.
2121
* Rename this for your plugin and update it as you release new versions.
2222
*/
23-
define('DEFER_WORDPRESS_PLUGIN_VERSION', '1.1.10+4');
23+
define('DEFER_WORDPRESS_PLUGIN_VERSION', '1.1.11');
2424
define('DEFER_JS_PREFIX', 'shinsenter_deferjs_');
2525

2626
/*
2727
* @wordpress-plugin
2828
* Plugin Name: An efficient lazy loader (defer.js)
2929
* Plugin URI: https://wordpress.org/plugins/shins-pageload-magic/
3030
* Description: ⚡️ A native, blazing fast lazy loader. ✅ Legacy browsers support (IE9+). 💯 SEO friendly. 🧩 Lazy load almost anything.
31-
* Version: 1.1.10+4
31+
* Version: 1.1.11
3232
* Author: Mai Nhut Tan
3333
* Author URI: https://code.shin.company/
3434
* License: GPL-2.0+
@@ -41,7 +41,7 @@
4141
* defer.js library version
4242
*/
4343
// if (!defined('DEFER_JS_VERSION')) {
44-
// define('DEFER_JS_VERSION', '1.1.10');
44+
// define('DEFER_JS_VERSION', '1.1.11');
4545
// }
4646

4747
if (!defined('DEFER_JS_PLUGIN_NAME')) {
@@ -88,27 +88,26 @@ function shinsenter_deferjs_ob($buffer)
8888

8989
// all files have been downloaded and served locally
9090
// https://github.com/shinsenter/defer.js/tree/master/dist
91+
$deferjs = file_get_contents(__DIR__ . '/public/js/defer.js');
9192
$polyfill = '"IntersectionObserver"in window||deferscript("'
9293
. plugin_dir_url(__FILE__)
9394
. 'public/js/polyfill.js","polyfill-js",1);';
94-
$deferjs = file_get_contents(__DIR__ . '/public/js/defer.js');
9595
$helpers = file_get_contents(\shinsenter\Defer::HELPERS_URL);
9696

9797
// Append polyfill.js and defer_plus.min.js
98-
\shinsenter\Defer::$helpers = $polyfill . $deferjs . $helpers;
99-
98+
\shinsenter\Defer::$helpers = $deferjs . $polyfill . $helpers;
10099

101100
// Remove copyright (omit external requests)
102101
\shinsenter\Defer::$fingerprint = '
103102
┌┬┐┌─┐┌─┐┌─┐┬─┐ ┬┌─┐
104103
││├┤ ├┤ ├┤ ├┬┘ │└─┐
105104
─┴┘└─┘└ └─┘┴└─o└┘└─┘
106105
This page was optimized with defer.js
107-
WordPress: https://wordpress.org/plugins/shins-pageload-magic/
106+
https://wordpress.org/plugins/shins-pageload-magic/
108107
';
109108

110-
$defer->debug_mode = false;
111-
$defer->hide_warnings = true;
109+
$defer->debug_mode = false;
110+
$defer->hide_warnings = true;
112111

113112
$optimized = $defer->fromHtml($buffer)->toHtml();
114113
} catch (\Exception $e) {

public/js/defer.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)