Visual Portfolio block preview breaks with 211+ Media items
-
Hi! I’m having an issue with the Visual Portfolio block editor preview when using Media as the content source.
I currently have a gallery with 573 media items. The gallery works correctly on the front end, including filtering and pagination, but inside the WordPress block editor the Visual Portfolio block fails to preview and displays:
“This block has encountered an error and cannot be previewed.”
I created a separate test page with a completely new Visual Portfolio block and found a reproducible threshold:
- 210 media items → the block preview works correctly.
- 211 media items → the preview breaks.
- 300, 400, 500 and 573 items → the preview also fails.
- Reducing the block back to 210 items immediately restores the preview.
The media items themselves are working correctly, and the front-end gallery continues to work with all 573 items. The problem seems specific to the editor preview.
Environment:
WordPress: 7.1.2
Visual Portfolio: 3.8.2
PHP: 8.2
PHP memory_limit: 512M
PHP post_max_size: 516M
PHP upload_max_filesize: 512M
PHP max_execution_time: 60I also tested increasing PHP
max_input_varsfrom 1000 to 5000, but it made no difference, so I restored the original value.In the browser console, when the preview fails, I see this error:
SecurityError: Failed to read a named property 'vp_preview_post_data' from 'Window': Blocked a frame with origin "https://cinco.xyz" from accessing a cross-origin frame.I also see a failed request related to:
?vp_preview=vp_preview...Interestingly, opening the preview URL directly in a browser loads the site, so the issue appears to happen specifically when Visual Portfolio generates the editor preview iframe.
Could you please check whether there is a size/item limit in the Media-source block preview, or whether this is a bug with large galleries?
I would like to keep the 573 items in a single gallery because they share category filters, so splitting the gallery into multiple blocks would not be ideal.
Thank you!
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.