Skip to content

feat: add subscribe notice in dashboard#1139

Merged
Soare-Robert-Daniel merged 7 commits into
developmentfrom
feat/dismissable_notice
Aug 15, 2025
Merged

feat: add subscribe notice in dashboard#1139
Soare-Robert-Daniel merged 7 commits into
developmentfrom
feat/dismissable_notice

Conversation

@RaduCristianPopescu

Copy link
Copy Markdown
Contributor

Summary

The user is now prompted with a notice after skipping the subscription step in the setup wizard page.

Will affect visual aspect of the product

YES

Screenshots

CleanShot 2025-08-13 at 17 50 12@2x

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

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

pirate-bot commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Plugin build for e94c4bd is ready 🛎️!

Note

You can preview the changes in the Playground

This comment was marked as outdated.

Add the JS and CSS into a single PHP file since it will used only one time
@Soare-Robert-Daniel Soare-Robert-Daniel changed the title add: dismissable notice in dashboard feat: add subscribe notice in dashboard Aug 14, 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 a subscription notice to the dashboard that appears when users skip the subscription step during onboarding. The notice allows users to subscribe to updates or dismiss it permanently.

  • Adds a new subscribe notice template that displays on the dashboard for users who skipped onboarding subscription
  • Implements AJAX handlers for subscription and notice dismissal functionality
  • Tracks user subscription status and notice dismissal state through WordPress options

Reviewed Changes

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

File Description
includes/layouts/feedzy-support.php Conditionally displays the subscribe notice and reformats some existing HTML
includes/layouts/feedzy-subscribe-notice.php New template file containing the subscription notice UI, styling, and JavaScript
includes/feedzy-rss-feeds.php Registers the new AJAX action for dashboard subscription handling
includes/admin/feedzy-rss-feeds-admin.php Adds subscription tracking and implements AJAX handlers for the dashboard notice

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

$onboarding_user_subscribed = get_option( 'feedzy_onboarding_user_subscribed' );
$subscribed_notice_dismissed = get_option( 'feedzy_dismiss_subscribe_notice_dashboard' );

if ( 'yes' !== $onboarding_user_subscribed && 'yes' !== $subscribed_notice_dismissed ) {

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

This PHP code is placed outside of PHP tags and will be rendered as plain text in the HTML output. It should be moved inside the PHP block that starts on line 5.

Copilot uses AI. Check for mistakes.
$subscribed_notice_dismissed = get_option( 'feedzy_dismiss_subscribe_notice_dashboard' );

if ( 'yes' !== $onboarding_user_subscribed && 'yes' !== $subscribed_notice_dismissed ) {
load_template( FEEDZY_ABSPATH . '/includes/layouts/feedzy-subscribe-notice.php' );

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

This PHP code is also outside of PHP tags and will be rendered as plain text. It should be moved inside the PHP block.

Copilot uses AI. Check for mistakes.
if ( 'yes' !== $onboarding_user_subscribed && 'yes' !== $subscribed_notice_dismissed ) {
load_template( FEEDZY_ABSPATH . '/includes/layouts/feedzy-subscribe-notice.php' );
}

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

This closing brace is outside of PHP tags and will be rendered as plain text. It should be moved inside the PHP block.

Suggested change
}

Copilot uses AI. Check for mistakes.
*/

?>
<div class ="feedzy-container">

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

There's an extra space in the class attribute. It should be class="feedzy-container" instead of class ="feedzy-container".

Suggested change
<div class ="feedzy-container">
<div class="feedzy-container">

Copilot uses AI. Check for mistakes.
const handleSubscription = async (button) => {
try {
hideError();
const withSubscribe = button.dataset.fz_subscribe || true;

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

The logical OR with true will always result in true regardless of the dataset value. This should likely be button.dataset.fz_subscribe !== 'false' or similar logic to properly check the dataset value.

Suggested change
const withSubscribe = button.dataset.fz_subscribe || true;
const withSubscribe = button.dataset.fz_subscribe !== 'false';

Copilot uses AI. Check for mistakes.
$this->dismiss_subscribe_notice();
wp_send_json_success();
} else {
wp_send_json_error(

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

There's a trailing space after the opening parenthesis. It should be wp_send_json_error( without the trailing space.

Suggested change
wp_send_json_error(
wp_send_json_error(

Copilot uses AI. Check for mistakes.
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 7ec9487 into development Aug 15, 2025
9 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the feat/dismissable_notice branch August 15, 2025 12:58
@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