[wp-trac] [WordPress Trac] #36638: Detect broken URLs in the editor

WordPress Trac noreply at wordpress.org
Mon Jun 13 06:05:44 UTC 2016


#36638: Detect broken URLs in the editor
--------------------------------------------+-----------------------
 Reporter:  iseulde                         |       Owner:  azaozz
     Type:  enhancement                     |      Status:  assigned
 Priority:  normal                          |   Milestone:  4.6
Component:  Editor                          |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  needs-unit-tests needs-testing  |     Focuses:
--------------------------------------------+-----------------------
Changes (by azaozz):

 * keywords:  needs-unit-tests needs-patch => needs-unit-tests needs-testing
 * milestone:  Future Release => 4.6


Comment:

 In 36638.1.patch:
 - Use capabilities check and a nonce for the AJAX request.
 - Use `wp_safe_remote_get()` to check the URL. Using a HEAD request sounds
 better, however: https://core.trac.wordpress.org/browser/tags/4.5.2/src
 /wp-admin/includes/upgrade.php#L331. Can probably use `wp_remote_get()`
 instead. `get_heaters()` (http://php.net/manual/en/function.get-
 headers.php) can possibly be used too however it has some drawbacks.
 - Only "fail" URLs when very malformed, domain cannot be found or the
 response is 404. This may need revising.
 - Add the error message as title on the URL in the inline toolbar. TODO:
 is it worth keeping this?
 - Make the link text white on red background and the URL in the inline
 toolbar reg when the test in negative.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36638#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list