Opened 4 years ago
Closed 4 years ago
#47487 closed enhancement (fixed)
Classic Editor plugin link and link target
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 5.2.1 |
Component: | Editor | Keywords: | has-patch commit |
Focuses: | accessibility | Cc: |
Description
The Editor shows following warning when JavaScript is disabled:
The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the Classic Editor plugin.
The "Classic Editor plugin" texts links to the classic editor in the Plugin repository. If you click on the link you will be redirected to the plugin respository and will leave the WordPress admin without any warning.
To reproduce
Steps to reproduce the behavior:
- Disable Javascipt
- Create a post
- See the message
- Click on "Classic Editor plugin"
Expected behavior
I wouldn't expect to leave the admin area without any warning.
There are two alternative behaviors I could think of:
- The link opens in a new window/tab.
Therefore we need to add target="_blank" to the link.
- Instead of linking to the respository, we could link to the plugin-install.php with the classic editor pre-selected. (if this is possible)
Attachments (6)
Change History (13)
#2
in reply to:
↑ description
@
4 years ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from Awaiting Review to Future Release
Hi @derweili, welcome to WordPress Trac! Thanks for the report.
Instead of linking to the respository, we could link to the plugin-install.php with the classic editor pre-selected. (if this is possible)
This would be the preferred option here. It was previously done in [43946] an [43952] for 5.0 About page (some comments on #45178 have more details, starting with comment:42:ticket:45178).
Forcing links to open in a new tab should be avoided for accessibility reasons:
Avoid
target="_blank"
in your links. It can be confusing to all types of users, especially for visually impaired folks. They can wind up with all sorts of open tabs that they don’t even know about. Leave the control of whether the link opens in the same window or in another tab in the hands of users.
Related: #23432
@
4 years ago
Replace external Classic Editor plugin link w/ internal Plugin Install URL for when JS disabled on block editor
#3
@
4 years ago
- Focuses accessibility added
- Keywords has-patch needs-testing added; needs-patch removed
- Milestone changed from Future Release to 5.3
Thanks for flagging this @derweili and for the initial patch, made it easy to find what link you were referring to.
@SergeyBiryukov I appreciate the input and direction, I've pulled the internal install link which was committed here;
https://core.trac.wordpress.org/changeset/44264
This links to the custom install screen made for the Classic Editor plugin. For reference here's the link code;
esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) )
My patch 47487.2.diff implements this URL replacing the translatable external plugin link.
This loads the custom favorites tab of the plugin install screen for the wordpressdotorg user which is specifically favourited Classic Editor, also has nonce to restore the users favorites.
Sergey can you review the link setup for CS I wasn't sure since it was inside an expanded sprintf if the esc_url, wp_nonce_url and self_admin_url calls should all be on individual lines indented or if the shortform I'm using passes formatting.
Please test,
Thank you
#4
@
4 years ago
- Keywords needs-testing removed
Thanks for working on this. Quickly tested and the esc_url ...
in one line is OK. Instead, phpcs complains for the closing ?>
and asks for one more tab. Which doesn't make sense to me, but this is the current state of the CS rules 🤷🏻♂️
I'd consider to improve the translators comment.
@
4 years ago
Update to wp-admin/includes/template.php in do_block_editor_incompatible_meta_box where same type of install URL is present.
#5
@
4 years ago
- Keywords needs-testing added
Thanks @afercia I've fixed the CS rule and improved the translator comment in 47487.3.diff.
I also found another similar implementation in wp-admin/includes/template.php for do_block_editor_incompatible_meta_box which I've uploaded 47487.4.diff to address.
I appreciate the review and testing.
Open classic editor link in new window/tab