WordPress.org

Ready to get started?Download WordPress

Forums

WP Deferred Javascripts
[resolved] Exclure certains scripts dans le backend (16 posts)

  1. nedmic
    Member
    Posted 1 year ago #

    Tout est dans le titre.

    Déjà bravo pour ce plugin (qui fonctionne à merveille sur l'un de mes sites).
    Cependant sur un autre site un peu plus complexe, les scripts ne sont pas forcément exécutés dès lors qu'ils sont différés.

    Je me demandais s'il n'y avait pas moyen de couper la poire en deux en permettant d'exclure certains scripts via l'interface d'administration.

    http://wordpress.org/extend/plugins/wp-deferred-javascripts/

  2. Daniel Roch
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Nedmic,

    PS : le forum étant en anglais, on est forcé de parler dans la langue de Shakespear.

    It's a bit complex to do, and i'm not sure it will help. If our plugin breaks your WordPress, it means that your theme or one of your plugins do not enqueue script properly.

  3. nedmic
    Member
    Posted 1 year ago #

    Hi Daniel.

    Thanks for your answer.
    Actually, I thought it was possible to do like in the WP Minify plugin, in which we can write the path from the script directly into a text field in order to exclude it.

    Just in case, the plugins which don't work are widgetkit (from yootheme) and gd star ratings.

    PS : 'sont fous ces ricains ^^

  4. Daniel Roch
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, i'll check this with the main author of this plugin to see if we can include this improvement.

    For now, can you mark this topic as resolved (this is not really a bug).

  5. nedmic
    Member
    Posted 1 year ago #

    Great can't wait ;)

  6. JibsouX
    Member
    Posted 1 year ago #

    Nice plugin but same problem ^^, i wait for excluding possibilities !
    My theme is fullscene and all the content is loaded by a script, as you can look, and it must be out of the asynchrone loop else any content is load ! :p
    Thanks a lot

  7. dEM0nsTAr
    Member
    Posted 1 year ago #

    It would also be nice to exclude specific pages with sub pages because it works on my site but only a gallery page/plugin doesn't work with it.

  8. Doremdou
    Member
    Posted 12 months ago #

    Hello, really nice plugin but I have the same problem, only one plugin is not working and I am sure it will work perfect if we could exclude specific pages!

    thank you :S

  9. Willy Bahuaud
    Member
    Plugin Author

    Posted 11 months ago #

    You can now exclude some scripts from queuing process using the 'do_not_defer' filter hook. You have to return an array of scripts handles in it, like this :

    function scripts_to_not_defer(){
    return array('jquery','custom-script');
    }
    add_filter('do_not_defer','scripts_to_not_defer');

    You can also take another way using 'wdjs_before_end_lab' fitler hook to had a callback function after labJS process...

  10. sireneweb
    Member
    Posted 10 months ago #

    is it possible to specify filename extension as style.css ?

  11. Willy Bahuaud
    Member
    Plugin Author

    Posted 10 months ago #

    Nope, only javascript handlers. But styles will not be deferred :-)

  12. sireneweb
    Member
    Posted 10 months ago #

    sorry, little mistake for script.js :)

  13. sireneweb
    Member
    Posted 10 months ago #

    is it possible to create an option page in backend to exclude script, the user just need to add the script name enqueue ?

    Or maybe an another solution would be better is to select which script who want deffering because actually too much plugins can't work with your plugin.

    Instead deffering all, let user choice which script

  14. Willy Bahuaud
    Member
    Plugin Author

    Posted 10 months ago #

    We wont add an option page to exclude script. You just have to use the "do_not_defer" hook, passing an array of script handle :-)

    How could it be easiest ?

    If you can find the "script name" which cause error, I think you're able to add this line of code in "function.php" of your theme. We dont want to overload WordPress backend with unnecessary information for the final user. Are you agree ?

  15. sireneweb
    Member
    Posted 10 months ago #

    In fact, with revolution slider, layer slider or other sames plugins there are a lot of errors.

    I understand you don't want add an option to exclude script but if you add a hook for only include what we want it would be better because when you have more than 20 javascripts files, it's hard difficult to find errors

  16. sireneweb
    Member
    Posted 9 months ago #

    any suggests ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic