soflyy/oxygen-bugs-and-features

Oxygen breaks Blocks πŸ’¨πŸ’”πŸ§±

Closed this issue Β· 31 comments

Steps to Reproduce

Note: This bug is not directly reproducible in the sandbox environment. Unfortunately the wp-includes directory and it's contents are locked in the sandbox, so we were unable to test why this is the case. as qsandbox.org uses Wordpress version: 6.4.2, the bug only happens in WP 6.5.2

  1. Blank install + oxygen.
  2. Install a plugin that registers a block that enqueues some script / style via editorScript, script, editorStyle or style. (e.g buddypress)
  3. Load the Gutenberg editor.
  4. Note the 404 in console:
Failed to load resource: the server responded with a status of 404 ()

https://website.com/wp-content/themes/oxygen-is-not-a-theme/var/www/website.com/wp-content/plugins/safe-svg/dist/safe-svg-block-frontend.css?ver=6.5

The error was reproducible on two separate blank installs on two totally different hosting configurations.

The Problem

Oxygen breaks get_block_asset_url with the following overrides:

function ct_oxygen_template_name($template) {
	return "oxygen-is-not-a-theme";
}
add_filter("template", "ct_oxygen_template_name");
function ct_disable_theme_load( $stylesheet_dir ) {
	return "fake";
}
add_filter("template_directory", "ct_disable_theme_load", 1, 1);
add_filter("stylesheet_directory", "ct_disable_theme_load", 1, 1);

Details

  1. During block initialization, register_block_style_handle calls get_block_asset_url with the path of each of the blocks dependencies.
  2. Because get_template_directory is forced with a value of "fake", wp_normalize_path( realpath( get_template_directory() ) ) is always empty - because the path doesn't exist.
  3. Thereby, trailingslashit( $template_paths_norm[ $stylesheet ] ) always equals "/"
  4. Thus, when WordPress's check to see if the dependency path string starts with the template path string, the result is always true. (All paths start with a /)
  5. As a result, WordPress erroneously calls get_theme_file_uri with the path (despite it actually being a plugin path), producing a garbled url like:

https://website.com/wp-content/themes/oxygen-is-not-a-theme/var/www/website.com/wp-content/plugins/safe-svg/dist/safe-svg-block-frontend.css?ver=6.5

Confirmed and reported internally via https://github.com/soflyy/oxygen/issues/5359

Hi @perrelet,

Have you encountered this error with any plugins other than BuddyPress?

Awesome, thank you!

It breaks Rank Math SEO (1.0.216) as well, could be the same issus as #3527

@javierruizjimenez Thanks for the insight in #3527

Looking at this further WordPress/WordPress@46e8b6f appears to have caused the bug with the introduction of realpath to get_block_asset_url.

@Kpudlo What are your thoughts on a fix?

Thank you for the additional information, we've added this information to our internal ticket for this issue. Our development team is reviewing the problem.

@Kpudlo Do you know any workaround for this, or if there's movement on a solution? I've started getting angry clients writing in to ask why random blocks are broken.

@shoelaced We're working on a fix, but no current workaround. I would recommend not using WP 6.5 until this is resolved if it's impacting your sites.

@Kpudlo Do you know any workaround for this, or if there's movement on a solution? I've started getting angry clients writing in to ask why random blocks are broken.

Use Rank Math URL redirections to do a 302 (temporary redirection), here how to do it for Rank Math TOC. Other blocks could do the same until it is fixed:

@shoelaced We're working on a fix, but no current workaround. I would recommend not using WP 6.5 until this is resolved if it's impacting your sites.

I am waiting for the fix, so will not do a Workaround. My issue relates to the Rank Math Table of Contents Block.

Is there an approximate timeframe for a fix and update release?

Thanks!

@soflyy @Spellhammer @Kpudlo

Given the severity of the issue, it really does feel like this one warrants a little more transparency and communication.

Thanks in advance for keeping everyone here updated and informed.

Oxygen 4.8.3 RC 1 is now available in the customer portal and addresses this issue. Please test and let us know if you continue to experience any issues with blocks in WP 6.5+.

@Spellhammer Awesome, would you mind sharing what the chosen fix is or would you prefer us to diff this for ourselves?

For those also wondering:

 function ct_disable_theme_load( $stylesheet_dir ) {
        // disable theme entirely for now
-       return "fake";
+       return (dirname(__FILE__));
 }
add_filter("template_directory", "ct_disable_theme_load", 1, 1);
add_filter("stylesheet_directory", "ct_disable_theme_load", 1, 1);

Hi!
I'm also affected. Quick question: when I install the RC, which is not supported according to the text here (https://oxygenbuilder.com/beta-access/) , will it return to the stable path with the next upgrade? Or will I need to install it manually?

