From d12f752c904b2110f06ed2bb559742b4a4925ff3 Mon Sep 17 00:00:00 2001 From: Mark Wilkinson Date: Mon, 8 Apr 2024 09:15:02 +0100 Subject: [PATCH 1/4] Removes the call to getimagesize() This seems to be causing problems on some installs and PHP setups. As the benefits are small for adding the width height attributes it makes sense to remove it. --- better-core-video-embeds.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/better-core-video-embeds.php b/better-core-video-embeds.php index a03d879..c3de96c 100644 --- a/better-core-video-embeds.php +++ b/better-core-video-embeds.php @@ -576,8 +576,13 @@ function hd_bcve_add_video_play_button( $block, $video_id, $thumbnail_url, $wrap */ function hd_bcve_add_video_thumbnail_markup( $block, $video_id, $thumbnail_url, $wrapper_classes ) { + // get the image ID from the URL. $imageid = attachment_url_to_postid( $thumbnail_url ); + + // if we have an image ID, therefore the image is a local image. if ( ! empty( $imageid ) ) { + + // output the image. echo wp_get_attachment_image( $imageid, 'full', @@ -587,21 +592,10 @@ function hd_bcve_add_video_thumbnail_markup( $block, $video_id, $thumbnail_url, 'loading' => 'lazy', ] ); + } else { ?> - - /> + Date: Fri, 24 May 2024 15:44:52 +0100 Subject: [PATCH 2/4] Render block with figcaption element When the block loads any caption was just being loaded as text and not wrapped with the correct
markup. --- better-core-video-embeds.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/better-core-video-embeds.php b/better-core-video-embeds.php index c3de96c..2617506 100644 --- a/better-core-video-embeds.php +++ b/better-core-video-embeds.php @@ -620,7 +620,9 @@ function hd_bcve_add_video_caption_markup( $block, $video_id, $thumbnail_url, $w } ?> - +
+ +
Date: Tue, 28 May 2024 08:33:22 +0100 Subject: [PATCH 3/4] Bump changelog and version --- better-core-video-embeds.php | 4 ++-- readme.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/better-core-video-embeds.php b/better-core-video-embeds.php index 2617506..d56cb6e 100644 --- a/better-core-video-embeds.php +++ b/better-core-video-embeds.php @@ -4,7 +4,7 @@ Description: A plugin which enhances the core video embeds for Youtube and Vimeo videos by not loading unnecessary scripts until they are needed. Requires at least: 6.0 Requires PHP: 7.0 -Version: 1.3.4 +Version: 1.3.5 Author: Highrise Digital Author URI: https://highrise.digital/ License: GPL-2.0-or-later @@ -15,7 +15,7 @@ // define variable for path to this plugin file. define( 'HD_BCVE_LOCATION', dirname( __FILE__ ) ); define( 'HD_BCVE_LOCATION_URL', plugins_url( '', __FILE__ ) ); -define( 'HD_BCVE_VERSION', '1.3.4' ); +define( 'HD_BCVE_VERSION', '1.3.5' ); /** * Function to run on plugins load. diff --git a/readme.txt b/readme.txt index 6123cb6..dca6189 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://example.com/ Tags: embed, oembed, youtube, vimeo, performance, blocks Requires at least: 6.0 Tested up to: 6.4.2 -Stable tag: 1.3.4 +Stable tag: 1.3.5 Requires PHP: 8.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -55,6 +55,9 @@ Yes! As of version 1.3, you can set a custom thumbnail on the embed block and th * Width and height parameters to remotely-hosted images. * Thanks to Matt Radford for these updates. += 1.3.5 (28/05/2024) = +* Ensure the caption markup matches that of the original embed when the page loads. + = 1.3.3 (21/03/2024) = * Ensure (previously) live video URLs from Youtube embed correctly. Thanks for @bacoords for the development on this. From 24eee4763b060257b131fffea1788f395d00cf23 Mon Sep 17 00:00:00 2001 From: Mark Wilkinson Date: Tue, 28 May 2024 08:34:40 +0100 Subject: [PATCH 4/4] Typo in readme --- readme.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index dca6189..1a4e266 100644 --- a/readme.txt +++ b/readme.txt @@ -49,15 +49,15 @@ Yes! As of version 1.3, you can set a custom thumbnail on the embed block and th == Changelog == += 1.3.5 (28/05/2024) = +* Ensure the caption markup matches that of the original embed when the page loads. + = 1.3.4 (02/04/2024) = * Translation of the "Play video" button text. * A responsive video poster image if a custom (locally-hosted) image is chosen. * Width and height parameters to remotely-hosted images. * Thanks to Matt Radford for these updates. -= 1.3.5 (28/05/2024) = -* Ensure the caption markup matches that of the original embed when the page loads. - = 1.3.3 (21/03/2024) = * Ensure (previously) live video URLs from Youtube embed correctly. Thanks for @bacoords for the development on this.