-
Notifications
You must be signed in to change notification settings - Fork 17
Added echo in pos.php #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughChanged title rendering in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
templates/pos.php (1)
14-14: i18n: Allow translators to reorder title parts.Use a translatable pattern with placeholders.
- <title><?php esc_attr_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php echo esc_html( bloginfo( 'name' ) ); ?></title> + <title><?php printf( esc_html__( '%1$s - %2$s', 'woocommerce-pos' ), esc_html__( 'Point of Sale', 'woocommerce-pos' ), esc_html( get_bloginfo( 'name' ) ) ); ?></title>
templates/pos.php
Outdated
| <html> | ||
| <head> | ||
| <title><?php esc_attr_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php esc_html( bloginfo( 'name' ) ); ?></title> | ||
| <title><?php esc_attr_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php echo esc_html( bloginfo( 'name' ) ); ?></title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix escaping: bloginfo() echoes before escaping; use get_bloginfo(). Also use esc_html_e() (not esc_attr_e()) in text nodes.
Current code prints the site name unescaped and echoes an empty string. Replace with the safe, correct variant below.
- <title><?php esc_attr_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php echo esc_html( bloginfo( 'name' ) ); ?></title>
+ <title><?php esc_html_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php echo esc_html( get_bloginfo( 'name' ) ); ?></title>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <title><?php esc_attr_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php echo esc_html( bloginfo( 'name' ) ); ?></title> | |
| <title><?php esc_html_e( 'Point of Sale', 'woocommerce-pos' ); ?> - <?php echo esc_html( get_bloginfo( 'name' ) ); ?></title> |
🤖 Prompt for AI Agents
In templates/pos.php around line 14, the title tag misuses escaping: it calls
esc_attr_e (meant for attributes) and uses bloginfo() which echoes before
escaping. Replace esc_attr_e with esc_html_e for the visible text and replace
bloginfo() with get_bloginfo() wrapped in esc_html() so the site name is
retrieved then safely escaped (i.e., output esc_html_e('Point of
Sale','woocommerce-pos') followed by ' - ' . esc_html( get_bloginfo('name') )).
Added echo in pos.php
Summary by CodeRabbit