soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
315 stars 29 forks source link

WordPress 6.4 & Oxygen 4.7 PHP Fatal #3441

Closed austinginder closed 10 months ago

austinginder commented 10 months ago

After upgrading to WordPress 6.4 all of my sites running Oxygen plugin are giving a PHP fatal error. I have confirmed that downgrading to WordPress 6.3.2 does workaround the issue wp core download --version=6.3.2 --force. I also confirmed that even default themes like twentytwentythree gives a similar PHP fatal. It seems that all get_template_directory() functions return as fake when Oxygen plugin is active. That makes it impossible for the theme's owns files to resolve to the proper directories when including files.

2023/11/08 01:11:05 [error] 7384#7384: *64294 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Failed opening required 'fake/includes/lib/fusion-library.php' (include_path='.:/usr/share/php') in /www/public/wp-content/themes/Avada/fake/includes/bootstrap.php:23
Stack trace:
#0 /www/public/wp-content/themes/Avada/functions.php(51): require_once()
#1 /www/public/wp-settings.php(611): include('/www/islandeyep...')
#2 /www/public/wp-config.php(82): require_once('/www/islandeyep...')
#3 /www/public/wp-load.php(50): require_once('/www/islandeyep...')
#4 /www/public/wp-admin/admin.php(34): require_once('/www/islandeyep...')
#5 /www/public/wp-admin/plugins.php(10): require_once('/www/islandeyep...')
#6 {main}
Spellhammer commented 10 months ago

Thanks for logging a report.

It looks like you're using the Avada theme based on the log. Would you be able to email us a copy of that theme at support@oxygenbuilder.com?

We've so far been unsuccessful in reproducing this issue with core themes, so there are some other factors at play that we haven't identified yet. If we can reproduce the issue with the Avada theme it will help us get to the bottom of the issue much quicker.

RichardTunstall commented 10 months ago

I can confirm we've had a number of sites with the same issue using the default themes only.

Error was showing similar to the above, but for the default activated theme at the time the site was installed being "twentytwentyone" (v1.4).

A workaround / fix that appears to be working for us initially is switching the active theme to the latest default one using WP CLI with skip-plugins option in SSH in the root of the site files:

wp theme activate twentytwentyfour --skip-plugins

Of course, if the theme isn't there, you may need to install the theme or try another one.

An alternative over S/FTP for those unable to SSH to their servers or don't have WP CLI available would be to rename the Oxygen plugin folder under wp-content/plugins, logging in and changing the default theme and then renaming the folder back.

We're rolling this out to more sites and will let you know if there are any continued issues.

willcrobinson commented 10 months ago

Exact same issue with twentytwentyone theme. get_template_directory running in functions.php returns fake and causes 500 errors.

Deleting all theme directories fixes the issue.

anton-esin commented 10 months ago

For some of our pages the wpcli was blocked as well, so no downgrade or changing of the theme to "empty" theme was possible, to change your current theme via database you can use this workaround: https://help.one.com/hc/en-us/articles/115005585909-Change-your-WordPress-theme-from-the-database After that wpcli was accessible again.

2gen commented 10 months ago

Yeah we had the issue with the twentytwentyone theme selected and setting twentytwentyfour fixed the issue. Seeing /fake/ in the error log really tripped me up for a while and thought there was something else disabling it somewhere.

andrewhoyer commented 10 months ago

Same problem with Oxygen 4.7, but with a custom built theme that uses this command:

require_once get_template_directory() . '/inc' . $file;

I changed it to the following, which makes the site load again, although I'm not sure it's a fix. I'm not very familiar with how Oxygen works with themes (other than mostly overriding them):

require_once locate_template('/inc' . $file);

andrewhoyer commented 10 months ago

WordPress 6.4.1 does not fix this problem.

Kpudlo commented 10 months ago

This issue has been fixed in Oxygen 4.7.1.