@kaibrockelt Release candidates are eligible for official support and will be able to update to the next stable release when it's available.

For those who need workaround, create blank theme and use this in mu-plugin/code snippet:

`// Reverse empty stylesheet URL being returned by Oxygen.
remove_filter( 'template_directory', 'ct_disable_theme_load', 1, 1 );
remove_filter( 'stylesheet_directory', 'ct_disable_theme_load', 1, 1 );

// Override the theme name change from "oxygen-is-not-a-theme" by Oxygen.
remove_filter( 'template', 'ct_oxygen_template_name' );
`
Here is the source:
https://www.great-tit.com/enable-wordpress-theme-when-using-oxygen-builder/

@Spellhammer Yes it seems to have fixed it for me.

Any ETA on this becoming a prod build?

@danner26 @MichaelSwanUK Did the RC fix the issue for you? The quicker people let us know that it worked across their various environments/scenarios, the quicker we can release it as a final. There's no reason not to use the RC in production if you've tested on staging and there are no issues.

@Spellhammer I have installed 4.8.3 RC 1 and it fixes the issue.

It does not look like 4.8.3 RC 1 fixes the issue on our end
image

If you want the stack output in full I can create a ticket or you can email me. There is a LOT. Here is a sample of it:

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 19

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 20

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 21

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$license_text is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 22

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 19

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 20

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 21

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$license_text is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 22

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 20

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 21

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 22

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$license_text is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 23

Deprecated: Creation of dynamic property OxygenCompositeElementsPluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater-composite-elements.php on line 19

Deprecated: Creation of dynamic property OxygenCompositeElementsPluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater-composite-elements.php on line 20

Deprecated: Creation of dynamic property OxygenCompositeElementsPluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater-composite-elements.php on line 21

@danner26

This issue is about Gutenberg/Block Editor blocks breaking.

Deprecation notices have nothing to do with this issue.

If there are blocks breaking on your site after upgrading to 4.8.3 RC 1, please email support@oxygenbuilder.com with temporary login credentials and we'll investigate.

Sorry, here is some more relevant output. I believe these are blocks erroring. Let me know if this relates or not:

Deprecated: Creation of dynamic property Oxygen_Gutenberg::$blocks is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/oxygen-gutenberg.php on line 74

Deprecated: Creation of dynamic property Oxygen_VSB_Dynamic_Shortcodes::$custom_dynamic_datas is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/includes/oxygen-dynamic-shortcodes.php on line 18

Deprecated: Creation of dynamic property Google\Site_Kit\Modules\Ads\Web_Tag::$home_domain is deprecated in /bitnami/wordpress/wp-content/plugins/google-site-kit/includes/Modules/Ads/Web_Tag.php on line 37

Deprecated: Creation of dynamic property Oxy_Header_Builder::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property Oxy_Header_Builder::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property CT_Inner_Content::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property CT_Inner_Content::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property Oxy_Google_Maps::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property Oxy_Google_Maps::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property Oxy_Header_Builder_Row::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property Oxy_Header_Builder_Row::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Left::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Left::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Center::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Center::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Right::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Right::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_DIV_Block::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_DIV_Block::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_DIV_Block::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440


Deprecated
: Creation of dynamic property CT_Link_Button::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Link_Button::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Link_Button::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440


Deprecated
: Creation of dynamic property CT_Fancy_Icon::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Fancy_Icon::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Text_Block::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Text_Block::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Text_Block::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

<REDACTED>

Deprecated
: Creation of dynamic property Oxy_Social_Icons::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property Oxy_Social_Icons::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Link_Wrapper::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Link_Wrapper::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Link_Wrapper::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440


Deprecated
: Creation of dynamic property CT_Image::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Image::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Headline::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Headline::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

<REDACTED>

Deprecated
: Creation of dynamic property Oxy_Nav_Menu::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property Oxy_Nav_Menu::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property Oxy_Nav_Menu::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

HOME
OUR SERVICES
CONTACT US
BLOG
SUPPORT TICKETS

Deprecated
: Creation of dynamic property CT_Code_Block::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property CT_Code_Block::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated
: Creation of dynamic property CT_Fancy_Icon::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440


Deprecated
: Creation of dynamic property Oxygen_VSB_Search_Form::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420


Deprecated
: Creation of dynamic property Oxygen_VSB_Search_Form::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421


Deprecated: Creation of dynamic property CT_Section::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property CT_Section::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property CT_Section::$media_queries is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2440

@danner26 Anything that says "Deprecated: Creation of dynamic property..." is a different issue and unrelated to this one.

If you still have broken Gutenberg blocks while using 4.8.3 RC, please email support@oxygenbuilder.com so we can investigate.

Fixed in Oxygen 4.8.3.