updated plugin W3 Total Cache version 2.6.1

This commit is contained in:
2023-12-08 23:23:32 +00:00
committed by Gitium
parent fa428d9da9
commit 33d18af972
82 changed files with 5759 additions and 1701 deletions
wp-content/plugins/w3-total-cache
Cache.phpCacheFlush.phpCacheGroups_Plugin_Admin_View.phpCdnEngine.phpCdnEngine_Mirror_BunnyCdn.phpCdn_AdminActions.phpCdn_BunnyCdn_Api.phpCdn_BunnyCdn_Page.phpCdn_BunnyCdn_Page_View.jsCdn_BunnyCdn_Page_View.phpCdn_BunnyCdn_Page_View_Purge_Urls.phpCdn_BunnyCdn_Popup.phpCdn_BunnyCdn_Popup_View_Configured.phpCdn_BunnyCdn_Popup_View_Deauthorize.phpCdn_BunnyCdn_Popup_View_Deauthorized.phpCdn_BunnyCdn_Popup_View_Intro.phpCdn_BunnyCdn_Popup_View_Pull_Zones.phpCdn_BunnyCdn_Widget.phpCdn_BunnyCdn_Widget_View.cssCdn_BunnyCdn_Widget_View_Authorized.phpCdn_BunnyCdn_Widget_View_Unauthorized.phpCdn_Core.phpCdn_GeneralPage_View.phpCdn_Page.phpCdn_Page_View_Header.phpCdn_Plugin_Admin.phpCdn_StackPath2_Page_View.phpCdn_StackPath2_Popup.phpCdn_Util.phpCdnfsd_BunnyCdn_Engine.phpCdnfsd_BunnyCdn_Page.phpCdnfsd_BunnyCdn_Page_View.jsCdnfsd_BunnyCdn_Page_View.phpCdnfsd_BunnyCdn_Popup.phpCdnfsd_BunnyCdn_Popup_View_Configured.phpCdnfsd_BunnyCdn_Popup_View_Deauthorize.phpCdnfsd_BunnyCdn_Popup_View_Deauthorized.phpCdnfsd_BunnyCdn_Popup_View_Intro.phpCdnfsd_BunnyCdn_Popup_View_Pull_Zones.phpCdnfsd_Core.phpCdnfsd_GeneralPage_View.phpCdnfsd_Page_View_Header.phpCdnfsd_Plugin_Admin.phpCdnfsd_StackPath2_Popup.phpCdnfsd_StackPath_Engine.phpConfigState.phpExtension_CloudFlare_Api.phpExtension_CloudFlare_Page.phpExtension_CloudFlare_Page_View.phpExtensions_Util.phpFeatureShowcase_Plugin_Admin.phpFeatureShowcase_Plugin_Admin_View.phpGeneric_AdminActions_Default.phpGeneric_AdminActions_Flush.phpGeneric_Plugin.phpGeneric_Plugin_Admin.phpModuleStatus.phpPageSpeed_Widget.phpUserExperience_DeferScripts_Extension.phpUserExperience_GeneralPage_View.phpUserExperience_Plugin_Admin.phpUserExperience_Preload_Requests_Extension.phpUserExperience_Preload_Requests_Page_View.phpUtil_Ui.php
inc
lib
Azure
MicrosoftAzureStorage
Common
Minify
Minify
OAuth
pub
readme.txt
vendor
w3-total-cache-api.phpw3-total-cache.php

@ -413,6 +413,7 @@ class Cdn_AdminActions {
$engine == 'stackpath2' ||
$engine == 'rackspace_cdn' ||
$engine == 'rscf' ||
'bunnycdn' === $engine ||
$engine == 's3_compatible' ) {
// those use already stored w3tc config
$w3_cdn = Dispatcher::component( 'Cdn_Core' )->get_cdn();
@ -462,46 +463,69 @@ class Cdn_AdminActions {
$container_id = '';
switch ( $engine ) {
case 's3':
case 'cf':
case 'cf2':
case 'azure':
$w3_cdn = CdnEngine::instance( $engine, $config );
case 's3':
case 'cf':
case 'cf2':
case 'azure':
$w3_cdn = CdnEngine::instance( $engine, $config );
@set_time_limit( $this->_config->get_integer( 'timelimit.cdn_upload' ) );
@set_time_limit( $this->_config->get_integer( 'timelimit.cdn_upload' ) );
$result = false;
try {
$container_id = $w3_cdn->create_container();
$result = true;
$error = __( 'Created successfully.', 'w3-total-cache' );
} catch ( \Exception $ex ) {
$error = sprintf( __( 'Error: %s', 'w3-total-cache' ),
$ex->getMessage() );
}
$result = false;
break;
default:
$result = false;
$error = __( 'Incorrect type.', 'w3-total-cache' );
try {
$container_id = $w3_cdn->create_container();
$result = true;
$error = __( 'Created successfully.', 'w3-total-cache' );
} catch ( \Exception $ex ) {
$error = sprintf(
__( 'Error: %s', 'w3-total-cache' ),
$ex->getMessage()
);
}
break;
default:
$result = false;
$error = __( 'Incorrect type.', 'w3-total-cache' );
}
$response = array(
'result' => $result,
'error' => $error,
'container_id' => $container_id
'result' => $result,
'error' => $error,
'container_id' => $container_id,
);
echo json_encode( $response );
}
/**
* Redirect to the Bunny CDN signup page.
*
* @since X.X.X
*
* @return void
*/
public function w3tc_cdn_bunnycdn_signup() {
try {
$state = Dispatcher::config_state();
$state->set( 'track.bunnycdn_signup', time() );
$state->save();
} catch ( \Exception $ex ) {} // phpcs:ignore
Util_Environment::redirect( W3TC_BUNNYCDN_SIGNUP_URL );
}
/**
* Test CDN URL.
*
* @param string $url URL.
*/
private function test_cdn_url( $url ) {
$response = wp_remote_get( $url );
if ( is_wp_error( $response ) )
if ( is_wp_error( $response ) ) {
return false;
else {
} else {
$code = wp_remote_retrieve_response_code( $response );
return 200 == $code;
}