Version Description
Download this release
Release Info
Developer | sstoqnov |
Plugin | SG Optimizer |
Version | 5.7.5 |
Comparing to | |
See all releases |
Code changes from version 5.7.4 to 5.7.5
- core/Front_End_Optimization/Front_End_Optimization.php +2 -1
- core/Minifier/Minify_Html.php +237 -249
- core/Parser/Parser.php +1 -0
- core/Supercacher/Supercacher_Helper.php +8 -0
- readme.txt +13 -11
- sg-cachepress.php +2 -2
core/Front_End_Optimization/Front_End_Optimization.php
CHANGED
@@ -373,7 +373,7 @@ class Front_End_Optimization {
|
|
373 |
*
|
374 |
* @return bool True/false.
|
375 |
*/
|
376 |
-
|
377 |
|
378 |
$builder_paramas = apply_filters(
|
379 |
'sgo_pb_params',
|
@@ -385,6 +385,7 @@ class Front_End_Optimization {
|
|
385 |
'tve',
|
386 |
'preview',
|
387 |
'elementor-preview',
|
|
|
388 |
)
|
389 |
);
|
390 |
|
373 |
*
|
374 |
* @return bool True/false.
|
375 |
*/
|
376 |
+
public function check_for_builders() {
|
377 |
|
378 |
$builder_paramas = apply_filters(
|
379 |
'sgo_pb_params',
|
385 |
'tve',
|
386 |
'preview',
|
387 |
'elementor-preview',
|
388 |
+
'uxb_iframe',
|
389 |
)
|
390 |
);
|
391 |
|
core/Minifier/Minify_Html.php
CHANGED
@@ -16,253 +16,241 @@ namespace SiteGround_Optimizer\Minifier;
|
|
16 |
*/
|
17 |
class Minify_Html {
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
protected function _removeCdata($str)
|
258 |
-
{
|
259 |
-
return (false !== @strpos($str, '<![CDATA['))
|
260 |
-
? str_replace(array('/* <![CDATA[ */','/* ]]> */','/*<![CDATA[*/','/*]]>*/','<![CDATA[', ']]>'), '', $str)
|
261 |
-
: $str;
|
262 |
-
}
|
263 |
-
|
264 |
-
protected function _needsCdata($str)
|
265 |
-
{
|
266 |
-
return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
|
267 |
-
}
|
268 |
}
|
16 |
*/
|
17 |
class Minify_Html {
|
18 |
|
19 |
+
/**
|
20 |
+
* "Minify" an HTML page
|
21 |
+
*
|
22 |
+
* @param string $html
|
23 |
+
*
|
24 |
+
* @param array $options
|
25 |
+
*
|
26 |
+
* 'cssMinifier' : (optional) callback function to process content of STYLE
|
27 |
+
* elements.
|
28 |
+
*
|
29 |
+
* 'jsMinifier' : (optional) callback function to process content of SCRIPT
|
30 |
+
* elements. Note: the type attribute is ignored.
|
31 |
+
*
|
32 |
+
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
|
33 |
+
* unset, minify will sniff for an XHTML doctype.
|
34 |
+
*
|
35 |
+
* 'keepComments' : (optional boolean) should the HTML comments be kept
|
36 |
+
* in the HTML Code?
|
37 |
+
*
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
public static function minify($html, $options = array()) {
|
41 |
+
$min = new Minify_Html($html, $options);
|
42 |
+
return $min->process();
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Create a minifier object
|
48 |
+
*
|
49 |
+
* @param string $html
|
50 |
+
*
|
51 |
+
* @param array $options
|
52 |
+
*
|
53 |
+
* 'cssMinifier' : (optional) callback function to process content of STYLE
|
54 |
+
* elements.
|
55 |
+
*
|
56 |
+
* 'jsMinifier' : (optional) callback function to process content of SCRIPT
|
57 |
+
* elements. Note: the type attribute is ignored.
|
58 |
+
*
|
59 |
+
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
|
60 |
+
* unset, minify will sniff for an XHTML doctype.
|
61 |
+
*
|
62 |
+
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
|
63 |
+
* unset, minify will sniff for an XHTML doctype.
|
64 |
+
*
|
65 |
+
* @return null
|
66 |
+
*/
|
67 |
+
public function __construct($html, $options = array())
|
68 |
+
{
|
69 |
+
$this->_html = str_replace("\r\n", "\n", trim($html));
|
70 |
+
if (isset($options['xhtml'])) {
|
71 |
+
$this->_isXhtml = (bool)$options['xhtml'];
|
72 |
+
}
|
73 |
+
if (isset($options['cssMinifier'])) {
|
74 |
+
$this->_cssMinifier = $options['cssMinifier'];
|
75 |
+
}
|
76 |
+
if (isset($options['jsMinifier'])) {
|
77 |
+
$this->_jsMinifier = $options['jsMinifier'];
|
78 |
+
}
|
79 |
+
if (isset($options['keepComments'])) {
|
80 |
+
$this->_keepComments = $options['keepComments'];
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Minify the markeup given in the constructor
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
public function process()
|
91 |
+
{
|
92 |
+
if ($this->_isXhtml === null) {
|
93 |
+
$this->_isXhtml = (false !== @strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
|
94 |
+
}
|
95 |
+
|
96 |
+
$this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
|
97 |
+
$this->_placeholders = array();
|
98 |
+
|
99 |
+
// remove HTML comments (not containing IE conditional comments).
|
100 |
+
if ($this->_keepComments == false) {
|
101 |
+
$this->_html = preg_replace_callback(
|
102 |
+
'/<!--([\\s\\S]*?)-->/'
|
103 |
+
,array($this, '_commentCB')
|
104 |
+
,$this->_html);
|
105 |
+
}
|
106 |
+
|
107 |
+
// replace PREs with placeholders
|
108 |
+
$this->_html = preg_replace_callback('/\\s*(<pre\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
|
109 |
+
,array($this, '_removePreCB')
|
110 |
+
,$this->_html);
|
111 |
+
|
112 |
+
// replace TEXTAREAs with placeholders
|
113 |
+
$this->_html = preg_replace_callback(
|
114 |
+
'/\\s*(<textarea\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
|
115 |
+
,array($this, '_removeTextareaCB')
|
116 |
+
,$this->_html);
|
117 |
+
|
118 |
+
// replace data: URIs with placeholders
|
119 |
+
$this->_html = preg_replace_callback(
|
120 |
+
'/(=("|\')data:.*\\2)/Ui'
|
121 |
+
,array($this, '_removeDataURICB')
|
122 |
+
,$this->_html);
|
123 |
+
|
124 |
+
// trim each line.
|
125 |
+
// replace by space instead of '' to avoid newline after opening tag getting zapped
|
126 |
+
$this->_html = preg_replace('/^\s+|\s+$/m', ' ', $this->_html);
|
127 |
+
|
128 |
+
// remove ws around block/undisplayed elements
|
129 |
+
$this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body'
|
130 |
+
.'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form'
|
131 |
+
.'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav'
|
132 |
+
.'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)'
|
133 |
+
.'|ul|video)\\b[^>]*>)/i', '$1', $this->_html);
|
134 |
+
|
135 |
+
// remove ws outside of all elements
|
136 |
+
$this->_html = preg_replace_callback(
|
137 |
+
'/>([^<]+)</'
|
138 |
+
,array($this, '_outsideTagCB')
|
139 |
+
,$this->_html);
|
140 |
+
|
141 |
+
// use newlines before 1st attribute in open tags (to limit line lengths)
|
142 |
+
//$this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html);
|
143 |
+
|
144 |
+
// fill placeholders
|
145 |
+
$this->_html = str_replace(
|
146 |
+
array_keys($this->_placeholders)
|
147 |
+
,array_values($this->_placeholders)
|
148 |
+
,$this->_html
|
149 |
+
);
|
150 |
+
return $this->_html;
|
151 |
+
}
|
152 |
+
|
153 |
+
protected function _commentCB($m)
|
154 |
+
{
|
155 |
+
return (0 === @strpos($m[1], '[') || false !== @strpos($m[1], '<!['))
|
156 |
+
? $m[0]
|
157 |
+
: '';
|
158 |
+
}
|
159 |
+
|
160 |
+
protected function _reservePlace($content)
|
161 |
+
{
|
162 |
+
$placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
|
163 |
+
$this->_placeholders[$placeholder] = $content;
|
164 |
+
return $placeholder;
|
165 |
+
}
|
166 |
+
|
167 |
+
protected $_isXhtml = null;
|
168 |
+
protected $_replacementHash = null;
|
169 |
+
protected $_placeholders = array();
|
170 |
+
protected $_cssMinifier = null;
|
171 |
+
protected $_jsMinifier = null;
|
172 |
+
protected $_keepComments = true;
|
173 |
+
|
174 |
+
protected function _outsideTagCB($m)
|
175 |
+
{
|
176 |
+
return '>' . preg_replace('/^\\s+|\\s+$/', ' ', $m[1]) . '<';
|
177 |
+
}
|
178 |
+
|
179 |
+
protected function _removePreCB($m)
|
180 |
+
{
|
181 |
+
return $this->_reservePlace($m[1]);
|
182 |
+
}
|
183 |
+
|
184 |
+
protected function _removeTextareaCB($m)
|
185 |
+
{
|
186 |
+
return $this->_reservePlace($m[1]);
|
187 |
+
}
|
188 |
+
|
189 |
+
protected function _removeDataURICB($m)
|
190 |
+
{
|
191 |
+
return $this->_reservePlace($m[1]);
|
192 |
+
}
|
193 |
+
|
194 |
+
protected function _removeStyleCB($m)
|
195 |
+
{
|
196 |
+
$openStyle = $m[1];
|
197 |
+
$css = $m[2];
|
198 |
+
// remove HTML comments
|
199 |
+
$css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);
|
200 |
+
|
201 |
+
// remove CDATA section markers
|
202 |
+
$css = $this->_removeCdata($css);
|
203 |
+
|
204 |
+
// minify
|
205 |
+
$minifier = $this->_cssMinifier
|
206 |
+
? $this->_cssMinifier
|
207 |
+
: 'trim';
|
208 |
+
$css = call_user_func($minifier, $css);
|
209 |
+
|
210 |
+
return $this->_reservePlace($this->_needsCdata($css)
|
211 |
+
? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
|
212 |
+
: "{$openStyle}{$css}</style>"
|
213 |
+
);
|
214 |
+
}
|
215 |
+
|
216 |
+
protected function _removeScriptCB($m)
|
217 |
+
{
|
218 |
+
$openScript = $m[2];
|
219 |
+
$js = $m[3];
|
220 |
+
|
221 |
+
// whitespace surrounding? preserve at least one space
|
222 |
+
$ws1 = ($m[1] === '') ? '' : ' ';
|
223 |
+
$ws2 = ($m[4] === '') ? '' : ' ';
|
224 |
+
|
225 |
+
if ($this->_keepComments == false) {
|
226 |
+
// remove HTML comments (and ending "//" if present)
|
227 |
+
$js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
|
228 |
+
|
229 |
+
// remove CDATA section markers
|
230 |
+
$js = $this->_removeCdata($js);
|
231 |
+
}
|
232 |
+
|
233 |
+
// minify
|
234 |
+
$minifier = $this->_jsMinifier
|
235 |
+
? $this->_jsMinifier
|
236 |
+
: 'trim';
|
237 |
+
$js = call_user_func($minifier, $js);
|
238 |
+
|
239 |
+
return $this->_reservePlace($this->_needsCdata($js)
|
240 |
+
? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
|
241 |
+
: "{$ws1}{$openScript}{$js}</script>{$ws2}"
|
242 |
+
);
|
243 |
+
}
|
244 |
+
|
245 |
+
protected function _removeCdata($str)
|
246 |
+
{
|
247 |
+
return (false !== @strpos($str, '<![CDATA['))
|
248 |
+
? str_replace(array('/* <![CDATA[ */','/* ]]> */','/*<![CDATA[*/','/*]]>*/','<![CDATA[', ']]>'), '', $str)
|
249 |
+
: $str;
|
250 |
+
}
|
251 |
+
|
252 |
+
protected function _needsCdata($str)
|
253 |
+
{
|
254 |
+
return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
|
255 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
}
|
core/Parser/Parser.php
CHANGED
@@ -63,6 +63,7 @@ class Parser {
|
|
63 |
if ( Options::is_enabled( 'siteground_optimizer_dns_prefetch' ) ) {
|
64 |
$html = Prefetch::get_instance()->run( $html );
|
65 |
}
|
|
|
66 |
return $html;
|
67 |
}
|
68 |
|
63 |
if ( Options::is_enabled( 'siteground_optimizer_dns_prefetch' ) ) {
|
64 |
$html = Prefetch::get_instance()->run( $html );
|
65 |
}
|
66 |
+
|
67 |
return $html;
|
68 |
}
|
69 |
|
core/Supercacher/Supercacher_Helper.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
namespace SiteGround_Optimizer\Supercacher;
|
3 |
|
|
|
|
|
4 |
/**
|
5 |
* SG CachePress class that help to split the logic in Supercacher.
|
6 |
*/
|
@@ -144,6 +146,12 @@ class Supercacher_Helper {
|
|
144 |
* @return boolean True if the url matches an excluded type, false otherwise.
|
145 |
*/
|
146 |
public static function is_post_type_excluded( $url ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
// Get the post/page ID.
|
148 |
$post_id = url_to_postid( $url );
|
149 |
|
1 |
<?php
|
2 |
namespace SiteGround_Optimizer\Supercacher;
|
3 |
|
4 |
+
use SiteGround_Optimizer\Front_End_Optimization\Front_End_Optimization;
|
5 |
+
|
6 |
/**
|
7 |
* SG CachePress class that help to split the logic in Supercacher.
|
8 |
*/
|
146 |
* @return boolean True if the url matches an excluded type, false otherwise.
|
147 |
*/
|
148 |
public static function is_post_type_excluded( $url ) {
|
149 |
+
|
150 |
+
// We don't want to cache page builder edit page.
|
151 |
+
if ( Front_End_Optimization::get_instance()->check_for_builders() ) {
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
|
155 |
// Get the post/page ID.
|
156 |
$post_id = url_to_postid( $url );
|
157 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Hristo Sg, siteground, sstoqnov, stoyangeorgiev
|
|
3 |
Tags: nginx, caching, speed, memcache, memcached, performance, siteground, nginx, supercacher
|
4 |
Requires at least: 4.7
|
5 |
Requires PHP: 5.5
|
6 |
-
Tested up to: 5.5.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -22,30 +22,27 @@ For detailed information on our plugin and how it works, please check out our [S
|
|
22 |
|
23 |
= SuperCacher Settings =
|
24 |
|
25 |
-
In this tab, you can configure your Dynamic Caching to store your content in the server
|
26 |
|
27 |
= Environment Optimization =
|
28 |
|
29 |
-
Here, you can force HTTPS for your site, enable or disable Gzip Compression and Browser Caching rules. You can activate
|
30 |
|
31 |
= Frontend Optimization =
|
32 |
|
33 |
-
In this tab, you can enable or disable Minification of your HTML, JS and CSS resources. You can activate/deactivate JS and CSS combinations to reduce the numbers of requests to the server. With the Web Fonts Optimization we’re changing the default way we load Google fonts. In addition, all other local fonts will be preloaded so browsers can cache and render them faster. You can Disable Emojis support in your pages to prevent WordPress from detecting and generating emojis on your pages. You can also Remove Query Strings from static resources to improve their caching.
|
34 |
|
35 |
= Image Optimization =
|
36 |
|
37 |
-
Here, you can enable or disable automatic optimization for your newly uploaded images or bulk optimize your old ones. You can also enable or disable Lazy Load for various assets such as iframes, videos, thumbnails, widgets, shortcodes and more. You can also enable Lazy Load for mobile requests. You have an option to exclude specific images from Lazy Loading.
|
38 |
-
|
39 |
-
= Web Fonts Optimization =
|
40 |
-
|
41 |
-
With this optimization we're changing the default way to load Google fonts in order to save HTTP requests. In addition to that, all other fonts that your website uses will be properly preloaded so browsers take the least possible amount of time to cache and render them.
|
42 |
|
43 |
= Speed Test =
|
44 |
|
45 |
-
Our performance check is powered by Google PageSpeed. Here you can check how well
|
46 |
|
47 |
= Full-page Caching on CloudFlare =
|
48 |
-
|
|
|
49 |
|
50 |
= Plugin Compatibility =
|
51 |
|
@@ -215,6 +212,11 @@ Our plugin uses a cookie in order to function properly. It does not store person
|
|
215 |
|
216 |
== Changelog ==
|
217 |
|
|
|
|
|
|
|
|
|
|
|
218 |
= Version 5.7.4 =
|
219 |
* Improved Leverage Browser Caching rules
|
220 |
* Add exclude by post type
|
3 |
Tags: nginx, caching, speed, memcache, memcached, performance, siteground, nginx, supercacher
|
4 |
Requires at least: 4.7
|
5 |
Requires PHP: 5.5
|
6 |
+
Tested up to: 5.5.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
22 |
|
23 |
= SuperCacher Settings =
|
24 |
|
25 |
+
In this tab, you can configure your Dynamic Caching to store your content in the server’s memory for faster access and Memcached which stores frequently executed queries to your database and reuses them for better performance. Make sure you’ve enabled them from your Site Tools or cPanel before using the plugin. You can also enable Automatic Cache purge. This will perform a Full Purge on page, posts, and category deletion, plugin and theme activation, deactivation, or update, and on WordPress core updates. Enabling the Browser-specific caching will create different cache versions based on the user agent used. From Exclude Post Types you can exclude the ones you don’t want to be cached at all. You can also exclude specific URLs or use a wildcard to exclude any sub-pages of a specific “parent-page”. We have also provided a test tool where you can check if a specific URL has Dynamic caching actually running.
|
26 |
|
27 |
= Environment Optimization =
|
28 |
|
29 |
+
Here, you can force HTTPS for your site, enable or disable Gzip Compression and Browser Caching rules. You can activate Database Optimization which will remove all unnecessary items from your database and optimize its tables. If you are using the InnoDB storage engine, the optimization of tables is done automatically by the engine. Use DNS-Prefetching to increase load speeds for external resources. It works by resolving the domain name, before a resource is requested. You can also manage Heartbeat Control to modify the frequency of the WP Heartbeat for different locations. By default, the WordPress Heartbeat API checks every 15 seconds on your post edit pages and every 60 seconds on your dashboard and front end whether there are scheduled tasks to be executed. With this option, you can make the checks run less frequently or completely disable them.
|
30 |
|
31 |
= Frontend Optimization =
|
32 |
|
33 |
+
In this tab, you can enable or disable Minification of your HTML, JS and CSS resources. You can activate/deactivate JS and CSS combinations to reduce the numbers of requests to the server. With the Web Fonts Optimization we’re changing the default way we load Google fonts. A preconnect link for Google's font repository will be added in your head tag. This informs the browser that your page intends to establish a connection to another origin, and that you'd like the process to start as soon as possible. In addition, all other local fonts will be preloaded so browsers can cache and render them faster. Also when combined with CSS Combination, we will change the font-display property to swap or add it if it's missing, so we ensure faster rendering. You can Disable Emojis support in your pages to prevent WordPress from detecting and generating emojis on your pages. You can also Remove Query Strings from static resources to improve their caching.
|
34 |
|
35 |
= Image Optimization =
|
36 |
|
37 |
+
Here, you can enable or disable automatic optimization for your newly uploaded images or bulk optimize your old ones. You can enable the generation of WebP images for newly uploaded images or generate WebP copies of your existing ones. WebP is a next generation image format supported by modern browsers which greatly reduces the size of your images. If the browser does not support WebP, the original images will be loaded. If you wish, you can delete all WebP copies of your images and original images will be loaded by default. You can also enable or disable Lazy Load for various assets such as iframes, videos, thumbnails, widgets, shortcodes and more. You can also enable Lazy Load for mobile requests. You have an option to exclude specific images from Lazy Loading. This is done by adding the class of the image in the tab.
|
|
|
|
|
|
|
|
|
38 |
|
39 |
= Speed Test =
|
40 |
|
41 |
+
Our performance check is powered by Google PageSpeed. Here you can check how well your website is optimized. The detailed tests result will provide you with additional information on what can be optimized more.
|
42 |
|
43 |
= Full-page Caching on CloudFlare =
|
44 |
+
|
45 |
+
Тhis optimization links your WordPress site with Cloudflare and sets the necessary rules and workers in order to enable full-page caching on Cloudflare edges in order to improve your TTFB and overall site performance. The tab will be available only if you have properly configured your installation to work with the CDN.
|
46 |
|
47 |
= Plugin Compatibility =
|
48 |
|
212 |
|
213 |
== Changelog ==
|
214 |
|
215 |
+
= Version 5.7.5 =
|
216 |
+
* Improved Flatsome UX Builder support
|
217 |
+
* Improved Essential Addons for Elementor support
|
218 |
+
* Updated readme
|
219 |
+
|
220 |
= Version 5.7.4 =
|
221 |
* Improved Leverage Browser Caching rules
|
222 |
* Add exclude by post type
|
sg-cachepress.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Plugin Name: SG Optimizer
|
11 |
* Plugin URI: https://siteground.com
|
12 |
* Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
|
13 |
-
* Version: 5.7.
|
14 |
* Author: SiteGround
|
15 |
* Author URI: https://www.siteground.com
|
16 |
* Text Domain: sg-cachepress
|
@@ -31,7 +31,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
31 |
|
32 |
// Define version constant.
|
33 |
if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
|
34 |
-
define( __NAMESPACE__ . '\VERSION', '5.7.
|
35 |
}
|
36 |
|
37 |
// Define slug constant.
|
10 |
* Plugin Name: SG Optimizer
|
11 |
* Plugin URI: https://siteground.com
|
12 |
* Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
|
13 |
+
* Version: 5.7.5
|
14 |
* Author: SiteGround
|
15 |
* Author URI: https://www.siteground.com
|
16 |
* Text Domain: sg-cachepress
|
31 |
|
32 |
// Define version constant.
|
33 |
if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
|
34 |
+
define( __NAMESPACE__ . '\VERSION', '5.7.5' );
|
35 |
}
|
36 |
|
37 |
// Define slug constant.
|