Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/ProPreviews/common/UpgradeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const UpgradeButton = ( { classes, showPopup, children } ) => {
) : (
<a
target='_blank'
href='//wedocs.co/'
href='//wedocs.co/pricing/?utm_source=wordpress-dashboard+&utm_medium=update_to_pro_pop-up&utm_campaign=free2pro_pop-up'
onClick={ showPopup }
Comment on lines 10 to 12
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add https:// scheme and rel="noopener noreferrer" to harden the link

  1. A protocol-relative URL (//...) can unexpectedly fall back to http on non-TLS pages, exposing users to MITM risks.
  2. Opening a new tab with target="_blank" without rel="noopener noreferrer" leaves the app vulnerable to reverse-tabnabbing.
-          target='_blank'
-          href='//wedocs.co/pricing/?utm_source=wordpress-dashboard+&utm_medium=update_to_pro_pop-up&utm_campaign=free2pro_pop-up'
+          target='_blank'
+          rel='noopener noreferrer'
+          href='https://wedocs.co/pricing/?utm_source=wordpress-dashboard&utm_medium=update_to_pro_pop-up&utm_campaign=free2pro_pop-up'
📝 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.

Suggested change
target='_blank'
href='//wedocs.co/'
href='//wedocs.co/pricing/?utm_source=wordpress-dashboard+&utm_medium=update_to_pro_pop-up&utm_campaign=free2pro_pop-up'
onClick={ showPopup }
target='_blank'
rel='noopener noreferrer'
href='https://wedocs.co/pricing/?utm_source=wordpress-dashboard&utm_medium=update_to_pro_pop-up&utm_campaign=free2pro_pop-up'
onClick={ showPopup }
🧰 Tools
🪛 Biome (2.1.2)

[error] 10-10: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)

🤖 Prompt for AI Agents
In src/components/ProPreviews/common/UpgradeButton.js around lines 10 to 12, the
href attribute uses a protocol-relative URL which can default to http and cause
security risks; update the href to include the full 'https://' scheme. Also, add
rel="noopener noreferrer" to the anchor tag to prevent reverse-tabnabbing
vulnerabilities when using target="_blank".

className={ `upgrade-button text-white hover:text-white focus:text-white focus:ring-0 px-4 py-2.5 inline-flex items-center rounded-md bg-[#ff9000] hover:bg-[#cf7500] font-semibold text-sm gap-2.5 ${ classes ? classes : '' }` }
>
Expand Down