[wp-trac] [WordPress Trac] #48689: PHP warnings after updating to WP 5.3: ftp_nlist() and ftp_pwd() expect missing parameters

WordPress Trac noreply at wordpress.org
Mon Jan 6 13:47:07 UTC 2020


#48689: PHP warnings after updating to WP 5.3: ftp_nlist() and ftp_pwd() expect
missing parameters
----------------------------+------------------------------
 Reporter:  Hinjiriyo       |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:  5.3
 Severity:  minor           |  Resolution:
 Keywords:  needs-patch     |     Focuses:
----------------------------+------------------------------

Comment (by SirLouen):

 I have inyected a little bit of extra verbosity through some php error
 logging function to discover that Rankmath was trying to access to certain
 files (.htaccess and robots.txt) without success. I'm not sure why WPML
 (also happened by activating AMP for WP plugin in combination with
 Rankmath) was hindering Rankmath from this access...

 The function that was being hindered is get_contents from WP Filesystem.
 So probably any plugin in combination with WPML or AMP for WP may have
 this issue?
 https://developer.wordpress.org/reference/classes/wp_filesystem_base/get_contents/

 Not 100% sure.

 This is the rankmath snippet which was making this misbehaviour.

 {{{#!php
 <?php
 public static function get_htaccess_data() {
                 $wp_filesystem = WordPress::get_filesystem();
                 $htaccess_file = get_home_path() . '.htaccess';

                 return ! $wp_filesystem->exists( $htaccess_file ) ? false
 : [
                         'content'  => $wp_filesystem->get_contents(
 $htaccess_file ),
                         'writable' => $wp_filesystem->is_writable(
 $htaccess_file ),
                 ];
         }
 }}}

 I'm not a code maintainer of Rankmath. In fact I have uninstalled from a
 production site, and left it in a staging server. But just wanted to
 inform about this because it could be useful for WP maintainers (I'm not
 sure).

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


More information about the wp-trac mailing list