PowerPress Podcasting plugin by Blubrry - Version 5.0.8

Version Description

  • Released on 6/11/2014
  • Added better error reporting logic for services and statistics.
  • Added option to get podcast meta data optionally from a value (rather than from database)
  • Added logic to override the html content-type when a HTTP HEAD request is made for a feed URL
  • Fixed notice message on line 220 of powerpress.php (thanks brandonferens for letting us know about the notice message)
  • We will soon be releasing a beta version of PowerPress 6.0. If you are interested in beta testing, please contact us.
Download this release

Release Info

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

Code changes from version 5.0.7 to 5.0.8

powerpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://create.blubrry.com/resources/powerpress/
5
  Description: <a href="http://create.blubrry.com/resources/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: 5.0.7
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -32,7 +32,7 @@ if( !function_exists('add_action') )
32
  die("access denied.");
33
 
34
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
35
- define('POWERPRESS_VERSION', '5.0.7' );
36
 
37
  // Translation support:
38
  if ( !defined('POWERPRESS_ABSPATH') )
@@ -217,7 +217,7 @@ function powerpress_content($content)
217
  if( $GeneralSettings['display_player'] == 0 )
218
  return $content;
219
 
220
- if( current_filter() == 'the_excerpt' && !$GeneralSettings['display_player_excerpt'] )
221
  return $content; // We didn't want to modify this since the user didn't enable it for excerpts
222
 
223
  // Figure out which players are alerady in the body of the page...
@@ -397,6 +397,18 @@ powerpress_url = '<?php echo powerpress_get_root_url(); ?>';
397
 
398
  add_action('wp_head', 'powerpress_header');
399
 
 
 
 
 
 
 
 
 
 
 
 
 
400
  function powerpress_rss2_ns()
401
  {
402
  if( !powerpress_is_podcast_feed() )
@@ -2421,14 +2433,16 @@ function powerpress_get_enclosure($post_id, $feed_slug = 'podcast')
2421
  return false;
2422
  }
2423
 
2424
- function powerpress_get_enclosure_data($post_id, $feed_slug = 'podcast')
2425
  {
2426
- if( $feed_slug == 'podcast' || $feed_slug == '' )
 
 
2427
  $MetaData = get_post_meta($post_id, 'enclosure', true);
2428
  else
2429
  $MetaData = get_post_meta($post_id, '_'. $feed_slug .':enclosure', true);
2430
 
2431
- if( !$MetaData )
2432
  return false;
2433
 
2434
  $MetaParts = explode("\n", $MetaData, 4);
@@ -2760,4 +2774,19 @@ if( is_admin() )
2760
  register_activation_hook( __FILE__, 'powerpress_admin_activate' );
2761
  }
2762
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2763
  ?>
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://create.blubrry.com/resources/powerpress/
5
  Description: <a href="http://create.blubrry.com/resources/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: 5.0.8
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
32
  die("access denied.");
33
 
34
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
35
+ define('POWERPRESS_VERSION', '5.0.8' );
36
 
37
  // Translation support:
38
  if ( !defined('POWERPRESS_ABSPATH') )
217
  if( $GeneralSettings['display_player'] == 0 )
218
  return $content;
219
 
220
+ if( current_filter() == 'the_excerpt' && empty($GeneralSettings['display_player_excerpt']) )
221
  return $content; // We didn't want to modify this since the user didn't enable it for excerpts
222
 
223
  // Figure out which players are alerady in the body of the page...
397
 
398
  add_action('wp_head', 'powerpress_header');
399
 
400
+ function powerpress_exit_on_http_head($return)
401
+ {
402
+ if( is_feed() )
403
+ {
404
+ // Set the content type for HTTP headers...
405
+ header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
406
+ }
407
+ return $return;
408
+ }
409
+
410
+ add_filter('exit_on_http_head', 'powerpress_exit_on_http_head' );
411
+
412
  function powerpress_rss2_ns()
413
  {
414
  if( !powerpress_is_podcast_feed() )
2433
  return false;
2434
  }
2435
 
2436
+ function powerpress_get_enclosure_data($post_id, $feed_slug = 'podcast', $raw_data = false)
2437
  {
2438
+ if( $raw_data )
2439
+ $MetaData = $raw_data;
2440
+ else if( $feed_slug == 'podcast' || $feed_slug == '' )
2441
  $MetaData = get_post_meta($post_id, 'enclosure', true);
2442
  else
2443
  $MetaData = get_post_meta($post_id, '_'. $feed_slug .':enclosure', true);
2444
 
2445
+ if( empty($MetaData) )
2446
  return false;
2447
 
2448
  $MetaParts = explode("\n", $MetaData, 4);
2774
  register_activation_hook( __FILE__, 'powerpress_admin_activate' );
2775
  }
