Skip to content

Commit

Permalink
Release 2.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljković committed Oct 5, 2018
2 parents 565ed90 + 349f9b9 commit 4d7db09
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
**/*.scssc
node_modules
7 changes: 7 additions & 0 deletions assets/css/theme-specific/Avada.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.single .single-navigation, .single .fusion-meta-info, .single .fusion-sharing-box, .single .about-author {
display: none;
}

.sm-filtering .avada-select-parent select {
min-width: auto;
}
7 changes: 6 additions & 1 deletion assets/css/theme-specific/astra.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@

.ast-separate-container .ast-article-post:last-child {
margin-bottom: 0;
}
}

.smpro-items-container .ast-col-sm-12 {
padding-left: 0;
padding-right: 0;
}
Binary file removed assets/images/SermonManagerDefaultImage.jpg
Binary file not shown.
10 changes: 9 additions & 1 deletion includes/admin/settings/class-sm-settings-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ public function get_settings() {
'id' => 'use_native_player_safari',
'default' => 'no',
),
array(
'title' => __( 'Cloudflare Compatibility', 'sermon-manager-for-wordpress' ),
'type' => 'checkbox',
'desc' => __( 'Load Plyr script immediately.', 'sermon-manager-for-wordpress' ),
'desc_tip' => __( 'Cloudflare uses some caching methods which break player loading, mostly when displaying sermons via shortcodes. Checking this option will most likely fix it. Default unchecked.', 'sermon-manager-for-wordpress' ),
'id' => 'disable_cloudflare_plyr',
'default' => 'no',
),
array(
'title' => __( 'Importing Settings', 'sermon-manager-for-wordpress' ),
'type' => 'separator_title',
Expand Down Expand Up @@ -152,7 +160,7 @@ public function get_settings() {
'default' => 'no',
),
array(
'title' => __( 'Custom Views', 'sermon-manager-for-wordpress' ),
'title' => __( 'Disable Plugin Views', 'sermon-manager-for-wordpress' ),
'type' => 'checkbox',
'desc' => __( 'Disable loading of Sermon Manager\'s views.', 'sermon-manager-for-wordpress' ),
'desc_tip' => __( 'Completely disables loading of views, including overrides. Uses whatever the theme is using. Default disabled.', 'sermon-manager-for-wordpress' ),
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/settings/class-sm-settings-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function get_settings() {
'type' => 'image',
'desc' => __( 'Sets the default sermon image that would show up if there is no sermon or series (if applicable) image is set.', 'sermon-manager-for-wordpress' ),
'id' => 'default_image',
'default' => plugins_url() . '/sermon-manager-for-wordpress/assets/images/SermonManagerDefaultImage.jpg',
'default' => '',
),
array(
'title' => __( 'Sermon Manager Styles', 'sermon-manager-for-wordpress' ),
Expand Down
3 changes: 3 additions & 0 deletions includes/class-sm-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class SM_Install {
'sm_update_2150_audio_file_ids',
'sm_update_2150_audio_duration_and_size',
),
'2.15.2' => array(
'sm_update_2152_remove_default_image',
),
);

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/class-sm-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ function display_sermons( $atts = array() ) {

$query = new WP_Query( $query_args );

// Set image size.
// Set image size. Deprecated.
add_filter( 'wpfc_sermon_excerpt_sermon_image_size', function () use ( $args ) {
return $args['image_size'];
} );
Expand Down
10 changes: 6 additions & 4 deletions includes/sm-core-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,9 @@ function get_sermon_image_url( $fallback = true, $image_size = 'post-thumbnail',

// Assign the image, based on function parameters.
if ( $series_image_primary ) {
$image = $series_image ?: $fallback ? $sermon_image : null;
$image = $series_image ?: ( $fallback ? $sermon_image : null );
} else {
$image = $sermon_image ?: $fallback ? $series_image : null;
$image = $sermon_image ?: ( $fallback ? $series_image : null );
}

// Use the image, or default image set in options, if nothing found.
Expand All @@ -674,16 +674,18 @@ function get_sermon_image_url( $fallback = true, $image_size = 'post-thumbnail',
/**
* Allows to filter the image URL.
*
* @param string|array $image_size The image size. Default: "post-thumbnail".
* @param string $image The image URL.
* @param bool $fallback If set to true, it will try to fallback to the secondary option. If series
* is primary, it will fallback to sermon image, else if sermon image is
* primary, it will fallback to series image - if they exist, of course.
* @param bool $series_image_primary Set series image as primary.
* @param WP_Post $post The sermon object.
* @param string|array $image_size The image size. Default: "post-thumbnail".
*
* @since 2.13.0
* @since 2.15.2 - Added missing $image_size argument, and re-labelled $image to correct description.
*/
return apply_filters( 'get_sermon_image_url_image_size', $image, $fallback, $series_image_primary, $post );
return apply_filters( 'get_sermon_image_url_image_size', $image, $fallback, $series_image_primary, $post, $image_size );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/sm-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function wpfc_sermon_excerpt_v2( $return = false, $args = array() ) {
}

