Code Duplication    Length = 3-3 lines in 6 locations

classes/autoptimizeExtra.php 1 location

@@ 93-95 (lines=3) @@
90
    public function extra_async_js( $in )
91
    {
92
        $exclusions = array();
93
        if ( ! empty( $in ) ) {
94
            $exclusions = array_fill_keys( array_filter( array_map( 'trim', explode( ',', $in ) ) ), '' );
95
        }
96
97
        $settings = $this->options['autoptimize_extra_text_field_3'];
98
        $async    = array_fill_keys( array_filter( array_map( 'trim', explode( ',', $settings ) ) ), '' );

classes/autoptimizeImages.php 1 location

@@ 764-766 (lines=3) @@
761
            // add from setting.
762
            if ( array_key_exists( 'autoptimize_imgopt_text_field_5', $options ) ) {
763
                $exclude_lazyload_option = $options['autoptimize_imgopt_text_field_5'];
764
                if ( ! empty( $exclude_lazyload_option ) ) {
765
                    $exclude_lazyload_array = array_merge( $exclude_lazyload_array, array_filter( array_map( 'trim', explode( ',', $options['autoptimize_imgopt_text_field_5'] ) ) ) );
766
                }
767
            }
768
769
            // and filter for developer-initiated changes.

classes/autoptimizeScripts.php 2 locations

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

classes/autoptimizeStyles.php 2 locations

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