Completed
Push — master ( b5e1c4...af52c3 )
by Hugh
02:36
created
includes/class-ssp-admin.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -658,7 +658,7 @@
 block discarded – undo
658 658
 	/**
659 659
 	 * Adding podcast episodes to 'At a glance' dashboard widget
660 660
 	 * @param  array $items Existing items
661
-	 * @return array        Updated items
661
+	 * @return string[]        Updated items
662 662
 	 */
663 663
 	public function glance_items( $items = array() ) {
664 664
 
Please login to merge, or discard this patch.
Spacing   +278 added lines, -278 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -32,84 +32,84 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$this->version = $version;
34 34
 
35
-		$this->dir = dirname( $file );
35
+		$this->dir = dirname ( $file );
36 36
 		$this->file = $file;
37
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
38
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) );
39
-		$this->template_path = trailingslashit( $this->dir ) . 'templates/';
40
-		$this->home_url = trailingslashit( home_url() );
37
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
38
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $file ) ) );
39
+		$this->template_path = trailingslashit ( $this->dir ).'templates/';
40
+		$this->home_url = trailingslashit ( home_url () );
41 41
 		$this->token = 'podcast';
42 42
 
43
-		$this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
43
+		$this->script_suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
44 44
 
45 45
 		// Handle localisation
46
-		$this->load_plugin_textdomain();
47
-		add_action( 'init', array( $this, 'load_localisation' ), 0 );
46
+		$this->load_plugin_textdomain ();
47
+		add_action ( 'init', array( $this, 'load_localisation' ), 0 );
48 48
 
49 49
 		// Regsiter podcast post type and taxonomies
50
-		add_action( 'init', array( $this, 'register_post_type' ), 1 );
50
+		add_action ( 'init', array( $this, 'register_post_type' ), 1 );
51 51
 
52 52
 		// Register podcast feed
53
-		add_action( 'init', array( $this, 'add_feed' ), 1 );
53
+		add_action ( 'init', array( $this, 'add_feed' ), 1 );
54 54
 
55 55
 		// Hide WP SEO footer text for podcast RSS feed
56
-		add_filter( 'wpseo_include_rss_footer', array( $this, 'hide_wp_seo_rss_footer' ) );
56
+		add_filter ( 'wpseo_include_rss_footer', array( $this, 'hide_wp_seo_rss_footer' ) );
57 57
 
58 58
 		// Handle v1.x feed URL as well as feed URLs for default permalinks
59
-		add_action( 'init', array( $this, 'redirect_old_feed' ) );
59
+		add_action ( 'init', array( $this, 'redirect_old_feed' ) );
60 60
 
61 61
 		// Setup custom permalink structures
62
-		add_action( 'init', array( $this, 'setup_permastruct' ), 10 );
62
+		add_action ( 'init', array( $this, 'setup_permastruct' ), 10 );
63 63
 
64
-		if ( is_admin() ) {
64
+		if ( is_admin () ) {
65 65
 
66
-			add_action( 'admin_init', array( $this, 'update_enclosures' ) );
66
+			add_action ( 'admin_init', array( $this, 'update_enclosures' ) );
67 67
 
68 68
 			// Episode meta box
69
-			add_action( 'admin_init', array( $this, 'register_meta_boxes' ) );
70
-			add_action( 'save_post', array( $this, 'meta_box_save' ), 10, 1 );
69
+			add_action ( 'admin_init', array( $this, 'register_meta_boxes' ) );
70
+			add_action ( 'save_post', array( $this, 'meta_box_save' ), 10, 1 );
71 71
 
72 72
 			// Episode edit screen
73
-			add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
74
-			add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
73
+			add_filter ( 'enter_title_here', array( $this, 'enter_title_here' ) );
74
+			add_filter ( 'post_updated_messages', array( $this, 'updated_messages' ) );
75 75
 
76 76
 			// Admin JS & CSS
77
-			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ), 10 );
78
-			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 10 );
77
+			add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ), 10 );
78
+			add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 10 );
79 79
 
80 80
 			// Episodes list table
81
-			add_filter( 'manage_edit-' . $this->token . '_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
82
-			add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
81
+			add_filter ( 'manage_edit-'.$this->token.'_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
82
+			add_action ( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
83 83
 
84 84
 			// Series list table
85
-			add_filter( 'manage_edit-series_columns' , array( $this, 'edit_series_columns' ) );
86
-            add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 );
85
+			add_filter ( 'manage_edit-series_columns', array( $this, 'edit_series_columns' ) );
86
+            add_filter ( 'manage_series_custom_column', array( $this, 'add_series_columns' ), 1, 3 );
87 87
 
88 88
             // Dashboard widgets
89
-            add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
89
+            add_filter ( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
90 90
 
91 91
             // Appreciation links
92
-            add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
92
+            add_filter ( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
93 93
 
94 94
             // Add footer text to dashboard
95
-            add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
95
+            add_filter ( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
96 96
 
97 97
             // Clear the cache on post save.
98
-            add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
98
+            add_action ( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
99 99
 
100 100
 		}
101 101
 
102 102
 		// Add ajax action for plugin rating
103
-		add_action( 'wp_ajax_ssp_rated', array( $this, 'rated' ) );
103
+		add_action ( 'wp_ajax_ssp_rated', array( $this, 'rated' ) );
104 104
 
105 105
 		// Add ajax action for customising episode embed code
106
-		add_action( 'wp_ajax_update_episode_embed_code', array( $this, 'update_episode_embed_code' ) );
106
+		add_action ( 'wp_ajax_update_episode_embed_code', array( $this, 'update_episode_embed_code' ) );
107 107
 
108 108
 		// Setup activation and deactivation hooks
109
-		register_activation_hook( $file, array( $this, 'activate' ) );
110
-		register_deactivation_hook( $file, array( $this, 'deactivate' ) );
109
+		register_activation_hook ( $file, array( $this, 'activate' ) );
110
+		register_deactivation_hook ( $file, array( $this, 'deactivate' ) );
111 111
 
112
-		add_action( 'init', array( $this, 'update' ), 11 );
112
+		add_action ( 'init', array( $this, 'update' ), 11 );
113 113
 	}
114 114
 
115 115
 	/**
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
 	public function setup_permastruct() {
120 120
 
121 121
 		// Episode download & player URLs
122
-		add_rewrite_rule( '^podcast-download/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]', 'top' );
123
-		add_rewrite_rule( '^podcast-player/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]&podcast_ref=player', 'top' );
122
+		add_rewrite_rule ( '^podcast-download/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]', 'top' );
123
+		add_rewrite_rule ( '^podcast-player/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]&podcast_ref=player', 'top' );
124 124
 
125 125
 		// Custom query variables
126
-		add_rewrite_tag( '%podcast_episode%', '([^&]+)' );
127
-		add_rewrite_tag( '%podcast_ref%', '([^&]+)' );
126
+		add_rewrite_tag ( '%podcast_episode%', '([^&]+)' );
127
+		add_rewrite_tag ( '%podcast_ref%', '([^&]+)' );
128 128
 
129 129
 		// Series feed URLs
130
-		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
131
-		add_rewrite_rule( '^feed/' . $feed_slug . '/([^/]*)/?', 'index.php?feed=podcast&podcast_series=$matches[1]', 'top' );
132
-		add_rewrite_tag( '%podcast_series%', '([^&]+)' );
130
+		$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
131
+		add_rewrite_rule ( '^feed/'.$feed_slug.'/([^/]*)/?', 'index.php?feed=podcast&podcast_series=$matches[1]', 'top' );
132
+		add_rewrite_tag ( '%podcast_series%', '([^&]+)' );
133 133
 	}
134 134
 
135 135
 	/**
@@ -139,25 +139,25 @@  discard block
 block discarded – undo
139 139
 	public function register_post_type() {
140 140
 
141 141
 		$labels = array(
142
-			'name' => _x( 'Podcast', 'post type general name' , 'seriously-simple-podcasting' ),
143
-			'singular_name' => _x( 'Podcast', 'post type singular name' , 'seriously-simple-podcasting' ),
144
-			'add_new' => _x( 'Add New', 'podcast' , 'seriously-simple-podcasting' ),
145
-			'add_new_item' => sprintf( __( 'Add New %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
146
-			'edit_item' => sprintf( __( 'Edit %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
147
-			'new_item' => sprintf( __( 'New %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
148
-			'all_items' => sprintf( __( 'All %s' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
149
-			'view_item' => sprintf( __( 'View %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
150
-			'search_items' => sprintf( __( 'Search %a' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
151
-			'not_found' =>  sprintf( __( 'No %s Found' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
152
-			'not_found_in_trash' => sprintf( __( 'No %s Found In Trash' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
142
+			'name' => _x ( 'Podcast', 'post type general name', 'seriously-simple-podcasting' ),
143
+			'singular_name' => _x ( 'Podcast', 'post type singular name', 'seriously-simple-podcasting' ),
144
+			'add_new' => _x ( 'Add New', 'podcast', 'seriously-simple-podcasting' ),
145
+			'add_new_item' => sprintf ( __ ( 'Add New %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
146
+			'edit_item' => sprintf ( __ ( 'Edit %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
147
+			'new_item' => sprintf ( __ ( 'New %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
148
+			'all_items' => sprintf ( __ ( 'All %s', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
149
+			'view_item' => sprintf ( __ ( 'View %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
150
+			'search_items' => sprintf ( __ ( 'Search %a', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
151
+			'not_found' =>  sprintf ( __ ( 'No %s Found', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
152
+			'not_found_in_trash' => sprintf ( __ ( 'No %s Found In Trash', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
153 153
 			'parent_item_colon' => '',
154
-			'menu_name' => __( 'Podcast' , 'seriously-simple-podcasting' ),
155
-			'filter_items_list' => sprintf( __( 'Filter %s list' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
156
-			'items_list_navigation' => sprintf( __( '%s list navigation' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
157
-			'items_list' => sprintf( __( '%s list' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
154
+			'menu_name' => __ ( 'Podcast', 'seriously-simple-podcasting' ),
155
+			'filter_items_list' => sprintf ( __ ( 'Filter %s list', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
156
+			'items_list_navigation' => sprintf ( __ ( '%s list navigation', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
157
+			'items_list' => sprintf ( __ ( '%s list', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
158 158
 		);
159 159
 
160
-		$slug = apply_filters( 'ssp_archive_slug', __( 'podcast' , 'seriously-simple-podcasting' ) );
160
+		$slug = apply_filters ( 'ssp_archive_slug', __ ( 'podcast', 'seriously-simple-podcasting' ) );
161 161
 
162 162
 		$args = array(
163 163
 			'labels' => $labels,
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 			'show_in_rest' => true,
180 180
 		);
181 181
 
182
-		$args = apply_filters( 'ssp_register_post_type_args', $args );
182
+		$args = apply_filters ( 'ssp_register_post_type_args', $args );
183 183
 
184
-		register_post_type( $this->token, $args );
184
+		register_post_type ( $this->token, $args );
185 185
 
186
-		$this->register_taxonomies();
186
+		$this->register_taxonomies ();
187 187
 	}
188 188
 
189 189
 	/**
@@ -192,45 +192,45 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	private function register_taxonomies() {
194 194
 
195
-		$podcast_post_types = ssp_post_types( true );
195
+		$podcast_post_types = ssp_post_types ( true );
196 196
 
197 197
         $series_labels = array(
198
-            'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ),
199
-            'singular_name' => __( 'Series', 'seriously-simple-podcasting' ),
200
-            'search_items' =>  __( 'Search Series' , 'seriously-simple-podcasting' ),
201
-            'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ),
202
-            'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ),
203
-            'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ),
204
-            'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ),
205
-            'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ),
206
-            'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ),
207
-            'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ),
208
-            'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ),
209
-            'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ),
210
-            'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ),
211
-            'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ),
212
-            'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ),
213
-            'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ),
214
-            'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ),
215
-            'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ),
216
-            'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ),
198
+            'name' => __ ( 'Podcast Series', 'seriously-simple-podcasting' ),
199
+            'singular_name' => __ ( 'Series', 'seriously-simple-podcasting' ),
200
+            'search_items' =>  __ ( 'Search Series', 'seriously-simple-podcasting' ),
201
+            'all_items' => __ ( 'All Series', 'seriously-simple-podcasting' ),
202
+            'parent_item' => __ ( 'Parent Series', 'seriously-simple-podcasting' ),
203
+            'parent_item_colon' => __ ( 'Parent Series:', 'seriously-simple-podcasting' ),
204
+            'edit_item' => __ ( 'Edit Series', 'seriously-simple-podcasting' ),
205
+            'update_item' => __ ( 'Update Series', 'seriously-simple-podcasting' ),
206
+            'add_new_item' => __ ( 'Add New Series', 'seriously-simple-podcasting' ),
207
+            'new_item_name' => __ ( 'New Series Name', 'seriously-simple-podcasting' ),
208
+            'menu_name' => __ ( 'Series', 'seriously-simple-podcasting' ),
209
+            'view_item' => __ ( 'View Series', 'seriously-simple-podcasting' ),
210
+            'popular_items' => __ ( 'Popular Series', 'seriously-simple-podcasting' ),
211
+            'separate_items_with_commas' => __ ( 'Separate series with commas', 'seriously-simple-podcasting' ),
212
+            'add_or_remove_items' => __ ( 'Add or remove Series', 'seriously-simple-podcasting' ),
213
+            'choose_from_most_used' => __ ( 'Choose from the most used Series', 'seriously-simple-podcasting' ),
214
+            'not_found' => __ ( 'No Series Found', 'seriously-simple-podcasting' ),
215
+            'items_list_navigation' => __ ( 'Series list navigation', 'seriously-simple-podcasting' ),
216
+            'items_list' => __ ( 'Series list', 'seriously-simple-podcasting' ),
217 217
         );
218 218
 
219 219
         $series_args = array(
220 220
             'public' => true,
221 221
             'hierarchical' => true,
222
-            'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ),
222
+            'rewrite' => array( 'slug' => apply_filters ( 'ssp_series_slug', 'series' ) ),
223 223
             'labels' => $series_labels,
224 224
             'show_in_rest' => true,
225 225
         );
226 226
 
227
-        $series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' );
227
+        $series_args = apply_filters ( 'ssp_register_taxonomy_args', $series_args, 'series' );
228 228
 
229
-        register_taxonomy( 'series', $podcast_post_types, $series_args );
229
+        register_taxonomy ( 'series', $podcast_post_types, $series_args );
230 230
 
231 231
         // Add Tags to podcast post type
232
-        if ( apply_filters( 'ssp_use_post_tags', true ) ) {
233
-        	register_taxonomy_for_object_type( 'post_tag', $this->token );
232
+        if ( apply_filters ( 'ssp_use_post_tags', true ) ) {
233
+        	register_taxonomy_for_object_type ( 'post_tag', $this->token );
234 234
         }
235 235
     }
236 236
 
@@ -240,13 +240,13 @@  discard block
 block discarded – undo
240 240
 	 * @return array           Modified columns
241 241
 	 */
242 242
 	public function register_custom_column_headings( $defaults ) {
243
-		$new_columns = apply_filters( 'ssp_admin_columns_episodes', array( 'series' => __( 'Series' , 'seriously-simple-podcasting' ) , 'image' => __( 'Image' , 'seriously-simple-podcasting' ) ) );
243
+		$new_columns = apply_filters ( 'ssp_admin_columns_episodes', array( 'series' => __ ( 'Series', 'seriously-simple-podcasting' ), 'image' => __ ( 'Image', 'seriously-simple-podcasting' ) ) );
244 244
 
245 245
 		// remove date column
246
-		unset( $defaults['date'] );
246
+		unset( $defaults[ 'date' ] );
247 247
 
248 248
 		// add new columns before last default one
249
-		$columns = array_slice( $defaults, 0, -1 ) + $new_columns + array_slice( $defaults, -1 );
249
+		$columns = array_slice ( $defaults, 0, -1 ) + $new_columns + array_slice ( $defaults, -1 );
250 250
 
251 251
 		return $columns;
252 252
 	}
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 		switch ( $column_name ) {
264 264
 
265 265
 			case 'series':
266
-				$terms = wp_get_post_terms( $id , 'series' );
267
-				$term_names = wp_list_pluck( $terms, 'name' );
268
-				echo join( ', ', $term_names );
266
+				$terms = wp_get_post_terms ( $id, 'series' );
267
+				$term_names = wp_list_pluck ( $terms, 'name' );
268
+				echo join ( ', ', $term_names );
269 269
 			break;
270 270
 
271 271
 			case 'image':
272
-				$value = $ss_podcasting->get_image( $id, 40 );
272
+				$value = $ss_podcasting->get_image ( $id, 40 );
273 273
 				echo $value;
274 274
 			break;
275 275
 
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 	 */
287 287
 	public function edit_series_columns( $columns ) {
288 288
 
289
-        unset( $columns['description'] );
290
-        unset( $columns['posts'] );
289
+        unset( $columns[ 'description' ] );
290
+        unset( $columns[ 'posts' ] );
291 291
 
292
-        $columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' );
293
-        $columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' );
292
+        $columns[ 'series_feed_url' ] = __ ( 'Series feed URL', 'seriously-simple-podcasting' );
293
+        $columns[ 'posts' ] = __ ( 'Episodes', 'seriously-simple-podcasting' );
294 294
 
295
-        $columns = apply_filters( 'ssp_admin_columns_series', $columns );
295
+        $columns = apply_filters ( 'ssp_admin_columns_series', $columns );
296 296
 
297 297
         return $columns;
298 298
     }
@@ -306,18 +306,18 @@  discard block
 block discarded – undo
306 306
      *
307 307
      * @return string
308 308
      */
309
-    public function add_series_columns( $column_data , $column_name , $term_id ) {
309
+    public function add_series_columns( $column_data, $column_name, $term_id ) {
310 310
 
311 311
         switch ( $column_name ) {
312 312
             case 'series_feed_url':
313
-            	$series = get_term( $term_id, 'series' );
313
+            	$series = get_term ( $term_id, 'series' );
314 314
             	$series_slug = $series->slug;
315 315
 
316
-            	if ( get_option( 'permalink_structure' ) ) {
317
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
318
-					$feed_url = $this->home_url . 'feed/' . $feed_slug . '/' . $series_slug;
316
+            	if ( get_option ( 'permalink_structure' ) ) {
317
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
318
+					$feed_url = $this->home_url.'feed/'.$feed_slug.'/'.$series_slug;
319 319
 				} else {
320
-					$feed_url = add_query_arg(
320
+					$feed_url = add_query_arg (
321 321
 						array(
322 322
 							'feed' => $this->token,
323 323
 							'podcast_series' => $series_slug
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 					);
327 327
 				}
328 328
 
329
-                $column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>';
329
+                $column_data = '<a href="'.esc_attr ( $feed_url ).'" target="_blank">'.esc_html ( $feed_url ).'</a>';
330 330
             break;
331 331
         }
332 332
 
@@ -343,16 +343,16 @@  discard block
 block discarded – undo
343 343
 
344 344
 	  $messages[ $this->token ] = array(
345 345
 	    0 => '',
346
-	    1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
347
-	    2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ),
348
-	    3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ),
349
-	    4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ),
350
-	    5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
351
-	    6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
352
-	    7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ),
353
-	    8 => sprintf( __( 'Episode submitted. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
354
-	    9 => sprintf( __( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.' , 'seriously-simple-podcasting' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'seriously-simple-podcasting' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
355
-	    10 => sprintf( __( 'Episode draft updated. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
346
+	    1 => sprintf ( __ ( 'Episode updated. %sView episode%s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( get_permalink ( $post_ID ) ).'">', '</a>' ),
347
+	    2 => __ ( 'Custom field updated.', 'seriously-simple-podcasting' ),
348
+	    3 => __ ( 'Custom field deleted.', 'seriously-simple-podcasting' ),
349
+	    4 => __ ( 'Episode updated.', 'seriously-simple-podcasting' ),
350
+	    5 => isset( $_GET[ 'revision' ] ) ? sprintf ( __ ( 'Episode restored to revision from %s.', 'seriously-simple-podcasting' ), wp_post_revision_title ( (int) $_GET[ 'revision' ], false ) ) : false,
351
+	    6 => sprintf ( __ ( 'Episode published. %sView episode%s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( get_permalink ( $post_ID ) ).'">', '</a>' ),
352
+	    7 => __ ( 'Episode saved.', 'seriously-simple-podcasting' ),
353
+	    8 => sprintf ( __ ( 'Episode submitted. %sPreview episode%s.', 'seriously-simple-podcasting' ), '<a target="_blank" href="'.esc_url ( add_query_arg ( 'preview', 'true', get_permalink ( $post_ID ) ) ).'">', '</a>' ),
354
+	    9 => sprintf ( __ ( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.', 'seriously-simple-podcasting' ), '<strong>'.date_i18n ( __ ( 'M j, Y @ G:i', 'seriously-simple-podcasting' ), strtotime ( $post->post_date ) ).'</strong>', '<a target="_blank" href="'.esc_url ( get_permalink ( $post_ID ) ).'">', '</a>' ),
355
+	    10 => sprintf ( __ ( 'Episode draft updated. %sPreview episode%s.', 'seriously-simple-podcasting' ), '<a target="_blank" href="'.esc_url ( add_query_arg ( 'preview', 'true', get_permalink ( $post_ID ) ) ).'">', '</a>' ),
356 356
 	  );
357 357
 
358 358
 	  return $messages;
@@ -362,14 +362,14 @@  discard block
 block discarded – undo
362 362
 	 * Register podcast episode details meta boxes
363 363
 	 * @return void
364 364
 	 */
365
-	public function register_meta_boxes () {
365
+	public function register_meta_boxes() {
366 366
 
367 367
 		// Get all podcast post types
368
-		$podcast_post_types = ssp_post_types( true );
368
+		$podcast_post_types = ssp_post_types ( true );
369 369
 
370 370
 		// Add meta box to each post type
371 371
 		foreach ( (array) $podcast_post_types as $post_type ) {
372
-			add_action( 'add_meta_boxes_' . $post_type, array( $this, 'meta_box_setup' ), 10, 1 );
372
+			add_action ( 'add_meta_boxes_'.$post_type, array( $this, 'meta_box_setup' ), 10, 1 );
373 373
 		}
374 374
 	}
375 375
 
@@ -377,17 +377,17 @@  discard block
 block discarded – undo
377 377
 	 * Create meta box on episode edit screen
378 378
 	 * @return void
379 379
 	 */
380
-	public function meta_box_setup ( $post ) {
380
+	public function meta_box_setup( $post ) {
381 381
 		global $pagenow;
382 382
 
383
-		add_meta_box( 'podcast-episode-data', __( 'Podcast Episode Details' , 'seriously-simple-podcasting' ), array( $this, 'meta_box_content' ), $post->post_type, 'normal', 'high' );
383
+		add_meta_box ( 'podcast-episode-data', __ ( 'Podcast Episode Details', 'seriously-simple-podcasting' ), array( $this, 'meta_box_content' ), $post->post_type, 'normal', 'high' );
384 384
 
385
-		if( 'post.php' == $pagenow && 'publish' == $post->post_status && function_exists( 'get_post_embed_html' ) ) {
386
-			add_meta_box( 'episode-embed-code', __( 'Episode Embed Code' , 'seriously-simple-podcasting' ), array( $this, 'embed_code_meta_box_content' ), $post->post_type, 'side', 'low' );
385
+		if ( 'post.php' == $pagenow && 'publish' == $post->post_status && function_exists ( 'get_post_embed_html' ) ) {
386
+			add_meta_box ( 'episode-embed-code', __ ( 'Episode Embed Code', 'seriously-simple-podcasting' ), array( $this, 'embed_code_meta_box_content' ), $post->post_type, 'side', 'low' );
387 387
 		}
388 388
 
389 389
 		// Allow more metaboxes to be added
390
-		do_action( 'ssp_meta_boxes', $post );
390
+		do_action ( 'ssp_meta_boxes', $post );
391 391
 
392 392
 	}
393 393
 
@@ -396,15 +396,15 @@  discard block
 block discarded – undo
396 396
 	 * @param  object $post Current post object
397 397
 	 * @return void
398 398
 	 */
399
-	public function embed_code_meta_box_content ( $post ) {
399
+	public function embed_code_meta_box_content( $post ) {
400 400
 
401 401
 		// Get post embed code
402
-		$embed_code = get_post_embed_html( 500, 350, $post );
402
+		$embed_code = get_post_embed_html ( 500, 350, $post );
403 403
 
404 404
 		// Generate markup for meta box
405
-		$html = '<p><em>' . __( 'Customise the size of your episode embed below, then copy the HTML to your clipboard.', 'seriously-simple-podcasting' ) . '</em></p>';
406
-		$html .= '<p><label for="episode_embed_code_width">' . __( 'Width:', 'seriously-simple-podcasting' ) . '</label> <input id="episode_embed_code_width" class="episode_embed_code_size_option" type="number" value="500" length="3" min="0" step="1" /> &nbsp;&nbsp;&nbsp;&nbsp;<label for="episode_embed_code_height">' . __( 'Height:', 'seriously-simple-podcasting' ) . '</label> <input id="episode_embed_code_height" class="episode_embed_code_size_option" type="number" value="350" length="3" min="0" step="1" /></p>';
407
-		$html .= '<p><textarea readonly id="episode_embed_code">' . esc_textarea( $embed_code ) . '</textarea></p>';
405
+		$html = '<p><em>'.__ ( 'Customise the size of your episode embed below, then copy the HTML to your clipboard.', 'seriously-simple-podcasting' ).'</em></p>';
406
+		$html .= '<p><label for="episode_embed_code_width">'.__ ( 'Width:', 'seriously-simple-podcasting' ).'</label> <input id="episode_embed_code_width" class="episode_embed_code_size_option" type="number" value="500" length="3" min="0" step="1" /> &nbsp;&nbsp;&nbsp;&nbsp;<label for="episode_embed_code_height">'.__ ( 'Height:', 'seriously-simple-podcasting' ).'</label> <input id="episode_embed_code_height" class="episode_embed_code_size_option" type="number" value="350" length="3" min="0" step="1" /></p>';
407
+		$html .= '<p><textarea readonly id="episode_embed_code">'.esc_textarea ( $embed_code ).'</textarea></p>';
408 408
 
409 409
 		echo $html;
410 410
 	}
@@ -413,20 +413,20 @@  discard block
 block discarded – undo
413 413
 	 * Update the epiaode embed code via ajax
414 414
 	 * @return void
415 415
 	 */
416
-	public function update_episode_embed_code () {
416
+	public function update_episode_embed_code() {
417 417
 
418 418
 		// Make sure we have a valid post ID
419
-		if( empty( $_POST['post_id'] ) ) {
419
+		if ( empty( $_POST[ 'post_id' ] ) ) {
420 420
 			return;
421 421
 		}
422 422
 
423 423
 		// Get info for embed code
424
-		$post_id = (int) $_POST['post_id'];
425
-		$width = (int) $_POST['width'];
426
-		$height = (int) $_POST['height'];
424
+		$post_id = (int) $_POST[ 'post_id' ];
425
+		$width = (int) $_POST[ 'width' ];
426
+		$height = (int) $_POST[ 'height' ];
427 427
 
428 428
 		// Generate embed code
429
-		echo get_post_embed_html( $width, $height, $post_id );
429
+		echo get_post_embed_html ( $width, $height, $post_id );
430 430
 
431 431
 		// Exit after ajax request
432 432
 		exit;
@@ -439,70 +439,70 @@  discard block
 block discarded – undo
439 439
 	public function meta_box_content() {
440 440
 		global $post_id;
441 441
 
442
-		$field_data = $this->custom_fields();
442
+		$field_data = $this->custom_fields ();
443 443
 
444 444
 		$html = '';
445 445
 
446
-		$html .= '<input type="hidden" name="seriouslysimple_' . $this->token . '_nonce" id="seriouslysimple_' . $this->token . '_nonce" value="' . wp_create_nonce( plugin_basename( $this->dir ) ) . '" />';
446
+		$html .= '<input type="hidden" name="seriouslysimple_'.$this->token.'_nonce" id="seriouslysimple_'.$this->token.'_nonce" value="'.wp_create_nonce ( plugin_basename ( $this->dir ) ).'" />';
447 447
 
448
-		if ( 0 < count( $field_data ) ) {
449
-			$html .= '<table class="form-table">' . "\n";
450
-			$html .= '<tbody>' . "\n";
448
+		if ( 0 < count ( $field_data ) ) {
449
+			$html .= '<table class="form-table">'."\n";
450
+			$html .= '<tbody>'."\n";
451 451
 
452
-			$html .= '<input id="seriouslysimple_post_id" type="hidden" value="'. $post_id . '" />';
452
+			$html .= '<input id="seriouslysimple_post_id" type="hidden" value="'.$post_id.'" />';
453 453
 
454 454
 			foreach ( $field_data as $k => $v ) {
455
-				$data = $v['default'];
456
-				$saved = get_post_meta( $post_id, $k, true );
455
+				$data = $v[ 'default' ];
456
+				$saved = get_post_meta ( $post_id, $k, true );
457 457
 				if ( $saved ) {
458 458
 					$data = $saved;
459 459
 				}
460 460
 
461 461
 				$class = '';
462
-				if ( isset( $v['class'] ) ) {
463
-					$class = $v['class'];
462
+				if ( isset( $v[ 'class' ] ) ) {
463
+					$class = $v[ 'class' ];
464 464
 				}
465 465
 
466 466
 				$disabled = false;
467
-				if ( isset( $v['disabled'] ) && $v['disabled'] ) {
467
+				if ( isset( $v[ 'disabled' ] ) && $v[ 'disabled' ] ) {
468 468
 					$disabled = true;
469 469
 				}
470 470
 
471 471
 				if ( $k == 'audio_file' ) {
472
-					$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td><input name="' . esc_attr( $k ) . '" type="text" id="upload_audio_file" class="regular-text" value="' . esc_attr( $data ) . '" /> <input type="button" class="button" id="upload_audio_file_button" value="' . __( 'Upload File' , 'seriously-simple-podcasting' ) . '" data-uploader_title="' . __( 'Choose a file', 'seriously-simple-podcasting' ) . '" data-uploader_button_text="' . __( 'Insert podcast file', 'seriously-simple-podcasting' ) . '" />' . "\n";
473
-					$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
474
-					$html .= '</td><tr/>' . "\n";
472
+					$html .= '<tr valign="top"><th scope="row"><label for="'.esc_attr ( $k ).'">'.$v[ 'name' ].'</label></th><td><input name="'.esc_attr ( $k ).'" type="text" id="upload_audio_file" class="regular-text" value="'.esc_attr ( $data ).'" /> <input type="button" class="button" id="upload_audio_file_button" value="'.__ ( 'Upload File', 'seriously-simple-podcasting' ).'" data-uploader_title="'.__ ( 'Choose a file', 'seriously-simple-podcasting' ).'" data-uploader_button_text="'.__ ( 'Insert podcast file', 'seriously-simple-podcasting' ).'" />'."\n";
473
+					$html .= '<p class="description">'.$v[ 'description' ].'</p>'."\n";
474
+					$html .= '</td><tr/>'."\n";
475 475
 				} else {
476
-					if ( $v['type'] == 'checkbox' ) {
477
-						$html .= '<tr valign="top"><th scope="row">' . $v['name'] . '</th><td><input name="' . esc_attr( $k ) . '" type="checkbox" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '" ' . checked( 'on' , $data , false ) . ' /> <label for="' . esc_attr( $k ) . '"><span class="description">' . $v['description'] . '</span></label>' . "\n";
478
-						$html .= '</td><tr/>' . "\n";
479
-					} elseif ( $v['type'] == 'radio' ) {
480
-						$html .= '<tr valign="top"><th scope="row">' . $v['name'] . '</th><td>' ."\n";
481
-						foreach( $v['options'] as $option => $label ) {
482
-
483
-							$html .= '<input style="vertical-align: bottom;" name="' . esc_attr( $k ) . '" type="radio" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '" ' . checked( $option , $data , false ) . ' value="' . esc_attr( $option ) . '" /> <label style="margin-right:10px;" for="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '">' . esc_html( $label ) . '</label>' . "\n";
476
+					if ( $v[ 'type' ] == 'checkbox' ) {
477
+						$html .= '<tr valign="top"><th scope="row">'.$v[ 'name' ].'</th><td><input name="'.esc_attr ( $k ).'" type="checkbox" class="'.esc_attr ( $class ).'" id="'.esc_attr ( $k ).'" '.checked ( 'on', $data, false ).' /> <label for="'.esc_attr ( $k ).'"><span class="description">'.$v[ 'description' ].'</span></label>'."\n";
478
+						$html .= '</td><tr/>'."\n";
479
+					} elseif ( $v[ 'type' ] == 'radio' ) {
480
+						$html .= '<tr valign="top"><th scope="row">'.$v[ 'name' ].'</th><td>'."\n";
481
+						foreach ( $v[ 'options' ] as $option => $label ) {
482
+
483
+							$html .= '<input style="vertical-align: bottom;" name="'.esc_attr ( $k ).'" type="radio" class="'.esc_attr ( $class ).'" id="'.esc_attr ( $k ).'_'.esc_attr ( $option ).'" '.checked ( $option, $data, false ).' value="'.esc_attr ( $option ).'" /> <label style="margin-right:10px;" for="'.esc_attr ( $k ).'_'.esc_attr ( $option ).'">'.esc_html ( $label ).'</label>'."\n";
484 484
 						}
485
-						$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
486
-						$html .= '</td><tr/>' . "\n";
487
-					} elseif ( $v['type'] == 'datepicker' ) {
485
+						$html .= '<p class="description">'.$v[ 'description' ].'</p>'."\n";
486
+						$html .= '</td><tr/>'."\n";
487
+					} elseif ( $v[ 'type' ] == 'datepicker' ) {
488 488
 						$display_date = '';
489
-						if( $data ) {
490
-							$display_date = date( 'j F, Y', strtotime( $data ) );
489
+						if ( $data ) {
490
+							$display_date = date ( 'j F, Y', strtotime ( $data ) );
491 491
 						}
492
-						$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '_display">' . $v['name'] . '</label></th><td class="hasDatepicker"><input type="text" id="' . esc_attr( $k ) . '_display" class="ssp-datepicker ' . esc_attr( $class ) . '" value="' . esc_attr( $display_date ) . '" />' . "\n";
493
-						$html .= '<input name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" type="hidden" value="' . esc_attr( $data ) . '" />' . "\n";
494
-						$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
495
-						$html .= '</td><tr/>' . "\n";
492
+						$html .= '<tr valign="top"><th scope="row"><label for="'.esc_attr ( $k ).'_display">'.$v[ 'name' ].'</label></th><td class="hasDatepicker"><input type="text" id="'.esc_attr ( $k ).'_display" class="ssp-datepicker '.esc_attr ( $class ).'" value="'.esc_attr ( $display_date ).'" />'."\n";
493
+						$html .= '<input name="'.esc_attr ( $k ).'" id="'.esc_attr ( $k ).'" type="hidden" value="'.esc_attr ( $data ).'" />'."\n";
494
+						$html .= '<p class="description">'.$v[ 'description' ].'</p>'."\n";
495
+						$html .= '</td><tr/>'."\n";
496 496
 					} else {
497
-						$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td><input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="' . esc_attr( $class ) . '" value="' . esc_attr( $data ) . '" />' . "\n";
498
-						$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
499
-						$html .= '</td><tr/>' . "\n";
497
+						$html .= '<tr valign="top"><th scope="row"><label for="'.esc_attr ( $k ).'">'.$v[ 'name' ].'</label></th><td><input name="'.esc_attr ( $k ).'" type="text" id="'.esc_attr ( $k ).'" class="'.esc_attr ( $class ).'" value="'.esc_attr ( $data ).'" />'."\n";
498
+						$html .= '<p class="description">'.$v[ 'description' ].'</p>'."\n";
499
+						$html .= '</td><tr/>'."\n";
500 500
 					}
501 501
 				}
502 502
 			}
503 503
 
504
-			$html .= '</tbody>' . "\n";
505
-			$html .= '</table>' . "\n";
504
+			$html .= '</tbody>'."\n";
505
+			$html .= '</table>'."\n";
506 506
 		}
507 507
 
508 508
 		echo $html;
@@ -516,78 +516,78 @@  discard block
 block discarded – undo
516 516
 	public function meta_box_save( $post_id ) {
517 517
 		global $ss_podcasting;
518 518
 
519
-		$podcast_post_types = ssp_post_types( true );
519
+		$podcast_post_types = ssp_post_types ( true );
520 520
 
521 521
 		// Post type check
522
-		if ( ! in_array( get_post_type(), $podcast_post_types ) ) {
522
+		if ( ! in_array ( get_post_type (), $podcast_post_types ) ) {
523 523
 			return false;
524 524
 		}
525 525
 
526 526
 		// Security check
527
-		if ( ! isset( $_POST['seriouslysimple_' . $this->token . '_nonce'] ) || ! ( isset( $_POST['seriouslysimple_' . $this->token . '_nonce'] ) && wp_verify_nonce( $_POST['seriouslysimple_' . $this->token . '_nonce'], plugin_basename( $this->dir ) ) ) ) {
527
+		if ( ! isset( $_POST[ 'seriouslysimple_'.$this->token.'_nonce' ] ) || ! ( isset( $_POST[ 'seriouslysimple_'.$this->token.'_nonce' ] ) && wp_verify_nonce ( $_POST[ 'seriouslysimple_'.$this->token.'_nonce' ], plugin_basename ( $this->dir ) ) ) ) {
528 528
 			return $post_id;
529 529
 		}
530 530
 
531 531
 		// User capability check
532
-		if ( 'page' == $_POST['post_type'] ) {
533
-			if ( ! current_user_can( 'edit_page', $post_id ) ) {
532
+		if ( 'page' == $_POST[ 'post_type' ] ) {
533
+			if ( ! current_user_can ( 'edit_page', $post_id ) ) {
534 534
 				return $post_id;
535 535
 			}
536 536
 		} else {
537
-			if ( ! current_user_can( 'edit_post', $post_id ) ) {
537
+			if ( ! current_user_can ( 'edit_post', $post_id ) ) {
538 538
 				return $post_id;
539 539
 			}
540 540
 		}
541 541
 
542
-		$field_data = $this->custom_fields();
542
+		$field_data = $this->custom_fields ();
543 543
 		$enclosure = '';
544 544
 
545 545
 		foreach ( $field_data as $k => $field ) {
546 546
 
547
-			if( 'embed_code' == $k ) {
547
+			if ( 'embed_code' == $k ) {
548 548
 				continue;
549 549
 			}
550 550
 
551 551
 			$val = '';
552 552
 			if ( isset( $_POST[ $k ] ) ) {
553
-				$val = strip_tags( trim( $_POST[ $k ] ) );
553
+				$val = strip_tags ( trim ( $_POST[ $k ] ) );
554 554
 			}
555 555
 
556 556
 			if ( $k == 'audio_file' ) {
557 557
 				$enclosure = $val;
558 558
 			}
559 559
 
560
-			update_post_meta( $post_id, $k, $val );
560
+			update_post_meta ( $post_id, $k, $val );
561 561
 		}
562 562
 
563 563
 		if ( $enclosure ) {
564 564
 
565 565
 			// Get file duration
566
-			if ( get_post_meta( $post_id, 'duration', true ) == '' ) {
567
-				$duration = $ss_podcasting->get_file_duration( $enclosure );
566
+			if ( get_post_meta ( $post_id, 'duration', true ) == '' ) {
567
+				$duration = $ss_podcasting->get_file_duration ( $enclosure );
568 568
 				if ( $duration ) {
569
-					update_post_meta( $post_id , 'duration' , $duration );
569
+					update_post_meta ( $post_id, 'duration', $duration );
570 570
 				}
571 571
 			}
572 572
 
573 573
 			// Get file size
574
-			if ( get_post_meta( $post_id, 'filesize', true ) == '' ) {
575
-				$filesize = $ss_podcasting->get_file_size( $enclosure );
574
+			if ( get_post_meta ( $post_id, 'filesize', true ) == '' ) {
575
+				$filesize = $ss_podcasting->get_file_size ( $enclosure );
576 576
 				if ( $filesize ) {
577 577
 
578
-					if ( isset( $filesize['formatted'] ) ) {
579
-						update_post_meta( $post_id, 'filesize', $filesize['formatted'] );
578
+					if ( isset( $filesize[ 'formatted' ] ) ) {
579
+						update_post_meta ( $post_id, 'filesize', $filesize[ 'formatted' ] );
580 580
 					}
581 581
 
582
-					if ( isset( $filesize['raw'] ) ) {
583
-						update_post_meta( $post_id, 'filesize_raw', $filesize['raw'] );
582
+					if ( isset( $filesize[ 'raw' ] ) ) {
583
+						update_post_meta ( $post_id, 'filesize_raw', $filesize[ 'raw' ] );
584 584
 					}
585 585
 
586 586
 				}
587 587
 			}
588 588
 
589 589
 			// Save podcast file to 'enclosure' meta field for standards-sake
590
-			update_post_meta( $post_id, 'enclosure', $enclosure );
590
+			update_post_meta ( $post_id, 'enclosure', $enclosure );
591 591
 
592 592
 		}
593 593
 
@@ -601,65 +601,65 @@  discard block
 block discarded – undo
601 601
 		global $pagenow;
602 602
 		$fields = array();
603 603
 
604
-		$fields['episode_type'] = array(
605
-			'name' => __( 'Episode type:' , 'seriously-simple-podcasting' ),
604
+		$fields[ 'episode_type' ] = array(
605
+			'name' => __ ( 'Episode type:', 'seriously-simple-podcasting' ),
606 606
 		    'description' => '',
607 607
 		    'type' => 'radio',
608 608
 		    'default' => 'audio',
609
-		    'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ),
609
+		    'options' => array( 'audio' => __ ( 'Audio', 'seriously-simple-podcasting' ), 'video' => __ ( 'Video', 'seriously-simple-podcasting' ) ),
610 610
 		    'section' => 'info',
611 611
 		);
612 612
 
613 613
 		// In v1.14+ the `audio_file` field can actually be either audio or video, but we're keeping the field name here for backwards compatibility
614
-		$fields['audio_file'] = array(
615
-		    'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ),
616
-		    'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ),
614
+		$fields[ 'audio_file' ] = array(
615
+		    'name' => __ ( 'Podcast file:', 'seriously-simple-podcasting' ),
616
+		    'description' => __ ( 'Upload the primary podcast file or paste the file URL here.', 'seriously-simple-podcasting' ),
617 617
 		    'type' => 'url',
618 618
 		    'default' => '',
619 619
 		    'section' => 'info',
620 620
 		);
621 621
 
622
-		$fields['duration'] = array(
623
-		    'name' => __( 'Duration:' , 'seriously-simple-podcasting' ),
624
-		    'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
622
+		$fields[ 'duration' ] = array(
623
+		    'name' => __ ( 'Duration:', 'seriously-simple-podcasting' ),
624
+		    'description' => __ ( 'Duration of podcast file for display (calculated automatically if possible).', 'seriously-simple-podcasting' ),
625 625
 		    'type' => 'text',
626 626
 		    'default' => '',
627 627
 		    'section' => 'info',
628 628
 		);
629 629
 
630
-		$fields['filesize'] = array(
631
-		    'name' => __( 'File size:' , 'seriously-simple-podcasting' ),
632
-		    'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
630
+		$fields[ 'filesize' ] = array(
631
+		    'name' => __ ( 'File size:', 'seriously-simple-podcasting' ),
632
+		    'description' => __ ( 'Size of the podcast file for display (calculated automatically if possible).', 'seriously-simple-podcasting' ),
633 633
 		    'type' => 'text',
634 634
 		    'default' => '',
635 635
 		    'section' => 'info',
636 636
 		);
637 637
 
638
-		$fields['date_recorded'] = array(
639
-		    'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ),
640
-		    'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ),
638
+		$fields[ 'date_recorded' ] = array(
639
+		    'name' => __ ( 'Date recorded:', 'seriously-simple-podcasting' ),
640
+		    'description' => __ ( 'The date on which this episode was recorded.', 'seriously-simple-podcasting' ),
641 641
 		    'type' => 'datepicker',
642 642
 		    'default' => '',
643 643
 		    'section' => 'info',
644 644
 		);
645 645
 
646
-		$fields['explicit'] = array(
647
-		    'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ),
648
-		    'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ),
646
+		$fields[ 'explicit' ] = array(
647
+		    'name' => __ ( 'Explicit:', 'seriously-simple-podcasting' ),
648
+		    'description' => __ ( 'Mark this episode as explicit.', 'seriously-simple-podcasting' ),
649 649
 		    'type' => 'checkbox',
650 650
 		    'default' => '',
651 651
 		    'section' => 'info',
652 652
 		);
653 653
 
654
-		$fields['block'] = array(
655
-		    'name' => __( 'Block:' , 'seriously-simple-podcasting' ),
656
-		    'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ),
654
+		$fields[ 'block' ] = array(
655
+		    'name' => __ ( 'Block:', 'seriously-simple-podcasting' ),
656
+		    'description' => __ ( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.', 'seriously-simple-podcasting' ),
657 657
 		    'type' => 'checkbox',
658 658
 		    'default' => '',
659 659
 		    'section' => 'info',
660 660
 		);
661 661
 
662
-		return apply_filters( 'ssp_episode_fields', $fields );
662
+		return apply_filters ( 'ssp_episode_fields', $fields );
663 663
 	}
664 664
 
665 665
 	/**
@@ -669,17 +669,17 @@  discard block
 block discarded – undo
669 669
 	 */
670 670
 	public function glance_items( $items = array() ) {
671 671
 
672
-		$num_posts = count( ssp_episodes( -1, '', false, 'glance' ) );
672
+		$num_posts = count ( ssp_episodes ( -1, '', false, 'glance' ) );
673 673
 
674
-		$post_type_object = get_post_type_object( $this->token );
674
+		$post_type_object = get_post_type_object ( $this->token );
675 675
 
676
-		$text = _n( '%s Episode', '%s Episodes', $num_posts, 'seriously-simple-podcasting' );
677
-		$text = sprintf( $text, number_format_i18n( $num_posts ) );
676
+		$text = _n ( '%s Episode', '%s Episodes', $num_posts, 'seriously-simple-podcasting' );
677
+		$text = sprintf ( $text, number_format_i18n ( $num_posts ) );
678 678
 
679
-		if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
680
-			$items[] = sprintf( '<a class="%1$s-count" href="edit.php?post_type=%1$s">%2$s</a>', $this->token, $text ) . "\n";
679
+		if ( $post_type_object && current_user_can ( $post_type_object->cap->edit_posts ) ) {
680
+			$items[ ] = sprintf ( '<a class="%1$s-count" href="edit.php?post_type=%1$s">%2$s</a>', $this->token, $text )."\n";
681 681
 		} else {
682
-			$items[] = sprintf( '<span class="%1$s-count">%2$s</span>', $this->token, $text ) . "\n";
682
+			$items[ ] = sprintf ( '<span class="%1$s-count">%2$s</span>', $this->token, $text )."\n";
683 683
 		}
684 684
 
685 685
 		return $items;
@@ -693,15 +693,15 @@  discard block
 block discarded – undo
693 693
 	 * @param  string $status      Plugin status
694 694
 	 * @return array               Modified plugin meta links
695 695
 	 */
696
-	public function plugin_row_meta ( $plugin_meta = array(), $plugin_file = '', $plugin_data = array(), $status = '' ) {
696
+	public function plugin_row_meta( $plugin_meta = array(), $plugin_file = '', $plugin_data = array(), $status = '' ) {
697 697
 
698
-		if ( ! isset( $plugin_data['slug'] ) || 'seriously-simple-podcasting' != $plugin_data['slug'] ) {
698
+		if ( ! isset( $plugin_data[ 'slug' ] ) || 'seriously-simple-podcasting' != $plugin_data[ 'slug' ] ) {
699 699
 			return $plugin_meta;
700 700
 		}
701 701
 
702
-		$plugin_meta['docs'] = '<a href="http://www.seriouslysimplepodcasting.com/documentation/" target="_blank">' . __( 'Documentation', 'seriously-simple-podcasting' ) . '</a>';
703
-		$plugin_meta['addons'] = '<a href="http://www.seriouslysimplepodcasting.com/add-ons/" target="_blank">' . __( 'Add-ons', 'seriously-simple-podcasting' ) . '</a>';
704
-		$plugin_meta['review'] = '<a href="https://wordpress.org/support/view/plugin-reviews/' . $plugin_data['slug'] . '?rate=5#postform" target="_blank">' . __( 'Write a review', 'seriously-simple-podcasting' ) . '</a>';
702
+		$plugin_meta[ 'docs' ] = '<a href="http://www.seriouslysimplepodcasting.com/documentation/" target="_blank">'.__ ( 'Documentation', 'seriously-simple-podcasting' ).'</a>';
703
+		$plugin_meta[ 'addons' ] = '<a href="http://www.seriouslysimplepodcasting.com/add-ons/" target="_blank">'.__ ( 'Add-ons', 'seriously-simple-podcasting' ).'</a>';
704
+		$plugin_meta[ 'review' ] = '<a href="https://wordpress.org/support/view/plugin-reviews/'.$plugin_data[ 'slug' ].'?rate=5#postform" target="_blank">'.__ ( 'Write a review', 'seriously-simple-podcasting' ).'</a>';
705 705
 
706 706
 		return $plugin_meta;
707 707
 	}
@@ -712,8 +712,8 @@  discard block
 block discarded – undo
712 712
 	 * @return string        Modified text
713 713
 	 */
714 714
 	public function enter_title_here( $title ) {
715
-		if ( get_post_type() == $this->token ) {
716
-			$title = __( 'Enter episode title here', 'seriously-simple-podcasting' );
715
+		if ( get_post_type () == $this->token ) {
716
+			$title = __ ( 'Enter episode title here', 'seriously-simple-podcasting' );
717 717
 		}
718 718
 		return $title;
719 719
 	}
@@ -723,11 +723,11 @@  discard block
 block discarded – undo
723 723
 	 * @return void
724 724
 	 */
725 725
 	public function enqueue_admin_styles() {
726
-		wp_register_style( 'ssp-admin', esc_url( $this->assets_url . 'css/admin.css' ), array(), $this->version );
727
-		wp_enqueue_style( 'ssp-admin' );
726
+		wp_register_style ( 'ssp-admin', esc_url ( $this->assets_url.'css/admin.css' ), array(), $this->version );
727
+		wp_enqueue_style ( 'ssp-admin' );
728 728
 
729 729
 		// Datepicker
730
-		wp_enqueue_style( 'jquery-ui-datepicker', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' );
730
+		wp_enqueue_style ( 'jquery-ui-datepicker', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' );
731 731
 	}
732 732
 
733 733
 	/**
@@ -735,8 +735,8 @@  discard block
 block discarded – undo
735 735
 	 * @return void
736 736
 	 */
737 737
 	public function enqueue_admin_scripts() {
738
-		wp_register_script( 'ssp-admin', esc_url( $this->assets_url . 'js/admin' . $this->script_suffix . '.js' ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker' ), $this->version );
739
-		wp_enqueue_script( 'ssp-admin' );
738
+		wp_register_script ( 'ssp-admin', esc_url ( $this->assets_url.'js/admin'.$this->script_suffix.'.js' ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker' ), $this->version );
739
+		wp_enqueue_script ( 'ssp-admin' );
740 740
 	}
741 741
 
742 742
 	/**
@@ -744,8 +744,8 @@  discard block
 block discarded – undo
744 744
 	 * @return void
745 745
 	 */
746 746
 	public function ensure_post_thumbnails_support() {
747
-		if ( ! current_theme_supports( 'post-thumbnails' ) ) {
748
-			add_theme_support( 'post-thumbnails' );
747
+		if ( ! current_theme_supports ( 'post-thumbnails' ) ) {
748
+			add_theme_support ( 'post-thumbnails' );
749 749
 		}
750 750
 	}
751 751
 
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 	 * @return void
755 755
 	 */
756 756
 	public function load_localisation() {
757
-		load_plugin_textdomain( 'seriously-simple-podcasting', false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
757
+		load_plugin_textdomain ( 'seriously-simple-podcasting', false, dirname ( plugin_basename ( $this->file ) ).'/lang/' );
758 758
 	}
759 759
 
760 760
 	/**
@@ -764,10 +764,10 @@  discard block
 block discarded – undo
764 764
 	public function load_plugin_textdomain() {
765 765
 	    $domain = 'seriously-simple-podcasting';
766 766
 	    // The "plugin_locale" filter is also used in load_plugin_textdomain()
767
-	    $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
767
+	    $locale = apply_filters ( 'plugin_locale', get_locale (), $domain );
768 768
 
769
-	    load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
770
-	    load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
769
+	    load_textdomain ( $domain, WP_LANG_DIR.'/'.$domain.'/'.$domain.'-'.$locale.'.mo' );
770
+	    load_plugin_textdomain ( $domain, false, dirname ( plugin_basename ( $this->file ) ).'/lang/' );
771 771
 	}
772 772
 
773 773
     /**
@@ -775,8 +775,8 @@  discard block
 block discarded – undo
775 775
      * @return void
776 776
      */
777 777
     public function add_feed() {
778
-    	$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
779
-		add_feed( $feed_slug, array( $this, 'feed_template' ) );
778
+    	$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
779
+		add_feed ( $feed_slug, array( $this, 'feed_template' ) );
780 780
 	}
781 781
 
782 782
 	/**
@@ -784,9 +784,9 @@  discard block
 block discarded – undo
784 784
 	 * @param  boolean $include_footer Default inclusion value
785 785
 	 * @return boolean                 Modified inclusion value
786 786
 	 */
787
-	public function hide_wp_seo_rss_footer ( $include_footer = true ) {
787
+	public function hide_wp_seo_rss_footer( $include_footer = true ) {
788 788
 
789
-		if ( is_feed( 'podcast' ) ) {
789
+		if ( is_feed ( 'podcast' ) ) {
790 790
 			$include_footer = false;
791 791
 		}
792 792
 
@@ -802,24 +802,24 @@  discard block
 block discarded – undo
802 802
 
803 803
     	// Prevent 404 on feed
804 804
     	$wp_query->is_404 = false;
805
-    	status_header( 200 );
805
+    	status_header ( 200 );
806 806
 
807 807
     	$file_name = 'feed-podcast.php';
808 808
 
809
-    	$user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name );
809
+    	$user_template_file = apply_filters ( 'ssp_feed_template_file', trailingslashit ( get_stylesheet_directory () ).$file_name );
810 810
 
811 811
 		// Any functions hooked in here must NOT output any data or else feed will break
812
-		do_action( 'ssp_before_feed' );
812
+		do_action ( 'ssp_before_feed' );
813 813
 
814 814
     	// Load user feed template if it exists, otherwise use plugin template
815
-    	if ( file_exists( $user_template_file ) ) {
815
+    	if ( file_exists ( $user_template_file ) ) {
816 816
     		require( $user_template_file );
817 817
     	} else {
818
-    		require( $this->template_path . $file_name );
818
+    		require( $this->template_path.$file_name );
819 819
     	}
820 820
 
821 821
     	// Any functions hooked in here must NOT output any data or else feed will break
822
-    	do_action( 'ssp_after_feed' );
822
+    	do_action ( 'ssp_after_feed' );
823 823
 	}
824 824
 
825 825
 	/**
@@ -827,8 +827,8 @@  discard block
 block discarded – undo
827 827
 	 * @return void
828 828
 	 */
829 829
 	public function redirect_old_feed() {
830
-		if ( isset( $_GET['feed'] ) && in_array( $_GET['feed'], array( 'podcast', 'itunes' ) ) ) {
831
-			$this->feed_template();
830
+		if ( isset( $_GET[ 'feed' ] ) && in_array ( $_GET[ 'feed' ], array( 'podcast', 'itunes' ) ) ) {
831
+			$this->feed_template ();
832 832
 			exit;
833 833
 		}
834 834
 	}
@@ -840,12 +840,12 @@  discard block
 block discarded – undo
840 840
 	public function activate() {
841 841
 
842 842
 		// Setup all custom URL rules
843
-		$this->register_post_type();
844
-		$this->add_feed();
845
-		$this->setup_permastruct();
843
+		$this->register_post_type ();
844
+		$this->add_feed ();
845
+		$this->setup_permastruct ();
846 846
 
847 847
 		// Flush permalinks
848
-		flush_rewrite_rules( true );
848
+		flush_rewrite_rules ( true );
849 849
 	}
850 850
 
851 851
 	/**
@@ -853,37 +853,37 @@  discard block
 block discarded – undo
853 853
 	 * @return void
854 854
 	 */
855 855
 	public function deactivate() {
856
-		flush_rewrite_rules();
856
+		flush_rewrite_rules ();
857 857
 	}
858 858
 
859 859
 	/**
860 860
 	 * Run functions on plugin update/activation
861 861
 	 * @return void
862 862
 	 */
863
-	public function update () {
863
+	public function update() {
864 864
 
865
-		$previous_version = get_option( 'ssp_version', '1.0' );
865
+		$previous_version = get_option ( 'ssp_version', '1.0' );
866 866
 
867
-		if ( version_compare( $previous_version, '1.13.1', '<' ) ) {
868
-			flush_rewrite_rules();
867
+		if ( version_compare ( $previous_version, '1.13.1', '<' ) ) {
868
+			flush_rewrite_rules ();
869 869
 		}
870 870
 
871
-		update_option( 'ssp_version', $this->version );
871
+		update_option ( 'ssp_version', $this->version );
872 872
 	}
873 873
 
874 874
 	/**
875 875
 	 * Update 'enclosure' meta field to 'audio_file' meta field
876 876
 	 * @return void
877 877
 	 */
878
-	public function update_enclosures () {
878
+	public function update_enclosures() {
879 879
 
880 880
 		// Allow forced re-run of update if necessary
881
-		if ( isset( $_GET['ssp_update_enclosures'] ) ) {
882
-			delete_option( 'ssp_update_enclosures' );
881
+		if ( isset( $_GET[ 'ssp_update_enclosures' ] ) ) {
882
+			delete_option ( 'ssp_update_enclosures' );
883 883
 		}
884 884
 
885 885
 		// Check if update has been run
886
-		$update_run = get_option( 'ssp_update_enclosures', false );
886
+		$update_run = get_option ( 'ssp_update_enclosures', false );
887 887
 
888 888
 		if ( $update_run ) {
889 889
 			return;
@@ -904,9 +904,9 @@  discard block
 block discarded – undo
904 904
 			'fields' => 'ids',
905 905
 		);
906 906
 
907
-		$posts_with_enclosures = get_posts( $args );
907
+		$posts_with_enclosures = get_posts ( $args );
908 908
 
909
-		if ( 0 == count( $posts_with_enclosures ) ) {
909
+		if ( 0 == count ( $posts_with_enclosures ) ) {
910 910
 			return;
911 911
 		}
912 912
 
@@ -914,17 +914,17 @@  discard block
 block discarded – undo
914 914
 		foreach ( (array) $posts_with_enclosures as $post_id ) {
915 915
 
916 916
 			// Get existing enclosure
917
-			$enclosure = get_post_meta( $post_id, 'enclosure', true );
917
+			$enclosure = get_post_meta ( $post_id, 'enclosure', true );
918 918
 
919 919
 			// Add audio_file field
920 920
 			if ( $enclosure ) {
921
-				update_post_meta( $post_id, 'audio_file', $enclosure );
921
+				update_post_meta ( $post_id, 'audio_file', $enclosure );
922 922
 			}
923 923
 
924 924
 		}
925 925
 
926 926
 		// Mark update as having been run
927
-		update_option( 'ssp_update_enclosures', 'run' );
927
+		update_option ( 'ssp_update_enclosures', 'run' );
928 928
 	}
929 929
 
930 930
 	/**
@@ -935,19 +935,19 @@  discard block
 block discarded – undo
935 935
 	public function admin_footer_text( $footer_text ) {
936 936
 
937 937
 		// Check to make sure we're on a SSP settings page
938
-		if ( ( isset( $_GET['page'] ) && 'podcast_settings' == esc_attr( $_GET['page'] ) ) && apply_filters( 'ssp_display_admin_footer_text', true ) ) {
938
+		if ( ( isset( $_GET[ 'page' ] ) && 'podcast_settings' == esc_attr ( $_GET[ 'page' ] ) ) && apply_filters ( 'ssp_display_admin_footer_text', true ) ) {
939 939
 
940 940
 			// Change the footer text
941
-			if ( ! get_option( 'ssp_admin_footer_text_rated' ) ) {
942
-				$footer_text = sprintf( __( 'If you like %1$sSeriously Simple Podcasting%2$s please leave a %3$s&#9733;&#9733;&#9733;&#9733;&#9733;%4$s rating. A huge thank you in advance!', 'seriously-simple-podcasting' ), '<strong>', '</strong>', '<a href="https://wordpress.org/support/view/plugin-reviews/seriously-simple-podcasting?filter=5#postform" target="_blank" class="ssp-rating-link" data-rated="' . __( 'Thanks!', 'seriously-simple-podcasting' ) . '">', '</a>' );
941
+			if ( ! get_option ( 'ssp_admin_footer_text_rated' ) ) {
942
+				$footer_text = sprintf ( __ ( 'If you like %1$sSeriously Simple Podcasting%2$s please leave a %3$s&#9733;&#9733;&#9733;&#9733;&#9733;%4$s rating. A huge thank you in advance!', 'seriously-simple-podcasting' ), '<strong>', '</strong>', '<a href="https://wordpress.org/support/view/plugin-reviews/seriously-simple-podcasting?filter=5#postform" target="_blank" class="ssp-rating-link" data-rated="'.__ ( 'Thanks!', 'seriously-simple-podcasting' ).'">', '</a>' );
943 943
 				$footer_text .= "<script type='text/javascript'>
944 944
 					jQuery('a.ssp-rating-link').click(function() {
945
-						jQuery.post( '" . admin_url( 'admin-ajax.php' ) . "', { action: 'ssp_rated' } );
945
+						jQuery.post( '" . admin_url ( 'admin-ajax.php' )."', { action: 'ssp_rated' } );
946 946
 						jQuery(this).parent().text( jQuery(this).data( 'rated' ) );
947 947
 					});
948 948
 				</script>";
949 949
 			} else {
950
-				$footer_text = sprintf( __( '%1$sThank you for publishing with %2$sSeriously Simple Podcasting%3$s.%4$s', 'seriously-simple-podcasting' ), '<span id="footer-thankyou">', '<a href="http://www.seriouslysimplepodcasting.com/" target="_blank">', '</a>', '</span>' );
950
+				$footer_text = sprintf ( __ ( '%1$sThank you for publishing with %2$sSeriously Simple Podcasting%3$s.%4$s', 'seriously-simple-podcasting' ), '<span id="footer-thankyou">', '<a href="http://www.seriouslysimplepodcasting.com/" target="_blank">', '</a>', '</span>' );
951 951
 			}
952 952
 
953 953
 		}
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 	 * @return void
961 961
 	 */
962 962
 	public function rated() {
963
-		update_option( 'ssp_admin_footer_text_rated', 1 );
963
+		update_option ( 'ssp_admin_footer_text_rated', 1 );
964 964
 		die();
965 965
 	}
966 966
 
@@ -970,11 +970,11 @@  discard block
 block discarded – undo
970 970
 	 * @param  object $post WordPress Post Object
971 971
 	 * @return void
972 972
 	 */
973
-	public function invalidate_cache( $id, $post ){
973
+	public function invalidate_cache( $id, $post ) {
974 974
 
975
-		if ( in_array( $post->post_type, ssp_post_types( true ) ) ){
976
-			wp_cache_delete( 'episodes',    'ssp' );
977
-			wp_cache_delete( 'episode_ids', 'ssp' );
975
+		if ( in_array ( $post->post_type, ssp_post_types ( true ) ) ) {
976
+			wp_cache_delete ( 'episodes', 'ssp' );
977
+			wp_cache_delete ( 'episode_ids', 'ssp' );
978 978
 		}
979 979
 
980 980
 	}
Please login to merge, or discard this patch.
Indentation   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 
84 84
 			// Series list table
85 85
 			add_filter( 'manage_edit-series_columns' , array( $this, 'edit_series_columns' ) );
86
-            add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 );
86
+			add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 );
87 87
 
88
-            // Dashboard widgets
89
-            add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
88
+			// Dashboard widgets
89
+			add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
90 90
 
91
-            // Appreciation links
92
-            add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
91
+			// Appreciation links
92
+			add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
93 93
 
94
-            // Add footer text to dashboard
95
-            add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
94
+			// Add footer text to dashboard
95
+			add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
96 96
 
97
-            // Clear the cache on post save.
98
-            add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
97
+			// Clear the cache on post save.
98
+			add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
99 99
 
100 100
 		}
101 101
 
@@ -194,47 +194,47 @@  discard block
 block discarded – undo
194 194
 
195 195
 		$podcast_post_types = ssp_post_types( true );
196 196
 
197
-        $series_labels = array(
198
-            'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ),
199
-            'singular_name' => __( 'Series', 'seriously-simple-podcasting' ),
200
-            'search_items' =>  __( 'Search Series' , 'seriously-simple-podcasting' ),
201
-            'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ),
202
-            'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ),
203
-            'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ),
204
-            'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ),
205
-            'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ),
206
-            'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ),
207
-            'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ),
208
-            'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ),
209
-            'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ),
210
-            'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ),
211
-            'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ),
212
-            'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ),
213
-            'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ),
214
-            'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ),
215
-            'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ),
216
-            'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ),
217
-        );
218
-
219
-        $series_args = array(
220
-            'public' => true,
221
-            'hierarchical' => true,
222
-            'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ),
223
-            'labels' => $series_labels,
224
-            'show_in_rest' => true,
225
-        );
226
-
227
-        $series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' );
228
-
229
-        register_taxonomy( 'series', $podcast_post_types, $series_args );
230
-
231
-        // Add Tags to podcast post type
232
-        if ( apply_filters( 'ssp_use_post_tags', true ) ) {
233
-        	register_taxonomy_for_object_type( 'post_tag', $this->token );
234
-        }
235
-    }
236
-
237
-    /**
197
+		$series_labels = array(
198
+			'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ),
199
+			'singular_name' => __( 'Series', 'seriously-simple-podcasting' ),
200
+			'search_items' =>  __( 'Search Series' , 'seriously-simple-podcasting' ),
201
+			'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ),
202
+			'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ),
203
+			'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ),
204
+			'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ),
205
+			'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ),
206
+			'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ),
207
+			'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ),
208
+			'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ),
209
+			'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ),
210
+			'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ),
211
+			'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ),
212
+			'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ),
213
+			'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ),
214
+			'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ),
215
+			'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ),
216
+			'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ),
217
+		);
218
+
219
+		$series_args = array(
220
+			'public' => true,
221
+			'hierarchical' => true,
222
+			'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ),
223
+			'labels' => $series_labels,
224
+			'show_in_rest' => true,
225
+		);
226
+
227
+		$series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' );
228
+
229
+		register_taxonomy( 'series', $podcast_post_types, $series_args );
230
+
231
+		// Add Tags to podcast post type
232
+		if ( apply_filters( 'ssp_use_post_tags', true ) ) {
233
+			register_taxonomy_for_object_type( 'post_tag', $this->token );
234
+		}
235
+	}
236
+
237
+	/**
238 238
 	 * Register columns for podcast list table
239 239
 	 * @param  array $defaults Default columns
240 240
 	 * @return array           Modified columns
@@ -251,12 +251,12 @@  discard block
 block discarded – undo
251 251
 		return $columns;
252 252
 	}
253 253
 
254
-    /**
255
-     * Display column data in podcast list table
256
-     * @param  string  $column_name Name of current column
257
-     * @param  integer $id          ID of episode
258
-     * @return void
259
-     */
254
+	/**
255
+	 * Display column data in podcast list table
256
+	 * @param  string  $column_name Name of current column
257
+	 * @param  integer $id          ID of episode
258
+	 * @return void
259
+	 */
260 260
 	public function register_custom_columns( $column_name, $id ) {
261 261
 		global $ss_podcasting;
262 262
 
@@ -286,34 +286,34 @@  discard block
 block discarded – undo
286 286
 	 */
287 287
 	public function edit_series_columns( $columns ) {
288 288
 
289
-        unset( $columns['description'] );
290
-        unset( $columns['posts'] );
289
+		unset( $columns['description'] );
290
+		unset( $columns['posts'] );
291 291
 
292
-        $columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' );
293
-        $columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' );
292
+		$columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' );
293
+		$columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' );
294 294
 
295
-        $columns = apply_filters( 'ssp_admin_columns_series', $columns );
295
+		$columns = apply_filters( 'ssp_admin_columns_series', $columns );
296 296
 
297
-        return $columns;
298
-    }
297
+		return $columns;
298
+	}
299 299
 
300
-    /**
301
-     * Display column data in series list table
302
-     *
303
-     * @param string  $column_data Default column content
304
-     * @param string  $column_name Name of current column
305
-     * @param integer $term_id     ID of term
306
-     *
307
-     * @return string
308
-     */
309
-    public function add_series_columns( $column_data , $column_name , $term_id ) {
300
+	/**
301
+	 * Display column data in series list table
302
+	 *
303
+	 * @param string  $column_data Default column content
304
+	 * @param string  $column_name Name of current column
305
+	 * @param integer $term_id     ID of term
306
+	 *
307
+	 * @return string
308
+	 */
309
+	public function add_series_columns( $column_data , $column_name , $term_id ) {
310 310
 
311
-        switch ( $column_name ) {
312
-            case 'series_feed_url':
313
-            	$series = get_term( $term_id, 'series' );
314
-            	$series_slug = $series->slug;
311
+		switch ( $column_name ) {
312
+			case 'series_feed_url':
313
+				$series = get_term( $term_id, 'series' );
314
+				$series_slug = $series->slug;
315 315
 
316
-            	if ( get_option( 'permalink_structure' ) ) {
316
+				if ( get_option( 'permalink_structure' ) ) {
317 317
 					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
318 318
 					$feed_url = $this->home_url . 'feed/' . $feed_slug . '/' . $series_slug;
319 319
 				} else {
@@ -326,33 +326,33 @@  discard block
 block discarded – undo
326 326
 					);
327 327
 				}
328 328
 
329
-                $column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>';
330
-            break;
331
-        }
329
+				$column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>';
330
+			break;
331
+		}
332 332
 
333
-        return $column_data;
334
-    }
333
+		return $column_data;
334
+	}
335 335
 
336
-    /**
337
-     * Create custom dashboard message
338
-     * @param  array $messages Default messages
339
-     * @return array           Modified messages
340
-     */
336
+	/**
337
+	 * Create custom dashboard message
338
+	 * @param  array $messages Default messages
339
+	 * @return array           Modified messages
340
+	 */
341 341
 	public function updated_messages( $messages ) {
342 342
 	  global $post, $post_ID;
343 343
 
344 344
 	  $messages[ $this->token ] = array(
345
-	    0 => '',
346
-	    1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
347
-	    2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ),
348
-	    3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ),
349
-	    4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ),
350
-	    5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
351
-	    6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
352
-	    7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ),
353
-	    8 => sprintf( __( 'Episode submitted. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
354
-	    9 => sprintf( __( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.' , 'seriously-simple-podcasting' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'seriously-simple-podcasting' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
355
-	    10 => sprintf( __( 'Episode draft updated. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
345
+		0 => '',
346
+		1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
347
+		2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ),
348
+		3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ),
349
+		4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ),
350
+		5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
351
+		6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
352
+		7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ),
353
+		8 => sprintf( __( 'Episode submitted. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
354
+		9 => sprintf( __( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.' , 'seriously-simple-podcasting' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'seriously-simple-podcasting' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
355
+		10 => sprintf( __( 'Episode draft updated. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
356 356
 	  );
357 357
 
358 358
 	  return $messages;
@@ -603,60 +603,60 @@  discard block
 block discarded – undo
603 603
 
604 604
 		$fields['episode_type'] = array(
605 605
 			'name' => __( 'Episode type:' , 'seriously-simple-podcasting' ),
606
-		    'description' => '',
607
-		    'type' => 'radio',
608
-		    'default' => 'audio',
609
-		    'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ),
610
-		    'section' => 'info',
606
+			'description' => '',
607
+			'type' => 'radio',
608
+			'default' => 'audio',
609
+			'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ),
610
+			'section' => 'info',
611 611
 		);
612 612
 
613 613
 		// In v1.14+ the `audio_file` field can actually be either audio or video, but we're keeping the field name here for backwards compatibility
614 614
 		$fields['audio_file'] = array(
615
-		    'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ),
616
-		    'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ),
617
-		    'type' => 'url',
618
-		    'default' => '',
619
-		    'section' => 'info',
615
+			'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ),
616
+			'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ),
617
+			'type' => 'url',
618
+			'default' => '',
619
+			'section' => 'info',
620 620
 		);
621 621
 
622 622
 		$fields['duration'] = array(
623
-		    'name' => __( 'Duration:' , 'seriously-simple-podcasting' ),
624
-		    'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
625
-		    'type' => 'text',
626
-		    'default' => '',
627
-		    'section' => 'info',
623
+			'name' => __( 'Duration:' , 'seriously-simple-podcasting' ),
624
+			'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
625
+			'type' => 'text',
626
+			'default' => '',
627
+			'section' => 'info',
628 628
 		);
629 629
 
630 630
 		$fields['filesize'] = array(
631
-		    'name' => __( 'File size:' , 'seriously-simple-podcasting' ),
632
-		    'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
633
-		    'type' => 'text',
634
-		    'default' => '',
635
-		    'section' => 'info',
631
+			'name' => __( 'File size:' , 'seriously-simple-podcasting' ),
632
+			'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
633
+			'type' => 'text',
634
+			'default' => '',
635
+			'section' => 'info',
636 636
 		);
637 637
 
638 638
 		$fields['date_recorded'] = array(
639
-		    'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ),
640
-		    'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ),
641
-		    'type' => 'datepicker',
642
-		    'default' => '',
643
-		    'section' => 'info',
639
+			'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ),
640
+			'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ),
641
+			'type' => 'datepicker',
642
+			'default' => '',
643
+			'section' => 'info',
644 644
 		);
645 645
 
646 646
 		$fields['explicit'] = array(
647
-		    'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ),
648
-		    'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ),
649
-		    'type' => 'checkbox',
650
-		    'default' => '',
651
-		    'section' => 'info',
647
+			'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ),
648
+			'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ),
649
+			'type' => 'checkbox',
650
+			'default' => '',
651
+			'section' => 'info',
652 652
 		);
653 653
 
654 654
 		$fields['block'] = array(
655
-		    'name' => __( 'Block:' , 'seriously-simple-podcasting' ),
656
-		    'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ),
657
-		    'type' => 'checkbox',
658
-		    'default' => '',
659
-		    'section' => 'info',
655
+			'name' => __( 'Block:' , 'seriously-simple-podcasting' ),
656
+			'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ),
657
+			'type' => 'checkbox',
658
+			'default' => '',
659
+			'section' => 'info',
660 660
 		);
661 661
 
662 662
 		return apply_filters( 'ssp_episode_fields', $fields );
@@ -762,20 +762,20 @@  discard block
 block discarded – undo
762 762
 	 * @return void
763 763
 	 */
764 764
 	public function load_plugin_textdomain() {
765
-	    $domain = 'seriously-simple-podcasting';
766
-	    // The "plugin_locale" filter is also used in load_plugin_textdomain()
767
-	    $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
765
+		$domain = 'seriously-simple-podcasting';
766
+		// The "plugin_locale" filter is also used in load_plugin_textdomain()
767
+		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
768 768
 
769
-	    load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
770
-	    load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
769
+		load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
770
+		load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
771 771
 	}
772 772
 
773
-    /**
774
-     * Register podcast feed
775
-     * @return void
776
-     */
777
-    public function add_feed() {
778
-    	$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
773
+	/**
774
+	 * Register podcast feed
775
+	 * @return void
776
+	 */
777
+	public function add_feed() {
778
+		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
779 779
 		add_feed( $feed_slug, array( $this, 'feed_template' ) );
780 780
 	}
781 781
 
@@ -797,31 +797,31 @@  discard block
 block discarded – undo
797 797
 	 * Load feed template
798 798
 	 * @return void
799 799
 	 */
800
-    public function feed_template() {
801
-    	global $wp_query;
800
+	public function feed_template() {
801
+		global $wp_query;
802 802
 
803
-    	// Prevent 404 on feed
804
-    	$wp_query->is_404 = false;
805
-    	status_header( 200 );
803
+		// Prevent 404 on feed
804
+		$wp_query->is_404 = false;
805
+		status_header( 200 );
806 806
 
807
-    	$file_name = 'feed-podcast.php';
807
+		$file_name = 'feed-podcast.php';
808 808
 
809
-    	$user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name );
809
+		$user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name );
810 810
 
811 811
 		// Any functions hooked in here must NOT output any data or else feed will break
812 812
 		do_action( 'ssp_before_feed' );
813 813
 
814
-    	// Load user feed template if it exists, otherwise use plugin template
815
-    	if ( file_exists( $user_template_file ) ) {
816
-    		require( $user_template_file );
817
-    	} else {
818
-    		require( $this->template_path . $file_name );
819
-    	}
814
+		// Load user feed template if it exists, otherwise use plugin template
815
+		if ( file_exists( $user_template_file ) ) {
816
+			require( $user_template_file );
817
+		} else {
818
+			require( $this->template_path . $file_name );
819
+		}
820 820
 
821
-    	// Any functions hooked in here must NOT output any data or else feed will break
822
-    	do_action( 'ssp_after_feed' );
821
+		// Any functions hooked in here must NOT output any data or else feed will break
822
+		do_action( 'ssp_after_feed' );
823 823
 
824
-    	exit;
824
+		exit;
825 825
 	}
826 826
 
827 827
 	/**
Please login to merge, or discard this patch.
includes/class-ssp-settings.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -928,15 +928,15 @@  discard block
 block discarded – undo
928 928
 		if ( $message ) {
929 929
 
930 930
 			$allowed = array(
931
-			    'a' => array(
932
-			        'href' => array(),
933
-			        'title' => array(),
934
-			        'target' => array()
935
-			    ),
936
-			    'br' => array(),
937
-			    'em' => array(),
938
-			    'strong' => array(),
939
-			    'p' => array()
931
+				'a' => array(
932
+					'href' => array(),
933
+					'title' => array(),
934
+					'target' => array()
935
+				),
936
+				'br' => array(),
937
+				'em' => array(),
938
+				'strong' => array(),
939
+				'p' => array()
940 940
 			);
941 941
 
942 942
 			$message = wp_kses( $message, $allowed );
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 			if( function_exists( 'php_sapi_name') && 'security' == $tab ) {
1027 1027
 				$sapi_type = php_sapi_name();
1028 1028
 				if ( strpos( $sapi_type, 'fcgi' ) !== false ) {
1029
-				    $html .= '<br/><div class="update-nag">
1029
+					$html .= '<br/><div class="update-nag">
1030 1030
 					        <p>' . sprintf( __( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ) . '</p>
1031 1031
 					    </div>';
1032 1032
 				}
Please login to merge, or discard this patch.
Spacing   +352 added lines, -352 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -31,37 +31,37 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct( $file ) {
33 33
 		$this->file = $file;
34
-		$this->dir = dirname( $this->file );
35
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
36
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
37
-		$this->home_url = trailingslashit( home_url() );
34
+		$this->dir = dirname ( $this->file );
35
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
36
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $this->file ) ) );
37
+		$this->home_url = trailingslashit ( home_url () );
38 38
 		$this->token = 'podcast';
39 39
 		$this->settings_base = 'ss_podcasting_';
40 40
 
41
-		add_action( 'init', array( $this, 'load_settings' ), 11 );
41
+		add_action ( 'init', array( $this, 'load_settings' ), 11 );
42 42
 
43 43
 		// Register podcast settings
44
-		add_action( 'admin_init' , array( $this, 'register_settings' ) );
44
+		add_action ( 'admin_init', array( $this, 'register_settings' ) );
45 45
 
46 46
 		// Add settings page to menu
47
-		add_action( 'admin_menu', array( $this , 'add_menu_item' ) );
47
+		add_action ( 'admin_menu', array( $this, 'add_menu_item' ) );
48 48
 
49 49
 		// Add settings link to plugins page
50
-		add_filter( 'plugin_action_links_' . plugin_basename( $this->file ), array( $this , 'add_plugin_links' ) );
50
+		add_filter ( 'plugin_action_links_'.plugin_basename ( $this->file ), array( $this, 'add_plugin_links' ) );
51 51
 
52 52
 		// Load scripts for settings page
53
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) , 10 );
53
+		add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 );
54 54
 
55 55
 		// Mark date on which feed redirection was activated
56
-		add_action( 'update_option', array( $this, 'mark_feed_redirect_date' ) , 10 , 3 );
56
+		add_action ( 'update_option', array( $this, 'mark_feed_redirect_date' ), 10, 3 );
57 57
 
58 58
 		// New caps for editors and above.
59
-		add_action( 'admin_init', array( $this, 'add_caps' ), 1 );
59
+		add_action ( 'admin_init', array( $this, 'add_caps' ), 1 );
60 60
 
61 61
 	}
62 62
 
63 63
 	public function load_settings() {
64
-		$this->settings = $this->settings_fields();
64
+		$this->settings = $this->settings_fields ();
65 65
 	}
66 66
 
67 67
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @return  void
70 70
 	 */
71 71
 	public function add_menu_item() {
72
-		add_submenu_page( 'edit.php?post_type=podcast' , __( 'Podcast Settings', 'seriously-simple-podcasting' ) , __( 'Settings', 'seriously-simple-podcasting' ), 'manage_podcast' , 'podcast_settings' , array( $this , 'settings_page' ) );
72
+		add_submenu_page ( 'edit.php?post_type=podcast', __ ( 'Podcast Settings', 'seriously-simple-podcasting' ), __ ( 'Settings', 'seriously-simple-podcasting' ), 'manage_podcast', 'podcast_settings', array( $this, 'settings_page' ) );
73 73
 	}
74 74
 
75 75
 	/**
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 
80 80
 		// Roles you'd like to have administer the podcast settings page.
81 81
 		// Admin and Editor, as default.
82
-		$roles = apply_filters( 'ssp_manage_podcast', array( 'administrator', 'editor' ) );
82
+		$roles = apply_filters ( 'ssp_manage_podcast', array( 'administrator', 'editor' ) );
83 83
 
84 84
 		// Loop through each role and assign capabilities
85
-		foreach( $roles as $the_role ) {
85
+		foreach ( $roles as $the_role ) {
86 86
 
87
-			$role = get_role( $the_role );
87
+			$role = get_role ( $the_role );
88 88
 			$caps = array(
89 89
 				'manage_podcast',
90 90
 			);
91 91
 
92 92
 			// Add the caps.
93 93
 			foreach ( $caps as $cap ) {
94
-				$this->maybe_add_cap( $role, $cap );
94
+				$this->maybe_add_cap ( $role, $cap );
95 95
 			}
96 96
 		}
97 97
 	}
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function maybe_add_cap( $role, $cap ) {
107 107
 		// Update the roles, if needed.
108
-		if ( ! $role->has_cap( $cap ) ) {
109
-			$role->add_cap( $cap );
108
+		if ( ! $role->has_cap ( $cap ) ) {
109
+			$role->add_cap ( $cap );
110 110
 		}
111 111
 	}
112 112
 
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 * @return array $links Modified links
117 117
 	 */
118 118
 	public function add_plugin_links( $links ) {
119
-		$settings_link = '<a href="edit.php?post_type=podcast&page=podcast_settings">' . __( 'Settings', 'seriously-simple-podcasting' ) . '</a>';
120
-  		array_push( $links, $settings_link );
119
+		$settings_link = '<a href="edit.php?post_type=podcast&page=podcast_settings">'.__ ( 'Settings', 'seriously-simple-podcasting' ).'</a>';
120
+  		array_push ( $links, $settings_link );
121 121
   		return $links;
122 122
 	}
123 123
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function enqueue_scripts() {
129 129
 		global $pagenow;
130
-		if ( in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) || ( isset( $_GET['page'] ) && 'podcast_settings' == $_GET['page'] ) ) {
131
-			wp_enqueue_media();
130
+		if ( in_array ( $pagenow, array( 'post-new.php', 'post.php' ) ) || ( isset( $_GET[ 'page' ] ) && 'podcast_settings' == $_GET[ 'page' ] ) ) {
131
+			wp_enqueue_media ();
132 132
 		}
133 133
 	}
134 134
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		// Set options for post type selection
145 145
 		foreach ( $wp_post_types as $post_type => $data ) {
146 146
 
147
-			if ( in_array( $post_type, array( 'page', 'attachment', 'revision', 'nav_menu_item', 'wooframework', 'podcast' ) ) ){
147
+			if ( in_array ( $post_type, array( 'page', 'attachment', 'revision', 'nav_menu_item', 'wooframework', 'podcast' ) ) ) {
148 148
 				continue;
149 149
 			}
150 150
 
@@ -153,173 +153,173 @@  discard block
 block discarded – undo
153 153
 
154 154
 		// Set up available category options
155 155
 		$category_options = array(
156
-			'' => __( '-- None --', 'seriously-simple-podcasting' ),
157
-			'Arts' => __( 'Arts', 'seriously-simple-podcasting' ),
158
-			'Business' => __( 'Business', 'seriously-simple-podcasting' ),
159
-			'Comedy' => __( 'Comedy', 'seriously-simple-podcasting' ),
160
-			'Education' => __( 'Education', 'seriously-simple-podcasting' ),
161
-			'Games & Hobbies' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ),
162
-			'Government & Organizations' => __( 'Government & Organizations', 'seriously-simple-podcasting' ),
163
-			'Health' => __( 'Health', 'seriously-simple-podcasting' ),
164
-			'Kids & Family' => __( 'Kids & Family', 'seriously-simple-podcasting' ),
165
-			'Music' => __( 'Music', 'seriously-simple-podcasting' ),
166
-			'News & Politics' => __( 'News & Politics', 'seriously-simple-podcasting' ),
167
-			'Religion & Spirituality' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ),
168
-			'Science & Medicine' => __( 'Science & Medicine', 'seriously-simple-podcasting' ),
169
-			'Society & Culture' => __( 'Society & Culture', 'seriously-simple-podcasting' ),
170
-			'Sports & Recreation' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ),
171
-			'Technology' => __( 'Technology', 'seriously-simple-podcasting' ),
172
-			'TV & Film' => __( 'TV & Film', 'seriously-simple-podcasting' ),
156
+			'' => __ ( '-- None --', 'seriously-simple-podcasting' ),
157
+			'Arts' => __ ( 'Arts', 'seriously-simple-podcasting' ),
158
+			'Business' => __ ( 'Business', 'seriously-simple-podcasting' ),
159
+			'Comedy' => __ ( 'Comedy', 'seriously-simple-podcasting' ),
160
+			'Education' => __ ( 'Education', 'seriously-simple-podcasting' ),
161
+			'Games & Hobbies' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ),
162
+			'Government & Organizations' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ),
163
+			'Health' => __ ( 'Health', 'seriously-simple-podcasting' ),
164
+			'Kids & Family' => __ ( 'Kids & Family', 'seriously-simple-podcasting' ),
165
+			'Music' => __ ( 'Music', 'seriously-simple-podcasting' ),
166
+			'News & Politics' => __ ( 'News & Politics', 'seriously-simple-podcasting' ),
167
+			'Religion & Spirituality' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ),
168
+			'Science & Medicine' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ),
169
+			'Society & Culture' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ),
170
+			'Sports & Recreation' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ),
171
+			'Technology' => __ ( 'Technology', 'seriously-simple-podcasting' ),
172
+			'TV & Film' => __ ( 'TV & Film', 'seriously-simple-podcasting' ),
173 173
 		);
174 174
 
175 175
 		// Set up available sub-category options
176 176
 		$subcategory_options = array(
177 177
 
178
-			'' => __( '-- None --', 'seriously-simple-podcasting' ),
179
-
180
-			'Design' => array( 'label' => __( 'Design', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
181
-			'Fashion & Beauty' => array( 'label' => __( 'Fashion & Beauty', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
182
-			'Food' => array( 'label' => __( 'Food', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
183
-			'Literature' => array( 'label' => __( 'Literature', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
184
-			'Performing Arts' => array( 'label' => __( 'Performing Arts', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
185
-			'Visual Arts' => array( 'label' => __( 'Visual Arts', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
186
-
187
-			'Business News' => array( 'label' => __( 'Business News', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
188
-			'Careers' => array( 'label' => __( 'Careers', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
189
-			'Investing' => array( 'label' => __( 'Investing', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
190
-			'Management & Marketing' => array( 'label' => __( 'Management & Marketing', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
191
-			'Shopping' => array( 'label' => __( 'Shopping', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
192
-
193
-			'Education' => array( 'label' => __( 'Education', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
194
-			'Education Technology' => array( 'label' => __( 'Education Technology', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
195
-			'Higher Education' => array( 'label' => __( 'Higher Education', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
196
-			'K-12' => array( 'label' => __( 'K-12', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
197
-			'Language Courses' => array( 'label' => __( 'Language Courses', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
198
-			'Training' => array( 'label' => __( 'Training', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
199
-
200
-			'Automotive' => array( 'label' => __( 'Automotive', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
201
-			'Aviation' => array( 'label' => __( 'Aviation', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
202
-			'Hobbies' => array( 'label' => __( 'Hobbies', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
203
-			'Other Games' => array( 'label' => __( 'Other Games', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
204
-			'Video Games' => array( 'label' => __( 'Video Games', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
205
-
206
-			'Local' => array( 'label' => __( 'Local', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
207
-			'National' => array( 'label' => __( 'National', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
208
-			'Non-Profit' => array( 'label' => __( 'Non-Profit', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
209
-			'Regional' => array( 'label' => __( 'Regional', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
210
-
211
-			'Alternative Health' => array( 'label' => __( 'Alternative Health', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
212
-			'Fitness & Nutrition' => array( 'label' => __( 'Fitness & Nutrition', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
213
-			'Self-Help' => array( 'label' => __( 'Self-Help', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
214
-			'Sexuality' => array( 'label' => __( 'Sexuality', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
215
-
216
-			'Buddhism' => array( 'label' => __( 'Buddhism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
217
-			'Christianity' => array( 'label' => __( 'Christianity', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
218
-			'Hinduism' => array( 'label' => __( 'Hinduism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
219
-			'Islam' => array( 'label' => __( 'Islam', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
220
-			'Judaism' => array( 'label' => __( 'Judaism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
221
-			'Other' => array( 'label' => __( 'Other', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
222
-			'Spirituality' => array( 'label' => __( 'Spirituality', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
223
-
224
-			'Medicine' => array( 'label' => __( 'Medicine', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
225
-			'Natural Sciences' => array( 'label' => __( 'Natural Sciences', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
226
-			'Social Sciences' => array( 'label' => __( 'Social Sciences', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
227
-
228
-			'History' => array( 'label' => __( 'History', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
229
-			'Personal Journals' => array( 'label' => __( 'Personal Journals', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
230
-			'Philosophy' => array( 'label' => __( 'Philosophy', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
231
-			'Places & Travel' => array( 'label' => __( 'Places & Travel', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
232
-
233
-			'Amateur' => array( 'label' => __( 'Amateur', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
234
-			'College & High School' => array( 'label' => __( 'College & High School', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
235
-			'Outdoor' => array( 'label' => __( 'Outdoor', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
236
-			'Professional' => array( 'label' => __( 'Professional', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
237
-
238
-			'Gadgets' => array( 'label' => __( 'Gadgets', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
239
-			'Tech News' => array( 'label' => __( 'Tech News', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
240
-			'Podcasting' => array( 'label' => __( 'Podcasting', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
241
-			'Software How-To' => array( 'label' => __( 'Software How-To', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
178
+			'' => __ ( '-- None --', 'seriously-simple-podcasting' ),
179
+
180
+			'Design' => array( 'label' => __ ( 'Design', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
181
+			'Fashion & Beauty' => array( 'label' => __ ( 'Fashion & Beauty', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
182
+			'Food' => array( 'label' => __ ( 'Food', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
183
+			'Literature' => array( 'label' => __ ( 'Literature', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
184
+			'Performing Arts' => array( 'label' => __ ( 'Performing Arts', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
185
+			'Visual Arts' => array( 'label' => __ ( 'Visual Arts', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
186
+
187
+			'Business News' => array( 'label' => __ ( 'Business News', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
188
+			'Careers' => array( 'label' => __ ( 'Careers', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
189
+			'Investing' => array( 'label' => __ ( 'Investing', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
190
+			'Management & Marketing' => array( 'label' => __ ( 'Management & Marketing', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
191
+			'Shopping' => array( 'label' => __ ( 'Shopping', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
192
+
193
+			'Education' => array( 'label' => __ ( 'Education', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
194
+			'Education Technology' => array( 'label' => __ ( 'Education Technology', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
195
+			'Higher Education' => array( 'label' => __ ( 'Higher Education', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
196
+			'K-12' => array( 'label' => __ ( 'K-12', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
197
+			'Language Courses' => array( 'label' => __ ( 'Language Courses', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
198
+			'Training' => array( 'label' => __ ( 'Training', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
199
+
200
+			'Automotive' => array( 'label' => __ ( 'Automotive', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
201
+			'Aviation' => array( 'label' => __ ( 'Aviation', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
202
+			'Hobbies' => array( 'label' => __ ( 'Hobbies', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
203
+			'Other Games' => array( 'label' => __ ( 'Other Games', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
204
+			'Video Games' => array( 'label' => __ ( 'Video Games', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
205
+
206
+			'Local' => array( 'label' => __ ( 'Local', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
207
+			'National' => array( 'label' => __ ( 'National', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
208
+			'Non-Profit' => array( 'label' => __ ( 'Non-Profit', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
209
+			'Regional' => array( 'label' => __ ( 'Regional', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
210
+
211
+			'Alternative Health' => array( 'label' => __ ( 'Alternative Health', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
212
+			'Fitness & Nutrition' => array( 'label' => __ ( 'Fitness & Nutrition', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
213
+			'Self-Help' => array( 'label' => __ ( 'Self-Help', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
214
+			'Sexuality' => array( 'label' => __ ( 'Sexuality', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
215
+
216
+			'Buddhism' => array( 'label' => __ ( 'Buddhism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
217
+			'Christianity' => array( 'label' => __ ( 'Christianity', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
218
+			'Hinduism' => array( 'label' => __ ( 'Hinduism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
219
+			'Islam' => array( 'label' => __ ( 'Islam', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
220
+			'Judaism' => array( 'label' => __ ( 'Judaism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
221
+			'Other' => array( 'label' => __ ( 'Other', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
222
+			'Spirituality' => array( 'label' => __ ( 'Spirituality', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
223
+
224
+			'Medicine' => array( 'label' => __ ( 'Medicine', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
225
+			'Natural Sciences' => array( 'label' => __ ( 'Natural Sciences', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
226
+			'Social Sciences' => array( 'label' => __ ( 'Social Sciences', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
227
+
228
+			'History' => array( 'label' => __ ( 'History', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
229
+			'Personal Journals' => array( 'label' => __ ( 'Personal Journals', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
230
+			'Philosophy' => array( 'label' => __ ( 'Philosophy', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
231
+			'Places & Travel' => array( 'label' => __ ( 'Places & Travel', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
232
+
233
+			'Amateur' => array( 'label' => __ ( 'Amateur', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
234
+			'College & High School' => array( 'label' => __ ( 'College & High School', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
235
+			'Outdoor' => array( 'label' => __ ( 'Outdoor', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
236
+			'Professional' => array( 'label' => __ ( 'Professional', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
237
+
238
+			'Gadgets' => array( 'label' => __ ( 'Gadgets', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
239
+			'Tech News' => array( 'label' => __ ( 'Tech News', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
240
+			'Podcasting' => array( 'label' => __ ( 'Podcasting', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
241
+			'Software How-To' => array( 'label' => __ ( 'Software How-To', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
242 242
 
243 243
 		);
244 244
 
245 245
 		$settings = array();
246 246
 
247
-		$settings['general'] = array(
248
-			'title'					=> __( 'General', 'seriously-simple-podcasting' ),
249
-			'description'			=> __( '', 'seriously-simple-podcasting' ),
247
+		$settings[ 'general' ] = array(
248
+			'title'					=> __ ( 'General', 'seriously-simple-podcasting' ),
249
+			'description'			=> __ ( '', 'seriously-simple-podcasting' ),
250 250
 			'fields'				=> array(
251 251
 				array(
252 252
 					'id' 			=> 'use_post_types',
253
-					'label'			=> __( 'Podcast post types', 'seriously-simple-podcasting' ),
254
-					'description'	=> __( 'Use this setting to enable podcast functions on any post type - this will add all podcast posts from the specified types to your podcast feed.', 'seriously-simple-podcasting' ),
253
+					'label'			=> __ ( 'Podcast post types', 'seriously-simple-podcasting' ),
254
+					'description'	=> __ ( 'Use this setting to enable podcast functions on any post type - this will add all podcast posts from the specified types to your podcast feed.', 'seriously-simple-podcasting' ),
255 255
 					'type'			=> 'checkbox_multi',
256 256
 					'options'		=> $post_type_options,
257 257
 					'default'		=> array(),
258 258
 				),
259 259
 				array(
260 260
 					'id' 			=> 'include_in_main_query',
261
-					'label'			=> __( 'Include podcast in main blog', 'seriously-simple-podcasting' ),
262
-					'description'	=> __( 'This setting may behave differently in each theme, so test it carefully after activation - it will add the \'podcast\' post type to your site\'s main query so that your podcast episodes appear on your home page along with your blog posts.', 'seriously-simple-podcasting' ),
261
+					'label'			=> __ ( 'Include podcast in main blog', 'seriously-simple-podcasting' ),
262
+					'description'	=> __ ( 'This setting may behave differently in each theme, so test it carefully after activation - it will add the \'podcast\' post type to your site\'s main query so that your podcast episodes appear on your home page along with your blog posts.', 'seriously-simple-podcasting' ),
263 263
 					'type'			=> 'checkbox',
264 264
 					'default'		=> '',
265 265
 				),
266 266
 				array(
267 267
 					'id' 			=> 'player_locations',
268
-					'label'			=> __( 'Media player locations', 'seriously-simple-podcasting' ),
269
-					'description'	=> __( 'Select where to show the podcast media player along with the episode data (download link, duration and file size)', 'seriously-simple-podcasting' ),
268
+					'label'			=> __ ( 'Media player locations', 'seriously-simple-podcasting' ),
269
+					'description'	=> __ ( 'Select where to show the podcast media player along with the episode data (download link, duration and file size)', 'seriously-simple-podcasting' ),
270 270
 					'type'			=> 'checkbox_multi',
271
-					'options'		=> array( 'content' => __( 'Full content', 'seriously-simple-podcasting' ), 'excerpt' => __( 'Excerpt', 'seriously-simple-podcasting' ),  'excerpt_embed' => __( 'oEmbed Excerpt', 'seriously-simple-podcasting' ) ),
271
+					'options'		=> array( 'content' => __ ( 'Full content', 'seriously-simple-podcasting' ), 'excerpt' => __ ( 'Excerpt', 'seriously-simple-podcasting' ), 'excerpt_embed' => __ ( 'oEmbed Excerpt', 'seriously-simple-podcasting' ) ),
272 272
 					'default'		=> array(),
273 273
 				),
274 274
 				array(
275 275
 					'id' 			=> 'player_content_location',
276
-					'label'			=> __( 'Media player position', 'seriously-simple-podcasting' ),
277
-					'description'	=> __( 'Select whether to display the media player above or below the full post content.', 'seriously-simple-podcasting' ),
276
+					'label'			=> __ ( 'Media player position', 'seriously-simple-podcasting' ),
277
+					'description'	=> __ ( 'Select whether to display the media player above or below the full post content.', 'seriously-simple-podcasting' ),
278 278
 					'type'			=> 'radio',
279
-					'options'		=> array( 'above' => __( 'Above content', 'seriously-simple-podcasting' ), 'below' => __( 'Below content', 'seriously-simple-podcasting' ) ),
279
+					'options'		=> array( 'above' => __ ( 'Above content', 'seriously-simple-podcasting' ), 'below' => __ ( 'Below content', 'seriously-simple-podcasting' ) ),
280 280
 					'default'		=> 'above',
281 281
 				),
282 282
 			),
283 283
 		);
284 284
 
285
-		$settings['feed-details'] = array(
286
-			'title'					=> __( 'Feed details', 'seriously-simple-podcasting' ),
287
-			'description'			=> sprintf( __( 'This data will be used in the feed for your podcast so your listeners will know more about it before they subscribe.%1$sAll of these fields are optional, but it is recommended that you fill in as many of them as possible. Blank fields will use the assigned defaults in the feed.%2$s', 'seriously-simple-podcasting' ), '<br/><em>', '</em>' ),
285
+		$settings[ 'feed-details' ] = array(
286
+			'title'					=> __ ( 'Feed details', 'seriously-simple-podcasting' ),
287
+			'description'			=> sprintf ( __ ( 'This data will be used in the feed for your podcast so your listeners will know more about it before they subscribe.%1$sAll of these fields are optional, but it is recommended that you fill in as many of them as possible. Blank fields will use the assigned defaults in the feed.%2$s', 'seriously-simple-podcasting' ), '<br/><em>', '</em>' ),
288 288
 			'fields'				=> array(
289 289
 				array(
290 290
 					'id' 			=> 'data_title',
291
-					'label'			=> __( 'Title' , 'seriously-simple-podcasting' ),
292
-					'description'	=> __( 'Your podcast title.', 'seriously-simple-podcasting' ),
291
+					'label'			=> __ ( 'Title', 'seriously-simple-podcasting' ),
292
+					'description'	=> __ ( 'Your podcast title.', 'seriously-simple-podcasting' ),
293 293
 					'type'			=> 'text',
294
-					'default'		=> get_bloginfo( 'name' ),
295
-					'placeholder'	=> get_bloginfo( 'name' ),
294
+					'default'		=> get_bloginfo ( 'name' ),
295
+					'placeholder'	=> get_bloginfo ( 'name' ),
296 296
 					'class'			=> 'large-text',
297 297
 					'callback'		=> 'wp_strip_all_tags',
298 298
 				),
299 299
 				array(
300 300
 					'id' 			=> 'data_subtitle',
301
-					'label'			=> __( 'Subtitle' , 'seriously-simple-podcasting' ),
302
-					'description'	=> __( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
301
+					'label'			=> __ ( 'Subtitle', 'seriously-simple-podcasting' ),
302
+					'description'	=> __ ( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
303 303
 					'type'			=> 'text',
304
-					'default'		=> get_bloginfo( 'description' ),
305
-					'placeholder'	=> get_bloginfo( 'description' ),
304
+					'default'		=> get_bloginfo ( 'description' ),
305
+					'placeholder'	=> get_bloginfo ( 'description' ),
306 306
 					'class'			=> 'large-text',
307 307
 					'callback'		=> 'wp_strip_all_tags',
308 308
 				),
309 309
 				array(
310 310
 					'id' 			=> 'data_author',
311
-					'label'			=> __( 'Author' , 'seriously-simple-podcasting' ),
312
-					'description'	=> __( 'Your podcast author.', 'seriously-simple-podcasting' ),
311
+					'label'			=> __ ( 'Author', 'seriously-simple-podcasting' ),
312
+					'description'	=> __ ( 'Your podcast author.', 'seriously-simple-podcasting' ),
313 313
 					'type'			=> 'text',
314
-					'default'		=> get_bloginfo( 'name' ),
315
-					'placeholder'	=> get_bloginfo( 'name' ),
314
+					'default'		=> get_bloginfo ( 'name' ),
315
+					'placeholder'	=> get_bloginfo ( 'name' ),
316 316
 					'class'			=> 'large-text',
317 317
 					'callback'		=> 'wp_strip_all_tags',
318 318
 				),
319 319
 				array(
320 320
 					'id' 			=> 'data_category',
321
-					'label'			=> __( 'Primary Category' , 'seriously-simple-podcasting' ),
322
-					'description'	=> __( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
321
+					'label'			=> __ ( 'Primary Category', 'seriously-simple-podcasting' ),
322
+					'description'	=> __ ( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
323 323
 					'type'			=> 'select',
324 324
 					'options'		=> $category_options,
325 325
 					'default'		=> '',
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 				),
328 328
 				array(
329 329
 					'id' 			=> 'data_subcategory',
330
-					'label'			=> __( 'Primary Sub-Category' , 'seriously-simple-podcasting' ),
331
-					'description'	=> __( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
330
+					'label'			=> __ ( 'Primary Sub-Category', 'seriously-simple-podcasting' ),
331
+					'description'	=> __ ( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
332 332
 					'type'			=> 'select',
333 333
 					'options'		=> $subcategory_options,
334 334
 					'default'		=> '',
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 				),
337 337
 				array(
338 338
 					'id' 			=> 'data_category2',
339
-					'label'			=> __( 'Secondary Category' , 'seriously-simple-podcasting' ),
340
-					'description'	=> __( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
339
+					'label'			=> __ ( 'Secondary Category', 'seriously-simple-podcasting' ),
340
+					'description'	=> __ ( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
341 341
 					'type'			=> 'select',
342 342
 					'options'		=> $category_options,
343 343
 					'default'		=> '',
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
 				),
346 346
 				array(
347 347
 					'id' 			=> 'data_subcategory2',
348
-					'label'			=> __( 'Secondary Sub-Category' , 'seriously-simple-podcasting' ),
349
-					'description'	=> __( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
348
+					'label'			=> __ ( 'Secondary Sub-Category', 'seriously-simple-podcasting' ),
349
+					'description'	=> __ ( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
350 350
 					'type'			=> 'select',
351 351
 					'options'		=> $subcategory_options,
352 352
 					'default'		=> '',
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 				),
355 355
 				array(
356 356
 					'id' 			=> 'data_category3',
357
-					'label'			=> __( 'Tertiary Category' , 'seriously-simple-podcasting' ),
358
-					'description'	=> __( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
357
+					'label'			=> __ ( 'Tertiary Category', 'seriously-simple-podcasting' ),
358
+					'description'	=> __ ( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
359 359
 					'type'			=> 'select',
360 360
 					'options'		=> $category_options,
361 361
 					'default'		=> '',
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
 				),
364 364
 				array(
365 365
 					'id' 			=> 'data_subcategory3',
366
-					'label'			=> __( 'Tertiary Sub-Category' , 'seriously-simple-podcasting' ),
367
-					'description'	=> __( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
366
+					'label'			=> __ ( 'Tertiary Sub-Category', 'seriously-simple-podcasting' ),
367
+					'description'	=> __ ( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
368 368
 					'type'			=> 'select',
369 369
 					'options'		=> $subcategory_options,
370 370
 					'default'		=> '',
@@ -372,18 +372,18 @@  discard block
 block discarded – undo
372 372
 				),
373 373
 				array(
374 374
 					'id' 			=> 'data_description',
375
-					'label'			=> __( 'Description/Summary' , 'seriously-simple-podcasting' ),
376
-					'description'	=> __( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
375
+					'label'			=> __ ( 'Description/Summary', 'seriously-simple-podcasting' ),
376
+					'description'	=> __ ( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
377 377
 					'type'			=> 'textarea',
378
-					'default'		=> get_bloginfo( 'description' ),
379
-					'placeholder'	=> get_bloginfo( 'description' ),
378
+					'default'		=> get_bloginfo ( 'description' ),
379
+					'placeholder'	=> get_bloginfo ( 'description' ),
380 380
 					'callback'		=> 'wp_strip_all_tags',
381 381
 					'class'			=> 'large-text',
382 382
 				),
383 383
 				array(
384 384
 					'id' 			=> 'data_image',
385
-					'label'			=> __( 'Cover Image' , 'seriously-simple-podcasting' ),
386
-					'description'	=> __( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
385
+					'label'			=> __ ( 'Cover Image', 'seriously-simple-podcasting' ),
386
+					'description'	=> __ ( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
387 387
 					'type'			=> 'image',
388 388
 					'default'		=> '',
389 389
 					'placeholder'	=> '',
@@ -391,182 +391,182 @@  discard block
 block discarded – undo
391 391
 				),
392 392
 				array(
393 393
 					'id' 			=> 'data_owner_name',
394
-					'label'			=> __( 'Owner name' , 'seriously-simple-podcasting' ),
395
-					'description'	=> __( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
394
+					'label'			=> __ ( 'Owner name', 'seriously-simple-podcasting' ),
395
+					'description'	=> __ ( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
396 396
 					'type'			=> 'text',
397
-					'default'		=> get_bloginfo( 'name' ),
398
-					'placeholder'	=> get_bloginfo( 'name' ),
397
+					'default'		=> get_bloginfo ( 'name' ),
398
+					'placeholder'	=> get_bloginfo ( 'name' ),
399 399
 					'class'			=> 'large-text',
400 400
 					'callback'		=> 'wp_strip_all_tags',
401 401
 				),
402 402
 				array(
403 403
 					'id' 			=> 'data_owner_email',
404
-					'label'			=> __( 'Owner email address' , 'seriously-simple-podcasting' ),
405
-					'description'	=> __( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
404
+					'label'			=> __ ( 'Owner email address', 'seriously-simple-podcasting' ),
405
+					'description'	=> __ ( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
406 406
 					'type'			=> 'text',
407
-					'default'		=> get_bloginfo( 'admin_email' ),
408
-					'placeholder'	=> get_bloginfo( 'admin_email' ),
407
+					'default'		=> get_bloginfo ( 'admin_email' ),
408
+					'placeholder'	=> get_bloginfo ( 'admin_email' ),
409 409
 					'class'			=> 'large-text',
410 410
 					'callback'		=> 'wp_strip_all_tags',
411 411
 				),
412 412
 				array(
413 413
 					'id' 			=> 'data_language',
414
-					'label'			=> __( 'Language' , 'seriously-simple-podcasting' ),
415
-					'description'	=> sprintf( __( 'Your podcast\'s language in %1$sISO-639-1 format%2$s.', 'seriously-simple-podcasting' ), '<a href="' . esc_url( 'http://www.loc.gov/standards/iso639-2/php/code_list.php' ) . '" target="' . wp_strip_all_tags( '_blank' ) . '">', '</a>' ),
414
+					'label'			=> __ ( 'Language', 'seriously-simple-podcasting' ),
415
+					'description'	=> sprintf ( __ ( 'Your podcast\'s language in %1$sISO-639-1 format%2$s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( 'http://www.loc.gov/standards/iso639-2/php/code_list.php' ).'" target="'.wp_strip_all_tags ( '_blank' ).'">', '</a>' ),
416 416
 					'type'			=> 'text',
417
-					'default'		=> get_bloginfo( 'language' ),
418
-					'placeholder'	=> get_bloginfo( 'language' ),
417
+					'default'		=> get_bloginfo ( 'language' ),
418
+					'placeholder'	=> get_bloginfo ( 'language' ),
419 419
 					'class'			=> 'all-options',
420 420
 					'callback'		=> 'wp_strip_all_tags',
421 421
 				),
422 422
 				array(
423 423
 					'id' 			=> 'data_copyright',
424
-					'label'			=> __( 'Copyright' , 'seriously-simple-podcasting' ),
425
-					'description'	=> __( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
424
+					'label'			=> __ ( 'Copyright', 'seriously-simple-podcasting' ),
425
+					'description'	=> __ ( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
426 426
 					'type'			=> 'text',
427
-					'default'		=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
428
-					'placeholder'	=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
427
+					'default'		=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
428
+					'placeholder'	=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
429 429
 					'class'			=> 'large-text',
430 430
 					'callback'		=> 'wp_strip_all_tags',
431 431
 				),
432 432
 				array(
433 433
 					'id' 			=> 'explicit',
434
-					'label'			=> __( 'Explicit', 'seriously-simple-podcasting' ),
435
-					'description'	=> __( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
434
+					'label'			=> __ ( 'Explicit', 'seriously-simple-podcasting' ),
435
+					'description'	=> __ ( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
436 436
 					'type'			=> 'checkbox',
437 437
 					'default'		=> '',
438 438
 					'callback'		=> 'wp_strip_all_tags',
439 439
 				),
440 440
 				array(
441 441
 					'id' 			=> 'complete',
442
-					'label'			=> __( 'Complete', 'seriously-simple-podcasting' ),
443
-					'description'	=> __( 'Mark if this podcast is complete or not. Only do this if no more episodes are going to be added to this feed.', 'seriously-simple-podcasting' ),
442
+					'label'			=> __ ( 'Complete', 'seriously-simple-podcasting' ),
443
+					'description'	=> __ ( 'Mark if this podcast is complete or not. Only do this if no more episodes are going to be added to this feed.', 'seriously-simple-podcasting' ),
444 444
 					'type'			=> 'checkbox',
445 445
 					'default'		=> '',
446 446
 					'callback'		=> 'wp_strip_all_tags',
447 447
 				),
448 448
 				array(
449 449
 					'id' 			=> 'redirect_feed',
450
-					'label'			=> __( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
451
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ) , '<br/>' ),
450
+					'label'			=> __ ( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
451
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ), '<br/>' ),
452 452
 					'type'			=> 'checkbox',
453 453
 					'default'		=> '',
454 454
 					'callback'		=> 'wp_strip_all_tags',
455 455
 				),
456 456
 				array(
457 457
 					'id' 			=> 'new_feed_url',
458
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
459
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
458
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
459
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
460 460
 					'type'			=> 'text',
461 461
 					'default'		=> '',
462
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
462
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
463 463
 					'callback'		=> 'esc_url_raw',
464 464
 					'class'			=> 'regular-text',
465 465
 				),
466 466
 			)
467 467
 		);
468 468
 
469
-		$settings['security'] = array(
470
-			'title'					=> __( 'Security', 'seriously-simple-podcasting' ),
471
-			'description'			=> __( 'Change these settings to ensure that your podcast feed remains private. This will block feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
469
+		$settings[ 'security' ] = array(
470
+			'title'					=> __ ( 'Security', 'seriously-simple-podcasting' ),
471
+			'description'			=> __ ( 'Change these settings to ensure that your podcast feed remains private. This will block feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
472 472
 			'fields'				=> array(
473 473
 				array(
474 474
 					'id' 			=> 'protect',
475
-					'label'			=> __( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
476
-					'description'	=> __( 'Mark if you would like to password protect your podcast feed - you can set the username and password below. This will block all feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
475
+					'label'			=> __ ( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
476
+					'description'	=> __ ( 'Mark if you would like to password protect your podcast feed - you can set the username and password below. This will block all feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
477 477
 					'type'			=> 'checkbox',
478 478
 					'default'		=> '',
479 479
 					'callback'		=> 'wp_strip_all_tags',
480 480
 				),
481 481
 				array(
482 482
 					'id' 			=> 'protection_username',
483
-					'label'			=> __( 'Username' , 'seriously-simple-podcasting' ),
484
-					'description'	=> __( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
483
+					'label'			=> __ ( 'Username', 'seriously-simple-podcasting' ),
484
+					'description'	=> __ ( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
485 485
 					'type'			=> 'text',
486 486
 					'default'		=> '',
487
-					'placeholder'	=> __( 'Feed username', 'seriously-simple-podcasting' ),
487
+					'placeholder'	=> __ ( 'Feed username', 'seriously-simple-podcasting' ),
488 488
 					'class'			=> 'regular-text',
489 489
 					'callback'		=> 'wp_strip_all_tags',
490 490
 				),
491 491
 				array(
492 492
 					'id' 			=> 'protection_password',
493
-					'label'			=> __( 'Password' , 'seriously-simple-podcasting' ),
494
-					'description'	=> __( 'Password for your podcast feed. Once saved, the password is encoded and secured so it will not be visible on this page again.', 'seriously-simple-podcasting' ),
493
+					'label'			=> __ ( 'Password', 'seriously-simple-podcasting' ),
494
+					'description'	=> __ ( 'Password for your podcast feed. Once saved, the password is encoded and secured so it will not be visible on this page again.', 'seriously-simple-podcasting' ),
495 495
 					'type'			=> 'text_secret',
496 496
 					'default'		=> '',
497
-					'placeholder'	=> __( 'Feed password', 'seriously-simple-podcasting' ),
497
+					'placeholder'	=> __ ( 'Feed password', 'seriously-simple-podcasting' ),
498 498
 					'callback'		=> array( $this, 'encode_password' ),
499 499
 					'class'			=> 'regular-text',
500 500
 				),
501 501
 				array(
502 502
 					'id' 			=> 'protection_no_access_message',
503
-					'label'			=> __( 'No access message' , 'seriously-simple-podcasting' ),
504
-					'description'	=> __( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
503
+					'label'			=> __ ( 'No access message', 'seriously-simple-podcasting' ),
504
+					'description'	=> __ ( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
505 505
 					'type'			=> 'textarea',
506
-					'default'		=> __( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
507
-					'placeholder'	=> __( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
506
+					'default'		=> __ ( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
507
+					'placeholder'	=> __ ( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
508 508
 					'callback'		=> array( $this, 'validate_message' ),
509 509
 					'class'			=> 'large-text',
510 510
 				),
511 511
 			)
512 512
 		);
513 513
 
514
-		$settings['redirection'] = array(
515
-			'title'					=> __( 'Redirection', 'seriously-simple-podcasting' ),
516
-			'description'			=> __( 'Use these settings to safely move your podcast to a different location. Only do this once your new podcast is setup and active.', 'seriously-simple-podcasting' ),
514
+		$settings[ 'redirection' ] = array(
515
+			'title'					=> __ ( 'Redirection', 'seriously-simple-podcasting' ),
516
+			'description'			=> __ ( 'Use these settings to safely move your podcast to a different location. Only do this once your new podcast is setup and active.', 'seriously-simple-podcasting' ),
517 517
 			'fields'				=> array(
518 518
 				array(
519 519
 					'id' 			=> 'redirect_feed',
520
-					'label'			=> __( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
521
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).%1$sThis will inform all podcasting services that your podcast has moved and 48 hours after you have saved this option it will permanently redirect your feed to the new URL.', 'seriously-simple-podcasting' ) , '<br/>' ),
520
+					'label'			=> __ ( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
521
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).%1$sThis will inform all podcasting services that your podcast has moved and 48 hours after you have saved this option it will permanently redirect your feed to the new URL.', 'seriously-simple-podcasting' ), '<br/>' ),
522 522
 					'type'			=> 'checkbox',
523 523
 					'default'		=> '',
524 524
 					'callback'		=> 'wp_strip_all_tags',
525 525
 				),
526 526
 				array(
527 527
 					'id' 			=> 'new_feed_url',
528
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
529
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
528
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
529
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
530 530
 					'type'			=> 'text',
531 531
 					'default'		=> '',
532
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
532
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
533 533
 					'callback'		=> 'esc_url_raw',
534 534
 					'class'			=> 'regular-text',
535 535
 				),
536 536
 			)
537 537
 		);
538 538
 
539
-		$settings['publishing'] = array(
540
-			'title'					=> __( 'Publishing' , 'seriously-simple-podcasting' ),
541
-			'description'			=> __( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).' , 'seriously-simple-podcasting' ),
539
+		$settings[ 'publishing' ] = array(
540
+			'title'					=> __ ( 'Publishing', 'seriously-simple-podcasting' ),
541
+			'description'			=> __ ( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).', 'seriously-simple-podcasting' ),
542 542
 			'fields'				=> array(
543 543
 				array(
544 544
 					'id' 			=> 'feed_url',
545
-					'label'			=> __( 'External feed URL', 'seriously-simple-podcasting' ),
546
-					'description'	=> __( 'If you are syndicating your podcast using a third-party service (like Feedburner) you can insert the URL here, otherwise this must be left blank.' , 'seriously-simple-podcasting' ),
545
+					'label'			=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
546
+					'description'	=> __ ( 'If you are syndicating your podcast using a third-party service (like Feedburner) you can insert the URL here, otherwise this must be left blank.', 'seriously-simple-podcasting' ),
547 547
 					'type'			=> 'text',
548 548
 					'default'		=> '',
549
-					'placeholder'	=> __( 'External feed URL', 'seriously-simple-podcasting' ),
549
+					'placeholder'	=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
550 550
 					'callback'		=> 'esc_url_raw',
551 551
 					'class'			=> 'regular-text',
552 552
 				),
553 553
 				array(
554 554
 					'id' 			=> 'feed_link',
555
-					'label'			=> __( 'Complete feed', 'seriously-simple-podcasting' ),
555
+					'label'			=> __ ( 'Complete feed', 'seriously-simple-podcasting' ),
556 556
 					'description'	=> '',
557 557
 					'type'			=> 'feed_link',
558 558
 					'callback'		=> 'esc_url_raw',
559 559
 				),
560 560
 				array(
561 561
 					'id' 			=> 'feed_link_series',
562
-					'label'			=> __( 'Feed for a specific series', 'seriously-simple-podcasting' ),
562
+					'label'			=> __ ( 'Feed for a specific series', 'seriously-simple-podcasting' ),
563 563
 					'description'	=> '',
564 564
 					'type'			=> 'feed_link_series',
565 565
 					'callback'		=> 'esc_url_raw',
566 566
 				),
567 567
 				array(
568 568
 					'id' 			=> 'podcast_url',
569
-					'label'			=> __( 'Podcast page', 'seriously-simple-podcasting' ),
569
+					'label'			=> __ ( 'Podcast page', 'seriously-simple-podcasting' ),
570 570
 					'description'	=> '',
571 571
 					'type'			=> 'podcast_url',
572 572
 					'callback'		=> 'esc_url_raw',
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 			)
575 575
 		);
576 576
 
577
-		$settings = apply_filters( 'ssp_settings_fields', $settings );
577
+		$settings = apply_filters ( 'ssp_settings_fields', $settings );
578 578
 
579 579
 		return $settings;
580 580
 	}
@@ -584,15 +584,15 @@  discard block
 block discarded – undo
584 584
 	 * @return void
585 585
 	 */
586 586
 	public function register_settings() {
587
-		if ( is_array( $this->settings ) ) {
587
+		if ( is_array ( $this->settings ) ) {
588 588
 
589 589
 			// Check posted/selected tab
590 590
 			$current_section = 'general';
591
-			if ( isset( $_POST['tab'] ) && $_POST['tab'] ) {
592
-				$current_section = $_POST['tab'];
591
+			if ( isset( $_POST[ 'tab' ] ) && $_POST[ 'tab' ] ) {
592
+				$current_section = $_POST[ 'tab' ];
593 593
 			} else {
594
-				if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
595
-					$current_section = $_GET['tab'];
594
+				if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
595
+					$current_section = $_GET[ 'tab' ];
596 596
 				}
597 597
 			}
598 598
 
@@ -607,81 +607,81 @@  discard block
 block discarded – undo
607 607
 				$series_id = 0;
608 608
 				if ( 'feed-details' == $section ) {
609 609
 
610
-					if ( isset( $_REQUEST['feed-series'] ) && $_REQUEST['feed-series'] && 'default' != $_REQUEST['feed-series'] ) {
610
+					if ( isset( $_REQUEST[ 'feed-series' ] ) && $_REQUEST[ 'feed-series' ] && 'default' != $_REQUEST[ 'feed-series' ] ) {
611 611
 
612 612
 						// Get selected series
613
-						$series = get_term_by( 'slug', esc_attr( $_REQUEST['feed-series'] ), 'series' );
613
+						$series = get_term_by ( 'slug', esc_attr ( $_REQUEST[ 'feed-series' ] ), 'series' );
614 614
 
615 615
 						// Store series ID for later use
616 616
 						$series_id = $series->term_id;
617 617
 
618 618
 						// Append series name to section title
619 619
 						if ( $series ) {
620
-							$title_tail = ': ' . $series->name;
620
+							$title_tail = ': '.$series->name;
621 621
 						}
622 622
 					}
623 623
 				}
624 624
 
625
-				$section_title = $data['title'] . $title_tail;
625
+				$section_title = $data[ 'title' ].$title_tail;
626 626
 
627 627
 				// Add section to page
628
-				add_settings_section( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
628
+				add_settings_section ( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
629 629
 
630
-				foreach ( $data['fields'] as $field ) {
630
+				foreach ( $data[ 'fields' ] as $field ) {
631 631
 
632 632
 					// Validation callback for field
633 633
 					$validation = '';
634
-					if ( isset( $field['callback'] ) ) {
635
-						$validation = $field['callback'];
634
+					if ( isset( $field[ 'callback' ] ) ) {
635
+						$validation = $field[ 'callback' ];
636 636
 					}
637 637
 
638 638
 					// Get field option name
639
-					$option_name = $this->settings_base . $field['id'];
639
+					$option_name = $this->settings_base.$field[ 'id' ];
640 640
 
641 641
 					// Append series ID if selected
642 642
 					if ( $series_id ) {
643
-						$option_name .= '_' . $series_id;
643
+						$option_name .= '_'.$series_id;
644 644
 					}
645 645
 
646 646
 					// Register setting
647
-					register_setting( 'ss_podcasting', $option_name, $validation );
647
+					register_setting ( 'ss_podcasting', $option_name, $validation );
648 648
 
649 649
 					// Add field to page
650
-					add_settings_field( $field['id'], $field['label'], array( $this, 'display_field' ), 'ss_podcasting', $section, array( 'field' => $field, 'prefix' => $this->settings_base, 'feed-series' => $series_id ) );
650
+					add_settings_field ( $field[ 'id' ], $field[ 'label' ], array( $this, 'display_field' ), 'ss_podcasting', $section, array( 'field' => $field, 'prefix' => $this->settings_base, 'feed-series' => $series_id ) );
651 651
 				}
652 652
 			}
653 653
 		}
654 654
 	}
655 655
 
656 656
 	public function settings_section( $section ) {
657
-		$html = '<p>' . $this->settings[ $section['id'] ]['description'] . '</p>' . "\n";
657
+		$html = '<p>'.$this->settings[ $section[ 'id' ] ][ 'description' ].'</p>'."\n";
658 658
 
659
-		if( 'feed-details' == $section['id'] ) {
659
+		if ( 'feed-details' == $section[ 'id' ] ) {
660 660
 
661 661
 			$feed_series = 'default';
662
-			if( isset( $_GET['feed-series'] ) ) {
663
-				$feed_series = esc_attr( $_GET['feed-series'] );
662
+			if ( isset( $_GET[ 'feed-series' ] ) ) {
663
+				$feed_series = esc_attr ( $_GET[ 'feed-series' ] );
664 664
 			}
665 665
 
666
-			$permalink_structure = get_option( 'permalink_structure' );
666
+			$permalink_structure = get_option ( 'permalink_structure' );
667 667
 
668 668
 			if ( $permalink_structure ) {
669
-				$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
670
-				$feed_url = $this->home_url . 'feed/' . $feed_slug;
669
+				$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
670
+				$feed_url = $this->home_url.'feed/'.$feed_slug;
671 671
 			} else {
672
-				$feed_url = $this->home_url . '?feed=' . $this->token;
672
+				$feed_url = $this->home_url.'?feed='.$this->token;
673 673
 			}
674 674
 
675
-			if( $feed_series && $feed_series != 'default' ) {
675
+			if ( $feed_series && $feed_series != 'default' ) {
676 676
 				if ( $permalink_structure ) {
677
-					$feed_url .= '/' . $feed_series;
677
+					$feed_url .= '/'.$feed_series;
678 678
 				} else {
679
-					$feed_url .= '&podcast_series=' . $feed_series;
679
+					$feed_url .= '&podcast_series='.$feed_series;
680 680
 				}
681 681
 			}
682 682
 
683
-			if( $feed_url ) {
684
-				$html .= '<p><a class="view-feed-link" href="' . esc_url( $feed_url ) . '" target="_blank"><span class="dashicons dashicons-rss"></span>' . __( 'View feed', 'seriously-simple-podcasting' ) . '</a></p>' . "\n";
683
+			if ( $feed_url ) {
684
+				$html .= '<p><a class="view-feed-link" href="'.esc_url ( $feed_url ).'" target="_blank"><span class="dashicons dashicons-rss"></span>'.__ ( 'View feed', 'seriously-simple-podcasting' ).'</a></p>'."\n";
685 685
 			}
686 686
 
687 687
 		}
@@ -696,116 +696,116 @@  discard block
 block discarded – undo
696 696
 	 */
697 697
 	public function display_field( $args ) {
698 698
 
699
-		$field = $args['field'];
699
+		$field = $args[ 'field' ];
700 700
 
701 701
 		$html = '';
702 702
 
703 703
 		// Get option name
704
-		$option_name = $this->settings_base . $field['id'];
704
+		$option_name = $this->settings_base.$field[ 'id' ];
705 705
 		$default_option_name = $option_name;
706 706
 
707 707
 		// Get field default
708 708
 		$default = '';
709
-		if ( isset( $field['default'] ) ) {
710
-			$default = $field['default'];
709
+		if ( isset( $field[ 'default' ] ) ) {
710
+			$default = $field[ 'default' ];
711 711
 		}
712 712
 
713 713
 		// Get option value
714
-		$data = get_option( $option_name, $default );
714
+		$data = get_option ( $option_name, $default );
715 715
 
716 716
 		// Get specific series data if applicable
717
-		if ( isset( $args['feed-series'] ) && $args['feed-series'] ) {
717
+		if ( isset( $args[ 'feed-series' ] ) && $args[ 'feed-series' ] ) {
718 718
 
719 719
 			$option_default = '';
720 720
 
721 721
 			// Set placeholder to default feed option with specified default fallback
722 722
 			if ( $data ) {
723
-				$field['placeholder'] = $data;
723
+				$field[ 'placeholder' ] = $data;
724 724
 
725
-				if ( in_array( $field['type'], array( 'checkbox', 'select', 'image' ) ) ) {
725
+				if ( in_array ( $field[ 'type' ], array( 'checkbox', 'select', 'image' ) ) ) {
726 726
 					$option_default = $data;
727 727
 				}
728 728
 			}
729 729
 
730 730
 			// Append series ID to option name
731
-			$option_name .= '_' . $args['feed-series'];
731
+			$option_name .= '_'.$args[ 'feed-series' ];
732 732
 
733 733
 			// Get series-sepcific option
734
-			$data = get_option( $option_name, $option_default );
734
+			$data = get_option ( $option_name, $option_default );
735 735
 
736 736
 		}
737 737
 
738 738
 		// Get field class if supplied
739 739
 		$class = '';
740
-		if ( isset( $field['class'] ) ) {
741
-			$class = $field['class'];
740
+		if ( isset( $field[ 'class' ] ) ) {
741
+			$class = $field[ 'class' ];
742 742
 		}
743 743
 
744 744
 		// Get parent class if supplied
745 745
 		$parent_class = '';
746
-		if ( isset( $field['parent_class'] ) ) {
747
-			$parent_class = $field['parent_class'];
746
+		if ( isset( $field[ 'parent_class' ] ) ) {
747
+			$parent_class = $field[ 'parent_class' ];
748 748
 		}
749 749
 
750
-		switch( $field['type'] ) {
750
+		switch ( $field[ 'type' ] ) {
751 751
 			case 'text':
752 752
 			case 'password':
753 753
 			case 'number':
754
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" value="' . esc_attr( $data ) . '" class="' . $class . '"/>' . "\n";
754
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $field[ 'placeholder' ] ).'" value="'.esc_attr ( $data ).'" class="'.$class.'"/>'."\n";
755 755
 			break;
756 756
 
757 757
 			case 'text_secret':
758
-				$placeholder = $field['placeholder'];
758
+				$placeholder = $field[ 'placeholder' ];
759 759
 				if ( $data ) {
760
-					$placeholder = __( 'Password stored securely', 'seriously-simple-podcasting' );
760
+					$placeholder = __ ( 'Password stored securely', 'seriously-simple-podcasting' );
761 761
 				}
762
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="text" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $placeholder ) . '" value="" class="' . $class . '"/>' . "\n";
762
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="text" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $placeholder ).'" value="" class="'.$class.'"/>'."\n";
763 763
 			break;
764 764
 
765 765
 			case 'textarea':
766
-				$html .= '<textarea id="' . esc_attr( $field['id'] ) . '" rows="5" cols="50" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" class="' . $class . '">' . $data . '</textarea><br/>'. "\n";
766
+				$html .= '<textarea id="'.esc_attr ( $field[ 'id' ] ).'" rows="5" cols="50" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $field[ 'placeholder' ] ).'" class="'.$class.'">'.$data.'</textarea><br/>'."\n";
767 767
 			break;
768 768
 
769 769
 			case 'checkbox':
770 770
 				$checked = '';
771
-				if ( $data && 'on' == $data ){
771
+				if ( $data && 'on' == $data ) {
772 772
 					$checked = 'checked="checked"';
773 773
 				}
774
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" ' . $checked . ' class="' . $class . '"/>' . "\n";
774
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" '.$checked.' class="'.$class.'"/>'."\n";
775 775
 			break;
776 776
 
777 777
 			case 'checkbox_multi':
778
-				foreach ( $field['options'] as $k => $v ) {
778
+				foreach ( $field[ 'options' ] as $k => $v ) {
779 779
 					$checked = false;
780
-					if ( in_array( $k, (array) $data ) ) {
780
+					if ( in_array ( $k, (array) $data ) ) {
781 781
 						$checked = true;
782 782
 					}
783
-					$html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"><input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '[]" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" class="' . $class . '" /> ' . $v . '</label><br/>';
783
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ].'_'.$k ).'"><input type="checkbox" '.checked ( $checked, true, false ).' name="'.esc_attr ( $option_name ).'[]" value="'.esc_attr ( $k ).'" id="'.esc_attr ( $field[ 'id' ].'_'.$k ).'" class="'.$class.'" /> '.$v.'</label><br/>';
784 784
 				}
785 785
 			break;
786 786
 
787 787
 			case 'radio':
788
-				foreach ( $field['options'] as $k => $v ) {
788
+				foreach ( $field[ 'options' ] as $k => $v ) {
789 789
 					$checked = false;
790 790
 					if ( $k == $data ) {
791 791
 						$checked = true;
792 792
 					}
793
-					$html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"><input type="radio" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" class="' . $class . '" /> ' . $v . '</label><br/>';
793
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ].'_'.$k ).'"><input type="radio" '.checked ( $checked, true, false ).' name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $k ).'" id="'.esc_attr ( $field[ 'id' ].'_'.$k ).'" class="'.$class.'" /> '.$v.'</label><br/>';
794 794
 				}
795 795
 			break;
796 796
 
797 797
 			case 'select':
798 798
 
799
-				$html .= '<select name="' . esc_attr( $option_name ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . $class . '">';
799
+				$html .= '<select name="'.esc_attr ( $option_name ).'" id="'.esc_attr ( $field[ 'id' ] ).'" class="'.$class.'">';
800 800
 				$prev_group = '';
801
-				foreach ( $field['options'] as $k => $v ) {
801
+				foreach ( $field[ 'options' ] as $k => $v ) {
802 802
 
803 803
 					$group = '';
804
-					if ( is_array( $v ) ) {
805
-						if ( isset( $v['group'] ) ) {
806
-							$group = $v['group'];
804
+					if ( is_array ( $v ) ) {
805
+						if ( isset( $v[ 'group' ] ) ) {
806
+							$group = $v[ 'group' ];
807 807
 						}
808
-						$v = $v['label'];
808
+						$v = $v[ 'label' ];
809 809
 					}
810 810
 
811 811
 					if ( $prev_group && $group != $prev_group ) {
@@ -818,10 +818,10 @@  discard block
 block discarded – undo
818 818
 					}
819 819
 
820 820
 					if ( $group && $group != $prev_group ) {
821
-						$html .= '<optgroup label="' . esc_attr( $group ) . '">';
821
+						$html .= '<optgroup label="'.esc_attr ( $group ).'">';
822 822
 					}
823 823
 
824
-					$html .= '<option ' . selected( $selected, true, false ) . ' value="' . esc_attr( $k ) . '">' . esc_html( $v ) . '</option>';
824
+					$html .= '<option '.selected ( $selected, true, false ).' value="'.esc_attr ( $k ).'">'.esc_html ( $v ).'</option>';
825 825
 
826 826
 					$prev_group = $group;
827 827
 				}
@@ -829,65 +829,65 @@  discard block
 block discarded – undo
829 829
 			break;
830 830
 
831 831
 			case 'image':
832
-				$html .= '<img id="' . esc_attr( $default_option_name ) . '_preview" src="' . esc_attr( $data ) . '" style="max-width:400px;height:auto;" /><br/>' . "\n";
833
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_button" type="button" class="button" value="'. __( 'Upload new image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
834
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_delete" type="button" class="button" value="'. __( 'Remove image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
835
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '" type="hidden" name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $data ) . '"/><br/>' . "\n";
832
+				$html .= '<img id="'.esc_attr ( $default_option_name ).'_preview" src="'.esc_attr ( $data ).'" style="max-width:400px;height:auto;" /><br/>'."\n";
833
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_button" type="button" class="button" value="'.__ ( 'Upload new image', 'seriously-simple-podcasting' ).'" />'."\n";
834
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_delete" type="button" class="button" value="'.__ ( 'Remove image', 'seriously-simple-podcasting' ).'" />'."\n";
835
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'" type="hidden" name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $data ).'"/><br/>'."\n";
836 836
 			break;
837 837
 
838 838
 			case 'feed_link':
839 839
 
840 840
 				// Set feed URL based on site's permalink structure
841
-				if ( get_option( 'permalink_structure' ) ) {
842
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
843
-					$url = $this->home_url . 'feed/' . $feed_slug;
841
+				if ( get_option ( 'permalink_structure' ) ) {
842
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
843
+					$url = $this->home_url.'feed/'.$feed_slug;
844 844
 				} else {
845
-					$url = $this->home_url . '?feed=' . $this->token;
845
+					$url = $this->home_url.'?feed='.$this->token;
846 846
 				}
847 847
 
848
-				$html .= '<a href="' . esc_url( $url ) . '" target="_blank">' . $url . '</a>';
848
+				$html .= '<a href="'.esc_url ( $url ).'" target="_blank">'.$url.'</a>';
849 849
 			break;
850 850
 
851 851
 			case 'feed_link_series':
852 852
 
853 853
 				// Set feed URL based on site's permalink structure
854
-				if ( get_option( 'permalink_structure' ) ) {
855
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
856
-					$url = $this->home_url . 'feed/' . $feed_slug . '/series-slug';
854
+				if ( get_option ( 'permalink_structure' ) ) {
855
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
856
+					$url = $this->home_url.'feed/'.$feed_slug.'/series-slug';
857 857
 				} else {
858
-					$url = $this->home_url . '?feed=' . $this->token . '&podcast_series=series-slug';
858
+					$url = $this->home_url.'?feed='.$this->token.'&podcast_series=series-slug';
859 859
 				}
860 860
 
861
-				$html .= esc_url( $url ) . "\n";
861
+				$html .= esc_url ( $url )."\n";
862 862
 			break;
863 863
 
864 864
 			case 'podcast_url';
865 865
 
866
-				$slug = apply_filters( 'ssp_archive_slug', __( 'podcast' , 'seriously-simple-podcasting' ) );
867
-				$podcast_url = $this->home_url . $slug;
866
+				$slug = apply_filters ( 'ssp_archive_slug', __ ( 'podcast', 'seriously-simple-podcasting' ) );
867
+				$podcast_url = $this->home_url.$slug;
868 868
 
869
-				$html .= '<a href="' . esc_url( $podcast_url ) . '" target="_blank">' . $podcast_url . '</a>';
869
+				$html .= '<a href="'.esc_url ( $podcast_url ).'" target="_blank">'.$podcast_url.'</a>';
870 870
 			break;
871 871
 
872 872
 		}
873 873
 
874
-		if ( ! in_array( $field['type'], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
875
-			switch( $field['type'] ) {
874
+		if ( ! in_array ( $field[ 'type' ], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
875
+			switch ( $field[ 'type' ] ) {
876 876
 
877 877
 				case 'checkbox_multi':
878 878
 				case 'radio':
879 879
 				case 'select_multi':
880
-					$html .= '<br/><span class="description">' . esc_attr( $field['description'] ) . '</span>';
880
+					$html .= '<br/><span class="description">'.esc_attr ( $field[ 'description' ] ).'</span>';
881 881
 				break;
882 882
 
883 883
 				default:
884
-					$html .= '<label for="' . esc_attr( $field['id'] ) . '"><span class="description">' . wp_kses_post( $field['description'] ) . '</span></label>' . "\n";
884
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ] ).'"><span class="description">'.wp_kses_post ( $field[ 'description' ] ).'</span></label>'."\n";
885 885
 				break;
886 886
 			}
887 887
 		}
888 888
 
889
-		if( $parent_class ) {
890
-			$html = '<div class="' . $parent_class . '">' . $html . '</div>';
889
+		if ( $parent_class ) {
890
+			$html = '<div class="'.$parent_class.'">'.$html.'</div>';
891 891
 		}
892 892
 
893 893
 		echo $html;
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
 	 * @return string       Validated string
900 900
 	 */
901 901
 	public function validate_slug( $slug ) {
902
-		if ( $slug && strlen( $slug ) > 0 && $slug != '' ) {
903
-			$slug = urlencode( strtolower( str_replace( ' ' , '-' , $slug ) ) );
902
+		if ( $slug && strlen ( $slug ) > 0 && $slug != '' ) {
903
+			$slug = urlencode ( strtolower ( str_replace ( ' ', '-', $slug ) ) );
904 904
 		}
905 905
 		return $slug;
906 906
 	}
@@ -912,10 +912,10 @@  discard block
 block discarded – undo
912 912
 	 */
913 913
 	public function encode_password( $password ) {
914 914
 
915
-		if ( $password && strlen( $password ) > 0 && $password != '' ) {
916
-			$password = md5( $password );
915
+		if ( $password && strlen ( $password ) > 0 && $password != '' ) {
916
+			$password = md5 ( $password );
917 917
 		} else {
918
-			$option = get_option( 'ss_podcasting_protection_password' );
918
+			$option = get_option ( 'ss_podcasting_protection_password' );
919 919
 			$password = $option;
920 920
 		}
921 921
 
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 			    'p' => array()
944 944
 			);
945 945
 
946
-			$message = wp_kses( $message, $allowed );
946
+			$message = wp_kses ( $message, $allowed );
947 947
 		}
948 948
 
949 949
 		return $message;
@@ -960,8 +960,8 @@  discard block
 block discarded – undo
960 960
 
961 961
 		if ( $option == 'ss_podcasting_redirect_feed' ) {
962 962
 			if ( ( $new_value != $old_value ) && $new_value == 'on' ) {
963
-				$date = time();
964
-				update_option( 'ss_podcasting_redirect_feed_date', $date );
963
+				$date = time ();
964
+				update_option ( 'ss_podcasting_redirect_feed_date', $date );
965 965
 			}
966 966
 		}
967 967
 
@@ -974,64 +974,64 @@  discard block
 block discarded – undo
974 974
 	public function settings_page() {
975 975
 
976 976
 		// Build page HTML
977
-		$html = '<div class="wrap" id="podcast_settings">' . "\n";
978
-			$html .= '<h1>' . __( 'Podcast Settings' , 'seriously-simple-podcasting' ) . '</h1>' . "\n";
977
+		$html = '<div class="wrap" id="podcast_settings">'."\n";
978
+			$html .= '<h1>'.__ ( 'Podcast Settings', 'seriously-simple-podcasting' ).'</h1>'."\n";
979 979
 
980 980
 			$tab = 'general';
981
-			if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
982
-				$tab = $_GET['tab'];
981
+			if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
982
+				$tab = $_GET[ 'tab' ];
983 983
 			}
984 984
 
985 985
 			// Show page tabs
986
-			if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) {
986
+			if ( is_array ( $this->settings ) && 1 < count ( $this->settings ) ) {
987 987
 
988
-				$html .= '<h2 class="nav-tab-wrapper">' . "\n";
988
+				$html .= '<h2 class="nav-tab-wrapper">'."\n";
989 989
 
990 990
 				$c = 0;
991 991
 				foreach ( $this->settings as $section => $data ) {
992 992
 
993 993
 					// Set tab class
994 994
 					$class = 'nav-tab';
995
-					if ( ! isset( $_GET['tab'] ) ) {
995
+					if ( ! isset( $_GET[ 'tab' ] ) ) {
996 996
 						if ( 0 == $c ) {
997 997
 							$class .= ' nav-tab-active';
998 998
 						}
999 999
 					} else {
1000
-						if ( isset( $_GET['tab'] ) && $section == $_GET['tab'] ) {
1000
+						if ( isset( $_GET[ 'tab' ] ) && $section == $_GET[ 'tab' ] ) {
1001 1001
 							$class .= ' nav-tab-active';
1002 1002
 						}
1003 1003
 					}
1004 1004
 
1005 1005
 					// Set tab link
1006
-					$tab_link = add_query_arg( array( 'tab' => $section ) );
1007
-					if ( isset( $_GET['settings-updated'] ) ) {
1008
-						$tab_link = remove_query_arg( 'settings-updated', $tab_link );
1006
+					$tab_link = add_query_arg ( array( 'tab' => $section ) );
1007
+					if ( isset( $_GET[ 'settings-updated' ] ) ) {
1008
+						$tab_link = remove_query_arg ( 'settings-updated', $tab_link );
1009 1009
 					}
1010 1010
 
1011
-					if ( isset( $_GET['feed-series'] ) ) {
1012
-						$tab_link = remove_query_arg( 'feed-series', $tab_link );
1011
+					if ( isset( $_GET[ 'feed-series' ] ) ) {
1012
+						$tab_link = remove_query_arg ( 'feed-series', $tab_link );
1013 1013
 					}
1014 1014
 
1015 1015
 					// Output tab
1016
-					$html .= '<a href="' . esc_url( $tab_link ) . '" class="' . esc_attr( $class ) . '">' . esc_html( $data['title'] ) . '</a>' . "\n";
1016
+					$html .= '<a href="'.esc_url ( $tab_link ).'" class="'.esc_attr ( $class ).'">'.esc_html ( $data[ 'title' ] ).'</a>'."\n";
1017 1017
 
1018 1018
 					++$c;
1019 1019
 				}
1020 1020
 
1021
-				$html .= '</h2>' . "\n";
1021
+				$html .= '</h2>'."\n";
1022 1022
 			}
1023 1023
 
1024
-			if ( isset( $_GET['settings-updated'] ) ) {
1024
+			if ( isset( $_GET[ 'settings-updated' ] ) ) {
1025 1025
 				$html .= '<br/><div class="updated notice notice-success is-dismissible">
1026
-					        <p>' . sprintf( __( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>' . str_replace( '-', ' ', ucfirst( $tab ) ) . '</b>' ) . '</p>
1026
+					        <p>' . sprintf ( __ ( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>'.str_replace ( '-', ' ', ucfirst ( $tab ) ).'</b>' ).'</p>
1027 1027
 					    </div>';
1028 1028
 			}
1029 1029
 
1030
-			if( function_exists( 'php_sapi_name') && 'security' == $tab ) {
1031
-				$sapi_type = php_sapi_name();
1032
-				if ( strpos( $sapi_type, 'fcgi' ) !== false ) {
1030
+			if ( function_exists ( 'php_sapi_name' ) && 'security' == $tab ) {
1031
+				$sapi_type = php_sapi_name ();
1032
+				if ( strpos ( $sapi_type, 'fcgi' ) !== false ) {
1033 1033
 				    $html .= '<br/><div class="update-nag">
1034
-					        <p>' . sprintf( __( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ) . '</p>
1034
+					        <p>' . sprintf ( __ ( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ).'</p>
1035 1035
 					    </div>';
1036 1036
 				}
1037 1037
 			}
@@ -1040,23 +1040,23 @@  discard block
 block discarded – undo
1040 1040
 
1041 1041
 			// Series submenu for feed details
1042 1042
 			if ( 'feed-details' == $tab ) {
1043
-				$series = get_terms( 'series', array( 'hide_empty' => false ) );
1043
+				$series = get_terms ( 'series', array( 'hide_empty' => false ) );
1044 1044
 
1045 1045
 				if ( ! empty( $series ) ) {
1046 1046
 
1047
-					if ( isset( $_GET['feed-series'] ) && $_GET['feed-series'] && 'default' != $_GET['feed-series'] ) {
1048
-						$current_series = esc_attr( $_GET['feed-series'] );
1047
+					if ( isset( $_GET[ 'feed-series' ] ) && $_GET[ 'feed-series' ] && 'default' != $_GET[ 'feed-series' ] ) {
1048
+						$current_series = esc_attr ( $_GET[ 'feed-series' ] );
1049 1049
 						$series_class = '';
1050 1050
 					} else {
1051 1051
 						$current_series = 'default';
1052 1052
 						$series_class = 'current';
1053 1053
 					}
1054 1054
 
1055
-					$html .= '<div class="feed-series-list-container">' . "\n";
1056
-						$html .= '<span id="feed-series-toggle" class="series-open" title="' . __( 'Toggle series list display', 'seriously-simple-podcasting' ) . '"></span>' . "\n";
1055
+					$html .= '<div class="feed-series-list-container">'."\n";
1056
+						$html .= '<span id="feed-series-toggle" class="series-open" title="'.__ ( 'Toggle series list display', 'seriously-simple-podcasting' ).'"></span>'."\n";
1057 1057
 
1058
-						$html .= '<ul id="feed-series-list" class="subsubsub series-open">' . "\n";
1059
-							$html .= '<li><a href="' . add_query_arg( array( 'feed-series' => 'default', 'settings-updated' => false ) ) . '" class="' . $series_class . '">' . __( 'Default feed', 'seriously-simple-podcasting' ) . '</a></li>';
1058
+						$html .= '<ul id="feed-series-list" class="subsubsub series-open">'."\n";
1059
+							$html .= '<li><a href="'.add_query_arg ( array( 'feed-series' => 'default', 'settings-updated' => false ) ).'" class="'.$series_class.'">'.__ ( 'Default feed', 'seriously-simple-podcasting' ).'</a></li>';
1060 1060
 
1061 1061
 							foreach ( $series as $s ) {
1062 1062
 
@@ -1066,39 +1066,39 @@  discard block
 block discarded – undo
1066 1066
 									$series_class = '';
1067 1067
 								}
1068 1068
 
1069
-								$html .= '<li>' . "\n";
1070
-									$html .= ' | <a href="' . esc_url( add_query_arg( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ) . '" class="' . $series_class . '">' . $s->name . '</a>' . "\n";
1071
-								$html .= '</li>' . "\n";
1069
+								$html .= '<li>'."\n";
1070
+									$html .= ' | <a href="'.esc_url ( add_query_arg ( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ).'" class="'.$series_class.'">'.$s->name.'</a>'."\n";
1071
+								$html .= '</li>'."\n";
1072 1072
 							}
1073 1073
 
1074
-						$html .= '</ul>' . "\n";
1075
-						$html .= '<br class="clear" />' . "\n";
1076
-					$html .= '</div>' . "\n";
1074
+						$html .= '</ul>'."\n";
1075
+						$html .= '<br class="clear" />'."\n";
1076
+					$html .= '</div>'."\n";
1077 1077
 
1078 1078
 				}
1079 1079
 			}
1080 1080
 
1081
-			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">' . "\n";
1081
+			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">'."\n";
1082 1082
 
1083 1083
 				// Add current series to posted data
1084 1084
 				if ( $current_series ) {
1085
-					$html .= '<input type="hidden" name="feed-series" value="' . esc_attr( $current_series ) . '" />' . "\n";
1085
+					$html .= '<input type="hidden" name="feed-series" value="'.esc_attr ( $current_series ).'" />'."\n";
1086 1086
 				}
1087 1087
 
1088 1088
 				// Get settings fields
1089
-				ob_start();
1090
-				settings_fields( 'ss_podcasting' );
1091
-				do_settings_sections( 'ss_podcasting' );
1092
-				$html .= ob_get_clean();
1089
+				ob_start ();
1090
+				settings_fields ( 'ss_podcasting' );
1091
+				do_settings_sections ( 'ss_podcasting' );
1092
+				$html .= ob_get_clean ();
1093 1093
 
1094 1094
 				// Submit button
1095
-				$html .= '<p class="submit">' . "\n";
1096
-					$html .= '<input type="hidden" name="tab" value="' . esc_attr( $tab ) . '" />' . "\n";
1097
-					$html .= '<input name="Submit" type="submit" class="button-primary" value="' . esc_attr( __( 'Save Settings' , 'seriously-simple-podcasting' ) ) . '" />' . "\n";
1098
-				$html .= '</p>' . "\n";
1095
+				$html .= '<p class="submit">'."\n";
1096
+					$html .= '<input type="hidden" name="tab" value="'.esc_attr ( $tab ).'" />'."\n";
1097
+					$html .= '<input name="Submit" type="submit" class="button-primary" value="'.esc_attr ( __ ( 'Save Settings', 'seriously-simple-podcasting' ) ).'" />'."\n";
1098
+				$html .= '</p>'."\n";
1099 1099
 
1100
-			$html .= '</form>' . "\n";
1101
-		$html .= '</div>' . "\n";
1100
+			$html .= '</form>'."\n";
1101
+		$html .= '</div>'."\n";
1102 1102
 
1103 1103
 	  	echo $html;
1104 1104
 	}
Please login to merge, or discard this patch.
includes/ssp-functions.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	 * @since  	 1.0.0
407 407
 	 * @return   mixed
408 408
 	 */
409
-    function ssp_readfile_chunked( $file, $retbytes = true ) {
409
+	function ssp_readfile_chunked( $file, $retbytes = true ) {
410 410
 
411 411
 		$chunksize = 1 * ( 1024 * 1024 );
412 412
 		$cnt = 0;
@@ -434,5 +434,5 @@  discard block
 block discarded – undo
434 434
 		}
435 435
 
436 436
 		return $status;
437
-    }
437
+	}
438 438
 }
439 439
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
8
-if ( ! function_exists( 'is_podcast_download' ) ) {
8
+if ( ! function_exists ( 'is_podcast_download' ) ) {
9 9
 	/**
10 10
 	 * Check if podcast file is being downloaded
11 11
 	 * @since  1.5
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 
17 17
 		$download = $episode = false;
18 18
 
19
-		if ( isset( $wp_query->query_vars['podcast_episode'] ) && $wp_query->query_vars['podcast_episode'] ) {
19
+		if ( isset( $wp_query->query_vars[ 'podcast_episode' ] ) && $wp_query->query_vars[ 'podcast_episode' ] ) {
20 20
 			$download = true;
21
-			$episode = intval( $wp_query->query_vars['podcast_episode'] );
21
+			$episode = intval ( $wp_query->query_vars[ 'podcast_episode' ] );
22 22
 		}
23 23
 
24
-		return apply_filters( 'ssp_is_podcast_download', $download, $episode );
24
+		return apply_filters ( 'ssp_is_podcast_download', $download, $episode );
25 25
 	}
26 26
 }
27 27
 
28
-if ( ! function_exists( 'ss_get_podcast' ) ) {
28
+if ( ! function_exists ( 'ss_get_podcast' ) ) {
29 29
 	/**
30 30
 	 * Wrapper function to get the podcast episodes from the SeriouslySimplePodcasting class.
31 31
 	 * @param  mixed $args  Arguments
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function ss_get_podcast( $args = '' ) {
36 36
 		global $ss_podcasting;
37
-		return $ss_podcasting->get_podcast( $args );
37
+		return $ss_podcasting->get_podcast ( $args );
38 38
 	}
39 39
 }
40 40
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
  * Enable the usage of do_action( 'get_podcast' ) to display podcast within a theme/plugin.
43 43
  * @since  1.0.0
44 44
  */
45
-add_action( 'get_podcast', 'ss_podcast' );
45
+add_action ( 'get_podcast', 'ss_podcast' );
46 46
 
47
-if ( ! function_exists( 'ss_podcast' ) ) {
47
+if ( ! function_exists ( 'ss_podcast' ) ) {
48 48
 	/**
49 49
 	 * Display or return HTML-formatted podcast data.
50 50
 	 * @param  mixed $args Arguments
@@ -66,57 +66,57 @@  discard block
 block discarded – undo
66 66
 			'after_title' => '</h3>'
67 67
 		);
68 68
 
69
-		$args = wp_parse_args( $args, $defaults );
69
+		$args = wp_parse_args ( $args, $defaults );
70 70
 
71 71
 		// Allow child themes/plugins to filter here
72
-		$args = apply_filters( 'ssp_podcast_args', $args );
72
+		$args = apply_filters ( 'ssp_podcast_args', $args );
73 73
 		$html = '';
74 74
 
75
-		do_action( 'ssp_podcast_before', $args );
75
+		do_action ( 'ssp_podcast_before', $args );
76 76
 
77 77
 		// The Query
78
-		$query = ss_get_podcast( $args );
78
+		$query = ss_get_podcast ( $args );
79 79
 
80 80
 		// The Display
81
-		if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
82
-			$html .= $args['before'] . "\n";
81
+		if ( ! is_wp_error ( $query ) && is_array ( $query ) && count ( $query ) > 0 ) {
82
+			$html .= $args[ 'before' ]."\n";
83 83
 
84
-			if ( '' != $args['title'] ) {
85
-				$html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
84
+			if ( '' != $args[ 'title' ] ) {
85
+				$html .= $args[ 'before_title' ].esc_html ( $args[ 'title' ] ).$args[ 'after_title' ]."\n";
86 86
 			}
87 87
 
88
-			$html .= '<div class="ss_podcast">' . "\n";
88
+			$html .= '<div class="ss_podcast">'."\n";
89 89
 
90 90
 			// Begin templating logic.
91 91
 			$tpl = '<div class="%%CLASS%%"><h4 class="podcast-title">%%TITLE%%</h4><aside class="meta">%%META%%</aside></div>';
92
-			$tpl = apply_filters( 'ssp_podcast_item_template', $tpl, $args );
92
+			$tpl = apply_filters ( 'ssp_podcast_item_template', $tpl, $args );
93 93
 
94
-			if ( $query['content'] == 'episodes' ) {
94
+			if ( $query[ 'content' ] == 'episodes' ) {
95 95
 
96 96
 				$i = 0;
97 97
 				foreach ( $query as $post ) {
98 98
 
99
-					if ( ! is_object( $post ) ) {
99
+					if ( ! is_object ( $post ) ) {
100 100
 						continue;
101 101
 					}
102 102
 
103 103
 					$template = $tpl;
104 104
 					$i++;
105 105
 
106
-					setup_postdata( $post );
106
+					setup_postdata ( $post );
107 107
 
108 108
 					$class = 'podcast';
109 109
 
110
-					$title = get_the_title();
111
-					if ( true == $args['link_title'] ) {
112
-						$title = '<a href="' . esc_url( $post->url ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
110
+					$title = get_the_title ();
111
+					if ( true == $args[ 'link_title' ] ) {
112
+						$title = '<a href="'.esc_url ( $post->url ).'" title="'.esc_attr ( $title ).'">'.$title.'</a>';
113 113
 					}
114 114
 
115
-					$meta = $ss_podcasting->episode_meta( $post->ID, 'shortcode' );
115
+					$meta = $ss_podcasting->episode_meta ( $post->ID, 'shortcode' );
116 116
 
117
-					$template = str_replace( '%%CLASS%%', $class, $template );
118
-					$template = str_replace( '%%TITLE%%', $title, $template );
119
-					$template = str_replace( '%%META%%', $meta, $template );
117
+					$template = str_replace ( '%%CLASS%%', $class, $template );
118
+					$template = str_replace ( '%%TITLE%%', $title, $template );
119
+					$template = str_replace ( '%%META%%', $meta, $template );
120 120
 
121 121
 					$html .= $template;
122 122
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 				$i = 0;
128 128
 				foreach ( $query as $series ) {
129 129
 
130
-					if ( ! is_object( $series ) ) continue;
130
+					if ( ! is_object ( $series ) ) continue;
131 131
 
132 132
 					$template = $tpl;
133 133
 					$i++;
@@ -135,15 +135,15 @@  discard block
 block discarded – undo
135 135
 					$class = 'podcast';
136 136
 
137 137
 					$title = $series->title;
138
-					if ( true == $args['link_title'] ) {
139
-						$title = '<a href="' . esc_url( $series->url ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
138
+					if ( true == $args[ 'link_title' ] ) {
139
+						$title = '<a href="'.esc_url ( $series->url ).'" title="'.esc_attr ( $title ).'">'.$title.'</a>';
140 140
 					}
141 141
 
142
-					$template = str_replace( '%%CLASS%%', $class, $template );
143
-					$template = str_replace( '%%TITLE%%', $title, $template );
142
+					$template = str_replace ( '%%CLASS%%', $class, $template );
143
+					$template = str_replace ( '%%TITLE%%', $title, $template );
144 144
 
145
-					$meta = $series->count . __( ' episodes' , 'seriously-simple-podcasting' );
146
-					$template = str_replace( '%%META%%' , $meta , $template );
145
+					$meta = $series->count.__ ( ' episodes', 'seriously-simple-podcasting' );
146
+					$template = str_replace ( '%%META%%', $meta, $template );
147 147
 
148 148
 					$html .= $template;
149 149
 
@@ -151,36 +151,36 @@  discard block
 block discarded – undo
151 151
 
152 152
 			}
153 153
 
154
-			$html .= '<div class="fix"></div>' . "\n";
154
+			$html .= '<div class="fix"></div>'."\n";
155 155
 
156
-			$html .= '</div><!--/.ss_podcast-->' . "\n";
157
-			$html .= $args['after'] . "\n";
156
+			$html .= '</div><!--/.ss_podcast-->'."\n";
157
+			$html .= $args[ 'after' ]."\n";
158 158
 
159
-			wp_reset_postdata();
159
+			wp_reset_postdata ();
160 160
 		}
161 161
 
162 162
 		// Allow themes/plugins to filter here
163
-		$html = apply_filters( 'ssp_podcast_html', $html, $query, $args );
163
+		$html = apply_filters ( 'ssp_podcast_html', $html, $query, $args );
164 164
 
165
-		if ( ! $args['echo'] ) {
165
+		if ( ! $args[ 'echo' ] ) {
166 166
 			return $html;
167 167
 		}
168 168
 
169 169
 		// Should only run if "echo" is set to true
170 170
 		echo $html;
171 171
 
172
-		do_action( 'ssp_podcast_after', $args );
172
+		do_action ( 'ssp_podcast_after', $args );
173 173
 	}
174 174
 }
175 175
 
176
-if ( ! function_exists( 'ss_podcast_shortcode' ) ) {
176
+if ( ! function_exists ( 'ss_podcast_shortcode' ) ) {
177 177
 
178 178
 	/**
179 179
 	 * Load podcast shortcode
180 180
 	 * @param  array  $atts    Shortcode attributes
181 181
 	 * @return string          HTML output
182 182
 	 */
183
-	function ss_podcast_shortcode ( $atts ) {
183
+	function ss_podcast_shortcode( $atts ) {
184 184
 
185 185
 		$defaults = array(
186 186
 			'title' => '',
@@ -191,27 +191,27 @@  discard block
 block discarded – undo
191 191
 			'link_title' => true
192 192
 		);
193 193
 
194
-		$args = shortcode_atts( $defaults, $atts );
194
+		$args = shortcode_atts ( $defaults, $atts );
195 195
 
196 196
 		// Make sure we return and don't echo.
197
-		$args['echo'] = false;
197
+		$args[ 'echo' ] = false;
198 198
 
199
-		return ss_podcast( $args );
199
+		return ss_podcast ( $args );
200 200
 	}
201 201
 }
202 202
 
203
-if ( ! function_exists( 'ssp_episode_ids' ) ) {
203
+if ( ! function_exists ( 'ssp_episode_ids' ) ) {
204 204
 
205 205
 	/**
206 206
 	 * Get post IDs of all podcast episodes for all post types
207 207
 	 * @since  1.8.2
208 208
 	 * @return array
209 209
 	 */
210
-	function ssp_episode_ids () {
210
+	function ssp_episode_ids() {
211 211
 		global $ss_podcasting;
212 212
 
213 213
 		// Remove action to prevent infinite loop
214
-		remove_action( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
214
+		remove_action ( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
215 215
 
216 216
 		// Setup the default args
217 217
 		$args = array(
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 		);
223 223
 
224 224
 		// Do we have any additional post types to add?
225
-		$podcast_post_types = ssp_post_types( false );
225
+		$podcast_post_types = ssp_post_types ( false );
226 226
 
227 227
 		if ( ! empty( $podcast_post_types ) ) {
228
-			$args['post_type']  = ssp_post_types();
229
-			$args['meta_query'] = array(
228
+			$args[ 'post_type' ]  = ssp_post_types ();
229
+			$args[ 'meta_query' ] = array(
230 230
 				array(
231 231
 					'key'     => 'audio_file',
232 232
 					'compare' => '!=',
@@ -238,23 +238,23 @@  discard block
 block discarded – undo
238 238
 		// Do we have this stored in the cache?
239 239
 		$key   = 'episode_ids';
240 240
 		$group = 'ssp';
241
-		$podcast_episodes = wp_cache_get( $key, $group );
241
+		$podcast_episodes = wp_cache_get ( $key, $group );
242 242
 
243 243
 		// If nothing in cache then fetch episodes again and store in cache
244 244
 		if ( $podcast_episodes === false ) {
245
-			$podcast_episodes = get_posts( $args );
246
-			wp_cache_set( $key, $podcast_episodes, $group, HOUR_IN_SECONDS * 12 );
245
+			$podcast_episodes = get_posts ( $args );
246
+			wp_cache_set ( $key, $podcast_episodes, $group, HOUR_IN_SECONDS * 12 );
247 247
 		}
248 248
 
249 249
 		// Reinstate action for future queries
250
-		add_action( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
250
+		add_action ( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
251 251
 
252 252
 		return $podcast_episodes;
253 253
 	}
254 254
 
255 255
 }
256 256
 
257
-if ( ! function_exists( 'ssp_episodes' ) ) {
257
+if ( ! function_exists ( 'ssp_episodes' ) ) {
258 258
 
259 259
 	/**
260 260
 	 * Fetch all podcast episodes
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 	 * @since  1.8.2
266 266
 	 * @return array                Array of posts or array of query args
267 267
 	 */
268
-	function ssp_episodes ( $n = 10, $series = '', $return_args = false, $context = '' ) {
268
+	function ssp_episodes( $n = 10, $series = '', $return_args = false, $context = '' ) {
269 269
 
270 270
 		// Get all podcast episodes IDs
271
-		$episode_ids = (array) ssp_episode_ids();
271
+		$episode_ids = (array) ssp_episode_ids ();
272 272
 
273 273
 		if ( $context === 'glance' ) {
274 274
 			return $episode_ids;
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		}
280 280
 
281 281
 		// Get all valid podcast post types
282
-		$podcast_post_types = ssp_post_types( true );
282
+		$podcast_post_types = ssp_post_types ( true );
283 283
 
284 284
 		if ( empty ( $podcast_post_types ) ) {
285 285
 			return array();
@@ -295,24 +295,24 @@  discard block
 block discarded – undo
295 295
 		);
296 296
 
297 297
 		if ( $series ) {
298
-			$args['series'] = esc_attr( $series );
298
+			$args[ 'series' ] = esc_attr ( $series );
299 299
 		}
300 300
 
301
-		$args = apply_filters( 'ssp_episode_query_args', $args, $context );
301
+		$args = apply_filters ( 'ssp_episode_query_args', $args, $context );
302 302
 
303 303
 		if ( $return_args ) {
304 304
 			return $args;
305 305
 		}
306 306
 
307 307
 		// Do we have anything in the cache here?
308
-		$key   = 'episodes_' . $series;
308
+		$key   = 'episodes_'.$series;
309 309
 		$group = 'ssp';
310
-		$posts = wp_cache_get( $key, $group );
310
+		$posts = wp_cache_get ( $key, $group );
311 311
 
312 312
 		// If nothing in cache then fetch episodes again and store in cache
313 313
 		if ( $posts === false ) {
314
-			$posts = get_posts( $args );
315
-			wp_cache_add( $key, $posts, $group, HOUR_IN_SECONDS * 12 );
314
+			$posts = get_posts ( $args );
315
+			wp_cache_add ( $key, $posts, $group, HOUR_IN_SECONDS * 12 );
316 316
 		}
317 317
 
318 318
 		return $posts;
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 }
322 322
 
323
-if ( ! function_exists( 'ssp_post_types' ) ) {
323
+if ( ! function_exists ( 'ssp_post_types' ) ) {
324 324
 
325 325
 	/**
326 326
 	 * Fetch all valid podcast post types
@@ -328,14 +328,14 @@  discard block
 block discarded – undo
328 328
 	 * @since  1.8.7
329 329
 	 * @return array                    Array of podcast post types
330 330
 	 */
331
-	function ssp_post_types ( $include_podcast = true ) {
331
+	function ssp_post_types( $include_podcast = true ) {
332 332
 
333 333
 		// Get saved podcast post type option
334
-		$podcast_post_types = get_option( 'ss_podcasting_use_post_types', array() );
334
+		$podcast_post_types = get_option ( 'ss_podcasting_use_post_types', array() );
335 335
 
336 336
 		// Add `podcast` post type to array if required
337 337
 		if ( $include_podcast ) {
338
-			$podcast_post_types[] = 'podcast';
338
+			$podcast_post_types[ ] = 'podcast';
339 339
 		}
340 340
 
341 341
 		$valid_podcast_post_types = array();
@@ -344,36 +344,36 @@  discard block
 block discarded – undo
344 344
 		if ( ! empty( $podcast_post_types ) ) {
345 345
 
346 346
 			foreach ( $podcast_post_types as $type ) {
347
-				if ( post_type_exists( $type ) ) {
348
-					$valid_podcast_post_types[] = $type;
347
+				if ( post_type_exists ( $type ) ) {
348
+					$valid_podcast_post_types[ ] = $type;
349 349
 				}
350 350
 			}
351 351
 
352 352
 		}
353 353
 
354 354
 		// Return only the valid podcast post types
355
-		return apply_filters( 'ssp_podcast_post_types', $valid_podcast_post_types, $include_podcast );
355
+		return apply_filters ( 'ssp_podcast_post_types', $valid_podcast_post_types, $include_podcast );
356 356
 	}
357 357
 }
358 358
 
359
-if( ! function_exists( 'ssp_get_feed_category_output' ) ) {
359
+if ( ! function_exists ( 'ssp_get_feed_category_output' ) ) {
360 360
 
361 361
 	/**
362 362
 	 * Get the XML markup for the feed category st the specified level
363 363
 	 * @param  int    $level Category level
364 364
 	 * @return string        XML output for feed vategory
365 365
 	 */
366
-	function ssp_get_feed_category_output ( $level = 1, $series_id ) {
366
+	function ssp_get_feed_category_output( $level = 1, $series_id ) {
367 367
 
368 368
 		$level = (int) $level;
369 369
 
370
-		if( 1 == $level ) {
370
+		if ( 1 == $level ) {
371 371
 			$level = '';
372 372
 		}
373 373
 
374
-		$category = get_option( 'ss_podcasting_data_category' . $level, '' );
374
+		$category = get_option ( 'ss_podcasting_data_category'.$level, '' );
375 375
 		if ( $series_id ) {
376
-			$series_category = get_option( 'ss_podcasting_data_category' . $level . '_' . $series_id, 'no-category' );
376
+			$series_category = get_option ( 'ss_podcasting_data_category'.$level.'_'.$series_id, 'no-category' );
377 377
 			if ( 'no-category' != $series_category ) {
378 378
 				$category = $series_category;
379 379
 			}
@@ -382,21 +382,21 @@  discard block
 block discarded – undo
382 382
 			$category = '';
383 383
 			$subcategory = '';
384 384
 		} else {
385
-			$subcategory = get_option( 'ss_podcasting_data_subcategory' . $level, '' );
385
+			$subcategory = get_option ( 'ss_podcasting_data_subcategory'.$level, '' );
386 386
 			if ( $series_id ) {
387
-				$series_subcategory = get_option( 'ss_podcasting_data_subcategory' . $level . '_' . $series_id, 'no-subcategory' );
387
+				$series_subcategory = get_option ( 'ss_podcasting_data_subcategory'.$level.'_'.$series_id, 'no-subcategory' );
388 388
 				if ( 'no-subcategory' != $series_subcategory ) {
389 389
 					$subcategory = $series_subcategory;
390 390
 				}
391 391
 			}
392 392
 		}
393 393
 
394
-		return apply_filters( 'ssp_feed_category_output', array( 'category' => $category, 'subcategory' => $subcategory ), $level, $series_id );
394
+		return apply_filters ( 'ssp_feed_category_output', array( 'category' => $category, 'subcategory' => $subcategory ), $level, $series_id );
395 395
 	}
396 396
 
397 397
 }
398 398
 
399
-if ( ! function_exists( 'ssp_readfile_chunked' ) ) {
399
+if ( ! function_exists ( 'ssp_readfile_chunked' ) ) {
400 400
 
401 401
 	/**
402 402
 	 * Reads file in chunks so big downloads are possible without changing PHP.INI - http://codeigniter.com/wiki/Download_helper_for_large_files/
@@ -411,23 +411,23 @@  discard block
 block discarded – undo
411 411
 		$chunksize = 1 * ( 1024 * 1024 );
412 412
 		$cnt = 0;
413 413
 
414
-		$handle = fopen( $file, 'r' );
414
+		$handle = fopen ( $file, 'r' );
415 415
 		if ( $handle === false ) {
416 416
 			return false;
417 417
 		}
418 418
 
419
-		while ( ! feof( $handle ) ) {
420
-			$buffer = fread( $handle, $chunksize );
419
+		while ( ! feof ( $handle ) ) {
420
+			$buffer = fread ( $handle, $chunksize );
421 421
 			echo $buffer;
422
-			ob_flush();
423
-			flush();
422
+			ob_flush ();
423
+			flush ();
424 424
 
425 425
 			if ( $retbytes ) {
426
-				$cnt += strlen( $buffer );
426
+				$cnt += strlen ( $buffer );
427 427
 			}
428 428
 		}
429 429
 
430
-		$status = fclose( $handle );
430
+		$status = fclose ( $handle );
431 431
 
432 432
 		if ( $retbytes && $status ) {
433 433
 			return $cnt;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,9 @@
 block discarded – undo
127 127
 				$i = 0;
128 128
 				foreach ( $query as $series ) {
129 129
 
130
-					if ( ! is_object( $series ) ) continue;
130
+					if ( ! is_object( $series ) ) {
131
+						continue;
132
+					}
131 133
 
132 134
 					$template = $tpl;
133 135
 					$i++;
Please login to merge, or discard this patch.
includes/widgets/class-ssp-widget-recent-episodes.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,118 +26,118 @@  discard block
 block discarded – undo
26 26
 	public function __construct() {
27 27
 		/* Widget variable settings. */
28 28
 		$this->widget_cssclass = 'widget_recent_entries widget_recent_episodes';
29
-		$this->widget_description = __( 'Display a list of your most recent podcast episodes.', 'seriously-simple-podcasting' );
29
+		$this->widget_description = __ ( 'Display a list of your most recent podcast episodes.', 'seriously-simple-podcasting' );
30 30
 		$this->widget_idbase = 'ss_podcast';
31
-		$this->widget_title = __( 'Podcast: Recent Episodes', 'seriously-simple-podcasting' );
31
+		$this->widget_title = __ ( 'Podcast: Recent Episodes', 'seriously-simple-podcasting' );
32 32
 
33 33
 		/* Widget settings. */
34 34
 		$widget_ops = array( 'classname' => $this->widget_cssclass, 'description' => $this->widget_description );
35 35
 
36
-		parent::__construct('recent-podcast-episodes', $this->widget_title, $widget_ops);
36
+		parent::__construct ( 'recent-podcast-episodes', $this->widget_title, $widget_ops );
37 37
 
38 38
 		$this->alt_option_name = 'widget_recent_episodes';
39 39
 
40
-		add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
41
-		add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
-		add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
40
+		add_action ( 'save_post', array( $this, 'flush_widget_cache' ) );
41
+		add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
+		add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) );
43 43
 
44 44
 	} // End __construct()
45 45
 
46
-	public function widget($args, $instance) {
46
+	public function widget( $args, $instance ) {
47 47
 		$cache = array();
48
-		if ( ! $this->is_preview() ) {
49
-			$cache = wp_cache_get( 'widget_recent_episodes', 'widget' );
48
+		if ( ! $this->is_preview () ) {
49
+			$cache = wp_cache_get ( 'widget_recent_episodes', 'widget' );
50 50
 		}
51 51
 
52
-		if ( ! is_array( $cache ) ) {
52
+		if ( ! is_array ( $cache ) ) {
53 53
 			$cache = array();
54 54
 		}
55 55
 
56
-		if ( ! isset( $args['widget_id'] ) ) {
57
-			$args['widget_id'] = $this->id;
56
+		if ( ! isset( $args[ 'widget_id' ] ) ) {
57
+			$args[ 'widget_id' ] = $this->id;
58 58
 		}
59 59
 
60
-		if ( isset( $cache[ $args['widget_id'] ] ) ) {
61
-			echo $cache[ $args['widget_id'] ];
60
+		if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) {
61
+			echo $cache[ $args[ 'widget_id' ] ];
62 62
 			return;
63 63
 		}
64 64
 
65
-		ob_start();
65
+		ob_start ();
66 66
 
67
-		$title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Episodes', 'seriously-simple-podcasting' );
67
+		$title = ( ! empty( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __ ( 'Recent Episodes', 'seriously-simple-podcasting' );
68 68
 
69 69
 		/** This filter is documented in wp-includes/default-widgets.php */
70
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
70
+		$title = apply_filters ( 'widget_title', $title, $instance, $this->id_base );
71 71
 
72
-		$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
72
+		$number = ( ! empty( $instance[ 'number' ] ) ) ? absint ( $instance[ 'number' ] ) : 5;
73 73
 		if ( ! $number ) {
74 74
 			$number = 5;
75 75
 		}
76 76
 
77
-		$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
77
+		$show_date = isset( $instance[ 'show_date' ] ) ? $instance[ 'show_date' ] : false;
78 78
 
79
-		$query_args = ssp_episodes( $number, '', true, 'widget' );
79
+		$query_args = ssp_episodes ( $number, '', true, 'widget' );
80 80
 
81
-		$qry = new WP_Query( apply_filters( 'ssp_widget_recent_episodes_args', $query_args ) );
81
+		$qry = new WP_Query ( apply_filters ( 'ssp_widget_recent_episodes_args', $query_args ) );
82 82
 
83
-		if ($qry->have_posts()) :
83
+		if ( $qry->have_posts () ) :
84 84
 ?>
85
-		<?php echo $args['before_widget']; ?>
85
+		<?php echo $args[ 'before_widget' ]; ?>
86 86
 		<?php if ( $title ) {
87
-			echo $args['before_title'] . $title . $args['after_title'];
87
+			echo $args[ 'before_title' ].$title.$args[ 'after_title' ];
88 88
 		} ?>
89 89
 		<ul>
90
-		<?php while ( $qry->have_posts() ) : $qry->the_post(); ?>
90
+		<?php while ( $qry->have_posts () ) : $qry->the_post (); ?>
91 91
 			<li>
92
-				<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
92
+				<a href="<?php the_permalink (); ?>"><?php get_the_title () ? the_title () : the_ID (); ?></a>
93 93
 			<?php if ( $show_date ) : ?>
94
-				<span class="post-date"><?php echo get_the_date(); ?></span>
94
+				<span class="post-date"><?php echo get_the_date (); ?></span>
95 95
 			<?php endif; ?>
96 96
 			</li>
97 97
 		<?php endwhile; ?>
98 98
 		</ul>
99
-		<?php echo $args['after_widget']; ?>
99
+		<?php echo $args[ 'after_widget' ]; ?>
100 100
 <?php
101 101
 		// Reset the global $the_post as this query will have stomped on it
102
-		wp_reset_postdata();
102
+		wp_reset_postdata ();
103 103
 
104 104
 		endif;
105 105
 
106
-		if ( ! $this->is_preview() ) {
107
-			$cache[ $args['widget_id'] ] = ob_get_flush();
108
-			wp_cache_set( 'widget_recent_episodes', $cache, 'widget' );
106
+		if ( ! $this->is_preview () ) {
107
+			$cache[ $args[ 'widget_id' ] ] = ob_get_flush ();
108
+			wp_cache_set ( 'widget_recent_episodes', $cache, 'widget' );
109 109
 		} else {
110
-			ob_end_flush();
110
+			ob_end_flush ();
111 111
 		}
112 112
 	}
113 113
 
114 114
 	public function update( $new_instance, $old_instance ) {
115 115
 		$instance = $old_instance;
116
-		$instance['title'] = strip_tags($new_instance['title']);
117
-		$instance['number'] = (int) $new_instance['number'];
118
-		$instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
119
-		$this->flush_widget_cache();
116
+		$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
117
+		$instance[ 'number' ] = (int) $new_instance[ 'number' ];
118
+		$instance[ 'show_date' ] = isset( $new_instance[ 'show_date' ] ) ? (bool) $new_instance[ 'show_date' ] : false;
119
+		$this->flush_widget_cache ();
120 120
 
121 121
 		return $instance;
122 122
 	}
123 123
 
124 124
 	public function flush_widget_cache() {
125
-		wp_cache_delete('widget_recent_episodes', 'widget');
125
+		wp_cache_delete ( 'widget_recent_episodes', 'widget' );
126 126
 	}
127 127
 
128 128
 	public function form( $instance ) {
129
-		$title     = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
130
-		$number    = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
131
-		$show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;
129
+		$title     = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : '';
130
+		$number    = isset( $instance[ 'number' ] ) ? absint ( $instance[ 'number' ] ) : 5;
131
+		$show_date = isset( $instance[ 'show_date' ] ) ? (bool) $instance[ 'show_date' ] : false;
132 132
 ?>
133
-		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'seriously-simple-podcasting' ); ?></label>
134
-		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
133
+		<p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title:', 'seriously-simple-podcasting' ); ?></label>
134
+		<input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
135 135
 
136
-		<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of episodes to show:', 'seriously-simple-podcasting' ); ?></label>
137
-		<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
136
+		<p><label for="<?php echo $this->get_field_id ( 'number' ); ?>"><?php _e ( 'Number of episodes to show:', 'seriously-simple-podcasting' ); ?></label>
137
+		<input id="<?php echo $this->get_field_id ( 'number' ); ?>" name="<?php echo $this->get_field_name ( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
138 138
 
139
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
140
-		<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
139
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_date ); ?> id="<?php echo $this->get_field_id ( 'show_date' ); ?>" name="<?php echo $this->get_field_name ( 'show_date' ); ?>" />
140
+		<label for="<?php echo $this->get_field_id ( 'show_date' ); ?>"><?php _e ( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
141 141
 <?php
142 142
 	}
143 143
 } // End Class
Please login to merge, or discard this patch.
includes/widgets/class-ssp-widget-series.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,74 +26,74 @@  discard block
 block discarded – undo
26 26
 	public function __construct() {
27 27
 		/* Widget variable settings. */
28 28
 		$this->widget_cssclass = 'widget_podcast_series';
29
-		$this->widget_description = __( 'Display a list of episodes from a single series.', 'seriously-simple-podcasting' );
29
+		$this->widget_description = __ ( 'Display a list of episodes from a single series.', 'seriously-simple-podcasting' );
30 30
 		$this->widget_idbase = 'ss_podcast';
31
-		$this->widget_title = __( 'Podcast: Series', 'seriously-simple-podcasting' );
31
+		$this->widget_title = __ ( 'Podcast: Series', 'seriously-simple-podcasting' );
32 32
 
33 33
 		/* Widget settings. */
34 34
 		$widget_ops = array( 'classname' => $this->widget_cssclass, 'description' => $this->widget_description );
35 35
 
36
-		parent::__construct('podcast-series', $this->widget_title, $widget_ops);
36
+		parent::__construct ( 'podcast-series', $this->widget_title, $widget_ops );
37 37
 
38 38
 		$this->alt_option_name = 'widget_podcast_series';
39 39
 
40
-		add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
41
-		add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
-		add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
40
+		add_action ( 'save_post', array( $this, 'flush_widget_cache' ) );
41
+		add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
+		add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) );
43 43
 
44 44
 	} // End __construct()
45 45
 
46
-	public function widget($args, $instance) {
46
+	public function widget( $args, $instance ) {
47 47
 		$cache = array();
48
-		if ( ! $this->is_preview() ) {
49
-			$cache = wp_cache_get( 'widget_podcast_series', 'widget' );
48
+		if ( ! $this->is_preview () ) {
49
+			$cache = wp_cache_get ( 'widget_podcast_series', 'widget' );
50 50
 		}
51 51
 
52
-		if ( ! is_array( $cache ) ) {
52
+		if ( ! is_array ( $cache ) ) {
53 53
 			$cache = array();
54 54
 		}
55 55
 
56
-		if ( ! isset( $args['widget_id'] ) ) {
57
-			$args['widget_id'] = $this->id;
56
+		if ( ! isset( $args[ 'widget_id' ] ) ) {
57
+			$args[ 'widget_id' ] = $this->id;
58 58
 		}
59 59
 
60
-		if ( isset( $cache[ $args['widget_id'] ] ) ) {
61
-			echo $cache[ $args['widget_id'] ];
60
+		if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) {
61
+			echo $cache[ $args[ 'widget_id' ] ];
62 62
 			return;
63 63
 		}
64 64
 
65
-		ob_start();
65
+		ob_start ();
66 66
 
67
-		$series_id = $instance['series_id'];
67
+		$series_id = $instance[ 'series_id' ];
68 68
 
69 69
 		if ( ! $series_id ) {
70 70
 			return;
71 71
 		}
72 72
 
73
-		$series = get_term( $series_id, 'series' );
73
+		$series = get_term ( $series_id, 'series' );
74 74
 
75
-		if ( ! $series || is_wp_error( $series ) ) {
75
+		if ( ! $series || is_wp_error ( $series ) ) {
76 76
 			return;
77 77
 		}
78 78
 
79
-		$title = ( $instance['title'] ) ? $instance['title'] : $series->name;
79
+		$title = ( $instance[ 'title' ] ) ? $instance[ 'title' ] : $series->name;
80 80
 
81 81
 		/** This filter is documented in wp-includes/default-widgets.php */
82
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
82
+		$title = apply_filters ( 'widget_title', $title, $instance, $this->id_base );
83 83
 
84
-		$show_title = isset( $instance['show_title'] ) ? $instance['show_title'] : false;
85
-		$show_desc = isset( $instance['show_desc'] ) ? $instance['show_desc'] : false;
86
-		$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
84
+		$show_title = isset( $instance[ 'show_title' ] ) ? $instance[ 'show_title' ] : false;
85
+		$show_desc = isset( $instance[ 'show_desc' ] ) ? $instance[ 'show_desc' ] : false;
86
+		$show_date = isset( $instance[ 'show_date' ] ) ? $instance[ 'show_date' ] : false;
87 87
 
88
-		$query_args = ssp_episodes( 999, $series->slug, true, 'widget' );
88
+		$query_args = ssp_episodes ( 999, $series->slug, true, 'widget' );
89 89
 
90
-		$qry = new WP_Query( apply_filters( 'ssp_widget_series_episodes_args', $query_args ) );
90
+		$qry = new WP_Query ( apply_filters ( 'ssp_widget_series_episodes_args', $query_args ) );
91 91
 
92
-		if ( $qry->have_posts() ) :
92
+		if ( $qry->have_posts () ) :
93 93
 ?>
94
-		<?php echo $args['before_widget']; ?>
94
+		<?php echo $args[ 'before_widget' ]; ?>
95 95
 		<?php if ( $title ) {
96
-			echo $args['before_title'] . $title . $args['after_title'];
96
+			echo $args[ 'before_title' ].$title.$args[ 'after_title' ];
97 97
 		} ?>
98 98
 
99 99
 		<?php if ( $show_title ) { ?>
@@ -105,77 +105,77 @@  discard block
 block discarded – undo
105 105
 		<?php } ?>
106 106
 
107 107
 		<ul>
108
-		<?php while ( $qry->have_posts() ) : $qry->the_post(); ?>
108
+		<?php while ( $qry->have_posts () ) : $qry->the_post (); ?>
109 109
 			<li>
110
-				<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
110
+				<a href="<?php the_permalink (); ?>"><?php get_the_title () ? the_title () : the_ID (); ?></a>
111 111
 			<?php if ( $show_date ) : ?>
112
-				<span class="post-date"><?php echo get_the_date(); ?></span>
112
+				<span class="post-date"><?php echo get_the_date (); ?></span>
113 113
 			<?php endif; ?>
114 114
 			</li>
115 115
 		<?php endwhile; ?>
116 116
 		</ul>
117
-		<?php echo $args['after_widget']; ?>
117
+		<?php echo $args[ 'after_widget' ]; ?>
118 118
 <?php
119 119
 		// Reset the global $the_post as this query will have stomped on it
120
-		wp_reset_postdata();
120
+		wp_reset_postdata ();
121 121
 
122 122
 		endif;
123 123
 
124
-		if ( ! $this->is_preview() ) {
125
-			$cache[ $args['widget_id'] ] = ob_get_flush();
126
-			wp_cache_set( 'widget_podcast_series', $cache, 'widget' );
124
+		if ( ! $this->is_preview () ) {
125
+			$cache[ $args[ 'widget_id' ] ] = ob_get_flush ();
126
+			wp_cache_set ( 'widget_podcast_series', $cache, 'widget' );
127 127
 		} else {
128
-			ob_end_flush();
128
+			ob_end_flush ();
129 129
 		}
130 130
 	}
131 131
 
132 132
 	public function update( $new_instance, $old_instance ) {
133 133
 		$instance = $old_instance;
134
-		$instance['title'] 		= strip_tags( $new_instance['title'] );
135
-		$instance['series_id']  = isset( $new_instance['series_id'] ) ? (int) $new_instance['series_id'] : 0;
136
-		$instance['show_title'] = isset( $new_instance['show_title'] ) ? (bool) $new_instance['show_title'] : false;
137
-		$instance['show_desc']  = isset( $new_instance['show_desc'] ) ? (bool) $new_instance['show_desc'] : false;
138
-		$instance['show_date']  = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
139
-		$this->flush_widget_cache();
134
+		$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
135
+		$instance[ 'series_id' ]  = isset( $new_instance[ 'series_id' ] ) ? (int) $new_instance[ 'series_id' ] : 0;
136
+		$instance[ 'show_title' ] = isset( $new_instance[ 'show_title' ] ) ? (bool) $new_instance[ 'show_title' ] : false;
137
+		$instance[ 'show_desc' ]  = isset( $new_instance[ 'show_desc' ] ) ? (bool) $new_instance[ 'show_desc' ] : false;
138
+		$instance[ 'show_date' ]  = isset( $new_instance[ 'show_date' ] ) ? (bool) $new_instance[ 'show_date' ] : false;
139
+		$this->flush_widget_cache ();
140 140
 
141 141
 		return $instance;
142 142
 	}
143 143
 
144 144
 	public function flush_widget_cache() {
145
-		wp_cache_delete('widget_podcast_series', 'widget');
145
+		wp_cache_delete ( 'widget_podcast_series', 'widget' );
146 146
 	}
147 147
 
148 148
 	public function form( $instance ) {
149
-		$title        = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
150
-		$series_id    = isset( $instance['series_id'] ) ? $instance['series_id'] : 0;
151
-		$show_title   = isset( $instance['show_title'] ) ? (bool) $instance['show_title'] : false;
152
-		$show_desc    = isset( $instance['show_desc'] ) ? (bool) $instance['show_desc'] : false;
153
-		$show_date    = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;
149
+		$title        = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : '';
150
+		$series_id    = isset( $instance[ 'series_id' ] ) ? $instance[ 'series_id' ] : 0;
151
+		$show_title   = isset( $instance[ 'show_title' ] ) ? (bool) $instance[ 'show_title' ] : false;
152
+		$show_desc    = isset( $instance[ 'show_desc' ] ) ? (bool) $instance[ 'show_desc' ] : false;
153
+		$show_date    = isset( $instance[ 'show_date' ] ) ? (bool) $instance[ 'show_date' ] : false;
154 154
 
155 155
 		// Get all podcast series
156
-		$series = get_terms( 'series' );
156
+		$series = get_terms ( 'series' );
157 157
 ?>
158
-		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'seriously-simple-podcasting' ); ?></label>
159
-		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" placeholder="<?php _e( 'Use series title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
158
+		<p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title:', 'seriously-simple-podcasting' ); ?></label>
159
+		<input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" placeholder="<?php _e ( 'Use series title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
160 160
 
161
-		<p><label for="<?php echo $this->get_field_id( 'series_id' ); ?>"><?php _e( 'Series:', 'seriously-simple-podcasting' ); ?></label>
162
-		<select id="<?php echo $this->get_field_id( 'series_id' ); ?>" name="<?php echo $this->get_field_name( 'series_id' ); ?>">
161
+		<p><label for="<?php echo $this->get_field_id ( 'series_id' ); ?>"><?php _e ( 'Series:', 'seriously-simple-podcasting' ); ?></label>
162
+		<select id="<?php echo $this->get_field_id ( 'series_id' ); ?>" name="<?php echo $this->get_field_name ( 'series_id' ); ?>">
163 163
 			<?php
164 164
 			foreach ( $series as $s ) {
165
-				echo '<option value="' . esc_attr( $s->term_id ) . '" ' . selected( $series_id, $s->term_id, false ) . '>' . $s->name . '</option>' . "\n";
165
+				echo '<option value="'.esc_attr ( $s->term_id ).'" '.selected ( $series_id, $s->term_id, false ).'>'.$s->name.'</option>'."\n";
166 166
 			}
167 167
 			?>
168 168
 		</select>
169 169
 		</p>
170 170
 
171
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_title ); ?> id="<?php echo $this->get_field_id( 'show_title' ); ?>" name="<?php echo $this->get_field_name( 'show_title' ); ?>" />
172
-		<label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Display series title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
171
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_title ); ?> id="<?php echo $this->get_field_id ( 'show_title' ); ?>" name="<?php echo $this->get_field_name ( 'show_title' ); ?>" />
172
+		<label for="<?php echo $this->get_field_id ( 'show_title' ); ?>"><?php _e ( 'Display series title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
173 173
 
174
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_desc ); ?> id="<?php echo $this->get_field_id( 'show_desc' ); ?>" name="<?php echo $this->get_field_name( 'show_desc' ); ?>" />
175
-		<label for="<?php echo $this->get_field_id( 'show_desc' ); ?>"><?php _e( 'Display series description?', 'seriously-simple-podcasting' ); ?></label></p>
174
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_desc ); ?> id="<?php echo $this->get_field_id ( 'show_desc' ); ?>" name="<?php echo $this->get_field_name ( 'show_desc' ); ?>" />
175
+		<label for="<?php echo $this->get_field_id ( 'show_desc' ); ?>"><?php _e ( 'Display series description?', 'seriously-simple-podcasting' ); ?></label></p>
176 176
 
177
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
178
-		<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
177
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_date ); ?> id="<?php echo $this->get_field_id ( 'show_date' ); ?>" name="<?php echo $this->get_field_name ( 'show_date' ); ?>" />
178
+		<label for="<?php echo $this->get_field_id ( 'show_date' ); ?>"><?php _e ( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
179 179
 <?php
180 180
 	}
181 181
 } // End Class
Please login to merge, or discard this patch.
includes/widgets/class-ssp-widget-single-episode.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
 	public function __construct() {
27 27
 		/* Widget variable settings. */
28 28
 		$this->widget_cssclass = 'widget_podcast_episode';
29
-		$this->widget_description = __( 'Display a single podcast episode.', 'seriously-simple-podcasting' );
29
+		$this->widget_description = __ ( 'Display a single podcast episode.', 'seriously-simple-podcasting' );
30 30
 		$this->widget_idbase = 'ss_podcast';
31
-		$this->widget_title = __( 'Podcast: Single Episode', 'seriously-simple-podcasting' );
31
+		$this->widget_title = __ ( 'Podcast: Single Episode', 'seriously-simple-podcasting' );
32 32
 
33 33
 		/* Widget settings. */
34 34
 		$widget_ops = array( 'classname' => $this->widget_cssclass, 'description' => $this->widget_description );
35 35
 
36
-		parent::__construct('single-podcast-episode', $this->widget_title, $widget_ops);
36
+		parent::__construct ( 'single-podcast-episode', $this->widget_title, $widget_ops );
37 37
 
38 38
 		$this->alt_option_name = 'widget_single_episode';
39 39
 
40
-		add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
41
-		add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
-		add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
40
+		add_action ( 'save_post', array( $this, 'flush_widget_cache' ) );
41
+		add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
+		add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) );
43 43
 
44 44
 	} // End __construct()
45 45
 
@@ -47,157 +47,157 @@  discard block
 block discarded – undo
47 47
 		global $ss_podcasting;
48 48
 
49 49
 		$cache = array();
50
-		if ( ! $this->is_preview() ) {
51
-			$cache = wp_cache_get( 'widget_single_episode', 'widget' );
50
+		if ( ! $this->is_preview () ) {
51
+			$cache = wp_cache_get ( 'widget_single_episode', 'widget' );
52 52
 		}
53 53
 
54
-		if ( ! is_array( $cache ) ) {
54
+		if ( ! is_array ( $cache ) ) {
55 55
 			$cache = array();
56 56
 		}
57 57
 
58
-		if ( ! isset( $args['widget_id'] ) ) {
59
-			$args['widget_id'] = $this->id;
58
+		if ( ! isset( $args[ 'widget_id' ] ) ) {
59
+			$args[ 'widget_id' ] = $this->id;
60 60
 		}
61 61
 
62
-		if ( isset( $cache[ $args['widget_id'] ] ) ) {
63
-			echo $cache[ $args['widget_id'] ];
62
+		if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) {
63
+			echo $cache[ $args[ 'widget_id' ] ];
64 64
 			return;
65 65
 		}
66 66
 
67
-		ob_start();
67
+		ob_start ();
68 68
 
69
-		$episode_id = $instance['episode_id'];
69
+		$episode_id = $instance[ 'episode_id' ];
70 70
 
71
-		if( 0 == $episode_id ) {
72
-			$ssp_episodes = ssp_episodes( 1 );
73
-			if( 0 < count( $ssp_episodes ) ) {
74
-				foreach( $ssp_episodes as $episode ) {
71
+		if ( 0 == $episode_id ) {
72
+			$ssp_episodes = ssp_episodes ( 1 );
73
+			if ( 0 < count ( $ssp_episodes ) ) {
74
+				foreach ( $ssp_episodes as $episode ) {
75 75
 					$episode_id = $episode->ID;
76 76
 					break;
77 77
 				}
78 78
 			}
79 79
 		}
80 80
 
81
-		if( ! $episode_id ) {
81
+		if ( ! $episode_id ) {
82 82
 			return;
83 83
 		}
84 84
 
85
-		$title = ( $instance['title'] ) ? $instance['title'] : get_the_title( $episode_id );
85
+		$title = ( $instance[ 'title' ] ) ? $instance[ 'title' ] : get_the_title ( $episode_id );
86 86
 
87 87
 		/** This filter is documented in wp-includes/default-widgets.php */
88
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
88
+		$title = apply_filters ( 'widget_title', $title, $instance, $this->id_base );
89 89
 
90
-		$show_title = isset( $instance['show_title'] ) ? $instance['show_title'] : false;
91
-		$show_excerpt = isset( $instance['show_excerpt'] ) ? $instance['show_excerpt'] : false;
92
-		$show_content = isset( $instance['show_content'] ) ? $instance['show_content'] : false;
93
-		$show_player = isset( $instance['show_player'] ) ? $instance['show_player'] : false;
94
-		$show_details = isset( $instance['show_details'] ) ? $instance['show_details'] : false;
90
+		$show_title = isset( $instance[ 'show_title' ] ) ? $instance[ 'show_title' ] : false;
91
+		$show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? $instance[ 'show_excerpt' ] : false;
92
+		$show_content = isset( $instance[ 'show_content' ] ) ? $instance[ 'show_content' ] : false;
93
+		$show_player = isset( $instance[ 'show_player' ] ) ? $instance[ 'show_player' ] : false;
94
+		$show_details = isset( $instance[ 'show_details' ] ) ? $instance[ 'show_details' ] : false;
95 95
 
96 96
 		$content_items = array();
97 97
 
98 98
 		if ( $show_title ) {
99
-			$content_items[] = 'title';
99
+			$content_items[ ] = 'title';
100 100
 		}
101 101
 
102 102
 		if ( $show_excerpt ) {
103
-			$content_items[] = 'excerpt';
103
+			$content_items[ ] = 'excerpt';
104 104
 		}
105 105
 
106 106
 		if ( $show_content ) {
107
-			$content_items[] = 'content';
107
+			$content_items[ ] = 'content';
108 108
 		}
109 109
 
110 110
 		if ( $show_player ) {
111
-			$content_items[] = 'player';
111
+			$content_items[ ] = 'player';
112 112
 		}
113 113
 
114 114
 		if ( $show_details ) {
115
-			$content_items[] = 'details';
115
+			$content_items[ ] = 'details';
116 116
 		}
117 117
 
118 118
 		// Get episode markup
119
-		$html = $ss_podcasting->podcast_episode( $episode_id, $content_items, 'widget' );
119
+		$html = $ss_podcasting->podcast_episode ( $episode_id, $content_items, 'widget' );
120 120
 
121 121
 		if ( ! $html ) {
122 122
 			return;
123 123
 		}
124 124
 
125
-		echo $args['before_widget'];
125
+		echo $args[ 'before_widget' ];
126 126
 
127 127
 		if ( $title ) {
128
-			echo $args['before_title'] . $title . $args['after_title'];
128
+			echo $args[ 'before_title' ].$title.$args[ 'after_title' ];
129 129
 		}
130 130
 
131 131
 		echo $html;
132 132
 
133
-		echo $args['after_widget'];
133
+		echo $args[ 'after_widget' ];
134 134
 
135
-		if ( ! $this->is_preview() ) {
136
-			$cache[ $args['widget_id'] ] = ob_get_flush();
137
-			wp_cache_set( 'widget_single_episode', $cache, 'widget' );
135
+		if ( ! $this->is_preview () ) {
136
+			$cache[ $args[ 'widget_id' ] ] = ob_get_flush ();
137
+			wp_cache_set ( 'widget_single_episode', $cache, 'widget' );
138 138
 		} else {
139
-			ob_end_flush();
139
+			ob_end_flush ();
140 140
 		}
141 141
 	}
142 142
 
143 143
 	public function update( $new_instance, $old_instance ) {
144 144
 		$instance = $old_instance;
145
-		$instance['title'] 		  = strip_tags( $new_instance['title'] );
146
-		$instance['episode_id']   = isset( $new_instance['episode_id'] ) ? (int) $new_instance['episode_id'] : 0;
147
-		$instance['show_title']   = isset( $new_instance['show_title'] ) ? (bool) $new_instance['show_title'] : false;
148
-		$instance['show_excerpt'] = isset( $new_instance['show_excerpt'] ) ? (bool) $new_instance['show_excerpt'] : false;
149
-		$instance['show_content'] = isset( $new_instance['show_content'] ) ? (bool) $new_instance['show_content'] : false;
150
-		$instance['show_player']  = isset( $new_instance['show_player'] ) ? (bool) $new_instance['show_player'] : false;
151
-		$instance['show_details'] = isset( $new_instance['show_details'] ) ? (bool) $new_instance['show_details'] : false;
152
-		$this->flush_widget_cache();
145
+		$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
146
+		$instance[ 'episode_id' ]   = isset( $new_instance[ 'episode_id' ] ) ? (int) $new_instance[ 'episode_id' ] : 0;
147
+		$instance[ 'show_title' ]   = isset( $new_instance[ 'show_title' ] ) ? (bool) $new_instance[ 'show_title' ] : false;
148
+		$instance[ 'show_excerpt' ] = isset( $new_instance[ 'show_excerpt' ] ) ? (bool) $new_instance[ 'show_excerpt' ] : false;
149
+		$instance[ 'show_content' ] = isset( $new_instance[ 'show_content' ] ) ? (bool) $new_instance[ 'show_content' ] : false;
150
+		$instance[ 'show_player' ]  = isset( $new_instance[ 'show_player' ] ) ? (bool) $new_instance[ 'show_player' ] : false;
151
+		$instance[ 'show_details' ] = isset( $new_instance[ 'show_details' ] ) ? (bool) $new_instance[ 'show_details' ] : false;
152
+		$this->flush_widget_cache ();
153 153
 
154 154
 		return $instance;
155 155
 	}
156 156
 
157 157
 	public function flush_widget_cache() {
158
-		wp_cache_delete('widget_single_episode', 'widget');
158
+		wp_cache_delete ( 'widget_single_episode', 'widget' );
159 159
 	}
160 160
 
161 161
 	public function form( $instance ) {
162
-		$title     	  = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
163
-		$episode_id   = isset( $instance['episode_id'] ) ? $instance['episode_id'] : 0;
164
-		$show_title   = isset( $instance['show_title'] ) ? (bool) $instance['show_title'] : false;
165
-		$show_excerpt = isset( $instance['show_excerpt'] ) ? (bool) $instance['show_excerpt'] : false;
166
-		$show_content = isset( $instance['show_content'] ) ? (bool) $instance['show_content'] : false;
167
-		$show_player  = isset( $instance['show_player'] ) ? (bool) $instance['show_player'] : false;
168
-		$show_details = isset( $instance['show_details'] ) ? (bool) $instance['show_details'] : false;
162
+		$title     	  = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : '';
163
+		$episode_id   = isset( $instance[ 'episode_id' ] ) ? $instance[ 'episode_id' ] : 0;
164
+		$show_title   = isset( $instance[ 'show_title' ] ) ? (bool) $instance[ 'show_title' ] : false;
165
+		$show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? (bool) $instance[ 'show_excerpt' ] : false;
166
+		$show_content = isset( $instance[ 'show_content' ] ) ? (bool) $instance[ 'show_content' ] : false;
167
+		$show_player  = isset( $instance[ 'show_player' ] ) ? (bool) $instance[ 'show_player' ] : false;
168
+		$show_details = isset( $instance[ 'show_details' ] ) ? (bool) $instance[ 'show_details' ] : false;
169 169
 
170 170
 		// Get all podcast episodes
171
-		$episode_ids = (array) ssp_episode_ids();
171
+		$episode_ids = (array) ssp_episode_ids ();
172 172
 ?>
173
-		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'seriously-simple-podcasting' ); ?></label>
174
-		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" placeholder="<?php _e( 'Use episode title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
173
+		<p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title:', 'seriously-simple-podcasting' ); ?></label>
174
+		<input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" placeholder="<?php _e ( 'Use episode title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
175 175
 
176
-		<p><label for="<?php echo $this->get_field_id( 'episode_id' ); ?>"><?php _e( 'Episode:', 'seriously-simple-podcasting' ); ?></label>
177
-		<select id="<?php echo $this->get_field_id( 'episode_id' ); ?>" name="<?php echo $this->get_field_name( 'episode_id' ); ?>">
178
-			<option value="0"><?php _e( '- Latest episode -', 'seriously-simple-podcasting' ); ?></option>
176
+		<p><label for="<?php echo $this->get_field_id ( 'episode_id' ); ?>"><?php _e ( 'Episode:', 'seriously-simple-podcasting' ); ?></label>
177
+		<select id="<?php echo $this->get_field_id ( 'episode_id' ); ?>" name="<?php echo $this->get_field_name ( 'episode_id' ); ?>">
178
+			<option value="0"><?php _e ( '- Latest episode -', 'seriously-simple-podcasting' ); ?></option>
179 179
 			<?php
180 180
 			foreach ( $episode_ids as $id ) {
181
-				echo '<option value="' . esc_attr( $id ) . '" ' . selected( $episode_id, $id, false ) . '>' . get_the_title( $id ) . '</option>' . "\n";
181
+				echo '<option value="'.esc_attr ( $id ).'" '.selected ( $episode_id, $id, false ).'>'.get_the_title ( $id ).'</option>'."\n";
182 182
 			}
183 183
 			?>
184 184
 		</select>
185 185
 		</p>
186 186
 
187
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_title ); ?> id="<?php echo $this->get_field_id( 'show_title' ); ?>" name="<?php echo $this->get_field_name( 'show_title' ); ?>" />
188
-		<label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Display episode title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
187
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_title ); ?> id="<?php echo $this->get_field_id ( 'show_title' ); ?>" name="<?php echo $this->get_field_name ( 'show_title' ); ?>" />
188
+		<label for="<?php echo $this->get_field_id ( 'show_title' ); ?>"><?php _e ( 'Display episode title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
189 189
 
190
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_excerpt ); ?> id="<?php echo $this->get_field_id( 'show_excerpt' ); ?>" name="<?php echo $this->get_field_name( 'show_excerpt' ); ?>" />
191
-		<label for="<?php echo $this->get_field_id( 'show_excerpt' ); ?>"><?php _e( 'Display episode excerpt?', 'seriously-simple-podcasting' ); ?></label></p>
190
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_excerpt ); ?> id="<?php echo $this->get_field_id ( 'show_excerpt' ); ?>" name="<?php echo $this->get_field_name ( 'show_excerpt' ); ?>" />
191
+		<label for="<?php echo $this->get_field_id ( 'show_excerpt' ); ?>"><?php _e ( 'Display episode excerpt?', 'seriously-simple-podcasting' ); ?></label></p>
192 192
 
193
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_content ); ?> id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>" />
194
-		<label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Display full episode content?', 'seriously-simple-podcasting' ); ?></label></p>
193
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_content ); ?> id="<?php echo $this->get_field_id ( 'show_content' ); ?>" name="<?php echo $this->get_field_name ( 'show_content' ); ?>" />
194
+		<label for="<?php echo $this->get_field_id ( 'show_content' ); ?>"><?php _e ( 'Display full episode content?', 'seriously-simple-podcasting' ); ?></label></p>
195 195
 
196
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_player ); ?> id="<?php echo $this->get_field_id( 'show_player' ); ?>" name="<?php echo $this->get_field_name( 'show_player' ); ?>" />
197
-		<label for="<?php echo $this->get_field_id( 'show_player' ); ?>"><?php _e( 'Display episode audio player?', 'seriously-simple-podcasting' ); ?></label></p>
196
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_player ); ?> id="<?php echo $this->get_field_id ( 'show_player' ); ?>" name="<?php echo $this->get_field_name ( 'show_player' ); ?>" />
197
+		<label for="<?php echo $this->get_field_id ( 'show_player' ); ?>"><?php _e ( 'Display episode audio player?', 'seriously-simple-podcasting' ); ?></label></p>
198 198
 
199
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_details ); ?> id="<?php echo $this->get_field_id( 'show_details' ); ?>" name="<?php echo $this->get_field_name( 'show_details' ); ?>" />
200
-		<label for="<?php echo $this->get_field_id( 'show_details' ); ?>"><?php _e( 'Display episode details?', 'seriously-simple-podcasting' ); ?></label></p>
199
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_details ); ?> id="<?php echo $this->get_field_id ( 'show_details' ); ?>" name="<?php echo $this->get_field_name ( 'show_details' ); ?>" />
200
+		<label for="<?php echo $this->get_field_id ( 'show_details' ); ?>"><?php _e ( 'Display episode details?', 'seriously-simple-podcasting' ); ?></label></p>
201 201
 <?php
202 202
 	}
203 203
 } // End Class
Please login to merge, or discard this patch.
templates/feed-podcast.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 	// Request password and give access if correct
34 34
 	if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) && ! isset( $_SERVER['PHP_AUTH_PW'] ) ) {
35
-	    $give_access = false;
35
+		$give_access = false;
36 36
 	} else {
37 37
 		$username = get_option( 'ss_podcasting_protection_username' );
38 38
 		$password = get_option( 'ss_podcasting_protection_password' );
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$no_access_message = '<div style="text-align:center;font-family:sans-serif;border:1px solid red;background:pink;padding:20px 0;color:red;">' . $message . '</div>';
51 51
 
52 52
 		header('WWW-Authenticate: Basic realm="Podcast Feed"');
53
-	    header('HTTP/1.0 401 Unauthorized');
53
+		header('HTTP/1.0 401 Unauthorized');
54 54
 
55 55
 		die( $no_access_message );
56 56
 	}
Please login to merge, or discard this patch.
Spacing   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 // Exit if accessed directly.
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if ( ! defined ( 'ABSPATH' ) ) {
11 11
 	exit;
12 12
 }
13 13
 
@@ -15,30 +15,30 @@  discard block
 block discarded – undo
15 15
 
16 16
 
17 17
 // Hide all errors
18
-error_reporting( 0 );
18
+error_reporting ( 0 );
19 19
 
20 20
 // Check if feed is password protected
21
-$protection = get_option( 'ss_podcasting_protect', '' );
21
+$protection = get_option ( 'ss_podcasting_protect', '' );
22 22
 
23 23
 if ( $protection && $protection == 'on' ) {
24 24
 
25 25
 	$give_access = false;
26 26
 
27
-	$message_option = get_option('ss_podcasting_protection_no_access_message');
28
-	$message = __( 'You are not permitted to view this podcast feed.' , 'seriously-simple-podcasting' );
29
-	if ( $message_option && strlen( $message_option ) > 0 && $message_option != '' ) {
27
+	$message_option = get_option ( 'ss_podcasting_protection_no_access_message' );
28
+	$message = __ ( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' );
29
+	if ( $message_option && strlen ( $message_option ) > 0 && $message_option != '' ) {
30 30
 		$message = $message_option;
31 31
 	}
32 32
 
33 33
 	// Request password and give access if correct
34
-	if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) && ! isset( $_SERVER['PHP_AUTH_PW'] ) ) {
34
+	if ( ! isset( $_SERVER[ 'PHP_AUTH_USER' ] ) && ! isset( $_SERVER[ 'PHP_AUTH_PW' ] ) ) {
35 35
 	    $give_access = false;
36 36
 	} else {
37
-		$username = get_option( 'ss_podcasting_protection_username' );
38
-		$password = get_option( 'ss_podcasting_protection_password' );
37
+		$username = get_option ( 'ss_podcasting_protection_username' );
38
+		$password = get_option ( 'ss_podcasting_protection_password' );
39 39
 
40
-		if ( $_SERVER['PHP_AUTH_USER'] == $username ) {
41
-			if ( md5( $_SERVER['PHP_AUTH_PW'] ) == $password ) {
40
+		if ( $_SERVER[ 'PHP_AUTH_USER' ] == $username ) {
41
+			if ( md5 ( $_SERVER[ 'PHP_AUTH_PW' ] ) == $password ) {
42 42
 				$give_access = true;
43 43
 			}
44 44
 		}
@@ -47,31 +47,31 @@  discard block
 block discarded – undo
47 47
 	// Send 401 status and display no access message
48 48
 	if ( ! $give_access ) {
49 49
 
50
-		$no_access_message = '<div style="text-align:center;font-family:sans-serif;border:1px solid red;background:pink;padding:20px 0;color:red;">' . $message . '</div>';
50
+		$no_access_message = '<div style="text-align:center;font-family:sans-serif;border:1px solid red;background:pink;padding:20px 0;color:red;">'.$message.'</div>';
51 51
 
52
-		header('WWW-Authenticate: Basic realm="Podcast Feed"');
53
-	    header('HTTP/1.0 401 Unauthorized');
52
+		header ( 'WWW-Authenticate: Basic realm="Podcast Feed"' );
53
+	    header ( 'HTTP/1.0 401 Unauthorized' );
54 54
 
55 55
 		die( $no_access_message );
56 56
 	}
57 57
 }
58 58
 
59 59
 // If redirect is on, get new feed URL and redirect if setting was changed more than 48 hours ago
60
-$redirect = get_option( 'ss_podcasting_redirect_feed' );
60
+$redirect = get_option ( 'ss_podcasting_redirect_feed' );
61 61
 $new_feed_url = false;
62 62
 if ( $redirect && $redirect == 'on' ) {
63 63
 
64
-	$new_feed_url = get_option( 'ss_podcasting_new_feed_url' );
65
-	$update_date = get_option( 'ss_podcasting_redirect_feed_date' );
64
+	$new_feed_url = get_option ( 'ss_podcasting_new_feed_url' );
65
+	$update_date = get_option ( 'ss_podcasting_redirect_feed_date' );
66 66
 
67 67
 	if ( $new_feed_url && $update_date ) {
68
-		$redirect_date = strtotime( '+2 days' , $update_date );
69
-		$current_date = time();
68
+		$redirect_date = strtotime ( '+2 days', $update_date );
69
+		$current_date = time ();
70 70
 
71 71
 		// Redirect with 301 if it is more than 2 days since redirect was saved
72 72
 		if ( $current_date > $redirect_date ) {
73 73
 			header ( 'HTTP/1.1 301 Moved Permanently' );
74
-			header ( 'Location: ' . $new_feed_url );
74
+			header ( 'Location: '.$new_feed_url );
75 75
 			exit;
76 76
 		}
77 77
 	}
@@ -79,107 +79,107 @@  discard block
 block discarded – undo
79 79
 
80 80
 // Get specified podcast series
81 81
 $podcast_series = '';
82
-if ( isset( $_GET['podcast_series'] ) && $_GET['podcast_series'] ) {
83
-	$podcast_series = esc_attr( $_GET['podcast_series'] );
84
-} elseif ( isset( $wp_query->query_vars['podcast_series'] ) && $wp_query->query_vars['podcast_series'] ) {
85
-	$podcast_series = esc_attr( $wp_query->query_vars['podcast_series'] );
82
+if ( isset( $_GET[ 'podcast_series' ] ) && $_GET[ 'podcast_series' ] ) {
83
+	$podcast_series = esc_attr ( $_GET[ 'podcast_series' ] );
84
+} elseif ( isset( $wp_query->query_vars[ 'podcast_series' ] ) && $wp_query->query_vars[ 'podcast_series' ] ) {
85
+	$podcast_series = esc_attr ( $wp_query->query_vars[ 'podcast_series' ] );
86 86
 }
87 87
 
88 88
 $series_id = 0;
89 89
 if ( $podcast_series ) {
90
-	$series = get_term_by( 'slug', $podcast_series, 'series' );
90
+	$series = get_term_by ( 'slug', $podcast_series, 'series' );
91 91
 	$series_id = $series->term_id;
92 92
 
93 93
 	// Do we need to redirect a single feed?
94
-	$redirect = get_option( 'ss_podcasting_redirect_feed_' . $series_id );
94
+	$redirect = get_option ( 'ss_podcasting_redirect_feed_'.$series_id );
95 95
 	$new_feed_url = false;
96 96
 	if ( $redirect && $redirect == 'on' ) {
97
-		$new_feed_url = get_option( 'ss_podcasting_new_feed_url_' . $series_id );
97
+		$new_feed_url = get_option ( 'ss_podcasting_new_feed_url_'.$series_id );
98 98
 		if ( $new_feed_url ) {
99 99
 			header ( 'HTTP/1.1 301 Moved Permanently' );
100
-			header ( 'Location: ' . $new_feed_url );
100
+			header ( 'Location: '.$new_feed_url );
101 101
 			exit;
102 102
 		}
103 103
 	}
104 104
 }
105 105
 
106 106
 // Podcast title
107
-$title = get_option( 'ss_podcasting_data_title', get_bloginfo( 'name' ) );
107
+$title = get_option ( 'ss_podcasting_data_title', get_bloginfo ( 'name' ) );
108 108
 if ( $podcast_series ) {
109
-	$series_title = get_option( 'ss_podcasting_data_title_' . $series_id, '' );
109
+	$series_title = get_option ( 'ss_podcasting_data_title_'.$series_id, '' );
110 110
 	if ( $series_title ) {
111 111
 		$title = $series_title;
112 112
 	}
113 113
 }
114 114
 
115 115
 // Podcast description
116
-$description = get_option( 'ss_podcasting_data_description', get_bloginfo( 'description' ) );
116
+$description = get_option ( 'ss_podcasting_data_description', get_bloginfo ( 'description' ) );
117 117
 if ( $podcast_series ) {
118
-	$series_description = get_option( 'ss_podcasting_data_description_' . $series_id, '' );
118
+	$series_description = get_option ( 'ss_podcasting_data_description_'.$series_id, '' );
119 119
 	if ( $series_description ) {
120 120
 		$description = $series_description;
121 121
 	}
122 122
 }
123
-$podcast_description = mb_substr( strip_tags( $description ), 0, 3999 );
123
+$podcast_description = mb_substr ( strip_tags ( $description ), 0, 3999 );
124 124
 
125 125
 // Podcast language
126
-$language = get_option( 'ss_podcasting_data_language', get_bloginfo( 'language' ) );
126
+$language = get_option ( 'ss_podcasting_data_language', get_bloginfo ( 'language' ) );
127 127
 if ( $podcast_series ) {
128
-	$series_language = get_option( 'ss_podcasting_data_language_' . $series_id, '' );
128
+	$series_language = get_option ( 'ss_podcasting_data_language_'.$series_id, '' );
129 129
 	if ( $series_language ) {
130 130
 		$language = $series_language;
131 131
 	}
132 132
 }
133 133
 
134 134
 // Podcast copyright string
135
-$copyright = get_option( 'ss_podcasting_data_copyright', '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ) );
135
+$copyright = get_option ( 'ss_podcasting_data_copyright', '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ) );
136 136
 if ( $podcast_series ) {
137
-	$series_copyright = get_option( 'ss_podcasting_data_copyright_' . $series_id, '' );
137
+	$series_copyright = get_option ( 'ss_podcasting_data_copyright_'.$series_id, '' );
138 138
 	if ( $series_copyright ) {
139 139
 		$copyright = $series_copyright;
140 140
 	}
141 141
 }
142 142
 
143 143
 // Podcast subtitle
144
-$subtitle = get_option( 'ss_podcasting_data_subtitle', get_bloginfo( 'description' ) );
144
+$subtitle = get_option ( 'ss_podcasting_data_subtitle', get_bloginfo ( 'description' ) );
145 145
 if ( $podcast_series ) {
146
-	$series_subtitle = get_option( 'ss_podcasting_data_subtitle_' . $series_id, '' );
146
+	$series_subtitle = get_option ( 'ss_podcasting_data_subtitle_'.$series_id, '' );
147 147
 	if ( $series_subtitle ) {
148 148
 		$subtitle = $series_subtitle;
149 149
 	}
150 150
 }
151 151
 
152 152
 // Podcast author
153
-$author = get_option( 'ss_podcasting_data_author', get_bloginfo( 'name' ) );
153
+$author = get_option ( 'ss_podcasting_data_author', get_bloginfo ( 'name' ) );
154 154
 if ( $podcast_series ) {
155
-	$series_author = get_option( 'ss_podcasting_data_author_' . $series_id, '' );
155
+	$series_author = get_option ( 'ss_podcasting_data_author_'.$series_id, '' );
156 156
 	if ( $series_author ) {
157 157
 		$author = $series_author;
158 158
 	}
159 159
 }
160 160
 
161 161
 // Podcast owner name
162
-$owner_name = get_option( 'ss_podcasting_data_owner_name', get_bloginfo( 'name' ) );
162
+$owner_name = get_option ( 'ss_podcasting_data_owner_name', get_bloginfo ( 'name' ) );
163 163
 if ( $podcast_series ) {
164
-	$series_owner_name = get_option( 'ss_podcasting_data_owner_name_' . $series_id, '' );
164
+	$series_owner_name = get_option ( 'ss_podcasting_data_owner_name_'.$series_id, '' );
165 165
 	if ( $series_owner_name ) {
166 166
 		$owner_name = $series_owner_name;
167 167
 	}
168 168
 }
169 169
 
170 170
 // Podcast owner email address
171
-$owner_email = get_option( 'ss_podcasting_data_owner_email', get_bloginfo( 'admin_email' ) );
171
+$owner_email = get_option ( 'ss_podcasting_data_owner_email', get_bloginfo ( 'admin_email' ) );
172 172
 if ( $podcast_series ) {
173
-	$series_owner_email = get_option( 'ss_podcasting_data_owner_email_' . $series_id, '' );
173
+	$series_owner_email = get_option ( 'ss_podcasting_data_owner_email_'.$series_id, '' );
174 174
 	if ( $series_owner_email ) {
175 175
 		$owner_email = $series_owner_email;
176 176
 	}
177 177
 }
178 178
 
179 179
 // Podcast explicit setting
180
-$explicit_option = get_option( 'ss_podcasting_explicit', '' );
180
+$explicit_option = get_option ( 'ss_podcasting_explicit', '' );
181 181
 if ( $podcast_series ) {
182
-	$series_explicit_option = get_option( 'ss_podcasting_explicit_' . $series_id, '' );
182
+	$series_explicit_option = get_option ( 'ss_podcasting_explicit_'.$series_id, '' );
183 183
 	$explicit_option = $series_explicit_option;
184 184
 }
185 185
 if ( $explicit_option && 'on' == $explicit_option ) {
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 }
192 192
 
193 193
 // Podcast complete setting
194
-$complete_option = get_option( 'ss_podcasting_complete', '' );
194
+$complete_option = get_option ( 'ss_podcasting_complete', '' );
195 195
 if ( $podcast_series ) {
196
-	$series_complete_option = get_option( 'ss_podcasting_complete_' . $series_id, '' );
196
+	$series_complete_option = get_option ( 'ss_podcasting_complete_'.$series_id, '' );
197 197
 	$complete_option = $series_complete_option;
198 198
 }
199 199
 if ( $complete_option && 'on' == $complete_option ) {
@@ -203,34 +203,34 @@  discard block
 block discarded – undo
203 203
 }
204 204
 
205 205
 // Podcast cover image
206
-$image = get_option( 'ss_podcasting_data_image', '' );
206
+$image = get_option ( 'ss_podcasting_data_image', '' );
207 207
 if ( $podcast_series ) {
208
-	$series_image = get_option( 'ss_podcasting_data_image_' . $series_id, 'no-image' );
208
+	$series_image = get_option ( 'ss_podcasting_data_image_'.$series_id, 'no-image' );
209 209
 	if ( 'no-image' != $series_image ) {
210 210
 		$image = $series_image;
211 211
 	}
212 212
 }
213 213
 
214 214
 // Image URL (filterable to allow custom images)
215
-$image = apply_filters( 'ssp_feed_image', $image, $series_id );
215
+$image = apply_filters ( 'ssp_feed_image', $image, $series_id );
216 216
 
217 217
 // Podcast category and subcategory (all levels)
218
-$category1 = ssp_get_feed_category_output( 1, $series_id );
219
-$category2 = ssp_get_feed_category_output( 2, $series_id );
220
-$category3 = ssp_get_feed_category_output( 3, $series_id );
218
+$category1 = ssp_get_feed_category_output ( 1, $series_id );
219
+$category2 = ssp_get_feed_category_output ( 2, $series_id );
220
+$category3 = ssp_get_feed_category_output ( 3, $series_id );
221 221
 
222 222
 // Get stylehseet URL (filterable to allow custom RSS stylesheets)
223
-$stylehseet_url = apply_filters( 'ssp_rss_stylesheet', $ss_podcasting->template_url . 'feed-stylesheet.xsl' );
223
+$stylehseet_url = apply_filters ( 'ssp_rss_stylesheet', $ss_podcasting->template_url.'feed-stylesheet.xsl' );
224 224
 
225 225
 // Set RSS content type and charset headers
226
-header( 'Content-Type: ' . feed_content_type( 'podcast' ) . '; charset=' . get_option( 'blog_charset' ), true );
226
+header ( 'Content-Type: '.feed_content_type ( 'podcast' ).'; charset='.get_option ( 'blog_charset' ), true );
227 227
 
228 228
 // Use `echo` for first line to prevent any extra characters at start of document
229
-echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?>' . "\n";
229
+echo '<?xml version="1.0" encoding="'.get_option ( 'blog_charset' ).'"?>'."\n";
230 230
 
231 231
 // Include RSS stylesheet
232
-if( $stylehseet_url ) {
233
-	echo '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylehseet_url ) . '"?>';
232
+if ( $stylehseet_url ) {
233
+	echo '<?xml-stylesheet type="text/xsl" href="'.esc_url ( $stylehseet_url ).'"?>';
234 234
 } ?>
235 235
 
236 236
 <rss version="2.0"
@@ -242,88 +242,88 @@  discard block
 block discarded – undo
242 242
 	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
243 243
 	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
244 244
 	xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"
245
-	<?php do_action( 'rss2_ns' ); ?>
245
+	<?php do_action ( 'rss2_ns' ); ?>
246 246
 >
247 247
 
248 248
 	<channel>
249
-		<title><?php echo esc_html( $title ); ?></title>
250
-		<atom:link href="<?php esc_url( self_link() ); ?>" rel="self" type="application/rss+xml" />
251
-		<link><?php echo esc_url( apply_filters( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
252
-		<description><?php echo esc_html( $description ); ?></description>
253
-		<lastBuildDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_lastpostmodified( 'GMT' ), false ) ); ?></lastBuildDate>
254
-		<language><?php echo esc_html( $language ); ?></language>
255
-		<copyright><?php echo esc_html( $copyright ); ?></copyright>
256
-		<itunes:subtitle><?php echo esc_html( $subtitle ); ?></itunes:subtitle>
257
-		<itunes:author><?php echo esc_html( $author ); ?></itunes:author>
258
-		<googleplay:author><?php echo esc_html( $author ); ?></googleplay:author>
259
-		<googleplay:email><?php echo esc_html( $owner_email ); ?></googleplay:email>
260
-		<itunes:summary><?php echo esc_html( $podcast_description ); ?></itunes:summary>
261
-		<googleplay:description><?php echo esc_html( $podcast_description ); ?></googleplay:description>
249
+		<title><?php echo esc_html ( $title ); ?></title>
250
+		<atom:link href="<?php esc_url ( self_link () ); ?>" rel="self" type="application/rss+xml" />
251
+		<link><?php echo esc_url ( apply_filters ( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
252
+		<description><?php echo esc_html ( $description ); ?></description>
253
+		<lastBuildDate><?php echo esc_html ( mysql2date ( 'D, d M Y H:i:s +0000', get_lastpostmodified ( 'GMT' ), false ) ); ?></lastBuildDate>
254
+		<language><?php echo esc_html ( $language ); ?></language>
255
+		<copyright><?php echo esc_html ( $copyright ); ?></copyright>
256
+		<itunes:subtitle><?php echo esc_html ( $subtitle ); ?></itunes:subtitle>
257
+		<itunes:author><?php echo esc_html ( $author ); ?></itunes:author>
258
+		<googleplay:author><?php echo esc_html ( $author ); ?></googleplay:author>
259
+		<googleplay:email><?php echo esc_html ( $owner_email ); ?></googleplay:email>
260
+		<itunes:summary><?php echo esc_html ( $podcast_description ); ?></itunes:summary>
261
+		<googleplay:description><?php echo esc_html ( $podcast_description ); ?></googleplay:description>
262 262
 		<itunes:owner>
263
-			<itunes:name><?php echo esc_html( $owner_name ); ?></itunes:name>
264
-			<itunes:email><?php echo esc_html( $owner_email ); ?></itunes:email>
263
+			<itunes:name><?php echo esc_html ( $owner_name ); ?></itunes:name>
264
+			<itunes:email><?php echo esc_html ( $owner_email ); ?></itunes:email>
265 265
 		</itunes:owner>
266
-		<itunes:explicit><?php echo esc_html( $itunes_explicit ); ?></itunes:explicit>
267
-		<googleplay:explicit><?php echo esc_html( $googleplay_explicit ); ?></googleplay:explicit>
268
-		<?php if( $complete ) { ?><itunes:complete><?php echo esc_html( $complete ); ?></itunes:complete><?php }
266
+		<itunes:explicit><?php echo esc_html ( $itunes_explicit ); ?></itunes:explicit>
267
+		<googleplay:explicit><?php echo esc_html ( $googleplay_explicit ); ?></googleplay:explicit>
268
+		<?php if ( $complete ) { ?><itunes:complete><?php echo esc_html ( $complete ); ?></itunes:complete><?php }
269 269
 if ( $image ) {
270
-		?><itunes:image href="<?php echo esc_url( $image ); ?>"></itunes:image>
271
-		<googleplay:image href="<?php echo esc_url( $image ); ?>"></googleplay:image>
270
+		?><itunes:image href="<?php echo esc_url ( $image ); ?>"></itunes:image>
271
+		<googleplay:image href="<?php echo esc_url ( $image ); ?>"></googleplay:image>
272 272
 		<image>
273
-			<url><?php echo esc_url( $image ); ?></url>
274
-			<title><?php echo esc_html( $title ); ?></title>
275
-			<link><?php echo esc_url( apply_filters( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
273
+			<url><?php echo esc_url ( $image ); ?></url>
274
+			<title><?php echo esc_html ( $title ); ?></title>
275
+			<link><?php echo esc_url ( apply_filters ( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
276 276
 		</image>
277 277
 <?php }
278
-if ( isset( $category1['category'] ) && $category1['category'] ) { ?>
279
-		<itunes:category text="<?php echo esc_attr( $category1['category'] ); ?>">
280
-<?php if ( isset( $category1['subcategory'] ) && $category1['subcategory'] ) { ?>
281
-			<itunes:category text="<?php echo esc_attr( $category1['subcategory'] ); ?>"></itunes:category>
278
+if ( isset( $category1[ 'category' ] ) && $category1[ 'category' ] ) { ?>
279
+		<itunes:category text="<?php echo esc_attr ( $category1[ 'category' ] ); ?>">
280
+<?php if ( isset( $category1[ 'subcategory' ] ) && $category1[ 'subcategory' ] ) { ?>
281
+			<itunes:category text="<?php echo esc_attr ( $category1[ 'subcategory' ] ); ?>"></itunes:category>
282 282
 <?php } ?>
283 283
 		</itunes:category>
284 284
 <?php } ?>
285
-<?php if ( isset( $category2['category'] ) && $category2['category'] ) { ?>
286
-		<itunes:category text="<?php echo esc_attr( $category2['category'] ); ?>">
287
-<?php if ( isset( $category2['subcategory'] ) && $category2['subcategory'] ) { ?>
288
-			<itunes:category text="<?php echo esc_attr( $category2['subcategory'] ); ?>"></itunes:category>
285
+<?php if ( isset( $category2[ 'category' ] ) && $category2[ 'category' ] ) { ?>
286
+		<itunes:category text="<?php echo esc_attr ( $category2[ 'category' ] ); ?>">
287
+<?php if ( isset( $category2[ 'subcategory' ] ) && $category2[ 'subcategory' ] ) { ?>
288
+			<itunes:category text="<?php echo esc_attr ( $category2[ 'subcategory' ] ); ?>"></itunes:category>
289 289
 <?php } ?>
290 290
 		</itunes:category>
291 291
 <?php } ?>
292
-<?php if ( isset( $category3['category'] ) && $category3['category'] ) { ?>
293
-		<itunes:category text="<?php echo esc_attr( $category3['category'] ); ?>">
294
-<?php if ( isset( $category3['subcategory'] ) && $category3['subcategory'] ) { ?>
295
-			<itunes:category text="<?php echo esc_attr( $category3['subcategory'] ); ?>"></itunes:category>
292
+<?php if ( isset( $category3[ 'category' ] ) && $category3[ 'category' ] ) { ?>
293
+		<itunes:category text="<?php echo esc_attr ( $category3[ 'category' ] ); ?>">
294
+<?php if ( isset( $category3[ 'subcategory' ] ) && $category3[ 'subcategory' ] ) { ?>
295
+			<itunes:category text="<?php echo esc_attr ( $category3[ 'subcategory' ] ); ?>"></itunes:category>
296 296
 <?php } ?>
297 297
 		</itunes:category>
298 298
 	<?php } ?>
299 299
 	<?php if ( $new_feed_url ) { ?>
300
-		<itunes:new-feed-url><?php echo esc_url( $new_feed_url ); ?></itunes:new-feed-url>
300
+		<itunes:new-feed-url><?php echo esc_url ( $new_feed_url ); ?></itunes:new-feed-url>
301 301
 	<?php }
302 302
 
303 303
 		// Prevent WP core from outputting an <image> element
304
-		remove_action( 'rss2_head', 'rss2_site_icon' );
304
+		remove_action ( 'rss2_head', 'rss2_site_icon' );
305 305
 
306 306
 		// Add RSS2 headers
307
-		do_action( 'rss2_head' );
307
+		do_action ( 'rss2_head' );
308 308
 
309 309
 		// Get post IDs of all podcast episodes
310
-		$num_posts = intval( apply_filters( 'ssp_feed_number_of_posts', get_option( 'posts_per_rss', 10 ) ) );
310
+		$num_posts = intval ( apply_filters ( 'ssp_feed_number_of_posts', get_option ( 'posts_per_rss', 10 ) ) );
311 311
 
312
-		$args = ssp_episodes( $num_posts, $podcast_series, true, 'feed' );
312
+		$args = ssp_episodes ( $num_posts, $podcast_series, true, 'feed' );
313 313
 
314
-		$qry = new WP_Query( $args );
314
+		$qry = new WP_Query ( $args );
315 315
 
316
-		if ( $qry->have_posts() ) {
317
-			while ( $qry->have_posts()) {
318
-				$qry->the_post();
316
+		if ( $qry->have_posts () ) {
317
+			while ( $qry->have_posts () ) {
318
+				$qry->the_post ();
319 319
 
320 320
 				// Get the episode type (audio or video)
321
-				$episode_type = $ss_podcasting->get_episode_type( get_the_ID() );
321
+				$episode_type = $ss_podcasting->get_episode_type ( get_the_ID () );
322 322
 
323 323
 				// Audio file
324
-				$audio_file = $ss_podcasting->get_enclosure( get_the_ID() );
325
-				if ( get_option( 'permalink_structure' ) ) {
326
-					$enclosure = $ss_podcasting->get_episode_download_link( get_the_ID() );
324
+				$audio_file = $ss_podcasting->get_enclosure ( get_the_ID () );
325
+				if ( get_option ( 'permalink_structure' ) ) {
326
+					$enclosure = $ss_podcasting->get_episode_download_link ( get_the_ID () );
327 327
 				} else {
328 328
 					$enclosure = $audio_file;
329 329
 				}
@@ -335,37 +335,37 @@  discard block
 block discarded – undo
335 335
 
336 336
 				// Get episode image from post featured image
337 337
 				$episode_image = '';
338
-				$image_id = get_post_thumbnail_id( get_the_ID() );
338
+				$image_id = get_post_thumbnail_id ( get_the_ID () );
339 339
 				if ( $image_id ) {
340
-					$image_att = wp_get_attachment_image_src( $image_id, 'full' );
340
+					$image_att = wp_get_attachment_image_src ( $image_id, 'full' );
341 341
 					if ( $image_att ) {
342
-						$episode_image = $image_att[0];
342
+						$episode_image = $image_att[ 0 ];
343 343
 					}
344 344
 				}
345 345
 
346 346
 				// Episode duration (default to 0:00 to ensure there is always a value for this)
347
-				$duration = get_post_meta( get_the_ID(), 'duration', true );
347
+				$duration = get_post_meta ( get_the_ID (), 'duration', true );
348 348
 				if ( ! $duration ) {
349 349
 					$duration = '0:00';
350 350
 				}
351 351
 
352 352
 				// File size
353
-				$size = get_post_meta( get_the_ID(), 'filesize_raw', true );
353
+				$size = get_post_meta ( get_the_ID (), 'filesize_raw', true );
354 354
 				if ( ! $size ) {
355 355
 					$size = 1;
356 356
 				}
357 357
 
358 358
 				// File MIME type (default to MP3/MP4 to ensure there is always a value for this)
359
-				$mime_type = $ss_podcasting->get_attachment_mimetype( $audio_file );
359
+				$mime_type = $ss_podcasting->get_attachment_mimetype ( $audio_file );
360 360
 				if ( ! $mime_type ) {
361
-					switch( $episode_type ) {
361
+					switch ( $episode_type ) {
362 362
 						case 'audio': $mime_type = 'audio/mpeg'; break;
363 363
 						case 'video': $mime_type = 'video/mp4'; break;
364 364
 					}
365 365
 				}
366 366
 
367 367
 				// Episode explicit flag
368
-				$ep_explicit = get_post_meta( get_the_ID(), 'explicit', true );
368
+				$ep_explicit = get_post_meta ( get_the_ID (), 'explicit', true );
369 369
 				if ( $ep_explicit && $ep_explicit == 'on' ) {
370 370
 					$itunes_explicit_flag = 'yes';
371 371
 					$googleplay_explicit_flag = 'Yes';
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 				}
376 376
 
377 377
 				// Episode block flag
378
-				$ep_block = get_post_meta( get_the_ID(), 'block', true );
378
+				$ep_block = get_post_meta ( get_the_ID (), 'block', true );
379 379
 				if ( $ep_block && $ep_block == 'on' ) {
380 380
 					$block_flag = 'yes';
381 381
 				} else {
@@ -383,52 +383,52 @@  discard block
 block discarded – undo
383 383
 				}
384 384
 
385 385
 				// Episode author
386
-				$author = esc_html( get_the_author() );
386
+				$author = esc_html ( get_the_author () );
387 387
 
388 388
 				// Episode content (with iframes removed)
389
-				$content = get_the_content_feed( 'rss2' );
390
-				$content = preg_replace( '/<\/?iframe(.|\s)*?>/', '', $content );
391
-				$content = apply_filters( 'ssp_feed_item_content', $content, get_the_ID() );
389
+				$content = get_the_content_feed ( 'rss2' );
390
+				$content = preg_replace ( '/<\/?iframe(.|\s)*?>/', '', $content );
391
+				$content = apply_filters ( 'ssp_feed_item_content', $content, get_the_ID () );
392 392
 
393 393
 				// iTunes summary is the full episode content, but must be shorter than 4000 characters
394
-				$itunes_summary = mb_substr( $content, 0, 3999 );
395
-				$itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID() );
396
-				$gp_description = apply_filters( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID() );
394
+				$itunes_summary = mb_substr ( $content, 0, 3999 );
395
+				$itunes_summary = apply_filters ( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID () );
396
+				$gp_description = apply_filters ( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID () );
397 397
 
398 398
 				// Episode description
399
-				ob_start();
400
-				the_excerpt_rss();
401
-				$description = ob_get_clean();
402
-				$description = apply_filters( 'ssp_feed_item_description', $description, get_the_ID() );
399
+				ob_start ();
400
+				the_excerpt_rss ();
401
+				$description = ob_get_clean ();
402
+				$description = apply_filters ( 'ssp_feed_item_description', $description, get_the_ID () );
403 403
 
404 404
 				// iTunes subtitle does not allow any HTML and must be shorter than 255 characters
405
-				$itunes_subtitle = strip_tags( strip_shortcodes( $description ) );
406
-				$itunes_subtitle = str_replace( array( '>', '<', '\'', '"', '`', '[andhellip;]', '[&hellip;]', '[&#8230;]' ), array( '', '', '', '', '', '', '', '' ), $itunes_subtitle );
407
-				$itunes_subtitle = mb_substr( $itunes_subtitle, 0, 254 );
408
-				$itunes_subtitle = apply_filters( 'ssp_feed_item_itunes_subtitle', $itunes_subtitle, get_the_ID() );
405
+				$itunes_subtitle = strip_tags ( strip_shortcodes ( $description ) );
406
+				$itunes_subtitle = str_replace ( array( '>', '<', '\'', '"', '`', '[andhellip;]', '[&hellip;]', '[&#8230;]' ), array( '', '', '', '', '', '', '', '' ), $itunes_subtitle );
407
+				$itunes_subtitle = mb_substr ( $itunes_subtitle, 0, 254 );
408
+				$itunes_subtitle = apply_filters ( 'ssp_feed_item_itunes_subtitle', $itunes_subtitle, get_the_ID () );
409 409
 
410 410
 		?>
411 411
 		<item>
412
-			<title><?php esc_html( the_title_rss() ); ?></title>
413
-			<link><?php esc_url( the_permalink_rss() ); ?></link>
414
-			<pubDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ) ); ?></pubDate>
412
+			<title><?php esc_html ( the_title_rss () ); ?></title>
413
+			<link><?php esc_url ( the_permalink_rss () ); ?></link>
414
+			<pubDate><?php echo esc_html ( mysql2date ( 'D, d M Y H:i:s +0000', get_post_time ( 'Y-m-d H:i:s', true ), false ) ); ?></pubDate>
415 415
 			<dc:creator><?php echo $author; ?></dc:creator>
416
-			<guid isPermaLink="false"><?php esc_html( the_guid() ); ?></guid>
416
+			<guid isPermaLink="false"><?php esc_html ( the_guid () ); ?></guid>
417 417
 			<description><![CDATA[<?php echo $description; ?>]]></description>
418 418
 			<itunes:subtitle><![CDATA[<?php echo $itunes_subtitle; ?>]]></itunes:subtitle>
419 419
 			<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
420 420
 			<itunes:summary><![CDATA[<?php echo $itunes_summary; ?>]]></itunes:summary>
421 421
 			<googleplay:description><![CDATA[<?php echo $gp_description; ?>]]></googleplay:description>
422 422
 <?php if ( $episode_image ) { ?>
423
-			<itunes:image href="<?php echo esc_url( $episode_image ); ?>"></itunes:image>
424
-			<googleplay:image href="<?php echo esc_url( $episode_image ); ?>"></googleplay:image>
423
+			<itunes:image href="<?php echo esc_url ( $episode_image ); ?>"></itunes:image>
424
+			<googleplay:image href="<?php echo esc_url ( $episode_image ); ?>"></googleplay:image>
425 425
 <?php } ?>
426
-			<enclosure url="<?php echo esc_url( $enclosure ); ?>" length="<?php echo esc_attr( $size ); ?>" type="<?php echo esc_attr( $mime_type ); ?>"></enclosure>
427
-			<itunes:explicit><?php echo esc_html( $itunes_explicit_flag ); ?></itunes:explicit>
428
-			<googleplay:explicit><?php echo esc_html( $googleplay_explicit_flag ); ?></googleplay:explicit>
429
-			<itunes:block><?php echo esc_html( $block_flag ); ?></itunes:block>
430
-			<googleplay:block><?php echo esc_html( $block_flag ); ?></googleplay:block>
431
-			<itunes:duration><?php echo esc_html( $duration ); ?></itunes:duration>
426
+			<enclosure url="<?php echo esc_url ( $enclosure ); ?>" length="<?php echo esc_attr ( $size ); ?>" type="<?php echo esc_attr ( $mime_type ); ?>"></enclosure>
427
+			<itunes:explicit><?php echo esc_html ( $itunes_explicit_flag ); ?></itunes:explicit>
428
+			<googleplay:explicit><?php echo esc_html ( $googleplay_explicit_flag ); ?></googleplay:explicit>
429
+			<itunes:block><?php echo esc_html ( $block_flag ); ?></itunes:block>
430
+			<googleplay:block><?php echo esc_html ( $block_flag ); ?></googleplay:block>
431
+			<itunes:duration><?php echo esc_html ( $duration ); ?></itunes:duration>
432 432
 			<itunes:author><?php echo $author; ?></itunes:author>
433 433
 		</item>
434 434
 <?php }
Please login to merge, or discard this patch.
includes/class-ssp-frontend.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -1134,6 +1134,7 @@
 block discarded – undo
1134 1134
 	 * returns the original URL
1135 1135
 	 *
1136 1136
 	 * @param    string    file
1137
+	 * @param string $file
1137 1138
 	 * @return   string    file or local file path
1138 1139
 	 */
1139 1140
 	function get_local_file_path( $file ) {
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -556,11 +556,11 @@  discard block
 block discarded – undo
556 556
 
557 557
 		if ( $size ) {
558 558
 
559
-		    $base = log ( $size ) / log( 1024 );
560
-		    $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
561
-		    $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
559
+			$base = log ( $size ) / log( 1024 );
560
+			$suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
561
+			$formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
562 562
 
563
-		    return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
563
+			return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
564 564
 		}
565 565
 
566 566
 		return false;
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 				wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS );
663 663
 			}
664 664
 
665
-		    return $mime;
665
+			return $mime;
666 666
 		}
667 667
 
668 668
 		return false;
@@ -796,15 +796,15 @@  discard block
 block discarded – undo
796 796
 				foreach ( $terms as $term ) {
797 797
 					$query[ $term->term_id ] = new stdClass();
798 798
 					$query[ $term->term_id ]->title = $term->name;
799
-		    		$query[ $term->term_id ]->url = get_term_link( $term );
799
+					$query[ $term->term_id ]->url = get_term_link( $term );
800 800
 
801
-		    		$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
801
+					$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
802 802
 
803
-		    		$posts = get_posts( $query_args );
803
+					$posts = get_posts( $query_args );
804 804
 
805
-		    		$count = count( $posts );
806
-		    		$query[ $term->term_id ]->count = $count;
807
-			    }
805
+					$count = count( $posts );
806
+					$query[ $term->term_id ]->count = $count;
807
+				}
808 808
 			}
809 809
 
810 810
 		}
@@ -914,18 +914,18 @@  discard block
 block discarded – undo
914 914
 				}
915 915
 
916 916
 				// Allow other actions - functions hooked on here must not output any data
917
-			    do_action( 'ssp_file_download', $file, $episode, $referrer );
917
+				do_action( 'ssp_file_download', $file, $episode, $referrer );
918 918
 
919
-			    // Set necessary headers
919
+				// Set necessary headers
920 920
 				header( "Pragma: no-cache" );
921 921
 				header( "Expires: 0" );
922 922
 				header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
923 923
 				header( "Robots: none" );
924 924
 
925
-		        // Check file referrer
926
-		        if( 'download' == $referrer ) {
925
+				// Check file referrer
926
+				if( 'download' == $referrer ) {
927 927
 
928
-		        	// Set size of file
928
+					// Set size of file
929 929
 					// Do we have anything in Cache/DB?
930 930
 					$size = wp_cache_get( $episode_id, 'filesize_raw' );
931 931
 
@@ -952,22 +952,22 @@  discard block
 block discarded – undo
952 952
 					}
953 953
 
954 954
 					// Send Content-Length header
955
-		        	if ( ! empty( $size ) ) {
955
+					if ( ! empty( $size ) ) {
956 956
 						header( "Content-Length: " . $size );
957 957
 					}
958 958
 
959
-		        	// Force file download
960
-		        	header( "Content-Type: application/force-download" );
959
+					// Force file download
960
+					header( "Content-Type: application/force-download" );
961 961
 
962
-			        // Set other relevant headers
963
-			        header( "Content-Description: File Transfer" );
964
-			        header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
965
-			        header( "Content-Transfer-Encoding: binary" );
962
+					// Set other relevant headers
963
+					header( "Content-Description: File Transfer" );
964
+					header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
965
+					header( "Content-Transfer-Encoding: binary" );
966 966
 
967
-			        // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
967
+					// Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
968 968
 					$file = str_replace( ' ', '%20', $file );
969 969
 
970
-			        // Use ssp_readfile_chunked() if allowed on the server or simply access file directly
970
+					// Use ssp_readfile_chunked() if allowed on the server or simply access file directly
971 971
 					@ssp_readfile_chunked( $file ) or header( 'Location: ' . $file );
972 972
 				} else {
973 973
 
@@ -1086,24 +1086,24 @@  discard block
 block discarded – undo
1086 1086
 	public function podcast_episode_shortcode ( $params ) {
1087 1087
 
1088 1088
 		$atts = shortcode_atts( array(
1089
-	        'episode' => 0,
1090
-	        'content' => 'title,player,details',
1091
-	    ), $params );
1089
+			'episode' => 0,
1090
+			'content' => 'title,player,details',
1091
+		), $params );
1092 1092
 
1093 1093
 		extract( $atts );
1094 1094
 
1095
-	    if ( ! $episode ) {
1096
-	    	return;
1097
-	    }
1095
+		if ( ! $episode ) {
1096
+			return;
1097
+		}
1098 1098
 
1099
-	    // Setup array of content items and trim whitespace
1100
-	    $content_items = explode( ',', $content );
1101
-	    $content_items = array_map( 'trim', $content_items );
1099
+		// Setup array of content items and trim whitespace
1100
+		$content_items = explode( ',', $content );
1101
+		$content_items = array_map( 'trim', $content_items );
1102 1102
 
1103
-	    // Get episode for display
1104
-	    $html = $this->podcast_episode( $episode, $content_items, 'shortcode' );
1103
+		// Get episode for display
1104
+		$html = $this->podcast_episode( $episode, $content_items, 'shortcode' );
1105 1105
 
1106
-	    return $html;
1106
+		return $html;
1107 1107
 
1108 1108
 	}
1109 1109
 
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 						if ( get_option( 'permalink_structure' ) ) {
1158 1158
 							$file = $this->get_episode_download_link( $episode_id );
1159 1159
 						}
1160
-		    			$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1160
+						$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1161 1161
 					break;
1162 1162
 
1163 1163
 					case 'details':
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 
1173 1173
 		$html .= '</div>' . "\n";
1174 1174
 
1175
-	    return $html;
1175
+		return $html;
1176 1176
 	}
1177 1177
 
1178 1178
 	/**
Please login to merge, or discard this patch.
Spacing   +298 added lines, -298 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -33,55 +33,55 @@  discard block
 block discarded – undo
33 33
 
34 34
 		$this->version = $version;
35 35
 
36
-		$this->dir = dirname( $file );
36
+		$this->dir = dirname ( $file );
37 37
 		$this->file = $file;
38
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
39
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) );
40
-		$this->template_path = trailingslashit( $this->dir ) . 'templates/';
41
-		$this->template_url = esc_url( trailingslashit( plugins_url( '/templates/', $file ) ) );
42
-		$this->home_url = trailingslashit( home_url() );
43
-		$this->site_url = trailingslashit( site_url() );
38
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
39
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $file ) ) );
40
+		$this->template_path = trailingslashit ( $this->dir ).'templates/';
41
+		$this->template_url = esc_url ( trailingslashit ( plugins_url ( '/templates/', $file ) ) );
42
+		$this->home_url = trailingslashit ( home_url () );
43
+		$this->site_url = trailingslashit ( site_url () );
44 44
 		$this->token = 'podcast';
45 45
 
46 46
 		// Add meta data to start of podcast content
47
-		$locations = get_option( 'ss_podcasting_player_locations', array() );
47
+		$locations = get_option ( 'ss_podcasting_player_locations', array() );
48 48
 
49
-		if ( in_array( 'content', (array) $locations ) ) {
50
-			add_filter( 'the_content', array( $this, 'content_meta_data' ), 10, 1 );
49
+		if ( in_array ( 'content', (array) $locations ) ) {
50
+			add_filter ( 'the_content', array( $this, 'content_meta_data' ), 10, 1 );
51 51
 		}
52 52
 
53
-		if ( in_array( 'excerpt', (array) $locations ) ) {
54
-			add_filter( 'the_excerpt', array( $this, 'get_excerpt_meta_data' ), 10, 1 );
53
+		if ( in_array ( 'excerpt', (array) $locations ) ) {
54
+			add_filter ( 'the_excerpt', array( $this, 'get_excerpt_meta_data' ), 10, 1 );
55 55
 		}
56 56
 
57
-		if ( in_array( 'excerpt_embed', (array) $locations ) ) {
58
-			add_filter( 'the_excerpt_embed', array( $this, 'get_embed_meta_data' ), 10, 1 );
57
+		if ( in_array ( 'excerpt_embed', (array) $locations ) ) {
58
+			add_filter ( 'the_excerpt_embed', array( $this, 'get_embed_meta_data' ), 10, 1 );
59 59
 		}
60 60
 
61 61
 		// Add SSP label and version to generator tags
62
-		add_action( 'get_the_generator_html', array( $this, 'generator_tag' ), 10, 2 );
63
-		add_action( 'get_the_generator_xhtml', array( $this, 'generator_tag' ), 10, 2 );
62
+		add_action ( 'get_the_generator_html', array( $this, 'generator_tag' ), 10, 2 );
63
+		add_action ( 'get_the_generator_xhtml', array( $this, 'generator_tag' ), 10, 2 );
64 64
 
65 65
 		// Add RSS meta tag to site header
66
-		add_action( 'wp_head' , array( $this, 'rss_meta_tag' ) );
66
+		add_action ( 'wp_head', array( $this, 'rss_meta_tag' ) );
67 67
 
68 68
 		// Add podcast episode to main query loop if setting is activated
69
-		add_action( 'pre_get_posts' , array( $this, 'add_to_home_query' ) );
69
+		add_action ( 'pre_get_posts', array( $this, 'add_to_home_query' ) );
70 70
 
71 71
 		// Make sure to fetch all relevant post types when viewing series archive
72
-		add_action( 'pre_get_posts' , array( $this, 'add_all_post_types' ) );
72
+		add_action ( 'pre_get_posts', array( $this, 'add_all_post_types' ) );
73 73
 
74 74
 		// Download podcast episode
75
-		add_action( 'wp', array( $this, 'download_file' ), 1 );
75
+		add_action ( 'wp', array( $this, 'download_file' ), 1 );
76 76
 
77 77
 		// Add shortcodes
78
-		add_shortcode( 'ss_podcast', 'ss_podcast_shortcode' );
79
-		add_shortcode( 'podcast_episode', array( $this, 'podcast_episode_shortcode' ) );
78
+		add_shortcode ( 'ss_podcast', 'ss_podcast_shortcode' );
79
+		add_shortcode ( 'podcast_episode', array( $this, 'podcast_episode_shortcode' ) );
80 80
 
81 81
 		// Register widgets
82
-		add_action( 'widgets_init', array( $this, 'register_widgets' ), 1 );
82
+		add_action ( 'widgets_init', array( $this, 'register_widgets' ), 1 );
83 83
 
84
-		add_filter( 'feed_content_type', array( $this, 'feed_content_type' ), 10, 2 );
84
+		add_filter ( 'feed_content_type', array( $this, 'feed_content_type' ), 10, 2 );
85 85
 	}
86 86
 
87 87
 	/**
@@ -92,36 +92,36 @@  discard block
 block discarded – undo
92 92
 	public function get_episode_download_link( $episode_id, $referrer = '' ) {
93 93
 
94 94
 		// Get file URL
95
-		$file = $this->get_enclosure( $episode_id );
95
+		$file = $this->get_enclosure ( $episode_id );
96 96
 
97 97
 		if ( ! $file ) {
98 98
 			return;
99 99
 		}
100 100
 
101 101
 		// Get download link based on permalink structure
102
-		if ( get_option( 'permalink_structure' ) ) {
103
-			$episode = get_post( $episode_id );
102
+		if ( get_option ( 'permalink_structure' ) ) {
103
+			$episode = get_post ( $episode_id );
104 104
 
105 105
 			// Get file extension - default to MP3 to prevent empty extension strings
106
-			$ext = pathinfo( $file, PATHINFO_EXTENSION );
107
-			if( ! $ext ) {
106
+			$ext = pathinfo ( $file, PATHINFO_EXTENSION );
107
+			if ( ! $ext ) {
108 108
 				$ext = 'mp3';
109 109
 			}
110 110
 
111
-			$link = $this->home_url . 'podcast-download/' . $episode_id . '/' . $episode->post_name . '.' . $ext;
111
+			$link = $this->home_url.'podcast-download/'.$episode_id.'/'.$episode->post_name.'.'.$ext;
112 112
 		} else {
113
-			$link = add_query_arg( array( 'podcast_episode' => $episode_id ), $this->home_url );
113
+			$link = add_query_arg ( array( 'podcast_episode' => $episode_id ), $this->home_url );
114 114
 		}
115 115
 
116 116
 		// Allow for dyamic referrer
117
-		$referrer = apply_filters( 'ssp_download_referrer', $referrer, $episode_id );
117
+		$referrer = apply_filters ( 'ssp_download_referrer', $referrer, $episode_id );
118 118
 
119 119
 		// Add referrer flag if supplied
120 120
 		if ( $referrer ) {
121
-			$link = add_query_arg( array( 'ref' => $referrer ), $link );
121
+			$link = add_query_arg ( array( 'ref' => $referrer ), $link );
122 122
 		}
123 123
 
124
-		return apply_filters( 'ssp_episode_download_link', esc_url( $link ), $episode_id, $file );
124
+		return apply_filters ( 'ssp_episode_download_link', esc_url ( $link ), $episode_id, $file );
125 125
 	}
126 126
 
127 127
 	/**
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	public function get_episode_type( $episode_id = 0 ) {
133 133
 
134
-		if( ! $episode_id ) {
134
+		if ( ! $episode_id ) {
135 135
 			return false;
136 136
 		}
137 137
 
138
-		$type = get_post_meta( $episode_id , 'episode_type' , true );
138
+		$type = get_post_meta ( $episode_id, 'episode_type', true );
139 139
 
140
-		if( ! $type ) {
140
+		if ( ! $type ) {
141 141
 			$type = 'audio';
142 142
 		}
143 143
 
@@ -153,32 +153,32 @@  discard block
 block discarded – undo
153 153
 		global $post, $wp_current_filter, $episode_context;
154 154
 
155 155
 		// Don't output unformatted data on excerpts
156
-		if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) {
156
+		if ( in_array ( 'get_the_excerpt', (array) $wp_current_filter ) ) {
157 157
 			return $content;
158 158
 		}
159 159
 
160 160
 		// Don't output episode meta in shortcode or widget
161
-		if ( isset( $episode_context ) && in_array( $episode_context, array( 'shortcode', 'widget' ) ) ) {
161
+		if ( isset( $episode_context ) && in_array ( $episode_context, array( 'shortcode', 'widget' ) ) ) {
162 162
 			return $content;
163 163
 		}
164 164
 
165
-		if( post_password_required( $post->ID ) ) {
165
+		if ( post_password_required ( $post->ID ) ) {
166 166
 			return $content;
167 167
 		}
168 168
 
169
-		$podcast_post_types = ssp_post_types( true );
169
+		$podcast_post_types = ssp_post_types ( true );
170 170
 
171
-		if ( in_array( $post->post_type, $podcast_post_types ) && ! is_feed() && ! isset( $_GET['feed'] ) ) {
171
+		if ( in_array ( $post->post_type, $podcast_post_types ) && ! is_feed () && ! isset( $_GET[ 'feed' ] ) ) {
172 172
 
173 173
 			// Get episode meta data
174
-			$meta = $this->episode_meta( $post->ID, 'content' );
174
+			$meta = $this->episode_meta ( $post->ID, 'content' );
175 175
 
176 176
 			// Get specified player position
177
-			$player_position = get_option( 'ss_podcasting_player_content_location', 'above' );
177
+			$player_position = get_option ( 'ss_podcasting_player_content_location', 'above' );
178 178
 
179
-			switch( $player_position ) {
180
-				case 'above': $content = $meta . $content; break;
181
-				case 'below': $content = $content . $meta; break;
179
+			switch ( $player_position ) {
180
+				case 'above': $content = $meta.$content; break;
181
+				case 'below': $content = $content.$meta; break;
182 182
 			}
183 183
 
184 184
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @return string          Modified excerpt
193 193
 	 */
194 194
 	public function get_excerpt_meta_data( $excerpt = '' ) {
195
-		return $this->excerpt_meta_data( $excerpt, 'excerpt' );
195
+		return $this->excerpt_meta_data ( $excerpt, 'excerpt' );
196 196
 	}
197 197
 
198 198
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @return string          Modified excerpt
202 202
 	 */
203 203
 	public function get_embed_meta_data( $excerpt = '' ) {
204
-		return $this->excerpt_meta_data( $excerpt, 'embed' );
204
+		return $this->excerpt_meta_data ( $excerpt, 'embed' );
205 205
 	}
206 206
 
207 207
 	/**
@@ -212,17 +212,17 @@  discard block
 block discarded – undo
212 212
 	public function excerpt_meta_data( $excerpt = '', $content = 'excerpt' ) {
213 213
 		global $post;
214 214
 
215
-		if( post_password_required( $post->ID ) ) {
215
+		if ( post_password_required ( $post->ID ) ) {
216 216
 			return $excerpt;
217 217
 		}
218 218
 
219
-		$podcast_post_types = ssp_post_types( true );
219
+		$podcast_post_types = ssp_post_types ( true );
220 220
 
221
-		if ( ( in_array( $post->post_type, $podcast_post_types ) ) && ! is_feed() ) {
221
+		if ( ( in_array ( $post->post_type, $podcast_post_types ) ) && ! is_feed () ) {
222 222
 
223
-			$meta = $this->episode_meta( $post->ID, $content );
223
+			$meta = $this->episode_meta ( $post->ID, $content );
224 224
 
225
-			$excerpt = $meta . $excerpt;
225
+			$excerpt = $meta.$excerpt;
226 226
 
227 227
 		}
228 228
 
@@ -243,34 +243,34 @@  discard block
 block discarded – undo
243 243
 			return $meta;
244 244
 		}
245 245
 
246
-		$file = $this->get_enclosure( $episode_id );
246
+		$file = $this->get_enclosure ( $episode_id );
247 247
 
248 248
 		if ( $file ) {
249 249
 
250
-			if ( get_option( 'permalink_structure' ) ) {
251
-				$file = $this->get_episode_download_link( $episode_id );
250
+			if ( get_option ( 'permalink_structure' ) ) {
251
+				$file = $this->get_episode_download_link ( $episode_id );
252 252
 			}
253 253
 
254 254
 			// Hide audio player in `ss_podcast` shortcode by default
255 255
 			$show_player = true;
256
-			if( 'shortcode' == $context ) {
256
+			if ( 'shortcode' == $context ) {
257 257
 				$show_player = false;
258 258
 			}
259 259
 
260 260
 			// Allow media player to be dynamically hidden/displayed
261
-			$show_player = apply_filters( 'ssp_show_media_player', $show_player, $context );
261
+			$show_player = apply_filters ( 'ssp_show_media_player', $show_player, $context );
262 262
 
263 263
 			// Show audio player if requested
264
-			if( $show_player ) {
265
-				$meta .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>';
264
+			if ( $show_player ) {
265
+				$meta .= '<div class="podcast_player">'.$this->media_player ( $file, $episode_id ).'</div>';
266 266
 			}
267 267
 
268
-			if ( apply_filters( 'ssp_show_episode_details', true, $episode_id, $context ) ) {
269
-				$meta .= $this->episode_meta_details( $episode_id, $context );
268
+			if ( apply_filters ( 'ssp_show_episode_details', true, $episode_id, $context ) ) {
269
+				$meta .= $this->episode_meta_details ( $episode_id, $context );
270 270
 			}
271 271
 		}
272 272
 
273
-		$meta = apply_filters( 'ssp_episode_meta', $meta, $episode_id, $context );
273
+		$meta = apply_filters ( 'ssp_episode_meta', $meta, $episode_id, $context );
274 274
 
275 275
 		return $meta;
276 276
 	}
@@ -281,36 +281,36 @@  discard block
 block discarded – undo
281 281
 	 * @param  string  $context    Context for display
282 282
 	 * @return string              Episode meta details
283 283
 	 */
284
-	public function episode_meta_details ( $episode_id = 0, $context = 'content' ) {
284
+	public function episode_meta_details( $episode_id = 0, $context = 'content' ) {
285 285
 
286 286
 		if ( ! $episode_id ) {
287 287
 			return;
288 288
 		}
289 289
 
290
-		$file = $this->get_enclosure( $episode_id );
290
+		$file = $this->get_enclosure ( $episode_id );
291 291
 
292 292
 		if ( ! $file ) {
293 293
 			return;
294 294
 		}
295 295
 
296
-		$link = $this->get_episode_download_link( $episode_id, 'download' );
297
-		$duration = get_post_meta( $episode_id , 'duration' , true );
298
-		$size = get_post_meta( $episode_id , 'filesize' , true );
296
+		$link = $this->get_episode_download_link ( $episode_id, 'download' );
297
+		$duration = get_post_meta ( $episode_id, 'duration', true );
298
+		$size = get_post_meta ( $episode_id, 'filesize', true );
299 299
 		if ( ! $size ) {
300
-			$size_data = $this->get_file_size( $file );
301
-			$size = $size_data['formatted'];
300
+			$size_data = $this->get_file_size ( $file );
301
+			$size = $size_data[ 'formatted' ];
302 302
 			if ( $size ) {
303
-				if ( isset( $size_data['formatted'] ) ) {
304
-					update_post_meta( $episode_id, 'filesize', $size_data['formatted'] );
303
+				if ( isset( $size_data[ 'formatted' ] ) ) {
304
+					update_post_meta ( $episode_id, 'filesize', $size_data[ 'formatted' ] );
305 305
 				}
306 306
 
307
-				if ( isset( $size_data['raw'] ) ) {
308
-					update_post_meta( $episode_id, 'filesize_raw', $size_data['raw'] );
307
+				if ( isset( $size_data[ 'raw' ] ) ) {
308
+					update_post_meta ( $episode_id, 'filesize_raw', $size_data[ 'raw' ] );
309 309
 				}
310 310
 			}
311 311
 		}
312 312
 
313
-		$date_recorded = get_post_meta( $episode_id, 'date_recorded', true );
313
+		$date_recorded = get_post_meta ( $episode_id, 'date_recorded', true );
314 314
 
315 315
 		// Build up meta data array with default values
316 316
 		$meta = array(
@@ -321,62 +321,62 @@  discard block
 block discarded – undo
321 321
 			'date_recorded' => '',
322 322
 		);
323 323
 
324
-		if( $link ) {
325
-			$meta['link'] = $link;
324
+		if ( $link ) {
325
+			$meta[ 'link' ] = $link;
326 326
 		}
327 327
 
328
-		if( $link && apply_filters( 'ssp_show_new_window_link', true, $context ) ) {
329
-			$meta['new_window'] = true;
328
+		if ( $link && apply_filters ( 'ssp_show_new_window_link', true, $context ) ) {
329
+			$meta[ 'new_window' ] = true;
330 330
 		}
331 331
 
332
-		if( $link ) {
333
-			$meta['duration'] = $duration;
332
+		if ( $link ) {
333
+			$meta[ 'duration' ] = $duration;
334 334
 		}
335 335
 
336
-		if( $size ) {
337
-			$meta['size'] = $size;
336
+		if ( $size ) {
337
+			$meta[ 'size' ] = $size;
338 338
 		}
339 339
 
340
-		if( $date_recorded ) {
341
-			$meta['date_recorded'] = $date_recorded;
340
+		if ( $date_recorded ) {
341
+			$meta[ 'date_recorded' ] = $date_recorded;
342 342
 		}
343 343
 
344 344
 		// Allow dynamic filtering of meta data - to remove, add or reorder meta items
345
-		$meta = apply_filters( 'ssp_episode_meta_details', $meta, $episode_id, $context );
345
+		$meta = apply_filters ( 'ssp_episode_meta_details', $meta, $episode_id, $context );
346 346
 
347 347
 		$meta_display = '';
348
-		$meta_sep = apply_filters( 'ssp_episode_meta_separator', ' | ' );
348
+		$meta_sep = apply_filters ( 'ssp_episode_meta_separator', ' | ' );
349 349
 		foreach ( $meta as $key => $data ) {
350 350
 
351
-			if( ! $data ) {
351
+			if ( ! $data ) {
352 352
 				continue;
353 353
 			}
354 354
 
355
-			if( $meta_display ) {
355
+			if ( $meta_display ) {
356 356
 				$meta_display .= $meta_sep;
357 357
 			}
358 358
 
359
-			switch( $key ) {
359
+			switch ( $key ) {
360 360
 
361 361
 				case 'link':
362
-					$meta_display .= '<a href="' . esc_url( $data ) . '" title="' . get_the_title() . ' ">' . __( 'Download file' , 'seriously-simple-podcasting' ) . '</a>';
362
+					$meta_display .= '<a href="'.esc_url ( $data ).'" title="'.get_the_title ().' ">'.__ ( 'Download file', 'seriously-simple-podcasting' ).'</a>';
363 363
 				break;
364 364
 
365 365
 				case 'new_window':
366
-					$play_link = add_query_arg( 'ref', 'new_window', $link );
367
-					$meta_display .= '<a href="' . esc_url( $play_link ) . '" target="_blank" title="' . get_the_title() . ' ">' . __( 'Play in new window' , 'seriously-simple-podcasting' ) . '</a>';
366
+					$play_link = add_query_arg ( 'ref', 'new_window', $link );
367
+					$meta_display .= '<a href="'.esc_url ( $play_link ).'" target="_blank" title="'.get_the_title ().' ">'.__ ( 'Play in new window', 'seriously-simple-podcasting' ).'</a>';
368 368
 				break;
369 369
 
370 370
 				case 'duration':
371
-					$meta_display .= __( 'Duration' , 'seriously-simple-podcasting' ) . ': ' . $data;
371
+					$meta_display .= __ ( 'Duration', 'seriously-simple-podcasting' ).': '.$data;
372 372
 				break;
373 373
 
374 374
 				case 'size':
375
-					$meta_display .= __( 'Size' , 'seriously-simple-podcasting' ) . ': ' . $data;
375
+					$meta_display .= __ ( 'Size', 'seriously-simple-podcasting' ).': '.$data;
376 376
 				break;
377 377
 
378 378
 				case 'date_recorded':
379
-					$meta_display .= __( 'Recorded on' , 'seriously-simple-podcasting' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $data ) );
379
+					$meta_display .= __ ( 'Recorded on', 'seriously-simple-podcasting' ).' '.date_i18n ( get_option ( 'date_format' ), strtotime ( $data ) );
380 380
 				break;
381 381
 
382 382
 				// Allow for custom items to be added, but only allow a small amount of HTML tags
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
 							'target' => array(),
393 393
 						),
394 394
 					);
395
-					$meta_display .= wp_kses( $data, $allowed_tags );
395
+					$meta_display .= wp_kses ( $data, $allowed_tags );
396 396
 				break;
397 397
 
398 398
 			}
399 399
 		}
400 400
 
401
-		$meta_display = '<div class="podcast_meta"><aside>' . $meta_display . '</aside></div>';
401
+		$meta_display = '<div class="podcast_meta"><aside>'.$meta_display.'</aside></div>';
402 402
 
403 403
 		return $meta_display;
404 404
 
@@ -410,43 +410,43 @@  discard block
 block discarded – undo
410 410
 	 */
411 411
 	public function add_to_home_query( $query ) {
412 412
 
413
-		if ( is_admin() ) {
413
+		if ( is_admin () ) {
414 414
 			return;
415 415
 		}
416 416
 
417
-		$include_in_main_query = get_option('ss_podcasting_include_in_main_query');
417
+		$include_in_main_query = get_option ( 'ss_podcasting_include_in_main_query' );
418 418
 		if ( $include_in_main_query && $include_in_main_query == 'on' ) {
419
-			if ( $query->is_home() && $query->is_main_query() ) {
420
-				$query->set( 'post_type', array( 'post', 'podcast' ) );
419
+			if ( $query->is_home () && $query->is_main_query () ) {
420
+				$query->set ( 'post_type', array( 'post', 'podcast' ) );
421 421
 			}
422 422
 		}
423 423
 	}
424 424
 
425
-	public function add_all_post_types ( $query ) {
425
+	public function add_all_post_types( $query ) {
426 426
 
427
-		if ( is_admin() ) {
427
+		if ( is_admin () ) {
428 428
 			return;
429 429
 		}
430 430
 
431
-		if ( ! $query->is_main_query() ) {
431
+		if ( ! $query->is_main_query () ) {
432 432
 			return;
433 433
 		}
434 434
 
435
-		if ( is_post_type_archive( 'podcast' ) || is_tax( 'series' ) ) {
435
+		if ( is_post_type_archive ( 'podcast' ) || is_tax ( 'series' ) ) {
436 436
 
437
-			$podcast_post_types = ssp_post_types( false );
437
+			$podcast_post_types = ssp_post_types ( false );
438 438
 
439 439
 			if ( empty( $podcast_post_types ) ) {
440 440
 				return;
441 441
 			}
442 442
 
443
-			$episode_ids = ssp_episode_ids();
443
+			$episode_ids = ssp_episode_ids ();
444 444
 			if ( ! empty( $episode_ids ) ) {
445 445
 
446
-				$query->set( 'post__in', $episode_ids );
446
+				$query->set ( 'post__in', $episode_ids );
447 447
 
448
-				$podcast_post_types[] = 'podcast';
449
-				$query->set( 'post_type', $podcast_post_types );
448
+				$podcast_post_types[ ] = 'podcast';
449
+				$query->set ( 'post_type', $podcast_post_types );
450 450
 
451 451
 			}
452 452
 
@@ -464,29 +464,29 @@  discard block
 block discarded – undo
464 464
 		if ( $file ) {
465 465
 
466 466
 			// Include media functions if necessary
467
-			if ( ! function_exists( 'wp_read_audio_metadata' ) ) {
468
-				require_once( ABSPATH . 'wp-admin/includes/media.php' );
467
+			if ( ! function_exists ( 'wp_read_audio_metadata' ) ) {
468
+				require_once( ABSPATH.'wp-admin/includes/media.php' );
469 469
 			}
470 470
 
471 471
 			// translate file URL to local file path if possible
472
-			$file = $this->get_local_file_path( $file );
472
+			$file = $this->get_local_file_path ( $file );
473 473
 
474 474
 			// Get file data (for local file)
475
-			$data = wp_read_audio_metadata( $file );
475
+			$data = wp_read_audio_metadata ( $file );
476 476
 
477 477
 			$raw = $formatted = '';
478 478
 
479 479
 			if ( $data ) {
480
-				$raw = $data['filesize'];
481
-				$formatted = $this->format_bytes( $raw );
480
+				$raw = $data[ 'filesize' ];
481
+				$formatted = $this->format_bytes ( $raw );
482 482
 			} else {
483 483
 
484 484
 				// get file data (for remote file)
485
-				$data = wp_remote_head( $file, array( 'timeout' => 10, 'redirection' => 5 ) );
485
+				$data = wp_remote_head ( $file, array( 'timeout' => 10, 'redirection' => 5 ) );
486 486
 
487
-				if ( ! is_wp_error( $data ) && is_array( $data ) && isset( $data['headers']['content-length'] ) ) {
488
-					$raw = $data['headers']['content-length'];
489
-					$formatted = $this->format_bytes( $raw );
487
+				if ( ! is_wp_error ( $data ) && is_array ( $data ) && isset( $data[ 'headers' ][ 'content-length' ] ) ) {
488
+					$raw = $data[ 'headers' ][ 'content-length' ];
489
+					$formatted = $this->format_bytes ( $raw );
490 490
 				}
491 491
 			}
492 492
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 					'formatted' => $formatted
498 498
 				);
499 499
 
500
-				return apply_filters( 'ssp_file_size', $size, $file );
500
+				return apply_filters ( 'ssp_file_size', $size, $file );
501 501
 			}
502 502
 
503 503
 		}
@@ -515,30 +515,30 @@  discard block
 block discarded – undo
515 515
 		if ( $file ) {
516 516
 
517 517
 			// Include media functions if necessary
518
-			if ( ! function_exists( 'wp_read_audio_metadata' ) ) {
519
-				require_once( ABSPATH . 'wp-admin/includes/media.php' );
518
+			if ( ! function_exists ( 'wp_read_audio_metadata' ) ) {
519
+				require_once( ABSPATH.'wp-admin/includes/media.php' );
520 520
 			}
521 521
 
522 522
 			// translate file URL to local file path if possible
523
-			$file = $this->get_local_file_path( $file );
523
+			$file = $this->get_local_file_path ( $file );
524 524
 
525 525
 			// Get file data (will only work for local files)
526
-			$data = wp_read_audio_metadata( $file );
526
+			$data = wp_read_audio_metadata ( $file );
527 527
 
528 528
 			$duration = false;
529 529
 
530 530
 			if ( $data ) {
531
-				if ( isset( $data['length_formatted'] ) && strlen( $data['length_formatted'] ) > 0 ) {
532
-					$duration = $data['length_formatted'];
531
+				if ( isset( $data[ 'length_formatted' ] ) && strlen ( $data[ 'length_formatted' ] ) > 0 ) {
532
+					$duration = $data[ 'length_formatted' ];
533 533
 				} else {
534
-					if ( isset( $data['length'] ) && strlen( $data['length'] ) > 0 ) {
535
-						$duration = gmdate( 'H:i:s', $data['length'] );
534
+					if ( isset( $data[ 'length' ] ) && strlen ( $data[ 'length' ] ) > 0 ) {
535
+						$duration = gmdate ( 'H:i:s', $data[ 'length' ] );
536 536
 					}
537 537
 				}
538 538
 			}
539 539
 
540 540
 			if ( $data ) {
541
-				return apply_filters( 'ssp_file_duration', $duration, $file );
541
+				return apply_filters ( 'ssp_file_duration', $duration, $file );
542 542
 			}
543 543
 
544 544
 		}
@@ -552,15 +552,15 @@  discard block
 block discarded – undo
552 552
 	 * @param  integer $precision Level of precision for formatting
553 553
 	 * @return mixed              Formatted file size on success, false on failure
554 554
 	 */
555
-	protected function format_bytes( $size , $precision = 2 ) {
555
+	protected function format_bytes( $size, $precision = 2 ) {
556 556
 
557 557
 		if ( $size ) {
558 558
 
559
-		    $base = log ( $size ) / log( 1024 );
560
-		    $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
561
-		    $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
559
+		    $base = log ( $size ) / log ( 1024 );
560
+		    $suffixes = array( '', 'k', 'M', 'G', 'T' );
561
+		    $formatted_size = round ( pow ( 1024, $base - floor ( $base ) ), $precision ).$suffixes[ floor ( $base ) ];
562 562
 
563
-		    return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
563
+		    return apply_filters ( 'ssp_file_size_formatted', $formatted_size, $size );
564 564
 		}
565 565
 
566 566
 		return false;
@@ -576,10 +576,10 @@  discard block
 block discarded – undo
576 576
 
577 577
 		// Let's hash the URL to ensure that we don't get
578 578
 		// any illegal chars that might break the cache.
579
-		$key = md5( $url );
579
+		$key = md5 ( $url );
580 580
 
581 581
 		// Do we have anything in the cache for this URL?
582
-		$attachment_id = wp_cache_get( $key, 'attachment_id' );
582
+		$attachment_id = wp_cache_get ( $key, 'attachment_id' );
583 583
 
584 584
 		if ( $attachment_id === false ) {
585 585
 
@@ -596,39 +596,39 @@  discard block
 block discarded – undo
596 596
 
597 597
 
598 598
 			// Function introduced in 4.0, let's try this first.
599
-			if ( function_exists( 'attachment_url_to_postid' ) ) {
600
-				$attachment_id = absint( attachment_url_to_postid( $url ) );
599
+			if ( function_exists ( 'attachment_url_to_postid' ) ) {
600
+				$attachment_id = absint ( attachment_url_to_postid ( $url ) );
601 601
 				if ( 0 !== $attachment_id ) {
602
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
602
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
603 603
 					return $attachment_id;
604 604
 				}
605 605
 			}
606 606
 
607 607
 			// Then this.
608
-			if ( preg_match( '#\.[a-zA-Z0-9]+$#', $url ) ) {
609
-				$sql = $wpdb->prepare(
608
+			if ( preg_match ( '#\.[a-zA-Z0-9]+$#', $url ) ) {
609
+				$sql = $wpdb->prepare (
610 610
 					"SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND guid = %s",
611
-					esc_url_raw( $url )
611
+					esc_url_raw ( $url )
612 612
 				);
613
-				$attachment_id = absint( $wpdb->get_var( $sql ) );
613
+				$attachment_id = absint ( $wpdb->get_var ( $sql ) );
614 614
 				if ( 0 !== $attachment_id ) {
615
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
615
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
616 616
 					return $attachment_id;
617 617
 				}
618 618
 			}
619 619
 
620 620
 			// And then try this
621
-			$upload_dir_paths = wp_upload_dir();
622
-			if ( false !== strpos( $url, $upload_dir_paths['baseurl'] ) ) {
621
+			$upload_dir_paths = wp_upload_dir ();
622
+			if ( false !== strpos ( $url, $upload_dir_paths[ 'baseurl' ] ) ) {
623 623
 				// Ensure that we have file extension that matches iTunes.
624
-				$url = preg_replace( '/(?=\.(m4a|mp3|mov|mp4)$)/i', '', $url );
624
+				$url = preg_replace ( '/(?=\.(m4a|mp3|mov|mp4)$)/i', '', $url );
625 625
 				// Remove the upload path base directory from the attachment URL
626
-				$url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $url );
626
+				$url = str_replace ( $upload_dir_paths[ 'baseurl' ].'/', '', $url );
627 627
 				// Finally, run a custom database query to get the attachment ID from the modified attachment URL
628
-				$sql = $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $url );
629
-				$attachment_id = absint( $wpdb->get_var( $sql ) );
628
+				$sql = $wpdb->prepare ( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $url );
629
+				$attachment_id = absint ( $wpdb->get_var ( $sql ) );
630 630
 				if ( 0 !== $attachment_id ) {
631
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
631
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
632 632
 					return $attachment_id;
633 633
 				}
634 634
 			}
@@ -646,20 +646,20 @@  discard block
 block discarded – undo
646 646
 	public function get_attachment_mimetype( $attachment = '' ) {
647 647
 
648 648
 		// Let's hash the URL to ensure that we don't get any illegal chars that might break the cache.
649
-		$key = md5( $attachment );
649
+		$key = md5 ( $attachment );
650 650
 
651 651
 		if ( $attachment ) {
652 652
 			// Do we have anything in the cache for this?
653
-			$mime = wp_cache_get( $key, 'mime-type' );
653
+			$mime = wp_cache_get ( $key, 'mime-type' );
654 654
 			if ( $mime === false ) {
655 655
 
656 656
 				// Get the ID
657
-				$id = $this->get_attachment_id_from_url( $attachment );
657
+				$id = $this->get_attachment_id_from_url ( $attachment );
658 658
 
659 659
 				// Get the MIME type
660
-				$mime = get_post_mime_type( $id );
660
+				$mime = get_post_mime_type ( $id );
661 661
 				// Set the cache
662
-				wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS );
662
+				wp_cache_set ( $key, $mime, 'mime-type', DAY_IN_SECONDS );
663 663
 			}
664 664
 
665 665
 		    return $mime;
@@ -676,8 +676,8 @@  discard block
 block discarded – undo
676 676
 	 * @return string        	   Audio player HTML on success, false on failure
677 677
 	 */
678 678
 	public function audio_player( $src = '', $episode_id = 0 ) {
679
-		$player = $this->media_player( $src, $episode_id );
680
-		return apply_filters( 'ssp_audio_player', $player, $src, $episode_id );
679
+		$player = $this->media_player ( $src, $episode_id );
680
+		return apply_filters ( 'ssp_audio_player', $player, $src, $episode_id );
681 681
 	}
682 682
 
683 683
 	/**
@@ -686,40 +686,40 @@  discard block
 block discarded – undo
686 686
 	 * @param  integer $episode_id Episode ID for audio file
687 687
 	 * @return string              Media player HTML on success, empty string on failure
688 688
 	 */
689
-	public function media_player ( $src = '', $episode_id = 0 ) {
689
+	public function media_player( $src = '', $episode_id = 0 ) {
690 690
 		$player = '';
691 691
 
692 692
 		if ( $src ) {
693 693
 
694 694
 			// Get episode type and default to audio
695
-			$type = $this->get_episode_type( $episode_id );
696
-			if( ! $type ) {
695
+			$type = $this->get_episode_type ( $episode_id );
696
+			if ( ! $type ) {
697 697
 				$type = 'audio';
698 698
 			}
699 699
 
700 700
 			// Switch to podcast player URL
701
-			$src = str_replace( 'podcast-download', 'podcast-player', $src );
701
+			$src = str_replace ( 'podcast-download', 'podcast-player', $src );
702 702
 
703 703
 			// Set up paramters for media player
704 704
 			$params = array( 'src' => $src, 'preload' => 'none' );
705 705
 
706 706
 			// Use built-in WordPress media player
707
-			switch( $type ) {
708
-				case 'audio': $player = wp_audio_shortcode( $params ); break;
707
+			switch ( $type ) {
708
+				case 'audio': $player = wp_audio_shortcode ( $params ); break;
709 709
 				case 'video':
710 710
 					// Use featured image as video poster
711
-					if( $episode_id && has_post_thumbnail( $episode_id ) ) {
712
-						$poster = wp_get_attachment_url( get_post_thumbnail_id( $episode_id ) );
713
-						if( $poster ) {
714
-							$params['poster'] = $poster;
711
+					if ( $episode_id && has_post_thumbnail ( $episode_id ) ) {
712
+						$poster = wp_get_attachment_url ( get_post_thumbnail_id ( $episode_id ) );
713
+						if ( $poster ) {
714
+							$params[ 'poster' ] = $poster;
715 715
 						}
716 716
 					}
717
-					$player = wp_video_shortcode( $params );
717
+					$player = wp_video_shortcode ( $params );
718 718
 				break;
719 719
 			}
720 720
 
721 721
 			// Allow filtering so that alternative players can be used
722
-			$player = apply_filters( 'ssp_media_player', $player, $src, $episode_id );
722
+			$player = apply_filters ( 'ssp_media_player', $player, $src, $episode_id );
723 723
 		}
724 724
 
725 725
 		return $player;
@@ -734,17 +734,17 @@  discard block
 block discarded – undo
734 734
 	public function get_image( $id = 0, $size = 'full' ) {
735 735
 		$image = '';
736 736
 
737
-		if ( has_post_thumbnail( $id ) ) {
737
+		if ( has_post_thumbnail ( $id ) ) {
738 738
 			// If not a string or an array, and not an integer, default to 200x9999.
739
-			if ( is_int( $size ) || ( 0 < intval( $size ) ) ) {
740
-				$size = array( intval( $size ), intval( $size ) );
741
-			} elseif ( ! is_string( $size ) && ! is_array( $size ) ) {
739
+			if ( is_int ( $size ) || ( 0 < intval ( $size ) ) ) {
740
+				$size = array( intval ( $size ), intval ( $size ) );
741
+			} elseif ( ! is_string ( $size ) && ! is_array ( $size ) ) {
742 742
 				$size = array( 200, 9999 );
743 743
 			}
744
-			$image = get_the_post_thumbnail( intval( $id ), $size );
744
+			$image = get_the_post_thumbnail ( intval ( $id ), $size );
745 745
 		}
746 746
 
747
-		return apply_filters( 'ssp_episode_image', $image, $id );
747
+		return apply_filters ( 'ssp_episode_image', $image, $id );
748 748
 	}
749 749
 
750 750
 	/**
@@ -759,29 +759,29 @@  discard block
 block discarded – undo
759 759
 			'series' => ''
760 760
 		);
761 761
 
762
-		$args = apply_filters( 'ssp_get_podcast_args', wp_parse_args( $args, $defaults ) );
762
+		$args = apply_filters ( 'ssp_get_podcast_args', wp_parse_args ( $args, $defaults ) );
763 763
 
764 764
 		$query = array();
765 765
 
766
-		if ( 'episodes' == $args['content'] ) {
766
+		if ( 'episodes' == $args[ 'content' ] ) {
767 767
 
768 768
 			// Get selected series
769 769
 			$podcast_series = '';
770
-			if ( isset( $args['series'] ) && $args['series'] ) {
771
-				$podcast_series = $args['series'];
770
+			if ( isset( $args[ 'series' ] ) && $args[ 'series' ] ) {
771
+				$podcast_series = $args[ 'series' ];
772 772
 			}
773 773
 
774 774
 			// Get query args
775
-			$query_args = apply_filters( 'ssp_get_podcast_query_args', ssp_episodes( -1, $podcast_series, true, '' ) );
775
+			$query_args = apply_filters ( 'ssp_get_podcast_query_args', ssp_episodes ( -1, $podcast_series, true, '' ) );
776 776
 
777 777
 			// The Query
778
-			$query = get_posts( $query_args );
778
+			$query = get_posts ( $query_args );
779 779
 
780 780
 			// The Display
781
-			if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
781
+			if ( ! is_wp_error ( $query ) && is_array ( $query ) && count ( $query ) > 0 ) {
782 782
 				foreach ( $query as $k => $v ) {
783 783
 					// Get the URL
784
-					$query[$k]->url = get_permalink( $v->ID );
784
+					$query[ $k ]->url = get_permalink ( $v->ID );
785 785
 				}
786 786
 			} else {
787 787
 				$query = false;
@@ -789,27 +789,27 @@  discard block
 block discarded – undo
789 789
 
790 790
 		} else {
791 791
 
792
-			$terms = get_terms( 'series' );
792
+			$terms = get_terms ( 'series' );
793 793
 
794
-			if ( count( $terms ) > 0) {
794
+			if ( count ( $terms ) > 0 ) {
795 795
 
796 796
 				foreach ( $terms as $term ) {
797
-					$query[ $term->term_id ] = new stdClass();
797
+					$query[ $term->term_id ] = new stdClass ();
798 798
 					$query[ $term->term_id ]->title = $term->name;
799
-		    		$query[ $term->term_id ]->url = get_term_link( $term );
799
+		    		$query[ $term->term_id ]->url = get_term_link ( $term );
800 800
 
801
-		    		$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
801
+		    		$query_args = apply_filters ( 'ssp_get_podcast_series_query_args', ssp_episodes ( -1, $term->slug, true, '' ) );
802 802
 
803
-		    		$posts = get_posts( $query_args );
803
+		    		$posts = get_posts ( $query_args );
804 804
 
805
-		    		$count = count( $posts );
805
+		    		$count = count ( $posts );
806 806
 		    		$query[ $term->term_id ]->count = $count;
807 807
 			    }
808 808
 			}
809 809
 
810 810
 		}
811 811
 
812
-		$query['content'] = $args['content'];
812
+		$query[ 'content' ] = $args[ 'content' ];
813 813
 
814 814
 		return $query;
815 815
 	}
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
 	public function get_enclosure( $episode_id = 0 ) {
823 823
 
824 824
 		if ( $episode_id ) {
825
-			return apply_filters( 'ssp_episode_enclosure', get_post_meta( $episode_id, 'audio_file', true ), $episode_id );
825
+			return apply_filters ( 'ssp_episode_enclosure', get_post_meta ( $episode_id, 'audio_file', true ), $episode_id );
826 826
 		}
827 827
 
828 828
 		return '';
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 
841 841
 		if ( $file != '' ) {
842 842
 
843
-			$post_types = ssp_post_types( true );
843
+			$post_types = ssp_post_types ( true );
844 844
 
845 845
 			$args = array(
846 846
 				'post_type' => $post_types,
@@ -850,17 +850,17 @@  discard block
 block discarded – undo
850 850
 				'meta_value' => $file
851 851
 			);
852 852
 
853
-			$qry = new WP_Query( $args );
853
+			$qry = new WP_Query ( $args );
854 854
 
855
-			if ( $qry->have_posts() ) {
856
-				while ( $qry->have_posts() ) { $qry->the_post();
855
+			if ( $qry->have_posts () ) {
856
+				while ( $qry->have_posts () ) { $qry->the_post ();
857 857
 					$episode = $post;
858 858
 					break;
859 859
 				}
860 860
 			}
861 861
 		}
862 862
 
863
-		return apply_filters( 'ssp_episode_from_file', $episode, $file );
863
+		return apply_filters ( 'ssp_episode_from_file', $episode, $file );
864 864
 
865 865
 	}
866 866
 
@@ -870,33 +870,33 @@  discard block
 block discarded – undo
870 870
 	 */
871 871
 	public function download_file() {
872 872
 
873
-		if ( is_podcast_download() ) {
873
+		if ( is_podcast_download () ) {
874 874
 			global $wp_query;
875 875
 
876 876
 			// Get requested episode ID
877
-			$episode_id = intval( $wp_query->query_vars['podcast_episode'] );
877
+			$episode_id = intval ( $wp_query->query_vars[ 'podcast_episode' ] );
878 878
 
879 879
 			if ( isset( $episode_id ) && $episode_id ) {
880 880
 
881 881
 				// Get episode post object
882
-				$episode = get_post( $episode_id );
882
+				$episode = get_post ( $episode_id );
883 883
 
884 884
 				// Make sure we have a valid episode post object
885
-				if ( ! $episode || ! is_object( $episode ) || is_wp_error( $episode ) || ! isset( $episode->ID ) ) {
885
+				if ( ! $episode || ! is_object ( $episode ) || is_wp_error ( $episode ) || ! isset( $episode->ID ) ) {
886 886
 					return;
887 887
 				}
888 888
 
889 889
 				// Do we have newlines?
890 890
 				$parts = false;
891
-				if( is_string( $episode ) ) {
892
-					$parts = explode( "\n", $episode );
891
+				if ( is_string ( $episode ) ) {
892
+					$parts = explode ( "\n", $episode );
893 893
 				}
894 894
 
895
-				if ( $parts && is_array( $parts ) && count( $parts ) > 1 ) {
896
-					$file = $parts[0];
895
+				if ( $parts && is_array ( $parts ) && count ( $parts ) > 1 ) {
896
+					$file = $parts[ 0 ];
897 897
 				} else {
898 898
 					// Get audio file for download
899
-					$file = $this->get_enclosure( $episode_id );
899
+					$file = $this->get_enclosure ( $episode_id );
900 900
 				}
901 901
 
902 902
 				// Exit if no file is found
@@ -906,77 +906,77 @@  discard block
 block discarded – undo
906 906
 
907 907
 				// Get file referrer
908 908
 				$referrer = '';
909
-				if( isset( $wp_query->query_vars['podcast_ref'] ) && $wp_query->query_vars['podcast_ref'] ) {
910
-					$referrer = $wp_query->query_vars['podcast_ref'];
909
+				if ( isset( $wp_query->query_vars[ 'podcast_ref' ] ) && $wp_query->query_vars[ 'podcast_ref' ] ) {
910
+					$referrer = $wp_query->query_vars[ 'podcast_ref' ];
911 911
 				} else {
912
-					if( isset( $_GET['ref'] ) ) {
913
-						$referrer = esc_attr( $_GET['ref'] );
912
+					if ( isset( $_GET[ 'ref' ] ) ) {
913
+						$referrer = esc_attr ( $_GET[ 'ref' ] );
914 914
 					}
915 915
 				}
916 916
 
917 917
 				// Allow other actions - functions hooked on here must not output any data
918
-			    do_action( 'ssp_file_download', $file, $episode, $referrer );
918
+			    do_action ( 'ssp_file_download', $file, $episode, $referrer );
919 919
 
920 920
 			    // Set necessary headers
921
-				header( "Pragma: no-cache" );
922
-				header( "Expires: 0" );
923
-				header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
924
-				header( "Robots: none" );
921
+				header ( "Pragma: no-cache" );
922
+				header ( "Expires: 0" );
923
+				header ( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
924
+				header ( "Robots: none" );
925 925
 
926 926
 		        // Check file referrer
927
-		        if( 'download' == $referrer ) {
927
+		        if ( 'download' == $referrer ) {
928 928
 
929 929
 		        	// Set size of file
930 930
 					// Do we have anything in Cache/DB?
931
-					$size = wp_cache_get( $episode_id, 'filesize_raw' );
931
+					$size = wp_cache_get ( $episode_id, 'filesize_raw' );
932 932
 
933 933
 					// Nothing in the cache, let's see if we can figure it out.
934 934
 					if ( false === $size ) {
935 935
 
936 936
 						// Do we have anything in post_meta?
937
-						$size = get_post_meta( $episode_id, 'filesize_raw', true );
937
+						$size = get_post_meta ( $episode_id, 'filesize_raw', true );
938 938
 
939 939
 						if ( empty( $size ) ) {
940 940
 
941 941
 							// Let's see if we can figure out the path...
942
-							$attachment_id = $this->get_attachment_id_from_url( $file );
942
+							$attachment_id = $this->get_attachment_id_from_url ( $file );
943 943
 
944
-							if ( ! empty( $attachment_id )  ) {
945
-								$size = filesize( get_attached_file( $attachment_id ) );
946
-								update_post_meta( $episode_id, 'filesize_raw', $size );
944
+							if ( ! empty( $attachment_id ) ) {
945
+								$size = filesize ( get_attached_file ( $attachment_id ) );
946
+								update_post_meta ( $episode_id, 'filesize_raw', $size );
947 947
 							}
948 948
 
949 949
 						}
950 950
 
951 951
 						// Update the cache
952
-						wp_cache_set( $episode_id, $size, 'filesize_raw' );
952
+						wp_cache_set ( $episode_id, $size, 'filesize_raw' );
953 953
 					}
954 954
 
955 955
 					// Send Content-Length header
956 956
 		        	if ( ! empty( $size ) ) {
957
-						header( "Content-Length: " . $size );
957
+						header ( "Content-Length: ".$size );
958 958
 					}
959 959
 
960 960
 		        	// Force file download
961
-		        	header( "Content-Type: application/force-download" );
961
+		        	header ( "Content-Type: application/force-download" );
962 962
 
963 963
 			        // Set other relevant headers
964
-			        header( "Content-Description: File Transfer" );
965
-			        header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
966
-			        header( "Content-Transfer-Encoding: binary" );
964
+			        header ( "Content-Description: File Transfer" );
965
+			        header ( "Content-Disposition: attachment; filename=\"".basename ( $file )."\";" );
966
+			        header ( "Content-Transfer-Encoding: binary" );
967 967
 
968 968
 			        // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
969
-					$file = str_replace( ' ', '%20', $file );
969
+					$file = str_replace ( ' ', '%20', $file );
970 970
 
971 971
 			        // Use ssp_readfile_chunked() if allowed on the server or simply access file directly
972
-					@ssp_readfile_chunked( $file ) or header( 'Location: ' . $file );
972
+					@ssp_readfile_chunked ( $file ) or header ( 'Location: '.$file );
973 973
 				} else {
974 974
 
975 975
 					// Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
976
-					$file = str_replace( ' ', '%20', $file );
976
+					$file = str_replace ( ' ', '%20', $file );
977 977
 
978 978
 					// For all other referrers redirect to the raw file
979
-					wp_redirect( $file, 302 );
979
+					wp_redirect ( $file, 302 );
980 980
 				}
981 981
 
982 982
 				// Exit to prevent other processes running later on
@@ -993,16 +993,16 @@  discard block
 block discarded – undo
993 993
 	public function generator_tag( $gen, $type ) {
994 994
 
995 995
 		// Allow generator tags to be hidden if necessary
996
-		if ( apply_filters( 'ssp_show_generator_tag', true, $type ) ) {
996
+		if ( apply_filters ( 'ssp_show_generator_tag', true, $type ) ) {
997 997
 
998
-			$generator = 'Seriously Simple Podcasting ' . esc_attr( $this->version );
998
+			$generator = 'Seriously Simple Podcasting '.esc_attr ( $this->version );
999 999
 
1000 1000
 			switch ( $type ) {
1001 1001
 				case 'html':
1002
-					$gen .= "\n" . '<meta name="generator" content="' . $generator . '">';
1002
+					$gen .= "\n".'<meta name="generator" content="'.$generator.'">';
1003 1003
 				break;
1004 1004
 				case 'xhtml':
1005
-					$gen .= "\n" . '<meta name="generator" content="' . $generator . '" />';
1005
+					$gen .= "\n".'<meta name="generator" content="'.$generator.'" />';
1006 1006
 				break;
1007 1007
 			}
1008 1008
 
@@ -1018,53 +1018,53 @@  discard block
 block discarded – undo
1018 1018
 	public function rss_meta_tag() {
1019 1019
 
1020 1020
 		// Get feed slug
1021
-		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
1021
+		$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
1022 1022
 
1023
-		if ( get_option( 'permalink_structure' ) ) {
1024
-			$feed_url = $this->home_url . 'feed/' . $feed_slug;
1023
+		if ( get_option ( 'permalink_structure' ) ) {
1024
+			$feed_url = $this->home_url.'feed/'.$feed_slug;
1025 1025
 		} else {
1026
-			$feed_url = $this->home_url . '?feed=' . $feed_slug;
1026
+			$feed_url = $this->home_url.'?feed='.$feed_slug;
1027 1027
 		}
1028 1028
 
1029
-		$custom_feed_url = get_option( 'ss_podcasting_feed_url' );
1029
+		$custom_feed_url = get_option ( 'ss_podcasting_feed_url' );
1030 1030
 		if ( $custom_feed_url ) {
1031 1031
 			$feed_url = $custom_feed_url;
1032 1032
 		}
1033 1033
 
1034
-		$feed_url = apply_filters( 'ssp_feed_url', $feed_url );
1034
+		$feed_url = apply_filters ( 'ssp_feed_url', $feed_url );
1035 1035
 
1036 1036
 		$html = '';
1037 1037
 
1038
-		if( apply_filters( 'ssp_show_global_feed_tag', true ) ) {
1039
-			$html = '<link rel="alternate" type="application/rss+xml" title="' . __( 'Podcast RSS feed', 'seriously-simple-podcasting' ) . '" href="' . esc_url( $feed_url ) . '" />';
1038
+		if ( apply_filters ( 'ssp_show_global_feed_tag', true ) ) {
1039
+			$html = '<link rel="alternate" type="application/rss+xml" title="'.__ ( 'Podcast RSS feed', 'seriously-simple-podcasting' ).'" href="'.esc_url ( $feed_url ).'" />';
1040 1040
 		}
1041 1041
 
1042 1042
 		// Check if this is a series taxonomy archive and display series-specific RSS feed tag
1043
-		$current_obj = get_queried_object();
1044
-		if( isset( $current_obj->taxonomy ) && 'series' == $current_obj->taxonomy && isset( $current_obj->slug ) && $current_obj->slug ) {
1043
+		$current_obj = get_queried_object ();
1044
+		if ( isset( $current_obj->taxonomy ) && 'series' == $current_obj->taxonomy && isset( $current_obj->slug ) && $current_obj->slug ) {
1045 1045
 
1046
-			if( apply_filters( 'ssp_show_series_feed_tag', true, $current_obj->slug ) ) {
1046
+			if ( apply_filters ( 'ssp_show_series_feed_tag', true, $current_obj->slug ) ) {
1047 1047
 
1048
-				if ( get_option( 'permalink_structure' ) ) {
1049
-					$series_feed_url = $feed_url . '/' . $current_obj->slug;
1048
+				if ( get_option ( 'permalink_structure' ) ) {
1049
+					$series_feed_url = $feed_url.'/'.$current_obj->slug;
1050 1050
 				} else {
1051
-					$series_feed_url = $feed_url . '&podcast_series=' . $current_obj->slug;
1051
+					$series_feed_url = $feed_url.'&podcast_series='.$current_obj->slug;
1052 1052
 				}
1053 1053
 
1054
-				$html .= "\n" . '<link rel="alternate" type="application/rss+xml" title="' . sprintf( __( '%s RSS feed', 'seriously-simple-podcasting' ), $current_obj->name ) . '" href="' . esc_url( $series_feed_url ) . '" />';
1054
+				$html .= "\n".'<link rel="alternate" type="application/rss+xml" title="'.sprintf ( __ ( '%s RSS feed', 'seriously-simple-podcasting' ), $current_obj->name ).'" href="'.esc_url ( $series_feed_url ).'" />';
1055 1055
 
1056 1056
 			}
1057 1057
 
1058 1058
 		}
1059 1059
 
1060
-		echo "\n" . apply_filters( 'ssp_rss_meta_tag', $html ) . "\n\n";
1060
+		echo "\n".apply_filters ( 'ssp_rss_meta_tag', $html )."\n\n";
1061 1061
 	}
1062 1062
 
1063 1063
 	/**
1064 1064
 	 * Register plugin widgets
1065 1065
 	 * @return void
1066 1066
 	 */
1067
-	public function register_widgets () {
1067
+	public function register_widgets() {
1068 1068
 
1069 1069
 		$widgets = array(
1070 1070
 			'recent-episodes' => 'Recent_Episodes',
@@ -1073,8 +1073,8 @@  discard block
 block discarded – undo
1073 1073
 		);
1074 1074
 
1075 1075
 		foreach ( $widgets as $id => $name ) {
1076
-			require_once( $this->dir . '/includes/widgets/class-ssp-widget-' . $id . '.php' );
1077
-			register_widget( 'SSP_Widget_' . $name );
1076
+			require_once( $this->dir.'/includes/widgets/class-ssp-widget-'.$id.'.php' );
1077
+			register_widget ( 'SSP_Widget_'.$name );
1078 1078
 		}
1079 1079
 
1080 1080
 	}
@@ -1084,25 +1084,25 @@  discard block
 block discarded – undo
1084 1084
 	 * @param  array  $params Shortcode paramaters
1085 1085
 	 * @return string         HTML output
1086 1086
 	 */
1087
-	public function podcast_episode_shortcode ( $params ) {
1087
+	public function podcast_episode_shortcode( $params ) {
1088 1088
 
1089
-		$atts = shortcode_atts( array(
1089
+		$atts = shortcode_atts ( array(
1090 1090
 	        'episode' => 0,
1091 1091
 	        'content' => 'title,player,details',
1092 1092
 	    ), $params );
1093 1093
 
1094
-		extract( $atts );
1094
+		extract ( $atts );
1095 1095
 
1096 1096
 	    if ( ! $episode ) {
1097 1097
 	    	return;
1098 1098
 	    }
1099 1099
 
1100 1100
 	    // Setup array of content items and trim whitespace
1101
-	    $content_items = explode( ',', $content );
1102
-	    $content_items = array_map( 'trim', $content_items );
1101
+	    $content_items = explode ( ',', $content );
1102
+	    $content_items = array_map ( 'trim', $content_items );
1103 1103
 
1104 1104
 	    // Get episode for display
1105
-	    $html = $this->podcast_episode( $episode, $content_items, 'shortcode' );
1105
+	    $html = $this->podcast_episode ( $episode, $content_items, 'shortcode' );
1106 1106
 
1107 1107
 	    return $html;
1108 1108
 
@@ -1114,64 +1114,64 @@  discard block
 block discarded – undo
1114 1114
 	 * @param  array   $content_items Orderd array of content items to display
1115 1115
 	 * @return string                 HTML of episode with specified content items
1116 1116
 	 */
1117
-	public function podcast_episode ( $episode_id = 0, $content_items = array( 'title', 'player', 'details' ), $context = '' ) {
1117
+	public function podcast_episode( $episode_id = 0, $content_items = array( 'title', 'player', 'details' ), $context = '' ) {
1118 1118
 		global $post, $episode_context;
1119 1119
 
1120
-		if ( ! $episode_id || ! is_array( $content_items ) || empty( $content_items ) ) {
1120
+		if ( ! $episode_id || ! is_array ( $content_items ) || empty( $content_items ) ) {
1121 1121
 			return;
1122 1122
 		}
1123 1123
 
1124 1124
 		// Get episode object
1125
-		$episode = get_post( $episode_id );
1125
+		$episode = get_post ( $episode_id );
1126 1126
 
1127
-		if ( ! $episode || is_wp_error( $episode ) ) {
1127
+		if ( ! $episode || is_wp_error ( $episode ) ) {
1128 1128
 			return;
1129 1129
 		}
1130 1130
 
1131
-		$html = '<div class="podcast-episode episode-' . esc_attr( $episode_id ) . '">' . "\n";
1131
+		$html = '<div class="podcast-episode episode-'.esc_attr ( $episode_id ).'">'."\n";
1132 1132
 
1133 1133
 			// Setup post data for episode post object
1134 1134
 			$post = $episode;
1135
-			setup_postdata( $post );
1135
+			setup_postdata ( $post );
1136 1136
 
1137 1137
 			$episode_context = $context;
1138 1138
 
1139 1139
 			// Display specified content items in the order supplied
1140 1140
 			foreach ( $content_items as $item ) {
1141 1141
 
1142
-				switch( $item ) {
1142
+				switch ( $item ) {
1143 1143
 
1144 1144
 					case 'title':
1145
-						$html .= '<h3 class="episode-title">' . get_the_title() . '</h3>' . "\n";
1145
+						$html .= '<h3 class="episode-title">'.get_the_title ().'</h3>'."\n";
1146 1146
 					break;
1147 1147
 
1148 1148
 					case 'excerpt':
1149
-						$html .= '<p class="episode-excerpt">' . get_the_excerpt() . '</p>' . "\n";
1149
+						$html .= '<p class="episode-excerpt">'.get_the_excerpt ().'</p>'."\n";
1150 1150
 					break;
1151 1151
 
1152 1152
 					case 'content':
1153
-						$html .= '<div class="episode-content">' . apply_filters( 'the_content', get_the_content() ) . '</div>' . "\n";
1153
+						$html .= '<div class="episode-content">'.apply_filters ( 'the_content', get_the_content () ).'</div>'."\n";
1154 1154
 					break;
1155 1155
 
1156 1156
 					case 'player':
1157
-						$file = $this->get_enclosure( $episode_id );
1158
-						if ( get_option( 'permalink_structure' ) ) {
1159
-							$file = $this->get_episode_download_link( $episode_id );
1157
+						$file = $this->get_enclosure ( $episode_id );
1158
+						if ( get_option ( 'permalink_structure' ) ) {
1159
+							$file = $this->get_episode_download_link ( $episode_id );
1160 1160
 						}
1161
-		    			$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1161
+		    			$html .= '<div class="podcast_player">'.$this->media_player ( $file, $episode_id ).'</div>'."\n";
1162 1162
 					break;
1163 1163
 
1164 1164
 					case 'details':
1165
-						$html .= $this->episode_meta_details( $episode_id, $episode_context );
1165
+						$html .= $this->episode_meta_details ( $episode_id, $episode_context );
1166 1166
 					break;
1167 1167
 
1168 1168
 				}
1169 1169
 			}
1170 1170
 
1171 1171
 			// Reset post data after fetching episode details
1172
-			wp_reset_postdata();
1172
+			wp_reset_postdata ();
1173 1173
 
1174
-		$html .= '</div>' . "\n";
1174
+		$html .= '</div>'."\n";
1175 1175
 
1176 1176
 	    return $html;
1177 1177
 	}
@@ -1186,26 +1186,26 @@  discard block
 block discarded – undo
1186 1186
 	function get_local_file_path( $file ) {
1187 1187
 
1188 1188
 		// Identify file by root path and not URL (required for getID3 class)
1189
-		$site_root = trailingslashit( ABSPATH );
1189
+		$site_root = trailingslashit ( ABSPATH );
1190 1190
 
1191 1191
 		// Remove common dirs from the ends of site_url and site_root, so that file can be outside of the WordPress installation
1192
-		$root_chunks = explode( '/', $site_root );
1193
-		$url_chunks  = explode( '/', $this->site_url );
1192
+		$root_chunks = explode ( '/', $site_root );
1193
+		$url_chunks  = explode ( '/', $this->site_url );
1194 1194
 
1195
-		end( $root_chunks );
1196
-		end( $url_chunks );
1195
+		end ( $root_chunks );
1196
+		end ( $url_chunks );
1197 1197
 
1198
-		while ( ! is_null( key( $root_chunks ) ) && ! is_null( key( $url_chunks ) ) && ( current( $root_chunks ) == current( $url_chunks ) ) ) {
1199
-			array_pop( $root_chunks );
1200
-			array_pop( $url_chunks );
1201
-			end( $root_chunks );
1202
-			end( $url_chunks );
1198
+		while ( ! is_null ( key ( $root_chunks ) ) && ! is_null ( key ( $url_chunks ) ) && ( current ( $root_chunks ) == current ( $url_chunks ) ) ) {
1199
+			array_pop ( $root_chunks );
1200
+			array_pop ( $url_chunks );
1201
+			end ( $root_chunks );
1202
+			end ( $url_chunks );
1203 1203
 		}
1204 1204
 
1205
-		$site_root = implode('/', $root_chunks);
1206
-		$site_url  = implode('/', $url_chunks);
1205
+		$site_root = implode ( '/', $root_chunks );
1206
+		$site_url  = implode ( '/', $url_chunks );
1207 1207
 
1208
-		$file = str_replace( $site_url, $site_root, $file );
1208
+		$file = str_replace ( $site_url, $site_root, $file );
1209 1209
 
1210 1210
 		return $file;
1211 1211
 	}
@@ -1217,9 +1217,9 @@  discard block
 block discarded – undo
1217 1217
 	 * @param  string $type         Type of feed
1218 1218
 	 * @return string               Updated content type
1219 1219
 	 */
1220
-	public function feed_content_type ( $content_type = '', $type = '' ) {
1220
+	public function feed_content_type( $content_type = '', $type = '' ) {
1221 1221
 
1222
-		if( 'podcast' == $type ) {
1222
+		if ( 'podcast' == $type ) {
1223 1223
 			$content_type = 'text/xml';
1224 1224
 		}
1225 1225
 
Please login to merge, or discard this patch.
seriously-simple-podcasting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined ( 'ABSPATH' ) ) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 require_once( 'includes/class-ssp-frontend.php' );
23 23
 
24 24
 global $ssp_admin, $ss_podcasting;
25
-$ssp_admin = new SSP_Admin( __FILE__, '1.14.7' );
26
-$ss_podcasting = new SSP_Frontend( __FILE__, '1.14.7' );
25
+$ssp_admin = new SSP_Admin ( __FILE__, '1.14.7' );
26
+$ss_podcasting = new SSP_Frontend ( __FILE__, '1.14.7' );
27 27
 
28
-if ( is_admin() ) {
28
+if ( is_admin () ) {
29 29
 	global $ssp_settings;
30 30
 	require_once( 'includes/class-ssp-settings.php' );
31
-	$ssp_settings = new SSP_Settings( __FILE__ );
31
+	$ssp_settings = new SSP_Settings ( __FILE__ );
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.