PowerPress Podcasting plugin by Blubrry - Version 0.9.1

Version Description

Download this release

Release Info

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

Code changes from version 0.9.0 to 0.9.1

powerpress.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
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 and iTunes integration.
6
- Version: 0.9.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -57,8 +57,8 @@ if( !defined('POWERPRESS_BLUBRRY_API_URL') )
57
 
58
  if( !defined('POWERPRESS_CONTENT_ACTION_PRIORITY') )
59
  define('POWERPRESS_CONTENT_ACTION_PRIORITY', 10 );
60
-
61
- //define('POWERPRESS_IN_THE_LOOP_CHECK', true); // Add this define if you are using a theme such as the Hybrid Theme that improperly calls the_content() and the_excerpt() filters incorrectly.
62
 
63
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
64
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
@@ -74,10 +74,6 @@ function powerpress_content($content)
74
  {
75
  global $post, $g_powerpress_excerpt_post_id;
76
 
77
- // For those poorly written themes that call in_the_loop only functions such as the_content() and the_excerpt() outside of the loop, such as in the wp_head action.
78
- if( in_the_loop() == false )
79
- return $content;
80
-
81
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
82
  return;
83
 
@@ -187,7 +183,8 @@ function powerpress_content($content)
187
  }
188
  if( !$EnclosureURL )
189
  continue;
190
- if( strpos($EnclosureURL, 'http://' ) !== 0 )
 
191
  $EnclosureURL = rtrim($GeneralSettings['default_url'], '/') .'/'. $EnclosureURL;
192
 
193
  // Add redirects to Media URL
@@ -597,7 +594,7 @@ function powerpress_rss2_item()
597
  if( $podPressMedia )
