Raindrops 1.524 about Improve the response of the website (ウェブサイトのレスポンスを改善)

In Raindrops 1.524, the item “Improve website response" is added to customize / Add-on.

With this function, InstantClick makes it possible to display the web site faster than before.

Depending on how your web site is configured, the web site may not work properly.

When this function is enabled, Raindrops stops page transition.

Just installing a theme is less likely to cause problems, but it may be hindered by actions such as plugins.

Problems that occur when enabling this function

Google tracking code will not work unless you devise.

If you use old code, it may not work. Operation check is necessary.

example, below code works.

/**
 * Google tracking code
 */
add_action( 'after_setup_theme','trimming_after_setup_theme');

function trimming_after_setup_theme(){
	add_action( 'wp_footer','google_tracking_code',99 );
}

function google_tracking_code(){
?>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxx-xx"></script>
<script>
 window.dataLayer= window.dataLayer | | [];
 function gtag(){dataLayer.push(arguments)};
 
	gtag('js', new Date());

	gtag('config', 'UA-xxxxxx-xx');
</script><?php
}

If non WordPress HTML exists on the same domain and the link to that page exists in WordPress.

In this case, it will not operate properly.

The way to avoid it is to add an attribute to the link tag (data-no-instant)

example

<a href="no-wordpress.html" data-no-instant>No WordPress HTML</a>

When header.php and footer.php are remodeled to those specific to that page

<a href="special-template.php" data-no-instant>No WordPress HTML</a>

If that page does not function properly, please do not load javascript on that page

The way to avoid it is to add filter

add_filter('raindrops_instantclick_operating_condition','my_filter');

function my_filter($condition){

 if( is_page(3) ) {
 return false;
 }

 return $condition;

}

コメントは受け付けていません。