Make WordPress Core

Opened 7 years ago

Last modified 6 weeks ago

#50191 new enhancement

Propose https prefix, not http for external links

Reported by: casiepa Owned by:
Priority: normal Milestone: Future Release
Component: TinyMCE Version:
Severity: normal Keywords: needs-patch close
Cc: Focuses: ui-copy

Description (last modified by sabernhardt)

In ​https://build.trac.wordpress.org/browser/trunk/wp-includes/class-wp-editor.php?marks=1269#L1269
The text says:
The URL you entered seems to be an external link. Do you want to add the required http:// prefix?

Might be better to propose to prefix https:// as default.

Attachments (4)

demo-confirm-dialog.png​ (117.2 KB ) - added by sabernhardt 6 weeks ago.
confirm dialog in latest TinyMCE (demo)
1-insert-edit-link-dialog.png​ (34.6 KB ) - added by sabernhardt 6 weeks ago.
step 1: add www.example.com in the Insert/edit link dialog
2-simple-link-editor.png​ (11.6 KB ) - added by sabernhardt 6 weeks ago.
step 2: add www.example.com in the simple link editor and press Enter to save
3-simple-link-editor.png​ (12.0 KB ) - added by sabernhardt 6 weeks ago.
step 3: open the simple link editor again to find that the link automatically added http://

Download all attachments as: .zip

Change History (13)

#1 @noisysocks
6 years ago

  • Focuses ui-copy added
  • Keywords needs-patch good-first-bug added

Sure, good suggestion.

#2 @noisysocks
6 years ago

  • Milestone Awaiting Review → Future Release

This ticket was mentioned in ​PR #768 on ​WordPress/wordpress-develop by ​iamazik.


6 years ago
#3

  • Keywords has-patch added; needs-patch removed

Update the default HTTP prefix to HTTPS as most sites now a days has SSL enabled and it's good for everything.

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

​github-actions[bot] commented on ​PR #768:


6 years ago
#4

Hi @iamazik! 👋

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

​aristath commented on ​PR #768:


6 years ago
#5

Patch looks good to me :+1:

#6 follow-up: @desrosj
4 years ago

  • Keywords 2nd-opinion added

This one seems to be a bit more involved than just simply changing these two strings. Those strings are copied directly from the TinyMCE library and included here for translation purposes. I believe that changing them in class-wp-editor.php without changing them in TinyMCE would result in those strings no longer being translated properly.

TinyMCE is currently on version 6.2, and WordPress includes 4.9.11 (last updated in [49557]). And far as I can tell, the 4.x branch is no longer maintained upstream, and we have not made any changes to the version of the library included in Core.

We could make changes to the bundled version on a case by case basis. But it would make it much more difficult to merge in an update from the maintainers should one become available (though unlikely). While this change does make sense (HTTPS is the ​protocol used on 80%+ of websites now), I'm not sure that it's worth the effort. Especially where WordPress no longer uses this library by default.

@azaozz Do you have any thoughts here?

#7 in reply to: ↑ 6 @azaozz
4 years ago

  • Keywords needs-patch added; has-patch 2nd-opinion removed

Replying to desrosj:

Yes, the strings can be changed easily, but the function that adds the http:// prefix has to be updated too. That seems to be part of the link plugin (if I'm not mistaken, it's been years...).

I'm also not sure it's worth the effort, unless it is a very easy/straightforward change.

#8 @davidbaumwald
4 years ago

  • Keywords good-first-bug removed

This came up at #WCUS Contributor Day. Given the maintenance issues with fixing this and needing some sort of decision on whether it should even be handled, removing the good-first-bug keyword.

@sabernhardt
6 weeks ago

confirm dialog in latest TinyMCE (demo)

@sabernhardt
6 weeks ago

step 1: add www.example.com in the Insert/edit link dialog

@sabernhardt
6 weeks ago

step 2: add www.example.com in the simple link editor and press Enter to save

@sabernhardt
6 weeks ago

step 3: open the simple link editor again to find that the link automatically added http://

#9 @sabernhardt
6 weeks ago

  • Component Editor → TinyMCE
  • Description modified (diff)
  • Keywords close added

I recommend closing because this is not simply updating translations.

TinyMCE uses the string in a confirm dialog that WordPress seems to replace anyway.

  • The latest version of TinyMCE has a ​variable for the preferred protocol. In the demo, the default is https://.
  • WordPress Classic Editor does not suggest adding a protocol. It either adds http:// automatically in the simple link editor, or it leaves the URL as entered in the Insert/edit link dialog.
Note: See TracTickets for help on using tickets.