Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
eteubert committed Jan 28, 2022
2 parents ad7c2bf + b7390b6 commit f8a3a1b
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 182 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ composer_with_prefixing:

install_php_scoper:
mkdir -p vendor-prefixed
composer require --dev bamarni/composer-bin-plugin
composer require --dev bamarni/composer-bin-plugin:1.4.1
composer bin php-scoper config minimum-stability dev
composer bin php-scoper config prefer-stable true
composer bin php-scoper require --dev humbug/php-scoper
composer bin php-scoper require --dev humbug/php-scoper:0.15.0

build:
mkdir -p vendor-prefixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"pear/pear_exception": "1.0.*@dev",
"podlove/comment-introspection": "dev-master",
"phpunit/phpunit": "^6.5.14",
"bamarni/composer-bin-plugin": "^1.4"
"bamarni/composer-bin-plugin": "1.4.1"
},
"autoload": {
"classmap": [
Expand Down
318 changes: 147 additions & 171 deletions composer.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions includes/scripts_and_styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,15 @@
], $version);

wp_enqueue_style('jquery-ui-style', \Podlove\PLUGIN_URL.'/js/admin/jquery-ui/css/smoothness/jquery-ui.css');

wp_localize_script(
'podlove_admin',
'podlove_admin_global',
[
'rest_url' => esc_url_raw(rest_url()),
'nonce' => wp_create_nonce('wp_rest'),
'post_id' => get_the_ID(),
]
);
}
});
2 changes: 1 addition & 1 deletion js/src/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var PODLOVE = PODLOVE || {};
jQuery.ajaxSetup({
beforeSend: function (xhr, settings) {
if (settings.url.includes("wp-json")) {
xhr.setRequestHeader("X-WP-Nonce", podlove_vue.nonce);
xhr.setRequestHeader("X-WP-Nonce", podlove_admin_global.nonce);
}
},
});
Expand Down
19 changes: 15 additions & 4 deletions lib/model/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,28 +322,39 @@ public function generate_resized_copy()
$image = wp_get_image_editor($this->original_file(), $editor_args);

if (is_wp_error($image)) {
Log::get()->addWarning('Podlove Image Cache: Unable to resize. '.$image->get_error_message());
Log::get()->addWarning('Podlove Image Cache: Unable to resize (1). '.$image->get_error_message());

return;
}

$orig_sizes = $image->get_size();
$original = $orig_sizes['width'] . 'x' . $orig_sizes['height'];

if (!$this->height) {
$this->height = $orig_sizes['height'];
}

if (!$this->width) {
$this->width = $orig_sizes['width'];
}

$result = $image->resize($this->width, $this->height, $this->crop);

if (is_wp_error($result)) {
Log::get()->addWarning('Podlove Image Cache: Unable to resize. '.$result->get_error_message());
Log::get()->addWarning('Podlove Image Cache: Unable to resize (2, w '.$this->width.' h '.$this->height.' ... original: '.$original.'). '.$result->get_error_message());

return;
}

$result = $image->save($this->resized_file());

if (is_wp_error($result)) {
Log::get()->addWarning('Podlove Image Cache: Unable to resize. '.$result->get_error_message());
Log::get()->addWarning('Podlove Image Cache: Unable to resize (3). '.$result->get_error_message());

return;
}

// when a new image size is created, Templace Cache must be cleared
// when a new image size is created, Template Cache must be cleared
TemplateCache::get_instance()->setup_global_purge();
}

Expand Down
4 changes: 3 additions & 1 deletion lib/template/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function __construct(\Podlove\Model\Image $image)

public function __toString()
{
return $this->image->url();
$url = $this->image->url();

return is_string($url) ? $url : "";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion podlove.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Podlove Podcast Publisher
* Plugin URI: http://publisher.podlove.org
* Description: The one and only next generation podcast publishing system. Seriously. It's magical and sparkles a lot.
* Version: 3.7.0
* Version: 3.7.2
* Author: Podlove
* Author URI: http://podlove.org
* License: MIT
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: podlove, podcast, publishing, rss, feed, audio, mp3, m4a, player, webplaye
Requires at least: 4.9.6
Tested up to: 5.8.3
Requires PHP: 7.0
Stable tag: 3.7.0
Stable tag: 3.7.2
License: MIT

The one and only next generation podcast publishing system. Seriously. It's magical and sparkles a lot.
Expand Down

0 comments on commit f8a3a1b

Please sign in to comment.