PowerPress Podcasting plugin by Blubrry - Version 1.0.6

Version Description

  • Released on 3/6/2010
  • Fixed warning message from appearing in other Blogging System import screen.
  • Fixed bug where media links were always being displayed when using the powerpress shortcode.
  • Added note why we do not plan on upgrading the FlowPlayer in PowerPress plugin.
  • Added new define POWERPRESS_TEXT_SEPARATOR so users can replace the : character with what ever they want in their wp-config.php.
  • Fixed bug with iTunes Enhanced Summary setting not applying correctly to podcast channel feeds (Thanks Kimberly for helping us with this issue!)
  • Added extra logic to the iTunes Enhanced Summary to remove incomplete URLs from the end of the summary. (Thanks Kimbery for bringing to our attention!)
  • Fixed bug where post per feed/item settings were not getting set, now using is_numeric instead of is_int(Thanks Darcy for bug fix!)
  • Added additional information in the Diagnostics email message.
  • Fixed remote HTTP logic for non-CURL configured servers (Thanks Andy for your assistance!)
Download this release

Release Info

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

Code changes from version 1.0.5 to 1.0.6

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: 1.0.5
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -33,7 +33,7 @@ if( !function_exists('add_action') )
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
- define('POWERPRESS_VERSION', '1.0.5' );
37
 
38
  /////////////////////////////////////////////////////
39
  // The following define options should be placed in your
@@ -51,7 +51,7 @@ if( !defined('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT') )
51
  if( !defined('POWERPRESS_DOWNLOAD_TEXT') )
52
  define('POWERPRESS_DOWNLOAD_TEXT', __('Download', 'powerpress') );
53
  if( !defined('POWERPRESS_PLAY_TEXT') )
54
- define('POWERPRESS_PLAY_TEXT', __('Play', 'powerpress') );
55
 
56
  if( !defined('POWERPRESS_BLUBRRY_API_URL') )
57
  define('POWERPRESS_BLUBRRY_API_URL', 'http://api.blubrry.com/');
@@ -67,6 +67,8 @@ if( !defined('POWERPRESS_CONTENT_ACTION_PRIORITY') )
67
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
68
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
69
  define('POWERPRESS_LINK_SEPARATOR', '|');
 
 
70
  if( !defined('POWERPRESS_PLAY_IMAGE') )
71
  define('POWERPRESS_PLAY_IMAGE', 'play_video_default.jpg');
72
  if( !defined('PHP_EOL') )
@@ -1034,9 +1036,9 @@ function powerpress_load_general_feed_settings()
1034
  $powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
1035
  else
1036
  $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1037
- $powerpress_feed['enhance_itunes_summary'] = @$Feed['enhance_itunes_summary'];
1038
  $powerpress_feed['posts_per_rss'] = false;
1039
- if( !empty($Feed['posts_per_rss']) && is_int($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0 )
1040
  $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
1041
  if( $Feed['feed_redirect_url'] != '' )
1042
  $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
@@ -1073,13 +1075,9 @@ function powerpress_load_general_feed_settings()
1073
  $powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
1074
  else
1075
  $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1076
- $powerpress_feed['enhance_itunes_summary'] = 1;
1077
- if( version_compare( '5', phpversion(), '>=' ) )
1078
- $powerpress_feed['enhance_itunes_summary'] = 0;
1079
- else if( !empty($Feed['enhance_itunes_summary']) )
1080
- $powerpress_feed['enhance_itunes_summary'] = $Feed['enhance_itunes_summary'];
1081
  $powerpress_feed['posts_per_rss'] = false;
1082
- if( !empty($Feed['posts_per_rss']) && is_int($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0 )
1083
  $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
1084
  if( !empty($Feed['feed_redirect_url']) )
1085
  $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
@@ -1132,13 +1130,11 @@ function powerpress_load_general_feed_settings()
1132
  $powerpress_feed['itunes_talent_name'] = $FeedSettingsBasic['itunes_talent_name'];
1133
  else
1134
  $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1135
- $powerpress_feed['enhance_itunes_summary'] = 1;
1136
- if( version_compare( '5', phpversion(), '>=' ) )
1137
- $powerpress_feed['enhance_itunes_summary'] = 0;
1138
- else if( !empty($FeedSettingsBasic['enhance_itunes_summary']) )
1139
  $powerpress_feed['enhance_itunes_summary'] = $FeedSettingsBasic['enhance_itunes_summary'];
1140
  $powerpress_feed['posts_per_rss'] = false;
1141
- if( !empty($FeedSettingsBasic['posts_per_rss']) && is_int($FeedSettingsBasic['posts_per_rss']) && $FeedSettingsBasic['posts_per_rss'] > 0 )
1142
  $powerpress_feed['posts_per_rss'] = $FeedSettingsBasic['posts_per_rss'];
1143
  if( !empty($FeedSettingsBasic['itunes_author_post']) )
1144
  $powerpress_feed['itunes_author_post'] = true;
@@ -1533,7 +1529,8 @@ function powerpress_shortcode_handler( $attributes, $content = null )
1533
  }
1534
 
1535
  $return = apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed, 'image'=>$image, 'type'=>$EpisodeData['type']) );
