• Resolved jtsimmons

    (@jtsimmons)


    Hello, the plugin is working great except my admin area is loading very slow. Upon inspection in browser console, I noticed that the following was trying to load twice and resulted in 404’s:

    null

    When removing everything after the .js, it loads, but the defer/version string is causing 404. I have W3 Total Cache with version numbers set to be removed. I even tried adding a snippet in functions.php to remove query strings from static resources on top of this and it still won’t affect this particular file.

    As mentioned it is also trying to load twice, causing a 3 second page load delay on each instance.

    Looking forward to any help,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @jtsimmons,

    Have you tried disabling W3TC completely to so we can see if the issue is specific to that?

    Let us know how it goes so we could pinpoint the cause of this.

    Cheers,
    Predrag

    Thank you for using Smush. I am going to mark this topic resolved because we haven’t heard from you in a while. If this issue was not resolved we can reopen the ticket. Thanks again!

    Thread Starter jtsimmons

    (@jtsimmons)

    Hello, after various debugging methods I have found the culprit. This issue is caused when using the following js defer script in functions.php:

    // Defer js parsing code
    
    function defer_parsing_of_js ( $url ) {
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    return "$url' defer ";
    }
    add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
    

    Noticeably the 404 versions of the script were containing “%20defer?v=__” in their filenames, so I assume this script was creating query strings of some sort?

    I removed this script and it solved the issue, though I am just pointing out as a lot of people use snippets like these in their functions.php to defer their js loading to the end of the page, though I don’t feel this warrants reopening the support topic.

    Perhaps there’s another way of using a snippet like this that won’t cause this issue..

    Thank you for posting the solution! I will pass this on to the developer to see if he can come up with a solution that allows both.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘404 on notice.js causing 6 second delay in backend’ is closed to new replies.