From 4ba567daa3840939d026eb6866a7facb3db57e93 Mon Sep 17 00:00:00 2001 From: wolfgang101 Date: Thu, 8 May 2025 11:57:40 +0200 Subject: [PATCH] feat: favoring preview_url over remote_url for image previews --- plugin.php | 7 ++----- readme.txt | 5 ++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin.php b/plugin.php index 3658832..80784e0 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ Plugin Name: Include Mastodon Feed Plugin URI: https://wolfgang.lol/code/include-mastodon-feed-wordpress-plugin Description: Plugin providing [include-mastodon-feed] shortcode - Version: 1.10 + Version: 1.11 Author: wolfgang.lol Author URI: https://wolfgang.lol License: MIT @@ -370,10 +370,7 @@ function init_scripts() { if('image' == media.type) { let mediaElemImgLink = mastodonFeedCreateElement('a'); let imageUrl = media.url; - if(null !== media.remote_url) { - imageUrl = media.remote_url; - } - else if('full' !== options.images.size && null !== media.preview_url) { + if('full' !== options.images.size && null !== media.preview_url) { imageUrl = media.preview_url; } mediaElemImgLink.href = status.url; diff --git a/readme.txt b/readme.txt index 486fd33..dcc8948 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: mastodon, status, feed Requires at least: 6.0 Tested up to: 6.8 Requires PHP: 7.4 -Stable tag: 1.10 +Stable tag: 1.11 License: MIT License URI: https://directory.fsf.org/wiki/License:Expat @@ -154,6 +154,9 @@ Use the following URL to get your ID: == Changelog == += 1.11 = +* now favoring preview_url (smaler size) instead of remote_url (full size) for image previews (thank you @oldrup@mastodon.green) + = 1.10 = * added image lazy loading for account and post images - post image lazy loading only works with preserveImageAspectRatio set to true (thank you @oldrup@mastodon.green)