'; echo '
'; echo ''; wp_nonce_field( 'wp-cache' ); ?>


' . esc_html__( 'Notice: Simple caching enabled but Supercache mod_rewrite rules from expert mode detected. Cached files will be served using those rules. If your site is working ok, please ignore this message. Otherwise, you can edit the .htaccess file in the root of your install and remove the SuperCache rules.', 'wp-super-cache' ) . '

'; } } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
'; if ( wpsc_is_boost_current() ) { $config = wpsc_get_boost_migration_config(); $button_url = $config['is_installed'] ? $config['activate_url'] : $config['install_url']; $button_class = $config['is_installed'] ? 'wpsc-activate-boost-button' : 'wpsc-install-boost-button'; $button_label = esc_html__( 'Try Jetpack Boost', 'wp-super-cache' ); if ( wpsc_is_boost_active() && wpsc_is_boost_installed() ) { $button_url = esc_url( admin_url( 'admin.php?page=jetpack-boost' ) ); $button_class = ''; $button_label = esc_html__( 'Jetpack Boost Dashboard', 'wp-super-cache' ); } echo ""; echo ''; echo ''; echo ''; } echo '
'; echo '
'; if ( $cache_enabled ) { echo '
'; echo '

' . esc_html__( 'Cache Tester', 'wp-super-cache' ) . '

'; echo '

' . esc_html__( 'Test your cached website by clicking the test button below.', 'wp-super-cache' ) . '

'; echo '

' . __( 'Note: if you use Cloudflare or other transparent front-end proxy service this test may fail.

  1. If you have Cloudflare minification enabled this plugin may detect differences in the pages and report an error.
  2. Try using the development mode of Cloudflare to perform the test. You can disable development mode afterwards if the test succeeds.
', 'wp-super-cache' ) . '

'; if ( array_key_exists( 'action', $_POST ) && 'test' === $_POST['action'] && $valid_nonce ) { $url = trailingslashit( get_bloginfo( 'url' ) ); if ( isset( $_POST['httponly'] ) ) { $url = str_replace( 'https://', 'http://', $url ); } $test_messages = array( esc_html__( 'Fetching %s to prime cache: ', 'wp-super-cache' ), esc_html__( 'Fetching first copy of %s: ', 'wp-super-cache' ), esc_html__( 'Fetching second copy of %s: ', 'wp-super-cache' ) ); $c = 0; $cache_test_error = false; $page = array(); foreach ( $test_messages as $message ) { echo '

' . sprintf( $message, $url ); $page[ $c ] = wp_remote_get( $url, array( 'timeout' => 60, 'blocking' => true ) ); if ( ! is_wp_error( $page[ $c ] ) ) { $fp = fopen( $cache_path . $c . '.html', 'w' ); fwrite( $fp, $page[ $c ]['body'] ); fclose( $fp ); echo '' . esc_html__( 'OK', 'wp-super-cache' ) . " (" . $c . '.html)

'; sleep( 1 ); } else { $cache_test_error = true; echo '' . esc_html__( 'FAILED', 'wp-super-cache' ) . '

'; $errors = ''; $messages = ''; foreach ( $page[ $c ]->get_error_codes() as $code ) { $severity = $page[ $c ]->get_error_data( $code ); foreach ( $page[ $c ]->get_error_messages( $code ) as $err ) { $errors .= $severity . ': ' . $err . "
\n"; } } if ( ! empty( $errors ) ) { echo '

' . sprintf( __( 'Errors: %s', 'wp-super-cache' ), $errors ) . '

'; } } ++$c; } if ( false == $cache_test_error ) { echo ''; } if ( false == $cache_test_error && preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page[1]['body'], $matches1 ) && preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page[2]['body'], $matches2 ) && $matches1[2] == $matches2[2] ) { echo '

' . sprintf( esc_html__( 'Page 1: %s', 'wp-super-cache' ), $matches1[2] ) . '

'; echo '

' . sprintf( esc_html__( 'Page 2: %s', 'wp-super-cache' ), $matches2[2] ) . '

'; echo '

' . esc_html__( 'The timestamps on both pages match!', 'wp-super-cache' ) . '

'; } else { echo '

' . esc_html__( 'The pages do not match! Timestamps differ or were not found!', 'wp-super-cache' ) . '

'; echo '

' . esc_html__( 'Things you can do:', 'wp-super-cache' ) . '

'; echo '
  1. ' . esc_html__( 'Load your homepage in a logged out browser, check the timestamp at the end of the html source. Load the page again and compare the timestamp. Caching is working if the timestamps match.', 'wp-super-cache' ) . '
  2. '; echo '
  3. ' . esc_html__( 'Enable logging on the Debug page here. That should help you track down the problem.', 'wp-super-cache' ) . '
  4. '; echo '
  5. ' . esc_html__( 'You should check Page 1 and Page 2 above for errors. Your local server configuration may not allow your website to access itself.', 'wp-super-cache' ) . '
  6. '; echo '
'; } } echo '
'; echo ''; if ( ! empty( $_SERVER['HTTPS'] ) && 'on' === strtolower( $_SERVER['HTTPS'] ) ) { echo ' ' . esc_html__( 'Send non-secure (non https) request for homepage', 'wp-super-cache' ); } if ( isset( $wp_super_cache_comments ) && $wp_super_cache_comments == 0 ) { echo '

' . __( 'Warning! Cache comments are currently disabled. Please go to the Debug page and enable Cache Status Messages there. You should clear the cache before testing.', 'wp-super-cache' ) . '

'; echo '
'; } else { echo '
'; } wp_nonce_field( 'wp-cache' ); echo '
'; echo '
'; } echo '
'; echo '

' . esc_html__( 'Delete Cached Pages', 'wp-super-cache' ) . '

'; echo '

' . esc_html__( 'Cached pages are stored on your server as html and PHP files. If you need to delete them, use the button below.', 'wp-super-cache' ) . '

'; echo '
'; echo ''; echo '
'; wp_nonce_field( 'wp-cache' ); echo "
\n"; echo '
'; if ( is_multisite() && wpsupercache_site_admin() ) { echo '
'; echo '
'; echo ''; echo '
'; wp_nonce_field( 'wp-cache' ); echo "

\n"; echo '
'; } ?>