Skip to content

feat: add aspect ratio control for Feedzy Classic Block#1117

Merged
Soare-Robert-Daniel merged 7 commits into
developmentfrom
feat/aspect-ratio_thumbnail
Aug 11, 2025
Merged

feat: add aspect ratio control for Feedzy Classic Block#1117
Soare-Robert-Daniel merged 7 commits into
developmentfrom
feat/aspect-ratio_thumbnail

Conversation

@RaduCristianPopescu

@RaduCristianPopescu RaduCristianPopescu commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Summary

Added Aspect Ratio Options and Better Dimension Handling for thumbnail image control.
Inspired by WordPress Aspect Ratio's design.

Will affect visual aspect of the product

YES

Screenshots

Editor

CleanShot 2025-08-01 at 10 45 38@2x

Preview

CleanShot 2025-07-31 at 16 31 21@2x

Test instructions

  • Try to play with the Aspect Ratio selector.
  • Also, check in an AMP environment

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/feedzy-rss-feeds-pro/issues/883

@RaduCristianPopescu RaduCristianPopescu self-assigned this Jul 31, 2025
@RaduCristianPopescu RaduCristianPopescu added the pr-checklist-skip Allow this Pull Request to skip checklist. label Jul 31, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds aspect ratio functionality to the thumbnail image control in the Feedzy RSS feeds plugin, allowing users to control how images are displayed with various aspect ratio options instead of relying only on fixed dimensions.

Key changes:

  • Adds new aspect ratio selector control with predefined options (Original, 1:1, 16:9, 4:3, 3:2, 2:1, 3:4)
  • Updates both block editor and frontend rendering to use CSS aspect-ratio property
  • Replaces background-image spans with proper img elements for better accessibility

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
js/FeedzyBlock/inspector.js Adds SelectControl for aspect ratio with predefined options
js/FeedzyBlock/attributes.js Defines aspectRatio attribute with default value 'auto'
js/FeedzyBlock/Editor.js Implements aspect ratio handler and updates editor rendering to use img elements
includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php Registers aspectRatio attribute for the block
includes/abstract/feedzy-rss-feeds-admin-abstract.php Updates frontend rendering to apply aspect ratio styles and use img elements

@RaduCristianPopescu RaduCristianPopescu force-pushed the feat/aspect-ratio_thumbnail branch from 880b755 to ee1fe1c Compare August 1, 2025 07:26
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Aug 1, 2025
@pirate-bot

pirate-bot commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Plugin build for 1974b4c is ready 🛎️!

Note

You can preview the changes in the Playground

// thumbs pixel size.
'size' => '',
// default aspect ratio for the image.
'aspectRatio' => 'auto',

@Soare-Robert-Daniel Soare-Robert-Daniel Aug 4, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make it '1'

Comment thread includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php Outdated
Comment thread js/FeedzyBlock/inspector.js Outdated
Comment thread js/FeedzyBlock/inspector.js Outdated
$img_style = '';
if ( isset( $sizes['height'] ) ) {
$img_style = 'height:' . $sizes['height'] . 'px;';
if ( isset( $sc['aspectRatio'] ) ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the aspectRatio is '1' let's keep the backward compatibility by providing the width.

if ( isset( $sc['aspectRatio'] ) && '1' !== $sc['aspectRatio'] ) {

Comment thread includes/abstract/feedzy-rss-feeds-admin-abstract.php Outdated
Comment on lines +1433 to +1437
if ( isset( $sc['aspectRatio'] ) ) {
$img_style .= 'aspect-ratio:' . $sc['aspectRatio'] . ';';
} elseif ( isset( $sizes['width'] ) && is_numeric( $sizes['width'] ) ) {
$img_style .= 'width:' . $sizes['width'] . 'px;';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be duplicated

@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
@RaduCristianPopescu RaduCristianPopescu changed the title feat: added thumbnail image control feat: add aspect ratio control for Feedzy Classic Block Aug 7, 2025
@RaduCristianPopescu RaduCristianPopescu force-pushed the feat/aspect-ratio_thumbnail branch from 0fb37d2 to 1974b4c Compare August 8, 2025 09:43
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit f0cc0a2 into development Aug 11, 2025
9 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the feat/aspect-ratio_thumbnail branch August 11, 2025 08:15
@pirate-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants