[wp-trac] [WordPress Trac] #53206: Fatal error in Site Health test_check_wp_filesystem_method when using other FS_METHOD than direct

WordPress Trac noreply at wordpress.org
Fri May 14 11:27:54 UTC 2021


#53206: Fatal error in Site Health test_check_wp_filesystem_method when using other
FS_METHOD than direct
--------------------------+-----------------------------
 Reporter:  lakrisgubben  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Site Health   |    Version:  5.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The site health test
 {{{WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method}}}
 generates a fatal error {{{Call to undefined function submit_button()}}}
 if the site is using another {{{FS_METHOD}}} than direct. The problem
 seems to be that the {{{submit_button}}} function is not available in a
 REST context.

 To test this out add {{{define( 'FS_METHOD', 'ftpext' );}}} to your wp-
 config.php file and then visit the site health page.

 The issue can be fixed by adding a {{{function_exists}}} check for
 {{{submit_button}}} here: https://github.com/WordPress/wordpress-
 develop/blob/master/src/wp-admin/includes/class-wp-site-health-auto-
 updates.php#L280 something like this:

 {{{#!php
 // Make sure the `submit_button` function is available during our REST
 call.
 if ( ! function_exists( 'submit_button' ) ) {
         require_once ABSPATH . '/wp-admin/includes/template.php';
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53206>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list