Skip to content

Conversation

@ShubhamGupta05
Copy link
Contributor

@ShubhamGupta05 ShubhamGupta05 commented Aug 1, 2025

Description

Main Purpose: This pull request adds functionality for a sticky header promotion notice within the admin interface of the Ultimate Addons for Elementor plugin. It aims to enhance user engagement by encouraging users to upgrade for additional sticky header features.

Key Changes:

  • Introduced a new action for dismissing the sticky header notice through dismiss_sticky_header_notice() in class-hfe-addons-actions.php, including security checks for nonce validation and user capability.
  • Implemented the logic to display the sticky header promotion notice when users are on the Elementor header footer edit page in class-header-footer-elementor.php.
  • Added methods such as should_show_sticky_header_notice() and render_sticky_header_notice() to conditionally handle notice display based on user actions, existing headers, and whether the pro version is active.
  • Enhanced the admin UI to visually integrate the notice and included Ajax functionality for dismissing the notice.

Additional Notes:

  • Reviewers should focus on the security implications of the Ajax implementation, particularly how nonces are used for validation.
  • Verify that the conditions for displaying the notice are appropriate and align with user scenarios.
  • Testing should include ensuring the notice behaves as expected when dismissed and not shown subsequently if the conditions warrant its hiding (e.g., if the pro version is activated or if the user has dismissed it).
  • Be mindful of how this new notice might impact user experience and overall admin UI cleanliness.

Screenshots

Types of changes

How has this been tested?

Checklist:

  • My code is tested
  • My code passes the PHPCS tests
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request
add_action( 'wp_ajax_hfe_flush_permalink_notice', [ $this, 'hfe_flush_permalink_notice' ] );
add_action( 'wp_ajax_nopriv_hfe_flush_permalink_notice', [ $this, 'hfe_flush_permalink_notice' ] );

add_action( 'wp_ajax_dismiss_sticky_header_notice', [ $this, 'dismiss_sticky_header_notice' ] );
Copy link

Choose a reason for hiding this comment

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

What: Consider using a more descriptive name for the nonce action instead of 'uae_dismiss_sticky_header_notice'. This will help in identifying the nonce's purpose easily.

Why: Using a descriptive name for your nonce action improves code readability and helps with future maintainability by making it clear what the nonce is intended for.

How: Change the nonce name to something more indicative, for example, 'dismiss_sticky_header_notice_nonce'. This will enhance clarity regarding its purpose.

Copy link
Collaborator

Choose a reason for hiding this comment

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

use hfe specific function name

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ShubhamGupta05 use hfe specific function name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants