Skip to content

Commit 8656d5d

Browse files
author
Nikola Miljković
authored
Merge pull request #36 from WP-for-Church/dev
Release 2.1.0
2 parents 047e1d7 + 2d6bef6 commit 8656d5d

5 files changed

Lines changed: 49 additions & 22 deletions

File tree

includes/fix-dates.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getAction( $action ) {
152152
*/
153153
public function render_warning() {
154154
?>
155-
<div class="notice notice-error">
155+
<div class="notice notice-error is-dismissible">
156156
<p><strong>Important!</strong> Sermon Manager needs to check dates of old sermons.
157157
<a href="<?php echo admin_url( 'edit.php?post_type=wpfc_sermon&page=' . basename( SERMON_MANAGER_PATH ) . '/includes/options.php#sermon-options-dates-fix' ); ?>">Click
158158
here</a> if you want to do it now.</p>
@@ -191,7 +191,7 @@ public function fix() {
191191
}
192192
}
193193
?>
194-
<br>Done. Check right sidebar for details. <?php echo count( $dates ) ? 'Please click on "Fix All".' : ''; ?>
194+
<br>Done. <?php echo count( $dates ) ? 'Please reload the page and click on "Fix All".' : 'No errors.'; ?>
195195
</span><?php echo wpfc_console_zsh( '', false ); ?>
196196
<?php
197197
} else if ( $action === SM_DATES_FIX ) {

includes/options.php

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ function wpfc_sermon_options_render_form() {
182182
}
183183

184184
.sm-box h3 {
185-
text-align: center;
186-
background: #f7f7f7;
187-
border-bottom: 1px solid #efefef;
185+
text-align: center;
186+
background: #f7f7f7;
187+
border-bottom: 1px solid #efefef;
188188
}
189189
</style>
190190
<?php $sermon_settings = get_option( 'wpfc_options' );
@@ -228,10 +228,13 @@ function wpfc_sermon_options_render_form() {
228228
<div class="inside">
229229
<p><?php _e( 'Did you know you can get expert support for only $49 per year! <a href="https://wpforchurch.com/wordpress-plugins/sermon-manager/?utm_source=sermon-manager&utm_medium=wordpress" target="_blank">Sign up</a> today and get support from the developers who are building the Sermon Manager.', 'sermon-manager' ); ?></p>
230230
<div style="text-align: center;">
231-
<a href="https://wordpress.org/support/plugin/sermon-manager-for-wordpress" target="_blank" class="button-secondary">Free Support</a> <a href="mailto:help@wpforchurch.com" class="button-primary">Priority Support</a>
231+
<a href="https://wordpress.org/support/plugin/sermon-manager-for-wordpress"
232+
target="_blank" class="button-secondary">Free Support</a> <a
233+
href="https://wpforchurch.com/my/clientarea.php" class="button-primary">Priority
234+
Support</a>
232235
</div>
233236
<div style="text-align: center; font-size: 0.85em; padding: 0.7rem 0 0;">
234-
<span>We offer limited free support via WordPress.org</span>
237+
<span>We offer limited free support via WordPress.org</span>
235238
</div>
236239
</div>
237240
</div>
@@ -241,13 +244,23 @@ function wpfc_sermon_options_render_form() {
241244
<div class="inside">
242245

243246
<ul>
244-
<li>- <a href="https://www.wpforchurch.com/my/knowledgebase/72/Getting-Started-with-Sermon-Manager-for-WordPress.html" title="" target="_blank">Getting Started with Sermon Manager</a></li>
245-
<li>- <a href="https://www.wpforchurch.com/my/knowledgebase/75/Sermon-Manager-Shortcodes.html" title="Sermon Manager Shortcodes" target="_blank">Sermon Manager Shortcodes</a></li>
246-
<li>- <a href="https://www.wpforchurch.com/my/knowledgebase/67/Troubleshooting-Sermon-Manager.html" title="Troubleshooting Sermon Manager" target="_blank">Troubleshooting Sermon Manager</a></li>
247+
<li>- <a
248+
href="https://www.wpforchurch.com/my/knowledgebase/72/Getting-Started-with-Sermon-Manager-for-WordPress.html"
249+
title="" target="_blank">Getting Started with Sermon Manager</a></li>
250+
<li>- <a
251+
href="https://www.wpforchurch.com/my/knowledgebase/75/Sermon-Manager-Shortcodes.html"
252+
title="Sermon Manager Shortcodes" target="_blank">Sermon Manager
253+
Shortcodes</a></li>
254+
<li>- <a
255+
href="https://www.wpforchurch.com/my/knowledgebase/67/Troubleshooting-Sermon-Manager.html"
256+
title="Troubleshooting Sermon Manager" target="_blank">Troubleshooting
257+
Sermon Manager</a></li>
247258
</ul>
248259

249260
<div style="text-align: center; font-size: 0.85em; padding: 0.4rem 0 0;">
250-
<span>Find out more in our <a href="https://www.wpforchurch.com/my/knowledgebase.php" title="Knowledgebase" target="_blank">Knowledgebase</a></span>
261+
<span>Find out more in our <a
262+
href="https://www.wpforchurch.com/my/knowledgebase.php"
263+
title="Knowledgebase" target="_blank">Knowledgebase</a></span>
251264
</div>
252265
</div>
253266
</div>
@@ -259,7 +272,8 @@ function wpfc_sermon_options_render_form() {
259272
<p><?php _e( 'If you have ideas on how to make Sermon Manager or any of our products better, let us know!', 'sermon-manager' ); ?></p>
260273

261274
<div style="text-align: center;">
262-
<a href="https://feedback.userreport.com/05ff651b-670e-4eb7-a734-9a201cd22906/" target="_blank" class="button-secondary">Submit Your Idea</a>
275+
<a href="https://feedback.userreport.com/05ff651b-670e-4eb7-a734-9a201cd22906/"
276+
target="_blank" class="button-secondary">Submit Your Idea</a>
263277
</div>
264278
</div>
265279
</div>
@@ -615,7 +629,7 @@ function wpfc_sermon_options_render_form() {
615629
<p><?php _e( 'For more info on PodTrac or to sign up for an account, visit <a href=http://podtrac.com>podtrac.com</a>', 'sermon-manager' ); ?></p>
616630
</td>
617631
</tr>
618-
632+
619633
</table>
620634

621635
<br/>
@@ -662,7 +676,7 @@ function wpfc_sermon_options_render_form() {
662676
<a class="button-primary"
663677
href="<?php echo admin_url( 'edit.php?post_type=wpfc_sermon&page=' . basename( SERMON_MANAGER_PATH ) . '/includes/options.php' ) . '&fix_dates=check#sermon-options-dates-fix' ?>">Check
664678
dates for errors</a>
665-
<a class="button-primary <?php echo ! get_option( 'wpfc_sm_dates_checked', 0 ) || $_GET['fix_dates'] !== 'check' || get_option( 'wpfc_sm_dates_all_fixed', true ) ? 'disabled' : ''; ?>"
679+
<a class="button-primary <?php echo ! get_option( 'wpfc_sm_dates_checked', 0 ) || ( isset( $_GET['fix_dates'] ) && $_GET['fix_dates'] !== 'check' ) || get_option( 'wpfc_sm_dates_all_fixed', true ) ? 'disabled' : ''; ?>"
666680
href="<?php echo admin_url( 'edit.php?post_type=wpfc_sermon&page=' . basename( SERMON_MANAGER_PATH ) . '/includes/options.php' ) . '&fix_dates=fix#sermon-options-dates-fix' ?>">Fix
667681
All</a>
668682
<a class="button-secondary disabled" href="">Revert fix</a>
@@ -692,9 +706,6 @@ function wpfc_console_zsh( $command = '', $close_span = true ) {
692706
<?php do_action( 'wpfc_fix_dates' ); ?>
693707
</span>
694708
</div>
695-
<div class="console-explanation">* Note: This is not a real console. It's
696-
made for humorous puroposes.
697-
</div>
698709
</div>
699710
<div class="damage-report">
700711
<div class="main-errors">

includes/template-tags.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function wpfc_render_audio( $url = '' ) {
334334
return '';
335335
}
336336

337-
$output = '<audio controls>';
337+
$output = '<audio controls preload="none">';
338338
$output .= '<source src="' . $url . '">';
339339
$output .= '</audio>';
340340

@@ -377,7 +377,7 @@ function wpfc_sermon_attachments() {
377377
}
378378
}
379379
if ( get_wpfc_sermon_meta( 'sermon_audio' ) ) {
380-
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-audio" download="true"></span>' . __( 'MP3', 'sermon-manager' ) . '</a>';
380+
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments" download="true"><span class="dashicons dashicons-media-audio"></span>' . __( 'MP3', 'sermon-manager' ) . '</a>';
381381
}
382382
if ( get_wpfc_sermon_meta( 'sermon_notes' ) ) {
383383
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_notes' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-document"></span>' . __( 'Notes', 'sermon-manager' ) . '</a>';

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man
9494
* Add date fixing feature - should fix most of date-related bugs
9595
* Add a new player for MP3 files
9696
* Add PodTrac Support (thanks @reykroona)
97+
* Add warning if user is using PHP version less than 5.6.0
9798
* Simplify shortcodes
9899

99100
= 2.0.8 =

sermons.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@
1212
Domain Path: /languages/
1313
*/
1414

15-
if ( ! defined( 'ABSPATH' ) ) {
16-
exit;
17-
} // Exit if accessed directly
15+
defined( 'ABSPATH' ) or die;
16+
17+
// Fail safe version check for PHP <5.6.0.
18+
if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
19+
if ( is_admin() ) {
20+
add_action( 'admin_notices', 'wpfc_sm_php_version_warning' );
21+
}
22+
23+
return;
24+
}
1825

1926
// define some basic stuff
2027
define( 'SERMON_MANAGER_PATH', plugin_dir_path( __FILE__ ) );
@@ -253,3 +260,11 @@ function sm_instance() {
253260
return SermonManager::get_instance();
254261

255262
}
263+
264+
265+
function wpfc_sm_php_version_warning()
266+
{
267+
echo '<div class="error"><p>';
268+
echo sprintf("You are running PHP %s, but Sermon Manager needs at least PHP %s to run.", PHP_VERSION, '5.6.0');
269+
echo '</p></div>';
270+
}

0 commit comments

Comments
 (0)