1536
- $return .= powerpress_get_player_links($post->ID, $feed, $EpisodeData );
 
1537
  }
1538
  }
1539
  else
@@ -1570,6 +1567,9 @@ function powerpress_shortcode_handler( $attributes, $content = null )
1570
  if( !isset($EpisodeData['no_player']) )
1571
  {
1572
  $return .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'image'=>$image_current, 'type'=>$EpisodeData['type']) );
 
 
 
1573
  $return .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData );
1574
  }
1575
  }
@@ -1795,12 +1795,6 @@ function powerpress_itunes_summary($html)
1795
  ),
1796
  $html);
1797
 
1798
- // Third, convert <ul><li> to <li>*
1799
- // TODO:
1800
-
1801
- // Last, and the hardest, convert <ol><li> to numbers, this will be the hardest
1802
- // TODO:
1803
-
1804
  // For now make them bullet points...
1805
  $html = str_replace('<li>', '<li>* ', $html);
1806
 
@@ -1808,8 +1802,9 @@ function powerpress_itunes_summary($html)
1808
  $html = strip_shortcodes( $html );
1809
  $html = str_replace(']]>', ']]&gt;', $html);
1810
  $content_no_html = strip_tags($html);
1811
-
1812
- return powerpress_format_itunes_value($content_no_html, 'summary');
 
1813
  }
1814
 
1815
  function powerpress_itunes_categories($PrefixSubCategories = false)
@@ -2093,6 +2088,10 @@ function powerpress_merge_empty_feed_settings($CustomFeedSettings, $FeedSettings
2093
  unset($FeedSettings['itunes_new_feed_url']);
2094
  unset($FeedSettings['apply_to']);
2095
  unset($FeedSettings['feed_redirect_url']);
 
 
 
 
2096
 
2097
  if( !$CustomFeedSettings )
2098
  return $FeedSettings; // If the $CustomFeedSettings is false
@@ -2356,12 +2355,17 @@ function powerpress_get_player_links($post_id, $feed_slug = 'podcast', $EpisodeD
2356
  if( $parts && isset($parts['extension']) )
2357
  $extension = strtolower($parts['extension']);
2358
 
 
2359
  if( $is_pdf )
2360
- return '<p class="powerpress_links powerpress_links_'. $extension .'">'. __('E-Book PDF', 'powerpress') . ( $feed_slug=='pdf'||$feed_slug=='podcast'?'':" ($feed_slug)") .': '. $player_links . '</p>'.PHP_EOL;
2361
  else if( $feed_slug != 'podcast' )
2362
- return '<p class="powerpress_links powerpress_links_'. $extension .'">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($feed_slug) .'): '. $player_links . '</p>'.PHP_EOL;
2363
  else
2364
- return '<p class="powerpress_links powerpress_links_'. $extension .'">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .': '. $player_links . '</p>'.PHP_EOL;
 
 
 
 
2365
  }
2366
  return '';
2367
  }
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: 1.0.6
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
+ define('POWERPRESS_VERSION', '1.0.6' );
37
 
38
  /////////////////////////////////////////////////////
39
  // The following define options should be placed in your
51
  if( !defined('POWERPRESS_DOWNLOAD_TEXT') )
52
  define('POWERPRESS_DOWNLOAD_TEXT', __('Download', 'powerpress') );
53
  if( !defined('POWERPRESS_PLAY_TEXT') )
54
+ define('POWERPRESS_PLAY_TEXT', __('Play', 'powerpress') );
55
 
56
  if( !defined('POWERPRESS_BLUBRRY_API_URL') )
57
  define('POWERPRESS_BLUBRRY_API_URL', 'http://api.blubrry.com/');
67
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
68
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
69
  define('POWERPRESS_LINK_SEPARATOR', '|');
70
+ if( !defined('POWERPRESS_TEXT_SEPARATOR') )
71
+ define('POWERPRESS_TEXT_SEPARATOR', ':');
72
  if( !defined('POWERPRESS_PLAY_IMAGE') )
73
  define('POWERPRESS_PLAY_IMAGE', 'play_video_default.jpg');
74
  if( !defined('PHP_EOL') )
1036
  $powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
1037
  else
1038
  $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1039
