You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$label = __( 'Page caching is not detected and response time is slow.', 'amp' );
344
-
345
341
$description = '<p>' . esc_html__( 'The AMP plugin performs at its best when page caching is enabled. This is because the additional optimizations performed require additional server processing time, and page caching ensures that responses are served quickly.', 'amp' ) . '</p>';
346
342
347
343
/* translators: List of page cache headers. */
348
-
$description .= '<p>' . sprintf( __( 'Page caching is detected by looking for an active page caching plugin, making three requests to the homepage and looking for HTTP response headers like: %s.', 'amp' ), '<code>' . implode( '</code>, <code>', array_keys( self::get_page_cache_headers() ) ) . '</code>' );
344
+
$description .= '<p>' . sprintf( __( 'Page caching is detected by looking for an active page caching plugin as well as making three requests to the homepage and looking for one or more of the following HTTP client caching response headers: %s.', 'amp' ), '<code>' . implode( '</code>, <code>', array_keys( self::get_page_cache_headers() ) ) . '</code>' );
349
345
350
346
if ( is_wp_error( $page_cache_detail ) ) {
347
+
$badge_color = 'red';
348
+
$status = 'critical';
349
+
$label = __( 'Unable to detect the presence of page caching', 'amp' );
350
+
351
351
$error_info = sprintf(
352
352
/* translators: 1 is error message, 2 is error code */
353
353
__( 'Unable to detect page caching due to possible loopback request problem. Please verify that the loopback request test is passing. Error: %1$s (Code: %2$s)', 'amp' ),
@@ -356,41 +356,65 @@ public function page_cache() {
$page_cache_test_summary[] = '<span class="dashicons dashicons-yes-alt text-success"></span>' . __( 'A page caching plugin was detected.', 'amp' );
372
379
} else {
373
-
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'Page caching plugin is not available.', 'amp' );
380
+
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'A page caching plugin was not detected.', 'amp' );
374
381
}
375
382
376
383
if ( empty( $page_cache_detail['response_time'] ) ) {
377
-
$page_cache_test_summary[] = '<span class="dashicons dashicons-dismiss text-error"></span>' . __( 'We couldn\'t able to find a response time. Please make sure loopback requests are allowed.', 'amp' );
384
+
$page_cache_test_summary[] = '<span class="dashicons dashicons-dismiss text-error"></span>' . __( 'Server response time could not be determined. Verify that loopback requests are working.', 'amp' );
378
385
} else {
379
386
387
+
// @todo The 600 millisecond threshold should be filterable.
380
388
if ( $page_cache_detail['response_time'] < 600 ) {
381
-
$page_cache_test_summary[] = '<span class="dashicons dashicons-yes-alt text-success"></span>' . __( 'Site response time is less than 600 microseconds.', 'amp' );
/* translators: %d is the response time in milliseconds */
391
+
__( 'Median server response time was %d milliseconds. This is less than the 600 millisecond threshold.', 'amp' ),
392
+
$page_cache_detail['response_time']
393
+
);
382
394
} else {
383
-
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'Site response time is more than 600 microseconds, which is not ideal.', 'amp' );
/* translators: %d is the response time in milliseconds */
397
+
__( 'Median server response time was %d milliseconds. It should be less than 600 milliseconds.', 'amp' ),
398
+
$page_cache_detail['response_time'],
399
+
$page_cache_detail['response_time']
400
+
);
384
401
}
385
402
386
403
if ( empty( $page_cache_detail['headers'] ) ) {
387
-
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'We could not find any page cache headers in a response.', 'amp' );
404
+
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'No client caching response headers were detected in response.', 'amp' );
0 commit comments