Skip to content

refactor: improved fallback settings for importer#1120

Merged
Soare-Robert-Daniel merged 8 commits into
developmentfrom
refactor/fallback_image
Aug 11, 2025
Merged

refactor: improved fallback settings for importer#1120
Soare-Robert-Daniel merged 8 commits into
developmentfrom
refactor/fallback_image

Conversation

@RaduCristianPopescu
Copy link
Copy Markdown
Contributor

@RaduCristianPopescu RaduCristianPopescu commented Aug 1, 2025

Summary

Now the user can select between general settings and their custom fallback image.

Will affect visual aspect of the product

YES

Screenshots

CleanShot 2025-08-04 at 13 14 44@2x CleanShot 2025-08-04 at 13 14 54@2x

Test instructions

  • Try to interact with the general feed settings in the import page.

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/feedzy-rss-feeds-pro/issues/885#event-18809301811

@RaduCristianPopescu RaduCristianPopescu self-assigned this Aug 1, 2025
@RaduCristianPopescu RaduCristianPopescu added the pr-checklist-skip Allow this Pull Request to skip checklist. label Aug 1, 2025
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Aug 1, 2025
Copy link
Copy Markdown

Copilot AI left a comment

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 refactors the fallback image settings for the Feedzy RSS feeds importer to improve user experience. Users can now choose between using the general fallback image from global settings or setting a custom fallback image specifically for each feed.

  • Refactored fallback image UI to present radio button options for general vs custom settings
  • Improved JavaScript code modernization with ES6 syntax and better formatting
  • Enhanced UX with clearer labeling and preview functionality for fallback images

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
includes/views/js/import-metabox-edit.js Modernized JavaScript syntax from ES5 to ES6, improved code formatting and structure
includes/views/import-metabox-edit.php Added radio button interface for fallback image options with preview functionality
includes/admin/feedzy-rss-feeds-import.php Updated logic to separate custom and inherited thumbnail handling
css/settings.css Added CSS for new fallback images display layout
Comments suppressed due to low confidence (1)

includes/views/import-metabox-edit.php:774

  • The variable name $default_thumbnails_id (plural) is confusing since it's derived from $default_thumbnail_id (singular). Consider renaming to $default_thumbnail_ids for clarity.
									$default_thumbnails_id = isset( $default_thumbnail_id ) ? explode( ',', $default_thumbnail_id ) : array();

// Reset the image preview.
document.querySelector('.feedzy-media-preview').remove();
removeFallbackImage.classList.remove('is-show');
// removeFallbackImage.classList.remove('is-show');
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

This commented-out code should be removed rather than left as a comment, as it creates confusion about the intended behavior.

Copilot uses AI. Check for mistakes.
}
} else {
$( '<div class="fz-form-group mb-20 feedzy-media-preview"><a href="javascript:;" class="btn btn-outline-primary feedzy-images-selected">' + feedzy.i10n.action_btn_text_3.replace( '%d', countSelected ) + '</a></div>' ).insertBefore( button.parent() );
$(
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The code appears to have a line break issue. The jQuery selector should be properly closed, but the opening $( doesn't match with the context - this looks like a formatting error that could cause JavaScript syntax errors.

Copilot uses AI. Check for mistakes.
@pirate-bot
Copy link
Copy Markdown
Contributor

pirate-bot commented Aug 1, 2025

Plugin build for 27cf0b2 is ready 🛎️!

Note

You can preview the changes in the Playground

@Codeinwp Codeinwp deleted a comment from Copilot AI Aug 4, 2025
Comment thread includes/views/import-metabox-edit.php Outdated
<?php
echo wp_kses_post(
sprintf(
/* translators: %s: opening anchor tag, %s: closing anchor tag */
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.

This translator's comment seems to be outdated.

Comment thread includes/views/import-metabox-edit.php Outdated
<?php
echo wp_kses_post(
sprintf(
/* translators: %s: opening anchor tag, %s: closing anchor tag */
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.

Needs update

Comment thread includes/views/import-metabox-edit.php Outdated
sprintf(
/* translators: %s: opening anchor tag, %s: closing anchor tag */
__( 'No general fallback image set. %s', 'feedzy-rss-feeds' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=feedzy-settings' ) ) . '" target="_blank">' . esc_html__( 'Set one in Feedzy Settings', 'feedzy-rss-feeds' ) . '</a>'
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.

Update it like we disscus it

@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 50daceb into development Aug 11, 2025
9 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the refactor/fallback_image branch August 11, 2025 07:29
@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