[wp-trac] [WordPress Trac] #31528: Shiny Updates: FTP Support

WordPress Trac noreply at wordpress.org
Mon Mar 16 07:55:24 UTC 2015


#31528: Shiny Updates: FTP Support
-------------------------------------+-------------------------------------
 Reporter:  pento                    |       Owner:  ericlewis
     Type:  task (blessed)           |      Status:  reopened
 Priority:  normal                   |   Milestone:  4.2
Component:  Upgrade/Install          |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  shiny-updates needs-     |     Focuses:  ui, javascript,
  patch                              |  administration
-------------------------------------+-------------------------------------

Comment (by jipmoors):

 Questions about `wp_print_request_filesystem_credentials_modal`
 considering the filter present internally.

 Considering this comment:
 {{{
  * Plugins may override this form by returning true|false via the
  * {@see 'request_filesystem_credentials'} filter.
 }}}


 '''Inconsistent URL use'''
 Since the URL is passed to the filter inside the function, results may
 differ on it's content.
 {{{
 1204 $filesystem_credentials_are_stored = request_filesystem_credentials(
 self_admin_url() );
 }}}
 versus
 {{{
 1215 <?php request_filesystem_credentials( site_url() ); ?>
 }}}

 The filter does not guarantee for a 100% that this will result in a
 credentials request form.

 If the filter is implemented somewhere and returning 'true' then the
 result of this call will be 'true' and not a form.

 It would seem more logical to me to capture the output and test if it's
 not empty (i.e. we have a form) instead of using the return value.
 {{{
 ob_start();
 $filesystem_credentials_are_stored = request_filesystem_credentials(
 self_admin_url() );
 ob_end_clean();
 }}}

 That output only has to be captured once (and the function only run once)
 so it can be used on the apropriate place to request the credentials.

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


More information about the wp-trac mailing list