Plugin Directory

Changeset 2902901


Ignore:
Timestamp:
04/23/2023 07:43:34 AM (3 years ago)
Author:
wpforchurch
Message:

New Checkbox added for the support of http:// or https:// inside the enclosure URL under the Podcast tab in the settings menu.

Location:
sermon-manager-for-wordpress/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sermon-manager-for-wordpress/trunk/changelog.txt

    r2891898 r2902901  
     1= 2.17.1.1 =
     2Add: New Checkbox added for the support of http:// or https:// inside the enclosure URL under the Podcast tab in the settings menu.
     3
    14### 2.17.1 ###
    25Fixed: Compability issues with PHP 8.x
  • sermon-manager-for-wordpress/trunk/includes/admin/settings/class-sm-settings-podcast.php

    r1953687 r2902901  
    211211                'default'  => 'no',
    212212            ),
     213            array(
     214                'title'    => __( 'Use "https://" in Enclosure URL', 'sermon-manager-for-wordpress' ),
     215                'type'     => 'checkbox',
     216                'id'       => 'podcast_enclosure_url',
     217                'desc'     => __( 'Podcast RSS feed Enclosure URL. Uncheck if description looks messy.' ),
     218                'desc_tip' => __( 'It is advisable to keep the checkbox unchecked, as selecting it will automatically replace all instances of "http://" with "https://" in the Enclosure URL of the podcast\'s RSS feed.', 'sermon-manager-for-wordpress' ),
     219                'default'  => 'no',
     220            ),
    213221
    214222            array(
  • sermon-manager-for-wordpress/trunk/sermons.php

    r2891898 r2902901  
    44 * Plugin URI: https://www.wpforchurch.com/products/sermon-manager-for-wordpress/
    55 * Description: Add audio and video sermons, manage speakers, series, and more.
    6  * Version: 2.17.1
     6 * Version: 2.17.1.1
    77 * Author: WP for Church
    88 * Author URI: https://www.wpforchurch.com/
    99 * Requires at least: 4.5
    10  * Tested up to: 5.9.3
     10 * Tested up to wordpress: 6.2
     11 * Tested up to PHP : 8.0.2
    1112 *
    1213 * Text Domain: sermon-manager-for-wordpress
  • sermon-manager-for-wordpress/trunk/views/wpfc-podcast-feed.php

    r2806220 r2902901  
    296296        <?php endif; ?>
    297297        <?php
     298        $podcast_enclosure_url = get_option("sermonmanager_podcast_enclosure_url");
     299        $use_https = ($podcast_enclosure_url == "yes")?true:false;
    298300        if ( $sermon_podcast_query->have_posts() ) :
    299301            while ( $sermon_podcast_query->have_posts() ) :
     
    304306                $audio_url_wp      = $audio_id ? wp_get_attachment_url( intval( $audio_id ) ) : false;
    305307                $audio_url         = $audio_id && $audio_url_wp ? $audio_url_wp : get_post_meta( $post->ID, 'sermon_audio', true );
    306                 $audio_raw         = str_ireplace( 'https://', 'http://', $audio_url );
     308                $audio_raw         = $use_https ? str_ireplace( 'http://', 'https://', $audio_url ) : str_ireplace( 'https://', 'http://', $audio_url );
    307309                $audio_p           = strrpos( $audio_raw, '/' ) + 1;
    308310                $audio_raw         = urldecode( $audio_raw );
     
    314316                $topics            = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_topics', '', ', ', '' ) );
    315317                $post_image        = get_sermon_image_url( $settings['podcast_sermon_image_series'] );
    316                 $post_image        = str_ireplace( 'https://', 'http://', ! empty( $post_image ) ? $post_image : '' );
     318                $post_image        =  $use_https ? str_ireplace( 'http://', 'https://', ! empty( $post_image ) ? $post_image : '' ) :  str_ireplace( 'https://', 'http://', ! empty( $post_image ) ? $post_image : '' );
    317319                $audio_duration    = get_post_meta( $post->ID, '_wpfc_sermon_duration', true ) ?: '0:00';
    318320                $audio_file_size   = get_post_meta( $post->ID, '_wpfc_sermon_size', 'true' ) ?: 0;
     
    331333
    332334                if ( $settings['podtrac'] ) {
    333                     $audio = 'http://dts.podtrac.com/redirect.mp3/' . esc_url( preg_replace( '#^https?://#', '', $audio ) );
     335                    $audio =  $use_https ? 'https://dts.podtrac.com/redirect.mp3/' . esc_url( preg_replace( '#^https?://#', '', $audio ) ) :  'http://dts.podtrac.com/redirect.mp3/' . esc_url( preg_replace( '#^https?://#', '', $audio ) );
    334336                } else {
    335337                    // As per RSS 2.0 spec, the enclosure URL must be HTTP only:
    336338                    // http://www.rssboard.org/rss-specification#ltenclosuregtSubelementOfLtitemgt .
    337                     $audio = preg_replace( '/^https:/i', 'http:', $audio );
     339                    // $audio = preg_replace( '/^https:/i', 'http:', $audio );
     340                    $audio =  $use_https ? preg_replace( '/^http:/i', 'https:', $audio ) : preg_replace( '/^https:/i', 'http:', $audio );
    338341                }
    339342                ?>
Note: See TracChangeset for help on using the changeset viewer.