• wordpressnetwork

    (@wordpressnetwork)


    Hello,

    thanks for your plugin! I think that is what I am searching for – I just have problems finding the correct config I guess. I want to import svg information from a JSON feed (via another plugin) into a WooCommerce product description. It seems to work fine, except the svg part gets stripped out. The pure number count of the reviews is imported. So there is a correct connection, but I cannot make the svg part get imported. The JSON part looks like this:

    <div class='amazon-customer-rating-stars'><div class='crIFrameNumCustReviews' data-rating='40' data-review-count='10601' data-review-url='https://www.amazon.de/product-reviews/B076FQHCMH?tag=xxx'><span class='crAvgStars'><span class='review-stars'><a href='https://www.amazon.de/product-reviews/B076FQHCMH?tag=xxx' target='_blank' rel='nofollow noopener'><svg style='position: absolute; width: 0; height: 0; overflow: hidden;' xmlns='https://www.w3.org/2000/svg' xmlns:xlink='https://www.w3.org/1999/xlink' width=0 height=0 viewBox='0 0 160 32'><g id='amazon-rating-stars'><path stroke='#E17B21' stroke-width='2' d='M 16.025391 0.58203125 L 11.546875 10.900391 L 0 12.099609 L 8.8222656 19.849609 L 6.1269531 31.382812 L 16.021484 25.294922 L 25.914062 31.382812 L 23.265625 19.849609 L 32 12.099609 L 20.388672 10.900391 L 16.025391 0.58203125 z M 32 12.099609 L 40.822266 19.849609 L 38.126953 31.382812 L 48.021484 25.294922 L 57.914062 31.382812 L 55.265625 19.849609 L 64 12.099609 L 52.388672 10.900391 L 48.025391 0.58203125 L 43.546875 10.900391 L 32 12.099609 z M 64 12.099609 L 72.822266 19.849609 L 70.126953 31.382812 L 80.021484 25.294922 L 89.914062 31.382812 L 87.265625 19.849609 L 96 12.099609 L 84.388672 10.900391 L 80.025391 0.58203125 L 75.546875 10.900391 L 64 12.099609 z M 96 12.099609 L 104.82227 19.849609 L 102.12695 31.382812 L 112.02148 25.294922 L 121.91406 31.382812 L 119.26562 19.849609 L 128 12.099609 L 116.38867 10.900391 L 112.02539 0.58203125 L 107.54688 10.900391 L 96 12.099609 z M 128 12.099609 L 136.82227 19.849609 L 134.12695 31.382812 L 144.02148 25.294922 L 153.91406 31.382812 L 151.26562 19.849609 L 160 12.099609 L 148.38867 10.900391 L 144.02539 0.58203125 L 139.54688 10.900391 L 128 12.099609 z' /></g><defs><linearGradient id='star-fill-gradient-40'><stop offset='80%' stop-color='#FFA41C'/><stop offset='80%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><defs><linearGradient id='star-fill-gradient-47'><stop offset='94%' stop-color='#FFA41C'/><stop offset='94%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><defs><linearGradient id='star-fill-gradient-46'><stop offset='92%' stop-color='#FFA41C'/><stop offset='92%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><defs><linearGradient id='star-fill-gradient-43'><stop offset='86%' stop-color='#FFA41C'/><stop offset='86%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><image src='https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/customer-reviews/stars-4-0.gif' /></svg><svg xmlns='https://www.w3.org/2000/svg' xmlns:xlink='https://www.w3.org/1999/xlink' viewBox='0 0 160 32' enable-background='new 0 0 160 32'><title>4.0 out of 5 stars</title><defs><linearGradient id='star-fill-gradient-40'><stop offset='80%' stop-color='#FFA41C'/><stop offset='80%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><use xlink:href='#amazon-rating-stars' fill='url(#star-fill-gradient-40)' /><image src='https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/customer-reviews/stars-4-0.gif' /></svg></a></span><span class='review-count'>(<a href='https://www.amazon.de/product-reviews/B076FQHCMH?tag=xxx' target='_blank' rel='nofollow noopener'>10601</a>)</span></span></div></div>

    If I copy that into WooCommerce manually it also works fine and shows up correctly.

    Your help would be highly appreciated! Thanks a lot!

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

    (@benbodhi)

    Hi there,

    Thanks for your support!

    I think this would have to do with the importer you’re using, stripping the code.
    Maybe it has filters that my plugin could help with SVG import/export. But I can’t be sure.

    I will add it to the list of things to look into, but I ant promise anything as I believe this is directly related to the import process and how the content is sanitised.

    Mind sharing which plugin you’re using for the importing so I can test it?

    Plugin Author Benbodhi

    (@benbodhi)

    Hello again, I’d like to see if I can make importing of SVG files work from my plugin, as an option. They would likely need to be sanitized, which is possible as of 2.4. But I just need to know what importer you’re using exactly so I can start where I know there’s an issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Import svg from JSON Feed’ is closed to new replies.