Skip to content

Commit

Permalink
*Tags should always be removed, not just when the cache is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
pcfreak30 committed Dec 26, 2016
1 parent 46049af commit 8fec6da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/class-rocket-async-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ public function process_css_buffer( $buffer ) {
$tags[] = array( $type, $tag );
}
if ( ! empty( $tags ) ) {
foreach ( $tags as $item ) {
//Remove tag
$tag->parentNode->removeChild( $item[1] );
}
// Check post cache
$post_cache_id_hash = md5( serialize( $urls ) );
$post_cache_id = 'wp_rocket_footer_js_script_';
Expand Down Expand Up @@ -416,8 +420,6 @@ public function process_css_buffer( $buffer ) {
foreach ( $tags as $item ) {
/** @var DOMEvent $tag */
list( $type, $tag ) = $item;
//Remove tag
$tag->parentNode->removeChild( $tag );
//Get source url
$href = $tag->getAttribute( 'href' );
if ( 'link' == $tag->tagName && ! empty( $href ) ) {
Expand Down

0 comments on commit 8fec6da

Please sign in to comment.