• When I use the next code in my theme / functions.php,
    FireWall Status change from green to grey. I cant Save other Status, and Rules list desappears. Im waiting for solution, because really I need to use this code.

    // Deferring parsing of JavaScript
    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 );

    @wfmattr

    • This topic was modified 7 years, 10 months ago by livingflame.
    • This topic was modified 7 years, 10 months ago by livingflame.
Viewing 1 replies (of 1 total)
  • Hi,
    In your code, replacing:
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    with:
    if ( FALSE === strpos( $url, '.js' ) || strpos( $url, 'wordfence') > 0 ) return $url;

    will exclude Wordfence files from being deferred which should resolve this issue for you.

    P.S. “clean_url” function is deprecated, you should use “esc_url” instead.

    Thanks.

    • This reply was modified 7 years, 10 months ago by wfalaa.
Viewing 1 replies (of 1 total)
  • The topic ‘Bug in Firewall’ is closed to new replies.