PowerPress Podcasting plugin by Blubrry - Version 0.9.2

Version Description

released on 07/23/2009 * Fixed logic error for new window player, now only displays embed or player, not both. * Fixed content-type detection bug introduced in version 0.9.1. * Added code to auto-correct the content-type in the feeds if it is invalid. * Updated readme.txt to use the recommended Changelog format.

Download this release

Release Info

Developer amandato
Plugin Icon 128x128 PowerPress Podcasting plugin by Blubrry
Version 0.9.2
Comparing to
See all releases

Code changes from version 0.9.1 to 0.9.2

powerpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
- Version: 0.9.1
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -29,7 +29,7 @@ License: GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt)
29
  */
30
 
31
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
32
- define('POWERPRESS_VERSION', '0.9.0' );
33
 
34
  /////////////////////////////////////////////////////
35
  // The following define options should be placed in your
@@ -603,9 +603,9 @@ function powerpress_rss2_item()
603
  if( $UrlParts['path'] )
604
  {
605
  // using functions that already exist in Wordpress when possible:
606
- $FileType = powerpress_check_filetype($UrlParts['path']);
607
- if( $FileType )
608
- $EnclosureType = $FileType['type'];
609
  }
610
 
611
  if( $EnclosureType && $EnclosureSize && $EnclosureURL )
@@ -625,6 +625,11 @@ function powerpress_rss2_item()
625
  $EnclosureURL = trim($EnclosureURL);
626
  $EnclosureType = trim($EnclosureType);
627
  $EnclosureSize = trim($EnclosureSize);
 
 
 
 
 
628
  $author = (isset($powerpress_feed['itunes_author_post'])?get_the_author() :$powerpress_feed['itunes_talent_name']);
629
  $explicit = $powerpress_feed['explicit'];
630
  $summary = false;
@@ -754,6 +759,14 @@ function powerpress_filter_rss_enclosure($content)
754
  // Modified Media URL
755
  $ModifiedURL = powerpress_add_redirect_url($OrigURL);
756
 
 
 
 
 
 
 
 
 
757
  // Replace the original url with the modified one...
758
  if( $OrigURL != $ModifiedURL )
759
  return str_replace($OrigURL, $ModifiedURL, $content);
@@ -1197,7 +1210,7 @@ function powerpress_player_filter($content, $media_url, $ExtraData = array() )
1197
  $player_height = $Settings['player_height'];
1198
 
1199
  // Used with some types
1200
- $content_type = powerpress_check_filetype($media_url);
1201
 
1202
  $parts = pathinfo($media_url);
1203
  switch( strtolower($parts['extension']) )
@@ -1438,11 +1451,17 @@ function powerpress_do_pinw($pinw)
1438
  <?php
1439
 
1440
  if( !$EpisdoeData )
 
1441
  echo '<p>Unable to retrieve media information.</p>';
 
1442
  else if( isset($EpisdoeData['embed']) && $EpisdoeData['embed'] )
 
1443
  echo $EpisdoeData['embed'];
1444
- if( !isset($EpisdoeData['no_player']) )
 
 
1445
  echo apply_filters('powerpress_player', '', $EpisdoeData['url'], array('feed'=>$feed_slug, 'autoplay'=>true) );
 
1446
 
1447
  ?>
1448
  </body>
@@ -1451,8 +1470,8 @@ function powerpress_do_pinw($pinw)
1451
  exit;
1452
  }
1453
 
1454
- // Add types that are missing from the default wp_check_filetype function
1455
- function powerpress_check_filetype($file)
1456
  {
1457
  $parts = pathinfo($file);
1458
  switch( strtolower($parts['extension']) )
@@ -1533,7 +1552,10 @@ function powerpress_check_filetype($file)
1533
  }
1534
 
1535
  // Last case let wordpress detect it:
1536
- return wp_check_filetype($file);
 
 
 
1537
  }
1538
 
1539
  function powerpress_itunes_summary($html)
@@ -1935,6 +1957,10 @@ function powerpress_get_enclosure_data($post_id, $feed_slug = 'podcast')
1935
  $Data['no_player'] = 1;
1936
  }
1937
 
 
 
 
 
1938
  return $Data;
1939
  }
1940
  /*
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
+ Version: 0.9.2
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
29
  */
30
 
31
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
32
+ define('POWERPRESS_VERSION', '0.9.2' );
33
 
34
  /////////////////////////////////////////////////////
