wp_create_nonce( 'wpsc_dismiss_boost_notice' ), 'boostDismissNonce' => wp_create_nonce( 'wpsc_dismiss_boost_banner' ), 'boostInstallNonce' => wp_create_nonce( 'updates' ), 'boostActivateNonce' => wp_create_nonce( 'activate-boost' ), ) ); } add_action( 'admin_enqueue_scripts', 'wp_super_cache_admin_enqueue_scripts' ); /** * Use the standard WordPress plugin installation ajax handler. */ add_action( 'wp_ajax_wpsc_install_plugin', 'wp_ajax_install_plugin' ); function wp_cache_manager_error_checks() { global $wp_cache_debug, $wp_cache_cron_check, $cache_enabled, $super_cache_enabled, $wp_cache_config_file, $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $wp_cache_mobile_browsers, $wp_cache_mobile_enabled, $wp_cache_mod_rewrite; global $dismiss_htaccess_warning, $dismiss_readable_warning, $dismiss_gc_warning, $wp_cache_shutdown_gc, $is_nginx; global $htaccess_path; if ( ! wpsupercache_site_admin() ) { return false; } // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved -- Version is checked before access. if ( PHP_VERSION_ID < 50300 && ( ini_get( 'safe_mode' ) === '1' || strtolower( ini_get( 'safe_mode' ) ) === 'on' ) ) { // @codingStandardsIgnoreLine echo '

' . esc_html__( 'Warning! PHP Safe Mode Enabled!', 'wp-super-cache' ) . '

'; echo '

' . esc_html__( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' ) . '
'; // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_mode_gidDeprecatedRemoved -- Version is checked before access. if ( ! ini_get( 'safe_mode_gid' ) ) { // @codingStandardsIgnoreLine esc_html_e( 'Your server is set up to check the owner of PHP scripts before allowing them to read and write files.', 'wp-super-cache' ); echo '
'; printf( __( 'You or an administrator may be able to make it work by changing the group owner of the plugin scripts to match that of the web server user. The group owner of the %s/cache/ directory must also be changed. See the safe mode manual page for further details.', 'wp-super-cache' ), esc_attr( WP_CONTENT_DIR ) ); } else { _e( 'You or an administrator must disable this. See the safe mode manual page for further details. This cannot be disabled in a .htaccess file unfortunately. It must be done in the php.ini config file.', 'wp-super-cache' ); } echo '

'; } if ( '' == get_option( 'permalink_structure' ) ) { echo '

' . __( 'Permlink Structure Error', 'wp-super-cache' ) . '

'; echo "

" . __( 'A custom url or permalink structure is required for this plugin to work correctly. Please go to the Permalinks Options Page to configure your permalinks.', 'wp-super-cache' ) . "

"; echo '
'; return false; } if ( $wp_cache_debug || ! $wp_cache_cron_check ) { if ( defined( 'DISABLE_WP_CRON' ) && constant( 'DISABLE_WP_CRON' ) ) { ?>

Troubleshooting section of the readme.txt', 'wp-super-cache' ), 'https://wordpress.org/plugins/wp-super-cache/faq/' ); ?>

