Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-super...
File: wp-cache.php
}
[1500] Fix | Delete
}
[1501] Fix | Delete
if ( false == isset( $cached_direct_pages ) )
[1502] Fix | Delete
$cached_direct_pages = array();
[1503] Fix | Delete
}
[1504] Fix | Delete
if ( $valid_nonce && array_key_exists('new_direct_page', $_POST) && $_POST[ 'new_direct_page' ] && '' != $_POST[ 'new_direct_page' ] ) {
[1505] Fix | Delete
$page = str_replace( get_option( 'siteurl' ), '', $_POST[ 'new_direct_page' ] );
[1506] Fix | Delete
$page = str_replace( '..', '', preg_replace( '/[ <>\'\"\r\n\t\(\)\$\[\];#]/', '', $page ) );
[1507] Fix | Delete
if ( substr( $page, 0, 1 ) != '/' )
[1508] Fix | Delete
$page = '/' . $page;
[1509] Fix | Delete
if ( $page != '/' || false == is_array( $cached_direct_pages ) || in_array( $page, $cached_direct_pages ) == false ) {
[1510] Fix | Delete
$cached_direct_pages[] = $page;
[1511] Fix | Delete
$out .= "'$page', ";
[1512] Fix | Delete
[1513] Fix | Delete
@unlink( trailingslashit( ABSPATH . $page ) . "index.html" );
[1514] Fix | Delete
wpsc_delete_files( get_supercache_dir() . $page );
[1515] Fix | Delete
}
[1516] Fix | Delete
}
[1517] Fix | Delete
[1518] Fix | Delete
if ( $out != '' ) {
[1519] Fix | Delete
$out = substr( $out, 0, -2 );
[1520] Fix | Delete
}
[1521] Fix | Delete
if ( $out == "''" ) {
[1522] Fix | Delete
$out = '';
[1523] Fix | Delete
}
[1524] Fix | Delete
$out = '$cached_direct_pages = array( ' . $out . ' );';
[1525] Fix | Delete
wp_cache_replace_line('^ *\$cached_direct_pages', "$out", $wp_cache_config_file);
[1526] Fix | Delete
[1527] Fix | Delete
if ( !empty( $expiredfiles ) ) {
[1528] Fix | Delete
foreach( $expiredfiles as $file ) {
[1529] Fix | Delete
if( $file != '' ) {
[1530] Fix | Delete
$firstfolder = explode( '/', $file );
[1531] Fix | Delete
$firstfolder = ABSPATH . $firstfolder[1];
[1532] Fix | Delete
$file = ABSPATH . $file;
[1533] Fix | Delete
$file = realpath( str_replace( '..', '', preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $file ) ) );
[1534] Fix | Delete
if ( $file ) {
[1535] Fix | Delete
@unlink( trailingslashit( $file ) . "index.html" );
[1536] Fix | Delete
@unlink( trailingslashit( $file ) . "index.html.gz" );
[1537] Fix | Delete
RecursiveFolderDelete( trailingslashit( $firstfolder ) );
[1538] Fix | Delete
}
[1539] Fix | Delete
}
[1540] Fix | Delete
}
[1541] Fix | Delete
}
[1542] Fix | Delete
[1543] Fix | Delete
if ( $valid_nonce && array_key_exists('deletepage', $_POST) && $_POST[ 'deletepage' ] ) {
[1544] Fix | Delete
$page = str_replace( '..', '', preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $_POST['deletepage'] ) ) . '/';
[1545] Fix | Delete
$pagefile = realpath( ABSPATH . $page . 'index.html' );
[1546] Fix | Delete
if ( substr( $pagefile, 0, strlen( ABSPATH ) ) != ABSPATH || false == wp_cache_confirm_delete( ABSPATH . $page ) ) {
[1547] Fix | Delete
die( __( 'Cannot delete directory', 'wp-super-cache' ) );
[1548] Fix | Delete
}
[1549] Fix | Delete
$firstfolder = explode( '/', $page );
[1550] Fix | Delete
$firstfolder = ABSPATH . $firstfolder[1];
[1551] Fix | Delete
$page = ABSPATH . $page;
[1552] Fix | Delete
if( is_file( $pagefile ) && is_writeable_ACLSafe( $pagefile ) && is_writeable_ACLSafe( $firstfolder ) ) {
[1553] Fix | Delete
@unlink( $pagefile );
[1554] Fix | Delete
@unlink( $pagefile . '.gz' );
[1555] Fix | Delete
RecursiveFolderDelete( $firstfolder );
[1556] Fix | Delete
}
[1557] Fix | Delete
}
[1558] Fix | Delete
[1559] Fix | Delete
return $cached_direct_pages;
[1560] Fix | Delete
}
[1561] Fix | Delete
[1562] Fix | Delete
function wpsc_lockdown() {
[1563] Fix | Delete
global $cached_direct_pages, $cache_enabled, $super_cache_enabled;
[1564] Fix | Delete
[1565] Fix | Delete
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
[1566] Fix | Delete
$wp_lock_down = wp_update_lock_down();
[1567] Fix | Delete
[1568] Fix | Delete
wpsc_render_partial(
[1569] Fix | Delete
'lockdown',
[1570] Fix | Delete
compact( 'cached_direct_pages', 'cache_enabled', 'super_cache_enabled', 'admin_url', 'wp_lock_down' )
[1571] Fix | Delete
);
[1572] Fix | Delete
}
[1573] Fix | Delete
[1574] Fix | Delete
function RecursiveFolderDelete ( $folderPath ) { // from http://www.php.net/manual/en/function.rmdir.php
[1575] Fix | Delete
if( trailingslashit( constant( 'ABSPATH' ) ) == trailingslashit( $folderPath ) )
[1576] Fix | Delete
return false;
[1577] Fix | Delete
if ( @is_dir ( $folderPath ) ) {
[1578] Fix | Delete
$dh = @opendir($folderPath);
[1579] Fix | Delete
while (false !== ($value = @readdir($dh))) {
[1580] Fix | Delete
if ( $value != "." && $value != ".." ) {
[1581] Fix | Delete
$value = $folderPath . "/" . $value;
[1582] Fix | Delete
if ( @is_dir ( $value ) ) {
[1583] Fix | Delete
RecursiveFolderDelete ( $value );
[1584] Fix | Delete
}
[1585] Fix | Delete
}
[1586] Fix | Delete
}
[1587] Fix | Delete
return @rmdir ( $folderPath );
[1588] Fix | Delete
} else {
[1589] Fix | Delete
return FALSE;
[1590] Fix | Delete
}
[1591] Fix | Delete
}
[1592] Fix | Delete
[1593] Fix | Delete
function wp_cache_time_update() {
[1594] Fix | Delete
global $cache_max_time, $wp_cache_config_file, $valid_nonce, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval, $cache_time_interval, $cache_gc_email_me;
[1595] Fix | Delete
if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'expirytime' ) {
[1596] Fix | Delete
[1597] Fix | Delete
if ( false == $valid_nonce )
[1598] Fix | Delete
return false;
[1599] Fix | Delete
[1600] Fix | Delete
if( !isset( $cache_schedule_type ) ) {
[1601] Fix | Delete
$cache_schedule_type = 'interval';
[1602] Fix | Delete
wp_cache_replace_line('^ *\$cache_schedule_type', "\$cache_schedule_type = '$cache_schedule_type';", $wp_cache_config_file);
[1603] Fix | Delete
}
[1604] Fix | Delete
[1605] Fix | Delete
if( !isset( $cache_scheduled_time ) ) {
[1606] Fix | Delete
$cache_scheduled_time = '00:00';
[1607] Fix | Delete
wp_cache_replace_line('^ *\$cache_scheduled_time', "\$cache_scheduled_time = '$cache_scheduled_time';", $wp_cache_config_file);
[1608] Fix | Delete
}
[1609] Fix | Delete
[1610] Fix | Delete
if( !isset( $cache_max_time ) ) {
[1611] Fix | Delete
$cache_max_time = 3600;
[1612] Fix | Delete
wp_cache_replace_line('^ *\$cache_max_time', "\$cache_max_time = $cache_max_time;", $wp_cache_config_file);
[1613] Fix | Delete
}
[1614] Fix | Delete
[1615] Fix | Delete
if ( !isset( $cache_time_interval ) ) {
[1616] Fix | Delete
$cache_time_interval = $cache_max_time;
[1617] Fix | Delete
wp_cache_replace_line('^ *\$cache_time_interval', "\$cache_time_interval = '$cache_time_interval';", $wp_cache_config_file);
[1618] Fix | Delete
}
[1619] Fix | Delete
[1620] Fix | Delete
if ( isset( $_POST['wp_max_time'] ) ) {
[1621] Fix | Delete
$cache_max_time = (int)$_POST['wp_max_time'];
[1622] Fix | Delete
wp_cache_replace_line('^ *\$cache_max_time', "\$cache_max_time = $cache_max_time;", $wp_cache_config_file);
[1623] Fix | Delete
// schedule gc watcher
[1624] Fix | Delete
if ( false == wp_next_scheduled( 'wp_cache_gc_watcher' ) )
[1625] Fix | Delete
wp_schedule_event( time()+600, 'hourly', 'wp_cache_gc_watcher' );
[1626] Fix | Delete
}
[1627] Fix | Delete
[1628] Fix | Delete
if ( isset( $_POST[ 'cache_gc_email_me' ] ) ) {
[1629] Fix | Delete
$cache_gc_email_me = 1;
[1630] Fix | Delete
wp_cache_replace_line('^ *\$cache_gc_email_me', "\$cache_gc_email_me = $cache_gc_email_me;", $wp_cache_config_file);
[1631] Fix | Delete
} else {
[1632] Fix | Delete
$cache_gc_email_me = 0;
[1633] Fix | Delete
wp_cache_replace_line('^ *\$cache_gc_email_me', "\$cache_gc_email_me = $cache_gc_email_me;", $wp_cache_config_file);
[1634] Fix | Delete
}
[1635] Fix | Delete
if ( isset( $_POST[ 'cache_schedule_type' ] ) && $_POST[ 'cache_schedule_type' ] == 'interval' && isset( $_POST['cache_time_interval'] ) ) {
[1636] Fix | Delete
wp_clear_scheduled_hook( 'wp_cache_gc' );
[1637] Fix | Delete
$cache_schedule_type = 'interval';
[1638] Fix | Delete
if ( (int)$_POST[ 'cache_time_interval' ] == 0 )
[1639] Fix | Delete
$_POST[ 'cache_time_interval' ] = 600;
[1640] Fix | Delete
$cache_time_interval = (int)$_POST[ 'cache_time_interval' ];
[1641] Fix | Delete
wp_schedule_single_event( time() + $cache_time_interval, 'wp_cache_gc' );
[1642] Fix | Delete
wp_cache_replace_line('^ *\$cache_schedule_type', "\$cache_schedule_type = '$cache_schedule_type';", $wp_cache_config_file);
[1643] Fix | Delete
wp_cache_replace_line('^ *\$cache_time_interval', "\$cache_time_interval = '$cache_time_interval';", $wp_cache_config_file);
[1644] Fix | Delete
} else { // clock
[1645] Fix | Delete
wp_clear_scheduled_hook( 'wp_cache_gc' );
[1646] Fix | Delete
$cache_schedule_type = 'time';
[1647] Fix | Delete
if ( !isset( $_POST[ 'cache_scheduled_time' ] ) ||
[1648] Fix | Delete
$_POST[ 'cache_scheduled_time' ] == '' ||
[1649] Fix | Delete
5 != strlen( $_POST[ 'cache_scheduled_time' ] ) ||
[1650] Fix | Delete
":" != substr( $_POST[ 'cache_scheduled_time' ], 2, 1 )
[1651] Fix | Delete
)
[1652] Fix | Delete
$_POST[ 'cache_scheduled_time' ] = '00:00';
[1653] Fix | Delete
[1654] Fix | Delete
$cache_scheduled_time = $_POST[ 'cache_scheduled_time' ];
[1655] Fix | Delete
[1656] Fix | Delete
if ( ! preg_match( '/[0-9][0-9]:[0-9][0-9]/', $cache_scheduled_time ) ) {
[1657] Fix | Delete
$cache_scheduled_time = '00:00';
[1658] Fix | Delete
}
[1659] Fix | Delete
$schedules = wp_get_schedules();
[1660] Fix | Delete
if ( !isset( $cache_schedule_interval ) )
[1661] Fix | Delete
$cache_schedule_interval = 'daily';
[1662] Fix | Delete
if ( isset( $_POST[ 'cache_schedule_interval' ] ) && isset( $schedules[ $_POST[ 'cache_schedule_interval' ] ] ) )
[1663] Fix | Delete
$cache_schedule_interval = $_POST[ 'cache_schedule_interval' ];
[1664] Fix | Delete
wp_cache_replace_line('^ *\$cache_schedule_type', "\$cache_schedule_type = '$cache_schedule_type';", $wp_cache_config_file);
[1665] Fix | Delete
wp_cache_replace_line('^ *\$cache_schedule_interval', "\$cache_schedule_interval = '{$cache_schedule_interval}';", $wp_cache_config_file);
[1666] Fix | Delete
wp_cache_replace_line('^ *\$cache_scheduled_time', "\$cache_scheduled_time = '$cache_scheduled_time';", $wp_cache_config_file);
[1667] Fix | Delete
wp_schedule_event( strtotime( $cache_scheduled_time ), $cache_schedule_interval, 'wp_cache_gc' );
[1668] Fix | Delete
}
[1669] Fix | Delete
}
[1670] Fix | Delete
}
[1671] Fix | Delete
[1672] Fix | Delete
function wp_cache_sanitize_value($text, & $array) {
[1673] Fix | Delete
$text = esc_html(strip_tags($text));
[1674] Fix | Delete
$array = preg_split( '/[\s,]+/', rtrim( $text ) );
[1675] Fix | Delete
$text = var_export($array, true);
[1676] Fix | Delete
$text = preg_replace('/[\s]+/', ' ', $text);
[1677] Fix | Delete
return $text;
[1678] Fix | Delete
}
[1679] Fix | Delete
[1680] Fix | Delete
function wp_cache_update_rejected_ua() {
[1681] Fix | Delete
global $cache_rejected_user_agent, $wp_cache_config_file, $valid_nonce;
[1682] Fix | Delete
[1683] Fix | Delete
if ( !function_exists( 'apache_request_headers' ) ) return;
[1684] Fix | Delete
[1685] Fix | Delete
if ( isset( $_POST[ 'wp_rejected_user_agent' ] ) && $valid_nonce ) {
[1686] Fix | Delete
$_POST[ 'wp_rejected_user_agent' ] = str_replace( ' ', '___', $_POST[ 'wp_rejected_user_agent' ] );
[1687] Fix | Delete
$text = str_replace( '___', ' ', wp_cache_sanitize_value( $_POST[ 'wp_rejected_user_agent' ], $cache_rejected_user_agent ) );
[1688] Fix | Delete
wp_cache_replace_line( '^ *\$cache_rejected_user_agent', "\$cache_rejected_user_agent = $text;", $wp_cache_config_file );
[1689] Fix | Delete
foreach( $cache_rejected_user_agent as $k => $ua ) {
[1690] Fix | Delete
$cache_rejected_user_agent[ $k ] = str_replace( '___', ' ', $ua );
[1691] Fix | Delete
}
[1692] Fix | Delete
reset( $cache_rejected_user_agent );
[1693] Fix | Delete
}
[1694] Fix | Delete
}
[1695] Fix | Delete
[1696] Fix | Delete
function wpsc_edit_rejected_ua() {
[1697] Fix | Delete
global $cache_rejected_user_agent;
[1698] Fix | Delete
[1699] Fix | Delete
if ( ! function_exists( 'apache_request_headers' ) ) {
[1700] Fix | Delete
return;
[1701] Fix | Delete
}
[1702] Fix | Delete
[1703] Fix | Delete
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
[1704] Fix | Delete
wp_cache_update_rejected_ua();
[1705] Fix | Delete
wpsc_render_partial(
[1706] Fix | Delete
'rejected_user_agents',
[1707] Fix | Delete
compact( 'cache_rejected_user_agent', 'admin_url' )
[1708] Fix | Delete
);
[1709] Fix | Delete
}
[1710] Fix | Delete
[1711] Fix | Delete
function wp_cache_update_rejected_pages() {
[1712] Fix | Delete
global $wp_cache_config_file, $valid_nonce, $wp_cache_pages;
[1713] Fix | Delete
[1714] Fix | Delete
if ( isset( $_POST[ 'wp_edit_rejected_pages' ] ) && $valid_nonce ) {
[1715] Fix | Delete
$pages = array( 'single', 'pages', 'archives', 'tag', 'frontpage', 'home', 'category', 'feed', 'author', 'search' );
[1716] Fix | Delete
foreach( $pages as $page ) {
[1717] Fix | Delete
if ( isset( $_POST[ 'wp_cache_pages' ][ $page ] ) ) {
[1718] Fix | Delete
$value = 1;
[1719] Fix | Delete
} else {
[1720] Fix | Delete
$value = 0;
[1721] Fix | Delete
}
[1722] Fix | Delete
wp_cache_replace_line('^ *\$wp_cache_pages\[ "' . $page . '" \]', "\$wp_cache_pages[ \"{$page}\" ] = $value;", $wp_cache_config_file);
[1723] Fix | Delete
$wp_cache_pages[ $page ] = $value;
[1724] Fix | Delete
}
[1725] Fix | Delete
}
[1726] Fix | Delete
}
[1727] Fix | Delete
[1728] Fix | Delete
function wpsc_update_tracking_parameters() {
[1729] Fix | Delete
global $wpsc_tracking_parameters, $valid_nonce, $wp_cache_config_file;
[1730] Fix | Delete
[1731] Fix | Delete
if ( isset( $_POST['tracking_parameters'] ) && $valid_nonce ) {
[1732] Fix | Delete
$text = wp_cache_sanitize_value( str_replace( '\\\\', '\\', $_POST['tracking_parameters'] ), $wpsc_tracking_parameters );
[1733] Fix | Delete
wp_cache_replace_line( '^ *\$wpsc_tracking_parameters', "\$wpsc_tracking_parameters = $text;", $wp_cache_config_file );
[1734] Fix | Delete
wp_cache_setting( 'wpsc_ignore_tracking_parameters', isset( $_POST['wpsc_ignore_tracking_parameters'] ) ? 1 : 0 );
[1735] Fix | Delete
}
[1736] Fix | Delete
}
[1737] Fix | Delete
[1738] Fix | Delete
function wpsc_edit_tracking_parameters() {
[1739] Fix | Delete
global $wpsc_tracking_parameters, $wpsc_ignore_tracking_parameters;
[1740] Fix | Delete
[1741] Fix | Delete
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
[1742] Fix | Delete
wpsc_update_tracking_parameters();
[1743] Fix | Delete
[1744] Fix | Delete
if ( ! isset( $wpsc_tracking_parameters ) ) {
[1745] Fix | Delete
$wpsc_tracking_parameters = array( 'fbclid', 'ref', 'gclid', 'fb_source', 'mc_cid', 'mc_eid', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'utm_expid', 'mtm_source', 'mtm_medium', 'mtm_campaign', 'mtm_keyword', 'mtm_content', 'mtm_cid', 'mtm_group', 'mtm_placement' );
[1746] Fix | Delete
}
[1747] Fix | Delete
[1748] Fix | Delete
if ( ! isset( $wpsc_ignore_tracking_parameters ) ) {
[1749] Fix | Delete
$wpsc_ignore_tracking_parameters = 0;
[1750] Fix | Delete
}
[1751] Fix | Delete
wpsc_render_partial(
[1752] Fix | Delete
'tracking_parameters',
[1753] Fix | Delete
compact( 'wpsc_ignore_tracking_parameters', 'wpsc_tracking_parameters', 'admin_url' )
[1754] Fix | Delete
);
[1755] Fix | Delete
}
[1756] Fix | Delete
[1757] Fix | Delete
function wp_cache_update_rejected_cookies() {
[1758] Fix | Delete
global $wpsc_rejected_cookies, $wp_cache_config_file, $valid_nonce;
[1759] Fix | Delete
[1760] Fix | Delete
if ( isset( $_POST['wp_rejected_cookies'] ) && $valid_nonce ) {
[1761] Fix | Delete
$text = wp_cache_sanitize_value( str_replace( '\\\\', '\\', $_POST['wp_rejected_cookies'] ), $wpsc_rejected_cookies );
[1762] Fix | Delete
wp_cache_replace_line( '^ *\$wpsc_rejected_cookies', "\$wpsc_rejected_cookies = $text;", $wp_cache_config_file );
[1763] Fix | Delete
}
[1764] Fix | Delete
}
[1765] Fix | Delete
[1766] Fix | Delete
function wp_cache_update_rejected_strings() {
[1767] Fix | Delete
global $cache_rejected_uri, $wp_cache_config_file, $valid_nonce;
[1768] Fix | Delete
[1769] Fix | Delete
if ( isset($_REQUEST['wp_rejected_uri']) && $valid_nonce ) {
[1770] Fix | Delete
$text = wp_cache_sanitize_value( str_replace( '\\\\', '\\', $_REQUEST['wp_rejected_uri'] ), $cache_rejected_uri );
[1771] Fix | Delete
wp_cache_replace_line('^ *\$cache_rejected_uri', "\$cache_rejected_uri = $text;", $wp_cache_config_file);
[1772] Fix | Delete
}
[1773] Fix | Delete
}
[1774] Fix | Delete
[1775] Fix | Delete
function wp_cache_update_accepted_strings() {
[1776] Fix | Delete
global $cache_acceptable_files, $wp_cache_config_file, $valid_nonce;
[1777] Fix | Delete
[1778] Fix | Delete
if ( isset( $_REQUEST[ 'wp_accepted_files' ] ) && $valid_nonce ) {
[1779] Fix | Delete
$text = wp_cache_sanitize_value( $_REQUEST[ 'wp_accepted_files' ], $cache_acceptable_files );
[1780] Fix | Delete
wp_cache_replace_line( '^ *\$cache_acceptable_files', "\$cache_acceptable_files = $text;", $wp_cache_config_file );
[1781] Fix | Delete
}
[1782] Fix | Delete
}
[1783] Fix | Delete
[1784] Fix | Delete
function wpsc_update_debug_settings() {
[1785] Fix | Delete
global $wp_super_cache_debug, $wp_cache_debug_log, $wp_cache_debug_ip, $cache_path, $valid_nonce, $wp_cache_config_file, $wp_super_cache_comments;
[1786] Fix | Delete
global $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;
[1787] Fix | Delete
global $wp_cache_debug_username;
[1788] Fix | Delete
[1789] Fix | Delete
if ( ! isset( $wp_super_cache_comments ) ) {
[1790] Fix | Delete
$wp_super_cache_comments = 1; // defaults to "enabled".
[1791] Fix | Delete
wp_cache_setting( 'wp_super_cache_comments', $wp_super_cache_comments );
[1792] Fix | Delete
}
[1793] Fix | Delete
[1794] Fix | Delete
if ( false == $valid_nonce ) {
[1795] Fix | Delete
return array (
[1796] Fix | Delete
'wp_super_cache_debug' => $wp_super_cache_debug,
[1797] Fix | Delete
'wp_cache_debug_log' => $wp_cache_debug_log,
[1798] Fix | Delete
'wp_cache_debug_ip' => $wp_cache_debug_ip,
[1799] Fix | Delete
'wp_super_cache_comments' => $wp_super_cache_comments,
[1800] Fix | Delete
'wp_super_cache_front_page_check' => $wp_super_cache_front_page_check,
[1801] Fix | Delete
'wp_super_cache_front_page_clear' => $wp_super_cache_front_page_clear,
[1802] Fix | Delete
'wp_super_cache_front_page_text' => $wp_super_cache_front_page_text,
[1803] Fix | Delete
'wp_super_cache_front_page_notification' => $wp_super_cache_front_page_notification,
[1804] Fix | Delete
'wp_super_cache_advanced_debug' => $wp_super_cache_advanced_debug,
[1805] Fix | Delete
'wp_cache_debug_username' => $wp_cache_debug_username,
[1806] Fix | Delete
);
[1807] Fix | Delete
}
[1808] Fix | Delete
[1809] Fix | Delete
if ( isset( $_POST[ 'wpsc_delete_log' ] ) && $_POST[ 'wpsc_delete_log' ] == 1 && $wp_cache_debug_log != '' ) {
[1810] Fix | Delete
@unlink( $cache_path . $wp_cache_debug_log );
[1811] Fix | Delete
extract( wpsc_create_debug_log( $wp_cache_debug_log, $wp_cache_debug_username ) ); // $wp_cache_debug_log, $wp_cache_debug_username
[1812] Fix | Delete
}
[1813] Fix | Delete
[1814] Fix | Delete
if ( ! isset( $wp_cache_debug_log ) || $wp_cache_debug_log == '' ) {
[1815] Fix | Delete
extract( wpsc_create_debug_log() ); // $wp_cache_debug_log, $wp_cache_debug_username
[1816] Fix | Delete
} elseif ( ! file_exists( $cache_path . $wp_cache_debug_log ) ) { // make sure debug log exists before toggling debugging
[1817] Fix | Delete
extract( wpsc_create_debug_log( $wp_cache_debug_log, $wp_cache_debug_username ) ); // $wp_cache_debug_log, $wp_cache_debug_username
[1818] Fix | Delete
}
[1819] Fix | Delete
$wp_super_cache_debug = ( isset( $_POST[ 'wp_super_cache_debug' ] ) && $_POST[ 'wp_super_cache_debug' ] == 1 ) ? 1 : 0;
[1820] Fix | Delete
wp_cache_setting( 'wp_super_cache_debug', $wp_super_cache_debug );
[1821] Fix | Delete
[1822] Fix | Delete
if ( isset( $_POST[ 'wp_cache_debug' ] ) ) {
[1823] Fix | Delete
wp_cache_setting( 'wp_cache_debug_username', $wp_cache_debug_username );
[1824] Fix | Delete
wp_cache_setting( 'wp_cache_debug_log', $wp_cache_debug_log );
[1825] Fix | Delete
$wp_super_cache_comments = isset( $_POST[ 'wp_super_cache_comments' ] ) ? 1 : 0;
[1826] Fix | Delete
wp_cache_setting( 'wp_super_cache_comments', $wp_super_cache_comments );
[1827] Fix | Delete
if ( isset( $_POST[ 'wp_cache_debug_ip' ] ) && filter_var( $_POST[ 'wp_cache_debug_ip' ], FILTER_VALIDATE_IP ) ) {
[1828] Fix | Delete
$wp_cache_debug_ip = esc_html( preg_replace( '/[ <>\'\"\r\n\t\(\)\$\[\];#]/', '', $_POST[ 'wp_cache_debug_ip' ] ) );
[1829] Fix | Delete
} else {
[1830] Fix | Delete
$wp_cache_debug_ip = '';
[1831] Fix | Delete
}
[1832] Fix | Delete
wp_cache_setting( 'wp_cache_debug_ip', $wp_cache_debug_ip );
[1833] Fix | Delete
$wp_super_cache_front_page_check = isset( $_POST[ 'wp_super_cache_front_page_check' ] ) ? 1 : 0;
[1834] Fix | Delete
wp_cache_setting( 'wp_super_cache_front_page_check', $wp_super_cache_front_page_check );
[1835] Fix | Delete
$wp_super_cache_front_page_clear = isset( $_POST[ 'wp_super_cache_front_page_clear' ] ) ? 1 : 0;
[1836] Fix | Delete
wp_cache_setting( 'wp_super_cache_front_page_clear', $wp_super_cache_front_page_clear );
[1837] Fix | Delete
if ( isset( $_POST[ 'wp_super_cache_front_page_text' ] ) ) {
[1838] Fix | Delete
$wp_super_cache_front_page_text = esc_html( preg_replace( '/[ <>\'\"\r\n\t\(\)\$\[\];#]/', '', $_POST[ 'wp_super_cache_front_page_text' ] ) );
[1839] Fix | Delete
} else {
[1840] Fix | Delete
$wp_super_cache_front_page_text = '';
[1841] Fix | Delete
}
[1842] Fix | Delete
wp_cache_setting( 'wp_super_cache_front_page_text', $wp_super_cache_front_page_text );
[1843] Fix | Delete
$wp_super_cache_front_page_notification = isset( $_POST[ 'wp_super_cache_front_page_notification' ] ) ? 1 : 0;
[1844] Fix | Delete
wp_cache_setting( 'wp_super_cache_front_page_notification', $wp_super_cache_front_page_notification );
[1845] Fix | Delete
if ( $wp_super_cache_front_page_check == 1 && !wp_next_scheduled( 'wp_cache_check_site_hook' ) ) {
[1846] Fix | Delete
wp_schedule_single_event( time() + 360 , 'wp_cache_check_site_hook' );
[1847] Fix | Delete
wp_cache_debug( 'scheduled wp_cache_check_site_hook for 360 seconds time.' );
[1848] Fix | Delete
}
[1849] Fix | Delete
}
[1850] Fix | Delete
[1851] Fix | Delete
return array (
[1852] Fix | Delete
'wp_super_cache_debug' => $wp_super_cache_debug,
[1853] Fix | Delete
'wp_cache_debug_log' => $wp_cache_debug_log,
[1854] Fix | Delete
'wp_cache_debug_ip' => $wp_cache_debug_ip,
[1855] Fix | Delete
'wp_super_cache_comments' => $wp_super_cache_comments,
[1856] Fix | Delete
'wp_super_cache_front_page_check' => $wp_super_cache_front_page_check,
[1857] Fix | Delete
'wp_super_cache_front_page_clear' => $wp_super_cache_front_page_clear,
[1858] Fix | Delete
'wp_super_cache_front_page_text' => $wp_super_cache_front_page_text,
[1859] Fix | Delete
'wp_super_cache_front_page_notification' => $wp_super_cache_front_page_notification,
[1860] Fix | Delete
'wp_super_cache_advanced_debug' => $wp_super_cache_advanced_debug,
[1861] Fix | Delete
'wp_cache_debug_username' => $wp_cache_debug_username,
[1862] Fix | Delete
);
[1863] Fix | Delete
}
[1864] Fix | Delete
[1865] Fix | Delete
function wp_cache_enable() {
[1866] Fix | Delete
global $wp_cache_config_file, $cache_enabled;
[1867] Fix | Delete
[1868] Fix | Delete
if ( $cache_enabled ) {
[1869] Fix | Delete
wp_cache_debug( 'wp_cache_enable: already enabled' );
[1870] Fix | Delete
return true;
[1871] Fix | Delete
}
[1872] Fix | Delete
[1873] Fix | Delete
wp_cache_setting( 'cache_enabled', true );
[1874] Fix | Delete
wp_cache_debug( 'wp_cache_enable: enable cache' );
[1875] Fix | Delete
[1876] Fix | Delete
$cache_enabled = true;
[1877] Fix | Delete
[1878] Fix | Delete
if ( wpsc_set_default_gc() ) {
[1879] Fix | Delete
// gc might not be scheduled, check and schedule
[1880] Fix | Delete
$timestamp = wp_next_scheduled( 'wp_cache_gc' );
[1881] Fix | Delete
if ( false == $timestamp ) {
[1882] Fix | Delete
wp_schedule_single_event( time() + 600, 'wp_cache_gc' );
[1883] Fix | Delete
}
[1884] Fix | Delete
}
[1885] Fix | Delete
}
[1886] Fix | Delete
[1887] Fix | Delete
function wp_cache_disable() {
[1888] Fix | Delete
global $wp_cache_config_file, $cache_enabled;
[1889] Fix | Delete
[1890] Fix | Delete
if ( ! $cache_enabled ) {
[1891] Fix | Delete
wp_cache_debug( 'wp_cache_disable: already disabled' );
[1892] Fix | Delete
return true;
[1893] Fix | Delete
}
[1894] Fix | Delete
[1895] Fix | Delete
wp_cache_setting( 'cache_enabled', false );
[1896] Fix | Delete
wp_cache_debug( 'wp_cache_disable: disable cache' );
[1897] Fix | Delete
[1898] Fix | Delete
$cache_enabled = false;
[1899] Fix | Delete
[1900] Fix | Delete
wp_clear_scheduled_hook( 'wp_cache_check_site_hook' );
[1901] Fix | Delete
wp_clear_scheduled_hook( 'wp_cache_gc' );
[1902] Fix | Delete
wp_clear_scheduled_hook( 'wp_cache_gc_watcher' );
[1903] Fix | Delete
}
[1904] Fix | Delete
[1905] Fix | Delete
function wp_super_cache_enable() {
[1906] Fix | Delete
global $supercachedir, $wp_cache_config_file, $super_cache_enabled;
[1907] Fix | Delete
[1908] Fix | Delete
if ( $super_cache_enabled ) {
[1909] Fix | Delete
wp_cache_debug( 'wp_super_cache_enable: already enabled' );
[1910] Fix | Delete
return true;
[1911] Fix | Delete
}
[1912] Fix | Delete
[1913] Fix | Delete
wp_cache_setting( 'super_cache_enabled', true );
[1914] Fix | Delete
wp_cache_debug( 'wp_super_cache_enable: enable cache' );
[1915] Fix | Delete
[1916] Fix | Delete
$super_cache_enabled = true;
[1917] Fix | Delete
[1918] Fix | Delete
if ( ! $supercachedir ) {
[1919] Fix | Delete
$supercachedir = get_supercache_dir();
[1920] Fix | Delete
}
[1921] Fix | Delete
[1922] Fix | Delete
if ( is_dir( $supercachedir . '.disabled' ) ) {
[1923] Fix | Delete
if ( is_dir( $supercachedir ) ) {
[1924] Fix | Delete
prune_super_cache( $supercachedir . '.disabled', true );
[1925] Fix | Delete
@unlink( $supercachedir . '.disabled' );
[1926] Fix | Delete
} else {
[1927] Fix | Delete
@rename( $supercachedir . '.disabled', $supercachedir );
[1928] Fix | Delete
}
[1929] Fix | Delete
}
[1930] Fix | Delete
}
[1931] Fix | Delete
[1932] Fix | Delete
function wp_super_cache_disable() {
[1933] Fix | Delete
global $cache_path, $supercachedir, $wp_cache_config_file, $super_cache_enabled;
[1934] Fix | Delete
[1935] Fix | Delete
if ( ! $super_cache_enabled ) {
[1936] Fix | Delete
wp_cache_debug( 'wp_super_cache_disable: already disabled' );
[1937] Fix | Delete
return true;
[1938] Fix | Delete
}
[1939] Fix | Delete
[1940] Fix | Delete
wp_cache_setting( 'super_cache_enabled', false );
[1941] Fix | Delete
wp_cache_debug( 'wp_super_cache_disable: disable cache' );
[1942] Fix | Delete
[1943] Fix | Delete
$super_cache_enabled = false;
[1944] Fix | Delete
[1945] Fix | Delete
if ( ! $supercachedir ) {
[1946] Fix | Delete
$supercachedir = get_supercache_dir();
[1947] Fix | Delete
}
[1948] Fix | Delete
[1949] Fix | Delete
if ( is_dir( $supercachedir ) ) {
[1950] Fix | Delete
@rename( $supercachedir, $supercachedir . '.disabled' );
[1951] Fix | Delete
}
[1952] Fix | Delete
sleep( 1 ); // allow existing processes to write to the supercachedir and then delete it
[1953] Fix | Delete
if ( function_exists( 'prune_super_cache' ) && is_dir( $supercachedir ) ) {
[1954] Fix | Delete
prune_super_cache( $cache_path, true );
[1955] Fix | Delete
}
[1956] Fix | Delete
[1957] Fix | Delete
if ( $GLOBALS['wp_cache_mod_rewrite'] === 1 ) {
[1958] Fix | Delete
remove_mod_rewrite_rules();
[1959] Fix | Delete
}
[1960] Fix | Delete
}
[1961] Fix | Delete
[1962] Fix | Delete
function wp_cache_is_enabled() {
[1963] Fix | Delete
global $wp_cache_config_file;
[1964] Fix | Delete
[1965] Fix | Delete
if ( get_option( 'gzipcompression' ) ) {
[1966] Fix | Delete
echo '<strong>' . __( 'Warning', 'wp-super-cache' ) . '</strong>: ' . __( 'GZIP compression is enabled in WordPress, wp-cache will be bypassed until you disable gzip compression.', 'wp-super-cache' );
[1967] Fix | Delete
return false;
[1968] Fix | Delete
}
[1969] Fix | Delete
[1970] Fix | Delete
$lines = file( $wp_cache_config_file );
[1971] Fix | Delete
foreach ( $lines as $line ) {
[1972] Fix | Delete
if ( preg_match( '/^\s*\$cache_enabled\s*=\s*true\s*;/', $line ) ) {
[1973] Fix | Delete
return true;
[1974] Fix | Delete
}
[1975] Fix | Delete
}
[1976] Fix | Delete
[1977] Fix | Delete
return false;
[1978] Fix | Delete
}
[1979] Fix | Delete
[1980] Fix | Delete
function wp_cache_remove_index() {
[1981] Fix | Delete
global $cache_path;
[1982] Fix | Delete
[1983] Fix | Delete
if ( empty( $cache_path ) ) {
[1984] Fix | Delete
return;
[1985] Fix | Delete
}
[1986] Fix | Delete
[1987] Fix | Delete
@unlink( $cache_path . "index.html" );
[1988] Fix | Delete
@unlink( $cache_path . "supercache/index.html" );
[1989] Fix | Delete
@unlink( $cache_path . "blogs/index.html" );
[1990] Fix | Delete
if ( is_dir( $cache_path . "blogs" ) ) {
[1991] Fix | Delete
$dir = new DirectoryIterator( $cache_path . "blogs" );
[1992] Fix | Delete
foreach( $dir as $fileinfo ) {
[1993] Fix | Delete
if ( $fileinfo->isDot() ) {
[1994] Fix | Delete
continue;
[1995] Fix | Delete
}
[1996] Fix | Delete
if ( $fileinfo->isDir() ) {
[1997] Fix | Delete
$directory = $cache_path . "blogs/" . $fileinfo->getFilename();
[1998] Fix | Delete
if ( is_file( $directory . "/index.html" ) ) {
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function