updated plugin `W3 Total Cache` version 2.7.1

This commit is contained in:
KawaiiPunk 2024-04-19 10:59:45 +00:00 committed by Gitium
parent 9420356fcf
commit 1a790bdd29
66 changed files with 3082 additions and 2126 deletions

View File

@ -274,11 +274,19 @@ class Cache_File extends Cache_Base {
*/
function flush( $group = '' ) {
@set_time_limit( $this->_flush_timelimit );
$flush_dir = $group ?
$this->_cache_dir . DIRECTORY_SEPARATOR . $group .
DIRECTORY_SEPARATOR :
$this->_flush_dir;
Util_File::emptydir( $flush_dir, $this->_exclude );
if ( 'sitemaps' === $group ) {
$config = Dispatcher::config();
$sitemap_regex = $config->get_string( 'pgcache.purge.sitemap_regex' );
$this->_flush_based_on_regex( $sitemap_regex );
} else {
$flush_dir = $group ?
$this->_cache_dir . DIRECTORY_SEPARATOR . $group .
DIRECTORY_SEPARATOR :
$this->_flush_dir;
Util_File::emptydir( $flush_dir, $this->_exclude );
}
return true;
}
@ -453,4 +461,38 @@ class Cache_File extends Cache_Base {
$fp = @fopen( $path, $mode );
return $fp;
}
/**
* Flush cache based on regex
*
* @since 2.7.1
*
* @param string $regex
*/
private function _flush_based_on_regex( $regex ) {
if ( Util_Environment::is_wpmu() && ! Util_Environment::is_wpmu_subdomain() ) {
$domain = get_home_url();
$parsed = parse_url( $domain );
$host = $parsed['host'];
$path = isset( $parsed['path'] ) ? '/' . trim( $parsed['path'], '/' ) : '';
$flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . DIRECTORY_SEPARATOR . $host . $path;
} else {
$flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . DIRECTORY_SEPARATOR . Util_Environment::host();
}
$dir = @opendir( $flush_dir );
if ( $dir ) {
while ( ( $entry = @readdir( $dir ) ) !== false ) {
if ( '.' === $entry || '..' === $entry ) {
continue;
}
if ( preg_match( '~' . $regex . '~', basename( $entry ) ) ) {
Util_File::rmdir( $flush_dir . DIRECTORY_SEPARATOR . $entry );
}
}
@closedir( $dir );
}
}
}

View File

