Version Description
- Released on 7/31/2019
- Fixed bug for older versions of PHP with WebSub, service to notify Google Podcasts of new episodes.
Download this release
Release Info
Developer | amandato |
Plugin | PowerPress Podcasting plugin by Blubrry |
Version | 7.5.3 |
Comparing to | |
See all releases |
Code changes from version 7.5.2 to 7.5.3
- class.powerpresswebsub.php +26 -39
- powerpress.php +2 -2
- powerpressadmin.php +9 -9
- readme.txt +7 -1
class.powerpresswebsub.php
CHANGED
@@ -5,14 +5,8 @@ class PowerPressWebSub
|
|
5 |
{
|
6 |
const DEFAULT_HUB = "https://pubsubhubbub.appspot.com";
|
7 |
private $hub;
|
8 |
-
private $wp_remote_options =
|
9 |
-
|
10 |
-
"httpversion" => '1.1',
|
11 |
-
"headers" => array('Content-Type' => 'application/x-www-form-urlencoded'),
|
12 |
-
"body" => array(
|
13 |
-
'hub.mode' => 'publish'
|
14 |
-
)
|
15 |
-
);
|
16 |
|
17 |
/**
|
18 |
* Websub constructor.
|
@@ -20,37 +14,41 @@ class PowerPressWebSub
|
|
20 |
*/
|
21 |
public function __construct($hub = self::DEFAULT_HUB){
|
22 |
$this->hub = $hub;
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
|
|
25 |
/**
|
26 |
* Publishes update to the hub
|
27 |
* @param string $feedUrl URL of feed to update
|
28 |
-
* @throws Exception Throws exception if HTTP response is not
|
29 |
*/
|
30 |
public function publish($feedUrl) {
|
31 |
-
if($this->isWebsubEnabled()) {
|
32 |
-
$this->wp_remote_options['body']['hub.url'] = $feedUrl;
|
33 |
-
$response = wp_remote_post($this->hub, $this->wp_remote_options);
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
if ($response->get_error_message())
|
38 |
-
throw new Exception($response->get_error_message());
|
39 |
-
else
|
40 |
-
throw new Exception("HTTP error response " . $response->get_error_code());
|
41 |
-
return false;
|
42 |
-
}
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
|
|
|
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -60,15 +58,4 @@ class PowerPressWebSub
|
|
60 |
{
|
61 |
return $this->hub;
|
62 |
}
|
63 |
-
|
64 |
-
public function isWebsubEnabled() {
|
65 |
-
require_once 'powerpressadmin.php';
|
66 |
-
$GeneralSettings = powerpress_get_settings('powerpress_general');
|
67 |
-
if(!empty($GeneralSettings['websub_enabled']) && $GeneralSettings['websub_enabled'] == 1) {
|
68 |
-
return true;
|
69 |
-
}
|
70 |
-
else {
|
71 |
-
return false;
|
72 |
-
}
|
73 |
-
}
|
74 |
}
|
5 |
{
|
6 |
const DEFAULT_HUB = "https://pubsubhubbub.appspot.com";
|
7 |
private $hub;
|
8 |
+
private $wp_remote_options = false;
|
9 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
/**
|
12 |
* Websub constructor.
|
14 |
*/
|
15 |
public function __construct($hub = self::DEFAULT_HUB){
|
16 |
$this->hub = $hub;
|
17 |
+
$this->wp_remote_options['user_agent'] = 'Blubrry PowerPress/'.POWERPRESS_VERSION;
|
18 |
+
$this->wp_remote_options['httpversion'] = '1.1';
|
19 |
+
$this->wp_remote_options['headers'] = array('Content-Type'=>'application/x-www-form-urlencoded');
|
20 |
+
$this->wp_remote_options['body'] = array('hub.mode'=>'publish');
|
21 |
}
|
22 |
|
23 |
+
|
24 |
/**
|
25 |
* Publishes update to the hub
|
26 |
* @param string $feedUrl URL of feed to update
|
27 |
+
* @throws Exception Throws exception if HTTP response is not 20x and returns HTTP body
|
28 |
*/
|
29 |
public function publish($feedUrl) {
|
|
|
|
|
|
|
30 |
|
31 |
+
$this->wp_remote_options['body']['hub.url'] = $feedUrl;
|
32 |
+
$response = wp_remote_post($this->hub, $this->wp_remote_options);
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
if (is_wp_error($response)) // Handle system level errors
|
35 |
+
{
|
36 |
+
if ($response->get_error_message())
|
37 |
+
throw new Exception($response->get_error_message());
|
38 |
+
else
|
39 |
+
throw new Exception("HTTP error response " . $response->get_error_code());
|
40 |
+
return false;
|
41 |
+
}
|
42 |
|
43 |
+
if ($response['response']['code'] > 299) {
|
44 |
+
if (!empty($response['body'])) // Handle service level errors
|
45 |
+
throw new Exception($response['body']);
|
46 |
+
else
|
47 |
+
throw new Exception("HTTP response " . $response['response']['code']);
|
48 |
+
return false;
|
49 |
}
|
50 |
+
|
51 |
+
return true;
|
52 |
}
|
53 |
|
54 |
/**
|
58 |
{
|
59 |
return $this->hub;
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
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> is the No. 1 Podcasting plugin for WordPress. Developed by podcasters for podcasters; features include Simple and Advanced modes, multiple audio/video player options, subscribe to podcast tools, podcast SEO features, and more! Fully supports Apple Podcasts (previously iTunes), Google Podcasts, Spotify, Stitcher, and Blubrry Podcasting directories, as well as all podcast applications and clients.
|
6 |
-
Version: 7.5.
|
7 |
Author: Blubrry
|
8 |
Author URI: http://www.blubrry.com/
|
9 |
Requires at least: 3.6
|
@@ -35,7 +35,7 @@ if( !function_exists('add_action') ) {
|
|
35 |
}
|
36 |
|
37 |
// WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
|
38 |
-
define('POWERPRESS_VERSION', '7.5.
|
39 |
|
40 |
// Translation support:
|
41 |
if ( !defined('POWERPRESS_ABSPATH') )
|
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> is the No. 1 Podcasting plugin for WordPress. Developed by podcasters for podcasters; features include Simple and Advanced modes, multiple audio/video player options, subscribe to podcast tools, podcast SEO features, and more! Fully supports Apple Podcasts (previously iTunes), Google Podcasts, Spotify, Stitcher, and Blubrry Podcasting directories, as well as all podcast applications and clients.
|
6 |
+
Version: 7.5.3
|
7 |
Author: Blubrry
|
8 |
Author URI: http://www.blubrry.com/
|
9 |
Requires at least: 3.6
|
35 |
}
|
36 |
|
37 |
// WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
|
38 |
+
define('POWERPRESS_VERSION', '7.5.3' );
|
39 |
|
40 |
// Translation support:
|
41 |
if ( !defined('POWERPRESS_ABSPATH') )
|
powerpressadmin.php
CHANGED
@@ -2125,14 +2125,14 @@ function powerpress_edit_post($post_ID, $post)
|
|
2125 |
powerpress_metabox_save($post_ID);
|
2126 |
}
|
2127 |
}
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
//WebSub
|
2135 |
-
if($post->post_status == 'publish') {
|
2136 |
require_once( 'class.powerpresswebsub.php' );
|
2137 |
$Websub = new PowerPressWebSub();
|
2138 |
$feedUrls = array(); //feed urls that have been updated by this post and that the hub should be notified about.
|
@@ -4096,7 +4096,7 @@ function powerpress_write_tags($file, $post_title, $program_keyword = false)
|
|
4096 |
if( empty($program_keyword) && !empty($Settings['blubrry_program_keyword']) ) {
|
4097 |
$program_keyword = $Settings['blubrry_program_keyword'];
|
4098 |
}
|
4099 |
-
|
4100 |
$PostArgs = array();
|
4101 |
$Fields = array('title','artist','album','genre','year','track','composer','copyright','url');
|
4102 |
foreach( $Fields as $null => $field )
|
2125 |
powerpress_metabox_save($post_ID);
|
2126 |
}
|
2127 |
}
|
2128 |
+
// Anytime the post is marked published, private or scheduled for the future we need to make sure we're making the media available for hosting
|
2129 |
+
if( $post->post_status == 'publish' || $post->post_status == 'private' || $post->post_status == 'future' )
|
2130 |
+
{
|
2131 |
+
if( !empty($GeneralSettings['blubrry_hosting']) && $GeneralSettings['blubrry_hosting'] !== 'false' )
|
2132 |
+
powerpress_process_hosting($post_ID, $post->post_title); // Call anytime blog post is in the published state
|
2133 |
+
}
|
2134 |
+
//WebSub implementation
|
2135 |
+
if($post->post_status == 'publish' && !empty($GeneralSettings['websub_enabled']) ) {
|
2136 |
require_once( 'class.powerpresswebsub.php' );
|
2137 |
$Websub = new PowerPressWebSub();
|
2138 |
$feedUrls = array(); //feed urls that have been updated by this post and that the hub should be notified about.
|
4096 |
if( empty($program_keyword) && !empty($Settings['blubrry_program_keyword']) ) {
|
4097 |
$program_keyword = $Settings['blubrry_program_keyword'];
|
4098 |
}
|
4099 |
+
|
4100 |
$PostArgs = array();
|
4101 |
$Fields = array('title','artist','album','genre','year','track','composer','copyright','url');
|
4102 |
foreach( $Fields as $null => $field )
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: podcasting, podcast, podcaster, powerpress, itunes, apple, apple podcasts,
|
|
4 |
Requires at least: 3.6
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.2.2
|
7 |
-
Stable tag: 7.5.
|
8 |
Donate link: https://create.blubrry.com/resources/podcast-media-hosting/
|
9 |
License: GPLv2 or later
|
10 |
|
@@ -234,11 +234,17 @@ To install Blubrry PowerPress manually, follow these steps:
|
|
234 |
= Fan of PowerPress and want to show your support? =
|
235 |
If you are a fan of PowerPress, we would greatly appreciate it if you could take a moment and [leave us a review on WordPress.org](https://wordpress.org/support/plugin/powerpress/reviews/?rate=5#new-post). Your support is greatly appreciated!
|
236 |
|
|
|
|
|
|
|
|
|
|
|
237 |
= 7.5.2 =
|
238 |
* Released on 7/25/2019
|
239 |
* Fixed logic bug introduced in 7.5 for sites using versions of PHP 5.4 or older.
|
240 |
* Added code changes to Blubrry Hosting's Post to Social from PowerPress feature. (Last beta release of this feature!)
|
241 |
|
|
|
242 |
= 7.5.1 =
|
243 |
* Released on 7/23/2019
|
244 |
* Added library for PubSubHubbub. Missed it when merging latest git release into wordpress.org svn. Sorry about that!
|
4 |
Requires at least: 3.6
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.2.2
|
7 |
+
Stable tag: 7.5.3
|
8 |
Donate link: https://create.blubrry.com/resources/podcast-media-hosting/
|
9 |
License: GPLv2 or later
|
10 |
|
234 |
= Fan of PowerPress and want to show your support? =
|
235 |
If you are a fan of PowerPress, we would greatly appreciate it if you could take a moment and [leave us a review on WordPress.org](https://wordpress.org/support/plugin/powerpress/reviews/?rate=5#new-post). Your support is greatly appreciated!
|
236 |
|
237 |
+
= 7.5.3 =
|
238 |
+
* Released on 7/31/2019
|
239 |
+
* Fixed bug for older versions of PHP with WebSub, service to notify Google Podcasts of new episodes.
|
240 |
+
|
241 |
+
|
242 |
= 7.5.2 =
|
243 |
* Released on 7/25/2019
|
244 |
* Fixed logic bug introduced in 7.5 for sites using versions of PHP 5.4 or older.
|
245 |
* Added code changes to Blubrry Hosting's Post to Social from PowerPress feature. (Last beta release of this feature!)
|
246 |
|
247 |
+
|
248 |
= 7.5.1 =
|
249 |
* Released on 7/23/2019
|
250 |
* Added library for PubSubHubbub. Missed it when merging latest git release into wordpress.org svn. Sorry about that!
|