+ $powerpress_feed['enhance_itunes_summary'] = $Feed['enhance_itunes_summary'];
1040
  $powerpress_feed['posts_per_rss'] = false;
1041
+ if( !empty($Feed['posts_per_rss']) && is_numeric($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0 )
1042
  $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
1043
  if( $Feed['feed_redirect_url'] != '' )
1044
  $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
1075
  $powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
1076
  else
1077
  $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1078
+ $powerpress_feed['enhance_itunes_summary'] = $Feed['enhance_itunes_summary'];
 
 
 
 
1079
  $powerpress_feed['posts_per_rss'] = false;
1080
+ if( !empty($Feed['posts_per_rss']) && is_numeric($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0 )
1081
  $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
1082
  if( !empty($Feed['feed_redirect_url']) )
1083
  $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
1130
  $powerpress_feed['itunes_talent_name'] = $FeedSettingsBasic['itunes_talent_name'];
1131
  else
1132
  $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1133
+ $powerpress_feed['enhance_itunes_summary'] = (version_compare( '5', phpversion(), '>=' )?0 : 1);
1134
+ if( isset($FeedSettingsBasic['enhance_itunes_summary']) )
 
 
1135
  $powerpress_feed['enhance_itunes_summary'] = $FeedSettingsBasic['enhance_itunes_summary'];
1136
  $powerpress_feed['posts_per_rss'] = false;
1137
+ if( !empty($FeedSettingsBasic['posts_per_rss']) && is_numeric($FeedSettingsBasic['posts_per_rss']) && $FeedSettingsBasic['posts_per_rss'] > 0 )
1138
  $powerpress_feed['posts_per_rss'] = $FeedSettingsBasic['posts_per_rss'];
1139
  if( !empty($FeedSettingsBasic['itunes_author_post']) )
1140
  $powerpress_feed['itunes_author_post'] = true;
1529
  }
1530
 
1531
  $return = apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed, 'image'=>$image, 'type'=>$EpisodeData['type']) );
1532
+ if( !isset($EpisodeData['no_links']) )
1533
+ $return .= powerpress_get_player_links($post->ID, $feed, $EpisodeData );
1534
  }
1535
  }
1536
  else
1567
  if( !isset($EpisodeData['no_player']) )
1568
  {
1569
  $return .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'image'=>$image_current, 'type'=>$EpisodeData['type']) );
1570
+ }
1571
+ if( !isset($EpisodeData['no_links']) )
1572
+ {
1573
  $return .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData );
1574
  }
1575
  }
1795
  ),
1796
  $html);
1797
 
 
 
 
 
 
 
1798
  // For now make them bullet points...
1799
  $html = str_replace('<li>', '<li>* ', $html);
1800
 
1802
  $html = strip_shortcodes( $html );
1803
  $html = str_replace(']]>', ']]&gt;', $html);
1804
  $content_no_html = strip_tags($html);
1805
+ $content_no_html = powerpress_format_itunes_value($content_no_html, 'summary');
1806
+ $content_no_html = preg_replace('/(\(http:\/\/[^\)\s]*)$/i', '', $content_no_html);
1807
+ return $content_no_html;
1808
  }
1809
 
1810
  function powerpress_itunes_categories($PrefixSubCategories = false)
2088
  unset($FeedSettings['itunes_new_feed_url']);
2089
  unset($FeedSettings['apply_to']);
2090
  unset($FeedSettings['feed_redirect_url']);
2091
+
2092
+ // If the setting is not already set, set the enhnaced itunes setting if they have PHP5+ on by default
2093
+ if( !isset($FeedSettings['enhance_itunes_summary']) )
2094
+ $FeedSettings['enhance_itunes_summary'] = ( version_compare( '5', phpversion(), '>=' )?0:1);
2095
 
2096
  if( !$CustomFeedSettings )
2097
  return $FeedSettings; // If the $CustomFeedSettings is false
2355
  if( $parts && isset($parts['extension']) )
2356
  $extension = strtolower($parts['extension']);
2357
 
2358
+ $prefix = '';
2359
  if( $is_pdf )
2360
+ $prefix .= __('E-Book PDF', 'powerpress') . ( $feed_slug=='pdf'||$feed_slug=='podcast'?'':" ($feed_slug)") .POWERPRESS_TEXT_SEPARATOR;
2361
  else if( $feed_slug != 'podcast' )
2362
+ $prefix .= htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($feed_slug) .')'. POWERPRESS_TEXT_SEPARATOR;
2363
  else
2364
+ $prefix .= htmlspecialchars(POWERPRESS_LINKS_TEXT) . POWERPRESS_TEXT_SEPARATOR;
2365
+ if( !empty($prefix) )
2366
+ $prefix .= ' ';
2367
+
2368
+ return '<p class="powerpress_links powerpress_links_'. $extension .'">'. $prefix . $player_links . '</p>'.PHP_EOL;
2369
  }
