Home Forums WoodMart support forum file_get_contents error

file_get_contents error

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #551449

    Hi,

    I’ve encountered an issue with displaying SVG files on my website that I can’t seem to resolve. Initially, SVGs were working perfectly. However, after updating my header menu under Appearance > Menu, SVG files began to show errors, specifically: “file_get_contents(https://www.craple.in/wp-content/uploads/2023/10/retail-free-shipping.svg): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden at wp-content/plugins/woodmart-core/post-types.php:728.”

    Here are the steps I’ve taken to troubleshoot the problem:

    1. Contacted my hosting provider to ensure there were no issues on their end.
    2. Consulted with my developer, who confirmed that there are no issues with displaying SVGs on the website in general. The problem seems to be isolated to certain pages. Direct access to the SVG URL (https://www.craple.in/wp-content/uploads/2023/10/retail-free-shipping.svg) shows no errors, indicating the file itself is accessible.
    3. Attempted to restore a previous backup and reinstall the Panel, but this did not resolve the issue.
    4. Disabling all plugins did not rectify the problem either.
    This situation is quite frustrating, as I cannot pinpoint the cause of this error or find a way to fix it. It seems to be hit or miss. For instance, disabling object caching occasionally makes the SVGs appear again, but re-enabling it brings back the error. Oddly, repeating this process doesn’t always yield the same result. Similarly, disabling and re-enabling plugins one by one has sporadically resolved the error, only for it to reappear upon making changes to theme or menu settings.

    Could you advise on how I might permanently fix this error?

    #551473

    Artem Temos
    Keymaster

    Hello,

    Please, provide us with your admin access so we can log in and check this on your side.

    Thank you in advance.

    #551478

    In private

    #551481

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this.

    add_filter('woodmart_show_infobox_svg_by_tag', '__return_false');

    Kind Regards

    #551486

    I can’t believe this, after spending so much time on this issue, was the solution just adding these codes?

    #551893

    Artem Temos
    Keymaster

    Yes, we will change the way SVG images are displayed in our next theme update to fix this issue.

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)