Avada Theme crashes on PHP 8+ when FS_METHOD set to ftpext
The Avada 7.16.x theme crashes WordPress when define('FS_METHOD', 'ftpext'); is in wp-config.php and PHP is version 8 and higher.
This error has been an issue with Avada on our sites since PHP 8 came out.
I'd been putting off updating our PHP version because of this, hoping it would be fixed. I've brought it to the devs' attention in the past, too, but they were no help. Due to PHP2Shell, we had to upgrade our servers from PHP 7.4.xx to 8.4.xx and remove the FS_METHOD line, making updates much more time-consuming to implement.
Search results for this issue always say to set FS_METHOD to direct but I can't do that due to security concerns and write permissions that I can't change. I've tried setting it to ssh2 with a plugin that is supposed to enable that but couldn't get it to work (even though I can connect via SSH2 with PuTTY).
Some of my sites are running different themes (Newspaper and Kale) and they have no problems with FS_METHOD set to ftpext, so I don't think this is a server/permissions issue. I've also tried disabling all plugins on my Avada dev site, but it still crashes.
Error logging returns this:
Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in [ROOT_DIR]/wp-admin/includes/class-wp-filesystem-ftpext.php:492 Stack trace: #0 [ROOT_DIR]/wp-admin/includes/class-wp-filesystem-ftpext.php(492): ftp_nlist() #1 [ROOT_DIR]/wp-content/themes/Avada/includes/class-avada-server-rules.php(465): WP_Filesystem_FTPext->exists() #2 [ROOT_DIR]/wp-content/themes/Avada/includes/class-avada-server-rules.php(307): Avada_Server_Rules->is_htaccess_writable() #3 [ROOT_DIR]/wp-content/themes/Avada/includes/class-avada-server-rules.php(116): Avada_Server_Rules->maybe_upgrade_rules() #4 [ROOT_DIR]/wp-includes/class-wp-hook.php(353): Avada_Server_Rules::init() #5 [ROOT_DIR]/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters() #6 [ROOT_DIR]/wp-includes/plugin.php(523): WP_Hook->do_action() #7 [ROOT_DIR]/wp-admin/admin.php(180): do_action() #8 {main} thrown in [ROOT_DIR]/wp-admin/includes/class-wp-filesystem-ftpext.php on line 492 My best guess is this has something to do with class-avada-server-rules.php not playing nice with PHP 8 and/or WordPress, but this is moving into unknown territory for me.
Does anyone have any ideas or suggestions for things I can try to get around this issue? Maybe some edit to class-avada-server-rules.php that I can put in my child theme?
- - semi-related rant incoming - -
In the past I'd go to ThemeFusion (Avada devs) for support, but they only include one year of support per license. The only ways to extend support are to buy another license for $70 or a 6-month renewal for $50, which is ridiculous. No wonder Avada is a best-seller; if you don't buy another copy every year, you don't get support! Inflating their sales numbers that way is dishonest and should be illegal.
Anyway... I'm at my wit's end. Thanks for reading.
[link] [comments]