From 8e8f71c8f9466706998292caec80d8a7983f2de8 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Thu, 4 Jul 2019 11:27:13 +0200 Subject: [PATCH 01/10] Add turbocharge feed setting --- .../handlers/class-settings-handler.php | 8 ++++ templates/feed-podcast.php | 47 +++++++++++-------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/php/classes/handlers/class-settings-handler.php b/php/classes/handlers/class-settings-handler.php index 2126bee3..eaef02d9 100644 --- a/php/classes/handlers/class-settings-handler.php +++ b/php/classes/handlers/class-settings-handler.php @@ -576,6 +576,14 @@ public function settings_fields() { 'default' => '', 'callback' => 'wp_strip_all_tags', ), + array( + 'id' => 'turbocharge_feed', + 'label' => __( 'Turbocharge podcast feed', 'seriously-simple-podcasting' ), + 'description' => sprintf( __( 'When enabled, this setting will speed up your feed loading time, by limiting or disabling certain content fields.', 'seriously-simple-podcasting' ), '
' ), + 'type' => 'checkbox', + 'default' => '', + 'callback' => 'wp_strip_all_tags', + ), array( 'id' => 'new_feed_url', 'label' => __( 'New podcast feed URL', 'seriously-simple-podcasting' ), diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index 8e6ed05d..a7a406d2 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -118,6 +118,8 @@ } } +$turbo = get_option( 'ss_podcasting_turbocharge_feed', 'off' ); + // Podcast title $title = get_option( 'ss_podcasting_data_title', get_bloginfo( 'name' ) ); if ( $podcast_series ) { @@ -242,20 +244,12 @@ $category2 = ssp_get_feed_category_output( 2, $series_id ); $category3 = ssp_get_feed_category_output( 3, $series_id ); -// Get stylehseet URL (filterable to allow custom RSS stylesheets) -$stylehseet_url = apply_filters( 'ssp_rss_stylesheet', $ss_podcasting->template_url . 'feed-stylesheet.xsl' ); - // Set RSS content type and charset headers header( 'Content-Type: ' . feed_content_type( 'podcast' ) . '; charset=' . get_option( 'blog_charset' ), true ); // Use `echo` for first line to prevent any extra characters at start of document echo '' . "\n"; -// Include RSS stylesheet -if ( $stylehseet_url ) { - echo ''; -} - // Get iTunes Type $itunes_type = get_option( 'ss_podcasting_consume_order' . ( $series_id > 0 ? '_' . $series_id : null ) ); ?> @@ -289,22 +283,17 @@ - - - - - <?php echo esc_html( $title ); ?> @@ -334,8 +323,18 @@ - + + + + + + + + + + element remove_action( 'rss2_head', 'rss2_site_icon' ); @@ -526,20 +525,28 @@ - ]]> + + ]]> + + ]]> + + ]]> - ]]> - - - - + + ]]> + + + + + + From 3d10878fa3ff7cf17cf7da7e04808d51d98be8ca Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Thu, 4 Jul 2019 11:29:02 +0200 Subject: [PATCH 02/10] Version bump --- readme.txt | 6 +++++- seriously-simple-podcasting.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index afea7ded..e24e721a 100644 --- a/readme.txt +++ b/readme.txt @@ -102,7 +102,11 @@ You can find complete user and developer documentation (along with the FAQs) on == Changelog == -= 1.20.4= += 1.20.5-beta = +* 2019-07-04 +* [NEW] Add the ability to turbo charge the load times of the RSS feed, by limiting certain fields + += 1.20.4 = * 2019-07-01 * [FIX] Fixes a bug introduced by 1.20.0 which breaks password protecting a feed diff --git a/seriously-simple-podcasting.php b/seriously-simple-podcasting.php index 714deda3..31308d84 100644 --- a/seriously-simple-podcasting.php +++ b/seriously-simple-podcasting.php @@ -1,7 +1,7 @@ Date: Thu, 4 Jul 2019 12:02:14 +0200 Subject: [PATCH 03/10] Corrected turbo charged content field --- templates/feed-podcast.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index a7a406d2..5fc948f7 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -528,7 +528,7 @@ ]]> - ]]> + ]]> ]]> From c1ccbe95b3967fb6c83a453de652235e1c856c5d Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Thu, 4 Jul 2019 12:43:29 +0200 Subject: [PATCH 04/10] Only apply turbocharge settings to all episodes after the newest 10 Updated to remove content:encoded and itunes:summary fields if enabled --- .../handlers/class-settings-handler.php | 2 +- templates/feed-podcast.php | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/php/classes/handlers/class-settings-handler.php b/php/classes/handlers/class-settings-handler.php index eaef02d9..c36fed34 100644 --- a/php/classes/handlers/class-settings-handler.php +++ b/php/classes/handlers/class-settings-handler.php @@ -579,7 +579,7 @@ public function settings_fields() { array( 'id' => 'turbocharge_feed', 'label' => __( 'Turbocharge podcast feed', 'seriously-simple-podcasting' ), - 'description' => sprintf( __( 'When enabled, this setting will speed up your feed loading time, by limiting or disabling certain content fields.', 'seriously-simple-podcasting' ), '
' ), + 'description' => sprintf( __( 'When enabled, this setting will speed up your feed loading time. %1$sMore details here.%2$s', 'seriously-simple-podcasting' ), '', '' ), 'type' => 'checkbox', 'default' => '', 'callback' => 'wp_strip_all_tags', diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index 5fc948f7..68d02412 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -118,8 +118,6 @@ } } -$turbo = get_option( 'ss_podcasting_turbocharge_feed', 'off' ); - // Podcast title $title = get_option( 'ss_podcasting_data_title', get_bloginfo( 'name' ) ); if ( $podcast_series ) { @@ -252,6 +250,9 @@ // Get iTunes Type $itunes_type = get_option( 'ss_podcasting_consume_order' . ( $series_id > 0 ? '_' . $series_id : null ) ); + +$turbo = get_option( 'ss_podcasting_turbocharge_feed', 'off' ); + ?> have_posts() ) { while ( $qry->have_posts() ) { $qry->the_post(); @@ -398,7 +403,6 @@ } $size = apply_filters( 'ssp_feed_item_size', $size, get_the_ID() ); - // File MIME type (default to MP3/MP4 to ensure there is always a value for this) $mime_type = $ss_podcasting->get_attachment_mimetype( $audio_file ); if ( ! $mime_type ) { @@ -501,6 +505,9 @@ $itunes_episode_number = get_post_meta( get_the_ID(), 'itunes_episode_number', true ); $itunes_season_number = get_post_meta( get_the_ID(), 'itunes_season_number', true ); } + if ( isset( $post_count ) ) { + $post_count ++; + } ?> <?php esc_html( the_title_rss() ); ?> @@ -525,13 +532,13 @@ - + ]]> - - ]]> - ]]> + + ]]> + From bf91a8a056c48479329b65606b96f180be7e7f40 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Fri, 5 Jul 2019 13:18:52 +0200 Subject: [PATCH 05/10] Fixed tax-query in ssp_episodes function --- php/includes/ssp-functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/php/includes/ssp-functions.php b/php/includes/ssp-functions.php index bf7c6366..ef02519c 100644 --- a/php/includes/ssp-functions.php +++ b/php/includes/ssp-functions.php @@ -354,7 +354,13 @@ function ssp_episodes( $n = 10, $series = '', $return_args = false, $context = ' ); if ( $series ) { - $args['series'] = esc_attr( $series ); + $args['tax_query'] = array( + array( + 'taxonomy' => 'series', + 'field' => 'slug', + 'terms' => esc_attr( $series ) + ) + ); } $args = apply_filters( 'ssp_episode_query_args', $args, $context ); From 304e4d377efc1fa9db4bd9810cb2b1d6f3342b5d Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Mon, 8 Jul 2019 12:06:04 +0200 Subject: [PATCH 06/10] Output the full show content in the description tag --- templates/feed-podcast.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index 8e6ed05d..9828ed3a 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -509,7 +509,7 @@ - ]]> + ]]> ]]> From 56d5e213f5d0b4659c41aab6abb43eb6634cb790 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Mon, 8 Jul 2019 14:10:36 +0200 Subject: [PATCH 07/10] Updating description to be the same as itunes summary Full HTML content, without shortcodes, limited to 3999 --- templates/feed-podcast.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index 9828ed3a..ff8dae56 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -446,16 +446,11 @@ $content = preg_replace( '/<\/?iframe(.|\s)*?>/', '', $content ); $content = apply_filters( 'ssp_feed_item_content', $content, get_the_ID() ); - // iTunes summary is the full episode content, but must be shorter than 4000 characters - $itunes_summary = mb_substr( $content, 0, 3999 ); - $itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID() ); - $gp_description = apply_filters( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID() ); - - // Episode description - ob_start(); - the_excerpt_rss(); - $description = ob_get_clean(); - $description = apply_filters( 'ssp_feed_item_description', $description, get_the_ID() ); + // Description, iTunes summary and Google Play description is the full episode content, but must be shorter than 4000 characters + $description = mb_substr( $content, 0, 3999 ); + $itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $description, get_the_ID() ); + $gp_description = apply_filters( 'ssp_feed_item_gp_description', $description, get_the_ID() ); + $description = apply_filters( 'ssp_feed_item_description', $description, get_the_ID() ); // iTunes subtitle does not allow any HTML and must be shorter than 255 characters $itunes_subtitle = strip_tags( strip_shortcodes( $description ) ); @@ -509,7 +504,7 @@ - ]]> + ]]> ]]> From 334cfe9af400781b877c88e85ba451541f57ce30 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Mon, 8 Jul 2019 14:38:46 +0200 Subject: [PATCH 08/10] Remove shortcodes from description field --- templates/feed-podcast.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index ff8dae56..f94025ce 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -441,8 +441,9 @@ $author = esc_html( get_the_author() ); $author = apply_filters( 'ssp_feed_item_author', $author, get_the_ID() ); - // Episode content (with iframes removed) + // Episode content (with shortcodes and iframes removed) $content = get_the_content_feed( 'rss2' ); + $content = strip_shortcodes( $content ); $content = preg_replace( '/<\/?iframe(.|\s)*?>/', '', $content ); $content = apply_filters( 'ssp_feed_item_content', $content, get_the_ID() ); From d170ea3f39783682464cb1ade67745c433aa983a Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Tue, 9 Jul 2019 08:50:22 +0200 Subject: [PATCH 09/10] Ensuring itunes summary does not include HTML Ensuring that googleplay:description is limited to 1000 characters --- templates/feed-podcast.php | 61 ++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/templates/feed-podcast.php b/templates/feed-podcast.php index 50d6b929..39fb5f40 100644 --- a/templates/feed-podcast.php +++ b/templates/feed-podcast.php @@ -450,41 +450,52 @@ $content = preg_replace( '/<\/?iframe(.|\s)*?>/', '', $content ); $content = apply_filters( 'ssp_feed_item_content', $content, get_the_ID() ); - // Description, iTunes summary and Google Play description is the full episode content, but must be shorter than 4000 characters - $description = mb_substr( $content, 0, 3999 ); - $itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $description, get_the_ID() ); - $gp_description = apply_filters( 'ssp_feed_item_gp_description', $description, get_the_ID() ); - $description = apply_filters( 'ssp_feed_item_description', $description, get_the_ID() ); - - // iTunes subtitle does not allow any HTML and must be shorter than 255 characters - $itunes_subtitle = strip_tags( strip_shortcodes( $description ) ); - $itunes_subtitle = str_replace( array( - '>', - '<', - '\'', - '"', - '`', - '[andhellip;]', - '[…]', - '[…]' - ), array( '', '', '', '', '', '', '', '' ), $itunes_subtitle ); + // Description is the full episode content, includes HTML, but must be shorter than 4000 characters + $description = mb_substr( $content, 0, 3999 ); + $description = apply_filters( 'ssp_feed_item_description', $description, get_the_ID() ); + + // iTunes summary excludes HTML and must be shorter than 4000 characters + $itunes_summary = wp_strip_all_tags( $content ); + $itunes_summary = mb_substr( $itunes_summary, 0, 3999 ); + $itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID() ); + + // Google Play description is the same as iTunes summary, but must be shorter than 1000 characters + $gp_description = mb_substr( $itunes_summary, 0, 999 ); + $gp_description = apply_filters( 'ssp_feed_item_gp_description', $gp_description, get_the_ID() ); + + // iTunes subtitle excludes HTML and must be shorter than 255 characters + $itunes_subtitle = wp_strip_all_tags( $description ); + $itunes_subtitle = str_replace( + array( + '>', + '<', + '\'', + '"', + '`', + '[andhellip;]', + '[…]', + '[…]', + ), + array( '', '', '', '', '', '', '', '' ), + $itunes_subtitle + ); $itunes_subtitle = mb_substr( $itunes_subtitle, 0, 254 ); $itunes_subtitle = apply_filters( 'ssp_feed_item_itunes_subtitle', $itunes_subtitle, get_the_ID() ); // Date recorded - $pubDateType = get_option( 'ss_podcasting_publish_date', 'published' ); - if ( $pubDateType === 'published' ) { - $pubDate = esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ) ); - } else // 'recorded' + $pub_date_type = get_option( 'ss_podcasting_publish_date', 'published' ); + if ( 'published' === $pub_date_type ) { + $pub_date = esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ) ); + } else // 'recorded'. { - $pubDate = esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_meta( get_the_ID(), 'date_recorded', true ), false ) ); + $pub_date = esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_meta( get_the_ID(), 'date_recorded', true ), false ) ); } // Tags/keywords $post_tags = get_the_tags( get_the_ID() ); if ( $post_tags ) { $tags = array(); - foreach( $post_tags as $tag ) { + foreach ( $post_tags as $tag ) { $tags[] = $tag->name; } $tags = apply_filters( 'ssp_feed_item_itunes_keyword_tags', $tags, get_the_ID() ); @@ -508,7 +519,7 @@ <?php esc_html( the_title_rss() ); ?> - + ]]> From debe4bc7ee20c8c7a498a75777ada08f7a506c1a Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Wed, 10 Jul 2019 11:09:50 +0200 Subject: [PATCH 10/10] Released version 1.20.5 --- readme.txt | 8 +++++--- seriously-simple-podcasting.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index e24e721a..a216ef65 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: podcast, audio, video, vodcast, rss, mp3, mp4, feed, itunes, podcasting, m Requires at least: 4.4 Tested up to: 5.2 Requires PHP: 5.6 -Stable tag: 1.20.4 +Stable tag: 1.20.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -102,9 +102,11 @@ You can find complete user and developer documentation (along with the FAQs) on == Changelog == -= 1.20.5-beta = -* 2019-07-04 += 1.20.5 = +* 2019-07-10 * [NEW] Add the ability to turbo charge the load times of the RSS feed, by limiting certain fields +* [CHANGE] Updated the RSS feed description tag, itunes:summary tag and googleplay:description tag to meet RSS feed requirements +* [FIX] Fixes a bug when retrieving posts by series = 1.20.4 = * 2019-07-01 diff --git a/seriously-simple-podcasting.php b/seriously-simple-podcasting.php index 31308d84..9077178c 100644 --- a/seriously-simple-podcasting.php +++ b/seriously-simple-podcasting.php @@ -1,7 +1,7 @@