Skip to content

starter-sites-onboarding-notice#465

Open
harshitarora-in wants to merge 5 commits into
developmentfrom
feature/starter-sites-onboarding-notice
Open

starter-sites-onboarding-notice#465
harshitarora-in wants to merge 5 commits into
developmentfrom
feature/starter-sites-onboarding-notice

Conversation

@harshitarora-in
Copy link
Copy Markdown
Contributor

@harshitarora-in harshitarora-in commented May 13, 2026

Summary

  • Added a new dismissible onboarding promo notice in the Site List step.
  • Notice dismissal is persisted via AJAX (dismiss_onboarding_promo_notice) and stored in plugin options.
  • Added tier-aware promo text variant:
    • Free + Personal users: existing/default notice text.
    • Business + Agency users: updated text with request a site mailto CTA.
  • Added styling for the new promo notice and highlighted CTA link (bold + white).
  • Fixed onboarding exit redirect to use admin URL localization fallback instead of hardcoded /wp-admin.

Will affect visual aspect of the product

YES

Screenshots

Free/personal plan users

Screenshot 2026-05-14 at 2 02 11 AM

Business/agency Users

Screenshot 2026-05-14 at 2 01 10 AM

Test instructions

  • Open onboarding
  • Verify notice appears for users who have not dismissed it.
  • Free user: verify default notice text (no Pro CTA text).
  • Personal (tier 1): verify default notice text (no Pro CTA text).
  • Business/Agency (tier 2/3): verify Pro variant with request a site mailto link.
  • Click dismiss and reload onboarding: verify notice does not reappear.
  • Click header “Exit to dashboard”: verify redirect goes to a valid admin URL.

Check before Pull Request is ready:

Closes #.

@harshitarora-in harshitarora-in requested review from Copilot and ineagu May 13, 2026 20:34
@pirate-bot pirate-bot added the pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) label May 13, 2026
@pirate-bot
Copy link
Copy Markdown
Collaborator

Plugin build for 9804031 is ready 🛎️!

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

Adds a dismissible onboarding promo notice to the Site List step, with localized backend data for visibility, dismissal, license-tier-specific copy, and dashboard redirect URL handling.

Changes:

  • Added the promo notice React component and inserted it into the Site List flow.
  • Added SCSS styling and imported it into onboarding styles.
  • Added AJAX dismissal handling, localization data, tier-aware promo selection, and admin URL fallback data.

Reviewed changes

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

Show a summary per file
File Description
onboarding/src/style.scss Imports the new promo notice stylesheet.
onboarding/src/scss/_onboarding-promo-notice.scss Adds layout and responsive styles for the onboarding promo notice.
onboarding/src/Components/Steps/SiteList.js Renders the new promo notice between filters and sites.
onboarding/src/Components/OnboardingPromoNotice.js Implements promo display, tier-specific message, mailto CTA, and dismissal action.
onboarding/src/Components/Header.js Updates exit redirect to use localized admin URL fallback.
includes/Admin.php Adds dismissal option/action, promo localization data, tier decision logic, and admin URL localization.
Comments suppressed due to low confidence (1)

onboarding/src/Components/OnboardingPromoNotice.js:23

  • The mailto subject is user-facing text but is not wrapped in the WordPress i18n helpers used for the visible notice strings. This leaves the generated email subject untranslated for localized users.
	const requestSiteLink =
		'mailto:contact@themeisle.com?subject=' +
		encodeURIComponent( 'Starter Site Request' ) +
		'&body=' +
		encodeURIComponent( emailBody );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/Admin.php Outdated
