Version Description
- Minor CSS _updates
- Bug fix with DNS-prefetch
- Fixed conflicts with other optimisation.io Plugins
- New fetaure - Disable Gravatars only in Comments
Download this release
Release Info
Developer | pigeonhut |
Plugin | Reduce HTTP Requests, Disable Emojis & Disable Embeds, Speedup WooCommerce |
Version | 1.5.15 |
Comparing to | |
See all releases |
Code changes from version 1.5.14 to 1.5.15
- css/optimisationio-dashboard.css +20 -0
- js/css-lazy-load.min.js +1 -0
- js/optimisationio-dashboard.js +93 -0
- lib/class-optimisationio-dashboard.php +2 -0
- lib/class-wpperformance-admin.php +14 -1
- lib/class-wpperformance.php +23 -7
- readme.txt +9 -2
- uninstall.php +2 -2
- views/optimisationio-dashboard.php +1 -1
- wpperformance.php +4 -4
css/optimisationio-dashboard.css
CHANGED
@@ -1076,4 +1076,24 @@
|
|
1076 |
|
1077 |
.donation-overlay-inner button.close:hover span {
|
1078 |
color: rgba(255, 255, 255, 0.9);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1079 |
}
|
1076 |
|
1077 |
.donation-overlay-inner button.close:hover span {
|
1078 |
color: rgba(255, 255, 255, 0.9);
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
.optimising-images-icon{
|
1082 |
+
position:relative;
|
1083 |
+
float:right;
|
1084 |
+
width:34px;
|
1085 |
+
height:34px;
|
1086 |
+
display:none;
|
1087 |
+
background:#ffcc26 url(../images/addon-load.gif) no-repeat center;
|
1088 |
+
-moz-border-radius: 9999px;
|
1089 |
+
-webkit-border-radius: 9999px;
|
1090 |
+
border-radius: 9999px;
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
.is-executing > .optimising-images-icon{
|
1094 |
+
display:inline-block;
|
1095 |
+
}
|
1096 |
+
|
1097 |
+
.is-executing > .not-while-exe{
|
1098 |
+
display:none;
|
1099 |
}
|
js/css-lazy-load.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(w){"use strict";var loadCSS=function(href,before,media){var doc=w.document;var ss=doc.createElement("link");var ref;if(before){ref=before}else{var refs=(doc.body||doc.getElementsByTagName("head")[0]).childNodes;ref=refs[refs.length-1]}var sheets=doc.styleSheets;ss.rel="stylesheet";ss.href=href;ss.media="only x";function ready(cb){if(doc.body){return cb()}setTimeout(function(){ready(cb)})}ready(function(){ref.parentNode.insertBefore(ss,before?ref:ref.nextSibling)});var onloadcssdefined=function(cb){var resolvedHref=ss.href;var i=sheets.length;while(i--){if(sheets[i].href===resolvedHref){return cb()}}setTimeout(function(){onloadcssdefined(cb)})};function loadCB(){if(ss.addEventListener){ss.removeEventListener("load",loadCB)}ss.media=media||"all"}if(ss.addEventListener){ss.addEventListener("load",loadCB)}ss.onloadcssdefined=onloadcssdefined;onloadcssdefined(loadCB);return ss};if(typeof exports!=="undefined"){exports.loadCSS=loadCSS}else{w.loadCSS=loadCSS}})(typeof global!=="undefined"?global:this);(function($){"use strict";$(function(){if("undefined"!==typeof WpDisableAsyncLinks&&Object.keys(WpDisableAsyncLinks).length){var key;for(key in WpDisableAsyncLinks){if(WpDisableAsyncLinks.hasOwnProperty(key)){loadCSS(WpDisableAsyncLinks[key])}}}})})(jQuery);
|
js/optimisationio-dashboard.js
CHANGED
@@ -482,6 +482,10 @@ var Optimisationio_Dashbord_WP_Disable = (function($){
|
|
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"]'),
|
@@ -490,6 +494,7 @@ var Optimisationio_Dashbord_WP_Disable = (function($){
|
|
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 ){
|
@@ -521,6 +526,11 @@ var Optimisationio_Dashbord_WP_Disable = (function($){
|
|
521 |
$toogle_el.dnsPrefetch.on('change', on_change_dnsPrefetch);
|
522 |
on_change_dnsPrefetch();
|
523 |
}
|
|
|
|
|
|
|
|
|
|
|
524 |
}
|
525 |
|
526 |
return {
|
@@ -663,6 +673,8 @@ var Optimisationio_Dashboard_Cache_Performance = (function($){
|
|
663 |
|
664 |
var Optimisationio_Dashboard_Image_Compression = (function($){
|
665 |
|
|
|
|
|
666 |
var $toogle_el = {
|
667 |
quality_auto: null,
|
668 |
custom_cloudinary_account: null,
|
@@ -678,6 +690,85 @@ var Optimisationio_Dashboard_Image_Compression = (function($){
|
|
678 |
$('.auto-cloudinary-group').css('display', isChecked ? 'none' : '');
|
679 |
}
|
680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
function init(){
|
682 |
$toogle_el = {
|
683 |
quality_auto: $('select[name="wpimages_quality_auto"]'),
|
@@ -699,6 +790,8 @@ var Optimisationio_Dashboard_Image_Compression = (function($){
|
|
699 |
$(this).remove();
|
700 |
});
|
701 |
});
|
|
|
|
|
702 |
}
|
703 |
|
704 |
return {
|
482 |
$('.dns-prefetch-group').css('display', $toogle_el.dnsPrefetch.is(":checked") ? '' : 'none');
|
483 |
}
|
484 |
|
485 |
+
function on_change_disableGravatars(ev){
|
486 |
+
$('.disable-gravatars-only-comments').css('display', $toogle_el.disableGravatars.is(":checked") ? '' : 'none');
|
487 |
+
}
|
488 |
+
|
489 |
function init(){
|
490 |
$toogle_el = {
|
491 |
feeds: $('input[name="disable_rss"]'),
|
494 |
spamCommentsCleaner: $('input[name="spam_comments_cleaner"]'),
|
495 |
certainPostsComments: $('input[name="disable_comments_on_certain_post_types"]'),
|
496 |
dnsPrefetch: $('input[name="dns_prefetch"]'),
|
497 |
+
disableGravatars: $('input[name="disable_gravatars"]'),
|
498 |
};
|
499 |
|
500 |
if( $toogle_el.feeds.length ){
|
526 |
$toogle_el.dnsPrefetch.on('change', on_change_dnsPrefetch);
|
527 |
on_change_dnsPrefetch();
|
528 |
}
|
529 |
+
|
530 |
+
if( $toogle_el.disableGravatars.length ){
|
531 |
+
$toogle_el.disableGravatars.on('change', on_change_disableGravatars);
|
532 |
+
on_change_disableGravatars();
|
533 |
+
}
|
534 |
}
|
535 |
|
536 |
return {
|
673 |
|
674 |
var Optimisationio_Dashboard_Image_Compression = (function($){
|
675 |
|
676 |
+
var while_optimising_images = false;
|
677 |
+
|
678 |
var $toogle_el = {
|
679 |
quality_auto: null,
|
680 |
custom_cloudinary_account: null,
|
690 |
$('.auto-cloudinary-group').css('display', isChecked ? 'none' : '');
|
691 |
}
|
692 |
|
693 |
+
function init_bulk_images_optimisation(){
|
694 |
+
|
695 |
+
var $bulk_optimisation_button = jQuery("#bulk_optimisation_button");
|
696 |
+
|
697 |
+
if( $bulk_optimisation_button.length ){
|
698 |
+
|
699 |
+
var page_leave_on_img_optimising = function(ev){
|
700 |
+
var msg;
|
701 |
+
if ( while_optimising_images ) {
|
702 |
+
msg = "Leaving the page while executing images bulk optimisation, may be canceled a part or the whole proccess.";
|
703 |
+
ev.returnValue = msg;
|
704 |
+
return msg;
|
705 |
+
}
|
706 |
+
}
|
707 |
+
|
708 |
+
var on_bulk_optimisation_click = function(ev){
|
709 |
+
|
710 |
+
ev.preventDefault();
|
711 |
+
ev.stopPropagation();
|
712 |
+
|
713 |
+
if( while_optimising_images ){ return; }
|
714 |
+
|
715 |
+
while_optimising_images = true;
|
716 |
+
|
717 |
+
var $parent = $(this).parent();
|
718 |
+
var error_msg = "There was a problem with the images optimization process and ended incomplete.";
|
719 |
+
|
720 |
+
$parent.addClass("is-executing");
|
721 |
+
|
722 |
+
$.ajax({
|
723 |
+
type: 'post',
|
724 |
+
url: ajaxurl,
|
725 |
+
data:{
|
726 |
+
action: 'wpimages_optimise_all_images',
|
727 |
+
nonce: $('#optimisationio_cloudinary_api_settings').val(),
|
728 |
+
},
|
729 |
+
dataType: 'json',
|
730 |
+
success: function (data, textStatus, XMLHttpRequest) {
|
731 |
+
|
732 |
+
var alert_msg = null;
|
733 |
+
|
734 |
+
if( 0 === parseInt( data.error, 10 ) ){
|
735 |
+
if( 1 < data.optimised_num ){
|
736 |
+
alert_msg = "Images bulk optimisation completed.\n " + data.optimised_num + " images have been successfully optimized.";
|
737 |
+
}
|
738 |
+
else{
|
739 |
+
alert_msg = "Images bulk optimisation completed.\n " + data.optimised_num + " image has been successfully optimized.";
|
740 |
+
}
|
741 |
+
}
|
742 |
+
else{
|
743 |
+
|
744 |
+
alert_msg = error_msg;
|
745 |
+
|
746 |
+
if( 'undefined' !== typeof data.msg ) {
|
747 |
+
console.info( data.msg );
|
748 |
+
}
|
749 |
+
}
|
750 |
+
|
751 |
+
while_optimising_images = false;
|
752 |
+
$parent.removeClass("is-executing");
|
753 |
+
|
754 |
+
if( alert_msg ){
|
755 |
+
alert( alert_msg );
|
756 |
+
}
|
757 |
+
},
|
758 |
+
error: function (data, textStatus, XMLHttpRequest) {
|
759 |
+
console.error(data);
|
760 |
+
while_optimising_images = false;
|
761 |
+
$parent.removeClass("is-executing");
|
762 |
+
alert( error_msg );
|
763 |
+
}
|
764 |
+
});
|
765 |
+
};
|
766 |
+
|
767 |
+
$bulk_optimisation_button.on('click', on_bulk_optimisation_click);
|
768 |
+
$(window).bind('beforeunload', page_leave_on_img_optimising );
|
769 |
+
}
|
770 |
+
}
|
771 |
+
|
772 |
function init(){
|
773 |
$toogle_el = {
|
774 |
quality_auto: $('select[name="wpimages_quality_auto"]'),
|
790 |
$(this).remove();
|
791 |
});
|
792 |
});
|
793 |
+
|
794 |
+
init_bulk_images_optimisation();
|
795 |
}
|
796 |
|
797 |
return {
|
lib/class-optimisationio-dashboard.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
class Optimisationio_Dashboard {
|
3 |
|
4 |
private static $instance = null;
|
1 |
<?php
|
2 |
+
if( class_exists('Optimisationio_Dashboard') ){ return; }
|
3 |
+
|
4 |
class Optimisationio_Dashboard {
|
5 |
|
6 |
private static $instance = null;
|
lib/class-wpperformance-admin.php
CHANGED
@@ -429,6 +429,7 @@ class WpPerformance_Admin {
|
|
429 |
|
430 |
$options = array(
|
431 |
'disable_gravatars' => isset( $post_req['disable_gravatars'] ) ? 1 : 0,
|
|
|
432 |
'disable_referral_spam' => isset( $post_req['disable_referral_spam'] ) ? 1 : 0,
|
433 |
'remove_jquery_migrate' => isset( $post_req['remove_jquery_migrate'] ) ? 1 : 0,
|
434 |
'dns_prefetch' => isset( $post_req['dns_prefetch'] ) ? 1 : 0,
|
@@ -553,6 +554,7 @@ class WpPerformance_Admin {
|
|
553 |
|
554 |
$default_values = array(
|
555 |
'disable_gravatars' => 0,
|
|
|
556 |
'disable_referral_spam' => 0,
|
557 |
'remove_jquery_migrate' => 0,
|
558 |
'dns_prefetch' => 0,
|
@@ -622,6 +624,7 @@ class WpPerformance_Admin {
|
|
622 |
<li data-tab-setting="admin"><?php esc_html_e('Admin', 'optimisationio'); ?></li>
|
623 |
<li data-tab-setting="seo"><?php esc_html_e('SEO', 'optimisationio'); ?></li>
|
624 |
<li data-tab-setting="others"><?php esc_html_e('Others', 'optimisationio'); ?></li>
|
|
|
625 |
</ul>
|
626 |
</div>
|
627 |
|
@@ -928,10 +931,14 @@ class WpPerformance_Admin {
|
|
928 |
<div class="field-left"><?php esc_attr_e('Disable XML-RPC', 'optimisationio'); ?></div>
|
929 |
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_xmlrpc', isset( $sett['disable_xmlrpc'] ) && 1 === (int) $sett['disable_xmlrpc']); ?></div>
|
930 |
</div>
|
931 |
-
<div class="field">
|
932 |
<div class="field-left"><?php esc_attr_e('Disable Gravatars', 'optimisationio'); ?></div>
|
933 |
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_gravatars', isset( $sett['disable_gravatars'] ) && 1 === (int) $sett['disable_gravatars']); ?></div>
|
934 |
</div>
|
|
|
|
|
|
|
|
|
935 |
<div class="field comments-group">
|
936 |
<div class="field-left"><?php esc_attr_e('Enable spam comments cleaner', 'optimisationio'); ?></div>
|
937 |
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('spam_comments_cleaner', isset( $sett['spam_comments_cleaner'] ) && 1 === (int) $sett['spam_comments_cleaner']); ?></div>
|
@@ -974,6 +981,12 @@ class WpPerformance_Admin {
|
|
974 |
</div>
|
975 |
</div>
|
976 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
977 |
</div>
|
978 |
|
979 |
<div class="addon-settings-actions-section">
|
429 |
|
430 |
$options = array(
|
431 |
'disable_gravatars' => isset( $post_req['disable_gravatars'] ) ? 1 : 0,
|
432 |
+
'disable_gravatars_only_comments' => isset( $post_req['disable_gravatars_only_comments'] ) ? 1 : 0,
|
433 |
'disable_referral_spam' => isset( $post_req['disable_referral_spam'] ) ? 1 : 0,
|
434 |
'remove_jquery_migrate' => isset( $post_req['remove_jquery_migrate'] ) ? 1 : 0,
|
435 |
'dns_prefetch' => isset( $post_req['dns_prefetch'] ) ? 1 : 0,
|
554 |
|
555 |
$default_values = array(
|
556 |
'disable_gravatars' => 0,
|
557 |
+
'disable_gravatars_only_comments' => 0,
|
558 |
'disable_referral_spam' => 0,
|
559 |
'remove_jquery_migrate' => 0,
|
560 |
'dns_prefetch' => 0,
|
624 |
<li data-tab-setting="admin"><?php esc_html_e('Admin', 'optimisationio'); ?></li>
|
625 |
<li data-tab-setting="seo"><?php esc_html_e('SEO', 'optimisationio'); ?></li>
|
626 |
<li data-tab-setting="others"><?php esc_html_e('Others', 'optimisationio'); ?></li>
|
627 |
+
<li data-tab-setting="rest-api"><?php esc_html_e('REST API', 'optimisationio'); ?></li>
|
628 |
</ul>
|
629 |
</div>
|
630 |
|
931 |
<div class="field-left"><?php esc_attr_e('Disable XML-RPC', 'optimisationio'); ?></div>
|
932 |
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_xmlrpc', isset( $sett['disable_xmlrpc'] ) && 1 === (int) $sett['disable_xmlrpc']); ?></div>
|
933 |
</div>
|
934 |
+
<div class="field comments-group">
|
935 |
<div class="field-left"><?php esc_attr_e('Disable Gravatars', 'optimisationio'); ?></div>
|
936 |
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_gravatars', isset( $sett['disable_gravatars'] ) && 1 === (int) $sett['disable_gravatars']); ?></div>
|
937 |
</div>
|
938 |
+
<div class="field sub-field disable-gravatars-only-comments comments-group">
|
939 |
+
<div class="field-left"><?php esc_attr_e('Disable Gravatars ONLY in comments', 'optimisationio'); ?></div>
|
940 |
+
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('disable_gravatars_only_comments', isset( $sett['disable_gravatars_only_comments'] ) && 1 === (int) $sett['disable_gravatars_only_comments'] ); ?></div>
|
941 |
+
</div>
|
942 |
<div class="field comments-group">
|
943 |
<div class="field-left"><?php esc_attr_e('Enable spam comments cleaner', 'optimisationio'); ?></div>
|
944 |
<div class="field-right"><?php Optimisationio_Dashboard::checkbox_component('spam_comments_cleaner', isset( $sett['spam_comments_cleaner'] ) && 1 === (int) $sett['spam_comments_cleaner']); ?></div>
|
981 |
</div>
|
982 |
</div>
|
983 |
</div>
|
984 |
+
|
985 |
+
<div data-tab-setting="rest-api" class="addon-settings-content auto-table-layout">
|
986 |
+
<div class="cdn-comming-soon" style="margin-bottom:0; background:none">
|
987 |
+
<div><strong>REST API</strong>Coming Soon</div>
|
988 |
+
</div>
|
989 |
+
</div>
|
990 |
</div>
|
991 |
|
992 |
<div class="addon-settings-actions-section">
|
lib/class-wpperformance.php
CHANGED
@@ -176,7 +176,7 @@ class WpPerformance {
|
|
176 |
if ( ! is_admin() ) {
|
177 |
$this->add_ga_header_script();
|
178 |
$this->check_pages_disable();
|
179 |
-
$this
|
180 |
}
|
181 |
else{
|
182 |
$this->check_admin_notices_display();
|
@@ -184,6 +184,7 @@ class WpPerformance {
|
|
184 |
|
185 |
$this->check_comments_disable();
|
186 |
$this->check_feeds_disable();
|
|
|
187 |
|
188 |
add_action( 'wp_print_styles', array( $this, 'enqueue_scripts' ), -1 );
|
189 |
add_action( 'wp_print_styles', array( $this, 'dequeue_styles'), -1 );
|
@@ -199,7 +200,7 @@ class WpPerformance {
|
|
199 |
public function enqueue_scripts() {
|
200 |
$async_links = $this->check_googlefonts_fontawesome_styles();
|
201 |
if ( ! empty( $async_links ) ) {
|
202 |
-
wp_enqueue_script( 'wp-disable-css-lazy-load', plugin_dir_url( dirname( __FILE__ ) ) . 'js/css-lazy-load.js' );
|
203 |
wp_localize_script( 'wp-disable-css-lazy-load', 'WpDisableAsyncLinks', $async_links );
|
204 |
}
|
205 |
}
|
@@ -219,9 +220,11 @@ class WpPerformance {
|
|
219 |
|
220 |
public function dequeue_scripts() {
|
221 |
|
|
|
|
|
222 |
$settings = $this->get_settings_values();
|
223 |
|
224 |
-
$invalid_disable = is_page('lost_password');
|
225 |
|
226 |
$wc_invalid_disable = ! WpPerformance::is_woocommerce_enabled() || $invalid_disable || is_account_page() || is_checkout();
|
227 |
|
@@ -332,7 +335,7 @@ class WpPerformance {
|
|
332 |
$this->update_saved_font_awesome_requests(0);
|
333 |
$this->update_saved_google_fonts_request(0);
|
334 |
}
|
335 |
-
}
|
336 |
|
337 |
return $ret;
|
338 |
}
|
@@ -523,7 +526,8 @@ class WpPerformance {
|
|
523 |
}
|
524 |
|
525 |
public static function synchronize_discussion_data($settings){
|
526 |
-
|
|
|
527 |
update_option( 'show_avatars', false );
|
528 |
} else {
|
529 |
update_option( 'show_avatars', true );
|
@@ -591,10 +595,10 @@ class WpPerformance {
|
|
591 |
remove_menu_page('edit-comments.php');
|
592 |
}
|
593 |
|
594 |
-
|
595 |
|
596 |
$settings = $this->get_settings_values();
|
597 |
-
|
598 |
if( ! isset( $settings['dns_prefetch'] ) || ! $settings['dns_prefetch'] ) {
|
599 |
return;
|
600 |
}
|
@@ -619,6 +623,18 @@ class WpPerformance {
|
|
619 |
}
|
620 |
}
|
621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
private function check_comments_disable() {
|
623 |
$settings = $this->get_settings_values();
|
624 |
$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 |
+
add_action('wp_head', array( $this, 'check_dns_prefetch') );
|
180 |
}
|
181 |
else{
|
182 |
$this->check_admin_notices_display();
|
184 |
|
185 |
$this->check_comments_disable();
|
186 |
$this->check_feeds_disable();
|
187 |
+
$this->check_gravatars_in_comments();
|
188 |
|
189 |
add_action( 'wp_print_styles', array( $this, 'enqueue_scripts' ), -1 );
|
190 |
add_action( 'wp_print_styles', array( $this, 'dequeue_styles'), -1 );
|
200 |
public function enqueue_scripts() {
|
201 |
$async_links = $this->check_googlefonts_fontawesome_styles();
|
202 |
if ( ! empty( $async_links ) ) {
|
203 |
+
wp_enqueue_script( 'wp-disable-css-lazy-load', plugin_dir_url( dirname( __FILE__ ) ) . 'js/css-lazy-load.min.js' );
|
204 |
wp_localize_script( 'wp-disable-css-lazy-load', 'WpDisableAsyncLinks', $async_links );
|
205 |
}
|
206 |
}
|
220 |
|
221 |
public function dequeue_scripts() {
|
222 |
|
223 |
+
global $wp;
|
224 |
+
|
225 |
$settings = $this->get_settings_values();
|
226 |
|
227 |
+
$invalid_disable = isset( $wp->query_vars['lost-password'] ) || ( isset($_GET['action']) && 'lostpassword' === $_GET['action'] ) || is_page('lost_password');
|
228 |
|
229 |
$wc_invalid_disable = ! WpPerformance::is_woocommerce_enabled() || $invalid_disable || is_account_page() || is_checkout();
|
230 |
|
335 |
$this->update_saved_font_awesome_requests(0);
|
336 |
$this->update_saved_google_fonts_request(0);
|
337 |
}
|
338 |
+
}
|
339 |
|
340 |
return $ret;
|
341 |
}
|
526 |
}
|
527 |
|
528 |
public static function synchronize_discussion_data($settings){
|
529 |
+
|
530 |
+
if ( isset( $settings['disable_gravatars'] ) && 1 === (int) $settings['disable_gravatars'] && ( ! isset( $settings['disable_gravatars_only_comments'] ) || 1 !== (int) $settings['disable_gravatars_only_comments'] ) ) {
|
531 |
update_option( 'show_avatars', false );
|
532 |
} else {
|
533 |
update_option( 'show_avatars', true );
|
595 |
remove_menu_page('edit-comments.php');
|
596 |
}
|
597 |
|
598 |
+
public function check_dns_prefetch(){
|
599 |
|
600 |
$settings = $this->get_settings_values();
|
601 |
+
|
602 |
if( ! isset( $settings['dns_prefetch'] ) || ! $settings['dns_prefetch'] ) {
|
603 |
return;
|
604 |
}
|
623 |
}
|
624 |
}
|
625 |
|
626 |
+
private function check_gravatars_in_comments(){
|
627 |
+
$settings = $this->get_settings_values();
|
628 |
+
if ( isset( $settings['disable_gravatars'] ) && 1 === (int) $settings['disable_gravatars'] && isset( $settings['disable_gravatars_only_comments'] ) && 1 === (int) $settings['disable_gravatars_only_comments'] ) {
|
629 |
+
add_filter("get_avatar" , array( $this, "disable_gravatars_in_comments" ) , 1, 5);
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
+
public function disable_gravatars_in_comments($avatar, $id_or_email, $size, $default, $alt){
|
634 |
+
global $in_comment_loop;
|
635 |
+
return $in_comment_loop ? '' : $avatar;
|
636 |
+
}
|
637 |
+
|
638 |
private function check_comments_disable() {
|
639 |
$settings = $this->get_settings_values();
|
640 |
$disable_all_comments = isset( $settings['disable_all_comments'] ) && 1 === $settings['disable_all_comments'];
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: optimisation.io, hosting.io
|
|
3 |
Tags: Disable Emoji, Disable Embeds, Disable Gravatars, Remove Querystrings, Reduce HTTP Requests, speedup WooCommerce, Close comments, Optimization
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 1.5.
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -37,7 +37,7 @@ General Performance improvements: Added support for : disable ping/trackbacks, c
|
|
37 |
<a href="https://github.com/hosting-io/wp-disable">Public repo on GitHub</a> if you would like to contribute or have any ideas to add.
|
38 |
|
39 |
<b>Docs & Support</b><br>
|
40 |
-
<a href="https://optimisation.io/faq/">
|
41 |
|
42 |
|
43 |
|
@@ -81,6 +81,13 @@ You can try our <a href="https://wordpress.org/plugins/wp-image-compression/">Fr
|
|
81 |
|
82 |
|
83 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
= 1.5.14 =
|
85 |
* Started on Documentation (can be found here https://optimisation.io/faq/)
|
86 |
* Added donation button - help us make this the best optimisation suite available on the repo. Every $ donated helps.
|
3 |
Tags: Disable Emoji, Disable Embeds, Disable Gravatars, Remove Querystrings, Reduce HTTP Requests, speedup WooCommerce, Close comments, Optimization
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 1.5.15
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
37 |
<a href="https://github.com/hosting-io/wp-disable">Public repo on GitHub</a> if you would like to contribute or have any ideas to add.
|
38 |
|
39 |
<b>Docs & Support</b><br>
|
40 |
+
The <a href="https://optimisation.io/faq/">documentation is an on-going project</a>, so please bare with us as we update. If you would like to help with the documentation, please get in touch.
|
41 |
|
42 |
|
43 |
|
81 |
|
82 |
|
83 |
== Changelog ==
|
84 |
+
= 1.5.15 =
|
85 |
+
* Minor CSS _updates
|
86 |
+
* Bug fix with DNS-prefetch
|
87 |
+
* Fixed conflicts with other optimisation.io Plugins
|
88 |
+
* New fetaure - Disable Gravatars only in Comments
|
89 |
+
|
90 |
+
|
91 |
= 1.5.14 =
|
92 |
* Started on Documentation (can be found here https://optimisation.io/faq/)
|
93 |
* Added donation button - help us make this the best optimisation suite available on the repo. Every $ donated helps.
|
uninstall.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; }
|
3 |
-
require_once 'lib/class-wpperformance.php';
|
4 |
-
require_once 'lib/class-optimisationio-dashboard.php';
|
5 |
WpPerformance::delete_options();
|
6 |
WpPerformance::delete_transients();
|
7 |
WpPerformance::unschedule_spam_comments_delete();
|
1 |
<?php
|
2 |
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; }
|
3 |
+
require_once dirname( __FILE__ ) . '/lib/class-wpperformance.php';
|
4 |
+
require_once dirname( __FILE__ ) . '/lib/class-optimisationio-dashboard.php';
|
5 |
WpPerformance::delete_options();
|
6 |
WpPerformance::delete_transients();
|
7 |
WpPerformance::unschedule_spam_comments_delete();
|
views/optimisationio-dashboard.php
CHANGED
@@ -113,7 +113,7 @@ $addons = Optimisationio_Dashboard::$addons;
|
|
113 |
<button class="close"><span>x</span></button>
|
114 |
</div>
|
115 |
</div>
|
116 |
-
</div>
|
117 |
</div><!-- // .donation-overlay-wrap -->
|
118 |
|
119 |
</div>
|
113 |
<button class="close"><span>x</span></button>
|
114 |
</div>
|
115 |
</div>
|
116 |
+
</div>
|
117 |
</div><!-- // .donation-overlay-wrap -->
|
118 |
|
119 |
</div>
|
wpperformance.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: WP Disable
|
4 |
* Plugin URI: https://optimisation.io
|
5 |
* Description: Improve WordPress performance by disabling unused items. <a href="admin.php?page=optimisationio-dashboard">Open Settings</a>
|
6 |
-
* Author: optimisation.io
|
7 |
* Author URI:https://optimisation.io
|
8 |
-
* Version: 1.5.
|
9 |
*
|
10 |
-
* Copyright (C) 2017 Optimisation.io
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
@@ -85,7 +85,7 @@ function wpperformance_init_wp_filesystem() {
|
|
85 |
*/
|
86 |
function wpperformance_disable_google_maps_ob_end( $html ) {
|
87 |
global $post;
|
88 |
-
$exclude_ids =
|
89 |
$settings = get_option( WpPerformance::OPTION_KEY . '_settings', array() );
|
90 |
if ( isset( $settings['exclude_from_disable_google_maps'] ) && '' !== $settings['exclude_from_disable_google_maps'] ) {
|
91 |
$exclude_ids = array_map( 'intval', explode(',', $settings['exclude_from_disable_google_maps']) );
|
3 |
* Plugin Name: WP Disable
|
4 |
* Plugin URI: https://optimisation.io
|
5 |
* Description: Improve WordPress performance by disabling unused items. <a href="admin.php?page=optimisationio-dashboard">Open Settings</a>
|
6 |
+
* Author: optimisation.io - jody nesbitt
|
7 |
* Author URI:https://optimisation.io
|
8 |
+
* Version: 1.5.15
|
9 |
*
|
10 |
+
* Copyright (C) 2017-2018 Optimisation.io
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
85 |
*/
|
86 |
function wpperformance_disable_google_maps_ob_end( $html ) {
|
87 |
global $post;
|
88 |
+
$exclude_ids = array();
|
89 |
$settings = get_option( WpPerformance::OPTION_KEY . '_settings', array() );
|
90 |
if ( isset( $settings['exclude_from_disable_google_maps'] ) && '' !== $settings['exclude_from_disable_google_maps'] ) {
|
91 |
$exclude_ids = array_map( 'intval', explode(',', $settings['exclude_from_disable_google_maps']) );
|