598
  {
599
  $EnclosureURL = $podPressMedia[0]['URI'];
600
- if( strpos($EnclosureURL, 'http://' ) !== 0 )
601
  $EnclosureURL = $powerpress_feed['default_url'] . $EnclosureURL;
602
  $EnclosureSize = $podPressMedia[0]['size'];
603
  $duration = $podPressMedia[0]['duration'];
@@ -606,7 +603,7 @@ function powerpress_rss2_item()
606
  if( $UrlParts['path'] )
607
  {
608
  // using functions that already exist in Wordpress when possible:
609
- $FileType = wp_check_filetype($UrlParts['path']);
610
  if( $FileType )
611
  $EnclosureType = $FileType['type'];
612
  }
@@ -885,6 +882,9 @@ function powerpress_init()
885
  {
886
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
887
  return false; // Another podcasting plugin is enabled...
 
 
 
888
 
889
  if( isset($_GET['powerpress_pinw']) )
890
  powerpress_do_pinw($_GET['powerpress_pinw']);
@@ -1154,6 +1154,21 @@ function powerpress_do_all_pings()
1154
  remove_action('do_pings', 'do_all_pings');
1155
  add_action('do_pings', 'powerpress_do_all_pings');
1156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1157
  function powerpress_player_filter($content, $media_url, $ExtraData = array() )
1158
  {
1159
  global $g_powerpress_player_id;
@@ -1340,10 +1355,6 @@ function powerpress_shortcode_handler( $attributes, $content = null )
1340
  {
1341
  global $post, $g_powerpress_player_added;
1342
 
1343
- // For those poorly written themes that call in_the_loop only functions such as the_content() and the_excerpt() outside of the loop, such as in the wp_head action.
1344
- if( in_the_loop() == false )
1345
- return '';
1346
-
1347
  // We can't add flash players to feeds
1348
  if( is_feed() )
1349
  return '';
2
  /*
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:
57
 
58
  if( !defined('POWERPRESS_CONTENT_ACTION_PRIORITY') )
59
  define('POWERPRESS_CONTENT_ACTION_PRIORITY', 10 );
60
+
61
+ //define('POWERPRESS_ENABLE_HTTPS_MEDIA', true); // Add this define to your wp-config.php if you wnat to allow media URLs that begin with https://
62
 
63
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
64
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
74
  {
75
  global $post, $g_powerpress_excerpt_post_id;
76
 
 
 
 
 
77
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
78
  return;
79
 
183
  }
184
  if( !$EnclosureURL )
185
  continue;
186
+
187
+ if( strpos($EnclosureURL, 'http://' ) !== 0 && strpos($EnclosureURL, 'https://' ) !== 0 )
188
  $EnclosureURL = rtrim($GeneralSettings['default_url'], '/') .'/'. $EnclosureURL;
189
 
190
  // Add redirects to Media URL
594
  if( $podPressMedia )
595
  {
596
  $EnclosureURL = $podPressMedia[0]['URI'];
597
+ if( strpos($EnclosureURL, 'http://' ) !== 0 && strpos($EnclosureURL, 'https://' ) !== 0 )
598
  $EnclosureURL = $powerpress_feed['default_url'] . $EnclosureURL;
599
  $EnclosureSize = $podPressMedia[0]['size'];
600
  $duration = $podPressMedia[0]['duration'];
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
  }
882
  {
883
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
884
  return false; // Another podcasting plugin is enabled...
885
+
886
+ // Translation support loaded:
887
+ load_plugin_textdomain('powerpress', false, dirname(plugin_basename(__FILE__)));
888
 
889
  if( isset($_GET['powerpress_pinw']) )
890
  powerpress_do_pinw($_GET['powerpress_pinw']);
1154
  remove_action('do_pings', 'do_all_pings');
1155
  add_action('do_pings', 'powerpress_do_all_pings');
1156
 
1157
+ function powerpress_future_to_publish($post)
1158
+ {
1159
+ // Perform iTunes ping here if configured...
1160
+ if( !is_admin() )
1161
+ { // If the future_to_publish is fired by a web visitor, we need to include the administration code so the iTunes ping goes as planned.
1162
+ $Settings = get_option('powerpress_general');
1163
+ if( isset($Settings['ping_itunes']) && $Settings['ping_itunes'] )
1164
+ {
1165
+ require_once(dirname(__FILE__).'/powerpressadmin.php');
1166
+ }
1167
+ }
1168
+ }
1169
+
1170
+ add_action('future_to_publish', 'powerpress_future_to_publish');
1171
+
1172
  function powerpress_player_filter($content, $media_url, $ExtraData = array() )
1173
  {
1174
  global $g_powerpress_player_id;
1355
  {
1356
  global $post, $g_powerpress_player_added;
1357
 
 
 
 
 
1358
  // We can't add flash players to feeds
1359
  if( is_feed() )
1360
  return '';
powerpressadmin-appearance.php CHANGED
@@ -68,6 +68,18 @@ while( list($value,$desc) = each($linkoptions) )
68
  </select>
69
  </td>
70
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
71
  </table>
72
 
73
 
68
  </select>
69
  </td>
70
  </tr>
71
+
72
+ <tr valign="top">
73
+ <th scope="row" style="background-image: url(/wp-includes/images/smilies/icon_exclaim.gif); background-position: 10px 10px; background-repeat: no-repeat; ">
74
+
75
+ <div style="margin-left: 24px;"><?php _e("Hybrid Themes"); ?></div></th>
76
+ <td>
77
+ <p style="margin-top: 5px;">
78
+ The Hybrid Theme system will fail to display the player and links when the Hybrid Theme Setting "Use the excerpt on single posts for your meta description?" is checked. To fix,
79
+ either uncheck the option or use the <a href="http://wordpress.org/extend/plugins/hybrid-bugfix/" target="_blank">Hybrid Theme Bugfix plugin</a>.
80
+ </p>
81
+ </td>
82
+ </tr>
83
  </table>
84
 
85
 
powerpressadmin-basic.php CHANGED
@@ -43,6 +43,7 @@ function SelectEntryBox(mode)
43
  document.getElementById('episode_box_keywords').disabled = (mode!=2);
44
  document.getElementById('episode_box_subtitle').disabled = (mode!=2);
45
  document.getElementById('episode_box_summary').disabled = (mode!=2);
 
46
  }
47
 
48
  </script>
@@ -157,6 +158,46 @@ while( list($value,$desc) = each($options) )
157
  'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=', $General['itunes_url']);
158
  ?>
159
  <p>You may also ping iTunes by using the following link: <a href="#" onclick="javascript: window.open('<?php echo $ping_url; ?>'); return false;" title="Ping iTunes in New Window">Ping iTunes in New Window</a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  <?php } ?>
161
  </td>
162
  </tr>
@@ -191,19 +232,26 @@ while( list($value,$desc) = each($options) )
191
  </ul>
192
  </li>
193
 
194
- <li><label><input type="radio" name="General[episode_box_mode]" value="2" <?php if( $General['episode_box_mode'] == 2 ) echo 'checked'; ?> onclick="SelectEntryBox(2);" /> Advanced</label></li>
195
  <li>
196
  <ul>
197
- <li>Episode entry box includes Media URL, File Size and Duration plus:
198
- <p style="margin-top: 15px;"><input id="episode_box_embed" name="General[episode_box_embed]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_embed'] ) echo ' checked'; ?> /> Embed Field (enter embed code from sites such as YouTube, Viddler and Blip.tv)</p>
199
- <p style="margin-top: 15px;"><input id="episode_box_no_player" name="General[episode_box_no_player]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_no_player'] ) echo ' checked'; ?> /> No Player Option (disable player on a per episode basis)</p>
 
 
 
200
 
201
- <p style="margin-top: 15px;"><input id="episode_box_keywords" name="General[episode_box_keywords]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_keywords'] ) echo ' checked'; ?> /> iTunes Keywords Field</p>
202
- <p style="margin-top: 15px;"><input id="episode_box_subtitle" name="General[episode_box_subtitle]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_subtitle'] ) echo ' checked'; ?> /> iTunes Subtitle Field</p>
203
- <p style="margin-top: 15px;"><input id="episode_box_summary" name="General[episode_box_summary]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_summary'] ) echo ' checked'; ?> /> iTunes Summary Field</p>
 
 
 
204
  <em>NOTE: An invalid entry into any of the iTunes fields may cause problems with your iTunes listing.
205
  It is highly recommended that you validate your feed using feedvalidator.org everytime you modify any of the iTunes fields listed above.</em><br />
206
  <em><strong>USE THE ITUNES FIELDS ABOVE AT YOUR OWN RISK.</strong></em>
 
207
  </li>
208
  </ul>
209
  </li>
43
  document.getElementById('episode_box_keywords').disabled = (mode!=2);
44
  document.getElementById('episode_box_subtitle').disabled = (mode!=2);
45
  document.getElementById('episode_box_summary').disabled = (mode!=2);
46
+ document.getElementById('episode_box_mode_adv').style.display = (mode==2?'block':'none');
47
  }
48
 
49
  </script>
158
  'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=', $General['itunes_url']);
159
  ?>
160
  <p>You may also ping iTunes by using the following link: <a href="#" onclick="javascript: window.open('<?php echo $ping_url; ?>'); return false;" title="Ping iTunes in New Window">Ping iTunes in New Window</a></p>
161
+
162
+ <?php
163
+ if( preg_match('/id=(\d+)/', $General['itunes_url'], $matches) )
164
+ {
165
+ $FEEDID = $matches[1];
166
+ $Logging = get_option('powerpress_log');
167
+
168
+ if( isset($Logging['itunes_ping_'. $FEEDID ]) )
169
+ {
170
+ $PingLog = $Logging['itunes_ping_'. $FEEDID ];
171
+ ?>
172
+ <h3>Latest iTunes Ping Status: <?php if( $PingLog['success'] ) echo '<span style="color: #006505;">Successful</span>'; else echo '<span style="color: #f00;">Error</span>'; ?></h3>
173
+ <div style="font-size: 85%; margin-left: 20px;">
174
+ <p>
175
+ <?php echo sprintf( __('iTunes pinged on %s at %s'), date(get_option('date_format'), $PingLog['timestamp']), date(get_option('time_format'), $PingLog['timestamp'])); ?>
176
+ <?php
177
+ if( $PingLog['post_id'] )
178
+ {
179
+ $post = get_post($PingLog['post_id']);
180
+ if( $post )
181
+ echo __(' for post: ') . htmlspecialchars($post->post_title);
182
+ }
183
+ ?>
184
+ </p>
185
+ <?php if( $PingLog['success'] ) { ?>
186
+ <p>Feed pulled by iTunes: <?php echo $PingLog['feed_url']; ?>
187
+ </p>
188
+ <?php
189
+
190
+ ?>
191
+ <?php } else { ?>
192
+ <p>Error: <?php echo htmlspecialchars($PingLog['content']); ?></p>
193
+ <?php } ?>
194
+ </div>
195
+ <?php
196
+ }
197
+ }
198
+ ?>
199
+
200
+
201
  <?php } ?>
202
  </td>
203
  </tr>
232
  </ul>
233
  </li>
234
 
235
+ <li><label><input type="radio" name="General[episode_box_mode]" value="2" <?php if( $General['episode_box_mode'] == 2 ) echo 'checked'; ?> onclick="SelectEntryBox(2);" /> Custom</label></li>
236
  <li>
237
  <ul>
238
+ <li>Episode entry box includes Media URL, File Size and Duration fields, plus:
239
+ <div id="episode_box_mode_adv" style="display: <?php echo ($General['episode_box_mode'] == 2?'block':'none'); ?>;">
240
+ <p style="margin-top: 15px;"><input id="episode_box_embed" name="General[episode_box_embed]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_embed'] ) echo ' checked'; ?> /> Embed Field
241
+ (Enter embed code from sites such as YouTube, Viddler and Blip.tv)</p>
242
+ <p style="margin-top: 15px;"><input id="episode_box_no_player" name="General[episode_box_no_player]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_no_player'] ) echo ' checked'; ?> /> No Player Option
243
+ (Disable player on a per episode basis)</p>
244
 
245
+ <p style="margin-top: 15px;"><input id="episode_box_keywords" name="General[episode_box_keywords]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_keywords'] ) echo ' checked'; ?> /> iTunes Keywords Field
246
+ (Leave blank to use your blog post tags)</p>
247
+ <p style="margin-top: 15px;"><input id="episode_box_subtitle" name="General[episode_box_subtitle]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_subtitle'] ) echo ' checked'; ?> /> iTunes Subtitle Field
248
+ (Leave blank to use the first 250 characters of your blog post)</p>
249
+ <p style="margin-top: 15px;"><input id="episode_box_summary" name="General[episode_box_summary]" <?php if( $General['episode_box_mode'] != 2 ) echo 'disabled'; ?> type="checkbox" value="1"<?php if( $General['episode_box_summary'] ) echo ' checked'; ?> /> iTunes Summary Field
250
+ (Leave blank to use your blog post)</p>
251
  <em>NOTE: An invalid entry into any of the iTunes fields may cause problems with your iTunes listing.
252
  It is highly recommended that you validate your feed using feedvalidator.org everytime you modify any of the iTunes fields listed above.</em><br />
253
  <em><strong>USE THE ITUNES FIELDS ABOVE AT YOUR OWN RISK.</strong></em>
254
+ </div>
255
  </li>
256
  </ul>
257
  </li>
powerpressadmin-editfeed.php CHANGED
@@ -312,6 +312,83 @@ while( list($value,$desc) = each($applyoptions) )
312
  </td>
313
  </tr>
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
 
316
  <tr valign="top">
317
  <th scope="row">
312
  </td>
313
  </tr>
314
 
315
+ <?php
316
+
317
+ if( $General['ping_itunes'] && $feed_slug != 'podcast' )
318
+ {
319
+ ?>
320
+ <tr valign="top">
321
+ <th scope="row">
322
+ <?php _e("iTunes URL"); ?>
323
+ </th>
324
+ <td>
325
+ <input type="text" style="width: 80%;" name="Feed[itunes_url]" value="<?php echo $FeedSettings['itunes_url']; ?>" maxlength="250" />
326
+ <p>Click the following link to <a href="https://phobos.apple.com/WebObjects/MZFinance.woa/wa/publishPodcast" target="_blank" title="Publish a Podcast on iTunes">Publish a Podcast on iTunes</a>.
327
+ Once your podcast is listed on iTunes, enter your one-click subscription URL above.
328
+ </p>
329
+ <p>e.g. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=000000000</p>
330
+
331
+ <p><input name="TestiTunesPing" type="checkbox" value="1" /> Test iTunes Ping (recommended)</p>
332
+ <?php if( $FeedSettings['itunes_url'] ) {
333
+
334
+ $ping_url = str_replace(
335
+ array( 'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
336
+ 'http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
337
+ 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
338
+ 'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
339
+ 'https://www.itunes.com/podcast?id=',
340
+ 'http://www.itunes.com/podcast?id='),
341
+ 'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=', $FeedSettings['itunes_url']);
342
+ ?>
343
+ <p>You may also ping iTunes by using the following link: <a href="#" onclick="javascript: window.open('<?php echo $ping_url; ?>'); return false;" title="Ping iTunes in New Window">Ping iTunes in New Window</a></p>
344
+
345
+ <?php
346
+ if( preg_match('/id=(\d+)/', $FeedSettings['itunes_url'], $matches) )
347
+ {
348
+ $FEEDID = $matches[1];
349
+ $Logging = get_option('powerpress_log');
350
+
351
+ if( isset($Logging['itunes_ping_'. $FEEDID ]) )
352
+ {
353
+ $PingLog = $Logging['itunes_ping_'. $FEEDID ];
354
+ ?>
355
+ <h3>Latest iTunes Ping Status: <?php if( $PingLog['success'] ) echo '<span style="color: #006505;">Successful</span>'; else echo '<span style="color: #f00;">Error</span>'; ?></h3>
356
+ <div style="font-size: 85%; margin-left: 20px;">
357
+ <p>
358
+ <?php echo sprintf( __('iTunes pinged on %s at %s'), date(get_option('date_format'), $PingLog['timestamp']), date(get_option('time_format'), $PingLog['timestamp'])); ?>
359
+ <?php
360
+ if( $PingLog['post_id'] )
361
+ {
362
+ $post = get_post($PingLog['post_id']);
363
+ if( $post )
364
+ echo __(' for post: ') . htmlspecialchars($post->post_title);
365
+ }
366
+ ?>
367
+ </p>
368
+ <?php if( $PingLog['success'] ) { ?>
369
+ <p>Feed pulled by iTunes: <?php echo $PingLog['feed_url']; ?>
370
+ </p>
371
+ <?php
372
+
373
+ ?>
374
+ <?php } else { ?>
375
+ <p>Error: <?php echo htmlspecialchars($PingLog['content']); ?></p>
376
+ <?php } ?>
377
+ </div>
378
+ <?php
379
+ }
380
+ }
381
+ ?>
382
+
383
+ <?php } ?>
384
+
385
+ </td>
386
+ </tr>
387
+ <?php
388
+ }
389
+ ?>
390
+
391
+
392
 
393
  <tr valign="top">
394
  <th scope="row">
powerpressadmin-mode.php CHANGED
@@ -33,7 +33,8 @@
33
  <li><em>Advanced Settings</em> - Tweak additional basic settings.</li>
34
  <li><em>Presentation Settings</em> - Customize web player and media download links</li>
35
  <li><em>Extensive Feed Settings</em> - Tweak all available feed settings</li>
36
- <li><em>Manage Custom Feeds</em> - Manage and add custom podcast feeds</li>
 
37
  <li><em>MP3 ID3 Tags</em> - Blubrry Media Hosting users can configure how their MP3 ID3 tags are written to hosted media</li>
38
  <li><em>Useful Tools</em> - Import data from previous sites (PodPress, MovableType, Blogger), add Update Sservices to your blog and more</li>
39
  </ul></li></ul>
33
  <li><em>Advanced Settings</em> - Tweak additional basic settings.</li>
34
  <li><em>Presentation Settings</em> - Customize web player and media download links</li>
35
  <li><em>Extensive Feed Settings</em> - Tweak all available feed settings</li>
36
+ <li><em>Manage Custom Podcast Feeds</em> - Manage and add custom podcast feeds</li>
37
+ <li><em>Manage Category Podcast Feeds</em> - Manage and add category podcast feeds</li>
38
  <li><em>MP3 ID3 Tags</em> - Blubrry Media Hosting users can configure how their MP3 ID3 tags are written to hosted media</li>
39
  <li><em>Useful Tools</em> - Import data from previous sites (PodPress, MovableType, Blogger), add Update Sservices to your blog and more</li>
40
  </ul></li></ul>
powerpressadmin-podpress.php CHANGED
@@ -52,7 +52,7 @@
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 = wp_check_filetype( $episode_data['URI'] );
56
  if( $FileType )
57
  $clean_data[ $episode_index ]['type'] = $FileType['type'];
58
  }
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
  }
powerpressadmin-tools.php CHANGED
@@ -91,7 +91,18 @@
91
  </p>
92
  </td>
93
  </tr>
94
-
 
 
 
 
 
 
 
 
 
 
 
95
  </table>
96
  <?php
97
 
91
  </p>
92
  </td>
93
  </tr>
94
+
95
+ <!--
96
+ <tr valign="top">
97
+ <th scope="row">Plugin Translation</th>
98
+ <td>
99
+ <p style="margin-top: 5px;">
100
+ Coming soon.
101
+ </p>
102
+ </td>
103
+ </tr>
104
+ -->
105
+
106
  </table>
107
  <?php
108
 
powerpressadmin.php CHANGED
@@ -295,7 +295,9 @@ function powerpress_admin_init()
295
 
296
  if( @$_POST['TestiTunesPing'] == 1 )
297
  {
298
- $PingResults = powerpress_ping_itunes($General['itunes_url']);
 
 
299
  if( @$PingResults['success'] )
300
  {
301
  powerpress_page_message_add_notice( 'iTunes Ping Successful. Podcast Feed URL: '. $PingResults['feed_url'] );
@@ -722,10 +724,21 @@ function powerpress_edit_post($post_ID, $post)
722
 
723
  // Initialize the important variables:
724
  $MediaURL = $Powerpress['url'];
725
- if( strpos($MediaURL, 'http://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http://
726
  {
727
- $Settings = get_option('powerpress_general');
728
- $MediaURL = rtrim(@$Settings['default_url'], '/') .'/'. $MediaURL;
 
 
 
 
 
 
 
 
 
 
 
729
  }
730
 
731
  $FileSize = '';
@@ -738,19 +751,11 @@ function powerpress_edit_post($post_ID, $post)
738
  if( $UrlParts['path'] )
739
  {
740
  // using functions that already exist in Wordpress when possible:
741
- $FileType = wp_check_filetype($UrlParts['path']);
742
  if( $FileType )
743
  $ContentType = $FileType['type'];
744
  else
745
  $ContentType = 'application/binary';
746
- /*
747
- $FileParts = pathinfo($UrlParts['path']);
748
- if( $FileParts )
749
- {
750
-
751
- $ContentType = powerpress_mimetypes($FileParts['extension']);
752
- }
753
- */
754
  }
755
 
756
  //Set the duration specified by the user
@@ -871,46 +876,10 @@ function powerpress_edit_post($post_ID, $post)
871
  delete_post_meta( $post_ID, 'itunes:duration'); // Simple cleanup, we're storing the duration in the enclosure as serialized value
872
  }
873
  }
874
-
875
- // If we're moving from draft to published, maybe we should ping iTunes?
876
- if($_POST['prev_status'] == 'draft' && $_POST['publish'] == 'Publish' )
877
- {
878
- // Next double check we're looking at a podcast episode...
879
- $Enclosure = get_post_meta($post_ID, $field, true);
880
- if( $Enclosure )
881
- {
882
- $Settings = get_option('powerpress_feed_'.$feed_slug);
883
- if( $Settings['ping_itunes'] && $Settings['itunes_url'] )
884
- {
885
- $PingResults = powerpress_ping_itunes($Settings['itunes_url']);
886
- //mail( 'email@host.com', 'Ping iTunes Results', implode("\n", $PingResults) ); // Let me know how the ping went.
887
- }
888
- }
889
- }
890
  } // Loop through posted episodes...
