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

Commit

Permalink
Merge pull request #29 from shinsenter/develop
Browse files Browse the repository at this point in the history
Updated vulnerable dependency
  • Loading branch information
shinsenter authored Dec 3, 2019
2 parents cc1953b + cb849fe commit ec87f9d
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 67 deletions.
4 changes: 3 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ Lazy loading content on web page can help reduce resource contention and improve

== Changelog ==

1.1.10+3 Bug fixes and improvements
1.1.10+4 Removed external resources

1.1.10 Bug fixes and improvements

1.1.9 Fixed wrong encoding when using mb_detect_encoding() function

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.10+3
1.1.10+4
4 changes: 2 additions & 2 deletions _dist_/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ fi
cd $plugin_dir

svn rm trunk/* --force
rsync -aHxW --delete --exclude-from=$base_dir/_dist_/blacklist.txt $base_dir/ $plugin_dir/trunk/
mv trunk/defer-wordpress.php $plugin_dir/trunk/$plugin_name.php
rsync -aHxW --delete --exclude-from=$base_dir/_dist_/blacklist.txt $base_dir/ trunk/
mv trunk/defer-wordpress.php trunk/$plugin_name.php

svn add trunk/* --force
svn stat
Expand Down
23 changes: 0 additions & 23 deletions admin/class-defer-js-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,6 @@ public function register_menu_plugin_options($links)

public function options_page()
{
if (!defined('DEFER_JS_SPONSORS_HTML')) {
if (class_exists('shinsenter\DeferCache')) {
$cache = new \shinsenter\DeferCache(DEFER_JS_CACHE_DIR, 1);
$html = $cache->get('sponsors' . DEFER_JS_CACHE_SUFFIX);

if (empty($html)) {
$html = @file_get_contents(DEFER_JS_SPONSORS . '?t=' . time());
$cache->put('sponsors' . DEFER_JS_CACHE_SUFFIX, $html, DEFER_JS_CACHE_EXP);
}

define('DEFER_JS_SPONSORS_HTML', $html);
} else {
if (!file_exists(DEFER_JS_CACHE_DIR) || time() - filectime(DEFER_JS_CACHE_DIR) >= DEFER_JS_CACHE_EXP) {
$source = @file_get_contents(DEFER_JS_SPONSORS . '?t=' . time());
$template = "<?php define('DEFER_JS_SPONSORS_HTML', base64_decode('%s'));";
@file_put_contents(DEFER_JS_CACHE_DIR . '/sponsors.php', sprintf($template, base64_encode($source)));
}

@include_once DEFER_JS_CACHE_DIR . '/sponsors.php';
}
}

if (!empty($_REQUEST['reset-settings'])) {
$reset_settings = $this->reset_settings();
}
Expand Down Expand Up @@ -170,7 +148,6 @@ public function enqueue_scripts()
* class.
*/

wp_enqueue_script('defer.js', 'https://cdn.jsdelivr.net/npm/@shinsenter/defer.js/dist/defer.min.js', array(), $this->version, false);
wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/defer-js-admin.js', array(), $this->version, false);
}

Expand Down
9 changes: 3 additions & 6 deletions admin/partials/defer-js-admin-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@
</div>
</div>

<?php /*
<div class="postbox">
<h2>Add defer.js library</h2>
<div class="inside">
Expand All @@ -404,7 +405,7 @@
</fieldset>
</td>
</tr>
<!--
<tr class="top">
<th>
<label for="deferjs_default_defer_time">Defer timeout</label>
Expand All @@ -420,7 +421,6 @@
</fieldset>
</td>
</tr>
-->
</tbody>
</table>
Expand All @@ -430,6 +430,7 @@
</p>
</div>
</div>
*/ ?>
</form>
</div>

Expand Down Expand Up @@ -473,9 +474,5 @@
<p>From Vietnam 🇻🇳 with love.</p>
</div>
</div>

<?php if (defined('DEFER_JS_SPONSORS_HTML')) {
echo DEFER_JS_SPONSORS_HTML;
} ?>
</div>
</div>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"require": {
"php": ">=5.6",
"symfony/http-foundation": "3.3.18",
"shinsenter/defer.php": "^1.0"
"symfony/http-foundation": "3.4.36",
"shinsenter/defer.php": "^1.0.0"
},
"config": {
"preferred-install": "dist",
Expand Down
145 changes: 127 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ec87f9d

Please sign in to comment.