From b19a5b539b0221115cf47ea62adebc75dbf14ee9 Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Wed, 7 Jun 2017 14:39:47 +0200 Subject: [PATCH 01/14] Fix date checking URL --- includes/fix-dates.php | 2 +- readme.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/fix-dates.php b/includes/fix-dates.php index cff4c6f..5399741 100644 --- a/includes/fix-dates.php +++ b/includes/fix-dates.php @@ -154,7 +154,7 @@ public function render_warning() { ?>

Important! Sermon Manager needs to check dates of old sermons. - Click + Click here if you want to do it now.

Date: Wed, 7 Jun 2017 14:49:32 +0200 Subject: [PATCH 02/14] Add a enqueue check for sermons shortcode in all posts --- sermons.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sermons.php b/sermons.php index 8f06b12..027965e 100755 --- a/sermons.php +++ b/sermons.php @@ -141,7 +141,7 @@ public static function load_translations() { */ public static function enqueue_scripts_styles() { - if ( 'wpfc_sermon' === get_post_type() ) { + if ( 'wpfc_sermon' === get_post_type() || has_shortcode( get_the_content(), 'sermons' ) ) { if ( ! \SermonManager::getOption( 'bibly' ) ) { wp_enqueue_script( 'bibly-script', SERMON_MANAGER_URL . 'js/bibly.min.js', array(), SERMON_MANAGER_VERSION ); wp_enqueue_style( 'bibly-style', SERMON_MANAGER_URL . 'css/bibly.min.css', array(), SERMON_MANAGER_VERSION ); From 73df68d247e6db80281ce2cbf5052e554c0758df Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Wed, 7 Jun 2017 14:50:19 +0200 Subject: [PATCH 03/14] Update changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 67a1ab9..a4c5dbf 100755 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man == Changelog == = 2.4.2 = * Fix date checking URL +* Fix scripts and styles not loading when shortcode is used = 2.4.1 = * Fix fatal error for podcasts From 27448470028605467c87bc8370b740cceefa492b Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Wed, 7 Jun 2017 18:48:38 +0200 Subject: [PATCH 04/14] Fix Plyr styles not loading --- readme.txt | 3 ++- sermons.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index a4c5dbf..78283d5 100755 --- a/readme.txt +++ b/readme.txt @@ -85,7 +85,8 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man == Changelog == = 2.4.2 = * Fix date checking URL -* Fix scripts and styles not loading when shortcode is used +* Fix scripts and styles not loading when shortcode is used in ordinary posts +* Fix new player styles not loading = 2.4.1 = * Fix fatal error for podcasts diff --git a/sermons.php b/sermons.php index 027965e..88f46fb 100755 --- a/sermons.php +++ b/sermons.php @@ -158,7 +158,7 @@ public static function enqueue_scripts_styles() { if ( ! \SermonManager::getOption( 'css' ) ) { wp_enqueue_style( 'sermon-styles', SERMON_MANAGER_URL . 'css/sermon.css', array(), SERMON_MANAGER_VERSION ); - if ( \SermonManager::getOption( 'use_old_player' ) ) { + if ( ! \SermonManager::getOption( 'use_old_player' ) ) { wp_enqueue_script( 'sermon-manager-plyr', SERMON_MANAGER_URL . 'js/plyr.js', array(), SERMON_MANAGER_VERSION ); wp_enqueue_style( 'sermon-manager-plyr-css', SERMON_MANAGER_URL . 'css/plyr.css', array(), SERMON_MANAGER_VERSION ); wp_add_inline_script( 'sermon-manager-plyr', 'window.onload=function(){plyr.setup(document.querySelectorAll(\'.wpfc-sermon-player\'));}' ); From 5a03b59abe771b9dac69b92b34451ed3be7cc956 Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 08:34:49 +0200 Subject: [PATCH 05/14] Fix date checking URL --- includes/options.php | 4 ++-- readme.txt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/options.php b/includes/options.php index 123c4fa..4315f37 100755 --- a/includes/options.php +++ b/includes/options.php @@ -717,10 +717,10 @@ function wpfc_sermon_options_render_form() {
diff --git a/readme.txt b/readme.txt index 78283d5..1a83131 100755 --- a/readme.txt +++ b/readme.txt @@ -83,6 +83,9 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man 2. Sermon Files == Changelog == += 2.4.3 = +* Fix date checking URL (last time) + = 2.4.2 = * Fix date checking URL * Fix scripts and styles not loading when shortcode is used in ordinary posts From a464db9a29c0e48f06da23f5386615c04a3483fa Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 08:38:16 +0200 Subject: [PATCH 06/14] Fix fatal error when using UpdraftPlus --- includes/CMB2/init.php | 17 +++++++++++------ readme.txt | 1 + sermons.php | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/includes/CMB2/init.php b/includes/CMB2/init.php index 9dbdc5f..1b7d926 100755 --- a/includes/CMB2/init.php +++ b/includes/CMB2/init.php @@ -43,17 +43,17 @@ */ /************************************************************************ - You should not edit the code below - (or any code in the included files) - or things might explode! -*************************************************************************/ + * You should not edit the code below + * (or any code in the included files) + * or things might explode! + *************************************************************************/ if ( ! class_exists( 'CMB2_Bootstrap_224_Trunk', false ) ) { /** * Handles checking for and loading the newest version of CMB2 * - * @since 2.0.0 + * @since 2.0.0 * * @category WordPress_Plugin * @package CMB2 @@ -65,6 +65,7 @@ class CMB2_Bootstrap_224_Trunk { /** * Current version number + * * @var string * @since 1.0.0 */ @@ -96,6 +97,7 @@ public static function initiate() { if ( null === self::$single_instance ) { self::$single_instance = new self(); } + return self::$single_instance; } @@ -151,11 +153,14 @@ public function include_cmb() { // Kick the whole thing off require_once 'bootstrap.php'; - cmb2_bootstrap(); + if ( function_exists( 'cmb2_bootstrap' ) ) { + cmb2_bootstrap(); + } } /** * Registers CMB2 text domain path + * * @since 2.0.0 */ public function l10ni18n() { diff --git a/readme.txt b/readme.txt index 1a83131..cc0bbff 100755 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man == Changelog == = 2.4.3 = * Fix date checking URL (last time) +* Fix fatal error when using UpdraftPlus = 2.4.2 = * Fix date checking URL diff --git a/sermons.php b/sermons.php index 88f46fb..3c87567 100755 --- a/sermons.php +++ b/sermons.php @@ -73,10 +73,8 @@ private function includes() { */ $includes = array( '/includes/legacy-php.php', // Old PHP compatibility fixes - '/includes/CMB2/init.php', // Metaboxes '/includes/types-taxonomies.php', // Post Types and Taxonomies '/includes/taxonomy-images/taxonomy-images.php', // Images for Custom Taxonomies - '/includes/options.php', // Options Page '/includes/entry-views.php', // Entry Views Tracking '/includes/shortcodes.php', // Shortcodes '/includes/widgets.php', // Widgets @@ -89,8 +87,10 @@ private function includes() { * Admin only includes */ $admin_includes = array( - '/includes/admin-functions.php', - '/includes/fix-dates.php', + '/includes/admin-functions.php', // General Admin area functions + '/includes/fix-dates.php', // Date fixing, explained in the script + '/includes/CMB2/init.php', // Metaboxes + '/includes/options.php', // Options Page ); // Load files From 2b62faf7744842b01833634f280fe248c4953a18 Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 09:30:32 +0200 Subject: [PATCH 07/14] Fix dates not working --- includes/template-tags.php | 2 +- readme.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/template-tags.php b/includes/template-tags.php index 6e4b845..3a3d436 100755 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -626,7 +626,7 @@ function wpfc_sermon_time_filter( $the_time = 0, $d = '', $post = null ) { */ function wpfc_sermon_date_filter( $the_date = 0, $d = '', $post = null ) { // if the post is not set, try to get current one - if ( $post === null ) { + if ( ! is_single() && $post === null ) { $post = the_post(); } diff --git a/readme.txt b/readme.txt index cc0bbff..0ee86d5 100755 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man = 2.4.3 = * Fix date checking URL (last time) * Fix fatal error when using UpdraftPlus +* Fix Sermon Manager interfering with regular post dates under some circumstances = 2.4.2 = * Fix date checking URL From 5fe53af18ad9c5e786d0d9bcb8c7e846f6123975 Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 09:34:07 +0200 Subject: [PATCH 08/14] Remove lefover code --- includes/options.php | 7 ------- readme.txt | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/includes/options.php b/includes/options.php index 4315f37..35dce35 100755 --- a/includes/options.php +++ b/includes/options.php @@ -187,13 +187,6 @@ function wpfc_sermon_options_render_form() { border-bottom: 1px solid #efefef; } - wpfc_sermon_update(); - } ?>

diff --git a/readme.txt b/readme.txt index 0ee86d5..9a60e3d 100755 --- a/readme.txt +++ b/readme.txt @@ -85,8 +85,9 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man == Changelog == = 2.4.3 = * Fix date checking URL (last time) -* Fix fatal error when using UpdraftPlus * Fix Sermon Manager interfering with regular post dates under some circumstances +* Fix fatal error when using UpdraftPlus +* Fix fatal error for longtime Sermon Manager users (thank you <3) = 2.4.2 = * Fix date checking URL From a5c82c3d5bcf7feb51a06218c62bc024669262ed Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 16:03:11 +0200 Subject: [PATCH 09/14] Load styles when shortcode is in other post types --- readme.txt | 1 + sermons.php | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 9a60e3d..e591265 100755 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man == Changelog == = 2.4.3 = * Fix date checking URL (last time) +* Fix scripts and styles not loading when shortcode is used in ordinary posts (another issue) * Fix Sermon Manager interfering with regular post dates under some circumstances * Fix fatal error when using UpdraftPlus * Fix fatal error for longtime Sermon Manager users (thank you <3) diff --git a/sermons.php b/sermons.php index 3c87567..16b7b35 100755 --- a/sermons.php +++ b/sermons.php @@ -141,7 +141,27 @@ public static function load_translations() { */ public static function enqueue_scripts_styles() { - if ( 'wpfc_sermon' === get_post_type() || has_shortcode( get_the_content(), 'sermons' ) ) { + global $wp_query; + + // we will check all the posts in the query if they have sermons shortcode + $has_shortcode = false; + if ( ! empty( $wp_query->posts ) ) { + foreach ( $wp_query->posts as $post ) { + if ( ! empty( $post->post_content ) ) { + $has_shortcode = has_shortcode( $post->post_content, 'sermons' ) || + has_shortcode( $post->post_content, 'list_sermons' ) || + has_shortcode( $post->post_content, 'sermon_images' ) || + has_shortcode( $post->post_content, 'latest_series' ) || + has_shortcode( $post->post_content, 'sermon_sort_fields' ); + + if ( $has_shortcode === true ) { + break; + } + } + } + } + + if ( 'wpfc_sermon' === get_post_type() || $has_shortcode ) { if ( ! \SermonManager::getOption( 'bibly' ) ) { wp_enqueue_script( 'bibly-script', SERMON_MANAGER_URL . 'js/bibly.min.js', array(), SERMON_MANAGER_VERSION ); wp_enqueue_style( 'bibly-style', SERMON_MANAGER_URL . 'css/bibly.min.css', array(), SERMON_MANAGER_VERSION ); From 9d8f42b6fa2fc55e23aea33218bd946fdfbc055a Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 16:31:41 +0200 Subject: [PATCH 10/14] Fix audio duplication --- includes/template-tags.php | 8 +++++++- readme.txt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/template-tags.php b/includes/template-tags.php index 3a3d436..9194c7f 100755 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -143,7 +143,7 @@ function render_wpfc_sorting() { $html .= '" method="get">'; $html .= ''; @@ -375,10 +375,16 @@ function wpfc_sermon_attachments() { ); $attachments = get_posts( $args ); $html = ''; + var_dump( get_wpfc_sermon_meta( 'sermon_audio' ) ); $html .= '
'; $html .= '

' . __( 'Download Files', 'sermon-manager' ) . ''; if ( $attachments ) { foreach ( $attachments as $attachment ) { + // skip audio, so we don't have double URLs + if ( get_wpfc_sermon_meta( 'sermon_audio' ) === wp_get_attachment_url( $attachment->ID ) ) { + continue; + } + $html .= '
'; $html .= $attachment->post_title; } diff --git a/readme.txt b/readme.txt index e591265..beb25fa 100755 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man * Fix Sermon Manager interfering with regular post dates under some circumstances * Fix fatal error when using UpdraftPlus * Fix fatal error for longtime Sermon Manager users (thank you <3) +* Fix audio URL duplication in "Download Files" section = 2.4.2 = * Fix date checking URL From 5536f5cf01cd8849372d51481a116ddda4665579 Mon Sep 17 00:00:00 2001 From: Nikola Miljkovic Date: Fri, 9 Jun 2017 16:34:08 +0200 Subject: [PATCH 11/14] Remove debugging code --- includes/template-tags.php | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/template-tags.php b/includes/template-tags.php index 9194c7f..35a6c21 100755 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -375,7 +375,6 @@ function wpfc_sermon_attachments() { ); $attachments = get_posts( $args ); $html = ''; - var_dump( get_wpfc_sermon_meta( 'sermon_audio' ) ); $html .= '

'; $html .= '

' . __( 'Download Files', 'sermon-manager' ) . ''; if ( $attachments ) { From 5f667073e8b0b3e60ff5db03be532998a67d100a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Miljkovi=C4=87?= Date: Sun, 11 Jun 2017 00:00:02 +0200 Subject: [PATCH 12/14] Update version --- readme.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index beb25fa..03802ec 100755 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: wpforchurch Donate link: http://wpforchurch.com/ Tags: church, sermon, sermons, preaching, podcasting Requires at least: 3.6 -Tested up to: 4.7.5 -Stable tag: 2.4.1 +Tested up to: 4.8.0 +Stable tag: 2.4.3 Add audio and video sermons, manage speakers, series, and more to your church website. From 57368c6950de794ff43ce6a7e6df79e557beb016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Miljkovi=C4=87?= Date: Sun, 11 Jun 2017 00:01:52 +0200 Subject: [PATCH 13/14] Update version (it was a typo) --- readme.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index 03802ec..7ecdd17 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: http://wpforchurch.com/ Tags: church, sermon, sermons, preaching, podcasting Requires at least: 3.6 Tested up to: 4.8.0 -Stable tag: 2.4.3 +Stable tag: 2.4.2 Add audio and video sermons, manage speakers, series, and more to your church website. @@ -84,14 +84,10 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man == Changelog == = 2.4.3 = -* Fix date checking URL (last time) -* Fix scripts and styles not loading when shortcode is used in ordinary posts (another issue) * Fix Sermon Manager interfering with regular post dates under some circumstances * Fix fatal error when using UpdraftPlus * Fix fatal error for longtime Sermon Manager users (thank you <3) * Fix audio URL duplication in "Download Files" section - -= 2.4.2 = * Fix date checking URL * Fix scripts and styles not loading when shortcode is used in ordinary posts * Fix new player styles not loading From 8d88bfd3613dfde68cd431ab1150911e12b3d00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Miljkovi=C4=87?= Date: Sun, 11 Jun 2017 00:02:09 +0200 Subject: [PATCH 14/14] Update version --- sermons.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sermons.php b/sermons.php index 16b7b35..9eccfc5 100755 --- a/sermons.php +++ b/sermons.php @@ -3,7 +3,7 @@ Plugin Name: Sermon Manager for WordPress Plugin URI: http://www.wpforchurch.com/products/sermon-manager-for-wordpress/ Description: Add audio and video sermons, manage speakers, series, and more. Visit Wordpress for Church for tutorials and support. -Version: 2.4.1 +Version: 2.4.2 Author: WP for Church Contributors: wpforchurch, jprummer, jamzth Author URI: http://www.wpforchurch.com/