Plugin Directory

Changeset 2352763


Ignore:
Timestamp:
08/05/2020 12:05:29 AM (5 years ago)
Author:
quecodig
Message:

Bug fixed

Location:
native-performance/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • native-performance/trunk/core/class-functions.php

    r2186154 r2352763  
    9292// Include/tweaks/footer
    9393if(native_performance_active('footer')){
    94     add_filter('script_loader_tag', 'native_performance_defer_parsing_of_js',10,2);
     94    add_filter('clean_url', 'native_performance_defer_parsing_of_js',10,2);
    9595}
  • native-performance/trunk/includes/tweaks/footer.php

    r2186154 r2352763  
    99
    1010// Mover JavaScript al Footer.
    11 function native_performance_defer_parsing_of_js($tag, $handle) {
    12     if (is_admin()){
    13         return $tag;
    14     }
    15     if (strpos($tag, '/wp-includes/js/jquery/jquery')) {
    16         return $tag;
    17     }
    18     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9.') !==false) {
    19     return $tag;
    20     }
    21     else {
    22         return str_replace(' src',' defer src', $tag);
    23     }
     11function native_performance_defer_parsing_of_js($url) {
     12    if ( FALSE === strpos( $url, '.js' ) ) return $url;
     13    if ( strpos( $url, 'jquery.js' ) ) return $url;
     14    return "$url' defer ";
    2415}
  • native-performance/trunk/readme.txt

    r2346855 r2352763  
    8080== Changelog ==
    8181
     82
     83= 1.2.7 =
     84* Fixed for Google site Kit
     85
    8286= 1.2.6 =
    8387Tested up to: 5.5
Note: See TracChangeset for help on using the changeset viewer.