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

Hide password in setup-config.php #3725

Closed
wants to merge 23 commits into from
Closed

Conversation

bgoewert
Copy link

@bgoewert bgoewert commented Dec 4, 2022

Trac ticket: https://core.trac.wordpress.org/ticket/3534


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

Hi @bgoewert! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

@@ -0,0 +1,33 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

This file could be named password-toggle.js for reusability on other screens in Core. What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, missed that. Agreed. Renaming now.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Update inline comment file name.

src/js/_enqueues/admin/password-toggle.js Outdated Show resolved Hide resolved
Need to use global search next time when renaming things.
@ironprogrammer
Copy link

@bgoewert, I like the direction this is headed, toward a shared implementation for the toggle feature 👍🏻

Once the above feedback is integrated, I'd love to give this a go. It should allow for #2070 to be simplified as well.

@bgoewert
Copy link
Author

bgoewert commented Dec 6, 2022

@bgoewert, I like the direction this is headed, toward a shared implementation for the toggle feature 👍🏻

Once the above feedback is integrated, I'd love to give this a go. It should allow for #2070 to be simplified as well.

@mukeshpanchal27's suggested change has been committed. Waiting to be reviewed again.

Copy link

@sabernhardt sabernhardt left a comment

Choose a reason for hiding this comment

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

Thanks for creating a script to try making this more consistent. If we keep the icon-only button, reusing the script for the Login page could help reduce resources there (ticket:57157).

However, while the icon-only button is consistent with the Login page, it is not consistent with other visibility toggle buttons in .form-table elements at larger screen sizes (on Profile and Installation pages). Andrea acknowledged that icon-only controls are an accessibility anti-pattern before committing r46256 as a "self-contained" improvement that ideally would have a different design later.

Also, the icon-only button on setup-config has the overlap with some password managers, as seen on the Login page (ticket:48222).

  1. In Edge, the LastPass icon appears behind the button on setup-config, so the toggle button is still clickable.

    setup-config with LastPass in Edge

  2. In Chrome (Windows), the Norton Password Manager icon covers the button at a higher z-index:

    setup-config with Norton Password Manager in Chrome

I marked some changes to this PR in case we continue in this direction.

src/js/_enqueues/admin/password-toggle.js Outdated Show resolved Hide resolved
src/js/_enqueues/admin/password-toggle.js Outdated Show resolved Hide resolved
@@ -550,7 +550,53 @@ fieldset label,
}

.wp-pwd {
margin-top: 1em;
display: inline-block;
Copy link

@sabernhardt sabernhardt Jan 5, 2023

Choose a reason for hiding this comment

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

This container needs to be block so it expands to the full width at narrower screen widths. Replacing the span with a div (as it is on the Installation page) should make the CSS unnecessary.

password input is too narrow at 600px browser width

Copy link
Author

@bgoewert bgoewert Jan 6, 2023

Choose a reason for hiding this comment

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

I've fixed the spanning issue for narrower screen sizes. However, I also noticed the password manager icons are overlapping the toggle button. When I have more time I'll attempt to address this as well. Leaving this open until then.

Screenshot_2023-01-05_22-49

Copy link
Author

Choose a reason for hiding this comment

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

In an attempt to fix the overlap issue I commented on, as well as the incorrect lang support I added here, I noticed that the profile page was hiding the pw toggle text on narrower screens. So I added <span class="text"><?php _e( 'Show' ); ?></span> to test. Unfortunately, this creates white space that is not taken up by the pw field or pw manager icons and the button is still focusable. It may be better to hide the button entirely and re-add the 10px padding that is added to input fields here for narrower screens.

Screenshot_2023-01-05_23-56

Thoughts @sabernhardt?

Copy link
Author

Choose a reason for hiding this comment

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

This was fixed in PR #3827 by separating the button from the input. Technically this is unresolved in this PR so I will leave it as such.

src/wp-admin/css/forms.css Outdated Show resolved Hide resolved
src/wp-admin/css/forms.css Outdated Show resolved Hide resolved
src/wp-admin/css/install.css Outdated Show resolved Hide resolved
src/wp-admin/setup-config.php Outdated Show resolved Hide resolved
src/wp-admin/setup-config.php Outdated Show resolved Hide resolved
@bgoewert
Copy link
Author

bgoewert commented Jan 6, 2023

Thank you @sabernhardt for the thorough review. I tried to address all your comments. Another change I added towards a standardized password-toggle.js is this fix for performing the toggle to the correct parent input.

However, while the icon-only button is consistent with the Login page, it is not consistent with other visibility toggle buttons in .form-table elements at larger screen sizes (on Profile and Installation pages). Andrea acknowledged that icon-only controls are an accessibility anti-pattern before committing r46256 as a "self-contained" improvement that ideally would have a different design later.

I noticed the profile page has an icon and text. If it helps with accessibility I can change the icon to text, or add an icon and text, to maintain consistency with the other toggles. Would it be preferable to still keep the button as "part of" the password input? Or do we go back to separating the button from the input? Do we then at some point also change the login page to follow suit?

Also, the icon-only button on setup-config has the overlap with some password managers, as seen on the Login page (ticket:48222).

Separating the button from the input would address this.

@bgoewert
Copy link
Author

Closed in r56008

@bgoewert bgoewert closed this Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants