Version Description
- Added an option to increase your page load speed by minifying JavaScript and HTML. Removed option to remove RSD Link, since its impact on improving speed was insignificant.
Download this release
Release Info
Developer | ShortPixel |
Plugin | Speed Booster Pack |
Version | 3.4 |
Comparing to | |
See all releases |
Code changes from version 3.3 to 3.4
- css/sbp_style.min.css +1 -1
- css/style.dev.css +2 -2
- inc/core.php +17 -5
- inc/sbp-minifier.php +120 -0
- inc/template/options.php +3 -3
- readme.txt +7 -7
- speed-booster-pack.php +2 -2
css/sbp_style.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.postbox,.wrap .sb-pack .sbp-box{position:relative;overflow:hidden}.wrap .sb-pack .welcome-panel .welcome-panel-column:first-child{display:block!important}.wrap .sb-pack .welcome-panel h4{margin:1.33em 0 20px}.wrap .sb-pack .sbp-inline-wrap{display:inline-block;margin-right:10px;vertical-align:top}.wrap .sb-pack .sbp-more-width{width:300px}.wrap .sb-pack input[type=text]{line-height:1.3}.wrap .sb-pack .sbp-all-enqueued{background-color:#FCFCFC;padding:5px 0 10px;border:1px solid #ddd;width:auto}.wrap .sb-pack .sbp-title-scripts,.wrap .sb-pack .sbp-width{min-width:200px;width:auto;padding:0 20px}.wrap .sb-pack .sbp-title-scripts{display:inline-block;font-weight:700}.wrap .sb-pack #poststuff h2{font-size:
|
1 |
+
.postbox,.wrap .sb-pack .sbp-box{position:relative;overflow:hidden}.wrap .sb-pack .welcome-panel .welcome-panel-column:first-child{display:block!important}.wrap .sb-pack .welcome-panel h4{margin:1.33em 0 20px}.wrap .sb-pack .sbp-inline-wrap{display:inline-block;margin-right:10px;vertical-align:top}.wrap .sb-pack .sbp-more-width{width:300px}.wrap .sb-pack input[type=text]{line-height:1.3}.wrap .sb-pack .sbp-all-enqueued{background-color:#FCFCFC;padding:5px 0 10px;border:1px solid #ddd;width:auto}.wrap .sb-pack .sbp-title-scripts,.wrap .sb-pack .sbp-width{min-width:200px;width:auto;padding:0 20px}.wrap .sb-pack .sbp-title-scripts{display:inline-block;font-weight:700}.wrap .sb-pack #poststuff h2{font-size:32px;padding:9px 15px 20px 0;font-weight:700;line-height:1.3}.wrap .sb-pack #poststuff .main-sbp-title h3{font-size:24px;padding:8px 0 20px;font-weight:700;color:#FA5148}.wrap .sb-pack .handlediv{color:#80828F;padding: 10px 0 0;cursor:pointer}.wrap .sb-pack .meta-box-sortables .postbox .handlediv:before{right:20px;font:400 30px/1.2 dashicons;padding:8px 0;content:"\f343"}.wrap .sb-pack .meta-box-sortables .postbox.closed .handlediv:before{content:"\f347"}.wrap .sb-pack .postbox .inside{padding:0 20px 20px}.wrap .sb-pack #poststuff .inside{margin:26px 0 0}.wrap .sb-pack #poststuff h3{font-size:24px;padding:8px 20px;font-weight:700;display:inline-block}.wrap .sb-pack .sbp-columns1{display:inline-block}.wrap .sb-pack .sbp-columns2{display:inline-block;max-width:73%}.wrap .sb-pack .sbp-title-div{height:50px;clear:both}.wrap .sb-pack .sbp-amount{background-color:transparent;border:none;box-shadow:none;font-size:16px}.wrap .sb-pack .sbp-slider{width:40%}.wrap .sb-pack p{color:#464646;line-height:1.6}.wrap .sb-pack .debug-info{margin-top:19px;border:1px solid #1A9E51;padding:17px 10px;background-color:#2DCB73;color:#FFF;font-size:16px;line-height:1.6;text-shadow:1px 1px #1A9E51}.wrap .sb-pack .td-margin{margin:1.5em 0}.wrap .sb-pack .sbp-div-head{border-bottom:1px solid #E1E1E1;margin:0 0 5px;padding:0 0 5px}.wrap .sb-pack .td-border{border-bottom:1px solid #E1E1E1;margin:10px 0}.wrap .sb-pack .td-border-last{border-bottom:1px solid #E1E1E1;margin:1.5em 0}.wrap .sb-pack .sbp-radio-content{display:block}.wrap .sb-pack .sbp-radio-content label{display:block!important}.wrap .sb-pack .sbp-box hr{margin-left:70px}.wrap .sb-pack .sbp-1{padding-top:10px}.wrap .sb-pack .sbp-2{padding-bottom:15px}.wrap .sb-pack .sbp-3{padding-top:5px}.wrap .sb-pack .sbp-title-div .sbp-title{font-size:23px;font-weight:300;line-height:26px;padding-top:16px;padding-right:15px;display:block;float:left}.wrap .sb-pack .sbp-box{background:#fff;border:1px solid #E5E5E5;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:15px;margin-bottom:15px}.wrap .sb-pack .ui-widget-content,.wrap .sb-pack label:before{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.wrap .sb-pack .sbp-box p{margin:5px 0 5px 70px;color:#777}.wrap .sb-pack .sbp-infos{display:block;margin:0 auto;padding-left:70px;font-weight:700;color:#777}.wrap .sb-pack .sbp-infos span{color:#777;font-weight:400}.wrap .sb-pack .sbp-infos-title{font-weight:700;color:#777}.wrap .sb-pack .sbp-box-legend,.wrap .sb-pack .sbp-box-version{position:absolute;left:0;top:0;height:100%}.wrap .sb-pack .sbp-box-version{background:#80828F;padding:20px 15px}.wrap .sb-pack .sbp-box-legend{background:#FCC500;padding:15px}.wrap .sb-pack .sbp-box-legend:hover{background-color:#F39C12}.wrap .sb-pack .sbp-box-version:hover{background-color:#6C6E79}.wrap .sb-pack .sbp-icon-help,.wrap .sb-pack .sbp-icon-version{color:#FFF;font-size:25px}.wrap .sb-pack .sbp-icon:before{content:"\f185";display:inline-block;-webkit-font-smoothing:antialiased;font:400 36px/.6 dashicons;vertical-align:sub;color:#FA5148;padding-right:5px}.wrap .sb-pack .sbp-icon-information:before{content:"\f348";display:inline-block;-webkit-font-smoothing:antialiased;font:400 28px/1 dashicons;vertical-align:middle;color:#C9D6E2;padding-right:5px}.wrap .sb-pack label{display:inline-block;cursor:pointer;position:relative;padding-left:35px;font-size:16px}.wrap .sb-pack label:before{content:"\2717";font-size:16px;-webkit-font-smoothing:antialiased;text-align:center;color:#fff;display:inline-block;width:26px;height:26px;margin-right:10px;position:absolute;left:0;background:#C9D6E2;box-shadow:inset 0 1px 2px rgba(0,0,0,.1);border:1px solid #B2BFCA}.wrap .sb-pack input[type=checkbox],.wrap .sb-pack input[type=radio]{display:none}.wrap .sb-pack input[type=checkbox]:checked+label:before{content:"\2714";background:#2DCB73;text-shadow:1px 1px 1px #148D44;border:1px solid #1A9E51;font-size:16px;-webkit-font-smoothing:antialiased;color:#fff;text-align:center}.wrap .sb-pack .sbp-icon-version:before{content:"\f348";display:inline-block;-webkit-font-smoothing:antialiased;font:400 30px/1 dashicons;vertical-align:top}.wrap .sb-pack .sbp-icon-help:before{content:"\f123";display:inline-block;-webkit-font-smoothing:antialiased;font:400 30px/1 dashicons;vertical-align:top}.wrap .sb-pack .sbp-stats{font-size:16px;line-height:1.5}.wrap .sb-pack .ui-widget-content .ui-state-default,.wrap .sb-pack .ui-widget-header .ui-state-default,.wrap .sb-pack.ui-state-default{border:1px solid #1A9E51;background-color:#2DCB73;font-weight:400;color:#555;outline:0;cursor:pointer}.wrap .sb-pack .ui-corner-all,.wrap .sb-pack .ui-corner-bl,.wrap .sb-pack .ui-corner-bottom,.wrap .sb-pack .ui-corner-left{border-bottom-left-radius:0}.wrap .sb-pack .ui-state-default:before,.wrap .sb-pack .ui-widget-content .ui-state-default:before,.wrap .sb-pack .ui-widget-header .ui-state-default:before{content:"\2630";display:inline-block;-webkit-font-smoothing:antialiased;color:#fff;font-weight:700;text-shadow:0 1px #1A9E51;line-height:1.8em}.wrap .sb-pack .ui-state-default a,.wrap .sb-pack .ui-state-default a:link,.wrap .sb-pack .ui-state-default a:visited{color:#fff;text-decoration:none}.wrap .sb-pack .ui-state-focus,.wrap .sb-pack .ui-state-hover,.wrap .sb-pack .ui-widget-content .ui-state-focus,.wrap .sb-pack .ui-widget-content .ui-state-hover,.wrap .sb-pack .ui-widget-header .ui-state-focus,.wrap .sb-pack .ui-widget-header .ui-state-hover{background:#3CE281}.wrap .sb-pack .ui-corner-all,.wrap .sb-pack .ui-corner-left,.wrap .sb-pack .ui-corner-tl,.wrap .sb-pack .ui-corner-top{border-top-left-radius:0}.wrap .sb-pack .ui-corner-all,.wrap .sb-pack .ui-corner-right,.wrap .sb-pack .ui-corner-top,.wrap .sb-pack .ui-corner-tr{border-top-right-radius:0}.wrap .sb-pack .ui-corner-all,.wrap .sb-pack .ui-corner-bottom,.wrap .sb-pack .ui-corner-br,.wrap .sb-pack .ui-corner-right{border-bottom-right-radius:0}.wrap .sb-pack .ui-slider-horizontal{height:1.3em}.wrap .sb-pack .ui-slider .ui-slider-handle{width:1.8em;height:1.8em;cursor:pointer;text-align:center}.wrap .sb-pack .ui-widget-content{box-shadow:inset 0 1px 2px rgba(0,0,0,.1);border:1px solid #B2BFCA;background:#F1F2F7;color:#222}.wrap .sb-pack .sbp-progress.queries,.wrap .sb-pack .sbp-progress.time{height:30px;width:77%;display:inline-block;position:relative;background-color:#F1F2F7;overflow:hidden;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.wrap .sbp-progress.queries>span,.wrap .sbp-progress.time>span{background-color:#7EDBA5;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#7EDBA5),color-stop(1,#2DCB73));background-image:-webkit-linear-gradient(top,#7EDBA5,#2DCB73);background-image:-moz-linear-gradient(top,#7EDBA5,#2DCB73);background-image:-ms-linear-gradient(top,#7EDBA5,#2DCB73);background-image:-o-linear-gradient(top,#7EDBA5,#f36d0a);color:#fff;width:0;max-width:98%;float:left;display:block;height:100%;position:relative;overflow:hidden}.wrap .sb-pack .sbp-progress.time>span{-webkit-animation:progress-bar-time 2s 1 forwards;-moz-animation:progress-bar-time 2s 1 forwards;-ms-animation:progress-bar-time 2s 1 forwards;-o-animation:progress-bar-time 2s 1 forwards;animation:progress-bar-time 2s 1 forwards}.wrap .sb-pack .sbp-progress.queries>span{-webkit-animation:progress-bar-queries 2s 1 forwards;-moz-animation:progress-bar-queries 2s 1 forwards;-ms-animation:progress-bar-queries 2s 1 forwards;-o-animation:progress-bar-queries 2s 1 forwards;animation:progress-bar-queries 2s 1 forwards}.wrap .sb-pack .sbp-values{float:right;padding:0 5px;background-color:#1AB4EF;color:#fff;width:18%;height:30px;line-height:30px;text-align:center;text-shadow:0 -2px #1AB4EF}.wrap .sb-pack .sbp-numbers{-webkit-animation:opacity 2s;-moz-animation:opacity 2s;-ms-animation:opacity 2s;-o-animation:opacity 2s;animation:opacity 2s;transition-delay:2s;-moz-transition-delay:2s;-webkit-transition-delay:2s;-o-transition-delay:2s;font-size:16px}@keyframes opacity{from{opacity:0}to{opacity:1}}@-moz-keyframes opacity{from{opacity:0}to{opacity:1}}@-webkit-keyframes opacity{from{opacity:0}to{opacity:1}}@-ms-keyframes opacity{from{opacity:0}to{opacity:1}} @-o-keyframes opacity{from{opacity:0}to{opacity:1}} @media screen and (max-width:783px){.wrap .sb-pack input.regular-text{width:14em}}@media screen and (min-width:784px){.wrap .sb-pack input.regular-text{width:45em}}
|
css/style.dev.css
CHANGED
@@ -53,7 +53,7 @@ p.description-link {
|
|
53 |
}
|
54 |
|
55 |
.wrap .sb-pack #poststuff h2 {
|
56 |
-
font-size:
|
57 |
padding: 9px 15px 20px 0px;
|
58 |
font-weight: 700;
|
59 |
line-height: 1.3;
|
@@ -273,7 +273,7 @@ p.description-link {
|
|
273 |
display: inline-block;
|
274 |
-webkit-font-smoothing: antialiased;
|
275 |
font: normal 36px/0.6 'dashicons';
|
276 |
-
vertical-align:
|
277 |
color: #FA5148;
|
278 |
padding-right: 5px;
|
279 |
}
|
53 |
}
|
54 |
|
55 |
.wrap .sb-pack #poststuff h2 {
|
56 |
+
font-size: 32px;
|
57 |
padding: 9px 15px 20px 0px;
|
58 |
font-weight: 700;
|
59 |
line-height: 1.3;
|
273 |
display: inline-block;
|
274 |
-webkit-font-smoothing: antialiased;
|
275 |
font: normal 36px/0.6 'dashicons';
|
276 |
+
vertical-align: sub;
|
277 |
color: #FA5148;
|
278 |
padding-right: 5px;
|
279 |
}
|
inc/core.php
CHANGED
@@ -38,6 +38,12 @@ if( !class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
38 |
$this->sbp_lazy_load_for_images();
|
39 |
}
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
// Defer parsing of JavaScript
|
42 |
if ( !is_admin() and isset( $sbp_options['defer_parsing'] ) ) {
|
43 |
add_filter( 'clean_url', array( $this, 'sbp_defer_parsing_of_js' ), 11, 1 );
|
@@ -374,6 +380,17 @@ function sbp_lazy_load_for_images() {
|
|
374 |
} // End function sbp_lazy_load_for_images()
|
375 |
|
376 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
/*--------------------------------------------------------------------------------------------------------
|
378 |
CSS Optimizer
|
379 |
---------------------------------------------------------------------------------------------------------*/
|
@@ -487,11 +504,6 @@ public function sbp_junk_header_tags() {
|
|
487 |
|
488 |
global $sbp_options;
|
489 |
|
490 |
-
// Remove RSD Link from header
|
491 |
-
if ( isset( $sbp_options['remove_rsd_link'] ) ) {
|
492 |
-
remove_action( 'wp_head', 'rsd_link' );
|
493 |
-
}
|
494 |
-
|
495 |
// Remove Adjacent Posts links PREV/NEXT
|
496 |
if ( isset( $sbp_options['remove_adjacent'] ) ) {
|
497 |
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
|
38 |
$this->sbp_lazy_load_for_images();
|
39 |
}
|
40 |
|
41 |
+
// Minifier
|
42 |
+
if ( !is_admin() and isset( $sbp_options['minify_html_js'] ) ) {
|
43 |
+
$this->sbp_minifier();
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
// Defer parsing of JavaScript
|
48 |
if ( !is_admin() and isset( $sbp_options['defer_parsing'] ) ) {
|
49 |
add_filter( 'clean_url', array( $this, 'sbp_defer_parsing_of_js' ), 11, 1 );
|
380 |
} // End function sbp_lazy_load_for_images()
|
381 |
|
382 |
|
383 |
+
|
384 |
+
/*--------------------------------------------------------------------------------------------------------
|
385 |
+
Minify HTML and Javascripts
|
386 |
+
---------------------------------------------------------------------------------------------------------*/
|
387 |
+
|
388 |
+
function sbp_minifier() {
|
389 |
+
|
390 |
+
require_once( SPEED_BOOSTER_PACK_PATH . 'inc/sbp-minifier.php' );
|
391 |
+
} // End function sbp_minifier()
|
392 |
+
|
393 |
+
|
394 |
/*--------------------------------------------------------------------------------------------------------
|
395 |
CSS Optimizer
|
396 |
---------------------------------------------------------------------------------------------------------*/
|
504 |
|
505 |
global $sbp_options;
|
506 |
|
|
|
|
|
|
|
|
|
|
|
507 |
// Remove Adjacent Posts links PREV/NEXT
|
508 |
if ( isset( $sbp_options['remove_adjacent'] ) ) {
|
509 |
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
|
inc/sbp-minifier.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*--------------------------------------------------------------------------------------------------------
|
4 |
+
MINIFIER - increase your page load speed by minifying JavaScript and HTML
|
5 |
+
---------------------------------------------------------------------------------------------------------*/
|
6 |
+
|
7 |
+
class SBP_HTML_Minifier {
|
8 |
+
// Minify settings
|
9 |
+
protected $minify_css = true;
|
10 |
+
protected $minify_js = true;
|
11 |
+
protected $info_comment = true;
|
12 |
+
protected $remove_comments = true;
|
13 |
+
|
14 |
+
// Minify variables
|
15 |
+
protected $html;
|
16 |
+
public function __construct($html) {
|
17 |
+
if (!empty($html)) {
|
18 |
+
$this->parseHTML($html);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public function __toString() {
|
23 |
+
return $this->html;
|
24 |
+
}
|
25 |
+
|
26 |
+
protected function bottomComment($raw, $minified) {
|
27 |
+
$raw = strlen($raw);
|
28 |
+
$minified = strlen($minified);
|
29 |
+
$savings = ($raw-$minified) / $raw * 100;
|
30 |
+
$savings = round($savings, 2);
|
31 |
+
return '<!--HTML minified, size saved '.$savings.'%. From '.$raw.' bytes, now '.$minified.' bytes-->';
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function minifyHTML($html) {
|
35 |
+
$pattern = '/<(?<script>script).*?<\/script\s*>|<(?<style>style).*?<\/style\s*>|<!(?<comment>--).*?-->|<(?<tag>[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'">]+)*>|(?<text>((<[^!\/\w.:-])?[^<]*)+)|/si';
|
36 |
+
preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);
|
37 |
+
$overriding = false;
|
38 |
+
$raw_tag = false;
|
39 |
+
// Variable reused for output
|
40 |
+
$html = '';
|
41 |
+
foreach ($matches as $token) {
|
42 |
+
$tag = (isset($token['tag'])) ? strtolower($token['tag']) : null;
|
43 |
+
|
44 |
+
$content = $token[0];
|
45 |
+
|
46 |
+
if (is_null($tag)) {
|
47 |
+
if ( !empty($token['script']) ) {
|
48 |
+
$strip = $this->minify_js;
|
49 |
+
} else if ( !empty($token['style']) ) {
|
50 |
+
$strip = $this->minify_css;
|
51 |
+
} else if ($content == '<!--sbp-html-minifier no minifier-->'){
|
52 |
+
$overriding = !$overriding;
|
53 |
+
|
54 |
+
// Don't print the comments
|
55 |
+
continue;
|
56 |
+
} else if ($this->remove_comments){
|
57 |
+
if (!$overriding && $raw_tag != 'textarea'){
|
58 |
+
// Remove any HTML comments, except MSIE conditional comments
|
59 |
+
$content = preg_replace('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->/s', '', $content);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}else{
|
63 |
+
if ($tag == 'pre' || $tag == 'textarea'){
|
64 |
+
$raw_tag = $tag;
|
65 |
+
}else if ($tag == '/pre' || $tag == '/textarea'){
|
66 |
+
$raw_tag = false;
|
67 |
+
}else{
|
68 |
+
if ($raw_tag || $overriding){
|
69 |
+
$strip = false;
|
70 |
+
}else{
|
71 |
+
$strip = true;
|
72 |
+
// Remove all empty attributes, except action, alt, content, src
|
73 |
+
$content = preg_replace('/(\s+)(\w++(?<!\baction|\balt|\bcontent|\bsrc)="")/', '$1', $content);
|
74 |
+
// Remove all space before the end of self-closing XHTML tags
|
75 |
+
// JavaScript excluded
|
76 |
+
$content = str_replace(' />', '/>', $content);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
if ($strip){
|
82 |
+
$content = $this->removeWhiteSpace($content);
|
83 |
+
}
|
84 |
+
|
85 |
+
$html .= $content;
|
86 |
+
}
|
87 |
+
|
88 |
+
return $html;
|
89 |
+
}
|
90 |
+
|
91 |
+
public function parseHTML($html){
|
92 |
+
$this->html = $this->minifyHTML($html);
|
93 |
+
|
94 |
+
if ($this->info_comment){
|
95 |
+
$this->html .= "\n" . $this->bottomComment($html, $this->html);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
protected function removeWhiteSpace($str){
|
100 |
+
$str = str_replace("\t", ' ', $str);
|
101 |
+
$str = str_replace("\n", '', $str);
|
102 |
+
$str = str_replace("\r", '', $str);
|
103 |
+
|
104 |
+
while (stristr($str, ' ')){
|
105 |
+
$str = str_replace(' ', ' ', $str);
|
106 |
+
}
|
107 |
+
|
108 |
+
return $str;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
function sbp_html_minifier_finish($html){
|
113 |
+
return new SBP_HTML_Minifier($html);
|
114 |
+
}
|
115 |
+
|
116 |
+
function sbp_html_minifier_start(){
|
117 |
+
ob_start('sbp_html_minifier_finish');
|
118 |
+
}
|
119 |
+
|
120 |
+
add_action('get_header', 'sbp_html_minifier_start');
|
inc/template/options.php
CHANGED
@@ -65,11 +65,11 @@
|
|
65 |
|
66 |
|
67 |
<div class="welcome-panel-column">
|
68 |
-
<h4> <?php _e( '
|
69 |
|
70 |
<p>
|
71 |
-
<input id="sbp_settings[
|
72 |
-
<label for="sbp_settings[
|
73 |
</p>
|
74 |
|
75 |
<p>
|
65 |
|
66 |
|
67 |
<div class="welcome-panel-column">
|
68 |
+
<h4> <?php _e( 'Other plugin settings', 'sb-pack' ); ?></h4>
|
69 |
|
70 |
<p>
|
71 |
+
<input id="sbp_settings[minify_html_js]" name="sbp_settings[minify_html_js]" type="checkbox" value="1" <?php checked( 1, isset( $sbp_options['minify_html_js'] ) ); ?> />
|
72 |
+
<label for="sbp_settings[minify_html_js]"><?php _e( 'Minify HTML and JS', 'sb-pack' ); ?></label>
|
73 |
</p>
|
74 |
|
75 |
<p>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: speed, optimization, performance, scripts to the footer, google libraries, font awesome cdn, defer parsing of javascript, remove query strings, lazy load images, gtmetrix, google pageSpeed, yslow, eliminate external render-blocking javascript and css, compression, async, render-blocking css
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -27,6 +27,7 @@ Speed Booster Pack is a plugin that can help you speed up your website by tweaki
|
|
27 |
* **Move scripts to the footer** to improve page loading speed.
|
28 |
* **Load CSS asynchronously** to render your page more quickly and get a higher score on the major speed testing services.
|
29 |
* **Minify and inline all CSS styles and move them to the footer** to eliminate external render-blocking CSS and optimize CSS delivery.
|
|
|
30 |
* **Lazy loads images** to improve page load times and save bandwidth.
|
31 |
* **Change image compression level** to keep file sizes smaller; Change JPG quality.
|
32 |
* **Load javascript files from Google Libraries** rather than serving them from your WordPress install directly, to reduce latency, increase parallelism and improve browser caching.
|
@@ -51,11 +52,10 @@ https://www.youtube.com/watch?v=u0G6pk2mX4M
|
|
51 |
|
52 |
Future Development:
|
53 |
|
54 |
-
* Image optimization options.
|
55 |
* Enable compression option.
|
56 |
* Leverage browser caching.
|
57 |
-
* Option to disable specific plugin actions on specific pages
|
58 |
-
* Option to keep specific scripts in the header, since there are many javascript-based plugins
|
59 |
|
60 |
= Recommended Plugins =
|
61 |
|
@@ -63,9 +63,6 @@ Future Development:
|
|
63 |
* [Simple Author Box](http://wordpress.org/plugins/simple-author-box/) - A simple but cool author box with social icons.
|
64 |
* [Verify Ownership](http://wordpress.org/plugins/verify-ownership/) - Adds meta tag verification codes to your site.
|
65 |
|
66 |
-
**Keywords:** booster, performance, wp optimize, minimify, minify, lazy load, lazy loading, optimize javascript, render blocking, above the fold, Leverage browser caching, gzip compression, html minify,improve page load time, js optimizer, css optimizer, defer parsing of javascript, remove query strings, lazy load images, gtmetrix, google pageSpeed, yslow, eliminate external render-blocking javascript and css, compression, async, pingdom, webpagetest, speed up website, above-the-fold, loading speed, move scritps, autoptimize, asynchronously, change jpeg quality, image compression, change jpg quality, browser caching, query string, remove query strings, junk header, page loading, improve page loading, autooptimize, css minify, js, javascript, minimify
|
67 |
-
|
68 |
-
|
69 |
== Installation ==
|
70 |
|
71 |
1. Download the plugin (.zip file) on your hard drive.
|
@@ -80,6 +77,9 @@ Future Development:
|
|
80 |
|
81 |
== Changelog ==
|
82 |
|
|
|
|
|
|
|
83 |
= 3.3 =
|
84 |
* Fix Lazy Load CSS problem.
|
85 |
|
4 |
Tags: speed, optimization, performance, scripts to the footer, google libraries, font awesome cdn, defer parsing of javascript, remove query strings, lazy load images, gtmetrix, google pageSpeed, yslow, eliminate external render-blocking javascript and css, compression, async, render-blocking css
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 3.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
27 |
* **Move scripts to the footer** to improve page loading speed.
|
28 |
* **Load CSS asynchronously** to render your page more quickly and get a higher score on the major speed testing services.
|
29 |
* **Minify and inline all CSS styles and move them to the footer** to eliminate external render-blocking CSS and optimize CSS delivery.
|
30 |
+
* ** Minify HTML and JavaScript to increase your page load speed.
|
31 |
* **Lazy loads images** to improve page load times and save bandwidth.
|
32 |
* **Change image compression level** to keep file sizes smaller; Change JPG quality.
|
33 |
* **Load javascript files from Google Libraries** rather than serving them from your WordPress install directly, to reduce latency, increase parallelism and improve browser caching.
|
52 |
|
53 |
Future Development:
|
54 |
|
|
|
55 |
* Enable compression option.
|
56 |
* Leverage browser caching.
|
57 |
+
* Option to disable specific plugin actions on specific pages directly via the page edit screen metabox.
|
58 |
+
* Option to keep specific scripts in the header, since there are many javascript-based plugins scripts, that rely on jQuery to be loaded prior to the HTML elements.
|
59 |
|
60 |
= Recommended Plugins =
|
61 |
|
63 |
* [Simple Author Box](http://wordpress.org/plugins/simple-author-box/) - A simple but cool author box with social icons.
|
64 |
* [Verify Ownership](http://wordpress.org/plugins/verify-ownership/) - Adds meta tag verification codes to your site.
|
65 |
|
|
|
|
|
|
|
66 |
== Installation ==
|
67 |
|
68 |
1. Download the plugin (.zip file) on your hard drive.
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 3.4 =
|
81 |
+
* Added an option to increase your page load speed by minifying JavaScript and HTML. Removed option to remove RSD Link, since its impact on improving speed was insignificant.
|
82 |
+
|
83 |
= 3.3 =
|
84 |
* Fix Lazy Load CSS problem.
|
85 |
|
speed-booster-pack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Speed Booster Pack
|
4 |
* Plugin URI: http://wordpress.org/plugins/speed-booster-pack/
|
5 |
* Description: Speed Booster Pack allows you to improve your page loading speed and get a higher score on the major speed testing services such as <a href="http://gtmetrix.com/">GTmetrix</a>, <a href="http://developers.google.com/speed/pagespeed/insights/">Google PageSpeed</a> or other speed testing tools.
|
6 |
-
* Version: 3.
|
7 |
* Author: SpeedWorks
|
8 |
* Author URI: http://tiguandesign.com/docs/speed-booster/
|
9 |
* License: GPLv2
|
@@ -38,7 +38,7 @@ $sbp_options = get_option( 'sbp_settings' ); // retrieve the plugin settings fro
|
|
38 |
|
39 |
define( 'SPEED_BOOSTER_PACK_RELEASE_DATE', date_i18n( 'F j, Y', strtotime('2017-06-17')) ); // Defining plugin release date
|
40 |
define( 'SPEED_BOOSTER_PACK_PATH', plugin_dir_path( __FILE__ ) ); // Defining plugin dir path
|
41 |
-
define( 'SPEED_BOOSTER_PACK_VERSION', 'v3.
|
42 |
define( 'SPEED_BOOSTER_PACK_NAME', 'Speed Booster Pack Plugin'); // Defining plugin name
|
43 |
define( 'SBP_FOOTER', 10 ); // Defining css position
|
44 |
define( 'SBP_FOOTER_LAST', 99999 ); // Defining css last position
|
3 |
* Plugin Name: Speed Booster Pack
|
4 |
* Plugin URI: http://wordpress.org/plugins/speed-booster-pack/
|
5 |
* Description: Speed Booster Pack allows you to improve your page loading speed and get a higher score on the major speed testing services such as <a href="http://gtmetrix.com/">GTmetrix</a>, <a href="http://developers.google.com/speed/pagespeed/insights/">Google PageSpeed</a> or other speed testing tools.
|
6 |
+
* Version: 3.4
|
7 |
* Author: SpeedWorks
|
8 |
* Author URI: http://tiguandesign.com/docs/speed-booster/
|
9 |
* License: GPLv2
|
38 |
|
39 |
define( 'SPEED_BOOSTER_PACK_RELEASE_DATE', date_i18n( 'F j, Y', strtotime('2017-06-17')) ); // Defining plugin release date
|
40 |
define( 'SPEED_BOOSTER_PACK_PATH', plugin_dir_path( __FILE__ ) ); // Defining plugin dir path
|
41 |
+
define( 'SPEED_BOOSTER_PACK_VERSION', 'v3.4'); // Defining plugin version
|
42 |
define( 'SPEED_BOOSTER_PACK_NAME', 'Speed Booster Pack Plugin'); // Defining plugin name
|
43 |
define( 'SBP_FOOTER', 10 ); // Defining css position
|
44 |
define( 'SBP_FOOTER_LAST', 99999 ); // Defining css last position
|