• I have a multisite and use “optimize JS” only nothing else.
    CSS has been manually integrated inline …
    The main site works with Autoptimize but the other languages do not work correctly. I have a fixed Header and I guess that the different JS location does not work with my inline css for the other languages …
    If I disable Autoptimize, it works and the header is not broken.
    Is there a way to use the same JS file from the main page (1) for all networksites perhaps a hack in functions.php?

    Regards, Ralph

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Author Frank Goossens

    (@futtta)

    OK, but;

    what is the path to jquery.js vs jquery-migrate.min.js (or any other aggregated js-file)?

    Thread Starter cluster666

    (@cluster666)

    the real path is:
    wp-includes/js/jquery/…
    but for the network sites (I guess there is a WP re-write rule) in place:
    for the main site:
    https://www.mydomain.tld/wp-includes/js/jquery/…
    and for other network sites:
    https://www.mydomain.tld/en/wp-includes/js/jquery/…
    https://www.mydomain.tld/fr/wp-includes/js/jquery/…

    All of the jquery links are working by default I can reach the same jquery file with /en, /fr .. or main site /

    I do not use a subdomain based multisite, the permalinks are just set to:
    en/
    fr/
    and
    /
    for the main site

    • This reply was modified 7 years, 12 months ago by cluster666.
    • This reply was modified 7 years, 12 months ago by cluster666.
    Plugin Author Frank Goossens

    (@futtta)

    and for other network sites:
    https://www.mydomain.tld/en/wp-includes/js/jquery/…
    https://www.mydomain.tld/fr/wp-includes/js/jquery/…

    does that mean that path to jquery.js (which is not aggregated) and jquery-migrate.min.js (which is migrated, correct?) are the same? if so; spooky!

    All of the jquery links are working by default I can reach the same jquery file with /en, /fr .. or main site /

    that’s because you’ll indeed probably have a rewrite-rule in .htaccess or something similar, which AO cannot know about.

    I have checked the link from sourcecode before AO was activated!
    $langlink means “/en” “/fr” when change the languages
    <script type='text/javascript' src='<?php echo network_site_url(); ?><?php echo $langlink; ?>wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>

    so what happens if you remove <?php echo $langlink; ?>?

    frank

    Thread Starter cluster666

    (@cluster666)

    thanks Frank,
    I have checked the functions.php again and found this:

    // Dequeue jQuery Migrate script in WordPress.
    function isa_remove_jquery_migrate( &$scripts) {
        if(!is_admin()) {
            $scripts->remove( 'jquery');
            $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4' );
        }
    }
    add_filter( 'wp_default_scripts', 'isa_remove_jquery_migrate' );

    could this be the reason?

    Plugin Author Frank Goossens

    (@futtta)

    well, that certainly explains why jquery-migrate.min.js isn’t a problem; it’s removed by that code ??

    so did you try removing the $langlink code?

    Thread Starter cluster666

    (@cluster666)

    Thanks Frank!
    Great, the hardcoded way works without $langlink or subfolder specification, also with official package ??
    <script type='text/javascript' src='<?php echo network_site_url(); ?>wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>

    Do tyou think disabling of jquery-migrate.min.js is OK if everything else works?

    Regards, Ralph

    Plugin Author Frank Goossens

    (@futtta)

    Great, the hardcoded way works without $langlink or subfolder specification

    great news! ??

    Do you think disabling of jquery-migrate.min.js is OK if everything else works?

    well, disabling jquery-migrate.min.js might break stuff as its aim is to plug holes left by stuff being removed from jquery proper. so if you have older pluginsand or people using older browsers (not sure), then you might want to keep jquery-migrate after all ??

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘issues with network site’ is closed to new replies.