W3 Total Cache - Version 2.1.9

Version Description

  • Fix: Cloudflare Dashboard Widget: Updated to use GraphQL
  • Fix: Cloudflare Dashboard Widget: Use WordPress timezone
  • Fix: CDN: Execute purge only if hosting is enabled, to prevent unneeded delays
  • Fix: Published/modified custom posts not clearing the archive cache(s)
  • Fix: Native WordPress sitemap caching
  • Fix: Extra MIME groups other than controlled by settings were added to rules
  • Fix: Usage Statistics: Not functioning when object cache is set to Redis
  • Fix: AMP Extension: Prevent popup admin bar for endpoints
  • Fix: Setup Guide Wizard: CSS for long translations
  • Fix: Opcache Settings: Validate timestamp indicator checkbox
  • Update: Remove robots.txt cache toggle setting
  • Enhancement: Impove 404 detection
  • Enhancement: Improved compatibility check indicators
  • Enhancement: AWS CloudFront: Faster cache invalidation using async
Download this release

Release Info

Developer joemoto
Plugin Icon 128x128 W3 Total Cache
Version 2.1.9
Comparing to
See all releases

Code changes from version 2.1.8 to 2.1.9

BrowserCache_Environment.php CHANGED
@@ -360,9 +360,12 @@ class BrowserCache_Environment {
360
  $rules .= "</IfModule>\n";
361
  }
362
 
363
- foreach ( $mime_types2 as $type => $extensions )
364
- $rules .= $this->_rules_cache_generate_apache_for_type( $config,
365
- $extensions, $type );
 
 
 
366
 
367
  if ( $config->get_boolean( 'browsercache.hsts' ) ||
368
  $config->get_boolean( 'browsercache.security.xfo' ) ||
@@ -579,18 +582,18 @@ class BrowserCache_Environment {
579
  } else {
580
  if ( $compatibility ) {
581
  $rules .= " FileETag None\n";
582
- $headers_rules .= " Header unset ETag\n";
583
  }
584
  }
585
 
586
  if ( $unset_setcookie )
587
- $headers_rules .= " Header unset Set-Cookie\n";
588
 
589
  if ( !$set_last_modified )
590
- $headers_rules .= " Header unset Last-Modified\n";
591
 
592
  if ( $w3tc )
593
- $headers_rules .= " Header set X-Powered-By \"" .
594
  Util_Environment::w3tc_header() . "\"\n";
595
 
596
  if ( strlen( $headers_rules ) > 0 ) {
360
  $rules .= "</IfModule>\n";
361
  }
362
 
363
+ $rules .= $this->_rules_cache_generate_apache_for_type( $config,
364
+ $mime_types2['cssjs'], 'cssjs' );
365
+ $rules .= $this->_rules_cache_generate_apache_for_type( $config,
366
+ $mime_types2['html'], 'html' );
367
+ $rules .= $this->_rules_cache_generate_apache_for_type( $config,
368
+ $mime_types2['other'], 'other' );
369
 
370
  if ( $config->get_boolean( 'browsercache.hsts' ) ||
371
  $config->get_boolean( 'browsercache.security.xfo' ) ||
582
  } else {
583
  if ( $compatibility ) {
584
  $rules .= " FileETag None\n";
585
+ $headers_rules .= " Header unset ETag\n";
586
  }
587
  }
588
 
589
  if ( $unset_setcookie )
590
+ $headers_rules .= " Header unset Set-Cookie\n";
591
 
592
  if ( !$set_last_modified )
593
+ $headers_rules .= " Header unset Last-Modified\n";
594
 
595
  if ( $w3tc )
596
+ $headers_rules .= " Header set X-Powered-By \"" .
597
  Util_Environment::w3tc_header() . "\"\n";
598
 
599
  if ( strlen( $headers_rules ) > 0 ) {
BrowserCache_Environment_Nginx.php CHANGED
@@ -141,11 +141,9 @@ class BrowserCache_Environment_Nginx {
141
  }
142
  }
143
 
144
- foreach ( $mime_types as $type => $extensions ) {
145
- if ( $type != 'other_compression' ) {
146
- $this->generate_section( $rules, $extensions, $type );
147
- }
148
- }
149
 
150
  $rules .= implode( "\n", $this->security_rules() ) . "\n";
151
  $rules .= W3TC_MARKER_END_BROWSERCACHE_CACHE . "\n";
141
  }
142
  }
143
 
144
+ $this->generate_section( $rules, $mime_types['cssjs'], 'cssjs' );
145
+ $this->generate_section( $rules, $mime_types['html'], 'html' );
146
+ $this->generate_section( $rules, $mime_types['other'], 'other' );
 
 
147
 
148
  $rules .= implode( "\n", $this->security_rules() ) . "\n";
149
  $rules .= W3TC_MARKER_END_BROWSERCACHE_CACHE . "\n";
