Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge incompatibility with Divi #430

Closed
dchenk opened this issue Jan 3, 2020 · 15 comments
Closed

Huge incompatibility with Divi #430

dchenk opened this issue Jan 3, 2020 · 15 comments
Assignees
Milestone

Comments

@dchenk
Copy link
Contributor

dchenk commented Jan 3, 2020

This plugin's 'sanitize_file_name' filter totally screws up the file-based caching that Divi and the plugins Bloom and Monarch do. When the Divi theme, for example, serializes the minified CSS for a page or for the site's global styling, or when it serializes the content of a page into a binary ".data" file for caching, it constructs a potential file name for this content using a particular structure for this file name. It then does a glob of the potential target directory to see if there already is an existing file that can be used (previously cached). However, when Divi constructs this potential file name, it passes it through the sanitize_file_name function (see the constructor of the ET_Core_PageResource class in Divi/core/components/PageResource.php), which applies the 'sanitize_file_name' filter.

This means that wp-stateless prepsends this potential file name with a random string, so in the call to glob no matching files are found. This means that, on every single request for that page, Divi will write the serialized data to disk after globbing for an existing cached file!

This behavior quickly used up all 20 GB of the disk where these files were being written, and it noticeably hurt performance of my websites.

I'm running the version 2.3.2 of this plugin in stateless mode. Please address this as soon as possible.

@harrystymiest
Copy link

I'm having this issue as well and it happens even with Divi's Static CSS turned off

@alimuzzaman alimuzzaman added this to the v2.4.1 milestone Jan 26, 2020
@donbowman
Copy link
Contributor

are there any workaround for this?

@harrystymiest
Copy link

are there any workaround for this?

Until they get it going I would write a cron like this
rm -rf public_html/wp-content/et-cache and run it every 10 min

@donbowman
Copy link
Contributor

its not sufficient.
it has a second side affect, some assets/css don't load properly.
so the site doesn't render after Divi 4.0.8 reliably.

@antonkorotkov
Copy link
Contributor

Hello everyone. The issue has been reviewed and confirmed. We are working on it. Thanks for your patience.

@antonkorotkov
Copy link
Contributor

@dchenk @harrystymiest @donbowman can you guys help me testing it? Here is the zip of the fixed version https://github.com/wpCloud/wp-stateless/archive/develop-anton.zip
Please let me know if it works correctly (do not forget to enable the Divi support in settings) and we will include the fix into the nearest release.

Thanks.

@donbowman
Copy link
Contributor

will do

@harrystymiest
Copy link

I installed on my Goddaughter's model portfolio site (Not a "client" site, Have a backup) ill monitor the size over the next 24H or so

@donbowman
Copy link
Contributor

[Thu Feb 20 15:49:58.435424 2020] [php7:error] [pid 22437] [client 10.16.1.100:51152] PHP Fatal error:  Uncaught Error: Class name must be a valid object or a string in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php:5645\nStack trace:\n#0 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3231): ET_Builder_Element->_add_position_fields()\n#1 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(425): ET_Builder_Element->_add_additional_fields()\n#2 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/main-structure-elements.php(1214): ET_Builder_Element->__construct()\n#3 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/framework.php(633): require_once('/bitnami/wordpr...')\n#4 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(288): et_builder_add_main_elements(Object(WP))\n#5 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)\n#6 /opt/bitnami/wordpress/wp-includes/plugin.php(544): WP_Hook->do_action(Array)\n#7 /opt/bitnami/wordpress/wp-includes/cl in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 5645
[Thu Feb 20 15:50:04.652671 2020] [php7:error] [pid 22461] [client 10.16.1.100:51524] PHP Fatal error:  Cannot redeclare et_pb_hover_options() (previously declared in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/autoload.php:119) in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/module/helpers/HoverOptions.php on line 183
[Thu Feb 20 15:50:05.197791 2020] [php7:error] [pid 22416] [client 10.16.1.100:51532] PHP Fatal error:  Cannot redeclare et_pb_hover_options() (previously declared in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/autoload.php:119) in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/module/helpers/HoverOptions.php on line 183
^C

@harrystymiest
Copy link

No issues for me so far
• I installed the Dev Plugin
• I removed my cron Work around
• Reenabled static CSS generation

@antonkorotkov
Copy link
Contributor

[Thu Feb 20 15:49:58.435424 2020] [php7:error] [pid 22437] [client 10.16.1.100:51152] PHP Fatal error:  Uncaught Error: Class name must be a valid object or a string in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php:5645\nStack trace:\n#0 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3231): ET_Builder_Element->_add_position_fields()\n#1 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(425): ET_Builder_Element->_add_additional_fields()\n#2 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/main-structure-elements.php(1214): ET_Builder_Element->__construct()\n#3 /bitnami/wordpress/wp-content/themes/Divi/includes/builder/framework.php(633): require_once('/bitnami/wordpr...')\n#4 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(288): et_builder_add_main_elements(Object(WP))\n#5 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)\n#6 /opt/bitnami/wordpress/wp-includes/plugin.php(544): WP_Hook->do_action(Array)\n#7 /opt/bitnami/wordpress/wp-includes/cl in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 5645
[Thu Feb 20 15:50:04.652671 2020] [php7:error] [pid 22461] [client 10.16.1.100:51524] PHP Fatal error:  Cannot redeclare et_pb_hover_options() (previously declared in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/autoload.php:119) in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/module/helpers/HoverOptions.php on line 183
[Thu Feb 20 15:50:05.197791 2020] [php7:error] [pid 22416] [client 10.16.1.100:51532] PHP Fatal error:  Cannot redeclare et_pb_hover_options() (previously declared in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/autoload.php:119) in /bitnami/wordpress/wp-content/themes/Divi/includes/builder/module/helpers/HoverOptions.php on line 183
^C

Sorry, it does not look like WP-Stateless errors. Can you try maybe re-installing the Divi?

@donbowman
Copy link
Contributor

this was after the re-isntall of divi, let me try again.

i had 4.0.8 (which is last version that my site would render w/ w/ wp-stateless).
i added the dev build of wp-stateless. observed site still rendered.
i then clicked update divi
the site stopped rendering, and this error occurred.

let me try again

@donbowman
Copy link
Contributor

ok the issue was the divi security patcher which was the workaround for a security flaw on 4.0.8.
remove that, update to 4.3.2, now it seems to render and not give the errors.
and the cache dir is not growing as fast.

@harrystymiest
Copy link

I'm ready to say this is resolved

@antonkorotkov
Copy link
Contributor

Closing the issue. Fix will be added to the next release. Thanks.

@alimuzzaman alimuzzaman modified the milestones: v2.4.1, v2.4.0 Feb 25, 2020
@ewsopp ewsopp removed this from the v2.4.0 milestone Jun 3, 2020
@ewsopp ewsopp added this to the v3.0.0 milestone Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants