Code Duplication    Length = 3-9 lines in 2 locations

classes/autoptimizeStyles.php 1 location

@@ 361-363 (lines=3) @@
358
                        }
359
360
                        // And replace!
361
                        if ( ( '' !== $new_tag && $new_tag !== $tag ) || ( '' === $new_tag && apply_filters( 'autoptimize_filter_css_remove_empty_files', false ) ) ) {
362
                            $this->content = str_replace( $tag, $new_tag, $this->content );
363
                        }
364
                    }
365
                }
366
            }

classes/autoptimizeScripts.php 1 location

@@ 388-396 (lines=9) @@
385
                            } else {
386
                                $this->move['first'][] = $new_tag;
387
                            }
388
                        } else {
389
                            // cannot be moved, so if flag was added re-inject altered tag immediately.
390
                            if ( ( '' !== $new_tag && $orig_tag !== $new_tag ) || ( '' === $new_tag && apply_filters( 'autoptimize_filter_js_remove_empty_files', false ) ) ) {
391
                                $this->content = str_replace( $orig_tag, $new_tag, $this->content );
392
                                $orig_tag      = '';
393
                            }
394
                            // and forget about the $tag (not to be touched any more).
395
                            $tag = '';
396
                        }
397
                    }
398
                } else {
399
                    // Inline script.