Cache_Redis.php CHANGED
@@ -269,6 +269,8 @@ class Cache_Redis extends Cache_Base {
269
  $accessor->watch( $storage_key );
270
 
271
  $value = $accessor->get( $storage_key );
 
 
272
  if ( !is_array( $value ) ) {
273
  $accessor->unwatch();
274
  return false;
269
  $accessor->watch( $storage_key );
270
 
271
  $value = $accessor->get( $storage_key );
272
+ $value = @unserialize( $value );
273
+
274
  if ( !is_array( $value ) ) {
275
  $accessor->unwatch();
276
  return false;
CdnEngine_Mirror_CloudFront.php CHANGED
@@ -80,7 +80,7 @@ class CdnEngine_Mirror_CloudFront extends CdnEngine_Mirror {
80
  }
81
 
82
  try {
83
- $invalidation = $this->api->createInvalidation( array(
84
  'DistributionId' => $dist['Id'],
85
  'InvalidationBatch' => array(
86
  'CallerReference' => 'w3tc-' . microtime(),
80
  }
81
 
82
  try {
83
+ $invalidation = $this->api->createInvalidationAsync( array(
84
  'DistributionId' => $dist['Id'],
85
  'InvalidationBatch' => array(
86
  'CallerReference' => 'w3tc-' . microtime(),
Cdn_Plugin.php CHANGED
@@ -235,7 +235,9 @@ class Cdn_Plugin {
235
 
236
  $cdn_engine = $this->_config->get_string( 'cdn.engine' );
237
  if ( Cdn_Util::is_engine_mirror( $cdn_engine ) ) {
238
- $common->purge( $files, $results );
 
 
239
  } else {
240
  $common->upload( $files, true, $results );
241
  }
235
 
236
  $cdn_engine = $this->_config->get_string( 'cdn.engine' );
237
  if ( Cdn_Util::is_engine_mirror( $cdn_engine ) ) {
238
+ if ($this->_config->get_boolean( 'cdn.uploads.enable' )) {
239
+ $common->purge( $files, $results );
240
+ }
241
  } else {
242
  $common->upload( $files, true, $results );
243
  }
ConfigKeys.php CHANGED
@@ -2323,10 +2323,7 @@ $keys = array(
2323
  )
2324
  ),
2325
 
2326
- 'robots_block.enable' => array(
2327
- 'type' => 'boolean',
2328
- 'default' => false
2329
- ),
2330
  'common.track_usage' => array(
2331
  'type' => 'boolean',
2332
  'default' => false
2323
  )
2324
  ),
2325
 
2326
+
 
 
 
2327
  'common.track_usage' => array(
2328
  'type' => 'boolean',
2329
  'default' => false
Extension_CloudFlare_Api.php CHANGED
@@ -143,25 +143,55 @@ class Extension_CloudFlare_Api {
143
  json_encode( array( 'value' => $value ) ) );
144
  }
145
 
 
 
 
146
 
 
 
 
 
147
 
148
- public function analytics_dashboard( $interval ) {
149
- return $this->_wp_remote_request( 'GET',
150
- self::$_root_uri . '/zones/' . $this->_zone_id .
151
- '/analytics/dashboard' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  }
153
 
154
-
155
-
156
-
157
  public function purge() {
158
  return $this->_wp_remote_request( 'DELETE',
159
  self::$_root_uri . '/zones/' . $this->_zone_id . '/purge_cache',
160
  '{"purge_everything":true}' );
161
  }
162
 
163
-
164
-
165
  private function _wp_remote_request( $method, $url, $body = array() ) {
166
  if ( empty( $this->_email ) || empty( $this->_key ) ) {
167
  throw new \Exception('Not authenticated');
@@ -189,8 +219,9 @@ class Extension_CloudFlare_Api {
189
  str_replace( '<', '.', str_replace( '>', '.', $result['body'] ) ) );
190
  }
191
 
192
- if ( !$response_json['success'] ) {
193
  $errors = array();
 
194
  if ( isset( $response_json['errors'] ) ) {
195
  foreach ( $response_json['errors'] as $e ) {
196
  if ( !empty( $e['message'] ) )
@@ -211,9 +242,11 @@ class Extension_CloudFlare_Api {
211
  return array();
212
  }
213
 
214
-
215
-
216
  private function _wp_remote_request_with_meta( $method, $url, $body = array() ) {
 
 
 
 
217
  $result = wp_remote_request( $url, array(
218
  'method' => $method,
219
  'headers' => array(
@@ -237,13 +270,13 @@ class Extension_CloudFlare_Api {
237
 
238
  if ( !$response_json['success'] ) {
239
  $errors = array();
 
240
  if ( isset( $response_json['errors'] ) ) {
241
  foreach ( $response_json['errors'] as $e ) {
242
- if ( !empty( $e['message'] ) )
243
- $errors[] = $e['message'];
244
  }
245
  }
246
-
247
  if ( empty( $errors ) )
248
  $errors[] = 'Request failed';
249
 
@@ -256,4 +289,54 @@ class Extension_CloudFlare_Api {
256
 
257
  return array();
258
  }
259
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  json_encode( array( 'value' => $value ) ) );
144
  }
145
 
146
+ public function analytics_dashboard( $start, $end, $type = 'day' ) {
147
+ $dataset = 'httpRequests1dGroups';
148
+ $datetime_filter = 'date';
149
 
150
+ if($type === 'hour') {
151
+ $dataset = 'httpRequests1hGroups';
152
+ $datetime_filter = 'datetime';
153
+ }
154
 
155
+ return $this->_wp_remote_request_graphql( 'POST',
156
+ self::$_root_uri . '/graphql',
157
+ "{ \"query\": \"query {
158
+ viewer {
159
+ zones(filter: {zoneTag: \\\"" . $this->_zone_id . "\\\"}) {
160
+ " . $dataset . "(
161
+ orderBy: [" . $datetime_filter . "_ASC],
162
+ limit: 100,
163
+ filter: {
164
+ " . $datetime_filter . "_geq: \\\"" . $start . "\\\",
165
+ " . $datetime_filter . "_lt: \\\"" . $end . "\\\"
166
+ }
167
+ ) {
168
+ dimensions {
169
+ " . $datetime_filter . "
170
+ }
171
+ sum {
172
+ bytes
173
+ cachedBytes
174
+ cachedRequests
175
+ pageViews
176
+ requests
177
+ threats
178
+ }
179
+ uniq {
180
+ uniques
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }\"}"
186
+ );
187
  }
188
 
 
 
 
189
  public function purge() {
190
  return $this->_wp_remote_request( 'DELETE',
191
  self::$_root_uri . '/zones/' . $this->_zone_id . '/purge_cache',
192
  '{"purge_everything":true}' );
193
  }
194
 
 
 
195
  private function _wp_remote_request( $method, $url, $body = array() ) {
196
  if ( empty( $this->_email ) || empty( $this->_key ) ) {
197
  throw new \Exception('Not authenticated');
219
  str_replace( '<', '.', str_replace( '>', '.', $result['body'] ) ) );
220
  }
221
 
222
+ if ( !isset( $response_json['success'] ) ) {
223
  $errors = array();
224
+
225
  if ( isset( $response_json['errors'] ) ) {
226
  foreach ( $response_json['errors'] as $e ) {
227
  if ( !empty( $e['message'] ) )
242
  return array();
243
  }
244
 
 
 
245
  private function _wp_remote_request_with_meta( $method, $url, $body = array() ) {
246
+ if ( empty( $this->_email ) || empty( $this->_key ) ) {
247
+ throw new \Exception('Not authenticated');
248
+ }
249
+
250
  $result = wp_remote_request( $url, array(
251
  'method' => $method,
252
  'headers' => array(
270
 
271
  if ( !$response_json['success'] ) {
272
  $errors = array();
273
+
274
  if ( isset( $response_json['errors'] ) ) {
275
  foreach ( $response_json['errors'] as $e ) {
276
+ if ( !empty( $e['message'] ) )
277
+ $errors[] = $e['message'];
278
  }
279
  }
 
280
  if ( empty( $errors ) )
281
  $errors[] = 'Request failed';
282
 
289
 
290
  return array();
291
  }
292
+
293
+ private function _wp_remote_request_graphql( $method, $url, $body ) {
294
+ if ( empty( $this->_email ) || empty( $this->_key ) ) {
295
+ throw new \Exception('Not authenticated');
296
+ }
297
+
298
+ $body = preg_replace( '/\s\s+/', ' ', $body );
299
+
300
+ $result = wp_remote_request( $url, array(
301
+ 'method' => $method,
302
+ 'headers' => array(
303
+ 'Content-Type' => 'application/json',
304
+ 'X-Auth-Key' => $this->_key,
305
+ 'X-Auth-Email' => $this->_email
306
+ ),
307
+ 'timeout' => $this->_timelimit_api_request,
308
+ 'body' => $body
309
+ ) );
310
+
311
+ if ( is_wp_error( $result ) ) {
312
+ throw new \Exception( 'Failed to reach API endpoint' );
313
+ }
314
+
315
+ $response_json = @json_decode( $result['body'], true );
316
+ if ( is_null( $response_json ) ) {
317
+ throw new \Exception(
318
+ 'Failed to reach API endpoint, got unexpected response ' .
319
+ str_replace( '<', '.', str_replace( '>', '.', $result['body'] ) ) );
320
+ }
321
+
322
+ if ( isset( $response_json['errors'] ) ) {
323
+ $errors = array();
324
+
325
+ foreach ( $response_json['errors'] as $e ) {
326
+ if ( !empty( $e['message'] ) )
327
+ $errors[] = $e['message'];
328
+ }
329
+
330
+ if ( empty( $errors ) )
331
+ $errors[] = 'Request failed';
332
+
333
+ throw new \Exception( implode( ', ', $errors ) );
334
+ }
335
+
336
+ if ( isset( $response_json['data'] ) ) {
337
+ return $response_json['data'];
338
+ }
339
+
340
+ return array();
341
+ }
342
+ }
Extension_CloudFlare_Widget.php CHANGED
@@ -18,24 +18,62 @@ class Extension_CloudFlare_Widget {
18
  'normal' );
19
  }
20
 
21
-
22
-
23
  function widget_form() {
24
  $api = Extension_CloudFlare_SettingsForUi::api();
25
  $c = Dispatcher::config();
26
  $interval = $c->get_integer( array( 'cloudflare', 'widget_interval' ) );
27
-
28
  $v = get_transient( 'w3tc_cloudflare_stats' );
29
-
30
  try {
31
  $key = 'dashboard-' . $interval;
32
  if ( !isset( $v[$key] ) ) {
33
  if ( !is_array( $v ) )
34
  $v = array();
35
 
36
- $v[$key] = $api->analytics_dashboard( $interval );
37
- set_transient( 'w3tc_cloudflare_stats', $v,
38
- $this->_cache_mins * 60 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
  $stats = $v[$key];
@@ -46,8 +84,6 @@ class Extension_CloudFlare_Widget {
46
  include W3TC_DIR . '/Extension_CloudFlare_Widget_View.php';
47
  }
48
 
49
-
50
-
51
  public function admin_print_styles_w3tc_dashboard() {
52
  wp_enqueue_style( 'w3tc-widget' );
53
  wp_enqueue_style( 'w3tc-cloudflare-widget',
@@ -55,50 +91,26 @@ class Extension_CloudFlare_Widget {
55
  array(), W3TC_VERSION );
56
  }
57
 
58
-
59
-
60
  public function admin_print_scripts_w3tc_dashboard() {
61
  wp_enqueue_script( 'w3tc-metadata' );
62
  wp_enqueue_script( 'w3tc-widget' );
63
  }
64
 
65
-
66
-
67
- private function v( $stats, $key1, $key2 ) {
68
  echo '<td class="cloudflare_td_value">';
69
- echo number_format( $this->value( $stats, 'totals', $key1, $key2 ) );
70
  echo "</td>\n";
71
  }
72
 
73
-
74
-
75
- private function value( $a, $k1, $k2, $k3 = null ) {
76
- $v = $a;
77
- if ( !is_null( $k1 ) )
78
- $v = isset( $v[$k1] ) ? $v[$k1] : null;
79
- if ( !is_null( $k2 ) )
80
- $v = isset( $v[$k2] ) ? $v[$k2] : null;
81
- if ( !is_null( $k3 ) )
82
- $v = isset( $v[$k3] ) ? $v[$k3] : null;
83
-
84
- return $v;
85
  }
86
 
87
-
88
-
89
- private function time( $a, $k1 ) {
90
- if ( !isset( $a['totals'][$k1] ) )
91
- return;
92
-
93
- echo date( 'm/d/Y H:i:s', strtotime( $a['totals'][$k1] ) );
94
  }
95
 
96
-
97
-
98
- private function time_mins( $a, $k1 ) {
99
- if ( !isset( $a['totals'][$k1] ) )
100
- return;
101
-
102
- echo date( 'm/d/Y H:i', strtotime( $a['totals'][$k1] ) );
103
  }
104
  }
18
  'normal' );
19
  }
20
 
 
 
21
  function widget_form() {
22
  $api = Extension_CloudFlare_SettingsForUi::api();
23
  $c = Dispatcher::config();
24
  $interval = $c->get_integer( array( 'cloudflare', 'widget_interval' ) );
 
25
  $v = get_transient( 'w3tc_cloudflare_stats' );
 
26
  try {
27
  $key = 'dashboard-' . $interval;
28
  if ( !isset( $v[$key] ) ) {
29
  if ( !is_array( $v ) )
30
  $v = array();
31
 
32
+ $type = 'day';
33
+ $dataset = 'httpRequests1dGroups';
34
+ $end = current_time( 'Y-m-d' );
35
+ $start = date( 'Y-m-d', strtotime( $end . ' ' . $interval . ' minutes' ) );
36
+
37
+ if( $interval >= -1440 ) {
38
+ $type = 'hour';
39
+ $dataset = 'httpRequests1hGroups';
40
+ $end = current_time( 'Y-m-d\TH:i:s' ) . 'Z';
41
+ $start = date( 'Y-m-d\TH:i:s', strtotime( $end . ' ' . $interval . ' minutes' ) ) . 'Z';
42
+ }
43
+
44
+ $stats = array(
45
+ "since" => $start,
46
+ "until" => $end,
47
+ "bandwidth_all" => 0,
48
+ "bandwidth_cached" => 0,
49
+ "requests_all" => 0,
50
+ "requests_cached" => 0,
51
+ "pageviews_all" => 0,
52
+ "uniques_all" => 0,
53
+ "threats_all" => 0,
54
+ "interval" => $interval,
55
+ "cached_ts" => current_time( 'Y-m-d H:i:s' ),
56
+ "cached_tf" => $c->get_integer( array( 'cloudflare', 'widget_cache_mins' ) )
57
+ );
58
+
59
+ $analytics_dashboard_data = $api->analytics_dashboard( $start, $end, $type );
60
+ foreach ( $analytics_dashboard_data["viewer"]["zones"][0][$dataset] as $data ) {
61
+ $stats["bandwidth_all"] += $data["sum"]["bytes"];
62
+ $stats["bandwidth_cached"] += $data["sum"]["cachedBytes"];
63
+ $stats["requests_all"] += $data["sum"]["requests"];
64
+ $stats["requests_cached"] += $data["sum"]["cachedRequests"];
65
+ $stats["pageviews_all"] += $data["sum"]["pageViews"];
66
+ $stats["uniques_all"] += $data["uniq"]["uniques"];
67
+ $stats["threats_all"] += $data["sum"]["threats"];
68
+ }
69
+
70
+ $v[$key] = $stats;
71
+
72
+ set_transient(
73
+ 'w3tc_cloudflare_stats',
74
+ $v,
75
+ $stats['cached_tf'] * 60
76
+ );
77
  }
78
 
79
  $stats = $v[$key];
84
  include W3TC_DIR . '/Extension_CloudFlare_Widget_View.php';
85
  }
86
 
 
 
87
  public function admin_print_styles_w3tc_dashboard() {
88
  wp_enqueue_style( 'w3tc-widget' );
89
  wp_enqueue_style( 'w3tc-cloudflare-widget',
91
  array(), W3TC_VERSION );
92
  }
93
 
 
 
94
  public function admin_print_scripts_w3tc_dashboard() {
95
  wp_enqueue_script( 'w3tc-metadata' );
96
  wp_enqueue_script( 'w3tc-widget' );
97
  }
98
 
99
+ private function value( $value ) {
 
 
100
  echo '<td class="cloudflare_td_value">';
101
+ echo number_format( $value );
102
  echo "</td>\n";
103
  }
104
 
105
+ private function date( $value ) {
106
+ echo date( 'n/j/Y', strtotime( $value ) );
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
+ private function date_time( $value ) {
110
+ echo date( 'n/j/Y g:i a', strtotime( $value ) );
 
 
 
 
 
111
  }
112
 
113
+ private function date_time_sec( $value ) {
114
+ echo date( 'n/j/Y g:i:s a', strtotime( $value ) );
 
 
 
 
 
115
  }
116
  }
Extension_CloudFlare_Widget_View.php CHANGED
@@ -11,9 +11,21 @@ if ( !defined( 'W3TC' ) )
11
 
12
  <p class="cloudflare_p">
13
  Period
14
- <?php $this->time_mins( $stats, 'since' ) ?>
 
 
 
 
 
 
15
  -
16
- <?php $this->time_mins( $stats, 'until' ) ?>
 
 
 
 
 
 
17
  </p>
18
  <table class="cloudflare_table">
19
  <tr>
@@ -23,26 +35,27 @@ if ( !defined( 'W3TC' ) )
23
  </tr>
24
  <tr>
25
  <td class="cloudflare_td">Bandwidth</td>
26
- <?php $this->v( $stats, 'bandwidth', 'all' ) ?>
27
- <?php $this->v( $stats, 'bandwidth', 'cached' ) ?>
28
  </tr>
29
  <tr>
30
  <td class="cloudflare_td">Requests</td>
31
- <?php $this->v( $stats, 'requests', 'all' ) ?>
32
- <?php $this->v( $stats, 'requests', 'cached' ) ?>
33
  </tr>
34
  <tr>
35
  <td class="cloudflare_td">Page Views</td>
36
- <?php $this->v( $stats, 'pageviews', 'all' ) ?>
37
  </tr>
38
  <tr>
39
  <td class="cloudflare_td">Uniques</td>
40
- <?php $this->v( $stats, 'uniques', 'all' ) ?>
41
  </tr>
42
  <tr>
43
  <td class="cloudflare_td">Threats</td>
44
- <?php $this->v( $stats, 'threats', 'all' ) ?>
45
  </tr>
46
  </table>
 
47
 
48
  <?php endif; ?>
11
 
12
  <p class="cloudflare_p">
13
  Period
14
+ <?php
15
+ if( $stats['interval'] >= -1440 ) {
16
+ echo $this->date_time( $stats['since'] );
17
+ } else {
18
+ echo $this->date( $stats['since'] );
19
+ }
20
+ ?>
21
  -
22
+ <?php
23
+ if( $stats['interval'] >= -1440 ) {
24
+ echo $this->date_time( $stats['until'] );
25
+ } else {
26
+ echo $this->date( $stats['until'] );
27
+ }
28
+ ?>
29
  </p>
30
  <table class="cloudflare_table">
31
  <tr>
35
  </tr>
36
  <tr>
37
  <td class="cloudflare_td">Bandwidth</td>
38
+ <?php $this->value( $stats['bandwidth_all'] ) ?>
39
+ <?php $this->value( $stats['bandwidth_cached'] ) ?>
40
  </tr>
41
  <tr>
42
  <td class="cloudflare_td">Requests</td>
43
+ <?php $this->value( $stats['requests_all'] ) ?>
44
+ <?php $this->value( $stats['requests_cached'] ) ?>
45
  </tr>
46
  <tr>
47
  <td class="cloudflare_td">Page Views</td>
48
+ <?php $this->value( $stats['pageviews_all'] ) ?>
49
  </tr>
50
  <tr>
51
  <td class="cloudflare_td">Uniques</td>
52
+ <?php $this->value( $stats['uniques_all'] ) ?>
53
  </tr>
54
  <tr>
55
  <td class="cloudflare_td">Threats</td>
56
+ <?php $this->value( $stats['threats_all'] ) ?>
57
  </tr>
58
  </table>
59
+ <p class="cloudflare_p"><small>Statistics cached for <?php $this->value( $stats['cached_tf'] ) ?> minutes on <?php $this->date_time( $stats['cached_ts'] ) ?></small></p>
60
 
61
  <?php endif; ?>
Generic_Environment.php CHANGED
@@ -4,6 +4,7 @@ namespace W3TC;
4
 
5
 
6
  class Generic_Environment {
 
7
  /**
8
  * Fixes environment
9
  *
@@ -16,14 +17,6 @@ class Generic_Environment {
16
  // create add-ins
17
  $this->create_required_files( $config, $exs );
18
 
19
- if ( Util_WpFile::file_exists( Util_Environment::site_path() . 'robots.txt' ) ) {
20
- if ( $config->get_boolean( 'robots_block.enable' ) ) {
21
- $this->robots_rules_add( $config, $exs );
22
- } else {
23
- $this->robots_rules_remove( $exs );
24
- }
25
- }
26
-
27
  // create folders
28
  $this->create_required_folders( $exs );
29
  $this->add_index_to_folders();
@@ -66,8 +59,6 @@ class Generic_Environment {
66
 
67
  $this->delete_required_files( $exs );
68
 
69
- $this->robots_rules_remove( $exs );
70
-
71
  if ( count( $exs->exceptions() ) > 0 )
72
  throw $exs;
73
  }
@@ -216,68 +207,4 @@ class Generic_Environment {
216
  return ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_ADVANCED_CACHE ) )
217
  && strstr( $script_data, 'PgCache_ContentGrabber' ) !== false );
218
  }
219
-
220
- /**
221
- * Write robots.txt directives to prevent crawl of cache directory.
222
- *
223
- * @since 2.1.7
224
- *
225
- * @param Config $config Configuration.
226
- * @param Util_Environment_Exceptions $exs Exceptions.
227
- *
228
- * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials.
229
- */
230
- private function robots_rules_add( $config, $exs ) {
231
- Util_Rule::add_rules(
232
- $exs,
233
- Util_Rule::get_robots_rules_path(),
234
- $this->robots_rules_generate(),
235
- W3TC_MARKER_BEGIN_ROBOTS,
236
- W3TC_MARKER_END_ROBOTS,
237
- array()
238
- );
239
- }
240
-
241
- /**
242
- * Generate robots.txt directives.
243
- *
244
- * @since 2.1.7
245
- *
246
- * @return string
247
- */
248
- public static function robots_rules_generate() {
249
- return '
250
- # BEGIN W3TC ROBOTS
251
- User-agent: *
252
- Disallow: /wp-content/cache/
253
- # END W3TC ROBOTS
254
- ';
255
- }
256
-
257
- /**
258
- * Removes robots.txt directives.
259
- *
260
- * @since 2.1.7
261
- *
262
- * @param Util_Environment_Exceptions $exs Exceptions.
263
- *
264
- * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials.
265
- */
266
- private function robots_rules_remove( $exs ) {
267
- $robots_path = Util_Environment::site_path() . 'robots.txt';
268
-
269
- Util_Rule::remove_rules(
270
- $exs,
271
- $robots_path,
272
- W3TC_MARKER_BEGIN_ROBOTS,
273
- W3TC_MARKER_END_ROBOTS
274
- );
275
-
276
- WP_Filesystem();
277
- global $wp_filesystem;
278
-
279
- if ( empty( trim( $wp_filesystem->get_contents( $robots_path ) ) ) ) {
280
- Util_WpFile::delete_file( $robots_path );
281
- }
282
- }
283
  }
4
 
5
 
6
  class Generic_Environment {
7
+
8
  /**
9
  * Fixes environment
10
  *
17
  // create add-ins
18
  $this->create_required_files( $config, $exs );
19
 
 
 
 
 
 
 
 
 
20
  // create folders
21
  $this->create_required_folders( $exs );
22
  $this->add_index_to_folders();
59
 
60
  $this->delete_required_files( $exs );
61
 
 
 
62
  if ( count( $exs->exceptions() ) > 0 )
63
  throw $exs;
64
  }
207
  return ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_ADVANCED_CACHE ) )
208
  && strstr( $script_data, 'PgCache_ContentGrabber' ) !== false );
209
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
Generic_Plugin.php CHANGED
@@ -84,14 +84,6 @@ class Generic_Plugin {
84
  'ob_callback'
85
  ) );
86
  }
87
-
88
- /*
89
- * @link https://developer.wordpress.org/reference/hooks/robots_txt/
90
- * if robots_block is enabled modify robots.txt
91
- */
92
- if ( $this->_config->get_boolean( 'robots_block.enable' ) && !Util_WpFile::file_exists( Util_Environment::site_path() . 'robots.txt' ) ) {
93
- add_filter( 'robots_txt', array( $this, 'robots_rules_generate' ) );
94
- }
95
  }
96
 
97
  /**
@@ -221,6 +213,7 @@ class Generic_Plugin {
221
  add_action( 'wp_print_scripts', array( $this, 'popup_script' ) );
222
  }
223
 
 
224
  // dont add system stuff to search results
225
  if ( ( isset( $_GET['repeat'] ) && $_GET['repeat'] == 'w3tc' ) ||
226
  Util_Environment::is_preview_mode() ) {
@@ -653,13 +646,16 @@ class Generic_Plugin {
653
  }
654
 
655
  function popup_script() {
656
- ?>
 
 
 
657
  <script type="text/javascript">
658
  function w3tc_popupadmin_bar(url) {
659
  return window.open(url, '', 'width=800,height=600,status=no,toolbar=no,menubar=no,scrollbars=yes');
660
  }
661
  </script>
662
- <?php
663
  }
664
 
665
  private function is_debugging() {
@@ -676,9 +672,4 @@ class Generic_Plugin {
676
  public function pro_dev_mode() {
677
  echo '<!-- W3 Total Cache is currently running in Pro version Development mode. --><div style="border:2px solid red;text-align:center;font-size:1.2em;color:red"><p><strong>W3 Total Cache is currently running in Pro version Development mode.</strong></p></div>';
678
  }
679
-
680
- public function robots_rules_generate( $content ) {
681
- $content .= Generic_Environment::robots_rules_generate();
682
- return $content;
683
- }
684
  }
84
  'ob_callback'
85
  ) );
86
  }
 
 
 
 
 
 
 
 
87
  }
88
 
89
  /**
213
  add_action( 'wp_print_scripts', array( $this, 'popup_script' ) );
214
  }
215
 
216
+
217
  // dont add system stuff to search results
218
  if ( ( isset( $_GET['repeat'] ) && $_GET['repeat'] == 'w3tc' ) ||
219
  Util_Environment::is_preview_mode() ) {
646
  }
647
 
648
  function popup_script() {
649
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
650
+ return;
651
+ }
652
+ ?>
653
  <script type="text/javascript">
654
  function w3tc_popupadmin_bar(url) {
655
  return window.open(url, '', 'width=800,height=600,status=no,toolbar=no,menubar=no,scrollbars=yes');
656
  }
657
  </script>
658
+ <?php
659
  }
660
 
661
  private function is_debugging() {
672
  public function pro_dev_mode() {
673
  echo '<!-- W3 Total Cache is currently running in Pro version Development mode. --><div style="border:2px solid red;text-align:center;font-size:1.2em;color:red"><p><strong>W3 Total Cache is currently running in Pro version Development mode.</strong></p></div>';
674
  }
 
 
 
 
 
675
  }
PgCache_ContentGrabber.php CHANGED
@@ -1492,7 +1492,7 @@ class PgCache_ContentGrabber {
1492
  $content_type = isset( $page_key_extension['content_type'] ) ?
1493
  $page_key_extension['content_type'] : '';
1494
 
1495
- if ( @preg_match( "~(text/xml|text/xsl|application/rdf\+xml|application/rss\+xml|application/atom\+xml)~i", $content_type ) ||
1496
  preg_match( W3TC_FEED_REGEXP, $request_url_fragments['path'] ) ||
1497
  strpos( $request_url_fragments['path'], ".xsl" ) !== false ) {
1498
  $key_postfix = '.xml';
@@ -1963,7 +1963,8 @@ class PgCache_ContentGrabber {
1963
  '' /* redirects, they have only Location header set */,
1964
  'application/json', 'text/html', 'text/xml', 'text/xsl',
1965
  'application/xhtml+xml', 'application/rss+xml',
1966
- 'application/atom+xml', 'application/rdf+xml'
 
1967
  )
1968
  );
1969
  return in_array( $content_type, $cache_headers );
@@ -2077,8 +2078,14 @@ class PgCache_ContentGrabber {
2077
  $compression_of_returned_content =
2078
  ( $has_dynamic ? false : $compression_header );
2079
 
2080
- $is_404 = ( function_exists( 'is_404' ) ? is_404() : false );
2081
  $headers = $this->_get_cached_headers( $response_headers['plain'] );
 
 
 
 
 
 
 
2082
 
2083
  if ( $this->_enhanced_mode ) {
2084
  // redirect issued, if we have some old cache entries
1492
  $content_type = isset( $page_key_extension['content_type'] ) ?
1493
  $page_key_extension['content_type'] : '';
1494
 
1495
+ if ( @preg_match( "~(text/xml|text/xsl|application/xhtml\+xml|application/rdf\+xml|application/rss\+xml|application/atom\+xml|application/xml)~i", $content_type ) ||
1496
  preg_match( W3TC_FEED_REGEXP, $request_url_fragments['path'] ) ||
1497
  strpos( $request_url_fragments['path'], ".xsl" ) !== false ) {
1498
  $key_postfix = '.xml';
1963
  '' /* redirects, they have only Location header set */,
1964
  'application/json', 'text/html', 'text/xml', 'text/xsl',
1965
  'application/xhtml+xml', 'application/rss+xml',
1966
+ 'application/atom+xml', 'application/rdf+xml',
1967
+ 'application/xml'
1968
  )
1969
  );
1970
  return in_array( $content_type, $cache_headers );
2078
  $compression_of_returned_content =
2079
  ( $has_dynamic ? false : $compression_header );
2080
 
 
2081
  $headers = $this->_get_cached_headers( $response_headers['plain'] );
2082
+ if ( !empty( $headers['Status-Code'] ) ) {
2083
+ $is_404 = ( $headers['Status-Code'] == 404 );
2084
+ } elseif ( function_exists( 'is_404' ) ) {
2085
+ $is_404 = is_404();
2086
+ } else {
2087
+ $is_404 = false;
2088
+ }
2089
 
2090
  if ( $this->_enhanced_mode ) {
2091
  // redirect issued, if we have some old cache entries
PgCache_Flush.php CHANGED
@@ -76,6 +76,7 @@ class PgCache_Flush extends PgCache_ContentGrabber {
76
  // calculate urls to purge
77
  $full_urls = array();
78
  $post = get_post( $post_id );
 
79
  $terms = array();
80
 
81
  $feeds = $this->_config->get_array( 'pgcache.purge.feed.types' );
@@ -102,13 +103,23 @@ class PgCache_Flush extends PgCache_ContentGrabber {
102
  Util_PageUrls::get_frontpage_urls( $limit_post_pages ) );
103
  }
104
 
 
105
  // Home (Post page) URL
106
  if ( $this->_config->get_boolean( 'pgcache.purge.home' ) &&
107
- $front_page != 'posts' ) {
 
108
  $full_urls = array_merge( $full_urls,
109
  Util_PageUrls::get_postpage_urls( $limit_post_pages ) );
110
  }
111
 
 
 
 
 
 
 
 
 
112
  // Post URL
113
  if ( $this->_config->get_boolean( 'pgcache.purge.post' ) ) {
114
  $full_urls = array_merge( $full_urls,
@@ -153,12 +164,20 @@ class PgCache_Flush extends PgCache_ContentGrabber {
153
  Util_PageUrls::get_yearly_archive_urls( $post, $limit_post_pages ) );
154
  }
155
 
156
- // Feed URLs
157
- if ( $this->_config->get_boolean( 'pgcache.purge.feed.blog' ) ) {
 
158
  $full_urls = array_merge( $full_urls,
159
  Util_PageUrls::get_feed_urls( $feeds, null ) );
160
  }
161
 
 
 
 
 
 
 
 
162
  if ( $this->_config->get_boolean( 'pgcache.purge.feed.comments' ) ) {
163
  $full_urls = array_merge( $full_urls,
164
  Util_PageUrls::get_feed_comments_urls( $post_id, $feeds ) );
76
  // calculate urls to purge
77
  $full_urls = array();
78
  $post = get_post( $post_id );
79
+ $is_cpt = Util_Environment::is_custom_post_type( $post );
80
  $terms = array();
81
 
82
  $feeds = $this->_config->get_array( 'pgcache.purge.feed.types' );
103
  Util_PageUrls::get_frontpage_urls( $limit_post_pages ) );
104
  }
105
 
106
+ // pgcache.purge.home becomes "Posts page" option in settings if home page and blog are set to page(s)
107
  // Home (Post page) URL
108
  if ( $this->_config->get_boolean( 'pgcache.purge.home' ) &&
109
+ $front_page != 'posts' &&
110
+ !$is_cpt ) {
111
  $full_urls = array_merge( $full_urls,
112
  Util_PageUrls::get_postpage_urls( $limit_post_pages ) );
113
  }
114
 
115
+ // pgcache.purge.home becomes "Posts page" option in settings if home page and blog are set to page(s)
116
+ // Custom Post Type Archive URL
117
+ if ( $this->_config->get_boolean( 'pgcache.purge.home' ) &&
118
+ $is_cpt ) {
119
+ $full_urls = array_merge( $full_urls,
120
+ Util_PageUrls::get_cpt_archive_urls( $post_id, $limit_post_pages ) );
121
+ }
122
+
123
  // Post URL
124
  if ( $this->_config->get_boolean( 'pgcache.purge.post' ) ) {
125
  $full_urls = array_merge( $full_urls,
164
  Util_PageUrls::get_yearly_archive_urls( $post, $limit_post_pages ) );
165
  }
166
 
167
+ // Feed URLs for posts
168
+ if ( $this->_config->get_boolean( 'pgcache.purge.feed.blog' ) &&
169
+ !$is_cpt ) {
170
  $full_urls = array_merge( $full_urls,
171
  Util_PageUrls::get_feed_urls( $feeds, null ) );
172
  }
173
 
174
+ // Feed URLs for posts
175
+ if ( $this->_config->get_boolean( 'pgcache.purge.feed.blog' ) &&
176
+ $is_cpt ) {
177
+ $full_urls = array_merge( $full_urls,
178
+ Util_PageUrls::get_feed_urls( $feeds, $post->post_type ) );
179
+ }
180
+
181
  if ( $this->_config->get_boolean( 'pgcache.purge.feed.comments' ) ) {
182
  $full_urls = array_merge( $full_urls,
183
  Util_PageUrls::get_feed_comments_urls( $post_id, $feeds ) );
SystemOpCache_GeneralPage_View.php CHANGED
@@ -30,7 +30,6 @@ Util_Ui::config_item( array(
30
  ),
31
  ) );
32
 
33
- $validate_timestamps = '';
34
  Util_Ui::config_item( array(
35
  'key' => 'opcache.validate_timestamps',
36
  'label' => 'Validate timestamps:',
30
  ),
31
  ) );
32
 
 
33
  Util_Ui::config_item( array(
34
  'key' => 'opcache.validate_timestamps',
35
  'label' => 'Validate timestamps:',
UsageStatistics_StorageWriter.php CHANGED
@@ -50,7 +50,8 @@ class UsageStatistics_StorageWriter {
50
 
51
  public function reset() {
52
  if ( !is_null( $this->cache_storage ) ) {
53
- $this->cache_storage->set( 'hotspot_endtime', 0 );
 
54
  }
55
 
56
  update_site_option( 'w3tc_stats_hotspot_start', time() );
@@ -99,7 +100,7 @@ class UsageStatistics_StorageWriter {
99
  /**
100
  * Returns if finish_* should be called.
101
  * It tries to pass as litte processes as possible to
102
- * flushing_begain if multiple processes come here
103
  * at the same time when hotspot time ended.
104
  */
105
  public function begin_flush_hotspot_data() {
50
 
51
  public function reset() {
52
  if ( !is_null( $this->cache_storage ) ) {
53
+ $this->cache_storage->set( 'hotspot_endtime',
54
+ array( 'content' => 0 ) );
55
  }
56
 
57
  update_site_option( 'w3tc_stats_hotspot_start', time() );
100
  /**
101
  * Returns if finish_* should be called.
102
  * It tries to pass as litte processes as possible to
103
+ * flushing_begin if multiple processes come here
104
  * at the same time when hotspot time ended.
105
  */
106
  public function begin_flush_hotspot_data() {
Util_Environment.php CHANGED
@@ -1208,6 +1208,31 @@ class Util_Environment {
1208
 
1209
 
1210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1211
  /**
1212
  * Converts value to boolean
1213
  *
@@ -1246,7 +1271,7 @@ class Util_Environment {
1246
  * @return string
1247
  */
1248
  static public function get_server_version() {
1249
- $sig= explode( '/', $_SERVER['SERVER_SOFTWARE'] );
1250
  $temp = isset( $sig[1] ) ? explode( ' ', $sig[1] ) : array( '0' );
1251
  $version = $temp[0];
1252
  return $version;
1208
 
1209
 
1210
 
1211
+ /**
1212
+ * Checks if post belongs to a custom post type
1213
+ *
1214
+ * @since 2.1.7
1215
+ *
1216
+ * @param unknown $post
1217
+ *
1218
+ * @return bool
1219
+ */
1220
+ static public function is_custom_post_type( $post ) {
1221
+ $post_type = get_post_type_object( $post->post_type );
1222
+
1223
+ // post type not found belongs to default post type(s)
1224
+ if ( empty ( $post_type ) )
1225
+ return false;
1226
+
1227
+ // check if custom
1228
+ if ( $post_type->_builtin === false )
1229
+ return true;
1230
+
1231
+ return false;
1232
+ }
1233
+
1234
+
1235
+
1236
  /**
1237
  * Converts value to boolean
1238
  *
1271
  * @return string
1272
  */
1273
  static public function get_server_version() {
1274
+ $sig = explode( '/', $_SERVER['SERVER_SOFTWARE'] );
1275
  $temp = isset( $sig[1] ) ? explode( ' ', $sig[1] ) : array( '0' );
1276
  $version = $temp[0];
1277
  return $version;
Util_PageUrls.php CHANGED
@@ -24,7 +24,7 @@ class Util_PageUrls {
24
  }
25
 
26
  $full_urls = array_merge( $full_urls,
27
- self::get_older_pages( $home_path, $limit_post_pages ) );
28
  $frontpage_urls[$limit_post_pages] = $full_urls;
29
  }
30
  return $frontpage_urls[$limit_post_pages];
@@ -42,6 +42,7 @@ class Util_PageUrls {
42
  if ( !isset( $postpage_urls[$limit_post_pages] ) ) {
43
  $posts_page_uri = '';
44
  $full_urls = array();
 
45
  $posts_page_id = get_option( 'page_for_posts' );
46
  if ( $posts_page_id ) {
47
  $posts_page_uri = get_page_uri( $posts_page_id );
@@ -49,22 +50,54 @@ class Util_PageUrls {
49
  $full_urls[] = $page_link;
50
  }
51
  if ( $posts_page_uri )
52
- $full_urls = array_merge( $full_urls, self::get_older_pages( $posts_page_uri, $limit_post_pages ) );
53
  $postpage_urls[$limit_post_pages] = $full_urls;
54
  }
 
55
  return $postpage_urls[$limit_post_pages];
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  /**
59
  * Return older pages listing posts
60
  *
61
  * @param unknown $posts_page_uri
62
  * @param int $limit_post_pages default is 10
 
63
  * @return array
64
  */
65
- static private function get_older_pages( $posts_page_uri, $limit_post_pages = 10 ) {
66
  $full_urls = array();
67
- $count_posts = wp_count_posts();
68
  $posts_number = $count_posts->publish;
69
  $posts_per_page = get_option( 'posts_per_page' );
70
  $posts_pages_number = @ceil( $posts_number / $posts_per_page );
@@ -109,6 +142,7 @@ class Util_PageUrls {
109
  $full_urls[] = $post_pagenum_link;
110
  }
111
  }
 
112
  $post_urls[$post_id] = $full_urls;
113
  }
114
  return $post_urls[$post_id];
24
  }
25
 
26
  $full_urls = array_merge( $full_urls,
27
+ self::get_older_pages( $home_path, $limit_post_pages, 'post' ) );
28
  $frontpage_urls[$limit_post_pages] = $full_urls;
29
  }
30
  return $frontpage_urls[$limit_post_pages];
42
  if ( !isset( $postpage_urls[$limit_post_pages] ) ) {
43
  $posts_page_uri = '';
44
  $full_urls = array();
45
+
46
  $posts_page_id = get_option( 'page_for_posts' );
47
  if ( $posts_page_id ) {
48
  $posts_page_uri = get_page_uri( $posts_page_id );
50
  $full_urls[] = $page_link;
51
  }
52
  if ( $posts_page_uri )
53
+ $full_urls = array_merge( $full_urls, self::get_older_pages( $posts_page_uri, $limit_post_pages, 'post' ) );
54
  $postpage_urls[$limit_post_pages] = $full_urls;
55
  }
56
+
57
  return $postpage_urls[$limit_post_pages];
58
  }
59
 
60
+ /**
61
+ * Returns all urls related to a custom post type post
62
+ *
63
+ * @since 2.1.7
64
+ *
65
+ * @param unknown $post_id
66
+ * @param int $limit_post_pages default is 10
67
+ * @return array
68
+ */
69
+ static public function get_cpt_archive_urls( $post_id, $limit_post_pages = 10 ) {
70
+ static $cpt_archive_urls = array();
71
+ $post = get_post( $post_id );
72
+
73
+ if( $post && Util_Environment::is_custom_post_type( $post ) && !isset( $cpt_archive_urls[$limit_post_pages] ) ) {
74
+ $full_urls = array();
75
+ $post_type = $post->post_type;
76
+ $archive_link = get_post_type_archive_link($post_type);
77
+ $posts_page_uri = str_replace( home_url(), '', $archive_link );
78
+
79
+ if ( $posts_page_uri ) {
80
+ $full_urls[] = $archive_link;
81
+ $full_urls = array_merge( $full_urls, self::get_older_pages( $posts_page_uri, $limit_post_pages, $post_type ) );
82
+ }
83
+
84
+ $cpt_archive_urls[$limit_post_pages] = $full_urls;
85
+ }
86
+
87
+ return $cpt_archive_urls[$limit_post_pages];
88
+ }
89
+
90
  /**
91
  * Return older pages listing posts
92
  *
93
  * @param unknown $posts_page_uri
94
  * @param int $limit_post_pages default is 10
95
+ * @param string $post_type default is post
96
  * @return array
97
  */
98
+ static private function get_older_pages( $posts_page_uri, $limit_post_pages = 10, $post_type = 'post' ) {
99
  $full_urls = array();
100
+ $count_posts = wp_count_posts($post_type);
101
  $posts_number = $count_posts->publish;
102
  $posts_per_page = get_option( 'posts_per_page' );
103
  $posts_pages_number = @ceil( $posts_number / $posts_per_page );
142
  $full_urls[] = $post_pagenum_link;
143
  }
144
  }
145
+
146
  $post_urls[$post_id] = $full_urls;
147
  }
148
  return $post_urls[$post_id];
Util_Rule.php CHANGED
@@ -135,28 +135,12 @@ class Util_Rule {
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
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 true if we can modify rules
 
 
 
 
 
 
 
 
 
 
 
144
  *
145
  * @param string $path
146
  * @return boolean
Util_WpFile.php CHANGED
@@ -226,28 +226,6 @@ class Util_WpFile {
226
  }
227
  }
228
 
229
- /**
230
- * Checks if file exists
231
- *
232
- * @since 2.1.8
233
- *
234
- * @param string $filename path to file
235
- * @throws Util_WpFile_FilesystemOperationException
236
- * @return boolean
237
- */
238
- static public function file_exists( $filename ) {
239
- try {
240
- self::request_filesystem_credentials();
241
- } catch ( Util_WpFile_FilesystemOperationException $ex ) {
242
- throw new Util_WpFile_FilesystemOperationException( $ex->getMessage(),
243
- $ex->credentials_form() );
244
- }
245
-
246
- global $wp_filesystem;
247
-
248
- return $wp_filesystem->exists( $filename );
249
- }
250
-
251
  /**
252
  * Get WordPress filesystems credentials. Required for WP filesystem usage.
253
  *
226
  }
227
  }
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  /**
230
  * Get WordPress filesystems credentials. Required for WP filesystem usage.
231
  *
composer.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "require": {
3
- "aws/aws-sdk-php": "^3.180",
4
- "guzzlehttp/guzzle": "6.*",
5
- "symfony/polyfill-intl-idn" : "1.20.*",
6
- "symfony/polyfill-intl-normalizer" : "1.20.*",
7
- "symfony/polyfill-mbstring" : "1.20.*"
8
- },
9
- "replace": {
10
- "symfony/polyfill-php56": "*",
11
- "symfony/polyfill-php70": "*",
12
- "symfony/polyfill-php71": "*",
13
- "symfony/polyfill-php72": "*",
14
- "symfony/polyfill-php73": "*",
15
- "symfony/polyfill-php74": "*",
16
- "symfony/polyfill-mbstring": "*"
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
composer.lock DELETED
@@ -1,605 +0,0 @@
1
- {
2
- "_readme": [
3
- "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
- "This file is @generated automatically"
6
- ],
7
- "content-hash": "d855034b6d59c71406bb056a1a3b487c",
8
- "packages": [
9
- {
10
- "name": "aws/aws-sdk-php",
11
- "version": "3.183.8",
12
- "source": {
13
- "type": "git",
14
- "url": "https://github.com/aws/aws-sdk-php.git",
15
- "reference": "3b52c4a99faa539c5bdc0a84cf88ee6ea385fd1c"
16
- },
17
- "dist": {
18
- "type": "zip",
19
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/3b52c4a99faa539c5bdc0a84cf88ee6ea385fd1c",
20
- "reference": "3b52c4a99faa539c5bdc0a84cf88ee6ea385fd1c",
21
- "shasum": ""
22
- },
23
- "require": {
24
- "ext-json": "*",
25
- "ext-pcre": "*",
26
- "ext-simplexml": "*",
27
- "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0",
28
- "guzzlehttp/promises": "^1.4.0",
29
- "guzzlehttp/psr7": "^1.7.0",
30
- "mtdowling/jmespath.php": "^2.6",
31
- "php": ">=5.5"
32
- },
33
- "require-dev": {
34
- "andrewsville/php-token-reflection": "^1.4",
35
- "aws/aws-php-sns-message-validator": "~1.0",
36
- "behat/behat": "~3.0",
37
- "doctrine/cache": "~1.4",
38
- "ext-dom": "*",
39
- "ext-openssl": "*",
40
- "ext-pcntl": "*",
41
- "ext-sockets": "*",
42
- "nette/neon": "^2.3",
43
- "paragonie/random_compat": ">= 2",
44
- "phpunit/phpunit": "^4.8.35|^5.4.3",
45
- "psr/cache": "^1.0",
46
- "psr/simple-cache": "^1.0",
47
- "sebastian/comparator": "^1.2.3"
48
- },
49
- "suggest": {
50
- "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
51
- "doctrine/cache": "To use the DoctrineCacheAdapter",
52
- "ext-curl": "To send requests using cURL",
53
- "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
54
- "ext-sockets": "To use client-side monitoring"
55
- },
56
- "type": "library",
57
- "extra": {
58
- "branch-alias": {
59
- "dev-master": "3.0-dev"
60
- }
61
- },
62
- "autoload": {
63
- "psr-4": {
64
- "Aws\\": "src/"
65
- },
66
- "files": [
67
- "src/functions.php"
68
- ]
69
- },
70
- "notification-url": "https://packagist.org/downloads/",
71
- "license": [
72
- "Apache-2.0"
73
- ],
74
- "authors": [
75
- {
76
- "name": "Amazon Web Services",
77
- "homepage": "http://aws.amazon.com"
78
- }
79
- ],
80
- "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
81
- "homepage": "http://aws.amazon.com/sdkforphp",
82
- "keywords": [
83
- "amazon",
84
- "aws",
85
- "cloud",
86
- "dynamodb",
87
- "ec2",
88
- "glacier",
89
- "s3",
90
- "sdk"
91
- ],
92
- "time": "2021-05-27T18:13:28+00:00"
93
- },
94
- {
95
- "name": "guzzlehttp/guzzle",
96
- "version": "6.5.5",
97
- "source": {
98
- "type": "git",
99
- "url": "https://github.com/guzzle/guzzle.git",
100
- "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
101
- },
102
- "dist": {
103
- "type": "zip",
104
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
105
- "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
106
- "shasum": ""
107
- },
108
- "require": {
109
- "ext-json": "*",
110
- "guzzlehttp/promises": "^1.0",
111
- "guzzlehttp/psr7": "^1.6.1",
112
- "php": ">=5.5",
113
- "symfony/polyfill-intl-idn": "^1.17.0"
114
- },
115
- "require-dev": {
116
- "ext-curl": "*",
117
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
118
- "psr/log": "^1.1"
119
- },
120
- "suggest": {
121
- "psr/log": "Required for using the Log middleware"
122
- },
123
- "type": "library",
124
- "extra": {
125
- "branch-alias": {
126
- "dev-master": "6.5-dev"
127
- }
128
- },
129
- "autoload": {
130
- "psr-4": {
131
- "GuzzleHttp\\": "src/"
132
- },
133
- "files": [
134
- "src/functions_include.php"
135
- ]
136
- },
137
- "notification-url": "https://packagist.org/downloads/",
138
- "license": [
139
- "MIT"
140
- ],
141
- "authors": [
142
- {
143
- "name": "Michael Dowling",
144
- "email": "mtdowling@gmail.com",
145
- "homepage": "https://github.com/mtdowling"
146
- }
147
- ],
148
- "description": "Guzzle is a PHP HTTP client library",
149
- "homepage": "http://guzzlephp.org/",
150
- "keywords": [
151
- "client",
152
- "curl",
153
- "framework",
154
- "http",
155
- "http client",
156
- "rest",
157
- "web service"
158
- ],
159
- "time": "2020-06-16T21:01:06+00:00"
160
- },
161
- {
162
- "name": "guzzlehttp/promises",
163
- "version": "1.4.1",
164
- "source": {
165
- "type": "git",
166
- "url": "https://github.com/guzzle/promises.git",
167
- "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
168
- },
169
- "dist": {
170
- "type": "zip",
171
- "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
172
- "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
173
- "shasum": ""
174
- },
175
- "require": {
176
- "php": ">=5.5"
177
- },
178
- "require-dev": {
179
- "symfony/phpunit-bridge": "^4.4 || ^5.1"
180
- },
181
- "type": "library",
182
- "extra": {
183
- "branch-alias": {
184
- "dev-master": "1.4-dev"
185
- }
186
- },
187
- "autoload": {
188
- "psr-4": {
189
- "GuzzleHttp\\Promise\\": "src/"
190
- },
191
- "files": [
192
- "src/functions_include.php"
193
- ]
194
- },
195
- "notification-url": "https://packagist.org/downloads/",
196
- "license": [
197
- "MIT"
198
- ],
199
- "authors": [
200
- {
201
- "name": "Michael Dowling",
202
- "email": "mtdowling@gmail.com",
203
- "homepage": "https://github.com/mtdowling"
204
- }
205
- ],
206
- "description": "Guzzle promises library",
207
- "keywords": [
208
- "promise"
209
- ],
210
- "time": "2021-03-07T09:25:29+00:00"
211
- },
212
- {
213
- "name": "guzzlehttp/psr7",
214
- "version": "1.8.2",
215
- "source": {
216
- "type": "git",
217
- "url": "https://github.com/guzzle/psr7.git",
218
- "reference": "dc960a912984efb74d0a90222870c72c87f10c91"
219
- },
220
- "dist": {
221
- "type": "zip",
222
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
223
- "reference": "dc960a912984efb74d0a90222870c72c87f10c91",
224
- "shasum": ""
225
- },
226
- "require": {
227
- "php": ">=5.4.0",
228
- "psr/http-message": "~1.0",
229
- "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
230
- },
231
- "provide": {
232
- "psr/http-message-implementation": "1.0"
233
- },
234
- "require-dev": {
235
- "ext-zlib": "*",
236
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
237
- },
238
- "suggest": {
239
- "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
240
- },
241
- "type": "library",
242
- "extra": {
243
- "branch-alias": {
244
- "dev-master": "1.7-dev"
245
- }
246
- },
247
- "autoload": {
248
- "psr-4": {
249
- "GuzzleHttp\\Psr7\\": "src/"
250
- },
251
- "files": [
252
- "src/functions_include.php"
253
- ]
254
- },
255
- "notification-url": "https://packagist.org/downloads/",
256
- "license": [
257
- "MIT"
258
- ],
259
- "authors": [
260
- {
261
- "name": "Michael Dowling",
262
- "email": "mtdowling@gmail.com",
263
- "homepage": "https://github.com/mtdowling"
264
- },
265
- {
266
- "name": "Tobias Schultze",
267
- "homepage": "https://github.com/Tobion"
268
- }
269
- ],
270
- "description": "PSR-7 message implementation that also provides common utility methods",
271
- "keywords": [
272
- "http",
273
- "message",
274
- "psr-7",
275
- "request",
276
- "response",
277
- "stream",
278
- "uri",
279
- "url"
280
- ],
281
- "time": "2021-04-26T09:17:50+00:00"
282
- },
283
- {
284
- "name": "mtdowling/jmespath.php",
285
- "version": "2.6.0",
286
- "source": {
287
- "type": "git",
288
- "url": "https://github.com/jmespath/jmespath.php.git",
289
- "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
290
- },
291
- "dist": {
292
- "type": "zip",
293
- "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
294
- "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
295
- "shasum": ""
296
- },
297
- "require": {
298
- "php": "^5.4 || ^7.0 || ^8.0",
299
- "symfony/polyfill-mbstring": "^1.17"
300
- },
301
- "require-dev": {
302
- "composer/xdebug-handler": "^1.4",
303
- "phpunit/phpunit": "^4.8.36 || ^7.5.15"
304
- },
305
- "bin": [
306
- "bin/jp.php"
307
- ],
308
- "type": "library",
309
- "extra": {
310
- "branch-alias": {
311
- "dev-master": "2.6-dev"
312
- }
313
- },
314
- "autoload": {
315
- "psr-4": {
316
- "JmesPath\\": "src/"
317
- },
318
- "files": [
319
- "src/JmesPath.php"
320
- ]
321
- },
322
- "notification-url": "https://packagist.org/downloads/",
323
- "license": [
324
- "MIT"
325
- ],
326
- "authors": [
327
- {
328
- "name": "Michael Dowling",
329
- "email": "mtdowling@gmail.com",
330
- "homepage": "https://github.com/mtdowling"
331
- }
332
- ],
333
- "description": "Declaratively specify how to extract elements from a JSON document",
334
- "keywords": [
335
- "json",
336
- "jsonpath"
337
- ],
338
- "time": "2020-07-31T21:01:56+00:00"
339
- },
340
- {
341
- "name": "psr/http-message",
342
- "version": "1.0.1",
343
- "source": {
344
- "type": "git",
345
- "url": "https://github.com/php-fig/http-message.git",
346
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
347
- },
348
- "dist": {
349
- "type": "zip",
350
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
351
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
352
- "shasum": ""
353
- },
354
- "require": {
355
- "php": ">=5.3.0"
356
- },
357
- "type": "library",
358
- "extra": {
359
- "branch-alias": {
360
- "dev-master": "1.0.x-dev"
361
- }
362
- },
363
- "autoload": {
364
- "psr-4": {
365
- "Psr\\Http\\Message\\": "src/"
366
- }
367
- },
368
- "notification-url": "https://packagist.org/downloads/",
369
- "license": [
370
- "MIT"
371
- ],
372
- "authors": [
373
- {
374
- "name": "PHP-FIG",
375
- "homepage": "http://www.php-fig.org/"
376
- }
377
- ],
378
- "description": "Common interface for HTTP messages",
379
- "homepage": "https://github.com/php-fig/http-message",
380
- "keywords": [
381
- "http",
382
- "http-message",
383
- "psr",
384
- "psr-7",
385
- "request",
386
- "response"
387
- ],
388
- "time": "2016-08-06T14:39:51+00:00"
389
- },
390
- {
391
- "name": "ralouphie/getallheaders",
392
- "version": "3.0.3",
393
- "source": {
394
- "type": "git",
395
- "url": "https://github.com/ralouphie/getallheaders.git",
396
- "reference": "120b605dfeb996808c31b6477290a714d356e822"
397
- },
398
- "dist": {
399
- "type": "zip",
400
- "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
401
- "reference": "120b605dfeb996808c31b6477290a714d356e822",
402
- "shasum": ""
403
- },
404
- "require": {
405
- "php": ">=5.6"
406
- },
407
- "require-dev": {
408
- "php-coveralls/php-coveralls": "^2.1",
409
- "phpunit/phpunit": "^5 || ^6.5"
410
- },
411
- "type": "library",
412
- "autoload": {
413
- "files": [
414
- "src/getallheaders.php"
415
- ]
416
- },
417
- "notification-url": "https://packagist.org/downloads/",
418
- "license": [
419
- "MIT"
420
- ],
421
- "authors": [
422
- {
423
- "name": "Ralph Khattar",
424
- "email": "ralph.khattar@gmail.com"
425
- }
426
- ],
427
- "description": "A polyfill for getallheaders.",
428
- "time": "2019-03-08T08:55:37+00:00"
429
- },
430
- {
431
- "name": "symfony/polyfill-intl-idn",
432
- "version": "v1.20.0",
433
- "source": {
434
- "type": "git",
435
- "url": "https://github.com/symfony/polyfill-intl-idn.git",
436
- "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117"
437
- },
438
- "dist": {
439
- "type": "zip",
440
- "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3b75acd829741c768bc8b1f84eb33265e7cc5117",
441
- "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117",
442
- "shasum": ""
443
- },
444
- "require": {
445
- "php": ">=7.1",
446
- "symfony/polyfill-intl-normalizer": "^1.10",
447
- "symfony/polyfill-php72": "^1.10"
448
- },
449
- "suggest": {
450
- "ext-intl": "For best performance"
451
- },
452
- "type": "library",
453
- "extra": {
454
- "branch-alias": {
455
- "dev-main": "1.20-dev"
456
- },
457
- "thanks": {
458
- "name": "symfony/polyfill",
459
- "url": "https://github.com/symfony/polyfill"
460
- }
461
- },
462
- "autoload": {
463
- "psr-4": {
464
- "Symfony\\Polyfill\\Intl\\Idn\\": ""
465
- },
466
- "files": [
467
- "bootstrap.php"
468
- ]
469
- },
470
- "notification-url": "https://packagist.org/downloads/",
471
- "license": [
472
- "MIT"
473
- ],
474
- "authors": [
475
- {
476
- "name": "Laurent Bassin",
477
- "email": "laurent@bassin.info"
478
- },
479
- {
480
- "name": "Trevor Rowbotham",
481
- "email": "trevor.rowbotham@pm.me"
482
- },
483
- {
484
- "name": "Symfony Community",
485
- "homepage": "https://symfony.com/contributors"
486
- }
487
- ],
488
- "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
489
- "homepage": "https://symfony.com",
490
- "keywords": [
491
- "compatibility",
492
- "idn",
493
- "intl",
494
- "polyfill",
495
- "portable",
496
- "shim"
497
- ],
498
- "funding": [
499
- {
500
- "url": "https://symfony.com/sponsor",
501
- "type": "custom"
502
- },
503
- {
504
- "url": "https://github.com/fabpot",
505
- "type": "github"
506
- },
507
- {
508
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
509
- "type": "tidelift"
510
- }
511
- ],
512
- "time": "2020-10-23T14:02:19+00:00"
513
- },
514
- {
515
- "name": "symfony/polyfill-intl-normalizer",
516
- "version": "v1.20.0",
517
- "source": {
518
- "type": "git",
519
- "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
520
- "reference": "727d1096295d807c309fb01a851577302394c897"
521
- },
522
- "dist": {
523
- "type": "zip",
524
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897",
525
- "reference": "727d1096295d807c309fb01a851577302394c897",
526
- "shasum": ""
527
- },
528
- "require": {
529
- "php": ">=7.1"
530
- },
531
- "suggest": {
532
- "ext-intl": "For best performance"
533
- },
534
- "type": "library",
535
- "extra": {
536
- "branch-alias": {
537
- "dev-main": "1.20-dev"
538
- },
539
- "thanks": {
540
- "name": "symfony/polyfill",
541
- "url": "https://github.com/symfony/polyfill"
542
- }
543
- },
544
- "autoload": {
545
- "psr-4": {
546
- "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
547
- },
548
- "files": [
549
- "bootstrap.php"
550
- ],
551
- "classmap": [
552
- "Resources/stubs"
553
- ]
554
- },
555
- "notification-url": "https://packagist.org/downloads/",
556
- "license": [
557
- "MIT"
558
- ],
559
- "authors": [
560
- {
561
- "name": "Nicolas Grekas",
562
- "email": "p@tchwork.com"
563
- },
564
- {
565
- "name": "Symfony Community",
566
- "homepage": "https://symfony.com/contributors"
567
- }
568
- ],
569
- "description": "Symfony polyfill for intl's Normalizer class and related functions",
570
- "homepage": "https://symfony.com",
571
- "keywords": [
572
- "compatibility",
573
- "intl",
574
- "normalizer",
575
- "polyfill",
576
- "portable",
577
- "shim"
578
- ],
579
- "funding": [
580
- {
581
- "url": "https://symfony.com/sponsor",
582
- "type": "custom"
583
- },
584
- {
585
- "url": "https://github.com/fabpot",
586
- "type": "github"
587
- },
588
- {
589
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
590
- "type": "tidelift"
591
- }
592
- ],
593
- "time": "2020-10-23T14:02:19+00:00"
594
- }
595
- ],
596
- "packages-dev": [],
597
- "aliases": [],
598
- "minimum-stability": "stable",
599
- "stability-flags": [],
600
- "prefer-stable": false,
601
- "prefer-lowest": false,
602
- "platform": [],
603
- "platform-dev": [],
604
- "plugin-api-version": "1.1.0"
605
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/lightbox/self_test.php CHANGED
@@ -11,9 +11,9 @@ if ( !defined( 'W3TC' ) )
11
  <legend><?php _e( 'Legend', 'w3-total-cache' ); ?></legend>
12
 
13
  <p>
14
- <?php _e( '<span style="background-color: #33cc33">Installed/Ok/Yes/True</span>: Functionality will work properly.', 'w3-total-cache' ); ?><br />
15
- <?php _e( '<span style="background-color: #FFFF00">Not detected/Not installed/Off</span>: May be installed, but cannot be automatically confirmed. Functionality will be limited.', 'w3-total-cache' ); ?><br />
16
- <?php _e( '<span style="background-color: #FF0000">Not Installed/Error/No/False</span>: Plugin or some functions may not work.', 'w3-total-cache' ); ?><br />
17
  </p>
18
  </fieldset>
19
 
@@ -52,7 +52,7 @@ if ( !defined( 'W3TC' ) )
52
  <?php if ( function_exists( 'ftp_connect' ) ): ?>
53
  <span style="background-color: #33cc33">Installed</span>
54
  <?php else: ?>
55
- <span style="background-color: #FFFF00">Not installed</span>
56
  <?php endif; ?>
57
  <span class="w3tc-self-test-hint"><?php _e( '(required for Self-hosted (<acronym title="File Transfer Protocol">FTP</acronym>) <acronym title="Content Delivery Network">CDN</acronym> support)', 'w3-total-cache' ); ?></span>
58
  </li>
@@ -62,7 +62,7 @@ if ( !defined( 'W3TC' ) )
62
  <?php if ( function_exists( 'mb_substr' ) ): ?>
63
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
64
  <?php else: ?>
65
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
66
  <?php endif; ?>
67
  <span class="w3tc-self-test-hint"><?php _e( '(required for Rackspace Cloud Files support)', 'w3-total-cache' ); ?></span>
68
  </li>
@@ -72,7 +72,7 @@ if ( !defined( 'W3TC' ) )
72
  <?php if ( function_exists( 'curl_init' ) ): ?>
73
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
74
  <?php else: ?>
75
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
76
  <?php endif; ?>
77
  <span class="w3tc-self-test-hint"><?php _e( '(required for Amazon S3, Amazon CloudFront, Rackspace CloudFiles support)', 'w3-total-cache' ); ?></span>
78
  </li>
@@ -82,7 +82,7 @@ if ( !defined( 'W3TC' ) )
82
  <?php if ( function_exists( 'gzencode' ) ): ?>
83
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
84
  <?php else: ?>
85
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
86
  <?php endif; ?>
87
  <span class="w3tc-self-test-hint"><?php _e( '(required for gzip compression support)', 'w3-total-cache' ); ?></span>
88
  </li>
@@ -92,7 +92,7 @@ if ( !defined( 'W3TC' ) )
92
  <?php if ( function_exists( 'brotli_compress' ) ): ?>
93
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
94
  <?php else: ?>
95
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
96
  <?php endif; ?>
97
  <span class="w3tc-self-test-hint"><?php _e( '(required for brotli compression support)', 'w3-total-cache' ); ?></span>
98
  </li>
@@ -110,7 +110,7 @@ if ( !defined( 'W3TC' ) )
110
  <?php elseif ( PHP_VERSION >= 6 ): ?>
111
  <span style="background-color: #33cc33"><?php _e( 'PHP6', 'w3-total-cache' ); ?></span>
112
  <?php else: ?>
113
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
114
  <?php endif; ?>
115
  </li>
116
 
@@ -119,7 +119,7 @@ if ( !defined( 'W3TC' ) )
119
  <?php if ( class_exists( '\Memcached' ) ): ?>
120
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
121
  <?php else: ?>
122
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
123
  <?php endif; ?>
124
  </li>
125
 
@@ -128,7 +128,7 @@ if ( !defined( 'W3TC' ) )
128
  <?php if ( class_exists( '\Memcache' ) ): ?>
129
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
130
  <?php else: ?>
131
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
132
  <?php endif; ?>
133
  </li>
134
 
@@ -137,7 +137,7 @@ if ( !defined( 'W3TC' ) )
137
  <?php if ( Util_Installed::redis() ): ?>
138
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
139
  <?php else: ?>
140
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
141
  <?php endif; ?>
142
  </li>
143
 
@@ -146,7 +146,7 @@ if ( !defined( 'W3TC' ) )
146
  <?php if ( Util_Installed::tidy() ): ?>
147
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
148
  <?php else: ?>
149
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
150
  <?php endif; ?>
151
  <span class="w3tc-self-test-hint"><?php _e( '(required for HTML Tidy minifier support)', 'w3-total-cache' ); ?></span>
152
  </li>
@@ -158,7 +158,7 @@ if ( !defined( 'W3TC' ) )
158
  <?php elseif ( function_exists( 'mime_content_type' ) ): ?>
159
  <span style="background-color: #33cc33"><?php _e( 'Installed (mime_content_type)', 'w3-total-cache' ); ?></span>
160
  <?php else: ?>
161
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
162
  <?php endif; ?>
163
  <span class="w3tc-self-test-hint"><?php _e( '(required for <acronym title="Content Delivery Network">CDN</acronym> support)', 'w3-total-cache' ); ?></span>
164
  </li>
@@ -170,7 +170,7 @@ if ( !defined( 'W3TC' ) )
170
  <?php elseif ( function_exists( 'mhash' ) ): ?>
171
  <span style="background-color: #33cc33"><?php _e( 'Installed (mhash)', 'w3-total-cache' ); ?></span>
172
  <?php else: ?>
173
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
174
  <?php endif; ?>
175
  <span class="w3tc-self-test-hint"><?php _e( '(required for NetDNA / MaxCDN <acronym title="Content Delivery Network">CDN</acronym> purge support)', 'w3-total-cache' ); ?></span>
176
  </li>
@@ -207,7 +207,7 @@ if ( !defined( 'W3TC' ) )
207
  <?php if ( function_exists( 'ssh2_connect' ) ): ?>
208
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
209
  <?php else: ?>
210
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
211
  <?php endif; ?>
212
  <span class="w3tc-self-test-hint"><?php _e( '(required for Self-hosted (<acronym title="File Transfer Protocol">FTP</acronym>) <acronym title="Content Delivery Network">CDN</acronym> <acronym title="Secure File Transfer Protocol">SFTP</acronym> support)', 'w3-total-cache' ); ?></span>
213
  </li>
@@ -266,6 +266,7 @@ if ( Util_Environment::is_apache() ):
266
  }
267
 
268
  ?>
 
269
  <?php foreach ( $modules as $module ): ?>
270
  <li>
271
  <?php echo $module; ?>:
@@ -273,10 +274,10 @@ if ( Util_Environment::is_apache() ):
273
  <?php if ( in_array( $module, $apache_modules ) ): ?>
274
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
275
  <?php else: ?>
276
- <span style="background-color: #FFFF00"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
277
  <?php endif; ?>
278
  <?php else: ?>
279
- <span style="background-color: #FF0000"><?php _e( 'Not detected', 'w3-total-cache' ); ?></span>
280
  <?php endif; ?>
281
  <span class="w3tc-self-test-hint"><?php _e( '(required for disk enhanced Page Cache and Browser Cache)', 'w3-total-cache' ); ?></span>
282
  </li>
@@ -351,7 +352,7 @@ $paths = array_unique( array(
351
  <?php $permalink_structure = get_option( 'permalink_structure' ); if ( $permalink_structure ): ?>
352
  <span style="background-color: #33cc33"><?php echo htmlspecialchars( $permalink_structure ); ?></span>
353
  <?php else: ?>
354
- <span style="background-color: #FF0000"><?php _e( 'Disabled', 'w3-total-cache' ); ?></span>
355
  <?php endif; ?>
356
  </li>
357
 
@@ -378,9 +379,9 @@ $paths = array_unique( array(
378
  <li>
379
  <?php _e( 'Network mode:', 'w3-total-cache' ); ?>
380
  <?php if ( Util_Environment::is_wpmu() ): ?>
381
- <span style="background-color: #33cc33"><?php _e( 'Yes', 'w3-total-cache' ); ?> (<?php echo Util_Environment::is_wpmu_subdomain() ? 'subdomain' : 'subdir'; ?>)</span>
382
  <?php else: ?>
383
- <span style="background-color: #FF0000"><?php _e( 'No', 'w3-total-cache' ); ?></span>
384
  <?php endif; ?>
385
  </li>
386
  </ul>
11
  <legend><?php _e( 'Legend', 'w3-total-cache' ); ?></legend>
12
 
13
  <p>
14
+ <?php _e( '<span style="background-color: #33cc33">Installed/Ok/Yes/True/On</span>: Functionality will work properly.', 'w3-total-cache' ); ?><br />
15
+ <?php _e( '<span style="background-color: #FFFF00">Not detected/Not available/Off</span>: May be installed, but cannot be automatically confirmed. Functionality may be limited.', 'w3-total-cache' ); ?><br />
16
+ <?php _e( '<span style="background-color: #FF0000">Not installed/Error/No/False</span>: Plugin or some functions may not work.', 'w3-total-cache' ); ?><br />
17
  </p>
18
  </fieldset>
19
 
52
  <?php if ( function_exists( 'ftp_connect' ) ): ?>
53
  <span style="background-color: #33cc33">Installed</span>
54
  <?php else: ?>
55
+ <span style="background-color: #FFFF00">Not detected</span>
56
  <?php endif; ?>
57
  <span class="w3tc-self-test-hint"><?php _e( '(required for Self-hosted (<acronym title="File Transfer Protocol">FTP</acronym>) <acronym title="Content Delivery Network">CDN</acronym> support)', 'w3-total-cache' ); ?></span>
58
  </li>
62
  <?php if ( function_exists( 'mb_substr' ) ): ?>
63
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
64
  <?php else: ?>
65
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
66
  <?php endif; ?>
67
  <span class="w3tc-self-test-hint"><?php _e( '(required for Rackspace Cloud Files support)', 'w3-total-cache' ); ?></span>
68
  </li>
72
  <?php if ( function_exists( 'curl_init' ) ): ?>
73
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
74
  <?php else: ?>
75
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
76
  <?php endif; ?>
77
  <span class="w3tc-self-test-hint"><?php _e( '(required for Amazon S3, Amazon CloudFront, Rackspace CloudFiles support)', 'w3-total-cache' ); ?></span>
78
  </li>
82
  <?php if ( function_exists( 'gzencode' ) ): ?>
83
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
84
  <?php else: ?>
85
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
86
  <?php endif; ?>
87
  <span class="w3tc-self-test-hint"><?php _e( '(required for gzip compression support)', 'w3-total-cache' ); ?></span>
88
  </li>
92
  <?php if ( function_exists( 'brotli_compress' ) ): ?>
93
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
94
  <?php else: ?>
95
+ <span style="background-color: #FFFF00"><?php _e( 'Not detected', 'w3-total-cache' ); ?></span>
96
  <?php endif; ?>
97
  <span class="w3tc-self-test-hint"><?php _e( '(required for brotli compression support)', 'w3-total-cache' ); ?></span>
98
  </li>
110
  <?php elseif ( PHP_VERSION >= 6 ): ?>
111
  <span style="background-color: #33cc33"><?php _e( 'PHP6', 'w3-total-cache' ); ?></span>
112
  <?php else: ?>
113
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
114
  <?php endif; ?>
115
  </li>
116
 
119
  <?php if ( class_exists( '\Memcached' ) ): ?>
120
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
121
  <?php else: ?>
122
+ <span style="background-color: #FFFF00"><?php _e( 'Not available', 'w3-total-cache' ); ?></span>
123
  <?php endif; ?>
124
  </li>
125
 
128
  <?php if ( class_exists( '\Memcache' ) ): ?>
129
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
130
  <?php else: ?>
131
+ <span style="background-color: #FFFF00"><?php _e( 'Not available', 'w3-total-cache' ); ?></span>
132
  <?php endif; ?>
133
  </li>
134
 
137
  <?php if ( Util_Installed::redis() ): ?>
138
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
139
  <?php else: ?>
140
+ <span style="background-color: #FFFF00"><?php _e( 'Not available', 'w3-total-cache' ); ?></span>
141
  <?php endif; ?>
142
  </li>
143
 
146
  <?php if ( Util_Installed::tidy() ): ?>
147
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
148
  <?php else: ?>
149
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
150
  <?php endif; ?>
151
  <span class="w3tc-self-test-hint"><?php _e( '(required for HTML Tidy minifier support)', 'w3-total-cache' ); ?></span>
152
  </li>
158
  <?php elseif ( function_exists( 'mime_content_type' ) ): ?>
159
  <span style="background-color: #33cc33"><?php _e( 'Installed (mime_content_type)', 'w3-total-cache' ); ?></span>
160
  <?php else: ?>
161
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
162
  <?php endif; ?>
163
  <span class="w3tc-self-test-hint"><?php _e( '(required for <acronym title="Content Delivery Network">CDN</acronym> support)', 'w3-total-cache' ); ?></span>
164
  </li>
170
  <?php elseif ( function_exists( 'mhash' ) ): ?>
171
  <span style="background-color: #33cc33"><?php _e( 'Installed (mhash)', 'w3-total-cache' ); ?></span>
172
  <?php else: ?>
173
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
174
  <?php endif; ?>
175
  <span class="w3tc-self-test-hint"><?php _e( '(required for NetDNA / MaxCDN <acronym title="Content Delivery Network">CDN</acronym> purge support)', 'w3-total-cache' ); ?></span>
176
  </li>
207
  <?php if ( function_exists( 'ssh2_connect' ) ): ?>
208
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
209
  <?php else: ?>
210
+ <span style="background-color: #FFFF00"><?php _e( 'Not detected', 'w3-total-cache' ); ?></span>
211
  <?php endif; ?>
212
  <span class="w3tc-self-test-hint"><?php _e( '(required for Self-hosted (<acronym title="File Transfer Protocol">FTP</acronym>) <acronym title="Content Delivery Network">CDN</acronym> <acronym title="Secure File Transfer Protocol">SFTP</acronym> support)', 'w3-total-cache' ); ?></span>
213
  </li>
266
  }
267
 
268
  ?>
269
+ <h5><?php _e( 'Detection of the below modules may not be possible on all environments. As such "Not detected" means that the environment disallowed detection for the given module which may still be installed/enabled whereas "Not installed" means the given module was detected but is not installed/detected.', 'w3-total-cache' )?></h5>
270
  <?php foreach ( $modules as $module ): ?>
271
  <li>
272
  <?php echo $module; ?>:
274
  <?php if ( in_array( $module, $apache_modules ) ): ?>
275
  <span style="background-color: #33cc33"><?php _e( 'Installed', 'w3-total-cache' ); ?></span>
276
  <?php else: ?>
277
+ <span style="background-color: #FF0000"><?php _e( 'Not installed', 'w3-total-cache' ); ?></span>
278
  <?php endif; ?>
279
  <?php else: ?>
280
+ <span style="background-color: #FFFF00"><?php _e( 'Not detected', 'w3-total-cache' ); ?></span>
281
  <?php endif; ?>
282
  <span class="w3tc-self-test-hint"><?php _e( '(required for disk enhanced Page Cache and Browser Cache)', 'w3-total-cache' ); ?></span>
283
  </li>
352
  <?php $permalink_structure = get_option( 'permalink_structure' ); if ( $permalink_structure ): ?>
353
  <span style="background-color: #33cc33"><?php echo htmlspecialchars( $permalink_structure ); ?></span>
354
  <?php else: ?>
355
+ <span style="background-color: #FFFF00"><?php _e( 'Off', 'w3-total-cache' ); ?></span>
356
  <?php endif; ?>
357
  </li>
358
 
379
  <li>
380
  <?php _e( 'Network mode:', 'w3-total-cache' ); ?>
381
  <?php if ( Util_Environment::is_wpmu() ): ?>
382
+ <span style="background-color: #33cc33"><?php _e( 'On', 'w3-total-cache' ); ?> (<?php echo Util_Environment::is_wpmu_subdomain() ? 'subdomain' : 'subdir'; ?>)</span>
383
  <?php else: ?>
384
+ <span style="background-color: #FFFF00"><?php _e( 'Off', 'w3-total-cache' ); ?></span>
385
  <?php endif; ?>
386
  </li>
387
  </ul>
inc/options/general.php CHANGED
@@ -524,20 +524,13 @@ Util_Ui::config_item( array(
524
  )
525
  );
526
 
527
- Util_Ui::config_item( array(
528
- 'key' => 'common.track_usage',
529
- 'control' => 'checkbox',
530
- 'checkbox_label' => __( 'Anonymously track usage to improve product quality', 'w3-total-cache' ),
531
- 'label_class' => 'w3tc_single_column'
532
- ) );
533
-
534
- Util_Ui::config_item( array(
535
- 'key' => 'robots_block.enable',
536
- 'control' => 'checkbox',
537
- 'checkbox_label' => __( 'Enable robots.txt blocking for cache directory', 'w3-total-cache' ),
538
- 'label_class' => 'w3tc_single_column'
539
- ) );
540
- ?>
541
  </table>
542
 
543
  <?php Util_Ui::button_config_save( 'general_misc' ); ?>
524
  )
525
  );
526
 
527
+ Util_Ui::config_item( array(
528
+ 'key' => 'common.track_usage',
529
+ 'control' => 'checkbox',
530
+ 'checkbox_label' => __( 'Anonymously track usage to improve product quality', 'w3-total-cache' ),
531
+ 'label_class' => 'w3tc_single_column'
532
+ ) );
533
+ ?>
 
 
 
 
 
 
 
534
  </table>
535
 
536
  <?php Util_Ui::button_config_save( 'general_misc' ); ?>
pub/css/setup-guide.css CHANGED
@@ -20,3 +20,12 @@
20
  .w3tc-option-recommended {
21
  font-size: 0.9em;
22
  }
 
 
 
 
 
 
 
 
 
20
  .w3tc-option-recommended {
21
  font-size: 0.9em;
22
  }
23
+
24
+ #w3tc-options-menu {
25
+ max-width: 155px;
26
+ }
27
+
28
+ #w3tc-options-menu li {
29
+ hyphens: auto;
30
+ overflow-wrap: break-word;
31
+ }
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.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -275,6 +275,22 @@ Please reach out to all of these people and support their projects if you're so
275
 
276
  == Changelog ==
277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  = 2.1.8 =
279
  * Fix: Corrected handling of robots.txt (file and filter)
280
 
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.9
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.9 =
279
+ * Fix: Cloudflare Dashboard Widget: Updated to use GraphQL
280
+ * Fix: Cloudflare Dashboard Widget: Use WordPress timezone
281
+ * Fix: CDN: Execute purge only if hosting is enabled, to prevent unneeded delays
282
+ * Fix: Published/modified custom posts not clearing the archive cache(s)
283
+ * Fix: Native WordPress sitemap caching
284
+ * Fix: Extra MIME groups other than controlled by settings were added to rules
285
+ * Fix: Usage Statistics: Not functioning when object cache is set to Redis
286
+ * Fix: AMP Extension: Prevent popup admin bar for endpoints
287
+ * Fix: Setup Guide Wizard: CSS for long translations
288
+ * Fix: Opcache Settings: Validate timestamp indicator checkbox
289
+ * Update: Remove robots.txt cache toggle setting
290
+ * Enhancement: Impove 404 detection
291
+ * Enhancement: Improved compatibility check indicators
292
+ * Enhancement: AWS CloudFront: Faster cache invalidation using async
293
+
294
  = 2.1.8 =
295
  * Fix: Corrected handling of robots.txt (file and filter)
296
 
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.8' );
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,7 +104,6 @@ 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
- define( 'W3TC_MARKER_BEGIN_ROBOTS', '# BEGIN W3TC ROBOTS' );
108
 
109
 
110
  define( 'W3TC_MARKER_END_WORDPRESS', '# END WordPress' );
@@ -119,7 +118,6 @@ define( 'W3TC_MARKER_END_MINIFY_CACHE', '# END W3TC Minify cache' );
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' ) ) {
5
  }
6
 
7
  define( 'W3TC', true );
8
+ define( 'W3TC_VERSION', '2.1.9' );
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
 
108
 
109
  define( 'W3TC_MARKER_END_WORDPRESS', '# END WordPress' );
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' ) ) {
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.8
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.9
7
  * Requires at least: 3.8
8
  * Requires PHP: 5.6
9
  * Author: BoldGrid