[wp-trac] [WordPress Trac] #34976: Plug ins fail to update after WP 4.4 installed

WordPress Trac noreply at wordpress.org
Fri Dec 11 19:59:30 UTC 2015


#34976: Plug ins fail to update after WP 4.4 installed
--------------------------+--------------------
 Reporter:  patdundee     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.4.1
Component:  Plugins       |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------

Comment (by ralbatross):

 I've been able to narrow down the source of the problem for this on my
 machine in particular (see [https://wordpress.org/support/topic/cant-
 upgrade-plugins-or-themes-after-upgrade-to-44?replies=2 this WordPress
 support thread]).  Not sure if this is the same for everyone, but
 hopefully it's helpful:

 In wp-admin/includes/class-wp-uploader.php, lines 531-535:

 {{{
 //Create destination if needed
 if ( ! $wp_filesystem->exists( $remote_destination ) ) {
         if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR )
 ) {
                 return new WP_Error( 'mkdir_failed_destination',
 $this->strings['mkdir_failed'], $remote_destination );
         }
 }
 }}}

 The exists call is returning false when I try to update a plugin. This is
 wrong. I am able to see the directory referred to by $remote_destination
 in my OS shell, and it obviously does exist because the failure occurs on
 the mkdir call—it is unable to make the directory because it already
 exists.

 Digging deeper, in wp-admin/includes/class-wp-filesystem-ftpext.php, lines
 329-338:


 {{{
 public function exists( $file ) {
         $path = dirname( $file );
         $filename = basename( $file );

         $file_list = @ftp_nlist( $this->link, '-a ' . $path );
         if ( $file_list ) {
                 $file_list = array_map( 'basename', $file_list );
         }
         return $file_list && in_array( $filename, $file_list );
 }
 }}}

 If I add the following line just before the return statement...


 {{{
 error_log(debug_backtrace()[1]['function'] . ": \npath: $path\nfilename:
 $filename\nfile list:\n" . print_r($file_list, true) . "\n");
 }}}


 ... I see this output in the relevant section of debug.log ...

 {{{
 [11-Dec-2015 18:42:19 UTC] install_package:
 path: <the expected path>
 filename: <the expected filename>
 file list:
 Array
 (
 )
 }}}

 The file list is empty! It should not be. What's going on here?

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


More information about the wp-trac mailing list