891
  }
892
 
893
- // If we're moving from draft to published, maybe we should ping iTunes?
894
- if($_POST['prev_status'] == 'draft' && $_POST['publish'] == 'Publish' )
895
- {
896
- //mail('cio@rawvoice.com', 'WordPress Publish Post', print_r($_POST, true) );
897
- $Settings = get_option('powerpress_general');
898
-
899
- // Next double check we're looking at a podcast episode...
900
- $Enclosure = get_post_meta($post_ID, 'enclosure', true);
901
- if( $Enclosure )
902
- {
903
- if( $Settings['ping_itunes'] && $Settings['itunes_url'] )
904
- {
905
- $PingResults = powerpress_ping_itunes($Settings['itunes_url']);
906
- //mail( 'email@host.com', 'Ping iTunes Results', implode("\n", $PingResults) ); // Let me know how the ping went.
907
- }
908
- }
909
-
910
- if( $Settings['blubrry_hosting'] )
911
- powerpress_process_hosting($post_ID, $post->post_title); // Call anytime blog post is in the published state
912
- }
913
- else if( $_POST['post_status'] == 'publish' )
914
  {
915
  $Settings = get_option('powerpress_general');
916
 
@@ -923,6 +892,14 @@ function powerpress_edit_post($post_ID, $post)
923
 
924
  add_action('edit_post', 'powerpress_edit_post', 10, 2);
925
 
 
 
 
 
 
 
 
 
926
  // Admin page, html meta header
927
  function powerpress_admin_head()
928
  {
@@ -1061,6 +1038,20 @@ function powerpress_check_url(url)
1061
  if( x == 5 )
1062
  validChars = validChars.substring(1); // remove the colon, should no longer appear in URLs
1063
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1064
 
1065
  document.getElementById(DestDiv).style.display = 'none';
1066
  }
@@ -1266,11 +1257,68 @@ function powerpress_admin_page()
1266
  /*
1267
  // Helper functions:
1268
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1269
  function powerpress_ping_itunes($iTunes_url)
1270
  {
1271
  // Pull the iTunes FEEDID from the URL...
1272
  if( !preg_match('/id=(\d+)/', $iTunes_url, $matches) )
1273
- return array('error'=>true, 'content'=>'iTunes URL required to ping iTunes.');
1274
 
1275
  $FEEDID = $matches[1];
1276
 
@@ -1282,10 +1330,16 @@ function powerpress_ping_itunes($iTunes_url)
1282
  $tempdata = powerpress_remote_fopen($ping_url);
1283
 
1284
  if( $tempdata == false )
1285
- return array('error'=>true, 'content'=>'Unable to connect to iTunes ping server.');
 
 
 
 
 
 
1286
 
1287
  if( stristr($tempdata, 'No Podcast Found') )
1288
- return array('error'=>true, 'content'=>'No Podcast Found from iTunes ping request');
1289
 
1290
  // Parse the data into something readable
1291
  $results = trim( str_replace('Podcast Ping Received', '', strip_tags($tempdata) ) );
@@ -1294,6 +1348,22 @@ function powerpress_ping_itunes($iTunes_url)
1294
  return array('success'=>true, 'content'=>$tempdata, 'feed_url'=>trim($FeedURL), 'podcast_id'=>trim($PodcastID) );
1295
  }
1296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1297
  function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array(), $timeout = 10 )
1298
  {
1299
  if( function_exists( 'curl_init' ) ) // Preferred method of connecting
295
 
296
  if( @$_POST['TestiTunesPing'] == 1 )
297
  {
298
+ $PingResults = powerpress_ping_itunes($General?$General['itunes_url']:$Feed['itunes_url']);
299
+ powerpress_ping_itunes_log($PingResults);
300
+
301
  if( @$PingResults['success'] )
302
  {
303
  powerpress_page_message_add_notice( 'iTunes Ping Successful. Podcast Feed URL: '. $PingResults['feed_url'] );
724
 
725
  // Initialize the important variables:
726
  $MediaURL = $Powerpress['url'];
727
+ if( defined('POWERPRESS_ENABLE_HTTPS_MEDIA') )
728
  {
729
+ if( strpos($MediaURL, 'http://') !== 0 && strpos($MediaURL, 'https://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http:// or https://
730
+ {
731
+ $Settings = get_option('powerpress_general');
732
+ $MediaURL = rtrim(@$Settings['default_url'], '/') .'/'. $MediaURL;
733
+ }
734
+ }
735
+ else
736
+ {
737
+ if( strpos($MediaURL, 'http://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http://
738
+ {
739
+ $Settings = get_option('powerpress_general');
740
+ $MediaURL = rtrim(@$Settings['default_url'], '/') .'/'. $MediaURL;
741
+ }
742
  }
743
 
744
  $FileSize = '';
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
  }
760
 
761
  //Set the duration specified by the user
876
  delete_post_meta( $post_ID, 'itunes:duration'); // Simple cleanup, we're storing the duration in the enclosure as serialized value
877
  }
878
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
879
  } // Loop through posted episodes...
880
  }
881
 
882
+ if( $post->post_status == 'publish' || $post->post_status == 'private' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
883
  {
884
  $Settings = get_option('powerpress_general');
885
 
892
 
893
  add_action('edit_post', 'powerpress_edit_post', 10, 2);
894
 
895
+ // Do the iTunes pinging here...
896
+ function powerpress_publish_post($post_id)
897
+ {
898
+ powerpress_do_ping_itunes($post_id);
899
+ }
900
+
901
+ add_action('publish_post', 'powerpress_publish_post');
902
+
903
  // Admin page, html meta header
904
  function powerpress_admin_head()
905
  {
1038
  if( x == 5 )
1039
  validChars = validChars.substring(1); // remove the colon, should no longer appear in URLs
1040
  }
1041
+
1042
+ <?php
1043
+ if( !defined('POWERPRESS_ENABLE_HTTPS_MEDIA') )
1044
+ {
1045
+ ?>
1046
+ if( url.charAt(0) == 'h' && url.charAt(1) == 't' && url.charAt(2) == 't' && url.charAt(3) == 'p' && url.charAt(4) == 's' )
1047
+ {
1048
+ document.getElementById(DestDiv).innerHTML = 'Media URL should not start with https://.<br />Not all podcatching (podcast downloading) applications support secure http.<br />By using https://, you may limit the size of your audience.';
1049
+ document.getElementById(DestDiv).style.display = 'block';
1050
+ return;
1051
+ }
1052
+ <?php
1053
+ }
1054
+ ?>
1055
 
1056
  document.getElementById(DestDiv).style.display = 'none';
1057
  }
1257
  /*
1258
  // Helper functions:
1259
  */
1260
+ function powerpress_do_ping_itunes($post_id)
1261
+ {
1262
+ $Settings = get_option('powerpress_general');
1263
+ if( isset($Settings['ping_itunes']) && $Settings['ping_itunes'] )
1264
+ {
1265
+ $Enclosure = get_post_meta($post_id, 'enclosure', true);
1266
+ if( $Enclosure )
1267
+ {
1268
+ if( $Settings['ping_itunes'] && $Settings['itunes_url'] )
1269
+ {
1270
+ $PingResults = powerpress_ping_itunes($Settings['itunes_url']);
1271
+ powerpress_ping_itunes_log($PingResults, $post_id);
1272
+ }
1273
+
1274
+ // Category feeds
1275
+ if( isset($Settings['custom_cat_feeds']) )
1276
+ {
1277
+ $post_categories = wp_get_post_categories($post_id);
1278
+ while( list($null, $cat_id) = each($post_categories) )
1279
+ {
1280
+ if( !in_array($cat_id, $Settings['custom_cat_feeds']) )
1281
+ continue; // This isn't a podcast category, so skip it...
1282
+
1283
+ $FeedSettings = get_option('powerpress_cat_feed_'.$cat_id);
1284
+ if( $FeedSettings && $FeedSettings['itunes_url'] )
1285
+ {
1286
+ $PingResults = powerpress_ping_itunes($FeedSettings['itunes_url']);
1287
+ powerpress_ping_itunes_log($PingResults, $post_id);
1288
+ }
1289
+ }
1290
+ }
1291
+ }
1292
+
1293
+ // Custom Podcast Feeds
1294
+ if( isset($Settings['custom_feeds']) )
1295
+ {
1296
+ while( list($feed_slug,$null) = each($Settings['custom_feeds']) )
1297
+ {
1298
+ if( $feed_slug == 'podcast' )
1299
+ continue;
1300
+
1301
+ // Next double check we're looking at a podcast episode...
1302
+ $Enclosure = get_post_meta($post_id, '_'.$feed_slug.':enclosure', true);
1303
+ if( $Enclosure )
1304
+ {
1305
+ $FeedSettings = get_option('powerpress_feed_'.$feed_slug);
1306
+ if( $FeedSettings && $FeedSettings['itunes_url'] )
1307
+ {
1308
+ $PingResults = powerpress_ping_itunes($FeedSettings['itunes_url']);
1309
+ powerpress_ping_itunes_log($PingResults, $post_id);
1310
+ }
1311
+ }
1312
+ }
1313
+ }
1314
+ }
1315
+ }
1316
+
1317
  function powerpress_ping_itunes($iTunes_url)
1318
  {
1319
  // Pull the iTunes FEEDID from the URL...
1320
  if( !preg_match('/id=(\d+)/', $iTunes_url, $matches) )
1321
+ return array('error'=>true, 'content'=>'iTunes URL required to ping iTunes.', 'podcast_id'=>0 );
1322
 
1323
  $FEEDID = $matches[1];
1324
 
1330
  $tempdata = powerpress_remote_fopen($ping_url);
1331
 
1332
  if( $tempdata == false )
1333
+ {
1334
+ // Simetimes this happens, lets try again...
1335
+ sleep(1); // wait just a second :)
1336
+ $tempdata = powerpress_remote_fopen($ping_url);
1337
+ if( $tempdata == false )
1338
+ return array('error'=>true, 'content'=>'Unable to connect to iTunes ping server.', 'podcast_id'=>trim($PodcastID));
1339
+ }
1340
 
1341
  if( stristr($tempdata, 'No Podcast Found') )
1342
+ return array('error'=>true, 'content'=>'No Podcast Found from iTunes ping request.', 'podcast_id'=>trim($PodcastID));
1343
 
1344
  // Parse the data into something readable
1345
  $results = trim( str_replace('Podcast Ping Received', '', strip_tags($tempdata) ) );
1348
  return array('success'=>true, 'content'=>$tempdata, 'feed_url'=>trim($FeedURL), 'podcast_id'=>trim($PodcastID) );
1349
  }
1350
 
1351
+ function powerpress_ping_itunes_log($Data, $post_id = 0)
1352
+ {
1353
+ if( $Data['podcast_id'] )
1354
+ {
1355
+ $Log = array();
1356
+ $Log['timestamp'] = time();
1357
+ $Log['feed_url'] = $Data['feed_url'];
1358
+ $Log['success'] = (isset($Data['error'])?0:1);
1359
+ $Log['content'] = $Data['content'];
1360
+ $Log['post_id'] = $post_id;
1361
+ $Save = array();
1362
+ $Save['itunes_ping_'.$Data['podcast_id'] ] = $Log;
1363
+ powerpress_save_settings($Save, 'powerpress_log');
1364
+ }
1365
+ }
1366
+
1367
  function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array(), $timeout = 10 )
