Reduce HTTP Requests, Disable Emojis & Disable Embeds, Speedup WooCommerce - Version 1.5.12

Version Description

  • WooCommerce bugs fixed
  • Syntax error fixed
  • General improvements to GA Offload (Some cases GA code may still not work, does not appear to be a fix for this, if this happens on yours, please ignore the feature)
Download this release

Release Info

Developer pigeonhut
Plugin Icon 128x128 Reduce HTTP Requests, Disable Emojis & Disable Embeds, Speedup WooCommerce
Version 1.5.12
Comparing to
See all releases

Code changes from version 1.5.11 to 1.5.12

css/optimisationio-dashboard.css CHANGED
@@ -796,6 +796,11 @@
796
  max-width: 100px;
797
  }
798
 
 
 
 
 
 
799
  .sidebar-title-wrap{
800
  padding:15px;
801
  border-bottom:1px solid #e6e6e6;
796
  max-width: 100px;
797
  }
798
 
799
+ .addon-settings-content .field textarea{
800
+ width:100%;
801
+ min-height:100px;
802
+ }
803
+
804
  .sidebar-title-wrap{
805
  padding:15px;
806
  border-bottom:1px solid #e6e6e6;
js/optimisationio-dashboard.js CHANGED
@@ -478,6 +478,10 @@ var Optimisationio_Dashbord_WP_Disable = (function($){
478
  $('.certain-posts-comments-group').css('display', ! $toogle_el.certainPostsComments.is(":checked") ? 'none' : ( $toogle_el.comments.is(":checked") ? 'none' : '' ) );
479
  }
480
 
 
 
 
 
481
  function init(){
482
  $toogle_el = {
483
  feeds: $('input[name="disable_rss"]'),
@@ -485,6 +489,7 @@ var Optimisationio_Dashbord_WP_Disable = (function($){
485
  googleMaps: $('input[name="disable_google_maps"]'),
486
  spamCommentsCleaner: $('input[name="spam_comments_cleaner"]'),
487
  certainPostsComments: $('input[name="disable_comments_on_certain_post_types"]'),
 
488
  };
489
 
490
  if( $toogle_el.feeds.length ){
@@ -511,6 +516,11 @@ var Optimisationio_Dashbord_WP_Disable = (function($){
511
  $toogle_el.certainPostsComments.on('change', on_change_certainPostsComments);
512
  on_change_certainPostsComments();
513
  }
 
 
 
 
 
514
  }
515
 
516
  return {
478
  $('.certain-posts-comments-group').css('display', ! $toogle_el.certainPostsComments.is(":checked") ? 'none' : ( $toogle_el.comments.is(":checked") ? 'none' : '' ) );
479
  }
480
 
481
+ function on_change_dnsPrefetch(ev){
482
+ $('.dns-prefetch-group').css('display', $toogle_el.dnsPrefetch.is(":checked") ? '' : 'none');
483
+ }
484
+
485
  function init(){
486
  $toogle_el = {
487
  feeds: $('input[name="disable_rss"]'),
489
  googleMaps: $('input[name="disable_google_maps"]'),
490
  spamCommentsCleaner: $('input[name="spam_comments_cleaner"]'),
491
  certainPostsComments: $('input[name="disable_comments_on_certain_post_types"]'),
492
+ dnsPrefetch: $('input[name="dns_prefetch"]'),
493
  };
494
 
495
  if( $toogle_el.feeds.length ){
516
  $toogle_el.certainPostsComments.on('change', on_change_certainPostsComments);
517
  on_change_certainPostsComments();
518
  }
519
+
520
+ if( $toogle_el.dnsPrefetch.length ){
521
+ $toogle_el.dnsPrefetch.on('change', on_change_dnsPrefetch);
522
+ on_change_dnsPrefetch();
523
+ }
524
  }
525
 
526
  return {
lib/class-wpperformance-admin.php CHANGED
@@ -388,6 +388,8 @@ class WpPerformance_Admin {
388
  $options = array(
389
  'disable_gravatars' => isset( $post_req['disable_gravatars'] ) ? 1 : 0,
390
  'disable_referral_spam' => isset( $post_req['disable_referral_spam'] ) ? 1 : 0,
 
 
391
  'disable_emoji' => isset( $post_req['disable_emoji'] ) ? 1 : 0,
392
  'disable_embeds' => isset( $post_req['disable_embeds'] ) ? 1 : 0,
393
  'remove_querystrings' => isset( $post_req['remove_querystrings'] ) ? 1 : 0,
@@ -507,6 +509,8 @@ class WpPerformance_Admin {
507
  $default_values = array(
508
  'disable_gravatars' => 0,
509
  'disable_referral_spam' => 0,
 
 
510
  'disable_emoji' => 0,
511
  'disable_embeds' => 0,
512
  'remove_querystrings' => 0,
@@ -602,6 +606,19 @@ class WpPerformance_Admin {
602
  <div class="field-left"><?php esc_attr_e('Disable Referral Spam', 'optimisationio'); ?></div>
603
  <div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_referral_spam', isset( $sett['disable_referral_spam'] ) && 1 === (int) $sett['disable_referral_spam']); ?></div>
604
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  <div class="field">
606
  <div class="field-left"><?php printf( __( 'Minimize requests and load %1$sGoogle Fonts%2$s asynchronous', 'optimisationio' ), '<strong>', '</strong>' ); ?></div>
607
  <div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('lazy_load_google_fonts', isset( $sett['lazy_load_google_fonts'] ) && 1 === (int) $sett['lazy_load_google_fonts']); ?></div>
388
  $options = array(
389
  'disable_gravatars' => isset( $post_req['disable_gravatars'] ) ? 1 : 0,
390
  'disable_referral_spam' => isset( $post_req['disable_referral_spam'] ) ? 1 : 0,
391
+ 'dns_prefetch' => isset( $post_req['dns_prefetch'] ) ? 1 : 0,
392
+ 'dns_prefetch_host_list' => isset( $post_req['dns_prefetch_host_list'] ) ? $post_req['dns_prefetch_host_list'] : '',
393
  'disable_emoji' => isset( $post_req['disable_emoji'] ) ? 1 : 0,
394
  'disable_embeds' => isset( $post_req['disable_embeds'] ) ? 1 : 0,
395
  'remove_querystrings' => isset( $post_req['remove_querystrings'] ) ? 1 : 0,
509
  $default_values = array(
510
  'disable_gravatars' => 0,
511
  'disable_referral_spam' => 0,
512
+ 'dns_prefetch' => 0,
513
+ 'dns_prefetch_host_list' => '',
514
  'disable_emoji' => 0,
515
  'disable_embeds' => 0,
516
  'remove_querystrings' => 0,
606
  <div class="field-left"><?php esc_attr_e('Disable Referral Spam', 'optimisationio'); ?></div>
607
  <div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_referral_spam', isset( $sett['disable_referral_spam'] ) && 1 === (int) $sett['disable_referral_spam']); ?></div>
608
  </div>
609
+ <div class="field">
610
+ <div class="field-left"><?php esc_attr_e('DNS prefetch', 'optimisationio'); ?></div>
611
+ <div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('dns_prefetch', isset( $sett['dns_prefetch'] ) && 1 === (int) $sett['dns_prefetch']); ?></div>
612
+ </div>
613
+
614
+ <div class="field sub-field dns-prefetch-group">
615
+ <div class="field-left" style="vertical-align:top;"><?php esc_attr_e('Prefetch host list', 'optimisationio'); ?></div>
616
+ <div class="field-right">
617
+ <textarea name="dns_prefetch_host_list"><?php echo isset( $sett['dns_prefetch_host_list'] ) ? $sett['dns_prefetch_host_list'] : ''; ?></textarea><br/>
618
+ <small class="dis-ib" style="padding-top:5px;"><?php esc_html_e('One domain by line', 'optimisationio' ); ?></small>
619
+ </div>
620
+ </div>
621
+
622
  <div class="field">
623
  <div class="field-left"><?php printf( __( 'Minimize requests and load %1$sGoogle Fonts%2$s asynchronous', 'optimisationio' ), '<strong>', '</strong>' ); ?></div>
624
  <div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('lazy_load_google_fonts', isset( $sett['lazy_load_google_fonts'] ) && 1 === (int) $sett['lazy_load_google_fonts']); ?></div>
lib/class-wpperformance.php CHANGED
@@ -176,6 +176,7 @@ class WpPerformance {
176
  if ( ! is_admin() ) {
177
  $this->add_ga_header_script();
178
  $this->check_pages_disable();
 
179
  }
180
  else{
181
  $this->check_admin_notices_display();
@@ -586,6 +587,34 @@ class WpPerformance {
586
  remove_menu_page('edit-comments.php');
587
  }
588
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  private function check_comments_disable() {
590
  $settings = $this->get_settings_values();
591
  $disable_all_comments = isset( $settings['disable_all_comments'] ) && 1 === $settings['disable_all_comments'];
176
  if ( ! is_admin() ) {
177
  $this->add_ga_header_script();
178
  $this->check_pages_disable();
179
+ $this->check_dns_prefetch();
180
  }
181
  else{
182
  $this->check_admin_notices_display();
587
  remove_menu_page('edit-comments.php');
588
  }
589
 
590
+ private function check_dns_prefetch(){
591
+
592
+ $settings = $this->get_settings_values();
593
+
594
+ if( ! $settings['dns_prefetch'] ) {
595
+ return;
596
+ }
597
+
598
+ $list = array();
599
+ $host_list = $settings['dns_prefetch_host_list'];
600
+ $host_list = '' !== $host_list ? explode("\n", $host_list) : array();
601
+
602
+ if( ! empty( $host_list ) ){
603
+ foreach ($host_list as $key => $val) {
604
+ $val = str_replace( 'http:', '', str_replace( 'https:', '', esc_url( $val ) ) );
605
+ if( $val && ! in_array($val, $list, true) ){
606
+ $list[] = $val;
607
+ }
608
+ }
609
+ }
610
+
611
+ if( ! empty( $list ) ){
612
+ foreach ($list as $key => $val) {
613
+ echo "<link rel=\"dns-prefetch\" href=\"" . $val . "\" />\n";
614
+ }
615
+ }
616
+ }
617
+
618
  private function check_comments_disable() {
619
  $settings = $this->get_settings_values();
620
  $disable_all_comments = isset( $settings['disable_all_comments'] ) && 1 === $settings['disable_all_comments'];
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: pigeonhut, Jody Nesbitt, optimisation.io
3
  Tags: Disable Emoji, Disable Embeds, Disable Gravatars, Remove Querystrings, Reduce HTTP Requests, speedup WooCommerce, Close comments
4
  Requires at least: 4.5
5
  Tested up to: 4.8.1
6
- Stable tag: 1.5.11
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -77,6 +77,11 @@ You can try our <a href="https://wordpress.org/plugins/wp-image-compression/">Fr
77
 
78
 
79
  == Changelog ==
 
 
 
 
 
80
  = 1.5.11 =
81
  * WooCommerce tab not displaying fixed
82
 
@@ -105,7 +110,7 @@ You can try our <a href="https://wordpress.org/plugins/wp-image-compression/">Fr
105
  = 1.4.4 =
106
  * Added ability to stop (disable) admin notices from showing
107
  * removed the stats sub menu item, so everything is now at the top level
108
- * "local-ga.js" file was created on activation, changed the way this works so it will work now independant of when adding the GA code
109
 
110
  = 1.4.3 =
111
  More dashboard visual tweaks.
3
  Tags: Disable Emoji, Disable Embeds, Disable Gravatars, Remove Querystrings, Reduce HTTP Requests, speedup WooCommerce, Close comments
4
  Requires at least: 4.5
5
  Tested up to: 4.8.1
6
+ Stable tag: 1.5.12
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
77
 
78
 
79
  == Changelog ==
80
+ = 1.5.12 =
81
+ * WooCommerce bugs fixed
82
+ * Syntax error fixed
83
+ * General improvements to GA Offload (Some cases GA code may still not work, does not appear to be a fix for this, if this happens on yours, please ignore the feature)
84
+
85
  = 1.5.11 =
86
  * WooCommerce tab not displaying fixed
87
 
110
  = 1.4.4 =
111
  * Added ability to stop (disable) admin notices from showing
112
  * removed the stats sub menu item, so everything is now at the top level
113
+ * "local-ga.js" file was created on activation, changed the way this works so it will work now independent of when adding the GA code
114
 
115
  = 1.4.3 =
116
  More dashboard visual tweaks.
wpperformance.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Improve WordPress performance by disabling unused items.
6
  * Author: pigeonhut, Jody Nesbitt, optimisation.io
7
  * Author URI:https://optimisation.io
8
- * Version: 1.5.11
9
  *
10
  * Copyright (C) 2017 Optimisation.io
11
  */
5
  * Description: Improve WordPress performance by disabling unused items.
6
  * Author: pigeonhut, Jody Nesbitt, optimisation.io
7
  * Author URI:https://optimisation.io
8
+ * Version: 1.5.12
9
  *
10
  * Copyright (C) 2017 Optimisation.io
11
  */