WordPress.org

Ready to get started?Download WordPress

Forums

Async JS and CSS
[resolved] Path Error (23 posts)

  1. microbe
    Member
    Posted 6 months ago #

    Hi

    Really useful plugin - I have a site which returns a Google Page Speed score of 100!

    One niggle, I have my wordpress installation in a subdirectory and the plugin is not adding the subdirectory path to js files

    Paths are being written as
    /wp-includes/js/comment-reply.min.js
    /wp-includes/js/jquery/jquery.js?ver=1.10.2
    /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1

    instead of
    /wordpress/wp-includes/js/jquery/jquery.js etc

    http://wordpress.org/plugins/async-js-and-css/

  2. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Ok, I see. Tomorrow if I have some free time, I'll try to resolve this issue. It looks like I'm ysing the wrong wariable to detect WordPress installation path. Thank you for feedback !

  3. microbe
    Member
    Posted 6 months ago #

    Great. Neat plugin, thanks.

  4. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    I think now it's fixed in the version 1.7.5 - give it a try :)

  5. microbe
    Member
    Posted 6 months ago #

    Hi

    Hmm, doesn't seem to have done the trick. Looking at the rendered page source it still has some unmodified path info. Looks like where it applies you are pulling the stylesheet directory variable correctly, but the others are not have the installation directory path inserted.

    <script type="text/javascript">
    		asyncScripts = [{"name":"admin-bar","src":"\/wp-includes\/js\/admin-bar.min.js","extra":""},{"name":"comment-reply","src":"\/wp-includes\/js\/comment-reply.min.js","extra":""},{"name":"jquery-core","src":"\/wp-includes\/js\/jquery\/jquery.js?ver=1.10.2","extra":""},{"name":"jquery-migrate","src":"\/wp-includes\/js\/jquery\/jquery-migrate.min.js?ver=1.2.1","extra":""},{"name":"jquery","src":"?ver=1.10.2","deps":["jquery-core","jquery-migrate"],"extra":""},{"name":"jquery-cookie","src":"http:\/\/marchant.ch\/wordpress\/wp-content\/plugins\/cookie-law-info\/js\/jquery.cookie.js","deps":["jquery"],"extra":""},{"name":"cookie-law-info-script","src":"http:\/\/marchant.ch\/wordpress\/wp-content\/plugins\/cookie-law-info\/js\/cookielawinfo.js","deps":["jquery"],"extra":""},{"name":"wintersong-responsive-menu","src":"http:\/\/marchant.ch\/wordpress\/wp-content\/themes\/wintersong-pro\/js\/responsive-menu.js?ver=1.0.0","deps":["jquery"],"extra":""},{"name":"jquery-form","src":"http:\/\/marchant.ch\/wordpress\/wp-content\/plugins\/contact-form-7\/includes\/js\/jquery.form.min.js?ver=3.40.0-2013.08.13","deps":["jquery"],"extra":""},{"name":"contact-form-7","src":"http:\/\/marchant.ch\/wordpress\/wp-content\/plugins\/contact-form-7\/includes\/js\/scripts.js?ver=3.5.2","deps":["jquery","jquery-form"],"extra":"var _wpcf7 = {\"loaderUrl\":\"http:\\\/\\\/marchant.ch\\\/wordpress\\\/wp-content\\\/plugins\\\/contact-form-7\\\/images\\\/ajax-loader.gif\",\"sending\":\"Sending ...\"};"}];

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  6. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Ok, previously I fixed it for stylesheet files. Now it is also fixed for JS files.

  7. microbe
    Member
    Posted 6 months ago #

    Hi

    That's better, the paths seem to be cleaned up. Great! Thanks v. much.

  8. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    You are welcome!

    Any review is welcome ;)

  9. microbe
    Member
    Posted 6 months ago #

    Aha, I have found another.

    This is being written out and will obviously give an error -
    {"name":"jquery","src":"http:\/\/marchant.ch\/wordpress\/","deps":["jquery-core","jquery-migrate"]

  10. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Looks like there is no path defined for this script. Is it defined in the template? Because it doesn't looks like the default jQuery script definition.

  11. microbe
    Member
    Posted 6 months ago #

    Hi

    Switched off all other plugins using Twenty Twelve it went away I changed to Twenty Thirteen Theme and it popped back up:

    asyncScripts = [{"name":"admin-bar","src":"http:\/\/marchant.ch\/wordpress\/wp-includes\/js\/admin-bar.min.js","extra":""},{"name":"comment-reply","src":"http:\/\/marchant.ch\/wordpress\/wp-includes\/js\/comment-reply.min.js","extra":""},{"name":"jquery-core","src":"http:\/\/marchant.ch\/wordpress\/wp-includes\/js\/jquery\/jquery.js","extra":""},{"name":"jquery-migrate","src":"http:\/\/marchant.ch\/wordpress\/wp-includes\/js\/jquery\/jquery-migrate.min.js","extra":""},{"name":"jquery","src":"http:\/\/marchant.ch\/wordpress\/","deps":["jquery-core","jquery-migrate"],"extra":""},{"name":"twentythirteen-script","src":"http:\/\/marchant.ch\/wordpress\/wp-content\/themes\/twentythirteen\/js\/functions.js","deps":["jquery"],"extra":""}];

  12. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Ok, with Twenty Thirteen I also see it... Give me a moment :)

  13. microbe
    Member
    Posted 6 months ago #

    I am using the latest Genesis theme (Wintersong), which I assume is pulling all the same stuff as Twenty Thirteen.

  14. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Solved !

    It seems that sometimes script can be enqueued without src field but with some dependencies to make it load its deps.

  15. microbe
    Member
    Posted 6 months ago #

    OOPS!!

    Warning: Illegal offset type in /home/marchant/public_html/wordpress/wp-content/plugins/async-js-and-css/functions.php on line 325

    Warning: Illegal offset type in /home/marchant/public_html/wordpress/wp-content/plugins/async-js-and-css/functions.php on line 328

  16. Tony Franco
    Member
    Posted 6 months ago #

    Hello !

    Give me the same message here: http://clip2net.com/s/5Te4mC

    Thanks,

    Tony

  17. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Fixed :)

  18. microbe
    Member
    Posted 6 months ago #

    Thanks. Seems to be working well for me now. I think you may have some more to do with rewriting paths, I did find that one other plugin was conflicting(?) - in that a path is broken when your plugin is activated (http://wordpress.org/plugins/simple-social-icons/).

    Great work though, thanks.

  19. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    I don't know if that was the same issue, but I just have fixed a path rewriting problem in inlined CSS "url(...)" statments.
    But I'll try to install the plugin you mentioned to check it.

  20. microbe
    Member
    Posted 6 months ago #

    Yes, I think that was probably the same.

    COmplicated this stuff, isn't it. :-)

  21. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    He-he, so it is :)

  22. microbe
    Member
    Posted 6 months ago #

    Your update has fixed that issue.

    Google Page Speed now 99/100 - need a faster server!

  23. elCHAVALdelaWEB
    Member
    Plugin Author

    Posted 6 months ago #

    Good to hear !
    And by the way - thanks for the review !

Reply

You must log in to post.

About this Plugin

About this Topic