Commit 5ede0f80 authored by samba's avatar samba

[auto] plugin: wp-super-cache 1.6.5

parent 690dda06
......@@ -4,16 +4,15 @@ function domain_mapping_gc_cache( $function, $directory ) {
global $cache_path;
if ( ! function_exists( 'domain_mapping_warning' ) ) {
return false;
return;
}
$siteurl = domain_mapping_siteurl( false );
if ( ! $siteurl ) {
return false;
return;
}
$protocol = ( isset( $_SERVER['HTTPS'] ) && 'on' === strtolower( $_SERVER['HTTPS'] ) ) ? 'https://' : 'http://';
$siteurl = trailingslashit( str_replace( $protocol, '', $siteurl ) );
$sitedir = trailingslashit( preg_replace( '`^(https?:)?//`', '', $siteurl ) );
if ( 'homepage' === $directory ) {
$directory = '';
......@@ -21,20 +20,17 @@ function domain_mapping_gc_cache( $function, $directory ) {
switch ( $function ) {
case 'rebuild':
@wp_cache_rebuild_or_delete( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html' );
@wp_cache_rebuild_or_delete( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html.gz' );
wpsc_rebuild_files( $cache_path . 'supercache/' . $sitedir . $directory );
break;
case 'prune':
prune_super_cache( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html', true, true );
prune_super_cache( $cache_path . 'supercache/' . $siteurl . $directory . 'index.html.gz', true, true );
wpsc_delete_files( $cache_path . 'supercache/' . $sitedir . $directory );
break;
}
return $directory;
}
function domain_mapping_supercachedir( $dir ) {
global $cache_path;
if ( ! function_exists( 'domain_mapping_warning' ) ) {
return $dir;
}
......@@ -44,56 +40,62 @@ function domain_mapping_supercachedir( $dir ) {
return $dir;
}
$protocol = ( isset( $_SERVER['HTTPS'] ) && 'on' === strtolower( $_SERVER['HTTPS'] ) ) ? 'https://' : 'http://';
$siteurl = str_replace( $protocol, '', $siteurl );
return trailingslashit( $cache_path . 'supercache/' . $siteurl );
$sitedir = trailingslashit( preg_replace( '`^(https?:)?//`', '', $siteurl ) );
return trailingslashit( $cache_path . 'supercache/' . $sitedir );
}
function domain_mapping_actions() {
global $cache_domain_mapping;
if ( '1' === $cache_domain_mapping ) {
add_filter( 'wp_super_cache_supercachedir', 'domain_mapping_supercachedir' );
add_action( 'gc_cache', 'domain_mapping_gc_cache', 10, 2 );
$cache_domain_mapping = (int) $cache_domain_mapping;
if ( 1 !== $cache_domain_mapping ) {
return;
}
add_filter( 'wp_super_cache_supercachedir', 'domain_mapping_supercachedir' );
add_action( 'gc_cache', 'domain_mapping_gc_cache', 10, 2 );
}
add_cacheaction( 'add_cacheaction', 'domain_mapping_actions' );
function wp_supercache_domain_mapping_admin() {
global $cache_domain_mapping, $wp_cache_config_file, $valid_nonce;
$cache_domain_mapping = '' === $cache_domain_mapping ? '0' : $cache_domain_mapping;
$requested_state = isset( $_POST['cache_domain_mapping'] ) ? (int) $_POST['cache_domain_mapping'] : null;
$cache_domain_mapping = (int) $cache_domain_mapping;
if ( isset( $_POST['cache_domain_mapping'] ) && $valid_nonce ) {
if ( $cache_domain_mapping === (int) $_POST['cache_domain_mapping'] ) {
$changed = false;
} else {
$changed = true;
}
$cache_domain_mapping = (int) $_POST['cache_domain_mapping'];
wp_cache_replace_line( '^ *\$cache_domain_mapping', "\$cache_domain_mapping = '$cache_domain_mapping';", $wp_cache_config_file );
$changed = false;
if ( null !== $requested_state && $valid_nonce ) {
$cache_domain_mapping = $requested_state;
wp_cache_replace_line( '^\s*\$cache_domain_mapping\s*=', '$cache_domain_mapping = ' . intval( $cache_domain_mapping ) . ';', $wp_cache_config_file );
$changed = true;
}
$id = 'domain_mapping-section';
?>
<fieldset id="<?php echo $id; ?>" class="options">
<h4><?php _e( 'Domain Mapping', 'wp-super-cache' ); ?></h4>
<fieldset id="<?php echo esc_attr( $id ); ?>" class="options">
<h4><?php esc_html_e( 'Domain Mapping', 'wp-super-cache' ); ?></h4>
<form name="wp_manager" action="" method="post">
<label><input type="radio" name="cache_domain_mapping" value="1" <?php if ( $cache_domain_mapping ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Enabled', 'wp-super-cache' ); ?></label>
<label><input type="radio" name="cache_domain_mapping" value="0" <?php if ( ! $cache_domain_mapping ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Disabled', 'wp-super-cache' ); ?></label>
<p><?php _e( '', 'wp-super-cache' ); ?></p>
<?php
echo '<p>' . __( 'Provides support for <a href="https://wordpress.org/plugins/wordpress-mu-domain-mapping/">Domain Mapping</a> plugin to map multiple domains to a blog.', 'wp-super-cache' ) . '</p>';
if ( isset( $changed ) && $changed ) {
if ( $cache_domain_mapping ) {
$status = __( 'enabled', 'wp-super-cache' );
} else {
$status = __( 'disabled', 'wp-super-cache' );
<label><input type="radio" name="cache_domain_mapping" value="1" <?php checked( $cache_domain_mapping ); ?>/> <?php esc_html_e( 'Enabled', 'wp-super-cache' ); ?></label>
<label><input type="radio" name="cache_domain_mapping" value="0" <?php checked( ! $cache_domain_mapping ); ?>/> <?php esc_html_e( 'Disabled', 'wp-super-cache' ); ?></label>
<?php
echo '<p>' . __( 'Provides support for <a href="https://wordpress.org/plugins/wordpress-mu-domain-mapping/">Domain Mapping</a> plugin to map multiple domains to a blog.', 'wp-super-cache' ) . '</p>';
if ( $changed ) {
echo '<p><strong>' . sprintf(
esc_html__( 'Domain Mapping support is now %s', 'wp-super-cache' ),
esc_html( $cache_domain_mapping ? __( 'enabled', 'wp-super-cache' ) : __( 'disabled', 'wp-super-cache' ) )
) . '</strong></p>';
}
echo '<p><strong>' . sprintf( __( 'Domain Mapping support is now %s', 'wp-super-cache' ), $status ) . '</strong></p>';
}
echo '<div class="submit"><input class="button-primary" ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field( 'wp-cache' );
?>
</form>
echo '<div class="submit"><input class="button-primary" ' . SUBMITDISABLED . ' type="submit" value="' . esc_html__( 'Update', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field( 'wp-cache' );
?>
</form>
</fieldset>
<?php
}
......@@ -101,14 +103,17 @@ add_cacheaction( 'cache_admin_page', 'wp_supercache_domain_mapping_admin' );
function wp_supercache_domain_mapping_notice() {
global $cache_enabled;
if ( $cache_enabled ) {
echo '<div class="error"><p><strong>' . __( 'Domain Mapping plugin detected! Please go to the Supercache plugins page and enable the domain mapping helper plugin.', 'wp-super-cache' ) . '</strong></p></div>';
echo '<div class="error"><p><strong>' . esc_html__( 'Domain Mapping plugin detected! Please go to the Supercache plugins page and enable the domain mapping helper plugin.', 'wp-super-cache' ) . '</strong></p></div>';
}
}
function wp_supercache_domain_mapping_exists() {
global $cache_domain_mapping;
if ( '1' === $cache_domain_mapping ) {
return false;
$cache_domain_mapping = (int) $cache_domain_mapping;
if ( 1 === $cache_domain_mapping ) {
return;
}
if ( is_admin() && function_exists( 'domain_mapping_warning' ) ) {
......@@ -124,8 +129,8 @@ function wpsc_domain_mapping_list( $list ) {
$list['domain_mapping'] = array(
'key' => 'domain_mapping',
'url' => 'https://wordpress.org/plugins/wordpress-mu-domain-mapping/',
'title' => __( 'Domain Mapping', 'wp-super-cache' ),
'desc' => __( 'Provides support for Domain Mapping plugin to map multiple domains to a blog.', 'wp-super-cache' ),
'title' => esc_html__( 'Domain Mapping', 'wp-super-cache' ),
'desc' => esc_html__( 'Provides support for Domain Mapping plugin to map multiple domains to a blog.', 'wp-super-cache' ),
);
return $list;
}
......
<?php
if ( ( defined( 'WP_ALLOW_MULTISITE' ) && constant( 'WP_ALLOW_MULTISITE' ) === true ) || defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) {
if ( is_multisite() ) {
add_cacheaction( 'add_cacheaction', 'wp_super_cache_multisite_init' );
}
......
# WP Super Cache #
* Contributors: donncha, automattic, kraftbj
* Tags: performance, caching, wp-cache, wp-super-cache, cache
* Tested up to: 5.0.2
* Stable tag: 1.6.4
* Tested up to: 5.1.1
* Stable tag: 1.6.5
* Requires at least: 3.1
* Requires PHP: 5.2.4
* License: GPLv2 or later
......@@ -266,6 +266,28 @@ Your theme is probably responsive which means it resizes the page to suit whatev
## Changelog ##
### 1.6.5 ###
* Check advanced-cache.php was created by the plugin before modifying/deleting it. (#666)
* When saving settings, save blank lines. Fixes problems with WP_CACHE and WPCACHEHOME in wp-config.php. Related to #652. (#667)
* Update outdated code and use is_multisite() (#600)
* Fix the delete cache button in the admin bar. (#603)
* Code cleanup in #602
* Use get_post_status instead of post_status (#623)
* Fixes button - Update Direct Pages (#622)
* Removes apache_response_headers and uses only headers_list (#618)
* Function is_site_admin has been deprecated (#611)
* Fixes action urls in wp_cache_manager (#610)
* Remove the link to the HibbsLupusTrust tweet. (#635)
* Don't load wp-cache-config.php if it's already loaded (#605)
* PHPCS fixes and optimization for plugins/domain-mapping.php (#615)
* Introduces PHP_VERSION_ID for faster checking (#604)
* Fixes regex and optimizes ossdl-cdn.php (#596)
* Only update new settings and use a temporary file to avoid corruption. (#652)
* Serve cached files to rejected user agents, don't cache them. (#658)
* Combine multiple headers with the same name (#641)
* Open ‘Delete Cache’ link in same window (#656)
* Promote the Jetpack Site Accelerator on the CDN page. (#636)
### 1.6.4 ###
* Changes between [1.6.3 and 1.6.4](https://github.com/Automattic/wp-super-cache/compare/1.6.3...1.6.4)
* Fixes for WP-CLI (#587) (#592)
......@@ -691,4 +713,4 @@ Your theme is probably responsive which means it resizes the page to suit whatev
## Upgrade Notice ##
Bug fixes
Many bug fixes
<?php
global $WPSC_HTTP_HOST, $blogcacheid;
global $WPSC_HTTP_HOST, $cache_enabled, $cache_path, $blogcacheid, $blog_cache_dir;
if ( ! empty( $_SERVER['HTTP_HOST'] ) ) {
$WPSC_HTTP_HOST = htmlentities( $_SERVER['HTTP_HOST'] );
$WPSC_HTTP_HOST = function_exists( 'mb_strtolower' ) ? mb_strtolower( $_SERVER['HTTP_HOST'] ) : strtolower( $_SERVER['HTTP_HOST'] );
$WPSC_HTTP_HOST = htmlentities( $WPSC_HTTP_HOST );
} elseif ( PHP_SAPI === 'cli' && function_exists( 'get_option' ) ) {
$WPSC_HTTP_HOST = (string) parse_url( get_option( 'home' ), PHP_URL_HOST );
} else {
......@@ -11,29 +12,36 @@ if ( ! empty( $_SERVER['HTTP_HOST'] ) ) {
}
// We want to be able to identify each blog in a WordPress MU install
$blogcacheid = '';
if ( ( defined( 'WP_ALLOW_MULTISITE' ) && constant( 'WP_ALLOW_MULTISITE' ) == true ) || defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) {
$blogcacheid = 'blog'; // main blog
if ( defined( 'SUBDOMAIN_INSTALL' ) && constant( 'SUBDOMAIN_INSTALL' ) == true ) {
$blogcacheid = '';
$blog_cache_dir = $cache_path;
if ( is_multisite() ) {
global $current_blog;
if ( is_object( $current_blog ) && function_exists( 'is_subdomain_install' ) ) {
$blogcacheid = is_subdomain_install() ? $current_blog->domain : trim( $current_blog->path, '/' );
} elseif ( ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) || ( defined( 'VHOST' ) && VHOST === 'yes' ) ) {
$blogcacheid = $WPSC_HTTP_HOST;
} else {
if ( isset( $base ) == false ) {
$base = '';
}
$request_uri = str_replace( '..', '', preg_replace( '/[ <>\'\"\r\n\t\(\)]/', '', $_SERVER['REQUEST_URI'] ) );
if ( strlen( $request_uri ) > 0 && strpos( $request_uri, '/', 1 ) ) {
if ( $base == '/' ) {
$blogcacheid = substr( $request_uri, 1, strpos( $request_uri, '/', 1 ) - 1 );
} else {
$blogcacheid = str_replace( $base, '', $request_uri );
if ( $blogcacheid != '' ) {
$blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) );
}
}
if ( '/' == substr( $blogcacheid, -1 ) ) {
$blogcacheid = substr( $blogcacheid, 0, -1 );
}
$request_uri = str_replace( '//', '/', $request_uri );
$wpsc_path_segs = array_filter( explode( '/', trim( $request_uri, '/' ) ) );
$wpsc_base_count = defined( 'PATH_CURRENT_SITE' ) ? count( array_filter( explode( '/', trim( PATH_CURRENT_SITE, '/' ) ) ) ) : 0;
if ( '/' !== substr( $request_uri, -1 ) ) {
$wpsc_path_segs = array_slice( $wpsc_path_segs, 0, -1 );
}
$blogcacheid = str_replace( '/', '', $blogcacheid );
if ( count( $wpsc_path_segs ) > $wpsc_base_count &&
( ! defined( 'PATH_CURRENT_SITE' ) || 0 === strpos( $request_uri, PATH_CURRENT_SITE ) )
) {
$blogcacheid = $wpsc_path_segs[ $wpsc_base_count ];
}
}
// If blogcacheid is empty then set it to main blog.
if ( empty( $blogcacheid ) ) {
$blogcacheid = 'blog';
}
$blog_cache_dir = str_replace( '//', '/', $cache_path . 'blogs/' . $blogcacheid . '/' );
}
......@@ -76,7 +76,6 @@ $wp_cache_pages[ "author" ] = 0;
$wp_cache_hide_donation = 0;
$wp_cache_not_logged_in = 0;
$wp_cache_clear_on_post_edit = 0;
$wp_cache_hello_world = 0;
$wp_cache_mobile_enabled = 0;
$wp_cache_cron_check = 0;
$wp_cache_mfunc_enabled = 0;
......
......@@ -52,11 +52,6 @@ function wp_cache_serve_cache_file() {
return false;
}
if ( wp_cache_user_agent_is_rejected() ) {
wp_cache_debug( 'No wp-cache file served as user agent rejected.', 5 );
return false;
}
if ( $wp_cache_no_cache_for_get && false == empty( $_GET ) ) {
wp_cache_debug( 'Non empty GET request. Caching disabled on settings page. ' . wpsc_dump_get_request(), 1 );
return false;
......@@ -226,10 +221,11 @@ function wp_cache_serve_cache_file() {
} else {
$ungzip = false;
}
foreach ($meta[ 'headers' ] as $t => $header) {
foreach ( $meta['headers'] as $t => $header ) {
// godaddy fix, via http://blog.gneu.org/2008/05/wp-supercache-on-godaddy/ and http://www.littleredrails.com/blog/2007/09/08/using-wp-cache-on-godaddy-500-error/
if( strpos( $header, 'Last-Modified:' ) === false )
header($header);
if ( strpos( $header, 'Last-Modified:' ) === false ) {
header( $header );
}
}
if ( isset( $wpsc_served_header ) && $wpsc_served_header ) {
header( 'X-WP-Super-Cache: Served WPCache cache file' );
......@@ -825,7 +821,7 @@ function get_oc_key( $url = false ) {
global $wp_cache_gzip_encoding, $WPSC_HTTP_HOST;
if ( $url ) {
$key = intval( $_SERVER[ 'SERVER_PORT' ] ) . strtolower( preg_replace( '/:.*$/', '', $WPSC_HTTP_HOST ) ) . $url;
$key = intval( $_SERVER[ 'SERVER_PORT' ] ) . preg_replace( '/:.*$/', '', $WPSC_HTTP_HOST ) . $url;
} else {
$key = get_current_url_supercache_dir();
}
......@@ -1109,13 +1105,23 @@ function wp_cache_replace_line( $old, $new, $my_file ) {
}
}
foreach( (array) $lines as $line ) {
if ( preg_match("/$old/", $line)) {
if (
trim( $new ) != '' &&
trim( $new ) == trim( $line )
) {
wp_cache_debug( "wp_cache_replace_line: setting not changed - $new" );
return false;
} elseif ( preg_match( "/$old/", $line ) ) {
wp_cache_debug( "wp_cache_replace_line: changing line " . trim( $line ) . " to *$new*" );
$found = true;
break;
}
}
$fd = fopen( $my_file, 'w' );
$tmp_config_filename = tempnam( $GLOBALS['cache_path'], 'wpsc' );
rename( $tmp_config_filename, $tmp_wpcache_filename . ".php" );
$tmp_config_filename .= ".php";
wp_cache_debug( 'wp_cache_replace_line: writing to ' . $tmp_config_filename );
$fd = fopen( $tmp_config_filename, 'w' );
if ( ! $fd ) {
if ( function_exists( 'set_transient' ) ) {
set_transient( 'wpsc_config_error', 'config_file_ro', 10 );
......@@ -1144,6 +1150,8 @@ function wp_cache_replace_line( $old, $new, $my_file ) {
}
}
fclose( $fd );
rename( $tmp_config_filename, $my_file );
wp_cache_debug( 'wp_cache_replace_line: moved ' . $tmp_config_filename . ' to ' . $my_file );
if ( function_exists( "opcache_invalidate" ) ) {
@opcache_invalidate( $my_file );
......@@ -1160,6 +1168,11 @@ function wp_cache_phase2() {
return false;
}
if ( wp_cache_user_agent_is_rejected() ) {
wp_cache_debug( 'wp_cache_phase2: No caching to do as user agent rejected.' );
return false;
}
wp_cache_debug( 'In WP Cache Phase 2', 5 );
$wp_cache_gmt_offset = get_option( 'gmt_offset' ); // caching for later use when wpdb is gone. https://wordpress.org/support/topic/224349
......@@ -1374,79 +1387,83 @@ function wp_cache_user_agent_is_rejected() {
function wp_cache_get_response_headers() {
static $known_headers = array(
'Access-Control-Allow-Origin',
'Accept-Ranges',
'Age',
'Allow',
'Cache-Control',
'Connection',
'Content-Encoding',
'Content-Language',
'Content-Length',
'Content-Location',
'Content-MD5',
'Content-Disposition',
'Content-Range',
'Content-Type',
'Date',
'ETag',
'Expires',
'Last-Modified',
'Link',
'Location',
'P3P',
'Pragma',
'Proxy-Authenticate',
"Referrer-Policy",
'Refresh',
'Retry-After',
'Server',
'Status',
'Strict-Transport-Security',
'Trailer',
'Transfer-Encoding',
'Upgrade',
'Vary',
'Via',
'Warning',
'WWW-Authenticate',
'X-Frame-Options',
'Public-Key-Pins',
'X-XSS-Protection',
'Content-Security-Policy',
"X-Pingback",
'X-Content-Security-Policy',
'X-WebKit-CSP',
'X-Content-Type-Options',
'X-Powered-By',
'X-UA-Compatible',
'X-Robots-Tag',
);
'Access-Control-Allow-Origin',
'Accept-Ranges',
'Age',
'Allow',
'Cache-Control',
'Connection',
'Content-Encoding',
'Content-Language',
'Content-Length',
'Content-Location',
'Content-MD5',
'Content-Disposition',
'Content-Range',
'Content-Type',
'Date',
'ETag',
'Expires',
'Last-Modified',
'Link',
'Location',
'P3P',
'Pragma',
'Proxy-Authenticate',
'Referrer-Policy',
'Refresh',
'Retry-After',
'Server',
'Status',
'Strict-Transport-Security',
'Trailer',
'Transfer-Encoding',
'Upgrade',
'Vary',
'Via',
'Warning',
'WWW-Authenticate',
'X-Frame-Options',
'Public-Key-Pins',
'X-XSS-Protection',
'Content-Security-Policy',
'X-Pingback',
'X-Content-Security-Policy',
'X-WebKit-CSP',
'X-Content-Type-Options',
'X-Powered-By',
'X-UA-Compatible',
'X-Robots-Tag',
);
if ( ! function_exists( 'headers_list' ) ) {
return array();
}
$known_headers = apply_filters( 'wpsc_known_headers', $known_headers );
if ( ! isset( $known_headers[ 'age' ] ) ) {
if ( ! isset( $known_headers['age'] ) ) {
$known_headers = array_map( 'strtolower', $known_headers );
}
$headers = array();
if ( function_exists( 'apache_response_headers' ) ) {
$headers = apache_response_headers();
}
if ( empty( $headers ) && function_exists( 'headers_list' ) ) {
$headers = array();
foreach( headers_list() as $hdr ) {
$header_parts = explode( ':', $hdr, 2 );
$header_name = isset( $header_parts[0] ) ? trim( $header_parts[0] ) : '';
$header_value = isset( $header_parts[1] ) ? trim( $header_parts[1] ) : '';
foreach ( headers_list() as $hdr ) {
$ptr = strpos( $hdr, ':' );
$headers[$header_name] = $header_value;
if ( empty( $ptr ) ) {
continue;
}
}
foreach( $headers as $key => $value ) {
if ( ! in_array( strtolower( $key ), $known_headers ) ) {
unset( $headers[ $key ] );
$hdr_key = rtrim( substr( $hdr, 0, $ptr ) );
if ( in_array( strtolower( $hdr_key ), $known_headers, true ) ) {
$hdr_val = ltrim( substr( $hdr, $ptr + 1 ) );
if ( ! empty( $headers[ $hdr_key ] ) ) {
$hdr_val = $headers[ $hdr_key ] . ', ' . $hdr_val;
}
$headers[ $hdr_key ] = $hdr_val;
}
}
......@@ -2760,7 +2777,7 @@ function wp_cache_post_edit( $post_id ) {
// Some users are inexplicibly seeing this error on scheduled posts.
// define this constant to disable the post status check.
if ( false == defined( 'WPSCFORCEUPDATE' ) && !in_array($post->post_status, array( 'publish', 'private' ) ) ) {
if ( ! defined( 'WPSCFORCEUPDATE' ) && ! in_array( get_post_status( $post ), array( 'publish', 'private' ), true ) ) {
wp_cache_debug( 'wp_cache_post_edit: draft post, not deleting any cache files. status: ' . $post->post_status, 4 );
return $post_id;
}
......@@ -2825,17 +2842,24 @@ function wp_cache_post_change( $post_id ) {
wp_cache_debug( "wp_cache_post_change(${action}): Already processed post $post_id.", 4 );
return $post_id;
}
$post = get_post( $post_id );
$post = get_post( $post_id );
$ptype = is_object( $post ) ? get_post_type_object( $post->post_type ) : null;
if ( empty( $ptype ) || ! $ptype->public ) {
return $post_id;
}
// Some users are inexplicibly seeing this error on scheduled posts.
// define this constant to disable the post status check.
if ( false == defined( 'WPSCFORCEUPDATE' ) && is_object( $post ) && !in_array($post->post_status, array( 'publish', 'private' ) ) ) {
if ( ! defined( 'WPSCFORCEUPDATE' ) && ! in_array( get_post_status( $post ), array( 'publish', 'private' ), true ) ) {
wp_cache_debug( 'wp_cache_post_change: draft post, not deleting any cache files.', 4 );
return $post_id;
}
$last_processed = $post_id;
if( !wp_cache_writers_entry() )
if ( ! wp_cache_writers_entry() ) {
return $post_id;
}
if (
isset( $wp_cache_refresh_single_only ) &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment