Code Duplication    Length = 3-3 lines in 6 locations

classes/autoptimizeScripts.php 2 locations

@@ 55-57 (lines=3) @@
52
53
        // only optimize known good JS?
54
        $whitelistJS = apply_filters( 'autoptimize_filter_js_whitelist', '', $this->content );
55
        if ( ! empty( $whitelistJS ) ) {
56
            $this->whitelist = array_filter( array_map( 'trim', explode( ',', $whitelistJS ) ) );
57
        }
58
59
        // is there JS we should simply remove?
60
        $removableJS = apply_filters( 'autoptimize_filter_js_removables', '', $this->content );
@@ 61-63 (lines=3) @@
58
59
        // is there JS we should simply remove?
60
        $removableJS = apply_filters( 'autoptimize_filter_js_removables', '', $this->content );
61
        if ( !empty( $removableJS ) ) {
62
            $this->jsremovables = array_filter( array_map( 'trim', explode( ',', $removableJS ) ) );
63
        }
64
65
        // only header?
66
        if ( apply_filters( 'autoptimize_filter_js_justhead', $options['justhead'] ) ) {

classes/autoptimizeStyles.php 2 locations

@@ 62-64 (lines=3) @@
59
        }
60
61
        $whitelistCSS = apply_filters( 'autoptimize_filter_css_whitelist', '', $this->content );
62
        if ( ! empty( $whitelistCSS ) ) {
63
            $this->whitelist = array_filter( array_map( 'trim', explode( ',', $whitelistCSS ) ) );
64
        }
65
66
        $removableCSS = apply_filters( 'autoptimize_filter_css_removables', '' );
67
        if ( ! empty( $removableCSS ) ) {
@@ 67-69 (lines=3) @@
64
        }
65
66
        $removableCSS = apply_filters( 'autoptimize_filter_css_removables', '' );
67
        if ( ! empty( $removableCSS ) ) {
68
            $this->cssremovables = array_filter( array_map( 'trim', explode( ',', $removableCSS ) ) );
69
        }
70
71
        $this->cssinlinesize = apply_filters( 'autoptimize_filter_css_inlinesize', 256 );
72

classes/autoptimizeExtra.php 1 location

@@ 128-130 (lines=3) @@
125
    public function extra_async_js( $in )
126
    {
127
        $exclusions = array();
128
        if ( ! empty( $in ) ) {
129
            $exclusions = array_fill_keys( array_filter( array_map( 'trim', explode( ',', $in ) ) ), '' );
130
        }
131
132
        $settings = $this->options['autoptimize_extra_text_field_3'];
133
        $async    = array_fill_keys( array_filter( array_map( 'trim', explode( ',', $settings ) ) ), '' );

classes/autoptimizeImages.php 1 location

@@ 823-825 (lines=3) @@
820
            // add from setting.
821
            if ( array_key_exists( 'autoptimize_imgopt_text_field_5', $options ) ) {
822
                $exclude_lazyload_option = $options['autoptimize_imgopt_text_field_5'];
823
                if ( ! empty( $exclude_lazyload_option ) ) {
824
                    $exclude_lazyload_array = array_merge( $exclude_lazyload_array, array_filter( array_map( 'trim', explode( ',', $options['autoptimize_imgopt_text_field_5'] ) ) ) );
825
                }
826
            }
827
828
            // and filter for developer-initiated changes.