Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 0 additions & 151 deletions Cdn_TotalCdn_FsdEnablePopup.js

This file was deleted.

34 changes: 34 additions & 0 deletions Generic_AdminActions_Default.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,40 @@ private function _w3tc_save_options_process() {
do_action( 'w3tc_config_ui_save', $config, $this->_config );
do_action( "w3tc_config_ui_save-{$this->_page}", $config, $this->_config );

$conflicting_engines = array( 'bunnycdn', 'totalcdn' );

if ( $config->get_boolean( 'cdn.enabled' ) && $config->get_boolean( 'cdnfsd.enabled' ) ) {
$cdn_engine = $config->get_string( 'cdn.engine' );
$cdnfsd_engine = $config->get_string( 'cdnfsd.engine' );

if ( $cdn_engine === $cdnfsd_engine && in_array( $cdn_engine, $conflicting_engines, true ) ) {
$data['response_errors'][] = 'cdn_fsd_conflict_' . $cdn_engine;
$data['response_notes'] = array();

return array(
'query_string' => $data['response_query_string'],
'actions' => $data['response_actions'],
'errors' => $data['response_errors'],
'notes' => $data['response_notes'],
);
}

if (
in_array( $cdn_engine, $conflicting_engines, true ) &&
in_array( $cdnfsd_engine, $conflicting_engines, true )
) {
$data['response_errors'][] = 'cdn_fsd_conflict_mixed';
$data['response_notes'] = array();

return array(
'query_string' => $data['response_query_string'],
'actions' => $data['response_actions'],
'errors' => $data['response_errors'],
'notes' => $data['response_notes'],
);
}
}

Util_Admin::config_save( $this->_config, $config );

if ( 'w3tc_cdn' === $this->_page ) {
Expand Down
15 changes: 13 additions & 2 deletions Generic_Plugin_Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,15 @@ public function admin_print_scripts() {
)
),
'bunnyCdnWarning' => esc_html__(
'Bunny CDN should only be enabled as either a CDN for objects or full-site delivery, not both at the same time. The CDN settings have been reverted.',
'Bunny CDN cannot be enabled for both CDN and Full Site Delivery.',
'w3-total-cache'
),
'totalCdnWarning' => esc_html__(
'Total CDN cannot be enabled for both CDN and Full Site Delivery.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use W3TC_CDN_NAME instead of "Total CDN".

'w3-total-cache'
),
'mixedCdnWarning' => esc_html__(
'Bunny CDN and Total CDN cannot be enabled across CDN and Full Site Delivery at the same time.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use W3TC_CDN_NAME instead of "Total CDN".

'w3-total-cache'
),
)
Expand Down Expand Up @@ -1151,6 +1159,9 @@ public function admin_notices() {
'<strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong>'
),
'pull_zone' => __( 'Pull Zone could not be automatically created.', 'w3-total-cache' ),
'cdn_fsd_conflict_bunnycdn' => esc_html__( 'Bunny CDN cannot be enabled for both CDN and Full Site Delivery. Please disable one and save again.', 'w3-total-cache' ),
'cdn_fsd_conflict_totalcdn' => esc_html__( 'Total CDN cannot be enabled for both CDN and Full Site Delivery. Please disable one and save again.', 'w3-total-cache' ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use W3TC_CDN_NAME instead of "Total CDN".

'cdn_fsd_conflict_mixed' => esc_html__( 'Bunny CDN and Total CDN cannot be enabled across CDN and Full Site Delivery at the same time. Please disable one and save again.', 'w3-total-cache' ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use W3TC_CDN_NAME instead of "Total CDN".

'flush_cdn_failed' => sprintf(
// translators: 1 HTML acronym for CDN (content delivery network).
__(
Expand All @@ -1160,7 +1171,7 @@ public function admin_notices() {
'<acronym title="' . esc_attr__( 'Content Delivery Network', 'w3-total-cache' ) . '">' . esc_html__( 'CDN', 'w3-total-cache' ) . '</acronym>'
),
'updated_pullzone_url' => __( 'Pull Zone URL could not be automatically updated. Please contact support for assistance.', 'w3-total-cache' ),
'cdn_totalcdn_fsd_origin_update_failed' => __( 'Unable to update the Total CDN origin for Full Site Delivery. Please contact support for assistance.', 'w3-total-cache' ),
'cdn_totalcdn_fsd_origin_update_failed' => __( 'Unable to update the Total CDN origin for Full Site Delivery. Please contact support for assistance.', 'w3-total-cache' ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use W3TC_CDN_NAME instead of "Total CDN".

'cdn_totalcdn_fsd_custom_hostname_remove_failed' => Cdn_TotalCdn_CustomHostname::removal_failure_message(),
'cdn_totalcdn_fsd_custom_hostname_failed' => Cdn_TotalCdn_CustomHostname::failure_message(),
);
Expand Down
Loading