35
  // The following define options should be placed in your
603
  if( $UrlParts['path'] )
604
  {
605
  // using functions that already exist in Wordpress when possible:
606
+ $ContentType = powerpress_get_contenttype($UrlParts['path']);
607
+ if( $ContentType )
608
+ $EnclosureType = $ContentType;
609
  }
610
 
611
  if( $EnclosureType && $EnclosureSize && $EnclosureURL )
625
  $EnclosureURL = trim($EnclosureURL);
626
  $EnclosureType = trim($EnclosureType);
627
  $EnclosureSize = trim($EnclosureSize);
628
+
629
+ // Check that the content type is a valid one...
630
+ if( strstr($EnclosureType, '/') == false )
631
+ $EnclosureType = powerpress_get_contenttype($EnclosureURL);
632
+
633
  $author = (isset($powerpress_feed['itunes_author_post'])?get_the_author() :$powerpress_feed['itunes_talent_name']);
634
  $explicit = $powerpress_feed['explicit'];
635
  $summary = false;
759
  // Modified Media URL
760
  $ModifiedURL = powerpress_add_redirect_url($OrigURL);
761
 
762
+ // Check that the content type is a valid one...
763
+ $match_count = preg_match('/\stype="([^"]*)"/', $content, $matches);
764
+ if( count($matches) > 1 && strstr($matches[1], '/') == false )
765
+ {
766
+ $ContentType = powerpress_get_contenttype($ModifiedURL);
767
+ $content = str_replace("type=\"{$matches[1]}\"", "type=\"$ContentType\"", $content);
768
+ }
769
+
770
  // Replace the original url with the modified one...
771
  if( $OrigURL != $ModifiedURL )
772
  return str_replace($OrigURL, $ModifiedURL, $content);
1210
  $player_height = $Settings['player_height'];
1211
 
1212
  // Used with some types
1213
+ //$content_type = powerpress_get_contenttype($media_url);
1214
 
1215
  $parts = pathinfo($media_url);
1216
  switch( strtolower($parts['extension']) )
1451
  <?php
1452
 
1453
  if( !$EpisdoeData )
1454
+ {
1455
  echo '<p>Unable to retrieve media information.</p>';
1456
+ }
1457
  else if( isset($EpisdoeData['embed']) && $EpisdoeData['embed'] )
1458
+ {
1459
  echo $EpisdoeData['embed'];
1460
+ }
1461
+ else // if( !isset($EpisdoeData['no_player']) ) // Even if there is no player set, if the play in new window option is enabled then it should play here...
1462
+ {
1463
  echo apply_filters('powerpress_player', '', $EpisdoeData['url'], array('feed'=>$feed_slug, 'autoplay'=>true) );
1464
+ }
1465
 
1466
  ?>
1467
  </body>
1470
  exit;
1471
  }
1472
 
1473
+ // Adds content types that are missing from the default wp_check_filetype function
1474
+ function powerpress_get_contenttype($file)
1475
  {
1476
  $parts = pathinfo($file);
1477
  switch( strtolower($parts['extension']) )
1552
  }
1553
 
1554
  // Last case let wordpress detect it:
1555
+ $FileType = wp_check_filetype($file);
1556
+ if( $FileType && isset($FileType['type']) )
1557
+ return $FileType['type'];
1558
+ return '';
1559
  }
1560
 
1561
  function powerpress_itunes_summary($html)
1957
  $Data['no_player'] = 1;
1958
  }
1959
 
1960
+ // Check that the content type is a valid one...
1961
+ if( strstr($Data['type'], '/') == false )
1962
+ $Data['type'] = powerpress_get_contenttype($Data['url']);
1963
+
1964
  return $Data;
1965
  }