// Get the partial.
$output = wpfc_get_partial( 'content-sermon-archive' );
$output = wpfc_get_partial( 'content-sermon-archive', $args );

/**
* Allows you to modify the sermon HTML on archive pages.
Expand Down
13 changes: 13 additions & 0 deletions includes/sm-update-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,16 @@ function sm_update_2150_audio_duration_and_size() {
// Mark it as done, backup way.
update_option( 'wp_sm_updater_' . __FUNCTION__ . '_done', 1 );
}

/**
* The default image was not right, since it looked too much link an ad, so we removed it in 2.15.2.
* We need to remove the option if it was already set to it.
*/
function sm_update_2152_remove_default_image() {
if ( strpos( get_option( 'sermonmanager_default_image' ), 'SermonManagerDefaultImage.jpg' ) !== false ) {
update_option( 'sermonmanager_default_image', '' );
}

// Mark it as done, backup way.
update_option( 'wp_sm_updater_' . __FUNCTION__ . '_done', 1 );
}
27 changes: 18 additions & 9 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Sermon Manager #
Contributors: wpforchurch, nikolam
Donate link: http://wpforchurch.com/
Tags: church, sermon, sermons, preaching, podcasting, manage, managing, podcasts, itunes
Requires at least: 4.7.0
Tested up to: 4.9
Requires PHP: 5.3
Stable tag: 2.15.1
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Contributors: wpforchurch, nikolam
Donate link: http://wpforchurch.com/
Tags: church, sermon, sermons, preaching, podcasting, manage, managing, podcasts, itunes
Requires at least: 4.7.0
Tested up to: 4.9
Requires PHP: 5.3
Stable tag: 2.15.2
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add audio and video sermons, manage speakers, series, and more to your church website.

Expand Down Expand Up @@ -103,6 +103,15 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man
2. Sermon Files

## Changelog ##
### 2.15.2 ###
* Change: Add Maranatha theme support
* Change: Add Saved theme support
* Change: Add Brandon theme support
* Change: Remove default default image
* Fix: Plyr not loading when Cloudflare is used
* Fix: Sermon image not showing up
* Fix: image_size argument not working in shortcode

### 2.15.1 ###
* Fix: Multi-term filter for feeds not working

Expand Down
44 changes: 41 additions & 3 deletions sermons.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Sermon Manager for WordPress
* Plugin URI: https://www.wpforchurch.com/products/sermon-manager-for-wordpress/
* Description: Add audio and video sermons, manage speakers, series, and more.
* Version: 2.15.1
* Version: 2.15.2
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down Expand Up @@ -565,8 +565,20 @@ public static function enqueue_scripts_styles() {
'use_native_player_safari' => \SermonManager::getOption( 'use_native_player_safari', false ) ? 1 : 0,
) );