0.01, 'blocking' => true)); if( is_array( $cron ) ) { if( $cron[ 'response' ][ 'code' ] == '404' ) { ?>

Warning! wp-cron.php not found!

Troubleshooting section of the readme.txt', 'wp-super-cache' ), 'https://wordpress.org/plugins/wp-super-cache/faq/' ); ?>

' . __( "Cannot continue... fix previous problems and retry.", 'wp-super-cache' ) . '

'; return false; } if ( false == function_exists( 'wpsc_deep_replace' ) ) { $msg = __( 'Warning! You must set WP_CACHE and WPCACHEHOME in your wp-config.php for this plugin to work correctly:' ) . '
'; $msg .= "define( 'WP_CACHE', true );
"; $msg .= "define( 'WPCACHEHOME', '" . dirname( __DIR__ ) . "/' );
"; wp_die( $msg ); } if (!wp_cache_check_global_config()) { return false; } if ( 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) { ?>

this page for instructions on modifying your php.ini.', 'wp-super-cache' ); ?>

%s/wp-cache-config.php and cannot be modified. That file must be writeable by the web server to make any changes.', 'wp-super-cache' ), WPCACHECONFIGPATH ); ?>

This page explains how to change file permissions.', 'wp-super-cache' ); ?>

chmod 666 /wp-cache-config.php
chmod 644 /wp-cache-config.php

this form to enable it.', 'wp-super-cache' ); ?>

' />

chmod 755 /

This page explains how to change file permissions.', 'wp-super-cache' ); ?>

' />

' . esc_html__( 'Mobile rewrite rules detected', 'wp-super-cache' ) . '

'; echo '

' . esc_html__( 'For best performance you should enable "Mobile device support" or delete the mobile rewrite rules in your .htaccess. Look for the 2 lines with the text "2.0\ MMP|240x320" and delete those.', 'wp-super-cache' ) . '

' . esc_html__( 'This will have no affect on ordinary users but mobile users will see uncached pages.', 'wp-super-cache' ) . '

'; } elseif ( $wp_cache_mod_rewrite && $cache_enabled && $wp_cache_mobile_enabled && $scrules != '' // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual && ( ( '' != $wp_cache_mobile_prefixes // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual && ! str_contains( $scrules, addcslashes( str_replace( ', ', '|', $wp_cache_mobile_prefixes ), ' ' ) ) ) || ( '' != $wp_cache_mobile_browsers // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual && ! str_contains( $scrules, addcslashes( str_replace( ', ', '|', $wp_cache_mobile_browsers ), ' ' ) ) ) ) ) { ?>

  1. Update Mod_Rewrite Rules button.', 'wp-super-cache' ); ?>
  2. # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ) ); ?>
  3. # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%2$s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ), esc_html( wpsc_get_logged_in_cookie() ) ); ?>

Update Mod_Rewrite Rules button.', 'wp-super-cache' ); ?>

__( 'Required to serve compressed supercache files properly.', 'wp-super-cache' ), 'mod_headers' => __( 'Required to set caching information on supercache pages. IE7 users will see old pages without this module.', 'wp-super-cache' ), 'mod_expires' => __( 'Set the expiry date on supercached pages. Visitors may not see new pages when they refresh or leave comments without this module.', 'wp-super-cache' ) ); foreach( $required_modules as $req => $desc ) { if( !in_array( $req, $mods ) ) { $missing_mods[ $req ] = $desc; } } if( isset( $missing_mods) && is_array( $missing_mods ) ) { ?>

"; foreach( $missing_mods as $req => $desc ) { echo "
  • $req - $desc
  • "; } echo ""; echo "
    "; } } if ( $valid_nonce && isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'dismiss_htaccess_warning' ) { wp_cache_replace_line('^ *\$dismiss_htaccess_warning', "\$dismiss_htaccess_warning = 1;", $wp_cache_config_file); $dismiss_htaccess_warning = 1; } elseif ( !isset( $dismiss_htaccess_warning ) ) { $dismiss_htaccess_warning = 0; } if ( ! $is_nginx && $dismiss_htaccess_warning == 0 && $wp_cache_mod_rewrite && $super_cache_enabled && get_option( 'siteurl' ) != get_option( 'home' ) ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual,Universal.Operators.StrictComparisons.LooseNotEqual ?>

    here. Unfortunately, WordPress writes to the .htaccess in the install directory, not where your site is served from.
    When you update the rewrite rules in this plugin you will have to copy the file to where your site is hosted. This will be fixed in the future.', 'wp-super-cache' ); ?>

    ' />

    \'\"\r\n\t\(\)\$\[\];#]/', '', $new_cache_path ); wp_cache_replace_line('^ *\$cache_path', "\$cache_path = " . var_export( $cache_path, true ) . ";", $wp_cache_config_file); } if( isset( $_POST[ 'wp_super_cache_late_init' ] ) ) { $wp_super_cache_late_init = 1; } else { $wp_super_cache_late_init = 0; } wp_cache_replace_line('^ *\$wp_super_cache_late_init', "\$wp_super_cache_late_init = " . $wp_super_cache_late_init . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_disable_utf8' ] ) ) { $wp_cache_disable_utf8 = 1; } else { $wp_cache_disable_utf8 = 0; } wp_cache_replace_line('^ *\$wp_cache_disable_utf8', "\$wp_cache_disable_utf8 = " . $wp_cache_disable_utf8 . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_no_cache_for_get' ] ) ) { $wp_cache_no_cache_for_get = 1; } else { $wp_cache_no_cache_for_get = 0; } wp_cache_replace_line('^ *\$wp_cache_no_cache_for_get', "\$wp_cache_no_cache_for_get = " . $wp_cache_no_cache_for_get . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_supercache_304' ] ) ) { $wp_supercache_304 = 1; } else { $wp_supercache_304 = 0; } wp_cache_replace_line('^ *\$wp_supercache_304', "\$wp_supercache_304 = " . $wp_supercache_304 . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_mfunc_enabled' ] ) ) { $wp_cache_mfunc_enabled = 1; } else { $wp_cache_mfunc_enabled = 0; } wp_cache_replace_line('^ *\$wp_cache_mfunc_enabled', "\$wp_cache_mfunc_enabled = " . $wp_cache_mfunc_enabled . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_mobile_enabled' ] ) ) { $wp_cache_mobile_enabled = 1; } else { $wp_cache_mobile_enabled = 0; } wp_cache_replace_line('^ *\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_front_page_checks' ] ) ) { $wp_cache_front_page_checks = 1; } else { $wp_cache_front_page_checks = 0; } wp_cache_replace_line('^ *\$wp_cache_front_page_checks', "\$wp_cache_front_page_checks = " . $wp_cache_front_page_checks . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_supercache_cache_list' ] ) ) { $wp_supercache_cache_list = 1; } else { $wp_supercache_cache_list = 0; } wp_cache_replace_line('^ *\$wp_supercache_cache_list', "\$wp_supercache_cache_list = " . $wp_supercache_cache_list . ";", $wp_cache_config_file); if ( isset( $_POST[ 'wp_cache_enabled' ] ) ) { wp_cache_enable(); if ( ! defined( 'DISABLE_SUPERCACHE' ) ) { wp_cache_debug( 'DISABLE_SUPERCACHE is not set, super_cache enabled.' ); wp_super_cache_enable(); $super_cache_enabled = true; } } else { wp_cache_disable(); wp_super_cache_disable(); $super_cache_enabled = false; } if ( isset( $_POST[ 'wp_cache_mod_rewrite' ] ) && $_POST[ 'wp_cache_mod_rewrite' ] == 1 ) { $wp_cache_mod_rewrite = 1; add_mod_rewrite_rules(); } else { $wp_cache_mod_rewrite = 0; // cache files served by PHP remove_mod_rewrite_rules(); } wp_cache_setting( 'wp_cache_mod_rewrite', $wp_cache_mod_rewrite ); if( isset( $_POST[ 'wp_cache_clear_on_post_edit' ] ) ) { $wp_cache_clear_on_post_edit = 1; } else { $wp_cache_clear_on_post_edit = 0; } wp_cache_replace_line('^ *\$wp_cache_clear_on_post_edit', "\$wp_cache_clear_on_post_edit = " . $wp_cache_clear_on_post_edit . ";", $wp_cache_config_file); if( isset( $_POST[ 'cache_rebuild_files' ] ) ) { $cache_rebuild_files = 1; } else { $cache_rebuild_files = 0; } wp_cache_replace_line('^ *\$cache_rebuild_files', "\$cache_rebuild_files = " . $cache_rebuild_files . ";", $wp_cache_config_file); if ( isset( $_POST[ 'wpsc_save_headers' ] ) ) { $wpsc_save_headers = 1; } else { $wpsc_save_headers = 0; } wp_cache_replace_line('^ *\$wpsc_save_headers', "\$wpsc_save_headers = " . $wpsc_save_headers . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_mutex_disabled' ] ) ) { $wp_cache_mutex_disabled = 0; } else { $wp_cache_mutex_disabled = 1; } if( defined( 'WPSC_DISABLE_LOCKING' ) ) { $wp_cache_mutex_disabled = 1; } wp_cache_replace_line('^ *\$wp_cache_mutex_disabled', "\$wp_cache_mutex_disabled = " . $wp_cache_mutex_disabled . ";", $wp_cache_config_file); if ( isset( $_POST['wp_cache_not_logged_in'] ) && $_POST['wp_cache_not_logged_in'] != 0 ) { if ( $wp_cache_not_logged_in == 0 && function_exists( 'prune_super_cache' ) ) { prune_super_cache( $cache_path, true ); } $wp_cache_not_logged_in = (int)$_POST['wp_cache_not_logged_in']; } else { $wp_cache_not_logged_in = 0; } wp_cache_replace_line('^ *\$wp_cache_not_logged_in', "\$wp_cache_not_logged_in = " . $wp_cache_not_logged_in . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_make_known_anon' ] ) ) { if( $wp_cache_make_known_anon == 0 && function_exists( 'prune_super_cache' ) ) prune_super_cache ($cache_path, true); $wp_cache_make_known_anon = 1; } else { $wp_cache_make_known_anon = 0; } wp_cache_replace_line('^ *\$wp_cache_make_known_anon', "\$wp_cache_make_known_anon = " . $wp_cache_make_known_anon . ";", $wp_cache_config_file); if( isset( $_POST[ 'wp_cache_refresh_single_only' ] ) ) { $wp_cache_refresh_single_only = 1; } else { $wp_cache_refresh_single_only = 0; } wp_cache_setting( 'wp_cache_refresh_single_only', $wp_cache_refresh_single_only ); if ( defined( 'WPSC_DISABLE_COMPRESSION' ) ) { $cache_compression = 0; wp_cache_replace_line('^ *\$cache_compression', "\$cache_compression = " . $cache_compression . ";", $wp_cache_config_file); } else { if ( isset( $_POST[ 'cache_compression' ] ) ) { $new_cache_compression = 1; } else { $new_cache_compression = 0; } if ( 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) { echo '
    ' . __( "Warning! You attempted to enable compression but zlib.output_compression is enabled. See #21 in the Troubleshooting section of the readme file.", 'wp-super-cache' ) . '
    '; } elseif ( $new_cache_compression !== (int) $cache_compression ) { $cache_compression = $new_cache_compression; wp_cache_replace_line( '^ *\$cache_compression', "\$cache_compression = $cache_compression;", $wp_cache_config_file ); if ( function_exists( 'prune_super_cache' ) ) { prune_super_cache( $cache_path, true ); } delete_option( 'super_cache_meta' ); } } } } if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'wpsupercache' ) add_action( 'admin_init', 'wp_cache_manager_updates' ); function wp_cache_manager() { global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled; global $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_mobile_enabled, $wp_cache_mobile_browsers, $wp_cache_no_cache_for_get; global $wp_cache_not_logged_in, $wp_cache_make_known_anon, $wp_supercache_cache_list, $cache_page_secret; global $wp_super_cache_front_page_check, $wp_cache_refresh_single_only, $wp_cache_mobile_prefixes; global $wp_cache_mod_rewrite, $wp_supercache_304, $wp_super_cache_late_init, $wp_cache_front_page_checks, $wp_cache_disable_utf8, $wp_cache_mfunc_enabled; global $wp_super_cache_comments, $wp_cache_home_path, $wpsc_save_headers, $is_nginx; global $wpsc_promo_links; if ( !wpsupercache_site_admin() ) return false; // used by mod_rewrite rules and config file if ( function_exists( "cfmobi_default_browsers" ) ) { $wp_cache_mobile_browsers = cfmobi_default_browsers( "mobile" ); $wp_cache_mobile_browsers = array_merge( $wp_cache_mobile_browsers, cfmobi_default_browsers( "touch" ) ); } elseif ( function_exists( 'lite_detection_ua_contains' ) ) { $wp_cache_mobile_browsers = explode( '|', lite_detection_ua_contains() ); } else { $wp_cache_mobile_browsers = array( '2.0 MMP', '240x320', '400X240', 'AvantGo', 'BlackBerry', 'Blazer', 'Cellphone', 'Danger', 'DoCoMo', 'Elaine/3.0', 'EudoraWeb', 'Googlebot-Mobile', 'hiptop', 'IEMobile', 'KYOCERA/WX310K', 'LG/U990', 'MIDP-2.', 'MMEF20', 'MOT-V', 'NetFront', 'Newt', 'Nintendo Wii', 'Nitro', 'Nokia', 'Opera Mini', 'Palm', 'PlayStation Portable', 'portalmmm', 'Proxinet', 'ProxiNet', 'SHARP-TQ-GX10', 'SHG-i900', 'Small', 'SonyEricsson', 'Symbian OS', 'SymbianOS', 'TS21i-10', 'UP.Browser', 'UP.Link', 'webOS', 'Windows CE', 'WinWAP', 'YahooSeeker/M1A1-R2D2', 'iPhone', 'iPod', 'iPad', 'Android', 'BlackBerry9530', 'LG-TU915 Obigo', 'LGE VX', 'webOS', 'Nokia5800' ); } if ( function_exists( "lite_detection_ua_prefixes" ) ) { $wp_cache_mobile_prefixes = lite_detection_ua_prefixes(); } else { $wp_cache_mobile_prefixes = array( 'w3c ', 'w3c-', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac', 'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'htc_', 'inno', 'ipaq', 'ipod', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-', 'lg/u', 'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-', 'newt', 'noki', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox', 'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar', 'sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-', 'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'wap-', 'wapa', 'wapi', 'wapp', 'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-' ); // from http://svn.wp-plugins.org/wordpress-mobile-pack/trunk/plugins/wpmp_switcher/lite_detection.php } $wp_cache_mobile_browsers = apply_filters( 'cached_mobile_browsers', $wp_cache_mobile_browsers ); // Allow mobile plugins access to modify the mobile UA list $wp_cache_mobile_prefixes = apply_filters( 'cached_mobile_prefixes', $wp_cache_mobile_prefixes ); // Allow mobile plugins access to modify the mobile UA prefix list if ( function_exists( 'do_cacheaction' ) ) { $wp_cache_mobile_browsers = do_cacheaction( 'wp_super_cache_mobile_browsers', $wp_cache_mobile_browsers ); $wp_cache_mobile_prefixes = do_cacheaction( 'wp_super_cache_mobile_prefixes', $wp_cache_mobile_prefixes ); } $mobile_groups = apply_filters( 'cached_mobile_groups', array() ); // Group mobile user agents by capabilities. Lump them all together by default // mobile_groups = array( 'apple' => array( 'ipod', 'iphone' ), 'nokia' => array( 'nokia5800', 'symbianos' ) ); $wp_cache_mobile_browsers = implode( ', ', $wp_cache_mobile_browsers ); $wp_cache_mobile_prefixes = implode( ', ', $wp_cache_mobile_prefixes ); if ( false == apply_filters( 'wp_super_cache_error_checking', true ) ) return false; if ( function_exists( 'get_supercache_dir' ) ) $supercachedir = get_supercache_dir(); if( get_option( 'gzipcompression' ) == 1 ) update_option( 'gzipcompression', 0 ); if( !isset( $cache_rebuild_files ) ) $cache_rebuild_files = 0; $valid_nonce = isset($_REQUEST['_wpnonce']) ? wp_verify_nonce($_REQUEST['_wpnonce'], 'wp-cache') : false; /* http://www.netlobo.com/div_hiding.html */ ?>
    '; echo ''; // Set a default. if ( false === $cache_enabled && ! isset( $wp_cache_mod_rewrite ) ) { $wp_cache_mod_rewrite = 0; } elseif ( ! isset( $wp_cache_mod_rewrite ) && $cache_enabled && $super_cache_enabled ) { $wp_cache_mod_rewrite = 1; } $admin_url = admin_url( 'options-general.php?page=wpsupercache' ); $curr_tab = ! empty( $_GET['tab'] ) ? sanitize_text_field( stripslashes( $_GET['tab'] ) ) : ''; // WPCS: sanitization ok. if ( empty( $curr_tab ) ) { $curr_tab = 'easy'; if ( $wp_cache_mod_rewrite ) { $curr_tab = 'settings'; echo '

    ' . __( 'Notice: Expert mode caching enabled. Showing Advanced Settings Page by default.', 'wp-super-cache' ) . '

    '; } } if ( 'preload' === $curr_tab ) { if ( true == $super_cache_enabled && ! defined( 'DISABLESUPERCACHEPRELOADING' ) ) { global $wp_cache_preload_interval, $wp_cache_preload_on, $wp_cache_preload_taxonomies, $wp_cache_preload_email_me, $wp_cache_preload_email_volume, $wp_cache_preload_posts, $wpdb; wpsc_preload_settings(); $currently_preloading = false; echo '
    '; } } wpsc_admin_tabs( $curr_tab ); echo '
    '; if ( isset( $wp_super_cache_front_page_check ) && $wp_super_cache_front_page_check == 1 && ! wp_next_scheduled( 'wp_cache_check_site_hook' ) ) { wp_schedule_single_event( time() + 360, 'wp_cache_check_site_hook' ); wp_cache_debug( 'scheduled wp_cache_check_site_hook for 360 seconds time.', 2 ); } if ( isset( $_REQUEST['wp_restore_config'] ) && $valid_nonce ) { unlink( $wp_cache_config_file ); echo '' . esc_html__( 'Configuration file changed, some values might be wrong. Load the page again from the "Settings" menu to reset them.', 'wp-super-cache' ) . ''; } if ( substr( get_option( 'permalink_structure' ), -1 ) == '/' ) { wp_cache_replace_line( '^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 1;", $wp_cache_config_file ); } else { wp_cache_replace_line( '^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 0;", $wp_cache_config_file ); } $home_path = parse_url( site_url() ); $home_path = trailingslashit( array_key_exists( 'path', $home_path ) ? $home_path['path'] : '' ); if ( ! isset( $wp_cache_home_path ) ) { $wp_cache_home_path = '/'; wp_cache_setting( 'wp_cache_home_path', '/' ); } if ( "$home_path" != "$wp_cache_home_path" ) { wp_cache_setting( 'wp_cache_home_path', $home_path ); } if ( $wp_cache_mobile_enabled == 1 ) { update_cached_mobile_ua_list( $wp_cache_mobile_browsers, $wp_cache_mobile_prefixes, $mobile_groups ); } ?>
    '; wp_cache_files(); break; case 'preload': wpsc_render_partial( 'preload', compact( 'cache_enabled', 'super_cache_enabled', 'admin_url', 'wp_cache_preload_interval', 'wp_cache_preload_on', 'wp_cache_preload_taxonomies', 'wp_cache_preload_email_me', 'wp_cache_preload_email_volume', 'currently_preloading', 'wp_cache_preload_posts' ) ); break; case 'plugins': wpsc_plugins_tab(); break; case 'debug': global $wp_super_cache_debug, $wp_cache_debug_log, $wp_cache_debug_ip, $wp_cache_debug_ip; global $wp_super_cache_front_page_text, $wp_super_cache_front_page_notification; global $wp_super_cache_advanced_debug, $wp_cache_debug_username, $wp_super_cache_front_page_clear; wpsc_render_partial( 'debug', compact( 'wp_super_cache_debug', 'wp_cache_debug_log', 'wp_cache_debug_ip', 'cache_path', 'valid_nonce', 'wp_cache_config_file', 'wp_super_cache_comments', 'wp_super_cache_front_page_check', 'wp_super_cache_front_page_clear', 'wp_super_cache_front_page_text', 'wp_super_cache_front_page_notification', 'wp_super_cache_advanced_debug', 'wp_cache_debug_username', 'wp_cache_home_path' ) ); break; case 'settings': global $cache_acceptable_files, $wpsc_rejected_cookies, $cache_rejected_uri, $wp_cache_pages; global $cache_max_time, $wp_cache_config_file, $valid_nonce, $super_cache_enabled, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval, $cache_time_interval, $cache_gc_email_me, $wp_cache_preload_on; wp_cache_update_rejected_pages(); wp_cache_update_rejected_cookies(); wp_cache_update_rejected_strings(); wp_cache_update_accepted_strings(); wp_cache_time_update(); wpsc_render_partial( 'advanced', compact( 'wp_cache_front_page_checks', 'admin_url', 'cache_enabled', 'super_cache_enabled', 'wp_cache_mod_rewrite', 'is_nginx', 'wp_cache_not_logged_in', 'wp_cache_no_cache_for_get', 'cache_compression', 'cache_rebuild_files', 'wpsc_save_headers', 'wp_supercache_304', 'wp_cache_make_known_anon', 'wp_cache_mfunc_enabled', 'wp_cache_mobile_enabled', 'wp_cache_mobile_browsers', 'wp_cache_disable_utf8', 'wp_cache_clear_on_post_edit', 'wp_cache_front_page_checks', 'wp_cache_refresh_single_only', 'wp_supercache_cache_list', 'wp_cache_mutex_disabled', 'wp_super_cache_late_init', 'cache_page_secret', 'cache_path', 'cache_acceptable_files', 'wpsc_rejected_cookies', 'cache_rejected_uri', 'wp_cache_pages', 'cache_max_time', 'valid_nonce', 'super_cache_enabled', 'cache_schedule_type', 'cache_scheduled_time', 'cache_schedule_interval', 'cache_time_interval', 'cache_gc_email_me', 'wp_cache_mobile_prefixes', 'wp_cache_preload_on' ) ); wpsc_edit_tracking_parameters(); wpsc_edit_rejected_ua(); wpsc_lockdown(); wpsc_restore_settings(); break; case 'easy': default: wpsc_render_partial( 'easy', array( 'admin_url' => $admin_url, 'cache_enabled' => $cache_enabled, 'is_nginx' => $is_nginx, 'wp_cache_mod_rewrite' => $wp_cache_mod_rewrite, 'valid_nonce' => $valid_nonce, 'cache_path' => $cache_path, 'wp_super_cache_comments' => $wp_super_cache_comments, ) ); break; } ?>

    1. Debug tab for diagnostics.', 'wp-super-cache' ), admin_url( 'options-general.php?page=wpsupercache&tab=debug' ) ); ?>
    2. plugin documentation.', 'wp-super-cache' ), 'https://jetpack.com/support/wp-super-cache/' ) ); ?>
    3. support forum.', 'wp-super-cache' ), 'https://wordpress.org/support/plugin/wp-super-cache/' ) ); ?>
    4. development version for the latest fixes (changelog).', 'wp-super-cache' ), 'https://odd.blog/y/2o', 'https://plugins.trac.wordpress.org/log/wp-super-cache/' ); ?>

    rate us and give feedback.', 'wp-super-cache' ), 'https://wordpress.org/support/plugin/wp-super-cache/reviews?rate=5#new-post' ); ?>

    %2$s', 'wp-super-cache' ), date( 'M j, Y', $start_date ), number_format( get_option( 'wpsupercache_count' ) ) ); ?>

      " . esc_html( substr( $url['url'] ?? '', 0, 20 ) ) . "\n"; } ?>

    '; echo '

    ' . esc_html__( 'Cache plugins are PHP scripts you\'ll find in a dedicated folder inside the WP Super Cache folder (wp-super-cache/plugins/). They load at the same time as WP Super Cache, and before regular WordPress plugins.', 'wp-super-cache' ) . '

    '; echo '

    ' . esc_html__( 'Keep in mind that cache plugins are for advanced users only. To create and manage them, you\'ll need extensive knowledge of both PHP and WordPress actions.', 'wp-super-cache' ) . '

    '; echo '

    ' . sprintf( __( 'Warning! Due to the way WordPress upgrades plugins, the ones you upload to the WP Super Cache folder (wp-super-cache/plugins/) will be deleted when you upgrade WP Super Cache. To avoid this loss, load your cache plugins from a different location. When you set $wp_cache_plugins_dir to the new location in wp-config.php, WP Super Cache will look there instead.
    You can find additional details in the developer documentation.', 'wp-super-cache' ), 'https://odd.blog/wp-super-cache-developers/' ) . '

    '; echo ''; echo '
    '; ob_start(); if ( defined( 'WP_CACHE' ) ) { if ( function_exists( 'do_cacheaction' ) ) { do_cacheaction( 'cache_admin_page' ); } } $out = ob_get_contents(); ob_end_clean(); if ( SUBMITDISABLED == ' ' && $out != '' ) { echo '

    ' . esc_html__( 'Available Plugins', 'wp-super-cache' ) . '

    '; echo '
      '; echo $out; echo '
    '; } echo '
    '; } function wpsc_admin_tabs( $current = '' ) { global $cache_enabled, $super_cache_enabled, $wp_cache_mod_rewrite; if ( '' === $current ) { $current = ! empty( $_GET['tab'] ) ? stripslashes( $_GET['tab'] ) : ''; // WPCS: CSRF ok, sanitization ok. } $admin_url = admin_url( 'options-general.php?page=wpsupercache' ); $admin_tabs = array( 'easy' => __( 'Easy', 'wp-super-cache' ), 'settings' => __( 'Advanced', 'wp-super-cache' ), 'cdn' => __( 'CDN', 'wp-super-cache' ), 'contents' => __( 'Contents', 'wp-super-cache' ), 'preload' => __( 'Preload', 'wp-super-cache' ), 'plugins' => __( 'Plugins', 'wp-super-cache' ), 'debug' => __( 'Debug', 'wp-super-cache' ), ); echo '
    '; } function supercache_admin_bar_render() { global $wp_admin_bar; if ( function_exists( '_deprecated_function' ) ) { _deprecated_function( __FUNCTION__, 'WP Super Cache 1.6.4' ); } wpsc_admin_bar_render( $wp_admin_bar ); } /** * Renders a partial/template. * * The global $current_user is made available for any rendered template. * * @param string $partial - Filename under ./partials directory, with or without .php (appended if absent). * @param array $page_vars - Variables made available for the template. */ function wpsc_render_partial( $partial, array $page_vars = array() ) { if ( ! str_ends_with( $partial, '.php' ) ) { $partial .= '.php'; } if ( strpos( $partial, 'partials/' ) !== 0 ) { $partial = 'partials/' . $partial; } $path = dirname( __DIR__ ) . '/' . $partial; if ( ! file_exists( $path ) ) { return; } foreach ( $page_vars as $key => $val ) { $$key = $val; } global $current_user; include $path; } /** * Render common header */ function wpsc_render_header() { ?>