1966
  /*
powerpressadmin-mt.php CHANGED
@@ -175,7 +175,7 @@
175
  else
176
  $EpisodeData['size'] = 0;
177
 
178
- $EpisodeData['type'] = powerpress_check_filetype($EpisodeData['url']);
179
  $EpisodeData['duration'] = false;
180
  if( $EpisodeData['type'] == 'audio/mpeg' && $DetectDuration )
181
  {
175
  else
176
  $EpisodeData['size'] = 0;
177
 
178
+ $EpisodeData['type'] = powerpress_get_contenttype($EpisodeData['url']);
179
  $EpisodeData['duration'] = false;
180
  if( $EpisodeData['type'] == 'audio/mpeg' && $DetectDuration )
181
  {
powerpressadmin-podpress.php CHANGED
@@ -52,9 +52,9 @@
52
  $clean_data[ $episode_index ]['size'] = $episode_data['size'];
53
  if( trim($episode_data['duration']) && $episode_data['duration'] != 'UNKNOWN' )
54
  $clean_data[ $episode_index ]['duration'] = powerpress_readable_duration($episode_data['duration'], true);
55
- $FileType = powerpress_check_filetype( $episode_data['URI'] );
56
- if( $FileType )
57
- $clean_data[ $episode_index ]['type'] = $FileType['type'];
58
  }
59
  }
60
 
52
  $clean_data[ $episode_index ]['size'] = $episode_data['size'];
53
  if( trim($episode_data['duration']) && $episode_data['duration'] != 'UNKNOWN' )
54
  $clean_data[ $episode_index ]['duration'] = powerpress_readable_duration($episode_data['duration'], true);
55
+ $ContentType = powerpress_get_contenttype( $episode_data['URI'] );
56
+ if( $ContentType )
57
+ $clean_data[ $episode_index ]['type'] = $ContentType;
58
  }
59
  }
60
 
powerpressadmin.php CHANGED
@@ -751,9 +751,9 @@ function powerpress_edit_post($post_ID, $post)
751
  if( $UrlParts['path'] )
752
  {
753
  // using functions that already exist in Wordpress when possible:
754
- $FileType = powerpress_check_filetype($UrlParts['path']);
755
  if( $FileType )
756
- $ContentType = $FileType['type'];
757
  else
758
  $ContentType = 'application/binary';
759
  }
751
  if( $UrlParts['path'] )
752
  {
753
  // using functions that already exist in Wordpress when possible:
754
+ $FileType = powerpress_get_contenttype($UrlParts['path']);
755
  if( $FileType )
756
+ $ContentType = $FileType;
757
  else
758
  $ContentType = 'application/binary';
759
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === Blubrry PowerPress Podcasting plugin ===
2
  Contributors: Angelo Mandato, Blubrry.com
3
  Tags: podcast, podcasting, itunes, enclosure, zune, iphone, youtube, viddler, blip.tv, audio, video, rss2, feed, player, media, rss, mp3, music, embed, feedburner, statistics, stats, flv, flash, id3, episodes, blubrry
4
  Requires at least: 2.6.0
5
  Tested up to: 2.8.2
6
- Stable tag: 0.9.1
7
 
8
  Add podcasting support to your blog.
9
 
@@ -41,7 +41,7 @@ Features:
41
  * Hosted Feed Support (FeedBurner.com)
42
  * User Role Management (Control which users on blog can Podcast)
43
 
44
- File Types detected: mp3, m4a, ogg, wma, ra, mp4a, m4v, mp4v, mpg, asf, avi, wmv, flv, swf, mov, divx, 3gp, midi, wav, aa, pdf, torrent
45
 
46
  For the latest information visit the website.
47
 
@@ -85,19 +85,36 @@ As a alternative, PowerPress allows you to create additional Custom Podcast Feed
85
 
86
  == Changelog ==
87
 
88
- 0.9.1 released on 7/22/2009
89
- Added new define for wp-config.php `POWERPRESS_ENABLE_HTTPS_MEDIA` for allowing https:// media links. iTunes ping logic updated to support scheduled posts as well as category and custom podcast feeds. iTunes URL setting added to category and custom podcast feeds settings page. Latest iTunes ping status now displayed below iTunes URL setting. `in_the_loop()` check added to 0.9.0 removed which broke some themes. Screenshots updated.
90
-
91
- 0.9.0 released on 7/20/2009
92
- Added `powerpress_get_enclosure_data()` and `powerpress_get_enclosure()` courtesy functions for theme developers to obtain enclosure data, changed the icon used for selecting blubrry hosted media, added m4b and m4r to list of detected audio formats, relabled Redirect Feed URL to FeedBurner Feed URL to clear up confusion.
93
-
94
- Completely revamped the on page and new window players, removed the "play in page" options as they were a source of confusion for some users, Added code to support poorly written themes that capture post content incorrectly,
95
-
96
- New powerpress shortcode added, enter [powerpress] within your post and the player will be inserted at that location, player. New embed option added to episode entry box, displayed just above the built-in player. New option to remove the player on a per episode basis. New optional episode entry fields for iTunes Keywords, iTunes Subtitle and iTunes Summary.
97
-
98
- Added courtesy functions `the_powerpress_content()` and `get_the_powerpress_content()` for theme developers to use for special themes. Example usage: `<?php if( function_exists('the_powerpress_content') ) the_powerpress_content(); ?>`
99
-
100
- Bugs: Fixed bug with `require_once()` calls on some servers displaying a fatal error, fixed scheduled posts bug with WordPress 2.8+.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  0.8.3 released on 6/27/2009
103
  Fixed bug with feed redirect URL setting for custom feeds, added option to disable the dashboard statistics widget, fixed 2 bugs with Blubrry hosting integration: media URL field no longer read-only after publishing and ID3 write tags bug fixed.
1
+ === Podcasting - Blubrry PowerPress Podcast plugin ===
2
  Contributors: Angelo Mandato, Blubrry.com
3
  Tags: podcast, podcasting, itunes, enclosure, zune, iphone, youtube, viddler, blip.tv, audio, video, rss2, feed, player, media, rss, mp3, music, embed, feedburner, statistics, stats, flv, flash, id3, episodes, blubrry
4
  Requires at least: 2.6.0
5
  Tested up to: 2.8.2
6
+ Stable tag: 0.9.2
7
 
8
  Add podcasting support to your blog.
9
 
41
  * Hosted Feed Support (FeedBurner.com)
42
  * User Role Management (Control which users on blog can Podcast)
43
 
44
+ File Types detected: mp3, m4a, ogg, wma, ra, mp4a, m4v, mp4v, mpg, asf, avi, wmv, flv, swf, mov, divx, 3gp, midi, wav, aa, pdf, torrent, m4b, m4r
45
 
46
  For the latest information visit the website.
47
 
85
 
86
  == Changelog ==
87
 
88
+ = 0.9.2 =
89
+ released on 07/23/2009
90
+ * Fixed logic error for new window player, now only displays embed or player, not both.
91
+ * Fixed content-type detection bug introduced in version 0.9.1.
92
+ * Added code to auto-correct the content-type in the feeds if it is invalid.
93
+ * Updated readme.txt to use the recommended Changelog format.
94
+
95
+ = 0.9.1 =
96
+ released on 7/22/2009
97
+ * Added new define for wp-config.php `POWERPRESS_ENABLE_HTTPS_MEDIA` for allowing https:// media links.
98
+ * iTunes ping logic updated to support scheduled posts as well as category and custom podcast feeds.
99
+ * iTunes URL setting added to category and custom podcast feeds settings page.
100
+ * Latest iTunes ping status now displayed below iTunes URL setting. `in_the_loop()` check added to 0.9.0 removed which broke some themes.
101
+ * Screenshots updated.
102
+
103
+ = 0.9.0 =
104
+ released on 7/20/2009
105
+ * Added `powerpress_get_enclosure_data()` and `powerpress_get_enclosure()` courtesy functions for theme developers to obtain enclosure data
106
+ * changed the icon used for selecting blubrry hosted media
107
+ * added m4b and m4r to list of detected audio formats
108
+ * relabled Redirect Feed URL to FeedBurner Feed URL to clear up confusion.
109
+ * Completely revamped the on page and new window players, removed the "play in page" options as they were a source of confusion for some users
110
+ * Added code to support poorly written themes that capture post content incorrectly,
111
+ * New powerpress shortcode added, enter [powerpress] within your post and the player will be inserted at that location, player.
112
+ * New embed option added to episode entry box, displayed just above the built-in player.
113
+ * New option to remove the player on a per episode basis.
114
+ * New optional episode entry fields for iTunes Keywords, iTunes Subtitle and iTunes Summary.
115
+ * Added courtesy functions `the_powerpress_content()` and `get_the_powerpress_content()` for theme developers to use for special themes. Example usage: `<?php if( function_exists('the_powerpress_content') ) the_powerpress_content(); ?>`
116
+ * Fixed bug with `require_once()` calls on some servers displaying a fatal error.
117
+ * Fixed scheduled posts bug with WordPress 2.8+.
118
 
119
  0.8.3 released on 6/27/2009
120
  Fixed bug with feed redirect URL setting for custom feeds, added option to disable the dashboard statistics widget, fixed 2 bugs with Blubrry hosting integration: media URL field no longer read-only after publishing and ID3 write tags bug fixed.