2776
 
2777
+ if( defined('POWERPRESS_PLAYLIST') && POWERPRESS_PLAYLIST && file_exists(POWERPRESS_ABSPATH.'/powerpress-playlist.php') )
2778
+ {
2779
+ require_once(POWERPRESS_ABSPATH.'/powerpress-playlist.php');
2780
+ }
2781
+
2782
+ if( defined('POWERPRESS_SUBSCRIBE') && POWERPRESS_SUBSCRIBE && file_exists(POWERPRESS_ABSPATH.'/powerpress-subscribe.php') )
2783
+ {
2784
+ require_once(POWERPRESS_ABSPATH.'/powerpress-subscribe.php');
2785
+ }
2786
+
2787
+ if( defined('POWERPRESS_NEW_CODE') && POWERPRESS_NEW_CODE && file_exists(POWERPRESS_ABSPATH.'/powerpress-new-code.php') )
2788
+ {
2789
+ require_once(POWERPRESS_ABSPATH.'/powerpress-new-code.php');
2790
+ }
2791
+
2792
  ?>
powerpressadmin-find-replace.php CHANGED
@@ -142,7 +142,7 @@
142
 
143
  }
144
 
145
- powerpress_page_message_add_notice( __('WARNING: Please backup your database before proceeding. Blubrry PowerPress is not responsibile for any lost or damaged data resulting from this Find and Replace tool.', 'powerpress') );
146
  }
147
 
148
  function powerpress_admin_find_replace()
142
 
143
  }
144
 
145
+ powerpress_page_message_add_notice( __('WARNING: Please backup your database before proceeding. Blubrry PowerPress is not responsible for any lost or damaged data resulting from this Find and Replace tool.', 'powerpress') );
146
  }
147
 
148
  function powerpress_admin_find_replace()
powerpressadmin-jquery.php CHANGED
@@ -258,6 +258,22 @@ function DeleteMedia(File)
258
  powerpress_page_message_add_notice( $message );
259
  powerpress_page_message_print();
260
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
 
262
  if( $Msg )
263
  echo '<p>'. $Msg . '</p>';
@@ -511,12 +527,13 @@ function DeleteMedia(File)
511
  else
512
  {
513
  global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
 
514
  if( !empty($g_powerpress_remote_errorno) && $g_powerpress_remote_errorno == 401 )
515
- $Error = 'Incorrect user email address or password, or no program was found signed-up for services. <br /><span style="font-weight: normal; font-size: 12px;">Verify your account settings and try again.</span>';
516
  else if( !empty($g_powerpress_remote_error) )
517
- $Error = __('Error:', 'powerpress') .' '.$g_powerpress_remote_error;
518
  else
519
- $Error = __('Authentication failed.', 'powerpress');
520
  }
521
 
522
  if( $Error )
@@ -719,7 +736,13 @@ while( list($value,$desc) = each($Programs) )
719
  }
720
  else if( $Error == false )
721
  {
722
- $Error = __('Unable to obtain upload session.','powerpress');
 
 
 
 
 
 
723
  }
724
 
725
  powerpress_admin_jquery_header( __('Uploader','powerpress') );
258
  powerpress_page_message_add_notice( $message );
259
  powerpress_page_message_print();
260
  }
261
+ else if( empty($results) )
262
+ {
263
+ // Handle the error here.
264
+ $message = '<h3>'.__('Error', 'powerpress') . '</h3>';
265
+ global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
266
+ if( !empty($g_powerpress_remote_errorno) && $g_powerpress_remote_errorno == 401 )
267
+ $message .= '<p>'. __('Incorrect sign-in email address or password.', 'powerpress').'</p><p>'.__('Verify your account entered under Services and Statistics settings then try again.', 'powerpress') .'</p>';
268
+ else if( !empty($g_powerpress_remote_error) )
269
+ $message .= '<p>'.$g_powerpress_remote_error.'</p>';
270
+ else
271
+ $message .= '<p>'.__('Unable to connect to service.','powerpress').'</p>';
272
+
273
+ // Print an erro here
274
+ powerpress_page_message_add_notice( $message );
275
+ powerpress_page_message_print();
276
+ }
277
 
278
  if( $Msg )
