Version Description
- Fix: Corrected relative paths used in the JS minify YUI Compressor
- Fix: Disallow crawling of cache directory
- Fix: Responsive display for the dashboard
- Enhancement: Added lazy load threshold setting
- Enhancement: Added feature policy security headers to settings
Download this release
Release Info
Developer | joemoto |
Plugin | W3 Total Cache |
Version | 2.1.7 |
Comparing to | |
See all releases |
Code changes from version 2.1.6 to 2.1.7
- BrowserCache_Page_View_SectionSecurity.php +61 -29
- ConfigKeys.php +4 -0
- Generic_Environment.php +57 -0
- Generic_Page_Dashboard_View.css +8 -0
- UserExperience_LazyLoad_Page_View.php +8 -0
- UserExperience_LazyLoad_Plugin.php +8 -1
- Util_Rule.php +17 -1
- lib/YuiCssMin/Minifier.php +3 -0
- readme.txt +8 -1
- w3-total-cache-api.php +3 -1
- w3-total-cache.php +1 -1
BrowserCache_Page_View_SectionSecurity.php
CHANGED
@@ -19,111 +19,143 @@ $fp_values = $c->get_array( 'browsercache.security.fp.values' );
|
|
19 |
$feature_policies = array(
|
20 |
array(
|
21 |
'label' => 'accelerometer',
|
22 |
-
'description' => __( '
|
23 |
),
|
24 |
array(
|
25 |
'label' => 'ambient-light-sensor',
|
26 |
-
'description' => __( '
|
27 |
),
|
28 |
array(
|
29 |
'label' => 'autoplay',
|
30 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
31 |
),
|
32 |
array(
|
33 |
'label' => 'camera',
|
34 |
-
'description' => __( '
|
35 |
),
|
36 |
array(
|
37 |
'label' => 'display-capture',
|
38 |
-
'description' => __( '
|
39 |
),
|
40 |
array(
|
41 |
'label' => 'document-domain',
|
42 |
-
'description' => __( '
|
43 |
),
|
44 |
array(
|
45 |
'label' => 'encrypted-media',
|
46 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
),
|
48 |
array(
|
49 |
'label' => 'fullscreen',
|
50 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
51 |
),
|
52 |
array(
|
53 |
'label' => 'geolocation',
|
54 |
-
'description' => __( '
|
55 |
),
|
56 |
array(
|
57 |
'label' => 'gyroscope',
|
58 |
-
'description' => __( '
|
59 |
),
|
60 |
array(
|
61 |
'label' => 'layout-animations',
|
62 |
-
'description' => __( '
|
63 |
),
|
64 |
array(
|
65 |
'label' => 'legacy-image-formats',
|
66 |
-
'description' => __( '
|
67 |
),
|
68 |
array(
|
69 |
'label' => 'magnetometer',
|
70 |
-
'description' => __( '
|
71 |
),
|
72 |
array(
|
73 |
'label' => 'microphone',
|
74 |
-
'description' => __( '
|
75 |
),
|
76 |
array(
|
77 |
'label' => 'midi',
|
78 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
79 |
),
|
80 |
array(
|
81 |
'label' => 'oversized-images',
|
82 |
-
'description' => __( '
|
83 |
),
|
84 |
array(
|
85 |
'label' => 'payment',
|
86 |
-
'description' => __( '
|
87 |
),
|
88 |
array(
|
89 |
'label' => 'picture-in-picture',
|
90 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
91 |
),
|
92 |
array(
|
93 |
-
'label' => '
|
94 |
-
'description' => __( '
|
95 |
),
|
96 |
array(
|
97 |
'label' => 'speaker',
|
98 |
-
'description' => __( '
|
99 |
),
|
100 |
array(
|
101 |
'label' => 'sync-xhr',
|
102 |
-
'description' => __( '
|
103 |
),
|
104 |
array(
|
105 |
'label' => 'unoptimized-images',
|
106 |
-
'description' => __( '
|
107 |
),
|
108 |
array(
|
109 |
'label' => 'unsized-media',
|
110 |
-
'description' => __( '
|
111 |
),
|
112 |
array(
|
113 |
'label' => 'usb',
|
114 |
-
'description' => __( '
|
115 |
),
|
116 |
array(
|
117 |
'label' => 'vibrate',
|
118 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
119 |
),
|
120 |
array(
|
121 |
'label' => 'wake-lock',
|
122 |
-
'description' => __( '
|
|
|
|
|
|
|
|
|
123 |
),
|
124 |
array(
|
125 |
'label' => 'xr-spatial-tracking',
|
126 |
-
'description' => __( '
|
127 |
),
|
128 |
);
|
129 |
|
@@ -502,7 +534,7 @@ $feature_policies = array(
|
|
502 |
'control' => 'textbox',
|
503 |
'label' => $i['label'],
|
504 |
'textbox_size' => '50',
|
505 |
-
'textbox_placeholder' => "One of: 'self' 'src' 'none' *.domain.com",
|
506 |
'description' => $i['description'],
|
507 |
)
|
508 |
);
|
19 |
$feature_policies = array(
|
20 |
array(
|
21 |
'label' => 'accelerometer',
|
22 |
+
'description' => __( 'Controls whether the current document is allowed to gather information about the acceleration of the device through the Accelerometer interface.', 'w3-total-cache' ),
|
23 |
),
|
24 |
array(
|
25 |
'label' => 'ambient-light-sensor',
|
26 |
+
'description' => __( 'Controls whether the current document is allowed to gather information about the amount of light in the environment around the device through the AmbientLightSensor interface.', 'w3-total-cache' ),
|
27 |
),
|
28 |
array(
|
29 |
'label' => 'autoplay',
|
30 |
+
'description' => __( 'Controls whether the current document is allowed to autoplay media requested through the HTMLMediaElement interface.', 'w3-total-cache' ),
|
31 |
+
),
|
32 |
+
array(
|
33 |
+
'label' => 'battery',
|
34 |
+
'description' => __( 'Controls whether the use of the Battery Status API is allowed. When this policy is disabled, the Promise returned by Navigator.getBattery() will reject with a NotAllowedError DOMException.', 'w3-total-cache' ),
|
35 |
),
|
36 |
array(
|
37 |
'label' => 'camera',
|
38 |
+
'description' => __( 'Controls whether the current document is allowed to use video input devices.', 'w3-total-cache' ),
|
39 |
),
|
40 |
array(
|
41 |
'label' => 'display-capture',
|
42 |
+
'description' => __( 'Controls whether or not the document is permitted to use Screen Capture API.', 'w3-total-cache' ),
|
43 |
),
|
44 |
array(
|
45 |
'label' => 'document-domain',
|
46 |
+
'description' => __( 'Controls whether the current document is allowed to set document.domain.', 'w3-total-cache' ),
|
47 |
),
|
48 |
array(
|
49 |
'label' => 'encrypted-media',
|
50 |
+
'description' => __( 'Controls whether the current document is allowed to use the Encrypted Media Extensions API (EME).', 'w3-total-cache' ),
|
51 |
+
),
|
52 |
+
array(
|
53 |
+
'label' => 'execution-while-not-rendered',
|
54 |
+
'description' => __( 'Controls whether tasks should execute in frames while they\'re not being rendered (e.g. if an iframe is hidden or display: none).', 'w3-total-cache' ),
|
55 |
+
),
|
56 |
+
array(
|
57 |
+
'label' => 'execution-while-out-of-viewport',
|
58 |
+
'description' => __( 'Controls whether tasks should execute in frames while they\'re outside of the visible viewport.', 'w3-total-cache' ),
|
59 |
),
|
60 |
array(
|
61 |
'label' => 'fullscreen',
|
62 |
+
'description' => __( 'Controls whether the current document is allowed to use Element.requestFullScreen().', 'w3-total-cache' ),
|
63 |
+
),
|
64 |
+
array(
|
65 |
+
'label' => 'gamepad',
|
66 |
+
'description' => __( 'Controls whether the current document is allowed to use the Gamepad API. When this policy is disabled, calls to Navigator.getGamepads() will throw a SecurityError DOMException, and the gamepadconnected and gamepaddisconnected events will not fire.', 'w3-total-cache' ),
|
67 |
),
|
68 |
array(
|
69 |
'label' => 'geolocation',
|
70 |
+
'description' => __( 'Controls whether the current document is allowed to use the Geolocation Interface.', 'w3-total-cache' ),
|
71 |
),
|
72 |
array(
|
73 |
'label' => 'gyroscope',
|
74 |
+
'description' => __( 'Controls whether the current document is allowed to gather information about the orientation of the device through the Gyroscope interface.', 'w3-total-cache' ),
|
75 |
),
|
76 |
array(
|
77 |
'label' => 'layout-animations',
|
78 |
+
'description' => __( 'Controls whether the current document is allowed to show layout animations.', 'w3-total-cache' ),
|
79 |
),
|
80 |
array(
|
81 |
'label' => 'legacy-image-formats',
|
82 |
+
'description' => __( 'Controls whether the current document is allowed to display images in legacy formats.', 'w3-total-cache' ),
|
83 |
),
|
84 |
array(
|
85 |
'label' => 'magnetometer',
|
86 |
+
'description' => __( 'Controls whether the current document is allowed to gather information about the orientation of the device through the Magnetometer interface.', 'w3-total-cache' ),
|
87 |
),
|
88 |
array(
|
89 |
'label' => 'microphone',
|
90 |
+
'description' => __( 'Controls whether the current document is allowed to use audio input devices.', 'w3-total-cache' ),
|
91 |
),
|
92 |
array(
|
93 |
'label' => 'midi',
|
94 |
+
'description' => __( 'Controls whether the current document is allowed to use the Web MIDI API.', 'w3-total-cache' ),
|
95 |
+
),
|
96 |
+
array(
|
97 |
+
'label' => 'navigation-override',
|
98 |
+
'description' => __( 'Controls the availability of mechanisms that enables the page author to take control over the behavior of spatial navigation, or to cancel it outright.', 'w3-total-cache' ),
|
99 |
),
|
100 |
array(
|
101 |
'label' => 'oversized-images',
|
102 |
+
'description' => __( 'Controls whether the current document is allowed to download and display large images.', 'w3-total-cache' ),
|
103 |
),
|
104 |
array(
|
105 |
'label' => 'payment',
|
106 |
+
'description' => __( 'Controls whether the current document is allowed to use the Payment Request API.', 'w3-total-cache' ),
|
107 |
),
|
108 |
array(
|
109 |
'label' => 'picture-in-picture',
|
110 |
+
'description' => __( 'Controls whether the current document is allowed to play a video in a Picture-in-Picture mode via the corresponding API.', 'w3-total-cache' ),
|
111 |
+
),
|
112 |
+
array(
|
113 |
+
'label' => 'publickey-credentials-get',
|
114 |
+
'description' => __( 'Controls whether the current document is allowed to use the Web Authentication API to retrieve already stored public-key credentials, i.e. via navigator.credentials.get({publicKey: ..., ...}).', 'w3-total-cache' ),
|
115 |
),
|
116 |
array(
|
117 |
+
'label' => 'screen-wake-lock',
|
118 |
+
'description' => __( 'Controls whether the current document is allowed to use Screen Wake Lock API to indicate that device should not turn off or dim the screen.', 'w3-total-cache' ),
|
119 |
),
|
120 |
array(
|
121 |
'label' => 'speaker',
|
122 |
+
'description' => __( 'Controls whether the current document is allowed to play audio via any methods.', 'w3-total-cache' ),
|
123 |
),
|
124 |
array(
|
125 |
'label' => 'sync-xhr',
|
126 |
+
'description' => __( 'Controls whether the current document is allowed to make synchronous XMLHttpRequest requests.', 'w3-total-cache' ),
|
127 |
),
|
128 |
array(
|
129 |
'label' => 'unoptimized-images',
|
130 |
+
'description' => __( 'Controls whether the current document is allowed to download and display unoptimized images.', 'w3-total-cache' ),
|
131 |
),
|
132 |
array(
|
133 |
'label' => 'unsized-media',
|
134 |
+
'description' => __( 'Controls whether the current document is allowed to change the size of media elements after the initial layout is complete.', 'w3-total-cache' ),
|
135 |
),
|
136 |
array(
|
137 |
'label' => 'usb',
|
138 |
+
'description' => __( 'Controls whether the current document is allowed to use the WebUSB API.', 'w3-total-cache' ),
|
139 |
),
|
140 |
array(
|
141 |
'label' => 'vibrate',
|
142 |
+
'description' => __( 'Controls whether the current document is allowed to trigger device vibrations via Navigator.vibrate() method of Vibration API.', 'w3-total-cache' ),
|
143 |
+
),
|
144 |
+
array(
|
145 |
+
'label' => 'vr',
|
146 |
+
'description' => __( 'Controls whether the current document is allowed to use the WebVR API. When this policy is disabled, the Promise returned by Navigator.getVRDisplays() will reject with a DOMException. Keep in mind that the WebVR standard is in the process of being replaced with WebXR.', 'w3-total-cache' ),
|
147 |
),
|
148 |
array(
|
149 |
'label' => 'wake-lock',
|
150 |
+
'description' => __( 'Controls whether the current document is allowed to use Wake Lock API to indicate that device should not enter power-saving mode.', 'w3-total-cache' ),
|
151 |
+
),
|
152 |
+
array(
|
153 |
+
'label' => 'web-share',
|
154 |
+
'description' => __( 'Controls whether or not the current document is allowed to use the Navigator.share() of Web Share API to share text, links, images, and other content to arbitrary destinations of user\'s choice, e.g. mobile apps.', 'w3-total-cache' ),
|
155 |
),
|
156 |
array(
|
157 |
'label' => 'xr-spatial-tracking',
|
158 |
+
'description' => __( 'Controls whether the current document is allowed to use the WebXR Device API.', 'w3-total-cache' ),
|
159 |
),
|
160 |
);
|
161 |
|
534 |
'control' => 'textbox',
|
535 |
'label' => $i['label'],
|
536 |
'textbox_size' => '50',
|
537 |
+
'textbox_placeholder' => "One of: * 'self' 'src' 'none' *.domain.com",
|
538 |
'description' => $i['description'],
|
539 |
)
|
540 |
);
|
ConfigKeys.php
CHANGED
@@ -170,6 +170,10 @@ $keys = array(
|
|
170 |
'type' => 'boolean',
|
171 |
'default' => false
|
172 |
),
|
|
|
|
|
|
|
|
|
173 |
'lazyload.process_img' => array(
|
174 |
'type' => 'boolean',
|
175 |
'default' => true
|
170 |
'type' => 'boolean',
|
171 |
'default' => false
|
172 |
),
|
173 |
+
'lazyload.threshold' => array(
|
174 |
+
'type' => 'string',
|
175 |
+
'default' => ''
|
176 |
+
),
|
177 |
'lazyload.process_img' => array(
|
178 |
'type' => 'boolean',
|
179 |
'default' => true
|
Generic_Environment.php
CHANGED
@@ -16,6 +16,7 @@ class Generic_Environment {
|
|
16 |
$exs = new Util_Environment_Exceptions();
|
17 |
// create add-ins
|
18 |
$this->create_required_files( $config, $exs );
|
|
|
19 |
|
20 |
// create folders
|
21 |
$this->create_required_folders( $exs );
|
@@ -58,6 +59,7 @@ class Generic_Environment {
|
|
58 |
$exs = new Util_Environment_Exceptions();
|
59 |
|
60 |
$this->delete_required_files( $exs );
|
|
|
61 |
|
62 |
if ( count( $exs->exceptions() ) > 0 )
|
63 |
throw $exs;
|
@@ -207,4 +209,59 @@ class Generic_Environment {
|
|
207 |
return ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_ADVANCED_CACHE ) )
|
208 |
&& strstr( $script_data, 'PgCache_ContentGrabber' ) !== false );
|
209 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
}
|
16 |
$exs = new Util_Environment_Exceptions();
|
17 |
// create add-ins
|
18 |
$this->create_required_files( $config, $exs );
|
19 |
+
$this->robots_rules_add( $config, $exs );
|
20 |
|
21 |
// create folders
|
22 |
$this->create_required_folders( $exs );
|
59 |
$exs = new Util_Environment_Exceptions();
|
60 |
|
61 |
$this->delete_required_files( $exs );
|
62 |
+
$this->robots_rules_remove( $exs );
|
63 |
|
64 |
if ( count( $exs->exceptions() ) > 0 )
|
65 |
throw $exs;
|
209 |
return ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_ADVANCED_CACHE ) )
|
210 |
&& strstr( $script_data, 'PgCache_ContentGrabber' ) !== false );
|
211 |
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Write robots.txt directives to prevent crawl of cache directory.
|
215 |
+
*
|
216 |
+
* @since 2.1.7
|
217 |
+
*
|
218 |
+
* @param Config $config Configuration.
|
219 |
+
* @param Util_Environment_Exceptions $exs Exceptions.
|
220 |
+
*
|
221 |
+
* @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials.
|
222 |
+
*/
|
223 |
+
private function robots_rules_add( $config, $exs ) {
|
224 |
+
Util_Rule::add_rules(
|
225 |
+
$exs,
|
226 |
+
Util_Rule::get_robots_rules_path(),
|
227 |
+
$this->robots_rules_generate(),
|
228 |
+
W3TC_MARKER_BEGIN_ROBOTS,
|
229 |
+
W3TC_MARKER_END_ROBOTS,
|
230 |
+
array()
|
231 |
+
);
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Generate robots.txt directives.
|
236 |
+
*
|
237 |
+
* @since 2.1.7
|
238 |
+
*
|
239 |
+
* @return string
|
240 |
+
*/
|
241 |
+
private function robots_rules_generate() {
|
242 |
+
return '
|
243 |
+
# BEGIN W3TC ROBOTS
|
244 |
+
User-agent: *
|
245 |
+
Disallow: /wp-content/cache/
|
246 |
+
# END W3TC ROBOTS
|
247 |
+
';
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Removes robots.txt directives.
|
252 |
+
*
|
253 |
+
* @since 2.1.7
|
254 |
+
*
|
255 |
+
* @param Util_Environment_Exceptions $exs Exceptions.
|
256 |
+
*
|
257 |
+
* @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials.
|
258 |
+
*/
|
259 |
+
private function robots_rules_remove( $exs ) {
|
260 |
+
Util_Rule::remove_rules(
|
261 |
+
$exs,
|
262 |
+
Util_Environment::site_path() . 'robots.txt',
|
263 |
+
W3TC_MARKER_BEGIN_ROBOTS,
|
264 |
+
W3TC_MARKER_END_ROBOTS
|
265 |
+
);
|
266 |
+
}
|
267 |
}
|
Generic_Page_Dashboard_View.css
CHANGED
@@ -126,6 +126,7 @@
|
|
126 |
}
|
127 |
#w3tc-dashboard-widgets {
|
128 |
min-width: auto;
|
|
|
129 |
}
|
130 |
#postbox-container-right {
|
131 |
width: 100%;
|
@@ -139,6 +140,13 @@
|
|
139 |
#w3tc-dashboard-widgets #normal-sortables .postbox {
|
140 |
width: 100%;
|
141 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
.w3tc_generic_widgetservice_label {
|
143 |
display: inline;
|
144 |
}
|
126 |
}
|
127 |
#w3tc-dashboard-widgets {
|
128 |
min-width: auto;
|
129 |
+
flex-wrap: wrap;
|
130 |
}
|
131 |
#postbox-container-right {
|
132 |
width: 100%;
|
140 |
#w3tc-dashboard-widgets #normal-sortables .postbox {
|
141 |
width: 100%;
|
142 |
}
|
143 |
+
#w3tc-dashboard-widgets #side-sortables .postbox .postbox-header .w3tc-widget-text {
|
144 |
+
float: none;
|
145 |
+
}
|
146 |
+
#w3tc-dashboard-widgets #side-sortables .postbox .postbox-header,
|
147 |
+
#w3tc-dashboard-widgets #side-sortables .postbox .inside {
|
148 |
+
text-align: center;
|
149 |
+
}
|
150 |
.w3tc_generic_widgetservice_label {
|
151 |
display: inline;
|
152 |
}
|
UserExperience_LazyLoad_Page_View.php
CHANGED
@@ -40,6 +40,14 @@ $is_google_maps_easy = ( in_array( 'google-maps-easy/gmp.php', $plugins ) );
|
|
40 |
'w3-total-cache' )
|
41 |
) );
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
Util_Ui::config_item( array(
|
44 |
'key' => 'lazyload.embed_method',
|
45 |
'label' => __( 'Script Embed method:', 'w3-total-cache' ),
|
40 |
'w3-total-cache' )
|
41 |
) );
|
42 |
|
43 |
+
Util_Ui::config_item( array(
|
44 |
+
'key' => 'lazyload.threshold',
|
45 |
+
'control' => 'textbox',
|
46 |
+
'label' => __( 'Threshold', 'w3-total-cache' ),
|
47 |
+
'description' => __( 'The outer distance off the scrolling area from which to start loading the elements (example: 100px, 10%).',
|
48 |
+
'w3-total-cache' )
|
49 |
+
) );
|
50 |
+
|
51 |
Util_Ui::config_item( array(
|
52 |
'key' => 'lazyload.embed_method',
|
53 |
'label' => __( 'Script Embed method:', 'w3-total-cache' ),
|
UserExperience_LazyLoad_Plugin.php
CHANGED
@@ -131,7 +131,14 @@ class UserExperience_LazyLoad_Plugin {
|
|
131 |
$method = $this->config->get_string( 'lazyload.embed_method' );
|
132 |
|
133 |
$fireEvent = 'function(t){var e;try{e=new CustomEvent("w3tc_lazyload_loaded",{detail:{e:t}})}catch(a){(e=document.createEvent("CustomEvent")).initCustomEvent("w3tc_lazyload_loaded",!1,!1,{e:t})}window.dispatchEvent(e)}';
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
$on_initialized_javascript = apply_filters( 'w3tc_lazyload_on_initialized_javascript', '' );
|
137 |
|
131 |
$method = $this->config->get_string( 'lazyload.embed_method' );
|
132 |
|
133 |
$fireEvent = 'function(t){var e;try{e=new CustomEvent("w3tc_lazyload_loaded",{detail:{e:t}})}catch(a){(e=document.createEvent("CustomEvent")).initCustomEvent("w3tc_lazyload_loaded",!1,!1,{e:t})}window.dispatchEvent(e)}';
|
134 |
+
|
135 |
+
$thresholds = '';
|
136 |
+
$config_threshold = $this->config->get_string( 'lazyload.threshold' );
|
137 |
+
if ( !empty( $config_threshold ) ) {
|
138 |
+
$thresholds = 'thresholds:' . json_encode( $config_threshold ) . ',';
|
139 |
+
}
|
140 |
+
|
141 |
+
$config = '{elements_selector:".lazy",' . $thresholds . 'callback_loaded:' . $fireEvent . '}';
|
142 |
|
143 |
$on_initialized_javascript = apply_filters( 'w3tc_lazyload_on_initialized_javascript', '' );
|
144 |
|
Util_Rule.php
CHANGED
@@ -135,12 +135,28 @@ class Util_Rule {
|
|
135 |
return false;
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
138 |
static public function get_new_relic_rules_core_path() {
|
139 |
return Util_Rule::get_pgcache_rules_core_path();
|
140 |
}
|
141 |
|
142 |
/**
|
143 |
-
* Returns
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
*
|
145 |
* @param string $path
|
146 |
* @return boolean
|
135 |
return false;
|
136 |
}
|
137 |
|
138 |
+
/**
|
139 |
+
* Returns path of pagecache core rules file for new relic.
|
140 |
+
*
|
141 |
+
* @return string
|
142 |
+
*/
|
143 |
static public function get_new_relic_rules_core_path() {
|
144 |
return Util_Rule::get_pgcache_rules_core_path();
|
145 |
}
|
146 |
|
147 |
/**
|
148 |
+
* Returns path of robots.txt.
|
149 |
+
*
|
150 |
+
* @since 2.1.7
|
151 |
+
*
|
152 |
+
* @return string
|
153 |
+
*/
|
154 |
+
static public function get_robots_rules_path() {
|
155 |
+
return Util_Environment::site_path() . 'robots.txt';
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Returns true if we can modify rules.
|
160 |
*
|
161 |
* @param string $path
|
162 |
* @return boolean
|
lib/YuiCssMin/Minifier.php
CHANGED
@@ -64,6 +64,9 @@ class Minifier
|
|
64 |
|
65 |
public static function minify_static($css, $options = array()) {
|
66 |
$m = new Minifier();
|
|
|
|
|
|
|
67 |
return $m->run($css);
|
68 |
}
|
69 |
|
64 |
|
65 |
public static function minify_static($css, $options = array()) {
|
66 |
$m = new Minifier();
|
67 |
+
|
68 |
+
$css = \W3TCL\Minify\Minify_CSS_UriRewriter::rewrite($css, $options);
|
69 |
+
|
70 |
return $m->run($css);
|
71 |
}
|
72 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryj
|
|
3 |
Tags: seo, cache, optimize, pagespeed, performance, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 5.8
|
6 |
-
Stable tag: 2.1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -275,6 +275,13 @@ Please reach out to all of these people and support their projects if you're so
|
|
275 |
|
276 |
== Changelog ==
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
= 2.1.6 =
|
279 |
* Fix: JS minify issue with template literal backticks
|
280 |
* Fix: Do not redirect when using WP-CLI
|
3 |
Tags: seo, cache, optimize, pagespeed, performance, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 5.8
|
6 |
+
Stable tag: 2.1.7
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
275 |
|
276 |
== Changelog ==
|
277 |
|
278 |
+
= 2.1.7 =
|
279 |
+
* Fix: Corrected relative paths used in the JS minify YUI Compressor
|
280 |
+
* Fix: Disallow crawling of cache directory
|
281 |
+
* Fix: Responsive display for the dashboard
|
282 |
+
* Enhancement: Added lazy load threshold setting
|
283 |
+
* Enhancement: Added feature policy security headers to settings
|
284 |
+
|
285 |
= 2.1.6 =
|
286 |
* Fix: JS minify issue with template literal backticks
|
287 |
* Fix: Do not redirect when using WP-CLI
|
w3-total-cache-api.php
CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
5 |
}
|
6 |
|
7 |
define( 'W3TC', true );
|
8 |
-
define( 'W3TC_VERSION', '2.1.
|
9 |
define( 'W3TC_POWERED_BY', 'W3 Total Cache' );
|
10 |
define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' );
|
11 |
define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' );
|
@@ -104,6 +104,7 @@ define( 'W3TC_MARKER_BEGIN_MINIFY_CORE', '# BEGIN W3TC Minify core' );
|
|
104 |
define( 'W3TC_MARKER_BEGIN_MINIFY_CACHE', '# BEGIN W3TC Minify cache' );
|
105 |
define( 'W3TC_MARKER_BEGIN_MINIFY_LEGACY', '# BEGIN W3TC Minify' );
|
106 |
define( 'W3TC_MARKER_BEGIN_CDN', '# BEGIN W3TC CDN' );
|
|
|
107 |
|
108 |
|
109 |
define( 'W3TC_MARKER_END_WORDPRESS', '# END WordPress' );
|
@@ -118,6 +119,7 @@ define( 'W3TC_MARKER_END_MINIFY_CACHE', '# END W3TC Minify cache' );
|
|
118 |
define( 'W3TC_MARKER_END_MINIFY_LEGACY', '# END W3TC Minify' );
|
119 |
define( 'W3TC_MARKER_END_CDN', '# END W3TC CDN' );
|
120 |
define( 'W3TC_MARKER_END_NEW_RELIC_CORE', '# END W3TC New Relic core' );
|
|
|
121 |
|
122 |
|
123 |
if ( !defined( 'W3TC_EXTENSION_DIR' ) ) {
|
5 |
}
|
6 |
|
7 |
define( 'W3TC', true );
|
8 |
+
define( 'W3TC_VERSION', '2.1.7' );
|
9 |
define( 'W3TC_POWERED_BY', 'W3 Total Cache' );
|
10 |
define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' );
|
11 |
define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' );
|
104 |
define( 'W3TC_MARKER_BEGIN_MINIFY_CACHE', '# BEGIN W3TC Minify cache' );
|
105 |
define( 'W3TC_MARKER_BEGIN_MINIFY_LEGACY', '# BEGIN W3TC Minify' );
|
106 |
define( 'W3TC_MARKER_BEGIN_CDN', '# BEGIN W3TC CDN' );
|
107 |
+
define( 'W3TC_MARKER_BEGIN_ROBOTS', '# BEGIN W3TC ROBOTS' );
|
108 |
|
109 |
|
110 |
define( 'W3TC_MARKER_END_WORDPRESS', '# END WordPress' );
|
119 |
define( 'W3TC_MARKER_END_MINIFY_LEGACY', '# END W3TC Minify' );
|
120 |
define( 'W3TC_MARKER_END_CDN', '# END W3TC CDN' );
|
121 |
define( 'W3TC_MARKER_END_NEW_RELIC_CORE', '# END W3TC New Relic core' );
|
122 |
+
define( 'W3TC_MARKER_END_ROBOTS', '# END W3TC ROBOTS' );
|
123 |
|
124 |
|
125 |
if ( !defined( 'W3TC_EXTENSION_DIR' ) ) {
|
w3-total-cache.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: W3 Total Cache
|
4 |
* Plugin URI: https://www.boldgrid.com/totalcache/
|
5 |
* Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.
|
6 |
-
* Version: 2.1.
|
7 |
* Requires at least: 3.8
|
8 |
* Requires PHP: 5.6
|
9 |
* Author: BoldGrid
|
3 |
* Plugin Name: W3 Total Cache
|
4 |
* Plugin URI: https://www.boldgrid.com/totalcache/
|
5 |
* Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.
|
6 |
+
* Version: 2.1.7
|
7 |
* Requires at least: 3.8
|
8 |
* Requires PHP: 5.6
|
9 |
* Author: BoldGrid
|