@ -328,6 +328,8 @@ class Cache_File_Generic extends Cache_File {
$c->clean();
}
return true;
}
/**

View File

@ -2,7 +2,7 @@
/**
* File: CdnEngine_Mirror_BunnyCdn.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,7 +11,7 @@ namespace W3TC;
/**
* Class: CdnEngine_Mirror_BunnyCdn
*
* @since X.X.X
* @since 2.6.0
*
* @extends CdnEngine_Mirror
*/
@ -47,7 +47,7 @@ class CdnEngine_Mirror_BunnyCdn extends CdnEngine_Mirror {
/**
* Purge remote files.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $files Local and remote file paths.
* @param array $results Results.
@ -95,7 +95,7 @@ class CdnEngine_Mirror_BunnyCdn extends CdnEngine_Mirror {
/**
* Purge CDN completely.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $results Results.
* @return bool
@ -148,7 +148,7 @@ class CdnEngine_Mirror_BunnyCdn extends CdnEngine_Mirror {
*
* If set to "auto", then add URLs for both "http" and "https".
*
* @since X.X.X
* @since 2.6.0
*
* @return array
*/

View File

@ -503,7 +503,7 @@ class Cdn_AdminActions {
/**
* Redirect to the Bunny CDN signup page.
*
* @since X.X.X
* @since 2.6.0
*
* @return void
*/

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Api.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdn_BunnyCdn_Api
*
* @since X.X.X
* @since 2.6.0
*/
class Cdn_BunnyCdn_Api {
/**
* Account API Key.
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @var string
@ -27,7 +27,7 @@ class Cdn_BunnyCdn_Api {
/**
* Storage API Key.
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @var string
@ -37,7 +37,7 @@ class Cdn_BunnyCdn_Api {
/**
* Stream API Key.
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @var string
@ -49,7 +49,7 @@ class Cdn_BunnyCdn_Api {
*
* One of: "account", "storage", "stream".
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @var string
@ -59,7 +59,7 @@ class Cdn_BunnyCdn_Api {
/**
* Pull zone id.
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @var int
@ -69,7 +69,7 @@ class Cdn_BunnyCdn_Api {
/**
* Default Edge Rules.
*
* @since X.X.X
* @since 2.6.0
* @access private
* @static
*
@ -148,7 +148,7 @@ class Cdn_BunnyCdn_Api {
/**
* Constructor.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $config Configuration.
*/
@ -162,7 +162,7 @@ class Cdn_BunnyCdn_Api {
/**
* Increase http request timeout to 60 seconds.
*
* @since X.X.X
* @since 2.6.0
*
* @param int $time Timeout in seconds.
*/
@ -173,7 +173,7 @@ class Cdn_BunnyCdn_Api {
/**
* Don't check certificate, some users have limited CA list
*
* @since X.X.X
* @since 2.6.0
*
* @param bool $verify Always false.
*/
@ -184,7 +184,7 @@ class Cdn_BunnyCdn_Api {
/**
* List pull zones.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://docs.bunny.net/reference/pullzonepublic_index
*
@ -199,7 +199,7 @@ class Cdn_BunnyCdn_Api {
/**
* Get pull zone details by pull zone id.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://docs.bunny.net/reference/pullzonepublic_index2
*
@ -217,7 +217,7 @@ class Cdn_BunnyCdn_Api {
/**
* Add a pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://docs.bunny.net/reference/pullzonepublic_add
*
@ -253,7 +253,7 @@ class Cdn_BunnyCdn_Api {
/**
* Update a pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://docs.bunny.net/reference/pullzonepublic_updatepullzone
*
@ -279,7 +279,7 @@ class Cdn_BunnyCdn_Api {
/**
* Delete a pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://docs.bunny.net/reference/pullzonepublic_delete
*
@ -305,7 +305,7 @@ class Cdn_BunnyCdn_Api {
/**
* Add a custom hostname to a pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://docs.bunny.net/reference/pullzonepublic_addhostname
*
@ -335,7 +335,7 @@ class Cdn_BunnyCdn_Api {
/**
* Get the default edge rules.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return array
@ -347,7 +347,7 @@ class Cdn_BunnyCdn_Api {
/**
* Add/Update Edge Rule.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $data Data.
* @param int $pull_zone_id Optional pull zone ID. Can be specified in the constructor configuration array parameter.
@ -387,7 +387,7 @@ class Cdn_BunnyCdn_Api {
/**
* Purge.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $data Data for the POST request.
* @return array
@ -404,7 +404,7 @@ class Cdn_BunnyCdn_Api {
/**
* Purge an entire pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @param int $pull_zone_id Optional pull zone ID. Can be specified in the constructor configuration array parameter.
* @return void
@ -426,7 +426,7 @@ class Cdn_BunnyCdn_Api {
*
* API type can be passed or the class property will be used.
*
* @since X.X.X
* @since 2.6.0
*
* @param string $type API type: One of "account", "storage", "stream" (optional).
* @return string|null
@ -451,7 +451,7 @@ class Cdn_BunnyCdn_Api {
/**
* Decode response from a wp_remote_* call.
*
* @since X.X.X
* @since 2.6.0
*
* @param array|WP_Error $result Result.
* @return array
@ -479,7 +479,7 @@ class Cdn_BunnyCdn_Api {
/**
* Remote GET request.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://developer.wordpress.org/reference/functions/wp_remote_get/
* @link https://developer.wordpress.org/reference/classes/wp_http/request/
@ -513,7 +513,7 @@ class Cdn_BunnyCdn_Api {
/**
* Remote POST request.
*
* @since X.X.X
* @since 2.6.0
*
* @link https://developer.wordpress.org/reference/functions/wp_remote_post/
* @link https://developer.wordpress.org/reference/classes/wp_http/request/

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Page.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdn_BunnyCdn_Page
*
* @since X.X.X
* @since 2.6.0
*/
class Cdn_BunnyCdn_Page {
/**
* W3TC AJAX.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return void
@ -34,7 +34,7 @@ class Cdn_BunnyCdn_Page {
/**
* Determine if CDN or CDNFSD is active.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return bool
@ -60,7 +60,7 @@ class Cdn_BunnyCdn_Page {
/**
* Add Dashboard actions.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @see self::in_active()
@ -91,7 +91,7 @@ class Cdn_BunnyCdn_Page {
*
* Called from plugin-admin.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return void
@ -128,7 +128,7 @@ class Cdn_BunnyCdn_Page {
/**
* CDN settings.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return void
@ -142,7 +142,7 @@ class Cdn_BunnyCdn_Page {
/**
* Display purge URLs page.
*
* @since X.X.X
* @since 2.6.0
* @static
*/
public static function w3tc_purge_urls_box() {
@ -159,7 +159,7 @@ class Cdn_BunnyCdn_Page {
* You can also purge folders or wildcard files using * inside of the URL path.
* Wildcard values are not supported if using Perma-Cache.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_purge_url() {
$url = Util_Request::get_string( 'url' );
@ -195,7 +195,7 @@ class Cdn_BunnyCdn_Page {
/**
* Flush all caches except Bunny CDN.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_bunnycdn_flush_all_except_bunnycdn() {
Dispatcher::component( 'CacheFlush' )->flush_all( array( 'bunnycdn' => 'skip' ) );

View File

@ -1,7 +1,7 @@
/**
* File: Cdn_BunnyCdn_Page_View.js
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @global W3TC_Bunnycdn Localization array for info and language.

View File

@ -4,7 +4,7 @@
*
* Bunny CDN settings page section view.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param array $config W3TC configuration.

View File

@ -4,7 +4,7 @@
*
* Bunny CDN settings purge URLs view.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param array $config W3TC configuration.

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Popup.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdn_BunnyCdn_Popup
*
* @since X.X.X
* @since 2.6.0
*/
class Cdn_BunnyCdn_Popup {
/**
* W3TC AJAX.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return void
@ -54,7 +54,7 @@ class Cdn_BunnyCdn_Popup {
/**
* W3TC AJAX: Render intro.
*
* @since X.X.X
* @since 2.6.0
*
* @return void
*/
@ -73,7 +73,7 @@ class Cdn_BunnyCdn_Popup {
/**
* W3TC AJAX: List pull zones.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_list_pull_zones() {
$account_api_key = Util_Request::get_string( 'account_api_key' );
@ -118,7 +118,7 @@ class Cdn_BunnyCdn_Popup {
/**
* W3TC AJAX: Configure pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @see Cdn_BunnyCdn_Api::get_default_edge_rules()
*/
@ -199,7 +199,7 @@ class Cdn_BunnyCdn_Popup {
/**
* W3TC AJAX: Deauthorization form.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_deauthorization() {
$config = Dispatcher::config();
@ -219,7 +219,7 @@ class Cdn_BunnyCdn_Popup {
*
* Deauthorize and optionally delete the pull zone.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_deauthorize() {
$config = Dispatcher::config();
@ -262,7 +262,7 @@ class Cdn_BunnyCdn_Popup {
/**
* Render intro.
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @param array $details {

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Popup_View_Configured.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/

View File

@ -4,7 +4,7 @@
*
* Assists to deauthorize Bunny CDN as an objects CDN and optionally delete the pull zone.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param Config $config W3TC configuration.

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Popup_View_Deauthorized.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param Config $config W3TC configuration.

View File

@ -5,7 +5,7 @@
* Assists with configuring Bunny CDN as an object storage CDN.
* Asks to enter an account API key from the Bunny CDN main account.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param array $details {

View File

@ -5,7 +5,7 @@
* Assists with configuring Bunny CDN as an object storage CDN.
* A pull zone selection is presented along with a form to add a new pull zone.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param string $account_api_key Account PI key.

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Widget.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdn_BunnyCdn_Widget
*
* @since X.X.X
* @since 2.6.0
*/
class Cdn_BunnyCdn_Widget {
/**
* Initialize the WP Admin Dashboard.
*
* @since X.X.X
* @since 2.6.0
*
* @return void
*/
@ -39,7 +39,7 @@ class Cdn_BunnyCdn_Widget {
/**
* Print widget form.
*
* @since X.X.X
* @since 2.6.0
*
* return void
*/
@ -58,7 +58,7 @@ class Cdn_BunnyCdn_Widget {
/**
* Enqueue styles.
*
* @since X.X.X
* @since 2.6.0
*
* @return void
*/

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Widget_View_Authorized.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/

View File

@ -2,7 +2,7 @@
/**
* File: Cdn_BunnyCdn_Widget_View_Unauthorized.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/

View File

@ -46,34 +46,55 @@ Util_Ui::config_overloading_button(
)
);
?>
<p>
<div id="w3tc-bunnycdn-ad-general">
<?php
if ( ! $cdn_enabled ) {
echo '&nbsp;' . wp_kses(
echo wp_kses(
sprintf(
// translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag,
// translators: 3 opening HTML a tag, 4 closing HTML a tag.
// translators: 1 opening HTML strong tag, 2 closing HTML strong tag,
// translators: 3 HTML input for Bunny CDN sign up, 4 HTML img tag for Bunny CDN white logo.
__(
'If you do not have a %1$sCDN%2$s provider try Bunny CDN. %3$sSign up now to enjoy a special offer%4$s!',
'%1$sLooking for a top rated CDN Provider? Try Bunny CDN.%2$s%3$s%4$s',
'w3-total-cache'
),
'<acronym title="' . __( 'Content Delivery Network', 'w3-total-cache' ) . '">',
'</acronym>',
'<a href="' . esc_url( wp_nonce_url( Util_Ui::admin_url( 'admin.php?page=w3tc_dashboard&w3tc_cdn_bunnycdn_signup' ), 'w3tc' ) ) . '" target="_blank">',
'</a>'
'<strong>',
'</strong>',
Util_Ui::button_link(
__( 'Sign up now to enjoy a special offer!', 'w3-total-cache' ),
esc_url( W3TC_BUNNYCDN_SIGNUP_URL ),
true,
'w3tc-bunnycdn-promotion-button',
'w3tc-bunnycdn-promotion-button'
),
'<img class="w3tc-bunnycdn-icon-white" src="' . esc_url( plugins_url( '/pub/img/w3tc_bunnycdn_icon_white.png', W3TC_FILE ) ) . '" alt="Bunny CDN Icon White">'
),
array(
'acronym' => array(
'title' => array(),
'strong' => array(),
'img' => array(
'src' => array(),
'alt' => array(),
'width' => array(),
),
'a' => array(
'href' => array(),
'target' => array(),
'img' => array(
'class' => array(),
'src' => array(),
'alt' => array(),
'height' => array(),
),
'input' => array(
'type' => array(),
'name' => array(),
'class' => array(),
'value' => array(),
'onclick' => array(),
),
)
);
}
?>
</div>
<p>
<?php
$config = Dispatcher::config();
$cdn_engine = $config->get_string( 'cdn.engine' );
$cdnfsd_engine = $config->get_string( 'cdnfsd.engine' );

View File

@ -2,8 +2,7 @@
/**
* File: Cdn_Plugin_Admin.php
*
* @since X.X.X
*
* @since 0.9.5.4
* @package W3TC
*/

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Engine.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdnfsd_Bunny_Cdn_Engine
*
* @since X.X.X
* @since 2.6.0
*/
class Cdnfsd_BunnyCdn_Engine {
/**
* CDN configuration.
*
* @since X.X.X
* @since 2.6.0
*
* @var array
*/
@ -26,7 +26,7 @@ class Cdnfsd_BunnyCdn_Engine {
/**
* Constructor.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $config CDN configuration.
*/
@ -37,7 +37,7 @@ class Cdnfsd_BunnyCdn_Engine {
/**
* Flush URLs.
*
* @since X.X.X
* @since 2.6.0
*
* @param array $urls URLs.
* @throws \Exception Exception.
@ -72,7 +72,7 @@ class Cdnfsd_BunnyCdn_Engine {
/**
* Flushes CDN completely.
*
* @since X.X.X
* @since 2.6.0
*
* @throws \Exception Exception.
*/

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Page.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdnfsd_BunnyCdn_Page
*
* @since X.X.X
* @since 2.6.0
*/
class Cdnfsd_BunnyCdn_Page {
/**
* Enqueue scripts.
*
* @since X.X.X
* @since 2.6.0
*/
public static function admin_print_scripts_performance_page_w3tc_cdn() {
wp_enqueue_script(
@ -31,7 +31,7 @@ class Cdnfsd_BunnyCdn_Page {
/**
* Display settings page.
*
* @since X.X.X
* @since 2.6.0
*/
public static function w3tc_settings_box_cdnfsd() {
$config = Dispatcher::config();

View File

@ -1,7 +1,7 @@
/**
* File: Cdnfsd_BunnyCdn_Page_View.js
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Page_View.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param array $config W3TC configuration.

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Popup.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/
@ -11,13 +11,13 @@ namespace W3TC;
/**
* Class: Cdnfsd_BunnyCdn_Popup
*
* @since X.X.X
* @since 2.6.0
*/
class Cdnfsd_BunnyCdn_Popup {
/**
* W3TC AJAX: Popup.
*
* @since X.X.X
* @since 2.6.0
* @static
*
* @return void
@ -54,7 +54,7 @@ class Cdnfsd_BunnyCdn_Popup {
/**
* W3TC AJAX: Intro -- authorization.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_fsd_intro() {
$config = Dispatcher::config();
@ -71,7 +71,7 @@ class Cdnfsd_BunnyCdn_Popup {
/**
* W3TC AJAX: List pull zones.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_fsd_list_pull_zones() {
$account_api_key = Util_Request::get_string( 'account_api_key' );
@ -119,7 +119,7 @@ class Cdnfsd_BunnyCdn_Popup {
/**
* W3TC AJAX: Configure pull zone.
*
* @since X.X.X
* @since 2.6.0
*
* @see Cdn_BunnyCdn_Api::get_default_edge_rules()
*/
@ -217,7 +217,7 @@ class Cdnfsd_BunnyCdn_Popup {
/**
* W3TC AJAX: Deauthorization form.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_fsd_deauthorization() {
$config = Dispatcher::config();
@ -237,7 +237,7 @@ class Cdnfsd_BunnyCdn_Popup {
*
* Deauthorize and optionally delete the pull zone.
*
* @since X.X.X
* @since 2.6.0
*/
public function w3tc_ajax_cdn_bunnycdn_fsd_deauthorize() {
$config = Dispatcher::config();
@ -280,7 +280,7 @@ class Cdnfsd_BunnyCdn_Popup {
/**
* Render intro.
*
* @since X.X.X
* @since 2.6.0
* @access private
*
* @param array $details {

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Popup_View_Configured.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*/

View File

@ -4,7 +4,7 @@
*
* Assists to deauthorize Bunny CDN as a full-site delivery CDN and optionally delete the pull zone.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param Config $config W3TC configuration.

View File

@ -2,7 +2,7 @@
/**
* File: Cdnfsd_BunnyCdn_Popup_View_Deauthorized.php
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param Config $config W3TC configuration.

View File

@ -5,7 +5,7 @@
* Assists with configuring Bunny CDN as a full-site delivery CDN.
* Asks to enter an account API key from the Bunny CDN main account.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param array $details {

View File

@ -5,7 +5,7 @@
* Assists with configuring Bunny CDN as a full-site delivery CDN.
* A pull zone selection is presented along with a form to add a new pull zone.
*
* @since X.X.X
* @since 2.6.0
* @package W3TC
*
* @param array $details {

View File

@ -672,7 +672,7 @@ $keys = array(
),
'pgcache.purge.sitemap_regex' => array(
'type' => 'string',
'default' => '([a-z0-9_\-]*?)sitemap([a-z0-9_\-]*)?\.xml'
'default' => '([a-z0-9_\-]*?)sitemap([a-z0-9_\-]*)?\.(?:xml|xsl)'
),
'pgcache.prime.enabled' => array(
'type' => 'boolean',

View File

@ -325,6 +325,8 @@ class Extension_FragmentCache_WpObjectCache {
$cache = $this->_get_cache( $descriptor['global'] );
$cache->flush( $group );
}
return true;
}
/**

View File

@ -4,7 +4,7 @@
* @file Google Charts driver for W3TC dashboard image service widget.
* @author W3TC.
* @version 1.0
* @since X.X.X
* @since 2.7.0
*/
jQuery( document ).ready(
@ -140,7 +140,7 @@ jQuery( document ).ready(
function dateFormat( d ){
return ( "0" + d.getUTCHours() ).slice( -2 ) + ":" + ( "0" + d.getUTCMinutes() ).slice( -2 );
}
// Formats bytes into a human readable string.
/**
* @param {Number} x Bytes.

View File

@ -4,7 +4,7 @@
*
* @package W3TC
*
* @since X.X.X
* @since 2.7.0
*/
namespace W3TC;
@ -12,13 +12,13 @@ namespace W3TC;
/**
* Class Extension_ImageService_Widget
*
* @since X.X.X
* @since 2.7.0
*/
class Extension_ImageService_Widget {
/**
* Dashboard setup action
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -91,7 +91,7 @@ class Extension_ImageService_Widget {
/**
* W3TC dashboard Premium Services widget.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -108,7 +108,7 @@ class Extension_ImageService_Widget {
/**
* Premium Services widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/

View File

@ -4,7 +4,7 @@
*
* @package W3TC
*
* @since X.X.X
* @since 2.7.0
*/
namespace W3TC;

View File

@ -551,12 +551,17 @@ class Generic_Plugin {
'newrelic',
'cdn',
'browsercache',
'pagecache',
),
$buffer
);
$buffer = apply_filters( 'w3tc_processed_content', $buffer );
// Apply the w3tc_processed_content filter before pagecache callback.
$buffer = Util_Bus::do_ob_callbacks(
array( 'pagecache' ),
$buffer
);
}
return $buffer;

View File

@ -2,9 +2,8 @@
/**
* File: Generic_WidgetAccount.php
*
* @since 2.7.0
* @package W3TC
*
* @since X.X.X
*/
namespace W3TC;
@ -12,13 +11,13 @@ namespace W3TC;
/**
* Class Generic_WidgetAccount
*
* @since X.X.X
* @since 2.7.0
*/
class Generic_WidgetAccount {
/**
* Dashboard setup action
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -31,7 +30,7 @@ class Generic_WidgetAccount {
/**
* W3TC dashboard Premium Services widget.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -48,7 +47,7 @@ class Generic_WidgetAccount {
/**
* Premium Services widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/

View File

@ -2,9 +2,8 @@
/**
* File: Generic_WidgetAccount_View.php
*
* @since 2.7.0
* @package W3TC
*
* @since X.X.X
*/
namespace W3TC;

View File

@ -2,8 +2,7 @@
/**
* File: Generic_WidgetPartners.php
*
* @since X.X.X
*
* @since 2.7.0
* @package W3TC
*/
@ -12,13 +11,13 @@ namespace W3TC;
/**
* Class Generic_WidgetServices
*
* @since X.X.X
* @since 2.7.0
*/
class Generic_WidgetPartners {
/**
* Dashboard setup action
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -31,7 +30,7 @@ class Generic_WidgetPartners {
/**
* W3TC dashboard Premium Services widget.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -48,7 +47,7 @@ class Generic_WidgetPartners {
/**
* Premium Services widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/

View File

@ -2,8 +2,7 @@
/**
* File: Generic_WidgetPartners_View.php
*
* @since X.X.X
*
* @since 2.7.0
* @package W3TC
*/

View File

@ -2,9 +2,8 @@
/**
* File: Generic_WidgetSettings.php
*
* @since 2.7.0
* @package W3TC
*
* @since X.X.X
*/
namespace W3TC;
@ -16,7 +15,7 @@ class Generic_WidgetSettings {
/**
* Dashboard setup action
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -29,7 +28,7 @@ class Generic_WidgetSettings {
/**
* W3TC dashboard Premium Services widget.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -46,7 +45,7 @@ class Generic_WidgetSettings {
/**
* Premium Services widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/

View File

@ -2,9 +2,8 @@
/**
* File: Generic_WidgetSettings_View.php
*
* @since 2.7.0
* @package W3TC
*
* @since X.X.X
*/
namespace W3TC;

View File

@ -4,7 +4,8 @@
* @file Google Charts driver for W3TC dashboard stats widgets.
* @author W3TC.
* @version 1.0
* @since X.X.X
* @since 2.7.0
* @package W3TC
*/
jQuery(document).ready(function($) {

View File

@ -2,8 +2,7 @@
/**
* File: Generic_WidgetStats.php
*
* @since X.X.X
*
* @since 2.7.0
* @package W3TC
*/
@ -16,7 +15,7 @@ class Generic_WidgetStats {
/**
* Dashboard setup action
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -32,7 +31,7 @@ class Generic_WidgetStats {
/**
* W3TC dashboard Stats widgets.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -65,7 +64,7 @@ class Generic_WidgetStats {
/**
* Web Requests widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -84,7 +83,7 @@ class Generic_WidgetStats {
/**
* Object Cache widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -103,7 +102,7 @@ class Generic_WidgetStats {
/**
* Database widget content.
*
* @since X.X.X
* @since 2.7.0
*
* @return void
*/
@ -122,7 +121,7 @@ class Generic_WidgetStats {
/**
* Get button link allowed tags.
*
* @since X.X.X
* @since 2.7.0
*
* @param array $chart_config Chart configuration array.
*
@ -148,7 +147,7 @@ class Generic_WidgetStats {
/**
* Get button link allowed tags.
*
* @since X.X.X
* @since 2.7.0
*
* @return array
*/

View File

@ -167,7 +167,7 @@ class Licensing_Plugin_Admin {
'It looks like your W3 Total Cache Pro license has expired. %1$s to continue using the Pro features',
'w3-total-cache'
),
'<input type="button" class="button button-buy-plugin" data-nonce="' .
'<input type="button" class="button button-renew-plugin" data-nonce="' .
wp_create_nonce( 'w3tc' ) . '" data-renew-key="' . esc_attr( $this->get_license_key() ) .
'" data-src="licensing_expired" value="' . __( 'Renew Now', 'w3-total-cache' ) . '" />'
),

View File

@ -24,9 +24,16 @@ class Minify_Core {
}
$minify_filename = $key . '.' . $type;
$minify_filename = apply_filters(
'w3tc_minify_urls_for_minification_to_minify_filename',
$minify_filename, $files, $type );
if ( has_filter( 'w3tc_minify_urls_for_minification_to_minify_filename' ) ) {
$minify_filename = apply_filters(
'w3tc_minify_urls_for_minification_to_minify_filename',
$minify_filename,
$files,
$type
);
update_option( 'w3tc_minify_filter_' . hash( 'crc32b', $minify_filename ), $key, false );
}
return $minify_filename;
}
@ -57,7 +64,10 @@ class Minify_Core {
* @return array
*/
static public function minify_filename_to_urls_for_minification( $filename, $type ) {
$v = get_option( 'w3tc_minify_' . $filename );
$hash = has_filter( 'w3tc_minify_urls_for_minification_to_minify_filename' ) ?
get_option( 'w3tc_minify_filter_' . hash( 'crc32b', $filename . '.' . $type ) ) : $filename;
$v = get_option( 'w3tc_minify_' . $hash );
$urls_unverified = @json_decode( $v, true );
if ( !is_array( $urls_unverified ) ) {
return array();

View File

@ -687,17 +687,23 @@ class PgCache_Environment {
$cache_path = str_replace( Util_Environment::document_root(), '', $cache_dir );
/**
* Set Accept-Encoding
* Set Accept-Encoding gzip
*/
if ( $config->get_boolean( 'browsercache.enabled' ) && $config->get_boolean( 'browsercache.html.compression' ) ) {
$rules .= " RewriteCond %{HTTP:Accept-Encoding} gzip\n";
$rules .= " RewriteRule .* - [E=W3TC_ENC:_gzip]\n";
$env_W3TC_ENC = '%{ENV:W3TC_ENC}';
}
/**
* Set Accept-Encoding brotli
*/
if ( $config->get_boolean( 'browsercache.enabled' ) && $config->get_boolean( 'browsercache.html.brotli' ) ) {
$rules .= " RewriteCond %{HTTP:Accept-Encoding} br\n";
$rules .= " RewriteRule .* - [E=W3TC_ENC:_br]\n";
$env_W3TC_ENC = '%{ENV:W3TC_ENC}';
} else if ( $config->get_boolean( 'browsercache.enabled' ) && $config->get_boolean( 'browsercache.html.compression' ) ) {
$rules .= " RewriteCond %{HTTP:Accept-Encoding} gzip\n";
$rules .= " RewriteRule .* - [E=W3TC_ENC:_gzip]\n";
$env_W3TC_ENC = '%{ENV:W3TC_ENC}';
}
$rules .= " RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]\n";
$rules .= " RewriteRule .* - [E=W3TC_PREVIEW:_preview]\n";
$env_W3TC_PREVIEW = '%{ENV:W3TC_PREVIEW}';
@ -752,6 +758,27 @@ class PgCache_Environment {
if ($config->get_boolean('pgcache.cache.nginx_handle_xml'))
$exts[] = '.xml';
/**
* Filter: Allow adding additional rules at the end of the PGCACHE_CORE block, before the last rule.
*
* @since 2.7.1
*
* @param string $rules Additional rules.
* @param string $use_cache_rules Rewrite conditions for non-POST, empty query string, rejected cookies, and rejected user agents.
* @param string $document_root Document root.
* @param string $uri_prefix URI prefix, after the "w3tc_pagecache_rules_apache_uri_prefix" WP filter.
* @param array $exts File extensions used; iterate to use them all.
* @param string $env_W3TC_ENC Encoding string: "", "_br", or "_gzip".
*/
$rules = \apply_filters(
'w3tc_pgcache_rules_apache_last',
$rules,
$use_cache_rules,
$document_root,
$uri_prefix,
$env_W3TC_ENC
);
foreach ( $exts as $ext ) {
$rules .= $use_cache_rules;
@ -1095,17 +1122,6 @@ class PgCache_Environment {
$env_w3tc_ssl = '$w3tc_ssl';
}
if ( $config->get_boolean( 'browsercache.enabled' ) &&
$config->get_boolean( 'browsercache.html.brotli' ) ) {
$rules .= "set \$w3tc_enc \"\";\n";
$rules .= "if (\$http_accept_encoding ~ br) {\n";
$rules .= " set \$w3tc_enc _br;\n";
$rules .= "}\n";
$env_w3tc_enc = '$w3tc_enc';
}
if ( $config->get_boolean( 'browsercache.enabled' ) &&
$config->get_boolean( 'browsercache.html.compression' ) ) {
$rules .= "set \$w3tc_enc \"\";\n";
@ -1117,9 +1133,29 @@ class PgCache_Environment {
$env_w3tc_enc = '$w3tc_enc';
}
if ( $config->get_boolean( 'browsercache.enabled' ) &&
$config->get_boolean( 'browsercache.html.brotli' ) ) {
$rules .= "set \$w3tc_enc \"\";\n";
$rules .= "if (\$http_accept_encoding ~ br) {\n";
$rules .= " set \$w3tc_enc _br;\n";
$rules .= "}\n";
$env_w3tc_enc = '$w3tc_enc';
}
$key_postfix = $env_w3tc_slash . $env_w3tc_ua . $env_w3tc_ref . $env_w3tc_cookie .
$env_w3tc_ssl . $env_w3tc_preview;
/**
* Filter: Allow modifying the key_postfix string used in the PGCACHE_CORE block.
*
* @since 2.7.1
*
* @param string $key_postfix Key postfix string.
*/
$key_postfix = \apply_filters( 'w3tc_pgcache_postfix_nginx', $key_postfix );
if ( $pgcache_engine == 'file_generic' ) {
$rules .= $this->for_file_generic( $config, $cache_dir,
$env_request_uri, $key_postfix, $env_w3tc_enc );

View File

@ -175,7 +175,7 @@ class PgCache_Plugin_Admin {
if ( !Util_Environment::is_url( $url ) )
$url = home_url( $url );
$urls = array();
$urls = array( $url );
$response = Util_Http::get( $url );
if ( !is_wp_error( $response ) && $response['response']['code'] == 200 ) {
@ -218,7 +218,7 @@ class PgCache_Plugin_Admin {
arsort( $locs );
$urls = array_keys( $locs );
$urls = array_merge( $urls, array_keys( $locs ) );
} elseif ( preg_match_all( '~<rss[^>]*>(.*?)</rss>~is', $response['body'], $sitemap_matches ) ) {
// rss feed format

View File

@ -24,7 +24,8 @@ class Util_AttachToActions {
// posts.
add_action( 'pre_post_update', array( $o, 'on_pre_post_update' ), 0, 2 );
add_action( 'save_post', array( $o, 'on_post_change' ), 0, 2 );
add_action( 'wp_trash_post', array( $o, 'on_post_change' ), 0, 2 );
add_filter( 'pre_trash_post', array( $o, 'on_post_change' ), 0, 2 );
add_action( 'before_delete_post', array( $o, 'on_post_change' ), 0, 2 );
// comments.
add_action( 'comment_post', array( $o, 'on_comment_change' ), 0 );
@ -93,7 +94,7 @@ class Util_AttachToActions {
* @param integer $post_id Post ID.
* @param WP_Post $post Post.
*
* @return void
* @return int|bool|null
*/
public function on_post_change( $post_id, $post = null ) {
if ( is_null( $post ) ) {
@ -109,11 +110,13 @@ class Util_AttachToActions {
}
if ( ! Util_Environment::is_flushable_post( $post, 'posts', Dispatcher::config() ) ) {
return;
return $post_id;
}
$cacheflush = Dispatcher::component( 'CacheFlush' );
$cacheflush->flush_post( $post_id );
return $post_id;
}
/**

View File

@ -18,6 +18,50 @@ $can_purge = Cdn_Util::can_purge( $cdn_engine );
require W3TC_INC_DIR . '/options/common/header.php';
?>
<div id="w3tc-bunnycdn-ad-cdn">
<?php
echo wp_kses(
sprintf(
// translators: 1 HTML img tag for Bunny CDN Icon Bunny Rocket, 2 opening HTML strong tag, 3 closing HTML strong tag,
// translators: 4 HTML input for Bunny CDN sign up, 5 HTML div tag for Bunny CDN logo svg.
__(
'%1$s%2$sLooking for a top rated CDN Provider? Try Bunny CDN.%3$s%4$s%5$s',
'w3-total-cache'
),
'<img class="w3tc-bunnycdn-icon-bunny-rocket" src="' . esc_url( plugins_url( '/pub/img/w3tc_bunnycdn_bunny_rocket.png', W3TC_FILE ) ) . '" alt="Bunny CDN Icon Bunny Rocket" width="90">',
'<strong>',
'</strong>',
Util_Ui::button_link(
__( 'Sign up now to enjoy a special offer!', 'w3-total-cache' ),
esc_url( W3TC_BUNNYCDN_SIGNUP_URL ),
true,
'w3tc-bunnycdn-promotion-button',
'w3tc-bunnycdn-promotion-button'
),
'<div class="w3tc-bunnycdn-logo"></div>'
),
array(
'strong' => array(),
'img' => array(
'class' => array(),
'src' => array(),
'alt' => array(),
'width' => array(),
),
'div' => array(
'class' => array(),
),
'input' => array(
'type' => array(),
'name' => array(),
'class' => array(),
'value' => array(),
'onclick' => array(),
),
)
);
?>
</div>
<p>
<?php
echo wp_kses(

View File

@ -36,6 +36,12 @@ do_action( 'w3tc-dashboard-footer' );
?>
</h2>
</a>
<?php
if ( ! Util_Environment::is_w3tc_pro( $config ) ) {
echo '<input type="button" class="button button-buy-plugin {nonce: \'' . esc_attr( wp_create_nonce( 'w3tc' ) ) . '\'}"
data-src="footer" value="' . esc_html__( 'Learn more about Pro!', 'w3-total-cache' ) . '" />';
}
?>
</div>
<div class="w3tc-footer-column-1">
<h2><?php esc_html_e( 'Documentation', 'w3-total-cache' ); ?></h2>
@ -45,8 +51,6 @@ do_action( 'w3tc-dashboard-footer' );
<a class="w3tc-footer-link" target="_blank" href="<?php echo esc_url( 'https://github.com/BoldGrid/w3-total-cache' ); ?>" alt="<?php esc_attr_e( 'GitHub', 'w3-total-cache' ); ?>">
<?php esc_html_e( 'GitHub', 'w3-total-cache' ); ?>
</a>
</div>
<div class="w3tc-footer-column-1">
<h2><?php esc_html_e( 'Support', 'w3-total-cache' ); ?></h2>
<a class="w3tc-footer-link" target="_blank" href="<?php echo esc_url( 'https://www.boldgrid.com/support/forum/w3-total-cache/' ); ?>" alt="<?php esc_attr_e( 'Forums', 'w3-total-cache' ); ?>">
<?php esc_html_e( 'Forums', 'w3-total-cache' ); ?>
@ -94,12 +98,6 @@ do_action( 'w3tc-dashboard-footer' );
<?php esc_html_e( 'Purge Logs', 'w3-total-cache' ); ?>
</a>
</div>
<?php
if ( ! Util_Environment::is_w3tc_pro( $config ) ) {
echo '<input type="button" class="button button-buy-plugin {nonce: \'' . esc_attr( wp_create_nonce( 'w3tc' ) ) . '\'}"
data-src="footer" value="' . esc_html__( 'Learn more about Pro!', 'w3-total-cache' ) . '" />';
}
?>
</div>
<div class="w3tc-footer-column-1">
<h2><?php esc_html_e( 'Follow Us', 'w3-total-cache' ); ?></h2>
@ -113,5 +111,11 @@ do_action( 'w3tc-dashboard-footer' );
<span class="dashicons dashicons-facebook"></span><?php esc_html_e( 'BoldGrid', 'w3-total-cache' ); ?>
</a>
</div>
<div class="w3tc-footer-column-1">
<h2><?php esc_html_e( 'Partners', 'w3-total-cache' ); ?></h2>
<a class="w3tc-footer-link" target="_blank" href="<?php echo esc_url( W3TC_BUNNYCDN_SIGNUP_URL ); ?>" alt="Bunny CDN">
<div class="w3tc-bunnycdn-logo"></div>
</a>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -173,7 +173,7 @@
text-align: center;
padding: 7px 5px;
background: #69BCC3;
color: #fff;
color: #3c434a;
}
.w3tc-card-ribbon-new b {

View File

@ -1209,7 +1209,7 @@ td .w3tc-control-after span {
}
#w3tc-footer .button-buy-plugin,
#w3tc-footer .w3tc-gopro-button {
margin-top: 10px;
margin: 10px 10px 0;
white-space: normal;
float: left;
clear: both;
@ -1222,17 +1222,15 @@ td .w3tc-control-after span {
#w3tc-footer .w3tc-footer-column-1 {
width: 20%;
margin-bottom: 15px;
}
#w3tc-footer .w3tc-footer-column-2 {
width: 40%;
margin-bottom: 15px;
}
#w3tc-footer .w3tc-footer-inner-column-50 {
width: 50%;
padding-right: 15px;
padding-right: 5px;
float: left;
box-sizing: border-box;
}
@ -1248,6 +1246,104 @@ td .w3tc-control-after span {
}
#w3tc-footer .w3tc-bunnycdn-logo,
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-logo {
width: 150px;
height: 50px;
background: url('../img/w3tc_bunnycdn_logo.svg') 0 8px no-repeat;
}
#w3tc-bunnycdn-ad-cdn,
#w3tc-bunnycdn-ad-general {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
#w3tc-bunnycdn-ad-cdn {
background: linear-gradient(to bottom, #FCFDFF, #E7F1FF);
border: 1px solid #c3c4c7;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
#w3tc-bunnycdn-ad-general {
background: #12193B;
margin-top: 10px;
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-icon-bunny-rocket {
padding: 5px;
}
#w3tc-bunnycdn-ad-cdn strong {
color: #3E497E;
font-weight: 700;
margin: 5px 10px;
padding: 5px 10px;
}
#w3tc-bunnycdn-ad-general strong {
color: #FFFFFF;
font-weight: 700;
margin: 5px 10px;
padding: 5px 10px;
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-promotion-button {
margin: 5px 10px;
padding: 5px 10px;
color: #ffffff;
font-weight: 600;
background-color: #242958;
border-color: #242958;
border-radius: 5px;
cursor: pointer;
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-promotion-button:hover {
background-color: #4965B6;
border-color: #4965B6;
}
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-promotion-button {
margin: 5px 10px;
padding: 5px 10px;
color: #12193B;
font-weight: 700;
border: 2px solid transparent;
border-radius: 5px;
background-image: linear-gradient(to right, #E97B4F, #ECB22B);
background-clip: padding-box, border-box;
transition: background-image 0.3s ease;
cursor: pointer;
}
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-promotion-button:hover {
background-image: linear-gradient(to right, #FFA681, #FFE072);
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-logo {
margin: 5px 10px;
padding: 5px;
}
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-icon-white {
margin: 5px 10px;
padding: 5px;
}
#w3tc-bunnycdn-ad-cdn strong,
#w3tc-bunnycdn-ad-general strong {
margin-right: auto;
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-promotion-button,
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-promotion-button {
margin-left: auto;
}
/**
* Button Save Dropdown
*/
@ -1430,6 +1526,31 @@ td .w3tc-control-after span {
.w3tc_form_bar .w3tc-button-control-container .w3tc-button-save-dropdown {
float: unset;
}
#w3tc-footer .button-buy-plugin,
#w3tc-footer .w3tc-bunnycdn-logo {
float: none;
margin: 1em auto;
}
#w3tc-bunnycdn-ad-cdn,
#w3tc-bunnycdn-ad-general {
flex-direction: column;
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-icon-bunny-rocket,
#w3tc-bunnycdn-ad-cdn strong,
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-promotion-button,
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-logo,
#w3tc-bunnycdn-ad-general strong,
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-promotion-button,
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-icon-white {
margin: 10px 0;
}
#w3tc-bunnycdn-ad-cdn .w3tc-bunnycdn-promotion-button,
#w3tc-bunnycdn-ad-general .w3tc-bunnycdn-promotion-button {
margin-top: 10px;
}
}
@media screen and (max-width: 960px) {
@ -1455,6 +1576,7 @@ td .w3tc-control-after span {
#w3tc-footer .w3tc-footer-column-2 {
width: 100%;
padding: 0 10px;
text-align: center;
}
#w3tc-footer .logo-link h2.logo {
background-position: center;

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -4,7 +4,7 @@
* @link https://www.gstatic.com/charts/loader.js
* @file Google Charts loader.
* @author Google.
* @since X.X.X
* @since 2.7.0
*/
(function(){/*

View File

@ -434,6 +434,10 @@ function w3tc_lightbox_upgrade(nonce, data_src, renew_key) {
}
function w3tc_lightbox_buy_plugin(nonce, data_src, renew_key, client_id) {
if (window.w3tc_ga) {
client_id = w3tc_ga_cid;
}
var minWidth = jQuery(window).width() - 30;
var minHeight = jQuery(window).height() - 30;
@ -526,11 +530,45 @@ jQuery(function() {
}
var renew_key = jQuery(this).data('renew-key');
if (window.w3tc_ga) {
w3tc_ga(
'event',
'button',
{
eventCategory: 'click',
eventLabel: 'license_upgrade_' + data_src
}
);
}
w3tc_lightbox_upgrade(nonce, data_src, renew_key);
jQuery('#w3tc-license-instruction').show();
return false;
});
jQuery('.button-renew-plugin').on( 'click', function() {
var data_src = jQuery(this).data('src');
var nonce = jQuery(this).data('nonce');
if (!nonce) {
nonce = w3tc_nonce;
}
var renew_key = jQuery(this).data('renew-key');
if (window.w3tc_ga) {
w3tc_ga(
'event',
'button',
{
eventCategory: 'click',
eventLabel: 'license_renew_' + data_src
}
);
}
w3tc_lightbox_buy_plugin(nonce, data_src, renew_key);
return false;
});
jQuery('body').on('click', '.w3tc_lightbox_close', function() {
W3tc_Lightbox.close();
});

View File

@ -325,7 +325,7 @@ function w3tc_csp_reference() {
*
* Prevent enabling Bunny CDN ("bunnycdn" engine) for both CDN and CDNFSD.
*
* @since X.X.X
* @since 2.6.0
*
* @returns null
*/
@ -1577,6 +1577,7 @@ jQuery(function() {
);
}
});
jQuery('body').on('click', 'input[type="submit"]', function() {
var name = jQuery(this).attr('name');
var id = jQuery(this).attr('id');
@ -1626,6 +1627,20 @@ jQuery(function() {
);
}
});
// Log if the admin notice containing the renew license button is present.
if (jQuery('.button-renew-plugin').length > 0) {
if (window.w3tc_ga) {
w3tc_ga(
'event',
'w3tc_error',
{
eventCategory: 'w3tc_renew_notice',
eventLabel: 'Renew Now'
}
);
}
}
}
jQuery("a").on('click', function(event) {

View File

@ -1,9 +1,9 @@
=== Plugin Name ===
=== W3 Total Cache ===
Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryjackson1221, joemoto, vmarko, jacobd91
Tags: seo, cache, CDN, pagespeed, caching, performance, compression, optimize, cloudflare, nginx, apache, varnish, redis, aws, amazon web services, s3, cloudfront, azure
Requires at least: 5.3
Tested up to: 6.4
Stable tag: 2.7.0
Tested up to: 6.5
Stable tag: 2.7.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -285,6 +285,14 @@ Please reach out to all of these people and support their projects if you're so
== Changelog ==
= 2.7.1 =
* Fix: Page Cache: Prefer Brotli over Gzip
* Fix: Page Cache: Purge sitemaps on post creation/edit/trash/delete
* Fix: Page Cache: Processed content filter
* Fix: Minify URL to filename filter mapping
* Update: Added Bunny CDN partner information
* Update: Added filters for Apache rules and Page Cache postfix
= 2.7.0 =
* Feature: Performance Dashboard update
* Feature: Remove unused CSS/JS

View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit1832972171c404e75e1f6d96942f429e::getLoader();
return ComposerAutoloaderInit7ff4d6043543dd62a0d9205d41d8b2dd::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit1832972171c404e75e1f6d96942f429e
class ComposerAutoloaderInit7ff4d6043543dd62a0d9205d41d8b2dd
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit1832972171c404e75e1f6d96942f429e
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit1832972171c404e75e1f6d96942f429e', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit7ff4d6043543dd62a0d9205d41d8b2dd', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit1832972171c404e75e1f6d96942f429e', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit7ff4d6043543dd62a0d9205d41d8b2dd', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit1832972171c404e75e1f6d96942f429e::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit7ff4d6043543dd62a0d9205d41d8b2dd::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -51,19 +51,19 @@ class ComposerAutoloaderInit1832972171c404e75e1f6d96942f429e
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit1832972171c404e75e1f6d96942f429e::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit7ff4d6043543dd62a0d9205d41d8b2dd::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire1832972171c404e75e1f6d96942f429e($fileIdentifier, $file);
composerRequire7ff4d6043543dd62a0d9205d41d8b2dd($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire1832972171c404e75e1f6d96942f429e($fileIdentifier, $file)
function composerRequire7ff4d6043543dd62a0d9205d41d8b2dd($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit1832972171c404e75e1f6d96942f429e
class ComposerStaticInit7ff4d6043543dd62a0d9205d41d8b2dd
{
public static $files = array (
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
@ -986,9 +986,9 @@ class ComposerStaticInit1832972171c404e75e1f6d96942f429e
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit1832972171c404e75e1f6d96942f429e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit1832972171c404e75e1f6d96942f429e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit1832972171c404e75e1f6d96942f429e::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit7ff4d6043543dd62a0d9205d41d8b2dd::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7ff4d6043543dd62a0d9205d41d8b2dd::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7ff4d6043543dd62a0d9205d41d8b2dd::$classMap;
}, null, ClassLoader::class);
}

View File

@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
define( 'W3TC', true );
define( 'W3TC_VERSION', '2.7.0' );
define( 'W3TC_VERSION', '2.7.1' );
define( 'W3TC_POWERED_BY', 'W3 Total Cache' );
define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' );
define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' );

View File

@ -3,7 +3,7 @@
* Plugin Name: W3 Total Cache
* Plugin URI: https://www.boldgrid.com/totalcache/
* Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.
* Version: 2.7.0
* Version: 2.7.1
* Requires at least: 5.3
* Requires PHP: 5.6
* Author: BoldGrid