279
  echo '<p>'. $Msg . '</p>';
527
  else
528
  {
529
  global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
530
+ //$Error = '<h3>'. __('Error', 'powerpress') .'</h3>';
531
  if( !empty($g_powerpress_remote_errorno) && $g_powerpress_remote_errorno == 401 )
532
+ $Error .= '<p>'. __('Incorrect sign-in email address or password.', 'powerpress') .'</p><p>'. __('Verify your account settings then try again.', 'powerpress') .'</p>';
533
  else if( !empty($g_powerpress_remote_error) )
534
+ $Error .= '<p>'.$g_powerpress_remote_error .'</p>';
535
  else
536
+ $Error .= '<p>'.__('Authentication failed.', 'powerpress') .'</p>';
537
  }
538
 
539
  if( $Error )
736
  }
737
  else if( $Error == false )
738
  {
739
+ global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
740
+ if( !empty($g_powerpress_remote_errorno) && $g_powerpress_remote_errorno == 401 )
741
+ $Error = '<p>'. __('Incorrect sign-in email address or password.', 'powerpress').'</p><p>'.__('Verify your account entered under Services and Statistics settings then try again.', 'powerpress') .'</p>';
742
+ else if( !empty($g_powerpress_remote_error) )
743
+ $Error = '<p>'.$g_powerpress_remote_error .'</p>';
744
+ else
745
+ $Error = '<p>'.__('Unable to obtain upload session.','powerpress') .'</p>';
746
  }
747
 
748
  powerpress_admin_jquery_header( __('Uploader','powerpress') );
powerpressadmin.php CHANGED
@@ -784,10 +784,6 @@ function powerpress_admin_init()
784
 
785
  //$term_info = term_exists($term_ID, $taxonomy_type);
786
  $tt_id = $term_object->term_taxonomy_id;
787
- //var_dump($term_info);
788
- //exit;
789
- // if( !empty($term_info['term_taxonomy_id']) )
790
- // $tt_id = $term_info['term_taxonomy_id'];
791
 
792
  if( !$tt_id )
793
  {
@@ -2832,6 +2828,9 @@ function powerpress_podpress_stats_exist()
2832
  */
2833
  function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array(), $timeout = 15, $custom_request = false )