Comment thread includes/Admin.php
Comment thread includes/Admin.php Outdated
Comment thread onboarding/src/Components/OnboardingPromoNotice.js Outdated
Comment on lines +53 to +59
const dismissNotice = () => {
setIsVisible( false );
ajaxAction(
tiobDash.onboardingPromoNotice.ajaxURL,
'dismiss_onboarding_promo_notice',
tiobDash.onboardingPromoNotice.nonce
).catch( () => null );
Comment thread onboarding/src/Components/OnboardingPromoNotice.js
Comment thread onboarding/src/Components/OnboardingPromoNotice.js Outdated
@harshitarora-in
Copy link
Copy Markdown
Contributor Author

@claude[agent] review the comment in this thread and apply the suggested changes.

…nd cleanup unused code

Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/c636c138-2459-452b-a54e-7ec23c3cfe96

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Copilot AI and others added 2 commits May 14, 2026 16:19
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

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

Comments suppressed due to low confidence (1)

includes/Admin.php:228

  • This only normalizes Neve plan categories 1, 2, and 3, but License::NEVE_CATEGORY_MAPPING defines valid categories through 9 and existing Neve plan handling accepts any mapped category. Business/Agency Neve categories such as 4, 5, 6, 8, or 9 skip this branch, so the promo variant can be decided from unrelated TPC tier data instead of the active Neve plan.
		if ( in_array( $neve_plan, array( 1, 2, 3 ), true ) ) {
			// Normalize Neve plan category to TPC tier using License::NEVE_CATEGORY_MAPPING
			$normalized_neve_tier = isset( License::NEVE_CATEGORY_MAPPING[ $neve_plan ] ) ? License::NEVE_CATEGORY_MAPPING[ $neve_plan ] : -1;
			return in_array( $normalized_neve_tier, array( 2, 3 ), true );

Comment thread includes/Admin.php Outdated
$license_key = isset( $license_data->key ) ? strtolower( trim( (string) $license_data->key ) ) : '';
$license_tier = License::get_license_tier( 0 );
$raw_tier = isset( $license_data->tier ) ? absint( $license_data->tier ) : 0;
$neve_plan = absint( apply_filters( 'product_neve_license_plan', -1 ) );
Comment thread includes/Admin.php
*
* @return bool
*/
private function should_show_business_agency_promo_text() {
Comment on lines +54 to +60
const dismissNotice = () => {
setIsVisible( false );
ajaxAction(
tiobDash.onboardingPromoNotice.ajaxURL,
'dismiss_onboarding_promo_notice',
tiobDash.onboardingPromoNotice.nonce
).catch( () => null );
Comment thread includes/Admin.php Outdated
return;
}

if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'dismiss_onboarding_promo_notice' ) ) {
Comment thread includes/Admin.php
unset( $response['code'] );
unset( $response['message'] );

update_option( self::ONBOARDING_PROMO_NOTICE_DISMISSED, 'yes' );
@harshitarora-in
Copy link
Copy Markdown
Contributor Author

@claude[agent] Review the comments in this thread and apply the fixes.

- Add proper nonce sanitization with wp_unslash and sanitize_text_field
- Add capability check (install_plugins) before allowing dismissal
- Fix Neve plan default -1 handling by removing absint() to allow fallback to TPC license tier

Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/69fed254-eb0a-4138-aca4-b87abd12189f

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
@Claude
Copy link
Copy Markdown

Claude AI commented May 14, 2026

@claude[agent] Review the comments in this thread and apply the fixes.

Applied all fixes from the review thread in commit 5776780:

  1. Neve plan -1 default handling (Admin.php:215): Removed absint() that was converting -1 to 1, causing installs without Neve to incorrectly enter the Personal tier branch. Now properly checks for -1 and falls through to TPC license tier logic for standalone Business/Agency licenses.

  2. Nonce sanitization (Admin.php:183): Added proper sanitization with sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ) before verification to meet WordPress security standards.

  3. Capability check (Admin.php:190): Added current_user_can( 'install_plugins' ) check before allowing dismissal to prevent lower-privileged users from changing the site-wide notice state.

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

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

Comment thread includes/Admin.php
Comment on lines +232 to +236
// Check Neve plan only if it's a valid category (not -1 default)
if ( -1 !== $neve_plan && in_array( $neve_plan, array( 1, 2, 3, 4, 5, 6, 7, 8, 9 ), true ) ) {
// Normalize Neve plan category to TPC tier using License::NEVE_CATEGORY_MAPPING
$normalized_neve_tier = isset( License::NEVE_CATEGORY_MAPPING[ $neve_plan ] ) ? License::NEVE_CATEGORY_MAPPING[ $neve_plan ] : -1;
return in_array( $normalized_neve_tier, array( 2, 3 ), true );
Comment thread includes/Admin.php
Comment on lines +217 to +223
private function should_show_business_agency_promo_text() {
$license_data = License::get_license_data();
$license_key = isset( $license_data->key ) ? strtolower( trim( (string) $license_data->key ) ) : '';
$license_tier = License::get_license_tier( 0 );
$raw_tier = isset( $license_data->tier ) ? absint( $license_data->tier ) : 0;
$neve_plan = apply_filters( 'product_neve_license_plan', -1 );

<EditorSelector />
</div>
<Filters />
<OnboardingPromoNotice />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants