Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-super...
File: ossdl-cdn.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/* Taken from OSSDL CDN off-linker, a plugin by W-Mark Kubacki and used with permission */
[2] Fix | Delete
[3] Fix | Delete
if ( ! isset( $ossdlcdn ) ) {
[4] Fix | Delete
$ossdlcdn = 1; // have to default to on for existing users.
[5] Fix | Delete
}
[6] Fix | Delete
[7] Fix | Delete
if ( 1 === $ossdlcdn && ! is_admin() ) {
[8] Fix | Delete
add_action( 'init', 'do_scossdl_off_ob_start' );
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Set up some defaults.
[13] Fix | Delete
*
[14] Fix | Delete
* @global string $ossdl_off_blog_url
[15] Fix | Delete
* @global string $ossdl_off_cdn_url
[16] Fix | Delete
* @global string $ossdl_cname
[17] Fix | Delete
* @global int $ossdl_https
[18] Fix | Delete
* @global array $ossdl_off_include_dirs
[19] Fix | Delete
* @global array $ossdl_off_excludes
[20] Fix | Delete
* @global array $ossdl_arr_of_cnames
[21] Fix | Delete
*
[22] Fix | Delete
* @return void
[23] Fix | Delete
*/
[24] Fix | Delete
function scossdl_off_get_options() {
[25] Fix | Delete
global $ossdl_off_blog_url, $ossdl_off_cdn_url, $ossdl_cname, $ossdl_https;
[26] Fix | Delete
global $ossdl_off_include_dirs, $ossdl_off_excludes, $ossdl_arr_of_cnames;
[27] Fix | Delete
[28] Fix | Delete
$ossdl_off_blog_url = get_option( 'ossdl_off_blog_url' );
[29] Fix | Delete
if ( false === $ossdl_off_blog_url ) {
[30] Fix | Delete
$ossdl_off_blog_url = untrailingslashit( get_site_url() );
[31] Fix | Delete
add_option( 'ossdl_off_blog_url', $ossdl_off_blog_url );
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
if ( has_filter( 'ossdl_off_blog_url' ) ) {
[35] Fix | Delete
$ossdl_off_blog_url = untrailingslashit( apply_filters( 'ossdl_off_blog_url', $ossdl_off_blog_url ) );
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
$ossdl_off_cdn_url = get_option( 'ossdl_off_cdn_url' );
[39] Fix | Delete
if ( false === $ossdl_off_cdn_url ) {
[40] Fix | Delete
$ossdl_off_cdn_url = untrailingslashit( get_site_url() );
[41] Fix | Delete
add_option( 'ossdl_off_cdn_url', $ossdl_off_cdn_url );
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
$include_dirs = get_option( 'ossdl_off_include_dirs' );
[45] Fix | Delete
if ( false !== $include_dirs ) {
[46] Fix | Delete
$ossdl_off_include_dirs = array_filter( array_map( 'trim', explode( ',', $include_dirs ) ) );
[47] Fix | Delete
} else {
[48] Fix | Delete
$ossdl_off_include_dirs = scossdl_off_default_inc_dirs();
[49] Fix | Delete
add_option( 'ossdl_off_include_dirs', implode( ',', $ossdl_off_include_dirs ) );
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
$exclude = get_option( 'ossdl_off_exclude' );
[53] Fix | Delete
if ( false !== $exclude ) {
[54] Fix | Delete
$ossdl_off_excludes = array_filter( array_map( 'trim', explode( ',', $exclude ) ) );
[55] Fix | Delete
} else {
[56] Fix | Delete
$ossdl_off_excludes = array( '.php' );
[57] Fix | Delete
add_option( 'ossdl_off_exclude', implode( ',', $ossdl_off_excludes ) );
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
$ossdl_cname = get_option( 'ossdl_cname' );
[61] Fix | Delete
if ( false !== $ossdl_cname ) {
[62] Fix | Delete
$ossdl_cname = trim( $ossdl_cname );
[63] Fix | Delete
} else {
[64] Fix | Delete
$ossdl_cname = '';
[65] Fix | Delete
add_option( 'ossdl_cname', $ossdl_cname );
[66] Fix | Delete
}
[67] Fix | Delete
$ossdl_arr_of_cnames = array_filter( array_map( 'trim', explode( ',', $ossdl_cname ) ) );
[68] Fix | Delete
[69] Fix | Delete
$ossdl_https = intval( get_option( 'ossdl_https' ) );
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
/**
[73] Fix | Delete
* Get default directories.
[74] Fix | Delete
*
[75] Fix | Delete
* @return array
[76] Fix | Delete
*/
[77] Fix | Delete
function scossdl_off_default_inc_dirs() {
[78] Fix | Delete
[79] Fix | Delete
$home_path = trailingslashit( (string) parse_url( get_option( 'siteurl' ), PHP_URL_PATH ) );
[80] Fix | Delete
$inc_dirs = array();
[81] Fix | Delete
[82] Fix | Delete
foreach ( array( content_url(), includes_url() ) as $dir ) {
[83] Fix | Delete
$dir = wp_make_link_relative( $dir );
[84] Fix | Delete
$dir = preg_replace( '`^' . preg_quote( $home_path, '`' ) . '`', '', $dir );
[85] Fix | Delete
$inc_dirs[] = trim( $dir, '/' );
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
return $inc_dirs;
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* Determines whether to exclude a match.
[93] Fix | Delete
*
[94] Fix | Delete
* @param string $match URI to examine.
[95] Fix | Delete
* @param array $excludes Array of "badwords".
[96] Fix | Delete
*
[97] Fix | Delete
* @return boolean true if to exclude given match from rewriting.
[98] Fix | Delete
*/
[99] Fix | Delete
function scossdl_off_exclude_match( $match, $excludes ) {
[100] Fix | Delete
foreach ( $excludes as $badword ) {
[101] Fix | Delete
if ( false !== stripos( $match, $badword ) ) {
[102] Fix | Delete
return true;
[103] Fix | Delete
}
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
return false;
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* Compute string modulo, based on SHA1 hash
[111] Fix | Delete
*
[112] Fix | Delete
* @param string $str The string.
[113] Fix | Delete
* @param int $mod The divisor.
[114] Fix | Delete
*
[115] Fix | Delete
* @return int The remainder.
[116] Fix | Delete
*/
[117] Fix | Delete
function scossdl_string_mod( $str, $mod ) {
[118] Fix | Delete
/**
[119] Fix | Delete
* The full SHA1 is too large for PHP integer types.
[120] Fix | Delete
* This should be enough for our purpose.
[121] Fix | Delete
*/
[122] Fix | Delete
$num = hexdec( substr( sha1( $str ), 0, 5 ) );
[123] Fix | Delete
[124] Fix | Delete
return $num % $mod;
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
/**
[128] Fix | Delete
* Rewriter of URLs, used as replace-callback.
[129] Fix | Delete
*
[130] Fix | Delete
* Called by #scossdl_off_filter.
[131] Fix | Delete
*/
[132] Fix | Delete
function scossdl_off_rewriter( $match ) {
[133] Fix | Delete
global $ossdl_off_blog_url, $ossdl_https, $ossdl_off_excludes, $ossdl_arr_of_cnames;
[134] Fix | Delete
static $count_cnames = null, $include_dirs = null;
[135] Fix | Delete
[136] Fix | Delete
// Set up static variables. Run once only.
[137] Fix | Delete
if ( ! isset( $count_cnames ) ) {
[138] Fix | Delete
$count_cnames = count( $ossdl_arr_of_cnames );
[139] Fix | Delete
$include_dirs = scossdl_off_additional_directories();
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
if ( $ossdl_https && str_starts_with( $match[0], 'https' ) ) {
[143] Fix | Delete
return $match[0];
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
if ( scossdl_off_exclude_match( $match[0], $ossdl_off_excludes ) ) {
[147] Fix | Delete
return $match[0];
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
if ( preg_match( '`(' . $include_dirs . ')`', $match[0] ) ) {
[151] Fix | Delete
$offset = scossdl_string_mod( $match[1], $count_cnames );
[152] Fix | Delete
return str_replace( $ossdl_off_blog_url, $ossdl_arr_of_cnames[ $offset ], $match[0] );
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
return $match[0];
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
/**
[159] Fix | Delete
* Creates a regexp compatible pattern from the directories to be included in matching.
[160] Fix | Delete
*
[161] Fix | Delete
* @return String with the pattern with {@literal |} as prefix, or empty
[162] Fix | Delete
*/
[163] Fix | Delete
function scossdl_off_additional_directories() {
[164] Fix | Delete
global $ossdl_off_include_dirs;
[165] Fix | Delete
[166] Fix | Delete
$arr_dirs = array();
[167] Fix | Delete
foreach ( $ossdl_off_include_dirs as $dir ) {
[168] Fix | Delete
$arr_dirs[] = preg_quote( trim( $dir ), '`' );
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
return implode( '|', $arr_dirs );
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
/**
[175] Fix | Delete
* Output filter which runs the actual plugin logic.
[176] Fix | Delete
*
[177] Fix | Delete
* @param string $content The content of the output buffer.
[178] Fix | Delete
*
[179] Fix | Delete
* @return string The rewritten content.
[180] Fix | Delete
*/
[181] Fix | Delete
function scossdl_off_filter( $content ) {
[182] Fix | Delete
global $ossdl_off_blog_url, $ossdl_off_cdn_url;
[183] Fix | Delete
global $ossdl_off_include_dirs, $ossdl_off_excludes, $ossdl_arr_of_cnames;
[184] Fix | Delete
[185] Fix | Delete
if ( empty( $content ) || empty( $ossdl_off_cdn_url ) ||
[186] Fix | Delete
$ossdl_off_blog_url === $ossdl_off_cdn_url
[187] Fix | Delete
) {
[188] Fix | Delete
return $content; // no rewrite needed.
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
if ( empty( $ossdl_off_include_dirs ) || ! is_array( $ossdl_off_include_dirs ) ) {
[192] Fix | Delete
$ossdl_off_include_dirs = scossdl_off_default_inc_dirs();
[193] Fix | Delete
}
[194] Fix | Delete
[195] Fix | Delete
if ( empty( $ossdl_off_excludes ) || ! is_array( $ossdl_off_excludes ) ) {
[196] Fix | Delete
$ossdl_off_excludes = array();
[197] Fix | Delete
}
[198] Fix | Delete
[199] Fix | Delete
if ( ! in_array( $ossdl_off_cdn_url, (array) $ossdl_arr_of_cnames, true ) ) {
[200] Fix | Delete
$ossdl_arr_of_cnames = array_merge( array( $ossdl_off_cdn_url ), (array) $ossdl_arr_of_cnames );
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
$ossdl_arr_of_cnames = apply_filters( 'wpsc_cdn_urls', $ossdl_arr_of_cnames );
[204] Fix | Delete
[205] Fix | Delete
$dirs = scossdl_off_additional_directories();
[206] Fix | Delete
$regex = '`(?<=[(\"\'])' . preg_quote( $ossdl_off_blog_url, '`' ) . '/(?:((?:' . $dirs . ')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])`';
[207] Fix | Delete
return preg_replace_callback( $regex, 'scossdl_off_rewriter', $content );
[208] Fix | Delete
}
[209] Fix | Delete
[210] Fix | Delete
/**
[211] Fix | Delete
* Registers scossdl_off_filter as output buffer, if needed.
[212] Fix | Delete
*/
[213] Fix | Delete
function do_scossdl_off_ob_start() {
[214] Fix | Delete
global $ossdl_off_blog_url, $ossdl_off_cdn_url;
[215] Fix | Delete
[216] Fix | Delete
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
[217] Fix | Delete
return;
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
scossdl_off_get_options();
[221] Fix | Delete
[222] Fix | Delete
if ( ! empty( $ossdl_off_cdn_url ) &&
[223] Fix | Delete
$ossdl_off_blog_url !== $ossdl_off_cdn_url
[224] Fix | Delete
) {
[225] Fix | Delete
add_filter( 'wp_cache_ob_callback_filter', 'scossdl_off_filter' );
[226] Fix | Delete
}
[227] Fix | Delete
}
[228] Fix | Delete
[229] Fix | Delete
/**
[230] Fix | Delete
* Update CDN settings to the options database table.
[231] Fix | Delete
*/
[232] Fix | Delete
function scossdl_off_update() {
[233] Fix | Delete
[234] Fix | Delete
if ( isset( $_POST['action'], $_POST['_wpnonce'] )
[235] Fix | Delete
&& 'update_ossdl_off' === $_POST['action'] // WPCS: sanitization ok.
[236] Fix | Delete
&& wp_verify_nonce( $_POST['_wpnonce'], 'wp-cache' )
[237] Fix | Delete
) {
[238] Fix | Delete
update_option( 'ossdl_off_cdn_url', untrailingslashit( wp_unslash( $_POST['ossdl_off_cdn_url'] ) ) ); // WPSC: sanitization ok.
[239] Fix | Delete
update_option( 'ossdl_off_blog_url', untrailingslashit( wp_unslash( $_POST['ossdl_off_blog_url'] ) ) ); // WPSC: sanitization ok.
[240] Fix | Delete
[241] Fix | Delete
if ( empty( $_POST['ossdl_off_include_dirs'] ) ) {
[242] Fix | Delete
$include_dirs = implode( ',', scossdl_off_default_inc_dirs() );
[243] Fix | Delete
} else {
[244] Fix | Delete
$include_dirs = sanitize_text_field( wp_unslash( $_POST['ossdl_off_include_dirs'] ) ); // WPSC: validation ok,sanitization ok.
[245] Fix | Delete
}
[246] Fix | Delete
update_option( 'ossdl_off_include_dirs', $include_dirs );
[247] Fix | Delete
[248] Fix | Delete
update_option( 'ossdl_off_exclude', sanitize_text_field( wp_unslash( $_POST['ossdl_off_exclude'] ) ) ); // WPSC: sanitization ok.
[249] Fix | Delete
update_option( 'ossdl_cname', sanitize_text_field( wp_unslash( $_POST['ossdl_cname'] ) ) ); // WPSC: sanitization ok.
[250] Fix | Delete
[251] Fix | Delete
$ossdl_https = empty( $_POST['ossdl_https'] ) ? 0 : 1;
[252] Fix | Delete
$ossdlcdn = empty( $_POST['ossdlcdn'] ) ? 0 : 1;
[253] Fix | Delete
[254] Fix | Delete
update_option( 'ossdl_https', $ossdl_https );
[255] Fix | Delete
wp_cache_setting( 'ossdlcdn', $ossdlcdn );
[256] Fix | Delete
}
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
/**
[260] Fix | Delete
* Show CDN settings.
[261] Fix | Delete
*/
[262] Fix | Delete
function scossdl_off_options() {
[263] Fix | Delete
global $ossdlcdn, $ossdl_off_blog_url, $ossdl_off_cdn_url, $ossdl_cname, $ossdl_https;
[264] Fix | Delete
global $ossdl_off_include_dirs, $ossdl_off_excludes;
[265] Fix | Delete
[266] Fix | Delete
scossdl_off_update();
[267] Fix | Delete
[268] Fix | Delete
scossdl_off_get_options();
[269] Fix | Delete
[270] Fix | Delete
$example_cdn_uri = ( is_ssl() ? 'https' : 'http' ) . '://cdn.' . preg_replace( '`^(https?:)?//(www\.)?`', '', get_site_url() );
[271] Fix | Delete
$example_cnames = str_replace( '://cdn.', '://cdn1.', $example_cdn_uri );
[272] Fix | Delete
$example_cnames .= ',' . str_replace( '://cdn.', '://cdn2.', $example_cdn_uri );
[273] Fix | Delete
$example_cnames .= ',' . str_replace( '://cdn.', '://cdn3.', $example_cdn_uri );
[274] Fix | Delete
[275] Fix | Delete
$example_cdn_uri = ( get_site_url() === $ossdl_off_cdn_url ) ? $example_cdn_uri : $ossdl_off_cdn_url;
[276] Fix | Delete
$example_cdn_uri .= '/wp-includes/js/jquery/jquery-migrate.js';
[277] Fix | Delete
$example_cdn_uri = esc_url( $example_cdn_uri );
[278] Fix | Delete
?>
[279] Fix | Delete
<div class="wpsc-card">
[280] Fix | Delete
<h3><?php _e( 'Jetpack CDN' ); ?></h3>
[281] Fix | Delete
<p><?php printf(
[282] Fix | Delete
__( 'The free %1$sJetpack plugin%2$s has a %3$sSite Accelerator%2$s feature that is easier to use than the CDN functionality in this plugin. However files will be cached "forever" and will not update if you update the local file. Files will need to be renamed to refresh them. The %3$sJetpack documentation%2$s explains more about this.', 'wp-super-cache' ),
[283] Fix | Delete
'<a href="https://jetpack.com/">',
[284] Fix | Delete
'</a>',
[285] Fix | Delete
'<a href="https://jetpack.com/support/site-accelerator/">'
[286] Fix | Delete
); ?></p>
[287] Fix | Delete
<?php
[288] Fix | Delete
if ( class_exists( 'Jetpack' ) ) {
[289] Fix | Delete
if ( Jetpack::is_module_active( 'photon' ) ) {
[290] Fix | Delete
?><p><strong><?php printf(
[291] Fix | Delete
__( 'You already have Jetpack installed and %1$sSite Accelerator%2$s enabled on this blog. The CDN here is disabled to avoid conflicts with Jetpack.', 'wp-super-cache' ),
[292] Fix | Delete
'<a href="https://jetpack.com/support/site-accelerator/">',
[293] Fix | Delete
'</a>'
[294] Fix | Delete
); ?></strong></p><?php
[295] Fix | Delete
} else {
[296] Fix | Delete
?><p><?php printf(
[297] Fix | Delete
__( 'You already have Jetpack installed but %1$sSite Accelerator%2$s is disabled on this blog. Enable it on the %3$sJetpack settings page%2$s.', 'wp-super-cache' ),
[298] Fix | Delete
'<a href="https://jetpack.com/support/site-accelerator/">',
[299] Fix | Delete
'</a>',
[300] Fix | Delete
'<a href="' . admin_url( 'admin.php?page=jetpack#/settings' ) . '">'
[301] Fix | Delete
); ?></p><?php
[302] Fix | Delete
}
[303] Fix | Delete
} else {
[304] Fix | Delete
?><p><strong><?php printf(
[305] Fix | Delete
__( '%1$sJetpack%2$s was not found on your site but %3$syou can install it%2$s. The Site Accelerator feature is free to use on any WordPress site and offers the same benefit as other CDN services. You should give it a try!', 'wp-super-cache' ),
[306] Fix | Delete
'<a href="https://jetpack.com/">',
[307] Fix | Delete
'</a>',
[308] Fix | Delete
'<a href="' . admin_url( 'plugin-install.php?s=jetpack&tab=search&type=term' ) . '">'
[309] Fix | Delete
); ?></strong></p><?php
[310] Fix | Delete
}
[311] Fix | Delete
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
[312] Fix | Delete
echo '</div>'; // close wpsc-card
[313] Fix | Delete
return;
[314] Fix | Delete
}
[315] Fix | Delete
?>
[316] Fix | Delete
<h3><?php _e( 'Simple CDN' ); ?></h3>
[317] Fix | Delete
<p><?php _e( 'Your website probably uses lots of static files. Image, Javascript and CSS files are usually static files that could just as easily be served from another site or CDN. Therefore, this plugin replaces any links in the <code>wp-content</code> and <code>wp-includes</code> directories (except for PHP files) on your site with the URL you provide below. That way you can either copy all the static content to a dedicated host or mirror the files to a CDN by <a href="https://www.google.com/search?q=cdn+origin+pull" target="_blank">origin pull</a>.', 'wp-super-cache' ); ?></p>
[318] Fix | Delete
<p><?php printf( __( '<strong style="color: red">WARNING:</strong> Test some static urls e.g., %s to ensure your CDN service is fully working before saving changes.', 'wp-super-cache' ), '<code>' . esc_html( $example_cdn_uri ) . '</code>' ); ?></p>
[319] Fix | Delete
[320] Fix | Delete
<?php if ( get_home_url() !== $ossdl_off_blog_url ) { ?>
[321] Fix | Delete
<p><?php printf( __( '<strong style="color: red">WARNING:</strong> Your siteurl and homeurl are different. The plugin is using %s as the homepage URL of your site but if that is wrong please use the filter "ossdl_off_blog_url" to fix it.', 'wp-super-cache' ), '<code>' . esc_html( $ossdl_off_blog_url ) . '</code>' ); ?></p>
[322] Fix | Delete
<?php } ?>
[323] Fix | Delete
<p><?php esc_html_e( 'You can define different CDN URLs for each site on a multsite network.', 'wp-super-cache' ); ?></p>
[324] Fix | Delete
<p><form method="post" action="">
[325] Fix | Delete
<?php wp_nonce_field( 'wp-cache' ); ?>
[326] Fix | Delete
<table class="form-table"><tbody>
[327] Fix | Delete
<tr valign="top">
[328] Fix | Delete
<td style='text-align: right'>
[329] Fix | Delete
<input id='ossdlcdn' type="checkbox" name="ossdlcdn" value="1" <?php checked( $ossdlcdn ); ?> />
[330] Fix | Delete
</td>
[331] Fix | Delete
<th scope="row"><label for="ossdlcdn"><?php esc_html_e( 'Enable CDN Support', 'wp-super-cache' ); ?></label></th>
[332] Fix | Delete
</tr>
[333] Fix | Delete
<tr valign="top">
[334] Fix | Delete
<th scope="row"><label for="ossdl_off_cdn_url"><?php esc_html_e( 'Site URL', 'wp-super-cache' ); ?></label></th>
[335] Fix | Delete
<td>
[336] Fix | Delete
<input type="text" name="ossdl_off_blog_url" value="<?php echo esc_attr( untrailingslashit( $ossdl_off_blog_url ) ); ?>" size="64" class="regular-text code" /><br />
[337] Fix | Delete
<span class="description"><?php _e( 'The URL of your site. No trailing <code>/</code> please.', 'wp-super-cache' ); ?></span>
[338] Fix | Delete
</td>
[339] Fix | Delete
</tr>
[340] Fix | Delete
<tr valign="top">
[341] Fix | Delete
<th scope="row"><label for="ossdl_off_cdn_url"><?php esc_html_e( 'Off-site URL', 'wp-super-cache' ); ?></label></th>
[342] Fix | Delete
<td>
[343] Fix | Delete
<input type="text" name="ossdl_off_cdn_url" value="<?php echo esc_attr( $ossdl_off_cdn_url ); ?>" size="64" class="regular-text code" /><br />
[344] Fix | Delete
<span class="description"><?php printf( __( 'The new URL to be used in place of %1$s for rewriting. No trailing <code>/</code> please.<br />Example: <code>%2$s</code>.', 'wp-super-cache' ), esc_html( get_site_url() ), esc_html( $example_cdn_uri ) ); ?></span>
[345] Fix | Delete
</td>
[346] Fix | Delete
</tr>
[347] Fix | Delete
<tr valign="top">
[348] Fix | Delete
<th scope="row"><label for="ossdl_off_include_dirs"><?php esc_html_e( 'Include directories', 'wp-super-cache' ); ?></label></th>
[349] Fix | Delete
<td>
[350] Fix | Delete
<input type="text" name="ossdl_off_include_dirs" value="<?php echo esc_attr( implode( ',', $ossdl_off_include_dirs ) ); ?>" size="64" class="regular-text code" /><br />
[351] Fix | Delete
<span class="description"><?php _e( 'Directories to include in static file matching. Use a comma as the delimiter. Default is <code>wp-content, wp-includes</code>, which will be enforced if this field is left empty.', 'wp-super-cache' ); ?></span>
[352] Fix | Delete
</td>
[353] Fix | Delete
</tr>
[354] Fix | Delete
<tr valign="top">
[355] Fix | Delete
<th scope="row"><label for="ossdl_off_exclude"><?php esc_html_e( 'Exclude if substring', 'wp-super-cache' ); ?></label></th>
[356] Fix | Delete
<td>
[357] Fix | Delete
<input type="text" name="ossdl_off_exclude" value="<?php echo esc_attr( implode( ',', $ossdl_off_excludes ) ); ?>" size="64" class="regular-text code" /><br />
[358] Fix | Delete
<span class="description"><?php _e( 'Excludes something from being rewritten if one of the above strings is found in the URL. Use a comma as the delimiter like this, <code>.php, .flv, .do</code>, and always include <code>.php</code> (default).', 'wp-super-cache' ); ?></span>
[359] Fix | Delete
</td>
[360] Fix | Delete
</tr>
[361] Fix | Delete
<tr valign="top">
[362] Fix | Delete
<th scope="row"><label for="ossdl_cname"><?php esc_html_e( 'Additional CNAMES', 'wp-super-cache' ); ?></label></th>
[363] Fix | Delete
<td>
[364] Fix | Delete
<input type="text" name="ossdl_cname" value="<?php echo esc_attr( $ossdl_cname ); ?>" size="64" class="regular-text code" /><br />
[365] Fix | Delete
<span class="description"><?php printf( __( 'These <a href="https://www.wikipedia.org/wiki/CNAME_record">CNAMES</a> will be used in place of %1$s for rewriting (in addition to the off-site URL above). Use a comma as the delimiter. For pages with a large number of static files, this can improve browser performance. CNAMEs may also need to be configured on your CDN.<br />Example: %2$s', 'wp-super-cache' ), esc_html( get_site_url() ), esc_html( $example_cnames ) ); ?></span>
[366] Fix | Delete
</td>
[367] Fix | Delete
</tr>
[368] Fix | Delete
<tr valign="top">
[369] Fix | Delete
<th scope="row" colspan='2'><label><input type='checkbox' name='ossdl_https' value='1' <?php checked( $ossdl_https ); ?> /><?php esc_html_e( 'Skip https URLs to avoid "mixed content" errors', 'wp-super-cache' ); ?></label></th>
[370] Fix | Delete
</tr>
[371] Fix | Delete
</tbody></table>
[372] Fix | Delete
<input type="hidden" name="action" value="update_ossdl_off" />
[373] Fix | Delete
<p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'wp-super-cache' ); ?>" /></p>
[374] Fix | Delete
</form></p>
[375] Fix | Delete
<p>
[376] Fix | Delete
<?php
[377] Fix | Delete
printf(
[378] Fix | Delete
/* Translators: placeholder is a link to OSSDL CDN Off Linker plugin on WordPress.org */
[379] Fix | Delete
esc_html__( 'CDN functionality provided by %s by Mark Kubacki', 'wp-super-cache' ),
[380] Fix | Delete
'<a href="https://wordpress.org/plugins/ossdl-cdn-off-linker/">OSSDL CDN Off Linker</a>'
[381] Fix | Delete
);
[382] Fix | Delete
?>
[383] Fix | Delete
</p>
[384] Fix | Delete
</div> <!-- Close .wpsc-card -->
[385] Fix | Delete
<?php
[386] Fix | Delete
}
[387] Fix | Delete
[388] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function