2023-06-05 11:23:16 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* File: Cdn_GeneralPage_View.php
|
|
|
|
*
|
|
|
|
* @package W3TC
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace W3TC;
|
|
|
|
|
2023-12-08 23:23:32 +00:00
|
|
|
defined( 'W3TC' ) || die;
|
2023-06-05 11:23:16 +00:00
|
|
|
|
2023-10-22 22:21:26 +00:00
|
|
|
Util_Ui::postbox_header_tabs(
|
2023-06-05 11:23:16 +00:00
|
|
|
wp_kses(
|
|
|
|
sprintf(
|
|
|
|
// translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
|
|
|
|
__(
|
|
|
|
'%1$sCDN%2$s',
|
|
|
|
'w3-total-cache'
|
|
|
|
),
|
|
|
|
'<acronym title="' . __( 'Content Delivery Network', 'w3-total-cache' ) . '">',
|
|
|
|
'</acronym>'
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'acronym' => array(
|
|
|
|
'title' => array(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
2023-10-22 22:21:26 +00:00
|
|
|
esc_html__(
|
2023-12-08 23:23:32 +00:00
|
|
|
'Content Delivery Network (CDN) is a powerful feature that can significantly enhance the performance of
|
|
|
|
your WordPress website. By leveraging a distributed network of servers located worldwide, a CDN helps
|
|
|
|
deliver your website\'s static files, such as images, CSS, and JavaScript, to visitors more efficiently.
|
|
|
|
This reduces the latency and improves the loading speed of your website, resulting in a faster and
|
|
|
|
smoother browsing experience for your users. With W3 Total Cache\'s CDN integration, you can easily
|
|
|
|
configure and connect your website to a CDN service of your choice, unleashing the full potential of
|
2023-10-22 22:21:26 +00:00
|
|
|
your WordPress site\'s speed optimization.',
|
|
|
|
'w3-total-cache'
|
|
|
|
),
|
2023-06-05 11:23:16 +00:00
|
|
|
'',
|
2023-10-22 22:21:26 +00:00
|
|
|
'cdn',
|
|
|
|
Util_UI::admin_url( 'admin.php?page=w3tc_cdn' )
|
2023-06-05 11:23:16 +00:00
|
|
|
);
|
|
|
|
Util_Ui::config_overloading_button(
|
|
|
|
array(
|
|
|
|
'key' => 'cdn.configuration_overloaded',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2024-04-19 10:59:45 +00:00
|
|
|
<div id="w3tc-bunnycdn-ad-general">
|
2023-06-05 11:23:16 +00:00
|
|
|
<?php
|
2023-12-08 23:23:32 +00:00
|
|
|
if ( ! $cdn_enabled ) {
|
2024-04-19 10:59:45 +00:00
|
|
|
echo wp_kses(
|
2023-12-08 23:23:32 +00:00
|
|
|
sprintf(
|
2024-04-19 10:59:45 +00:00
|
|
|
// 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.
|
2023-12-08 23:23:32 +00:00
|
|
|
__(
|
2024-04-19 10:59:45 +00:00
|
|
|
'%1$sLooking for a top rated CDN Provider? Try Bunny CDN.%2$s%3$s%4$s',
|
2023-12-08 23:23:32 +00:00
|
|
|
'w3-total-cache'
|
|
|
|
),
|
2024-04-19 10:59:45 +00:00
|
|
|
'<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">'
|
2023-12-08 23:23:32 +00:00
|
|
|
),
|
|
|
|
array(
|
2024-04-19 10:59:45 +00:00
|
|
|
'strong' => array(),
|
|
|
|
'img' => array(
|
|
|
|
'src' => array(),
|
|
|
|
'alt' => array(),
|
|
|
|
'width' => array(),
|
|
|
|
),
|
|
|
|
'img' => array(
|
|
|
|
'class' => array(),
|
|
|
|
'src' => array(),
|
|
|
|
'alt' => array(),
|
|
|
|
'height' => array(),
|
2023-12-08 23:23:32 +00:00
|
|
|
),
|
2024-04-19 10:59:45 +00:00
|
|
|
'input' => array(
|
|
|
|
'type' => array(),
|
|
|
|
'name' => array(),
|
|
|
|
'class' => array(),
|
|
|
|
'value' => array(),
|
|
|
|
'onclick' => array(),
|
2023-12-08 23:23:32 +00:00
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2024-04-19 10:59:45 +00:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<p>
|
|
|
|
<?php
|
2023-10-22 22:21:26 +00:00
|
|
|
$config = Dispatcher::config();
|
|
|
|
$cdn_engine = $config->get_string( 'cdn.engine' );
|
|
|
|
$cdnfsd_engine = $config->get_string( 'cdnfsd.engine' );
|
|
|
|
$stackpaths = array( 'stackpath', 'stackpath2' );
|
2023-06-05 11:23:16 +00:00
|
|
|
|
2023-10-22 22:21:26 +00:00
|
|
|
if ( in_array( $cdn_engine, $stackpaths, true ) || in_array( $cdnfsd_engine, $stackpaths, true ) ) {
|
|
|
|
?>
|
|
|
|
<div class="notice notice-warning inline">
|
|
|
|
<p>
|
|
|
|
<?php
|
|
|
|
// StackPath sunset is 12:00 am Central (UTC-6:00) on November, 22, 2023 (1700629200).
|
2023-12-08 23:23:32 +00:00
|
|
|
$date_time_format = \get_option( 'date_format' ) . ' ' . \get_option( 'time_format' );
|
|
|
|
\printf(
|
2023-10-22 22:21:26 +00:00
|
|
|
// translators: 1 StackPath sunset datetime.
|
2023-12-08 23:23:32 +00:00
|
|
|
\esc_html__(
|
2023-10-22 22:21:26 +00:00
|
|
|
'StackPath will cease operations at %1$s.',
|
|
|
|
'w3-total-cache'
|
|
|
|
),
|
2023-12-08 23:23:32 +00:00
|
|
|
\wp_date( $date_time_format, '1700629200' ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
2023-10-22 22:21:26 +00:00
|
|
|
);
|
2023-12-08 23:23:32 +00:00
|
|
|
?>
|
2023-10-22 22:21:26 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
} elseif ( 'highwinds' === $cdn_engine || 'highwinds' === $cdnfsd_engine ) {
|
|
|
|
?>
|
|
|
|
<div class="notice notice-warning inline">
|
|
|
|
<p>
|
|
|
|
<?php
|
|
|
|
// HighWinds sunset is 12:00 am Central (UTC-6:00) on November, 22, 2023 (1700629200).
|
2023-12-08 23:23:32 +00:00
|
|
|
$date_time_format = \get_option( 'date_format' ) . ' ' . \get_option( 'time_format' );
|
|
|
|
\printf(
|
2023-10-22 22:21:26 +00:00
|
|
|
// translators: 1 HighWinds sunset datetime.
|
2023-12-08 23:23:32 +00:00
|
|
|
\esc_html__(
|
2023-10-22 22:21:26 +00:00
|
|
|
'HighWinds will cease operations at %1$s.',
|
|
|
|
'w3-total-cache'
|
|
|
|
),
|
2023-12-08 23:23:32 +00:00
|
|
|
\wp_date( $date_time_format, '1700629200' ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
2023-10-22 22:21:26 +00:00
|
|
|
);
|
2023-12-08 23:23:32 +00:00
|
|
|
?>
|
2023-10-22 22:21:26 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<?php
|
2023-06-05 11:23:16 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</p>
|
|
|
|
<table class="form-table">
|
|
|
|
<?php
|
|
|
|
Util_Ui::config_item(
|
|
|
|
array(
|
|
|
|
'key' => 'cdn.enabled',
|
|
|
|
'control' => 'checkbox',
|
|
|
|
'checkbox_label' => __( 'Enable', 'w3-total-cache' ),
|
|
|
|
'description' => wp_kses(
|
|
|
|
sprintf(
|
|
|
|
// translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag,
|
|
|
|
// translators: 3 opening HTML acronym tag, 4 closing acronym tag.
|
|
|
|
__(
|
2023-12-08 23:23:32 +00:00
|
|
|
'Theme files, media library attachments, %1$sCSS%2$s, and %3$sJS%4$s files will load quickly for site visitors.',
|
2023-06-05 11:23:16 +00:00
|
|
|
'w3-total-cache'
|
|
|
|
),
|
|
|
|
'<acronym title="' . __( 'Cascading Style Sheet', 'w3-total-cache' ) . '">',
|
|
|
|
'</acronym>',
|
|
|
|
'<acronym title="' . __( 'JavaScript', 'w3-total-cache' ) . '">',
|
|
|
|
'</acronym>'
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'acronym' => array(
|
|
|
|
'title' => array(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
Util_Ui::config_item(
|
|
|
|
array(
|
|
|
|
'key' => 'cdn.engine',
|
|
|
|
'control' => 'selectbox',
|
|
|
|
'selectbox_values' => $engine_values,
|
|
|
|
'selectbox_optgroups' => $engine_optgroups,
|
|
|
|
'description' => wp_kses(
|
|
|
|
sprintf(
|
|
|
|
// translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
|
|
|
|
__(
|
|
|
|
'Select the %1$sCDN%2$s type you wish to use.',
|
|
|
|
'w3-total-cache'
|
|
|
|
),
|
|
|
|
'<acronym title="' . __( 'Content Delivery Network', 'w3-total-cache' ) . '">',
|
|
|
|
'</acronym>'
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'acronym' => array(
|
|
|
|
'title' => array(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
do_action( 'w3tc_settings_general_boxarea_cdn_footer' );
|
|
|
|
?>
|
2023-10-22 22:21:26 +00:00
|
|
|
|
2023-06-05 11:23:16 +00:00
|
|
|
<?php Util_Ui::postbox_footer(); ?>
|