• Resolved Arie

    (@ao-on-wp)


    Hi Jose. Thanks for creating this cool plugin. The “Download Image” button on our site does nothing, the generated image does not download. Do you know how to fix this issue?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose Varghese

    (@josevarghese)

    Hi @ao-on-wp

    Thanks for using Social Profile Frame Generator WordPress plugin and for opening the thread. I checked the page and noticed that a security rule you have setup for the www version of your site is restricting the downloading. You can confirm the error “Uncaught (in promise) SecurityError: Failed to execute ‘toDataURL’ on ‘HTMLCanvasElement’: Tainted canvases may not be exported.” by opening the browser console errors.

    This happens because the browser treats the canvas as tainted when resources used inside it come from different origins. Even though both URLs are HTTPS, https://www.example.com and https://example.com are considered different origins.

    In your case:

    • Plugin JS file loads from https://www
    • WordPress core jQuery loads from https://non-www

    So when the canvas tries to export using toDataURL(), the browser blocks it for security reasons. To fix this you need to make sure the entire site uses a single canonical domain, either: https://www.example.comor https://example.com, but not both.

    Fix in WordPress: Go to Settings → General and make sure both are exactly the same for WordPress Address (URL) and Site Address (URL). Also, in wp-config.php, ensure that WP_HOME and WP_SITEURL are set to the same value, so your website is output on the frontend.

    You can also contact your hosting provider and developer to check this further on why https://www and https:// non-www files are loaded. You can also notice the same behavior for files that are loaded as https://www and some are loaded as https:// without the www version in the source code.

    Looking forward to hearing from you.

    Thread Starter Arie

    (@ao-on-wp)

    Hi Jose. Thank you very much for your detailed reply, it pointed me in the right direction. Our website is on a WordPress Network which was setup many years ago. In the network sites settings the URL of our site included the www whilst the site Info URL excluded the www. By simply removing the www on the site settings page the Download Image button now works. Thanks again for your help and for creating the plugin.

    Plugin Author Jose Varghese

    (@josevarghese)

    Thanks for replying and happy to hear that the details which I have provided helped you to sort it out @ao-on-wp . I have also checked and confirmed that the download option is now working fine. I also noticed that you have donated to me. Thank you so much for that, too 😍!

    If you have some time, would you be able to rate and give a great review for the plugin? It will help me to motivate and to add more features in the future.

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

You must be logged in to reply to this topic.