Skip to content

Commit

Permalink
Super Cache: be more defensive when fetching promo links
Browse files Browse the repository at this point in the history
Fixes #34960

Avoid trying to fetch specific links when the global is not set.
  • Loading branch information
jeherve committed Jan 11, 2024
1 parent 05e4a87 commit f366a4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

General: avoid deprecation warnings when trying to get URLs in PHP 8.2
13 changes: 7 additions & 6 deletions projects/plugins/super-cache/wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1292,14 +1292,15 @@ function toggleLayer( whichLayer ) {
</td><td valign='top' style='width: 300px'>
<!-- TODO: Hide #wpsc-callout from all pages except the Easy tab -->
<div class="wpsc-card" id="wpsc-callout">
<h4><?php _e( 'Other Site Tools', 'wp-super-cache' ); ?></h4>
<?php if ( ! empty( $wpsc_promo_links ) && is_array( $wpsc_promo_links ) ) : ?>
<h4><?php esc_html_e( 'Other Site Tools', 'wp-super-cache' ); ?></h4>
<ul style="list-style: square; margin-left: 2em;">

<li><a href="<?php echo esc_url( $wpsc_promo_links['boost'] ); ?>"><?php esc_html_e( 'Boost your page speed scores', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['photon'] ); ?>"><?php esc_html_e( 'Speed up images and photos (free)', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['videopress'] ); ?>"><?php esc_html_e( 'Fast video hosting (paid)', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['crowdsignal'] ); ?>"><?php esc_html_e( 'Add Surveys and Polls to your site', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['boost'] ); ?>"><?php esc_html_e( 'Boost your page speed scores', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['photon'] ); ?>"><?php esc_html_e( 'Speed up images and photos (free)', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['videopress'] ); ?>"><?php esc_html_e( 'Fast video hosting (paid)', 'wp-super-cache' ); ?></a></li>
<li><a href="<?php echo esc_url( $wpsc_promo_links['crowdsignal'] ); ?>"><?php esc_html_e( 'Add Surveys and Polls to your site', 'wp-super-cache' ); ?></a></li>
</ul>
<?php endif; ?>
<h4><?php _e( 'Need Help?', 'wp-super-cache' ); ?></h4>
<ol>
<li><?php printf( __( 'Use the <a href="%1$s">Debug tab</a> for diagnostics.', 'wp-super-cache' ), admin_url( 'options-general.php?page=wpsupercache&tab=debug' ) ); ?></li>
Expand Down

0 comments on commit f366a4a

Please sign in to comment.