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
$description = '<p>' . esc_html__( 'The AMP plugin performs at its best when persistent object cache is enabled. Persistent object caching is used to more effectively store image dimensions and parsed CSS using a caching backend rather than using the options table in the database.', 'amp' ) . '</p>';
253
253
@@ -337,64 +337,65 @@ static function ( $available_service ) {
$label = __( 'Page caching is not detected and response time is slow.', 'amp' );
345
344
346
345
$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>';
347
346
348
347
/* translators: List of page cache headers. */
349
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>' );
350
349
351
-
if ( is_wp_error( $page_cache_status ) ) {
350
+
if ( is_wp_error( $page_cache_detail ) ) {
352
351
$error_info = sprintf(
353
352
/* translators: 1 is error message, 2 is error code */
354
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' ),
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'Page caching plugin is not available.', 'amp' );
374
-
}
367
+
if ( ! is_wp_error( $page_cache_detail ) ) {
368
+
$page_cache_test_summary = [];
375
369
376
-
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' );
378
-
} else {
379
-
380
-
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' );
370
+
if ( $page_cache_detail['advanced_cache_present'] ) {
$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' );
373
+
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning text-warning"></span>' . __( 'Page caching plugin is not available.', 'amp' );
384
374
}
385
375
386
-
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' );
376
+
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' );
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' );
382
+
} 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' );
384
+
}
385
+
386
+
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' );
0 commit comments