1368
  {
1369
  if( function_exists( 'curl_init' ) ) // Preferred method of connecting
readme.txt CHANGED
@@ -3,17 +3,20 @@ 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.0
7
 
8
  Add podcasting support to your blog.
9
 
10
  == Description ==
11
  The Blubrry PowerPress Podcast Plugin has all of the essential features needed to provide podcasting support in a Wordpress blog.
12
 
 
 
13
  The Blubrry PowerPress interface allows you to easily add/modify/remove podcast episodes from blog posts and includes a simple on-line media player, iTunes compatibile RSS feed tags, ability to upload cover art images, ping iTunes, detect media size, detect time duration (mp3's only) and add 3rd party media statistics.
14
 
15
  Features:
16
 
 
17
  * Easily add/modify/remove podcast episodes from blog posts and pages
18
  * Integrated audio/video media player
19
  * Embed player within blog posts with [powerpress] shortcode
@@ -28,7 +31,7 @@ Features:
28
  * Enhanced iTunes summaries from blog posts option
29
  * iTunes album/cover art
30
  * Upload new iTunes/RSS cover art
31
- * Ping iTunes
32
  * Media size detection
33
  * Duration detection (mp3 only)
34
  * 3rd party statistics integration
@@ -76,11 +79,15 @@ As a alternative, PowerPress allows you to create additional Custom Podcast Feed
76
 
77
  == Screenshots ==
78
  1. Add podcast episode, found within the edit post screen
79
- 2. Cross section of Blubrry PowerPress settings page (Feed settings).
80
- 3. Cross section of Blubrry PowerPress settings page (Basic settings).
 
81
 
82
  == Changelog ==
83
 
 
 
 
84
  0.9.0 released on 7/20/2009
85
  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.
86
 
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
 
10
  == Description ==
11
  The Blubrry PowerPress Podcast Plugin has all of the essential features needed to provide podcasting support in a Wordpress blog.
12
 
13
+ For users who feel the plugin is too complicated, we've included a Simple Mode. Simple Mode only includes the essential features to your blog to support podcasting.
14
+
15
  The Blubrry PowerPress interface allows you to easily add/modify/remove podcast episodes from blog posts and includes a simple on-line media player, iTunes compatibile RSS feed tags, ability to upload cover art images, ping iTunes, detect media size, detect time duration (mp3's only) and add 3rd party media statistics.
16
 
17
  Features:
18
 
19
+ * Simple Mode (displays only the essential features in one settings page)
20
  * Easily add/modify/remove podcast episodes from blog posts and pages
21
  * Integrated audio/video media player
22
  * Embed player within blog posts with [powerpress] shortcode
31
  * Enhanced iTunes summaries from blog posts option
32
  * iTunes album/cover art
33
  * Upload new iTunes/RSS cover art
34
+ * Ping iTunes (with logging)
35
  * Media size detection
36
  * Duration detection (mp3 only)
37
  * 3rd party statistics integration
79
 
80
  == Screenshots ==
81
  1. Add podcast episode, found within the edit post screen
82
+ 2. Cross section of Blubrry PowerPress Feed settings page (Advanced Mode)
83
+ 3. Cross section of Blubrry PowerPress Basic settings page (Simple Mode)
84
+ 4. Cross section of blog post with built-in flash player and download links
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
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg CHANGED
Binary file
screenshot-3.jpg CHANGED
Binary file
screenshot-4.jpg ADDED
Binary file