Version Description
Release Date: 18 October 2019
- Updated: Rewrote the readme file from scratch (the description parts).
-
Updated: Updated instant.page to version 2.0.0 and changed its filename to
inspage.js
because ad blocker plugins started blocking instant.page too. - Fixed: Some errors in the CSS optimizer library.
- Removed: A little house cleaning for unused files.
Download this release
Release Info
Developer | optimocha |
Plugin | Speed Booster Pack |
Version | 3.8.4.1 |
Comparing to | |
See all releases |
Code changes from version 3.8.3 to 3.8.4.1
- css/style.css +1 -0
- inc/core.php +41 -9
- inc/css-optimizer.php +3 -4
- inc/images/1x1.trans.gif +0 -0
- inc/images/handshake.png +0 -0
- inc/images/hostinger-official.jpg +0 -0
- inc/images/wpengine.png +0 -0
- inc/js/{instant.page.js → inspage.js} +59 -15
- inc/js/lazyload.js +5 -0
- inc/template/options.php +8 -2
- readme.txt +72 -23
- speed-booster-pack.php +6 -6
css/style.css
CHANGED
@@ -25,6 +25,7 @@ html {
|
|
25 |
float:left;
|
26 |
width:25%;
|
27 |
margin-left:1%;
|
|
|
28 |
}
|
29 |
|
30 |
.wrap .sb-pack input[type=text], .wrap .sb-pack textarea {
|
25 |
float:left;
|
26 |
width:25%;
|
27 |
margin-left:1%;
|
28 |
+
overflow-wrap:break-word;
|
29 |
}
|
30 |
|
31 |
.wrap .sb-pack input[type=text], .wrap .sb-pack textarea {
|
inc/core.php
CHANGED
@@ -36,6 +36,13 @@ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
36 |
add_action( 'template_redirect', array( $this, 'sbp_cdn_rewrite' ) );
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
// WooCommerce optimizing features
|
40 |
if( $this->sbp_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
41 |
/**
|
@@ -746,11 +753,7 @@ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
746 |
---------------------------------------------------------------------------------------------------------*/
|
747 |
|
748 |
function sbp_enable_instant_page() {
|
749 |
-
wp_enqueue_script( 'sbp-
|
750 |
-
false,
|
751 |
-
'1.2.2',
|
752 |
-
true
|
753 |
-
);
|
754 |
}
|
755 |
|
756 |
/*--------------------------------------------------------------------------------------------------------
|
@@ -795,12 +798,41 @@ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
795 |
} // END public function sbp_junk_header_tags
|
796 |
|
797 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
798 |
/*--------------------------------
|
799 |
CDN Rewrite URLs
|
800 |
---------------------------------*/
|
801 |
|
802 |
function sbp_cdn_rewrite() {
|
803 |
-
ob_start(array($this,'sbp_cdn_rewriter'));
|
804 |
}
|
805 |
|
806 |
function sbp_cdn_rewriter($html) {
|
@@ -874,7 +906,7 @@ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
874 |
File processor
|
875 |
--------------------------------------------*/
|
876 |
|
877 |
-
function
|
878 |
global $wp_filesystem;
|
879 |
|
880 |
require_once ( ABSPATH . '/wp-admin/includes/file.php' );
|
@@ -889,7 +921,7 @@ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
889 |
|
890 |
//update analytics.js
|
891 |
function sbp_update_ga() {
|
892 |
-
$wp_filesystem = $this->
|
893 |
|
894 |
if( !$wp_filesystem->exists( WP_CONTENT_DIR . $this->local_cache_dir . 'speed-booster/' ) ) {
|
895 |
$wp_filesystem->mkdir( WP_CONTENT_DIR . $this->local_cache_dir, FS_CHMOD_DIR );
|
@@ -914,7 +946,7 @@ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
|
|
914 |
}
|
915 |
|
916 |
if( isset( $sbp_options[ 'sbp_ga_tracking_id' ] ) && !empty( $sbp_options[ 'sbp_ga_tracking_id' ] ) ) {
|
917 |
-
$wp_filesystem = $this->
|
918 |
$ga_script = WP_CONTENT_URL . $this->local_ga_script;
|
919 |
|
920 |
if( !$wp_filesystem->exists( WP_CONTENT_DIR . $this->local_ga_script ) ) {
|
36 |
add_action( 'template_redirect', array( $this, 'sbp_cdn_rewrite' ) );
|
37 |
}
|
38 |
|
39 |
+
//enable lazy loading
|
40 |
+
if( isset( $sbp_options[ 'sbp_enable_lazy_load' ] ) ) {
|
41 |
+
add_action( 'template_redirect', array( $this, 'sbp_lazy_load' ) );
|
42 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'sbp_lazy_load_script' ) );
|
43 |
+
add_action( 'enqueue_embed_scripts', array( $this, 'sbp_lazy_load_script' ) );
|
44 |
+
}
|
45 |
+
|
46 |
// WooCommerce optimizing features
|
47 |
if( $this->sbp_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
48 |
/**
|
753 |
---------------------------------------------------------------------------------------------------------*/
|
754 |
|
755 |
function sbp_enable_instant_page() {
|
756 |
+
wp_enqueue_script( 'sbp-ins-page', plugins_url( 'js/inspage.js', __FILE__ ), false, '2.0.0', true );
|
|
|
|
|
|
|
|
|
757 |
}
|
758 |
|
759 |
/*--------------------------------------------------------------------------------------------------------
|
798 |
} // END public function sbp_junk_header_tags
|
799 |
|
800 |
|
801 |
+
/*--------------------------------
|
802 |
+
Lazy Loader (native with polyfill)
|
803 |
+
---------------------------------*/
|
804 |
+
|
805 |
+
function sbp_lazy_load_script() {
|
806 |
+
wp_enqueue_script( 'sbp-lazy-load', plugins_url( 'js/lazyload.js', __FILE__ ), false, '12.1', true );
|
807 |
+
wp_add_inline_script( 'sbp-lazy-load', '
|
808 |
+
(function() {
|
809 |
+
var ll = new LazyLoad({
|
810 |
+
elements_selector: "[loading=lazy]",
|
811 |
+
use_native: true
|
812 |
+
});
|
813 |
+
})();
|
814 |
+
' );
|
815 |
+
}
|
816 |
+
|
817 |
+
function sbp_lazy_load() {
|
818 |
+
ob_start( array( $this, 'sbp_lazy_loader') );
|
819 |
+
}
|
820 |
+
|
821 |
+
function sbp_lazy_loader( $html ) {
|
822 |
+
$placeholder = 'data:image/svg+xml,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20viewBox%3D%270%200%203%202%27%3E%3C/svg%3E';
|
823 |
+
$html = preg_replace( "/<(img|source|iframe)(.*?) (src=)(.*?)>/i", '<$1$2 $3"' . $placeholder . '" data-$3$4>', $html );
|
824 |
+
$html = preg_replace( "/<(img|source|iframe)(.*?) (srcset=)(.*?)>/i", '<$1$2 $3"' . $placeholder . '" data-$3$4>', $html );
|
825 |
+
$html = preg_replace( "/<(img|source|iframe)(.*?) (\/?)>/i", '<$1$2 loading="lazy" $3>', $html );
|
826 |
+
return $html;
|
827 |
+
}
|
828 |
+
|
829 |
+
|
830 |
/*--------------------------------
|
831 |
CDN Rewrite URLs
|
832 |
---------------------------------*/
|
833 |
|
834 |
function sbp_cdn_rewrite() {
|
835 |
+
ob_start( array( $this, 'sbp_cdn_rewriter' ) );
|
836 |
}
|
837 |
|
838 |
function sbp_cdn_rewriter($html) {
|
906 |
File processor
|
907 |
--------------------------------------------*/
|
908 |
|
909 |
+
function sbp_file_process() {
|
910 |
global $wp_filesystem;
|
911 |
|
912 |
require_once ( ABSPATH . '/wp-admin/includes/file.php' );
|
921 |
|
922 |
//update analytics.js
|
923 |
function sbp_update_ga() {
|
924 |
+
$wp_filesystem = $this->sbp_file_process();
|
925 |
|
926 |
if( !$wp_filesystem->exists( WP_CONTENT_DIR . $this->local_cache_dir . 'speed-booster/' ) ) {
|
927 |
$wp_filesystem->mkdir( WP_CONTENT_DIR . $this->local_cache_dir, FS_CHMOD_DIR );
|
946 |
}
|
947 |
|
948 |
if( isset( $sbp_options[ 'sbp_ga_tracking_id' ] ) && !empty( $sbp_options[ 'sbp_ga_tracking_id' ] ) ) {
|
949 |
+
$wp_filesystem = $this->sbp_file_process();
|
950 |
$ga_script = WP_CONTENT_URL . $this->local_ga_script;
|
951 |
|
952 |
if( !$wp_filesystem->exists( WP_CONTENT_DIR . $this->local_ga_script ) ) {
|
inc/css-optimizer.php
CHANGED
@@ -103,11 +103,10 @@ function sbp_inline_css( $url, $minify = true ) {
|
|
103 |
function sbp_rebuilding_css_urls( $css, $url ) {
|
104 |
$css_dir = substr( $url, 0, strrpos( $url, '/' ) );
|
105 |
|
106 |
-
//
|
107 |
-
|
108 |
-
|
109 |
// new regex expression
|
110 |
-
$css = preg_replace( "/url(?!\(['\"]?(data:|http:))\(['\"]?([^\/][^'\"\)]*)['\"]?\)/i", "url({$css_dir}/$2)", $css );
|
111 |
|
112 |
|
113 |
return $css;
|
103 |
function sbp_rebuilding_css_urls( $css, $url ) {
|
104 |
$css_dir = substr( $url, 0, strrpos( $url, '/' ) );
|
105 |
|
106 |
+
// remove empty url() declarations
|
107 |
+
$css = preg_replace( "/url\(\s?\)/", "", $css );
|
|
|
108 |
// new regex expression
|
109 |
+
$css = preg_replace( "/url(?!\(['\"]?(data:|http:|https:))\(['\"]?([^\/][^'\"\)]*)['\"]?\)/i", "url({$css_dir}/$2)", $css );
|
110 |
|
111 |
|
112 |
return $css;
|
inc/images/1x1.trans.gif
DELETED
Binary file
|
inc/images/handshake.png
DELETED
Binary file
|
inc/images/hostinger-official.jpg
DELETED
Binary file
|
inc/images/wpengine.png
DELETED
Binary file
|
inc/js/{instant.page.js → inspage.js}
RENAMED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! instant.page
|
2 |
|
3 |
let urlToPreload
|
4 |
let mouseoverTimer
|
@@ -9,6 +9,25 @@ const isSupported = prefetcher.relList && prefetcher.relList.supports && prefetc
|
|
9 |
const isDataSaverEnabled = navigator.connection && navigator.connection.saveData
|
10 |
const allowQueryString = 'instantAllowQueryString' in document.body.dataset
|
11 |
const allowExternalLinks = 'instantAllowExternalLinks' in document.body.dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
if (isSupported && !isDataSaverEnabled) {
|
14 |
prefetcher.rel = 'prefetch'
|
@@ -18,8 +37,17 @@ if (isSupported && !isDataSaverEnabled) {
|
|
18 |
capture: true,
|
19 |
passive: true,
|
20 |
}
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
function touchstartListener(event) {
|
@@ -63,7 +91,21 @@ function mouseoverListener(event) {
|
|
63 |
mouseoverTimer = setTimeout(() => {
|
64 |
preload(linkElement.href)
|
65 |
mouseoverTimer = undefined
|
66 |
-
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
function mouseoutListener(event) {
|
@@ -75,10 +117,10 @@ function mouseoutListener(event) {
|
|
75 |
clearTimeout(mouseoverTimer)
|
76 |
mouseoverTimer = undefined
|
77 |
}
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
}
|
83 |
|
84 |
function isPreloadable(linkElement) {
|
@@ -90,25 +132,27 @@ function isPreloadable(linkElement) {
|
|
90 |
return
|
91 |
}
|
92 |
|
93 |
-
|
|
|
|
|
94 |
|
95 |
-
if (!allowExternalLinks &&
|
96 |
return
|
97 |
}
|
98 |
|
99 |
-
if (!['http:', 'https:'].includes(
|
100 |
return
|
101 |
}
|
102 |
|
103 |
-
if (
|
104 |
return
|
105 |
}
|
106 |
|
107 |
-
if (!allowQueryString &&
|
108 |
return
|
109 |
}
|
110 |
|
111 |
-
if (
|
112 |
return
|
113 |
}
|
114 |
|
@@ -125,4 +169,4 @@ function preload(url) {
|
|
125 |
|
126 |
function stopPreloading() {
|
127 |
prefetcher.removeAttribute('href')
|
128 |
-
}
|
1 |
+
/*! instant.page v2.0.0 - (C) 2019 Alexandre Dieulot - https://instant.page/license */
|
2 |
|
3 |
let urlToPreload
|
4 |
let mouseoverTimer
|
9 |
const isDataSaverEnabled = navigator.connection && navigator.connection.saveData
|
10 |
const allowQueryString = 'instantAllowQueryString' in document.body.dataset
|
11 |
const allowExternalLinks = 'instantAllowExternalLinks' in document.body.dataset
|
12 |
+
const useWhitelist = 'instantWhitelist' in document.body.dataset
|
13 |
+
|
14 |
+
let delayOnHover = 65
|
15 |
+
let useMousedown = false
|
16 |
+
let useMousedownOnly = false
|
17 |
+
if ('instantIntensity' in document.body.dataset) {
|
18 |
+
if (document.body.dataset.instantIntensity.substr(0, 'mousedown'.length) == 'mousedown') {
|
19 |
+
useMousedown = true
|
20 |
+
if (document.body.dataset.instantIntensity == 'mousedown-only') {
|
21 |
+
useMousedownOnly = true
|
22 |
+
}
|
23 |
+
}
|
24 |
+
else {
|
25 |
+
const milliseconds = parseInt(document.body.dataset.instantIntensity)
|
26 |
+
if (milliseconds != NaN) {
|
27 |
+
delayOnHover = milliseconds
|
28 |
+
}
|
29 |
+
}
|
30 |
+
}
|
31 |
|
32 |
if (isSupported && !isDataSaverEnabled) {
|
33 |
prefetcher.rel = 'prefetch'
|
37 |
capture: true,
|
38 |
passive: true,
|
39 |
}
|
40 |
+
|
41 |
+
if (!useMousedownOnly) {
|
42 |
+
document.addEventListener('touchstart', touchstartListener, eventListenersOptions)
|
43 |
+
}
|
44 |
+
|
45 |
+
if (!useMousedown) {
|
46 |
+
document.addEventListener('mouseover', mouseoverListener, eventListenersOptions)
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
document.addEventListener('mousedown', mousedownListener, eventListenersOptions)
|
50 |
+
}
|
51 |
}
|
52 |
|
53 |
function touchstartListener(event) {
|
91 |
mouseoverTimer = setTimeout(() => {
|
92 |
preload(linkElement.href)
|
93 |
mouseoverTimer = undefined
|
94 |
+
}, delayOnHover)
|
95 |
+
}
|
96 |
+
|
97 |
+
function mousedownListener(event) {
|
98 |
+
const linkElement = event.target.closest('a')
|
99 |
+
|
100 |
+
if (!isPreloadable(linkElement)) {
|
101 |
+
return
|
102 |
+
}
|
103 |
+
|
104 |
+
linkElement.addEventListener('mouseout', mouseoutListener, {passive: true})
|
105 |
+
|
106 |
+
urlToPreload = linkElement.href
|
107 |
+
|
108 |
+
preload(linkElement.href)
|
109 |
}
|
110 |
|
111 |
function mouseoutListener(event) {
|
117 |
clearTimeout(mouseoverTimer)
|
118 |
mouseoverTimer = undefined
|
119 |
}
|
120 |
+
|
121 |
+
urlToPreload = undefined
|
122 |
+
|
123 |
+
stopPreloading()
|
124 |
}
|
125 |
|
126 |
function isPreloadable(linkElement) {
|
132 |
return
|
133 |
}
|
134 |
|
135 |
+
if (useWhitelist && !('instant' in linkElement.dataset)) {
|
136 |
+
return
|
137 |
+
}
|
138 |
|
139 |
+
if (!allowExternalLinks && linkElement.origin != location.origin && !('instant' in linkElement.dataset)) {
|
140 |
return
|
141 |
}
|
142 |
|
143 |
+
if (!['http:', 'https:'].includes(linkElement.protocol)) {
|
144 |
return
|
145 |
}
|
146 |
|
147 |
+
if (linkElement.protocol == 'http:' && location.protocol == 'https:') {
|
148 |
return
|
149 |
}
|
150 |
|
151 |
+
if (!allowQueryString && linkElement.search && !('instant' in linkElement.dataset)) {
|
152 |
return
|
153 |
}
|
154 |
|
155 |
+
if (linkElement.hash && linkElement.pathname + linkElement.search == location.pathname + location.search) {
|
156 |
return
|
157 |
}
|
158 |
|
169 |
|
170 |
function stopPreloading() {
|
171 |
prefetcher.removeAttribute('href')
|
172 |
+
}
|
inc/js/lazyload.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* lazyload.js - v12.1
|
2 |
+
* https://github.com/verlok/lazyload
|
3 |
+
* Copyright (c) 2019 Andrea Verlicchi; Licensed MIT */
|
4 |
+
function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=t&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&"isIntersecting"in window.IntersectionObserverEntry.prototype,o=t&&"classList"in document.createElement("p"),r={elements_selector:"img",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null,use_native:!1},i=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)};var a=function(t,e){return t.getAttribute("data-"+e)},s=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},c=function(t){return"true"===a(t,"was-processed")},l=function(t,e){return s(t,"ll-timeout",e)},u=function(t){return a(t,"ll-timeout")},d=function(t,e){t&&t(e)},f=function(t,e){t._loadingCount+=e,0===t._elements.length&&0===t._loadingCount&&d(t._settings.callback_finish)},_=function(t){for(var e,n=[],o=0;e=t.children[o];o+=1)"SOURCE"===e.tagName&&n.push(e);return n},v=function(t,e,n){n&&t.setAttribute(e,n)},g=function(t,e){v(t,"sizes",a(t,e.data_sizes)),v(t,"srcset",a(t,e.data_srcset)),v(t,"src",a(t,e.data_src))},b={IMG:function(t,e){var n=t.parentNode;n&&"PICTURE"===n.tagName&&_(n).forEach(function(t){g(t,e)});g(t,e)},IFRAME:function(t,e){v(t,"src",a(t,e.data_src))},VIDEO:function(t,e){_(t).forEach(function(t){v(t,"src",a(t,e.data_src))}),v(t,"src",a(t,e.data_src)),t.load()}},m=function(t,e){var n,o,r=e._settings,i=t.tagName,s=b[i];if(s)return s(t,r),f(e,1),void(e._elements=(n=e._elements,o=t,n.filter(function(t){return t!==o})));!function(t,e){var n=a(t,e.data_src),o=a(t,e.data_bg);n&&(t.style.backgroundImage='url("'.concat(n,'")')),o&&(t.style.backgroundImage=o)}(t,r)},h=function(t,e){o?t.classList.add(e):t.className+=(t.className?" ":"")+e},p=function(t,e,n){t.addEventListener(e,n)},y=function(t,e,n){t.removeEventListener(e,n)},E=function(t,e,n){y(t,"load",e),y(t,"loadeddata",e),y(t,"error",n)},w=function(t,e,n){var r=n._settings,i=e?r.class_loaded:r.class_error,a=e?r.callback_loaded:r.callback_error,s=t.target;!function(t,e){o?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")}(s,r.class_loading),h(s,i),d(a,s),f(n,-1)},I=function(t,e){var n=function n(r){w(r,!0,e),E(t,n,o)},o=function o(r){w(r,!1,e),E(t,n,o)};!function(t,e,n){p(t,"load",e),p(t,"loadeddata",e),p(t,"error",n)}(t,n,o)},k=["IMG","IFRAME","VIDEO"],O=function(t,e){var n=e._observer;x(t,e),n&&e._settings.auto_unobserve&&n.unobserve(t)},A=function(t){var e=u(t);e&&(clearTimeout(e),l(t,null))},L=function(t,e){var n=e._settings.load_delay,o=u(t);o||(o=setTimeout(function(){O(t,e),A(t)},n),l(t,o))},x=function(t,e,n){var o=e._settings;!n&&c(t)||(k.indexOf(t.tagName)>-1&&(I(t,e),h(t,o.class_loading)),m(t,e),function(t){s(t,"was-processed","true")}(t),d(o.callback_reveal,t),d(o.callback_set,t))},z=function(t){return!!n&&(t._observer=new IntersectionObserver(function(e){e.forEach(function(e){return function(t){return t.isIntersecting||t.intersectionRatio>0}(e)?function(t,e){var n=e._settings;d(n.callback_enter,t),n.load_delay?L(t,e):O(t,e)}(e.target,t):function(t,e){var n=e._settings;d(n.callback_exit,t),n.load_delay&&A(t)}(e.target,t)})},{root:(e=t._settings).container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}),!0);var e},N=["IMG","IFRAME"],C=function(t,e){return function(t){return t.filter(function(t){return!c(t)})}((n=t||function(t){return t.container.querySelectorAll(t.elements_selector)}(e),Array.prototype.slice.call(n)));var n},M=function(t,e){this._settings=function(t){return _extends({},r,t)}(t),this._loadingCount=0,z(this),this.update(e)};return M.prototype={update:function(t){var n,o=this,r=this._settings;(this._elements=C(t,r),!e&&this._observer)?(function(t){return t.use_native&&"loading"in HTMLImageElement.prototype}(r)&&((n=this)._elements.forEach(function(t){-1!==N.indexOf(t.tagName)&&(t.setAttribute("loading","lazy"),x(t,n))}),this._elements=C(t,r)),this._elements.forEach(function(t){o._observer.observe(t)})):this.loadAll()},destroy:function(){var t=this;this._observer&&(this._elements.forEach(function(e){t._observer.unobserve(e)}),this._observer=null),this._elements=null,this._settings=null},load:function(t,e){x(t,this,e)},loadAll:function(){var t=this;this._elements.forEach(function(e){O(e,t)})}},t&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)i(t,n);else i(t,e)}(M,window.lazyLoadOptions),M});
|
5 |
+
//# sourceMappingURL=lazyload.min.js.map
|
inc/template/options.php
CHANGED
@@ -171,6 +171,12 @@ if ( is_array( $option_arr ) && in_array( 'defer-from-footer', $option_arr ) ) {
|
|
171 |
'type' => 'section',
|
172 |
'label' => __( 'Advanced Optimizations', 'speed-booster-pack' ),
|
173 |
'items' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
'enable_instant_page' => array(
|
175 |
'type' => 'checkbox',
|
176 |
'label' => __( 'Enable instant.page', 'speed-booster-pack' ),
|
@@ -686,7 +692,7 @@ if ( is_array( $option_arr ) && in_array( 'defer-from-footer', $option_arr ) ) {
|
|
686 |
<div class="inside">
|
687 |
<p><?php _e( 'People abandon pages that take more than a few seconds to load, which means slow pages lose you visitors (and money). You don’t want that to happen, do you?', 'speed-booster-pack' )?></p>
|
688 |
<p><?php _e( 'If you’re ready to <em>invest</em> in speeding up your website, click below for our professional, tailored speed optimization services!', 'speed-booster-pack' ); ?></a></p>
|
689 |
-
<p><a href="https://optimocha.com/?ref=sbp" target="_blank" class="button button-primary button-large"><?php _e( "Speed Up Your Website!", 'speed-booster-pack' ); ?></a></p>
|
690 |
</div>
|
691 |
</div>
|
692 |
|
@@ -694,7 +700,7 @@ if ( is_array( $option_arr ) && in_array( 'defer-from-footer', $option_arr ) ) {
|
|
694 |
<h3 class="hndle">Test Your Website</h3>
|
695 |
<div class="inside">
|
696 |
<p><?php _e( 'It\'s always a good idea to keep testing your website so you can track your website\'s speed. Click the buttons below to see how well your website performs in various speed test tools!', 'speed-booster-pack' )?></p>
|
697 |
-
<p><a href="https://gtmetrix.com/?url=<?php echo home_url('/'); ?>" target="_blank" class="button button-secondary"><?php _e( "Test on GTmetrix", 'speed-booster-pack' ); ?></a> <a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo home_url('/'); ?>" target="_blank" class="button button-secondary"><?php _e( "Test on Google PageSpeed", 'speed-booster-pack' ); ?></a></p>
|
698 |
</div>
|
699 |
</div>
|
700 |
|
171 |
'type' => 'section',
|
172 |
'label' => __( 'Advanced Optimizations', 'speed-booster-pack' ),
|
173 |
'items' => array(
|
174 |
+
'sbp_enable_lazy_load' => array(
|
175 |
+
'type' => 'checkbox',
|
176 |
+
'label' => __( 'Enable lazy loader (BETA)', 'speed-booster-pack' ),
|
177 |
+
'tooltip' => __( 'Check this option if you want to enable native lazy loading with fallback.', 'speed-booster-pack' ),
|
178 |
+
'options_group' => 'sbp_settings',
|
179 |
+
),
|
180 |
'enable_instant_page' => array(
|
181 |
'type' => 'checkbox',
|
182 |
'label' => __( 'Enable instant.page', 'speed-booster-pack' ),
|
692 |
<div class="inside">
|
693 |
<p><?php _e( 'People abandon pages that take more than a few seconds to load, which means slow pages lose you visitors (and money). You don’t want that to happen, do you?', 'speed-booster-pack' )?></p>
|
694 |
<p><?php _e( 'If you’re ready to <em>invest</em> in speeding up your website, click below for our professional, tailored speed optimization services!', 'speed-booster-pack' ); ?></a></p>
|
695 |
+
<p style="text-align:center"><a href="https://optimocha.com/?ref=sbp" target="_blank" class="button button-primary button-large"><?php _e( "Speed Up Your Website!", 'speed-booster-pack' ); ?></a></p>
|
696 |
</div>
|
697 |
</div>
|
698 |
|
700 |
<h3 class="hndle">Test Your Website</h3>
|
701 |
<div class="inside">
|
702 |
<p><?php _e( 'It\'s always a good idea to keep testing your website so you can track your website\'s speed. Click the buttons below to see how well your website performs in various speed test tools!', 'speed-booster-pack' )?></p>
|
703 |
+
<p style="text-align:center"><a href="https://gtmetrix.com/?url=<?php echo home_url('/'); ?>" target="_blank" class="button button-secondary"><?php _e( "Test on GTmetrix", 'speed-booster-pack' ); ?></a> <a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo home_url('/'); ?>" target="_blank" class="button button-secondary"><?php _e( "Test on Google PageSpeed", 'speed-booster-pack' ); ?></a></p>
|
704 |
</div>
|
705 |
</div>
|
706 |
|
readme.txt
CHANGED
@@ -1,44 +1,62 @@
|
|
1 |
-
=== Speed Booster Pack ===
|
|
|
2 |
Contributors: optimocha
|
3 |
Tags: speed, performance, javascript optimization, css optimization, google pagespeed
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.2.1
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 3.8.
|
8 |
License: GPLv3 or later
|
9 |
-
License URI:
|
10 |
|
11 |
-
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
**Speed Booster Pack** is
|
16 |
|
17 |
-
|
18 |
|
19 |
Improving your site's speed will get you a better score on major speed testing services such as [Google PageSpeed](https://developers.google.com/speed/pagespeed/insights/), [GTmetrix](https://gtmetrix.com/), [Pingdom](https://tools.pingdom.com/), [WebPageTest](https://www.webpagetest.org/) and will also improve your overall site's usability. This will help Google and other search engines to rank your site higher in search results thus sending more traffic.
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
* **Move scripts to the footer** to improve page loading speed.
|
31 |
-
* **Minify and inline all CSS and move them to footer** to optimize CSS delivery.
|
32 |
-
* **Minify HTML and JavaScript** to increase your page speed.
|
33 |
-
* **Defer parsing of JavaScript files** to reduce the initial load time of your page.
|
34 |
-
* **Remove query strings from static resources** to improve your speed scores.
|
35 |
-
* **Remove junk header tags** to clean up your WordPress head code.
|
36 |
-
* **Exclude scripts** from being moved to the footer or defered.
|
37 |
-
* **Remove RSD Link** if you are not using a Weblog Client or some 3rd party sites/programs that use the XML-RPC request formats.
|
38 |
-
* **Remove WordPress Version** this option is added for security reasons and cleaning the header.
|
39 |
-
* **Remove all RSS feed links** to cleanup your WordPress header.
|
40 |
|
41 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
== Installation ==
|
44 |
|
@@ -46,13 +64,44 @@ Speed Booster Pack is a plugin that can help you speed up your website by tweaki
|
|
46 |
2. Unzip the zip file contents.
|
47 |
3. Upload the `speed-booster-pack` folder to the `/wp-content/plugins/` directory.
|
48 |
4. Activate the plugin through the 'Plugins' menu in WordPress.
|
49 |
-
5. A new sub menu item `Speed Booster
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
== Screenshots ==
|
52 |
1. Plugin options page
|
53 |
|
54 |
== Changelog ==
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
= 3.8.3 =
|
57 |
|
58 |
*Release Date: 10 July 2019*
|
1 |
+
=== Speed Booster Pack: Easy Performance & PageSpeed Optimization ===
|
2 |
+
Plugin Name: Speed Booster Pack: Easy Performance & PageSpeed Optimization
|
3 |
Contributors: optimocha
|
4 |
Tags: speed, performance, javascript optimization, css optimization, google pagespeed
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.2.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 3.8.4.1
|
9 |
License: GPLv3 or later
|
10 |
+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
+
Speed optimization is crucial for SEO. And Speed Booster Pack is the easiest way to improve website performance. Get better PageSpeed scores today!
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
**Speed Booster Pack** is maintained & operated by **[Optimocha](https://optimocha.com/)**, a company that offers special speed optimization services filled with people who *obsess* about speed!
|
17 |
|
18 |
+
WordPress is, hands down, the most popular content management system in the world. But like all giants, WordPress gets bigger and bigger every release; and it needs you to stay healthy and fast. Otherwise, your website can get slower and nobody likes slow websites. *NOBODY*. Not only your visitors hate your website, but also search engines (especially Google) penalizes you and drop your search engine rankings.
|
19 |
|
20 |
Improving your site's speed will get you a better score on major speed testing services such as [Google PageSpeed](https://developers.google.com/speed/pagespeed/insights/), [GTmetrix](https://gtmetrix.com/), [Pingdom](https://tools.pingdom.com/), [WebPageTest](https://www.webpagetest.org/) and will also improve your overall site's usability. This will help Google and other search engines to rank your site higher in search results thus sending more traffic.
|
21 |
|
22 |
+
### Benefits of Speed Booster Pack
|
23 |
|
24 |
+
Each second of delay can cause up to 20% loss in conversion rates ([source: Google](https://web.dev/why-speed-matters/)). "Conversion" means *converting* visitors to something more than a "visitor": leads, customers, subscribers, followers... you name it.
|
25 |
|
26 |
+
You might lose more than half of your visitors if your website loads **slower than three seconds**! ([source: Google again](https://www.blog.google/products/admanager/the-need-for-mobile-speed/)) This is a huge problem, and it's hugely overlooked among other SEO-related concerns. People don't realize how important speed is, in the eyes of search engines.
|
27 |
|
28 |
+
That's where Speed Booster Pack comes in: With its ever-evolving codebase, Speed Booster Pack aims to increase your site performance, page load times and PageSpeed (Lighthouse) scores! Optimocha, the company behind Speed Booster Pack, has a team with a mutual obsession for speed; so you can be sure that your site will be in good hands.
|
29 |
|
30 |
+
### How Speed Booster Pack helps you get better PageSpeed scores:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
* **CSS optimization**: You can inline and minify all CSS in your pages, and save on HTTP requests.
|
33 |
+
* **JavaScript optimization**: Deferring JS and moving them into the footer makes them non-render-blocking, which Google PageSpeed likes *so much*.
|
34 |
+
* **(NEW!) Lazy loading**: With the latest native browser feature for lazy loading *and* a state-of-the-art lazy loader script, your images will load as soon as they're in the viewport (instead of all at once). This alone can make your site faster than ever!
|
35 |
+
* **Remove clutter**: Clutter is always bad, especially for page sources; and faster websites have less clutter inside their pages. Removing unnecessary junk is key to solid speed optimization work.
|
36 |
+
* **(NEW!) Instant Page**: This brand new tool helps your visitors get to the *next* page in your website by prefetching any internal link the visitor's about to click. It's not AI or anything but it's a pretty smart way to optimize your site!
|
37 |
+
* **Disable unnecessary stuff**: This one's a no-brainer - if there's less work for WordPress, it works faster.
|
38 |
+
* **(NEW!) WooCommerce optimization**: WooCommerce is awesome and all, but it could use some help to speed up. And Speed Booster Pack does exactly that: With a few tweaks, it resolves some WooCommerce speed bottlenecks.
|
39 |
+
* **CDN integration**: Content delivery networks are essential for every website, especially if its visitors come from all around the world. With Speed Booster Pack's CDN integration feature, you can easily start using the CDN of your choice in WordPress.
|
40 |
+
* **Google Analytics localization**: Google itself can surely benefit from a speed optimization job, but they're not picking up our calls. Oh well, the least we can do is to help you load Google Analytics from your own server.
|
41 |
+
* **...and much more**: We're constantly working on building a better performance optimization plugin for tens of thousands of people, and hundreds more downloading Speed Booster Pack every day. Rest assured, our roadmap is always full of new ideas!
|
42 |
+
|
43 |
+
For complete usage instructions, you can visit the [Plugin Documentation](https://optimocha.com/speed-booster-pack-documentation/) page.
|
44 |
+
|
45 |
+
### Translators are always welcome & always rewarded!
|
46 |
+
|
47 |
+
More than half of WordPress users don't speak English, and missing out so much! That's why Optimocha is always looking for volunteers to [translate Speed Booster Pack](https://translate.wordpress.org/projects/wp-plugins/speed-booster-pack/) so more and more people can benefit from its goodness. Oh, and we reward the people who help us! Reach out to us to become a translation editor in your language, and get rewarded with special discount codes of our services!
|
48 |
+
|
49 |
+
### About [Optimocha](https://optimocha.com/) Speed Optimization Services
|
50 |
+
|
51 |
+
Speed optimization plugins might do a great job at optimizing your website and increasing your PageSpeed scores, but even they can't perform well on websites with poor setups. There are lots of factors to think about when it comes to web performance optimization. That's where we, as Optimocha, come in: We log in to your website; create a specialized optimization report considering all your plugins, your theme settings, your hosting environment and your whole content; then we get our hands dirty to get your website as fast as possible. To learn more about our services and get in touch with us, here are some links:
|
52 |
+
|
53 |
+
* [One-time speed optimization services](https://optimocha.com/speed-optimization-for-wordpress/)
|
54 |
+
* [Monthly speed optimization & maintenance services](https://optimocha.com/monthly-wordpress-optimization-maintenance/)
|
55 |
+
* [Contact Optimocha](https://optimocha.com/contact/)
|
56 |
+
|
57 |
+
### Disclaimer
|
58 |
+
|
59 |
+
Even though the plugin works perfectly well on most WordPress websites, it's not perfect. We just need to make sure that we're on the same page: This plugin, no matter how hard we work on it, might have bugs in it and your site has an off chance to have issues with the plugin. It doesn't do anything permanent to your pages' source codes, so deactivating the plugin and clearing your browser & server caches will solve any kind of issue it might cause. Other than that, we won't be able to take responsibility if something else clashes with Speed Booster Pack.
|
60 |
|
61 |
== Installation ==
|
62 |
|
64 |
2. Unzip the zip file contents.
|
65 |
3. Upload the `speed-booster-pack` folder to the `/wp-content/plugins/` directory.
|
66 |
4. Activate the plugin through the 'Plugins' menu in WordPress.
|
67 |
+
5. A new sub menu item `Speed Booster` will appear in your main Settings menu.
|
68 |
+
|
69 |
+
== Frequently Asked Questions ==
|
70 |
+
|
71 |
+
= This plugin broke my site! =
|
72 |
+
|
73 |
+
It's possible that the theme or your plugins might be using some old code that isn't compatible with Speed Booster Pack's code. If that's the case, try disabling some features in the Advanced tab. If that doesn't work, try deactivating the plugin and clear your browser & server caches. If that does the trick, reach out to us so we can help you. If the site is *still* broken, though, there's obviously another reason for your site breaking because everything Speed Booster Pack does, it does it on-the-fly. Deactivating the plugin (and clearing your caches) will make everything go away.
|
74 |
+
|
75 |
+
= I have a bug report! =
|
76 |
+
|
77 |
+
We love you already! Please contact us (link above in the About section) so we can get to the bottom of the bug you found. **If it's a legitimate bug, you'll be awarded with discount coupons to our services!**
|
78 |
+
|
79 |
+
= I like your plugin, how do I thank you? =
|
80 |
+
|
81 |
+
We don't accept any donations, if that's what you're asking! :) But we do like to have our users [review the plugin](https://wordpress.org/support/plugin/speed-booster-pack/reviews/#new-post) with a fair star rating. And we always appreciate you recommending our plugin to other people!
|
82 |
+
|
83 |
+
= I need more than Speed Booster Pack! =
|
84 |
+
|
85 |
+
Our main business is special speed optimization services, tailored for every website we work on. [On our website](https://optimocha.com/), you can review our speed optimization packages and contact us.
|
86 |
+
|
87 |
+
= How often do you update the plugin? =
|
88 |
+
|
89 |
+
All the time! We're always looking for new ways to get this plugin to a better state: We code new features, we fix existing bugs, and we try our best to make Speed Booster Pack more and more popular. And we always appreciate a helping hand: If you've got a new feature to offer, [you can suggest it over here](https://optimocha.com/contact/). If we eventually make it happen and/or you help us make it happen, you'll be rewarded with handsome discount coupons or even free speed optimization services!
|
90 |
|
91 |
== Screenshots ==
|
92 |
1. Plugin options page
|
93 |
|
94 |
== Changelog ==
|
95 |
|
96 |
+
= 3.8.4.1 =
|
97 |
+
|
98 |
+
*Release Date: 18 October 2019*
|
99 |
+
|
100 |
+
* **Updated**: Rewrote the readme file from scratch (the description parts).
|
101 |
+
* **Updated**: Updated instant.page to version 2.0.0 and changed its filename to `inspage.js` because ad blocker plugins started blocking instant.page too.
|
102 |
+
* **Fixed**: Some errors in the CSS optimizer library.
|
103 |
+
* **Removed**: A little house cleaning for unused files.
|
104 |
+
|
105 |
= 3.8.3 =
|
106 |
|
107 |
*Release Date: 10 July 2019*
|
speed-booster-pack.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Speed Booster Pack
|
4 |
-
* Plugin URI:
|
5 |
-
* Description: Speed
|
6 |
* Author: Optimocha
|
7 |
-
* Version: 3.8.
|
8 |
-
* Author URI: https://optimocha.com
|
9 |
* License: GPLv3 or later
|
10 |
-
* License URI:
|
11 |
* Requires PHP: 5.6
|
12 |
* Text Domain : speed-booster-pack
|
13 |
* Domain Path: /lang
|
@@ -47,7 +47,7 @@ if( !defined( 'ABSPATH' ) ) {
|
|
47 |
|
48 |
define( 'SPEED_BOOSTER_PACK_PATH', plugin_dir_path( __FILE__ ) );
|
49 |
define( 'SPEED_BOOSTER_PACK_URL', preg_replace('#^https?:#', '', plugin_dir_url( __FILE__ ) ) );
|
50 |
-
define( 'SPEED_BOOSTER_PACK_VERSION', '3.8.
|
51 |
// Defining css position
|
52 |
define( 'SBP_FOOTER', 10 );
|
53 |
// Defining css last position
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Speed Booster Pack
|
4 |
+
* Plugin URI: https://wordpress.org/plugins/speed-booster-pack/
|
5 |
+
* Description: Speed optimization is crucial for SEO. And Speed Booster Pack is the easiest way to improve website performance. Get better PageSpeed scores today!
|
6 |
* Author: Optimocha
|
7 |
+
* Version: 3.8.4.1
|
8 |
+
* Author URI: https://optimocha.com/
|
9 |
* License: GPLv3 or later
|
10 |
+
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
* Requires PHP: 5.6
|
12 |
* Text Domain : speed-booster-pack
|
13 |
* Domain Path: /lang
|
47 |
|
48 |
define( 'SPEED_BOOSTER_PACK_PATH', plugin_dir_path( __FILE__ ) );
|
49 |
define( 'SPEED_BOOSTER_PACK_URL', preg_replace('#^https?:#', '', plugin_dir_url( __FILE__ ) ) );
|
50 |
+
define( 'SPEED_BOOSTER_PACK_VERSION', '3.8.4.1' );
|
51 |
// Defining css position
|
52 |
define( 'SBP_FOOTER', 10 );
|
53 |
// Defining css last position
|