Skip to content
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

Add external link icon for none wporg themes and plugins #6704

Merged

Conversation

dhaval-parekh
Copy link
Collaborator

@dhaval-parekh dhaval-parekh commented Nov 9, 2021

Summary

Related #2313

This PR adds an external link icon in the "Visit Site" button for none WordPress org plugin/theme in the "AMP Compatible" tab to indicate that the link may go to another site and not to the WordPress.org site.

Add new theme page

Before After
image image

Add new plugin page

Before After
image image

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@dhaval-parekh dhaval-parekh marked this pull request as ready for review November 9, 2021 19:46
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2021

Plugin builds for 24c4948 are ready 🛎️!

@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #6704 (cc3f180) into develop (dd91371) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head cc3f180 differs from pull request most recent head b951ba0. Consider uploading reports for the commit b951ba0 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #6704      +/-   ##
=============================================
- Coverage      76.67%   76.62%   -0.06%     
+ Complexity      6543     6520      -23     
=============================================
  Files            263      263              
  Lines          20955    20870      -85     
=============================================
- Hits           16068    15991      -77     
+ Misses          4887     4879       -8     
Flag Coverage Δ
javascript 58.20% <ø> (-0.74%) ⬇️
php 77.72% <100.00%> (-0.04%) ⬇️
unit 77.72% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Admin/AmpPlugins.php 100.00% <100.00%> (ø)
...src/components/site-scan-context-provider/index.js 19.38% <0.00%> (-15.29%) ⬇️
...lidation/class-amp-validation-callback-wrapper.php 82.80% <0.00%> (-1.03%) ⬇️
...cludes/validation/class-amp-validation-manager.php 83.28% <0.00%> (-0.24%) ⬇️

Copy link
Collaborator

@delawski delawski left a comment

Choose a reason for hiding this comment

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

The PR looks good to me 👍

I'm just wondering if we could use a similar markup to the markup used in Core for external links. E.g. on the WP admin Dashboard, in the Events and News panel, there are a few external links:

Screenshot 2021-11-10 at 14 24 04

Here's a markup of one of them:

<a href="https://make.wordpress.org/community/meetups-landing-page" target="_blank">Meetups <span class="screen-reader-text">(opens in a new tab)</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>

It's very similar to what we have but it additionally contains the screen reader text and the aria-hidden property.

@dhaval-parekh dhaval-parekh force-pushed the enhancement/2313-highlight-amp-compatible-theme-plugin branch from cc3f180 to b951ba0 Compare November 11, 2021 11:04
@dhaval-parekh
Copy link
Collaborator Author

@delawski It's a good suggestion. I have added screen reader text along with the aria-hidden property in the icon.

@westonruter westonruter added this to the v2.2 milestone Nov 11, 2021
Copy link
Collaborator

@milindmore22 milindmore22 left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@milindmore22 milindmore22 self-requested a review November 16, 2021 12:55
@milindmore22
Copy link
Collaborator

@dhaval-parekh noticed a small issue, Themes that are present on wordpress.org have no Install button instead I see Visit button
eg: Astra in below screenshot

image

@milindmore22
Copy link
Collaborator

@jamesozzie we may also need to correct plugin URLs for some plugins eg: site kit by google, Setka Editor are pointing to external sites (thier official site) they should be pointing to wp.org plugin link.

image

image

@westonruter
Copy link
Member

@milindmore22 I think you're looking at an old version of the plugin. I corrected this. In the latest version, the AMP Compatible banner is also removed in favor of a badge but not on the AMP-Compatible tab.

image

image

Comment on lines -38 to -43
.theme-browser .theme {
float: none;
display: inline-block;
vertical-align: top;
}

Copy link
Member

Choose a reason for hiding this comment

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

This style rule didn't seem to be doing anything anymore. I think it was needed for the AMP-compatible banner which we replaced with a badge. @dhaval-parekh is that right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, This style is no longer needed. It was added for the AMP-compatible banner.

Comment on lines +15 to +18
.theme-browser .theme .theme-screenshot img {
height: 100%;
object-fit: contain;
}
Copy link
Member

Choose a reason for hiding this comment

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

This is needed because the theme screenshots from amp-wp.org are not the same aspect ratio as those from WordPress.org:

Before After
image image

@westonruter
Copy link
Member

noticed a small issue, Themes that are present on wordpress.org have no Install button instead I see Visit button
eg: Astra in below screenshot

I don't see that issue:

image

@westonruter westonruter merged commit a0fca7e into develop Nov 16, 2021
@westonruter westonruter deleted the enhancement/2313-highlight-amp-compatible-theme-plugin branch November 16, 2021 17:10
@milindmore22
Copy link
Collaborator

Oops!! yes, you are correct I didn't pull the latest changes! all looks good now 👍🏼


if ( ! empty( $plugin['homepage'] ) ) {
$actions[] = sprintf(
'<a href="%s" target="_blank" rel="noopener noreferrer" aria-label="%s">%s</a>',
'<a href="%s" target="_blank" rel="noopener noreferrer" aria-label="%s">%s<span class="screen-reader-text">(opens in a new tab)</span>%s</a>',
Copy link
Member

Choose a reason for hiding this comment

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

I just realized this is missing translation. See #6723.

@delawski delawski self-assigned this Nov 29, 2021
@delawski delawski removed their assignment Nov 29, 2021
@delawski
Copy link
Collaborator

delawski commented Dec 1, 2021

QA Passed

The external icons are correctly shown when installing a plugin or a theme.

Add Theme
External link if not leading to wp.org
Add Plugin
External link if not leading to wp.org
Screenshot 2021-11-29 at 23 38 33 Screenshot 2021-11-29 at 23 38 58

This has been QA'ed as part of #6725 (comment)
Tested on AMP Version 2.2.0-alpha-20211123T020732Z-5405daa

@delawski delawski self-assigned this Dec 1, 2021
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants