Skip to content

starter-sites-onboarding-notice#465

Merged
harshitarora-in merged 12 commits into
developmentfrom
feature/starter-sites-onboarding-notice
May 20, 2026
Merged

starter-sites-onboarding-notice#465
harshitarora-in merged 12 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

pirate-bot commented May 13, 2026

Plugin build for eeac6df 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
Contributor

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 Outdated
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 );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

Applied in eeac6df. The promo tier check now reuses neve_license_plan(), and I added PHPUnit + onboarding E2E coverage for the tier selection and dismiss flow. Screenshot (UI unchanged): https://github.com/user-attachments/assets/83986407-7f72-4012-a012-8585d843c141

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 />
@ineagu
Copy link
Copy Markdown
Contributor

ineagu commented May 19, 2026

the goal looks good for me, the code/implementation need validaiton

Copilot AI and others added 7 commits May 19, 2026 13:56
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

Co-authored-by: harshitarora-in <56164789+harshitarora-in@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/templates-patterns-collection/sessions/32d60726-d310-4c01-a838-ee64ba6531f9

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

Copilot AI commented May 19, 2026

the goal looks good for me, the code/implementation need validaiton

Validation updates are in eeac6df. I added targeted PHPUnit coverage for the promo tier logic, added onboarding E2E coverage for notice dismissal persistence, and ran local syntax/build/lint checks where the sandbox allowed it. Screenshot (UI unchanged): https://github.com/user-attachments/assets/83986407-7f72-4012-a012-8585d843c141

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.wordpress.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
    • Triggering command: /usr/bin/curl curl -s REDACTED git conf�� --get-regexp lityWP.git /usr/local/.ghcup/bin/git r (dns block)
  • https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/efacebef421334d54b99afa92fb8fa645336a8a7
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/Codeinwp/phpcs-ruleset/zipball/982f9881312252e6213cde07704b74da47b39475
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/bb2a8414b0418b18c68c9ff1df3d7fb10467928d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/a792ab623069f0ce971b2417edef8d9632e32f75
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/WPTT/WPThemeReview/zipball/462e59020dad9399ed2fe8e61f2a21b5e206e420
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6105bdab2f26c0204fe90ecc53d5684754550e8f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/php-stubs/wp-cli-stubs/zipball/aa2afe94cd02f314659a3d9ef8821a3f81761c37
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/ffa517cb918591b93acc9b95c0bebdcd0e4538bd
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3fad28475bfbdbf8aa5c440f8a8f89824983d85e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZW2lvO /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/oB2d3c /usr/bin/composer install --prefer-dist --no-progress --no-suggest (http block)
  • https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/891d0767855a32c886a439efae090408cc1fa156
    • Triggering command: REDACTED, pid is -1 (http block)
  • wordpress.org
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/templates-patterns-collection/templates-patterns-collection/e2e-tests/node_modules/.bin/wp-env start onboarding/src/Components/ProgressBar.js ns-c�� rd --global /usr/local/bin/g168.63.129.16 com-php-stubs-wpnode (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@harshitarora-in
Copy link
Copy Markdown
Contributor Author

Hi @Soare-Robert-Daniel, I’ve fixed the changes using Copilot. Could you please review them and validate the fixes?

I’ve tested everything, and it works as expected.

Thanks!

@harshitarora-in
Copy link
Copy Markdown
Contributor Author

@Soare-Robert-Daniel, while preparing the release, let’s make sure the changelog clearly highlights the addition of 100+ new starter sites.

@harshitarora-in harshitarora-in merged commit 3c1423d into development May 20, 2026
4 of 7 checks passed
@harshitarora-in harshitarora-in deleted the feature/starter-sites-onboarding-notice branch May 20, 2026 17:17
@pirate-bot
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.2.29 🎉

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 May 21, 2026
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) 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.

7 participants