From 0d34e719c7292a847632c3435773e7f25629a516 Mon Sep 17 00:00:00 2001 From: Nikola Date: Wed, 24 Jan 2018 02:17:45 +0100 Subject: [PATCH 1/2] Fix fatal error --- includes/admin/sm-admin-functions.php | 23 -------------------- includes/sm-core-functions.php | 30 +++++++++++++++++++++++++++ readme.txt | 3 +++ sermons.php | 2 +- 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/includes/admin/sm-admin-functions.php b/includes/admin/sm-admin-functions.php index 1fa6da3..0209ecc 100644 --- a/includes/admin/sm-admin-functions.php +++ b/includes/admin/sm-admin-functions.php @@ -22,26 +22,3 @@ function sm_get_screen_ids() { return apply_filters( 'sm_screen_ids', $screen_ids ); } - -function sm_debug_get_update_functions() { - $options = array( - '' => '---', - ); - - foreach ( \SM_Install::$db_updates as $version => $functions ) { - foreach ( $functions as $function ) { - if ( get_option( 'wp_sm_updater_' . $function . '_done', 0 ) ) { - $name = '[AE]'; - } else { - $name = '[NE]'; - } - - $name .= ' ' . $function . ' '; - $name .= "($version)"; - - $options[ $function ] = $name; - } - } - - return $options; -} \ No newline at end of file diff --git a/includes/sm-core-functions.php b/includes/sm-core-functions.php index 4fe59b9..f5a5e2c 100644 --- a/includes/sm-core-functions.php +++ b/includes/sm-core-functions.php @@ -561,3 +561,33 @@ function get_sermon_series_image_url( $series_id = 0 ) { return ! empty( $associations[ $series_id ] ) ? wp_get_attachment_image_url( $associations[ $series_id ] ) : null; } + +/** + * Gets dropdown options for a setting in "Debug" tab of Sermon Manager Settings + * + * @return array + * + * @since 2.11.0 + */ +function sm_debug_get_update_functions() { + $options = array( + '' => '---', + ); + + foreach ( \SM_Install::$db_updates as $version => $functions ) { + foreach ( $functions as $function ) { + if ( get_option( 'wp_sm_updater_' . $function . '_done', 0 ) ) { + $name = '[AE]'; + } else { + $name = '[NE]'; + } + + $name .= ' ' . $function . ' '; + $name .= "($version)"; + + $options[ $function ] = $name; + } + } + + return $options; +} diff --git a/readme.txt b/readme.txt index 68dd7be..10038c1 100755 --- a/readme.txt +++ b/readme.txt @@ -102,6 +102,9 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man 2. Sermon Files ## Changelog ## +### 2.11.1 ### +* Fix: Fatal error on update because of not-loaded function + ### 2.11.0 ### * New: Added a debug tab in settings * New: Added an option to disable book order in book filter dropdown diff --git a/sermons.php b/sermons.php index 0c560b5..b7e7466 100755 --- a/sermons.php +++ b/sermons.php @@ -228,13 +228,13 @@ private function _includes() { */ $includes = array( 'includes/class-sm-autoloader.php', // Autoloader + 'includes/sm-core-functions.php', // Core Sermon Manager functions 'includes/class-sm-dates.php', // Dates operations 'includes/class-sm-dates-wp.php', // Attach to WP filters 'includes/class-sm-api.php', // API 'includes/class-sm-post-types.php', // Register post type, taxonomies, etc 'includes/class-sm-install.php', // Install and update functions 'includes/sm-deprecated-functions.php', // Deprecated SM functions - 'includes/sm-core-functions.php', // Deprecated SM functions 'includes/sm-formatting-functions.php', // Data formatting 'includes/sm-cmb-functions.php', // CMB2 Meta Fields functions 'includes/taxonomy-images/taxonomy-images.php', // Images for Custom Taxonomies From 9693e1391682d96b5cf31854264a57bf4297d3d2 Mon Sep 17 00:00:00 2001 From: Nikola Date: Wed, 24 Jan 2018 02:19:23 +0100 Subject: [PATCH 2/2] Update version number --- readme.txt | 2 +- sermons.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 10038c1..62508d7 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: church, sermon, sermons, preaching, podcasting, manage, managing, podcasts Requires at least: 4.5 Tested up to: 4.9.2 Requires PHP: 5.3 -Stable tag: 2.11.0 +Stable tag: 2.11.1 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/sermons.php b/sermons.php index b7e7466..78012c7 100755 --- a/sermons.php +++ b/sermons.php @@ -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.11.0 + * Version: 2.11.1 * Author: WP for Church * Author URI: https://www.wpforchurch.com/ * Requires at least: 4.5