Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @Log1x and thanks for updating acf-composer to v3. Massive improvement!
I just starting to testing it all out on my local and I noticed an memory issue when our Rankmath SEO plugin was generating our sitemap. If the sitemap for example has over 30 URL per page the memory gets exhausted.
I have traced it back to the this line:
acf-composer/src/Block.php
Line 464 in 21f654d
I guess with the new caching
$this->template
gets saved on the first built and then carried over to the next time it needs built. If you have a page with a block that are used over 3 times, then it causes a problem.$this->template
simply gets converted into JSON string everytime. Even if$this->template
is a string it gets encoded again into JSON.On a single page with 10+ blocks its fine, but 30 pages with 300 blocks the
$this->template
gets massive. Therefore memory getting exhausted.Here is a simple log trace here for one page:
Notice the third time "acf/button" is being used at the DEBUG line.
$this->template
is now[[0,"[]"]]
.I have made a PR that should fix the problem of
$this->template
being converted recursively. If the$this->template
is a string then return the string. Otherwise it should just contiune normally.