From 9834ffd5f67d358c7bc7958bf41b308dd2caf00e Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Thu, 30 May 2019 11:53:52 +0200 Subject: [PATCH 1/4] Defer post type registration until (usually) after all other custom post types have been registered --- php/classes/controllers/class-admin-controller.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/php/classes/controllers/class-admin-controller.php b/php/classes/controllers/class-admin-controller.php index bfaa77e7..9848237a 100644 --- a/php/classes/controllers/class-admin-controller.php +++ b/php/classes/controllers/class-admin-controller.php @@ -5,6 +5,7 @@ use SeriouslySimplePodcasting\Handlers\Upgrade_Handler; use SeriouslySimplePodcasting\Ajax\Ajax_Handler; use SeriouslySimplePodcasting\Handlers\Castos_Handler; +use SeriouslySimplePodcasting\Helpers\Log_Helper; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { @@ -54,7 +55,7 @@ public function bootstrap() { add_action( 'init', array( $this, 'load_localisation' ), 0 ); // Regsiter podcast post type, taxonomies and meta fields. - add_action( 'init', array( $this, 'register_post_type' ), 1 ); + add_action( 'init', array( $this, 'register_post_type' ), 11 ); // Register podcast feed. add_action( 'init', array( $this, 'add_feed' ), 1 ); @@ -241,9 +242,11 @@ public function register_post_type() { * @return void */ private function register_taxonomies() { - $podcast_post_types = ssp_post_types( true ); + $log_helper = new Log_Helper(); + $log_helper->log('Post Types', $podcast_post_types); + $series_labels = array( 'name' => __( 'Podcast Series', 'seriously-simple-podcasting' ), 'singular_name' => __( 'Series', 'seriously-simple-podcasting' ), From 7f488e13c917be988a88cace9bddb8c513f73e05 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Thu, 30 May 2019 11:56:14 +0200 Subject: [PATCH 2/4] Releasing beta version --- readme.txt | 4 ++++ seriously-simple-podcasting.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 79f08b04..e5b607f7 100644 --- a/readme.txt +++ b/readme.txt @@ -102,6 +102,10 @@ You can find complete user and developer documentation (along with the FAQs) on == Changelog == += 1.20.2-beta = +* 2019-05-30 +* [FIX] Fixes a legacy bug where post type registration was prioritised over other custom post types + = 1.20.1 = * 2019-05-28 * [FIX] Fixes a bug where subscribe links still show, even if not url has been set diff --git a/seriously-simple-podcasting.php b/seriously-simple-podcasting.php index f6fc62e4..effdf5db 100644 --- a/seriously-simple-podcasting.php +++ b/seriously-simple-podcasting.php @@ -1,7 +1,7 @@ Date: Tue, 4 Jun 2019 10:12:43 +0200 Subject: [PATCH 3/4] Cleaning up some Logger usages --- php/classes/controllers/class-admin-controller.php | 4 ---- .../controllers/class-frontend-controller.php | 1 - php/classes/helpers/class-log-helper.php | 12 ++++++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/php/classes/controllers/class-admin-controller.php b/php/classes/controllers/class-admin-controller.php index 9848237a..86c1b7d5 100644 --- a/php/classes/controllers/class-admin-controller.php +++ b/php/classes/controllers/class-admin-controller.php @@ -5,7 +5,6 @@ use SeriouslySimplePodcasting\Handlers\Upgrade_Handler; use SeriouslySimplePodcasting\Ajax\Ajax_Handler; use SeriouslySimplePodcasting\Handlers\Castos_Handler; -use SeriouslySimplePodcasting\Helpers\Log_Helper; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { @@ -244,9 +243,6 @@ public function register_post_type() { private function register_taxonomies() { $podcast_post_types = ssp_post_types( true ); - $log_helper = new Log_Helper(); - $log_helper->log('Post Types', $podcast_post_types); - $series_labels = array( 'name' => __( 'Podcast Series', 'seriously-simple-podcasting' ), 'singular_name' => __( 'Series', 'seriously-simple-podcasting' ), diff --git a/php/classes/controllers/class-frontend-controller.php b/php/classes/controllers/class-frontend-controller.php index 2fb19866..a1c29914 100644 --- a/php/classes/controllers/class-frontend-controller.php +++ b/php/classes/controllers/class-frontend-controller.php @@ -2,7 +2,6 @@ namespace SeriouslySimplePodcasting\Controllers; -use SeriouslySimplePodcasting\Helpers\Log_Helper; use stdClass; use WP_Query; diff --git a/php/classes/helpers/class-log-helper.php b/php/classes/helpers/class-log-helper.php index 267661b2..63684af5 100644 --- a/php/classes/helpers/class-log-helper.php +++ b/php/classes/helpers/class-log-helper.php @@ -14,6 +14,9 @@ class Log_Helper { public $log_path; public $log_url; + /** + * Log_Helper constructor. + */ public function __construct() { $this->log_dir_path = SSP_PLUGIN_PATH . 'log' . DIRECTORY_SEPARATOR; $this->log_dir_url = SSP_PLUGIN_URL . 'log' . DIRECTORY_SEPARATOR; @@ -22,7 +25,16 @@ public function __construct() { $this->check_paths(); } + /** + * Checks if the logging paths exist, and attempts to create them + * Will only fire if SSP_DEBUG is set and true + * + * @return bool + */ public function check_paths() { + if ( ! defined( 'SSP_DEBUG' ) || ! SSP_DEBUG ) { + return false; + } if ( ! is_dir( $this->log_dir_path ) ) { mkdir( $this->log_dir_path ); } From ade07883211c9a9442b64723d4343690ff97ad03 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Wed, 5 Jun 2019 13:22:19 +0200 Subject: [PATCH 4/4] Version bump to 1.20.2 --- readme.txt | 8 ++++---- seriously-simple-podcasting.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/readme.txt b/readme.txt index e5b607f7..c0f08cb2 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.1 +Stable tag: 1.20.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -102,9 +102,9 @@ You can find complete user and developer documentation (along with the FAQs) on == Changelog == -= 1.20.2-beta = -* 2019-05-30 -* [FIX] Fixes a legacy bug where post type registration was prioritised over other custom post types += 1.20.2 = +* 2019-06-05 +* [FIX] Fixes a legacy bug where the series custom taxonomy was not available an certain custom post types, if enabled = 1.20.1 = * 2019-05-28 diff --git a/seriously-simple-podcasting.php b/seriously-simple-podcasting.php index effdf5db..88b9b6cf 100644 --- a/seriously-simple-podcasting.php +++ b/seriously-simple-podcasting.php @@ -1,7 +1,7 @@