2370
  return '';
2371
  }
powerpressadmin-dashboard.php CHANGED
@@ -82,6 +82,7 @@ function powerpress_dashboard_stats_content()
82
  else
83
  {
84
  $api_url = sprintf('%s/stats/%s/summary.html?nobody=1', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Keyword);
 
85
 
86
  $content = powerpress_remote_fopen($api_url, $UserPass);
87
  if( $content )
82
  else
83
  {
84
  $api_url = sprintf('%s/stats/%s/summary.html?nobody=1', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Keyword);
85
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
86
 
87
  $content = powerpress_remote_fopen($api_url, $UserPass);
88
  if( $content )
powerpressadmin-diagnostics.php CHANGED
@@ -256,6 +256,11 @@
256
  $message .= " &nbsp; \t &nbsp; ". __('PowerPress version:') .' '. POWERPRESS_VERSION ."<br />\n";
257
  $message .= " &nbsp; \t &nbsp; ". __('advanced mode:') .' '. ($SettingsGeneral['advanced_mode']?'true':'false') ."<br />\n";
258
  $message .= " &nbsp; \t &nbsp; ". __('episode box mode:') .' '. ($SettingsGeneral['episode_box_mode']==0?__('normal'): ($SettingsGeneral['episode_box_mode']==1?__('simple'):__('advanced')) ) ."<br />\n";
 
 
 
 
 
259
 
260
  // Detecting Media Information
261
  $message .= "<br />\n";
256
  $message .= " &nbsp; \t &nbsp; ". __('PowerPress version:') .' '. POWERPRESS_VERSION ."<br />\n";
257
  $message .= " &nbsp; \t &nbsp; ". __('advanced mode:') .' '. ($SettingsGeneral['advanced_mode']?'true':'false') ."<br />\n";
258
  $message .= " &nbsp; \t &nbsp; ". __('episode box mode:') .' '. ($SettingsGeneral['episode_box_mode']==0?__('normal'): ($SettingsGeneral['episode_box_mode']==1?__('simple'):__('advanced')) ) ."<br />\n";
259
+ $message .= " &nbsp; \t &nbsp; ". __('Podcasting capability:') .' '. ($SettingsGeneral['use_caps']==0?__('Disabled (default)'): __('Enabled')) ."<br />\n";
260
+ $message .= " &nbsp; \t &nbsp; ". __('Feed capability:') .' '. ($SettingsGeneral['feed_caps']==0?__('Disabled (default)'): __('Enabled')) ."<br />\n";
261
+ $message .= " &nbsp; \t &nbsp; ". __('Category Podcasting:') .' '. ($SettingsGeneral['cat_casting']==0?__('Disabled (default)'): __('Enabled')) ."<br />\n";
262
+ $message .= " &nbsp; \t &nbsp; ". __('Podcast Channels:') .' '. ($SettingsGeneral['channels']==0?__('Disabled (default)'): __('Enabled')) ."<br />\n";
263
+ $message .= " &nbsp; \t &nbsp; ". __('Additional Player Options:') .' '. ($SettingsGeneral['player_options']==0?__('Disabled (default)'): __('Enabled')) ."<br />\n";
264
 
265
  // Detecting Media Information
266
  $message .= "<br />\n";
powerpressadmin-jquery.php CHANGED
@@ -8,6 +8,9 @@
8
 
9
  function powerpress_add_blubrry_redirect($program_keyword)
10
  {
 
 
 
11
  $Settings = powerpress_get_settings('powerpress_general');
12
  $RedirectURL = 'http://media.blubrry.com/'.$program_keyword;
13
  $NewSettings = array();
@@ -150,6 +153,7 @@ if( !isset($Settings['blubrry_auth']) || $Settings['blubrry_auth'] == '' )
150
  if( $DeleteFile )
151
  {
152
  $api_url = sprintf('%s/media/%s/%s?format=json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Settings['blubrry_program_keyword'], $DeleteFile );
 
153
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth'], array(), 10, 'DELETE');
154
  $results = powerpress_json_decode($json_data);
155
 
@@ -162,6 +166,7 @@ if( !isset($Settings['blubrry_auth']) || $Settings['blubrry_auth'] == '' )
162
  }
163
 
164
  $api_url = sprintf('%s/media/%s/index.json?quota=true&published=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Settings['blubrry_program_keyword'] );
 
165
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth']);
166
  $results = powerpress_json_decode($json_data);
167
 
@@ -314,6 +319,7 @@ function DeleteMedia(File)
314
  $api_url = sprintf('%s/stats/index.json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/') );
315
  else
316
  $api_url = sprintf('%s/media/index.json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/') );
 
317
  $json_data = powerpress_remote_fopen($api_url, $auth);
318
  if( $json_data )
319
  {
@@ -373,7 +379,11 @@ function DeleteMedia(File)
373
  }
374
  else
375
  {
376
- $Error = 'Authentication failed.';
 
 
 
 
377
  }
378
  }
379
 
@@ -509,6 +519,7 @@ while( list($value,$desc) = each($Programs) )
509
  if( $Error == false )
510
  {
511
  $api_url = sprintf('%s/media/%s/upload_session.json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Settings['blubrry_program_keyword'] );
 
512
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth']);
513
 
514
  $results = powerpress_json_decode($json_data);
8
 
9
  function powerpress_add_blubrry_redirect($program_keyword)
10
  {
11
+ if( !strstr(POWERPRESS_BLUBRRY_API_URL, 'api.blubrry.com' ) )
12
+ return;
13
+
14
  $Settings = powerpress_get_settings('powerpress_general');
15
  $RedirectURL = 'http://media.blubrry.com/'.$program_keyword;
16
  $NewSettings = array();
153
  if( $DeleteFile )
154
  {
155
  $api_url = sprintf('%s/media/%s/%s?format=json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Settings['blubrry_program_keyword'], $DeleteFile );
156
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
157
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth'], array(), 10, 'DELETE');
158
  $results = powerpress_json_decode($json_data);
159
 
166
  }
167
 
168
  $api_url = sprintf('%s/media/%s/index.json?quota=true&published=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Settings['blubrry_program_keyword'] );
169
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
170
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth']);
171
  $results = powerpress_json_decode($json_data);
172
 
319
  $api_url = sprintf('%s/stats/index.json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/') );
320
  else
321
  $api_url = sprintf('%s/media/index.json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/') );
322
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'?'. POWERPRESS_BLUBRRY_API_QSA:'');
323
  $json_data = powerpress_remote_fopen($api_url, $auth);
324
  if( $json_data )
325
  {
379
  }
380
  else
381
  {
382
+ global $g_powerpress_remote_error;
383
+ if( !empty($g_powerpress_remote_error) )
384
+ $Error = __('Error:', 'powerpress') .' '.$g_powerpress_remote_error;
385
+ else
386
+ $Error = __('Authentication failed.', 'powerpress');
387
  }
388
  }
389
 
519
  if( $Error == false )
520
  {
521
  $api_url = sprintf('%s/media/%s/upload_session.json', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $Settings['blubrry_program_keyword'] );
522
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'?'. POWERPRESS_BLUBRRY_API_QSA:'');
523
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth']);
524
 
525
  $results = powerpress_json_decode($json_data);
powerpressadmin-mt.php CHANGED
@@ -298,8 +298,10 @@ if( !function_exists('add_action') )
298
  {
299
  $results = powerpress_get_mt_episodes();
300
  $Settings = powerpress_get_settings('powerpress_general', false);
301
- if( !isset($Settings['custom_feeds']['podcast']) )
302
  $Settings['custom_feeds'] = array_merge( array('podcast'=> 'Podcast Feed (default)'), $Settings['custom_feeds'] );
 
 
303
 
304
  if( $results )
305
  {
298
  {
299
  $results = powerpress_get_mt_episodes();
300
  $Settings = powerpress_get_settings('powerpress_general', false);
301
+ if( !isset($Settings['custom_feeds']['podcast']) && !empty($Settings['custom_feeds']) )
302
  $Settings['custom_feeds'] = array_merge( array('podcast'=> 'Podcast Feed (default)'), $Settings['custom_feeds'] );
303
+ else if( empty($Settings['custom_feeds']) )
304
+ $Settings['custom_feeds'] = array('podcast'=> 'Podcast Feed (default)');
305
 
306
  if( $results )
307
  {
powerpressadmin-podpress.php CHANGED
@@ -242,7 +242,7 @@ if( !function_exists('add_action') )
242
  {
243
  $EpisodeData = $PodPressData[ $post_id ]['podpress_data'][ $podpress_index ];
244
 
245
- if( $EpisodeData['size'] == '' || !is_int($EpisodeData['size']) ) // Get the content length
246
  {
247
  $headers = wp_get_http_headers($EpisodeData['url']);
248
  if( $headers && $headers['content-length'] )
242
  {
243
  $EpisodeData = $PodPressData[ $post_id ]['podpress_data'][ $podpress_index ];
244
 
245
+ if( $EpisodeData['size'] == '' || !is_numeric($EpisodeData['size']) ) // Get the content length
246
  {
247
  $headers = wp_get_http_headers($EpisodeData['url']);
248
  if( $headers && $headers['content-length'] )
powerpressadmin.php CHANGED
@@ -289,6 +289,7 @@ function powerpress_admin_init()
289
  {
290
  // Lets try to cache the image onto Blubrry's Server...
291
  $api_url = sprintf('%s/media/%s/coverart.json?url=%s', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $GeneralSettingsTemp['blubrry_program_keyword'], urlencode($TagValues['tag_coverart']) );
 
292
  $json_data = powerpress_remote_fopen($api_url, $GeneralSettingsTemp['blubrry_auth']);
293
  $results = powerpress_json_decode($json_data);
294
 
@@ -1876,7 +1877,7 @@ function powerpress_ping_itunes_log($Data, $post_id = 0)
1876
  }
1877
  }
1878
 
1879
- function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array(), $timeout = 10, $custom_request = false )
1880
  {
1881
  if( function_exists( 'curl_init' ) ) // Preferred method of connecting
1882
  {
@@ -1931,10 +1932,12 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
1931
 
1932
  $content = curl_exec($curl);
1933
  $error = curl_errno($curl);
 
1934
  curl_close($curl);
1935
  if( $error )
1936
  {
1937
  global $g_powerpress_remote_error;
 
1938
  return false;
1939
  }
1940
  return $content;
@@ -1946,33 +1949,32 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
1946
  $options = array();
1947
  $options['timeout'] = $timeout;
1948
  $options['user-agent'] = 'Blubrry PowerPress/'.POWERPRESS_VERSION;
1949
- if( $basicauth )
1950
- $options['headers'][] = 'Authorization: Basic '.$basic_auth;
 
1951
  if( count($post_args) > 0 )
1952
  {
1953
  $options['body'] = $post_args;
1954
- $response = wp_remote_post( $uri, $options );
1955
  }
1956
  else
1957
  {
1958
- $response = wp_remote_get( $uri, $options );
1959
  }
1960
 
1961
  if ( is_wp_error( $response ) )
 
 
 
1962
  return false;
 
1963
 
1964
  return $response['body'];
1965
  }
1966
 
1967
- // No sense going any further, we're not allowed to open remote URLs on this server
1968
- if( !ini_get( 'allow_url_fopen' ) )
1969
- return false;
1970
-
1971
- if( count($post_args) > 0 )
1972
  {
1973
- if( !function_exists('fsockopen') )
1974
- return false; // This was our last attempt, we failed...
1975
-
1976
  $post_query = '';
1977
  while( list($name,$value) = each($post_args) )
1978
  {
@@ -1988,7 +1990,7 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
1988
  if( isset($url_parts['port']) )
1989
  $port = $url_parts['port'];
1990
 
1991
- $http_request = "POST /updated-batch/ HTTP/1.0\r\n";
1992
  $http_request .= "Host: $host\r\n";
1993
  if( $basic_auth )
1994
  $http_request .= 'Authorization: Basic '. $basic_auth ."\r\n";
@@ -2011,9 +2013,21 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
2011
  $response = explode("\r\n\r\n", $response, 2);
2012
  if( count($response) > 1 )
2013
  return $response[1];
 
 
 
 
 
 
 
 
 
 
 
2014
  return false;
2015
  }
2016
 
 
2017
  if( $basic_auth )
2018
  {
2019
  $UserPassDecoded = base64_decode($basic_auth);
@@ -2095,6 +2109,7 @@ function powerpress_process_hosting($post_ID, $post_title)
2095
  // Extend the max execution time here
2096
  set_time_limit(60*20); // give it 20 minutes just in case
2097
  $api_url = sprintf('%s/media/%s/%s?format=json&publish=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), urlencode($Settings['blubrry_program_keyword']), urlencode($EnclosureURL) );
 
2098
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth'], array(), 60*30); // give this up to 30 minutes, though 3 seocnds to 20 seconds is all one should need.
2099
  $results = powerpress_json_decode($json_data);
2100
 
@@ -2521,6 +2536,7 @@ function powerpress_write_tags($file, $post_title)
2521
 
2522
  // Get meta info via API
2523
  $api_url = sprintf('%s/media/%s/%s?format=json&id3=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), urlencode($Settings['blubrry_program_keyword']), urlencode($file) );
 
2524
 
2525
  $content = powerpress_remote_fopen($api_url, $Settings['blubrry_auth'], $PostArgs );
2526
  if( $content )
@@ -2538,6 +2554,7 @@ function powerpress_get_media_info($file)
2538
  $Settings = get_option('powerpress_general');
2539
 
2540
  $api_url = sprintf('%s/media/%s/%s?format=json&info=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), urlencode($Settings['blubrry_program_keyword']), urlencode($file) );
 
2541
  $content = powerpress_remote_fopen($api_url, $Settings['blubrry_auth']);
2542
  if( $content )
2543
  {
289
  {
290
  // Lets try to cache the image onto Blubrry's Server...
291
  $api_url = sprintf('%s/media/%s/coverart.json?url=%s', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), $GeneralSettingsTemp['blubrry_program_keyword'], urlencode($TagValues['tag_coverart']) );
292
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
293
  $json_data = powerpress_remote_fopen($api_url, $GeneralSettingsTemp['blubrry_auth']);
294
  $results = powerpress_json_decode($json_data);
295
 
1877
  }
1878
  }
1879
 
1880
+ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array(), $timeout = 15, $custom_request = false )
1881
  {
1882
  if( function_exists( 'curl_init' ) ) // Preferred method of connecting
1883
  {
1932
 
1933
  $content = curl_exec($curl);
1934
  $error = curl_errno($curl);
1935
+ $error_msg = curl_error($curl);
1936
  curl_close($curl);
1937
  if( $error )
1938
  {
1939
  global $g_powerpress_remote_error;
1940
+ $g_powerpress_remote_error = $error_msg;
1941
  return false;
1942
  }
1943
  return $content;
1949
  $options = array();
1950
  $options['timeout'] = $timeout;
1951
  $options['user-agent'] = 'Blubrry PowerPress/'.POWERPRESS_VERSION;
1952
+ if( $basic_auth )
1953
+ $options['headers']['Authorization'] = 'Basic '.$basic_auth;
1954
+
1955
  if( count($post_args) > 0 )
1956
  {
1957
  $options['body'] = $post_args;
1958
+ $response = wp_remote_post( $url, $options );
1959
  }
1960
  else
1961
  {
1962
+ $response = wp_remote_get( $url, $options );
1963
  }
1964
 
1965
  if ( is_wp_error( $response ) )
1966
+ {
1967
+ global $g_powerpress_remote_error;
1968
+ $g_powerpress_remote_error = $response->get_error_message();
1969
  return false;
1970
+ }
1971
 
1972
  return $response['body'];
1973
  }
1974
 
1975
+ // Try the fopen way:
1976
+ if( count($post_args) > 0 && ini_get( 'allow_url_fopen' ) && function_exists('fsockopen') )
 
 
 
1977
  {
 
 
 
1978
  $post_query = '';
1979
  while( list($name,$value) = each($post_args) )
1980
  {
1990
  if( isset($url_parts['port']) )
1991
  $port = $url_parts['port'];
1992
 
1993
+ $http_request = "POST {$url_parts['path']} HTTP/1.0\r\n";
1994
  $http_request .= "Host: $host\r\n";
1995
  if( $basic_auth )
1996
  $http_request .= 'Authorization: Basic '. $basic_auth ."\r\n";
2013
  $response = explode("\r\n\r\n", $response, 2);
2014
  if( count($response) > 1 )
2015
  return $response[1];
2016
+
2017
+ global $g_powerpress_remote_error;
2018
+ $g_powerpress_remote_error = __('Unable to parse response from server.', 'powerpress');
2019
+ return false;
2020
+ }
2021
+
2022
+ // If we made it this far then we got a different problem.
2023
+ if( count($post_args) > 0 )
2024
+ {
2025
+ global $g_powerpress_remote_error;
2026
+ $g_powerpress_remote_error = __('Your version of WordPress is too outdated for this function.', 'powerpress');
2027
  return false;
2028
  }
2029
 
2030
+ // Last ditch attempt using Pre WP2.7 helper function
2031
  if( $basic_auth )
2032
  {
2033
  $UserPassDecoded = base64_decode($basic_auth);
2109
  // Extend the max execution time here
2110
  set_time_limit(60*20); // give it 20 minutes just in case
2111
  $api_url = sprintf('%s/media/%s/%s?format=json&publish=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), urlencode($Settings['blubrry_program_keyword']), urlencode($EnclosureURL) );
2112
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
2113
  $json_data = powerpress_remote_fopen($api_url, $Settings['blubrry_auth'], array(), 60*30); // give this up to 30 minutes, though 3 seocnds to 20 seconds is all one should need.
2114
  $results = powerpress_json_decode($json_data);
2115
 
2536
 
2537
  // Get meta info via API
2538
  $api_url = sprintf('%s/media/%s/%s?format=json&id3=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), urlencode($Settings['blubrry_program_keyword']), urlencode($file) );
2539
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
2540
 
2541
  $content = powerpress_remote_fopen($api_url, $Settings['blubrry_auth'], $PostArgs );
2542
  if( $content )
2554
  $Settings = get_option('powerpress_general');
2555
 
2556
  $api_url = sprintf('%s/media/%s/%s?format=json&info=true', rtrim(POWERPRESS_BLUBRRY_API_URL, '/'), urlencode($Settings['blubrry_program_keyword']), urlencode($file) );
2557
+ $api_url .= (defined('POWERPRESS_BLUBRRY_API_QSA')?'&'. POWERPRESS_BLUBRRY_API_QSA:'');
2558
  $content = powerpress_remote_fopen($api_url, $Settings['blubrry_auth']);
2559
  if( $content )
2560
  {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Angelo Mandato, Blubrry.com
3
  Tags: podcasting, podcast, podcaster, itunes, enclosure, zune, iphone, youtube, viddler, blip.tv, ustream, podcasting, audio, video, rss2, feed, player, media, rss, mp3, music, embed, feedburner, statistics, stats, flv, flash, id3, episodes, blubrry, wordpressmu, mu, wordpress mu
4
  Requires at least: 2.6.0
5
- Tested up to: 2.9.1
6
- Stable tag: 1.0.5
7
 
8
  Blubrry PowerPress brings the essential features for podcasting to WordPress including full iTunes support, web audio/video media players and more.
9
 
@@ -117,6 +117,8 @@ You can insert the media player within yoru blog posts by using the WordPress sh
117
  = Why can't you upload large media files? =
118
  File uploads are tricky to handle because there are so many web hosting variations with different upload size limits. We recommend using an FTP application to upload large media files. FTP is much more efficient than web based uploads and is typically provided by nearly all web hosting providers.
119
 
 
 
120
 
121
  == Installation ==
122
  To install Blubrry PowerPress manually, follow these steps:
@@ -138,6 +140,18 @@ To install Blubrry PowerPress manually, follow these steps:
138
  = Announcement =
139
  * We are about 90% done updating PowerPress for translation. If you would like to have PowerPress translated into other languages, please contact Angelo: cio [at] rawvoice.com.
140
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
  = 1.0.5 =
143
  * Released on 1/30/2010
2
  Contributors: Angelo Mandato, Blubrry.com
3
  Tags: podcasting, podcast, podcaster, itunes, enclosure, zune, iphone, youtube, viddler, blip.tv, ustream, podcasting, audio, video, rss2, feed, player, media, rss, mp3, music, embed, feedburner, statistics, stats, flv, flash, id3, episodes, blubrry, wordpressmu, mu, wordpress mu
4
  Requires at least: 2.6.0
5
+ Tested up to: 2.9.2
6
+ Stable tag: 1.0.6
7
 
8
  Blubrry PowerPress brings the essential features for podcasting to WordPress including full iTunes support, web audio/video media players and more.
9
 
117
  = Why can't you upload large media files? =
118
  File uploads are tricky to handle because there are so many web hosting variations with different upload size limits. We recommend using an FTP application to upload large media files. FTP is much more efficient than web based uploads and is typically provided by nearly all web hosting providers.
119
 
120
+ = Will you be upgrading the version of Flow Player to 3.x? =
121
+ Because of the feature restrictions and branding that FlowPlayer.org places on FlowPlayer 3.x versions, we do not plan on updating the player packaged with PowerPress. The **PAID open-source** FlowPlayer is not compatible with the **FREE open source** PowerPress plugin.
122
 
123
  == Installation ==
124
  To install Blubrry PowerPress manually, follow these steps:
140
  = Announcement =
141
  * We are about 90% done updating PowerPress for translation. If you would like to have PowerPress translated into other languages, please contact Angelo: cio [at] rawvoice.com.
142
 
143
+ = 1.0.6 =
144
+ * Released on 3/6/2010
145
+ * Fixed warning message from appearing in other Blogging System import screen.
146
+ * Fixed bug where media links were always being displayed when using the powerpress shortcode.
147
+ * Added note why we do not plan on upgrading the FlowPlayer in PowerPress plugin.
148
+ * Added new define `POWERPRESS_TEXT_SEPARATOR` so users can replace the : character with what ever they want in their wp-config.php.
149
+ * Fixed bug with iTunes Enhanced Summary setting not applying correctly to podcast channel feeds (Thanks Kimberly for helping us with this issue!)
150
+ * Added extra logic to the iTunes Enhanced Summary to remove incomplete URLs from the end of the summary. (Thanks Kimbery for bringing to our attention!)
151
+ * Fixed bug where post per feed/item settings were not getting set, now using `is_numeric` instead of `is_int`(Thanks Darcy for bug fix!)
152
+ * Added additional information in the Diagnostics email message.
153
+ * Fixed remote HTTP logic for non-CURL configured servers (Thanks Andy for your assistance!)
154
+
155
 
156
  = 1.0.5 =
157
  * Released on 1/30/2010