Giter Site home page Giter Site logo

Comments (6)

turtlepod avatar turtlepod commented on September 2, 2024

@dkotter I think it's because of this line of code:

add_action( 'admin_enqueue_scripts', [ $this, 'enqueues' ] );

The JS need gutenberg, so, technically, this need to be updated from admin_enqueue_scripts to enqueue_block_editor_assets ?

from safe-svg.

dkotter avatar dkotter commented on September 2, 2024

@turtlepod That makes sense to me but I've been unable to reproduce this.

That JS file is only loaded if the optimizer feature is enabled (do this by returning true in the safe_svg_optimizer_enabled filter). I've set this up and I see the file loading but I'm not getting any errors in the console when testing in the Classic Editor. Are there other steps I need to take?

from safe-svg.

dkotter avatar dkotter commented on September 2, 2024

And I guess one other thing in thinking through this more, I believe this was set up to fire not only in the editor but when media is directly uploaded, so I think loading the script on enqueue_block_editor_assets would break that functionality

from safe-svg.

turtlepod avatar turtlepod commented on September 2, 2024

@dkotter I tested and I can reproduce. Yes, this issue is only if we use the safe_svg_optimizer_enabled filter.
Apparently the issue is probably a conflict with Yoast SEO. Can you confirm this and simply enable Yoast to check?
Thanks

from safe-svg.

dkotter avatar dkotter commented on September 2, 2024

@turtlepod Thanks for the additional information. I had originally tested with Yoast but couldn't reproduce the issue. Turns out I had another plugin installed that was loading the proper dependencies which fixed the issue. I've opened #187 to address this, if you have time to test that and ensure it fixes things for you.

from safe-svg.

turtlepod avatar turtlepod commented on September 2, 2024

@dkotter I tested and the fix is working as expected! Thank you!

from safe-svg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.