2834
  {
 
 
 
2835
  if( function_exists( 'curl_init' ) ) // Preferred method of connecting
2836
  {
2837
  $curl = curl_init();
@@ -2887,12 +2886,30 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
2887
  $error = curl_errno($curl);
2888
  $error_msg = curl_error($curl);
2889
  $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
 
 
2890
  curl_close($curl);
2891
  if( $error )
2892
  {
2893
- global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
2894
- $g_powerpress_remote_error = $error_msg;
2895
- $g_powerpress_remote_errorno = $http_code;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2896
  return false;
2897
  }
2898
  return $content;
@@ -2916,11 +2933,25 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
2916
 
2917
  if ( is_wp_error( $response ) )
2918
  {
2919
- global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
2920
- $g_powerpress_remote_errorno = $response->get_error_code();
2921
- $g_powerpress_remote_error = $response->get_error_message();
2922
  return false;
2923
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2924
 
2925
  return $response['body'];
2926
  }
784
 
785
  //$term_info = term_exists($term_ID, $taxonomy_type);
786
  $tt_id = $term_object->term_taxonomy_id;
 
 
 
 
787
 
788
  if( !$tt_id )
789
  {
2828
  */
2829
  function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array(), $timeout = 15, $custom_request = false )
2830
  {
2831
+ unset($GLOBALS['g_powerpress_remote_error']);
2832
+ unset($GLOBALS['g_powerpress_remote_errorno']);
2833
+
2834
  if( function_exists( 'curl_init' ) ) // Preferred method of connecting
2835
  {
2836
  $curl = curl_init();
2886
  $error = curl_errno($curl);
2887
  $error_msg = curl_error($curl);
2888
  $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
2889
+
2890
+
2891
  curl_close($curl);
2892
  if( $error )
2893
  {
2894
+ $GLOBALS['g_powerpress_remote_error'] = $error_msg;
2895
+ $GLOBALS['g_powerpress_remote_errorno'] = $http_code;
2896
+ return false;
2897
+ }
2898
+ else if( $http_code > 399 )
2899
+ {
2900
+
2901
+ $GLOBALS['g_powerpress_remote_error'] = "HTTP $http_code";
2902
+ $GLOBALS['g_powerpress_remote_errorno'] = $http_code;
2903
+ switch( $http_code )
2904
+ {
2905
+ case 400: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Bad Request", 'powerpress'); break;
2906
+ case 401: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Unauthorized (Check that your username and password are correct)", 'powerpress'); break;
2907
+ case 402: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Payment Required", 'powerpress'); break;
2908
+ case 403: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Forbidden", 'powerpress'); break;
2909
+ case 404: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Not Found", 'powerpress'); break;
2910
+ }
2911
+
2912
+
2913
  return false;
2914
  }
2915
  return $content;
2933
 
2934
  if ( is_wp_error( $response ) )
2935
  {
2936
+ $GLOBALS['g_powerpress_remote_errorno'] = $response->get_error_code();
2937
+ $GLOBALS['g_powerpress_remote_error'] = $response->get_error_message();
 
2938
  return false;
2939
  }
2940
+
2941
+ if( isset($response['response']['code']) && $response['response']['code'] > 399 )
2942
+ {
2943
+ $GLOBALS['g_powerpress_remote_error'] = "HTTP ".$response['response']['code'];
2944
+ $GLOBALS['g_powerpress_remote_errorno'] = $response['response']['code'];
2945
+ switch( $response['response']['code'] )
2946
+ {
2947
+ case 400: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Bad Request", 'powerpress'); break;
2948
+ case 401: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Unauthorized (Check that your username and password are correct)", 'powerpress'); break;
2949
+ case 402: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Payment Required", 'powerpress'); break;
2950
+ case 403: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Forbidden", 'powerpress'); break;
2951
+ case 404: $GLOBALS['g_powerpress_remote_error'] .= ' '. __("Not Found", 'powerpress'); break;
2952
+ default: $GLOBALS['g_powerpress_remote_error'] .= ' '.$response['response']['message'];
2953
+ }
2954
+ }
2955
 
2956
  return $response['body'];
2957
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: amandato, blubrry
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, webm, mp4, m4v, wordpressmu, mu, wordpress mu, multisite, multi site, mediacaster, post, plugin, posts, simple, social, dashboard, TSG, Buzzsprout, MTR, WP-boxCast, CastMyBlog, simple podcasting, seriously simple podcasting, seriously-simple-podcasting, podlove, podcast.de
4
  Requires at least: 3.0
5
- Tested up to: 3.9
6
- Stable tag: 5.0.7
7
  Donate link: http://create.blubrry.com/
8
  License: GPLv2 or later
9
 
@@ -175,6 +175,15 @@ To install Blubrry PowerPress manually, follow these steps:
175
  * We are looking for beta testers! If you would like to beta test future versions of PowerPress, please [contact us](http://www.blubrry.com/contact.php) with your name and email.
176
 
177
 
 
 
 
 
 
 
 
 
 
178
  = 5.0.7 =
179
  * Released on 4/3/3014
180
  * Fixed bug found with some versions of php with a parse error on line 1345 (Thanks joebotha for reporting)
2
  Contributors: amandato, blubrry
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, webm, mp4, m4v, wordpressmu, mu, wordpress mu, multisite, multi site, mediacaster, post, plugin, posts, simple, social, dashboard, TSG, Buzzsprout, MTR, WP-boxCast, CastMyBlog, simple podcasting, seriously simple podcasting, seriously-simple-podcasting, podlove, podcast.de
4
  Requires at least: 3.0
5
+ Tested up to: 3.9.1
6
+ Stable tag: 5.0.8
7
  Donate link: http://create.blubrry.com/
8
  License: GPLv2 or later
9
 
175
  * We are looking for beta testers! If you would like to beta test future versions of PowerPress, please [contact us](http://www.blubrry.com/contact.php) with your name and email.
176
 
177
 
178
+ = 5.0.8 =
179
+ * Released on 6/11/2014
180
+ * Added better error reporting logic for services and statistics.
181
+ * Added option to get podcast meta data optionally from a value (rather than from database)
182
+ * Added logic to override the html content-type when a HTTP HEAD request is made for a feed URL
183
+ * Fixed notice message on line 220 of powerpress.php (thanks brandonferens for letting us know about the notice message)
184
+ * We will soon be releasing a beta version of PowerPress 6.0. If you are interested in beta testing, please [contact us](http://www.blubrry.com/contact.php).
185
+
186
+
187
  = 5.0.7 =
188
  * Released on 4/3/3014
189
  * Fixed bug found with some versions of php with a parse error on line 1345 (Thanks joebotha for reporting)