wp_enqueue_script( 'wpfc-sm-plyr' );
wp_enqueue_script( 'wpfc-sm-plyr-loader' );
if ( SermonManager::getOption( 'disable_cloudflare_plyr' ) ) {
global $wp_scripts;

$GLOBALS['sm_plyr_scripts'] = array(
'wpfc-sm-plyr-loader' => $wp_scripts->registered['wpfc-sm-plyr-loader'],
'wpfc-sm-plyr' => $wp_scripts->registered['wpfc-sm-plyr'],
);

add_action( 'wp_print_scripts', array( __CLASS__, 'maybe_print_cloudflare_plyr' ) );
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'maybe_print_cloudflare_plyr' ) );
} else {
wp_enqueue_script( 'wpfc-sm-plyr' );
wp_enqueue_script( 'wpfc-sm-plyr-loader' );
}

wp_enqueue_style( 'wpfc-sm-plyr-css' );

Expand Down Expand Up @@ -672,6 +684,32 @@ public static function add_image_sizes() {
add_image_size( 'sermon_wide', 940, 350, true );
}
}

/**
* Workaround for Cloudflare caching.
*
* @since 2.15.2
*/
public static function maybe_print_cloudflare_plyr() {
if ( defined( 'SM_CLOUDFLARE_DONE' ) ) {
return;
}

if ( ! isset( $GLOBALS['sm_plyr_scripts'] ) ) {
return;
}

foreach ( $GLOBALS['sm_plyr_scripts'] as $script ) {
echo '<script type="text/javascript" data-cfasync="false" src="' . $script->src . '"></script>';

if ( ! empty( $script->extra ) ) {
/* @noinspection BadExpressionStatementJS */
printf( "<script type='text/javascript'>\n%s\n</script>\n", $script->extra['data'] );
}
}

define( 'SM_CLOUDFLARE_DONE', true );
}
}

// Initialize Sermon Manager.
Expand Down
5 changes: 3 additions & 2 deletions views/partials/content-sermon-archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
*
* @package SermonManager\Views\Partials
*
* @since 2.13.0 - added
* @since 2.13.0 - added.
* @since 2.15.2 - fix $args not being loaded from shortcode.
*/

global $post;

$args = ! empty( $args ) ? $args : array(
$args = ! empty( $GLOBALS['wpfc_partial_args'] ) ? $GLOBALS['wpfc_partial_args'] : array(
'image_size' => 'post-thumbnail',
);

Expand Down
9 changes: 9 additions & 0 deletions views/partials/content-sermon-wrapper-end.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
get_sidebar();
echo '</div>';
break;
case 'maranatha':
echo '</div></div></main>';
break;
case 'saved':
echo '</div></div></main>';
break;
case 'brandon':
echo '</div></div>';
break;
default:
ob_start();
get_sidebar();
Expand Down
9 changes: 9 additions & 0 deletions views/partials/content-sermon-wrapper-start.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
case 'genesis':
echo '<div class="content-sidebar-wrap"><main class="content" id="genesis-content">';
break;
case 'maranatha':
echo '<main id="maranatha-content"><div id="maranatha-content-inner" class="maranatha-centered-large maranatha-entry-content"><div id="maranatha-loop-multiple" class="maranatha-clearfix maranatha-loop-two-columns">';
break;
case 'saved':
echo '<main id="saved-content" class="saved-bg-contrast"><div id="saved-content-inner" class="saved-centered-large saved-entry-content"><div id="saved-loop-multiple" class="saved-clearfix saved-loop-entries saved-loop-three-columns">';
break;
case 'brandon':
echo '<div id="Content"><div class="content_wrapper clearfix">';
break;
default:
echo apply_filters( 'sm_templates_wrapper_start', '<div class="wrap"><div id="primary" class="content-area"><main id="main" class="site-main wpfc-sermon-container ' . $additional_classes . '">' );
break;
Expand Down

0 comments on commit 4d7db09

Please sign in to comment.