Disabling Cloudflare's Rocket Loader on the JW Player

da

Home Forum JW Player 7 for WordPress Disabling Cloudflare's Rocket Loader on the JW Player

Stai vedendo 4 articoli - dal 1 a 4 (di 4 totali)
  • Autore
    Articoli
  • #1712
    nissiu
    Partecipante

    Hello, I use Cloudflare on my website and I have Rocket Loader activated because it’s really useful but I would like to disable it on the player. As Rocket Loader defers the scripts it causes the JW player to be one of the last elements to load on my pages and I want it to be one of the first elements to load. Now, in order to disable Rocket Loader on specific scripts this code data-cfasync="false" must be added before the src tag in the script. The problem is that when I modify your plugin’s functions file in order to add that piece of code in the jwppp_add_header_code function to echo data-cfasync="false" before src=\"$library\", it breaks my website giving me 500 error on all pages. I can’t really play too much with this because my website has a pretty large volume of traffic so could you suggest me a solution? I would really appreciate it. Thanks!

    #1720
    ilGhera
    Amministratore del forum

    Hi @nissiu, sorry for the late.
    What about this?
    echo "<script data-cfasync=\"false\" src=\"$library\"></script>\n";
    Line 671, jwppp-functions.php, includes folder.

    #1721
    nissiu
    Partecipante

    Hi, thanks! it works now.

    • Questa risposta è stata modificata 5 anni, 11 mesi fa da nissiu.
    #1724
    ilGhera
    Amministratore del forum

    Perfect 😉
    Please, if you find the plugin useful, consider to leave it a good review, I will really appreciate it.
    https://wordpress.org/support/plugin/jw-player-7-for-wp/reviews/?filter=5
    https://ilghera.com/product/jw-player-7-for-wordpress-premium/

Stai vedendo 4 articoli - dal 1 a 4 (di 4 totali)
  • Devi essere connesso per rispondere a questo topic.