• Resolved cinercin

    (@cinercin)


    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: 60

    I also tested increasing PHP max_input_vars from 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]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nK

    (@nko)

    Hi,

    Thanks for the detailed report. It looks like a bug in the editor preview rather than an image limit. The editor sent each image as several separate fields, and with a few hundred images the request likely grew large enough for your server to cut it or block it.

    We changed how the preview sends this data, and the change will be in the next update. We could not reproduce your exact server setup, so please let us know if the preview still breaks after updating. Your published gallery is not affected, only the preview in the editor.

    Thread Starter cinercin

    (@cinercin)

    Thanks so much for looking into this and for the quick fix!
    I’ll test the gallery with all 573 images as soon as the next update is available and let you know if the editor preview still has any issues.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.