SPPB 4.x - PHP Regular Expression Limit Reached (pcre.backtrack_limit) - Question | JoomShaper

SPPB 4.x - PHP Regular Expression Limit Reached (pcre.backtrack_limit)

A

Alvaro

SP Page Builder 1 year ago

SP Page Builder 4.0.4 is slow because it has problems rendering sections with titles that have not been assigned a FONT SIZE. This happens in new sections or in sections created in previous versions that were not assigned a font size. When there are 3 or 4 sections, the error is not shown, but the loading is slow, if you have between 8 sections with titles without assigning font size, the error is generated.

Apparently that happens because if the font size has not been set the field is not created and page builder is trying to get the value persistently until the limit is reached.

Note: The Font Size does not have to be assigned, if you add it and then delete it I think the field is already created and it works. But as you may know it is not necessary to add the font-size in each section, in most cases a CSS rule is added to style all our titles with a font size.

Tested in PHP 7.4 , 8.0.13 and 8.1

Watch Video https://www.screencast.com/t/3xvvbypn

Regards

0
6 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #83834

Hello Alvaro

Thanks for the detailed video. I have tried on my localhost but did not face this issue. Please follow this documentation. Hopefully, it will be solved.

Best regards

0
A
Alvaro
Accepted Answer
1 year ago #83981

The fact that it does not happen on your localhost does not mean that the problem does not exist, the problem exists and must be solved.

What you propose can be a solution to get out of the problem, it is as if the track were full of nails and you propose to protect the tires with steel so that the nails do not damage them.

It has to work in standard environments, increasing memory or limiting it to 250000 does not make SP Page builder avoid trying to render the font size although it does not exist, this problem continues, it will answer yes but it will take a while to respond, and nobody wants to have a site that takes 10 or 15 seconds to answer just one section.

Please use logic and solve this based on standard environments

0
A
Alvaro
Accepted Answer
1 year ago #83999

I will spread the information: When you don't assign a font size in the title_fontsize field, it is of type string "title_fontsize":"", but when you assign a value (even if you delete it later) the field is an object "title_fontsize":{"xxl":"", "xl":"","lg":"","md":"","sm":"","xs":""} So if the generateMultiDeviceObject()function of components/com_sppagebuilder/helpers/addon-helper.php does not process the title_fontsize field when it is of type string it would be the cause of the problem. If this function is processing both objects and strings you have to check line 545 of components/com_sppagebuilder/layouts/row/css.php because apparently even though title_fontsize is empty it still returns true.

You guys know your code better than me, please fix this, because neither increasing memory nor pcre.backtrack_limit to 250000 solve this problem for me.

0
A
Alvaro
Accepted Answer
1 year ago #85757

SPPB 4.0.5 and this problem is not solved, although pcre.backtrack_limit to 250000 is added, the response is still slow. All pages load too slow, please fix this

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #86350

Apology for the inconvenience. Please share your administrator access here to check the issue. Use the Hidden Content box to share the credentials. Make sure that you have a full site backup with you before sharing.

0
A
Alvaro
Accepted Answer
1 year ago #100102

We are on SPPB 4.0.7 and this problem persists and is not fixed even though I have sent you details of what the problem is. Again this problem happens with pages migrated from version 3.x and when titles are added in SPPB 4 sections and a Font Size is not defined for the title.

Here again I leave the error message that $titleFontSize is not defined.

Warning:Undefined variable $titleFontSize in \components\com_sppagebuilder\layouts\row\css.php on line 578

To see this message you must see the frontend source code (Ctrl + U or Command + U) and check the CSS generated by SPPB 4, it is full of these messages. NOTE: SPPB must not be in production mode.

regards

0