Fatal Error on Subsite of Multisite

  • Hello,

    I am experiencing this fatal error as soon as I try to activate your plugin on a subsite of a multisite installation.

    This crashes the subsite completely and says that the site is having technical difficulties.

    PHP Fatal error: Uncaught Error: Call to a member function stat() on boolean in /var/www/html/wp-content/plugins/ssh-sftp-updater-support/class-wp-filesystem-ssh2.php:253\nStack trace:\n#0 /var/www/html/wp-content/plugins/seo-by-rank-math/includes/admin/class-admin-helper.php(35): WP_Filesystem_SSH2->exists(‘/var/www/html/….’)\n#1 /var/www/html/wp-content/plugins/seo-by-rank-math/includes/settings/general/htaccess.php(12): RankMath\\Admin\\Admin_Helper::get_htaccess_data()\n#2 /var/www/html/wp-content/plugins/seo-by-rank-math/includes/admin/class-options.php(167): include(‘/var/www/html/w…’)\n#3 /var/www/html/wp-includes/class-wp-hook.php(286): RankMath\\Admin\\Options->register_option_page(”)\n#4 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#5 /var/www/html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)\n#6 /var/www/html/wp-content/plugins/seo-by-rank-math/vendor/cmb2/cmb2/bootstrap.php(26): do_action(‘cmb2_admin_init’)\n#7 /var/www/html/wp-content/plugins/seo-by-rank-math/vendor/cmb in /var/www/html/wp-content/plugins/ssh-sftp-updater-support/class-wp-filesystem-ssh2.php on line 253, referer: https://bus-wpprod.business.mcmaster.ca/mbarecruit-2019/wp-admin/plugins.php

    After looking into this further, it appears that there is a conflict with another plugin that I use.

    I have looked into the other plugin to see if that was the issue and have ruled out that it is definitely not.

    From what I can tell, your plugin does not use the proper checks on the function stat() when using the function WP_Filesystem_SSH2, which is causing this error.

    Could you please look into this and correct this error as soon as possible as I

    would really like to use your plugin but sadly cannot.



Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have submitted this issue to our dev team and we will be looking into this and get back to you shortly.

    We appreciate your patience.


    OK great, thanks Michael!


    From what I can tell, your plugin does not use the proper checks on the function stat() when using the function WP_Filesystem_SSH2, which is causing this error.

    We are not using stat() function anywhere in the plugin. This function is used in the SSH SFTP Updater Support plugin, so they will have to add the condition to check if the function exists.

    But since you are getting the error only after activating the Rank Math plugin, I tried to reproduce this issue on my multisite setup. I didn’t get any error after activating the Rank Math plugin on the subsite. Here is a screencast: https://i.rankmath.com/juHw8m

    Can you please add your site’s admin and FTP access in the Sensitive Data Section, so we could further debug this issue on your site?

    Looking forward to helping you. Thank you.

    Hello Pratik,

    I have contacted the other plugins developer and he sent me to this page:

    The response from that link is the following:


    This error occurs if you have code that calls the WP_Filesystem function incorrectly, carrying on blindly after receiving an error (rather than checking codes returned). As such, the thing to do is to report it to the plugin author.

    Looking in the first plugin you mention, it calls the WP_Filesystem API but does not check the result, and does not check whether any credentials are needed, but just carries on.


    This is the same bug but with a different plugin conflict.

    So, basically they are saying that the function WP_Filesystem_SSH2 is being used incorrectly inside RankMath.

    Could you look into this for me please? As I would very much like to use your plugin on our production sites.

    Also, I cannot give you access to our systems because we are an institution. It is out of our control. I have requested access and they have said they absolutely will not grant access to a 3rd party developer and that it is not possible with our systems because you have to be connected to our network to even access the login screen.




    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘Fatal Error on Subsite of Multisite’ is closed to new replies.