Asset CleanUp: Page Speed Booster - Version 1.2.6.4

Version Description

  • Bug Fix: When editing a post/page within the Dashboard and the "Update" button was pressed before the "WP Asset CleanUp" meta box was loading, it sent an empty unloaded list to the plugin and it deleted the current settings for that particular post/page
Download this release

Release Info

Developer gabelivan
Plugin Icon 128x128 Asset CleanUp: Page Speed Booster
Version 1.2.6.4
Comparing to
See all releases

Code changes from version 1.2.6.3 to 1.2.6.4

assets/icons/woocommerce-icon-logo.svg ADDED
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="1200px" height="1200px" viewBox="0 0 1200 1200" enable-background="new 0 0 1200 1200" xml:space="preserve">
6
+ <path fill="#9B5C8F" d="M131.729,257.729h936.074c59.242,0,107.197,47.954,107.197,107.197v357.313
7
+ c0,59.243-47.955,107.196-107.197,107.196H732.115l46.077,112.836l-202.64-112.836H132.196
8
+ c-59.238,0-107.193-47.953-107.193-107.196V364.926C24.531,306.155,72.481,257.729,131.729,257.729z"/>
9
+ <path fill="#FFFFFF" d="M90.486,355.434c6.545-8.886,16.359-13.558,29.451-14.491c23.845-1.874,37.401,9.344,40.672,33.654
10
+ c14.492,97.705,30.385,180.452,47.213,248.234l102.377-194.939c9.353-17.767,21.041-27.114,35.064-28.049
11
+ c20.57-1.4,33.188,11.686,38.332,39.267c11.689,62.172,26.648,115,44.41,159.877c12.156-118.737,32.727-204.287,61.709-257.11
12
+ c7.008-13.09,17.295-19.635,30.854-20.574c10.754-0.93,20.568,2.34,29.449,9.354c8.882,7.012,13.559,15.893,14.492,26.646
13
+ c0.467,8.414-0.934,15.426-4.672,22.438c-18.234,33.66-33.197,90.226-45.349,168.758c-11.686,76.201-15.895,135.575-13.09,178.116
14
+ c0.938,11.679-0.935,21.967-5.606,30.852c-5.615,10.283-14.025,15.895-24.779,16.828c-12.154,0.935-24.773-4.672-36.93-17.295
15
+ c-43.475-44.414-78.07-110.795-103.313-199.148c-30.39,59.837-52.827,104.714-67.319,134.632
16
+ c-27.582,52.827-50.955,79.941-70.59,81.345c-12.623,0.934-23.373-9.82-32.722-32.254c-23.84-61.242-49.553-179.519-77.131-354.821
17
+ C81.137,374.598,83.939,363.843,90.486,355.434L90.486,355.434z M1095.102,428.827c-16.827-29.451-41.605-47.213-74.795-54.229
18
+ c-8.886-1.869-17.295-2.803-25.246-2.803c-44.877,0-81.341,23.373-109.856,70.123c-24.312,39.733-36.463,83.676-36.463,131.828
19
+ c0,35.996,7.479,66.848,22.438,92.561c16.827,29.451,41.605,47.215,74.795,54.227c8.881,1.874,17.294,2.808,25.245,2.808
20
+ c45.345,0,81.809-23.373,109.857-70.123c24.307-40.205,36.463-84.146,36.463-132.295
21
+ C1118.007,484.458,1110.061,454.069,1095.102,428.827z M1036.2,558.319c-6.546,30.852-18.234,53.758-35.534,69.185
22
+ c-13.552,12.155-26.176,17.295-37.859,14.959c-11.222-2.336-20.574-12.151-27.582-30.386c-5.615-14.491-8.414-28.983-8.414-42.541
23
+ c0-11.686,0.936-23.373,3.271-34.123c4.209-19.168,12.155-37.869,24.773-55.631c15.431-22.911,31.791-32.254,48.619-28.984
24
+ c11.223,2.336,20.574,12.156,27.582,30.385c5.61,14.492,8.413,28.984,8.413,42.541c0,12.156-0.935,23.841-3.27,34.591V558.319z
25
+ M802.458,428.827c-16.828-29.45-42.074-47.213-74.795-54.229c-8.881-1.869-17.295-2.803-25.246-2.803
26
+ c-44.877,0-81.34,23.373-109.857,70.123c-24.307,39.733-36.463,83.676-36.463,131.828c0,35.996,7.48,66.848,22.439,92.561
27
+ c16.828,29.451,41.606,47.215,74.795,54.227c8.885,1.874,17.294,2.808,25.246,2.808c45.344,0,81.807-23.373,109.855-70.123
28
+ c24.313-40.205,36.463-84.146,36.463-132.295C824.896,484.458,817.417,454.069,802.458,428.827L802.458,428.827z M743.089,558.319
29
+ c-6.545,30.852-18.233,53.758-35.528,69.185c-13.558,12.155-26.181,17.295-37.868,14.959c-11.218-2.336-20.565-12.151-27.582-30.386
30
+ c-5.606-14.491-8.409-28.983-8.409-42.541c0-11.686,0.935-23.373,3.27-34.123c4.21-19.168,12.156-37.869,24.779-55.631
31
+ c15.427-22.911,31.787-32.254,48.614-28.984c11.222,2.336,20.573,12.156,27.582,30.385c5.614,14.492,8.414,28.984,8.414,42.541
32
+ c0.472,12.156-0.935,23.841-3.271,34.591V558.319z"/>
33
+ </svg>
assets/script.js CHANGED
@@ -86,11 +86,23 @@ jQuery(document).ready(function($) {
86
});
87
*/
88
89
- $('.wpacu_post_type_unload').click(function() {
90
if ($(this).prop('checked')) {
91
- $(this).parent('label').addClass('wpacu_post_type_unload_active');
92
} else {
93
- $(this).parent('label').removeClass('wpacu_post_type_unload_active');
94
}
95
});
96
86
});
87
*/
88
89
+ $('.wpacu_keep_bulk_rule').click(function() {
90
if ($(this).prop('checked')) {
91
+ $(this).parents('li').next().removeClass('remove_rule');
92
+ }
93
+ });
94
+
95
+ $('.wpacu_remove_bulk_rule').click(function() {
96
+ if ($(this).prop('checked')) {
97
+ $(this).parents('li').addClass('remove_rule');
98
+ }
99
+ });
100
+
101
+ $('.wpacu_bulk_unload').click(function() {
102
+ if ($(this).prop('checked')) {
103
+ $(this).parent('label').addClass('wpacu_bulk_unload_active');
104
} else {
105
+ $(this).parent('label').removeClass('wpacu_bulk_unload_active');
106
}
107
});
108
assets/script.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){var b={load:function(){var b,c=".icheckbox_square-red";a(c).iCheck({checkboxClass:"icheckbox_square-red"}),a(c).on("ifChecked",function(b){a(b.target).closest("tr").addClass("wpacu_not_load")}),a(c).on("ifUnchecked",function(b){a(b.target).closest("tr").removeClass("wpacu_not_load")}),a(".wpacu_global_unload").click(function(){b=a(this).attr("data-handle"),a(this).prop("checked")?a(this).parent("label").addClass("wpacu_global_checked"):a(this).parent("label").removeClass("wpacu_global_checked")}),a(".wpacu_post_type_unload").click(function(){a(this).prop("checked")?a(this).parent("label").addClass("wpacu_post_type_unload_active"):a(this).parent("label").removeClass("wpacu_post_type_unload_active")}),a(".wpacu_load_it_option").click(function(){var b=a(this).attr("data-handle");if(a(this).prop("checked")){a(this).parent("label").addClass("wpacu_global_unload_exception");var c="";a(this).hasClass("wpacu_style")?c="style":a(this).hasClass("wpacu_script")&&(c="script"),a("#"+c+"_"+b).iCheck("uncheck")}else a(this).parent("label").removeClass("wpacu_global_unload_exception")})}};if(a("#wpacu_post_type_select").change(function(){a("#wpacu_post_type_form").submit()}),a(".wpacu_remove_rule").click(function(){var b=a(this).parents(".wpacu_global_rule_row");a(this).prop("checked")?b.addClass("selected"):b.removeClass("selected")}),a("#wpacu_wrap_assets").length>0&&b.load(),"undefined"==typeof wpacu_object||a("#wpacu_meta_box_content").length<1)return!1;var c={};"direct"===wpacu_object.dom_get_type?(c[wpacu_object.plugin_name+"_load"]=1,a.post(wpacu_object.post_url,c,function(c){var d=c.substring(c.lastIndexOf(wpacu_object.start_del)+wpacu_object.start_del.length,c.lastIndexOf(wpacu_object.end_del)),e={action:wpacu_object.plugin_name+"_get_loaded_assets",wpacu_list:d,post_id:wpacu_object.post_id,post_url:wpacu_object.post_url};if("btoa"in window)try{c=c.replace(/[\u0250-\ue007]/g,""),c=c.replace(/[^\x00-\x7F]/g,""),e.contents=window.btoa(c)}catch(a){e.contents=""}a.post(wpacu_object.ajax_url,e,function(c){return!!c&&(a("#wpacu_meta_box_content").html(c),a("#wpacu_home_page_form").length>0&&a("#submit").show(),void b.load())})})):"wp_remote_post"===wpacu_object.dom_get_type&&(c={action:wpacu_object.plugin_name+"_get_loaded_assets",post_id:wpacu_object.post_id,post_url:wpacu_object.post_url},a.post(wpacu_object.ajax_url,c,function(c){return!!c&&(a("#wpacu_meta_box_content").html(c),a("#wpacu_home_page_form").length>0&&a("#submit").show(),void b.load())}))});
1
+ jQuery(document).ready(function(a){var b={load:function(){var b,c=".icheckbox_square-red";a(c).iCheck({checkboxClass:"icheckbox_square-red"}),a(c).on("ifChecked",function(b){a(b.target).closest("tr").addClass("wpacu_not_load")}),a(c).on("ifUnchecked",function(b){a(b.target).closest("tr").removeClass("wpacu_not_load")}),a(".wpacu_global_unload").click(function(){b=a(this).attr("data-handle"),a(this).prop("checked")?a(this).parent("label").addClass("wpacu_global_checked"):a(this).parent("label").removeClass("wpacu_global_checked")}),a(".wpacu_keep_bulk_rule").click(function(){a(this).prop("checked")&&a(this).parents("li").next().removeClass("remove_rule")}),a(".wpacu_remove_bulk_rule").click(function(){a(this).prop("checked")&&a(this).parents("li").addClass("remove_rule")}),a(".wpacu_bulk_unload").click(function(){a(this).prop("checked")?a(this).parent("label").addClass("wpacu_bulk_unload_active"):a(this).parent("label").removeClass("wpacu_bulk_unload_active")}),a(".wpacu_load_it_option").click(function(){var b=a(this).attr("data-handle");if(a(this).prop("checked")){a(this).parent("label").addClass("wpacu_global_unload_exception");var c="";a(this).hasClass("wpacu_style")?c="style":a(this).hasClass("wpacu_script")&&(c="script"),a("#"+c+"_"+b).iCheck("uncheck")}else a(this).parent("label").removeClass("wpacu_global_unload_exception")})}};if(a("#wpacu_post_type_select").change(function(){a("#wpacu_post_type_form").submit()}),a(".wpacu_remove_rule").click(function(){var b=a(this).parents(".wpacu_global_rule_row");a(this).prop("checked")?b.addClass("selected"):b.removeClass("selected")}),a("#wpacu_wrap_assets").length>0&&b.load(),"undefined"==typeof wpacu_object||a("#wpacu_meta_box_content").length<1)return!1;var c={};"direct"===wpacu_object.dom_get_type?(c[wpacu_object.plugin_name+"_load"]=1,a.post(wpacu_object.post_url,c,function(c){var d=c.substring(c.lastIndexOf(wpacu_object.start_del)+wpacu_object.start_del.length,c.lastIndexOf(wpacu_object.end_del)),e={action:wpacu_object.plugin_name+"_get_loaded_assets",wpacu_list:d,post_id:wpacu_object.post_id,post_url:wpacu_object.post_url};if("btoa"in window)try{c=c.replace(/[\u0250-\ue007]/g,""),c=c.replace(/[^\x00-\x7F]/g,""),e.contents=window.btoa(c)}catch(a){e.contents=""}a.post(wpacu_object.ajax_url,e,function(c){return!!c&&(a("#wpacu_meta_box_content").html(c),a("#wpacu_home_page_form").length>0&&a("#submit").show(),void b.load())})})):"wp_remote_post"===wpacu_object.dom_get_type&&(c={action:wpacu_object.plugin_name+"_get_loaded_assets",post_id:wpacu_object.post_id,post_url:wpacu_object.post_url},a.post(wpacu_object.ajax_url,c,function(c){return!!c&&(a("#wpacu_meta_box_content").html(c),a("#wpacu_home_page_form").length>0&&a("#submit").show(),void b.load())}))});
assets/style.min.css CHANGED
@@ -1 +1 @@
1
- .widefat .check-column.wpacu_check,body.toplevel_page_wpassetcleanup_settings .notice{padding:10px}tr.wpacu_not_load td,tr.wpacu_not_load th{background:#FFE1E1!important;}#wpacu_meta_box_content{width:99%}#wpacu_meta_box_content h3{margin-left:0;padding-left:0}#wpacu_meta_box_content div.wpacu_note,#wpacu_wrap_assets div.wpacu_note{padding:10px;background-color:#f5f5f5}#wpacu_meta_box_content .dashicons.dashicons-warning{color:red}#wpacu_meta_box_content div.wpacu_warning,#wpacu_wrap_assets div.wpacu_warning{border:1px solid #c00}#wpacu_meta_box_content div.wpacu_verified{padding:10px;background-color:#f5f5f5;border-left:1px solid #ddd}#wpacu_meta_box_content div.wpacu_verified span{color:#0073aa;font-weight:700}#wpacu_meta_box_content ul.wpacu_asset_options{margin:0;padding:0}#wpacu_meta_box_content ul.wpacu_asset_options li{list-style:none;display:inline-block}#wpacu_wrap_assets img,.wpacu_asset_row td label{display:inline-block!important}#wpacu_meta_box_content ul.wpacu_asset_options label{margin-right:20px;font-weight:400}#wpacu_wrap_assets{color:#000!important;text-align:left;clear:both;width:90%;padding:20px;margin:30px 0 0 15px;border:1px solid #cdcdcd;z-index:10000!important;position:relative;background-color:#fff}#wpacu_wrap_assets p{margin:10px 0;line-height:22px;text-align:left}#wpacu_wrap_assets h1{margin:0 0 20px;font-size:160%;text-align:left}#wpacu_wrap_assets h3{margin:20px 0;font-size:130%}.wpacu_verified{margin:0 0 10px}.wpacu_asset_row td{padding:10px}.wpacu_asset_row td p{margin-bottom:10px;word-wrap:break-word}.wpacu_asset_row td label{cursor:pointer!important;font-size:100%;font-weight:400}.wpacu_asset_row td label span{font-size:100%!important}.wpacu_asset_row td.wpacu_check{width:50px}body.wp-admin .wpacu_asset_row td.wpacu_check{width:25px}label.wpacu_add_global{cursor:pointer}label.wpacu_global_checked{font-weight:700;color:#d54e21}label.wpacu_global_unload_exception{font-weight:700!important}label.wpacu_post_type_unload_active{color:#d54e21}tr.wpacu_global_rule_row.selected{background:#e7e7e7}.nav-tab-wrapper{border-bottom:1px solid #ccc;width:95%}ul.wpacu_asset_options{margin:0;padding:0}ul.wpacu_asset_options li{list-style:none;display:inline-block}ul.wpacu_asset_options label{margin-right:20px;font-weight:400}ul.wpacu_asset_options label input{margin-right:4px}.wp-asset-clean-up.widefat{width:99%}.wpacu_widefat,.wpacu_widefat td{border:1px solid #e5e5e5!important}.wpacu_striped>tbody>:nth-child(odd),ul.wpacu_striped>:nth-child(odd){background-color:#f9f9f9!important}.wpacu_update_btn{-moz-box-shadow:inset 0 1px 0 0 #54a3f7!important;-webkit-box-shadow:inset 0 1px 0 0 #54a3f7!important;box-shadow:inset 0 1px 0 0 #54a3f7!important;background:-webkit-gradient(linear,left top,left bottom,color-stop(.05,#007dc1),color-stop(1,#0061a7))!important;background:-moz-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:-webkit-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:-o-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:-ms-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:linear-gradient(to bottom,#007dc1 5%,#0061a7 100%)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#007dc1', endColorstr='#0061a7', GradientType=0)!important;background-color:#007dc1!important;-moz-border-radius:3px!important;-webkit-border-radius:3px!important;border-radius:3px!important;border:1px solid #124d77!important;display:inline-block!important;cursor:pointer!important;color:#fff!important;font-size:15px!important;padding:10px 24px!important;text-decoration:none!important;text-shadow:0 1px 0 #154682!important;height:auto!important;line-height:normal!important}.wpacu-btns .btn:focus,.wpacu-btns .btn:hover,.wpacu-btns a{text-decoration:none}.wpacu_update_btn:hover{background:-webkit-gradient(linear,left top,left bottom,color-stop(.05,#0061a7),color-stop(1,#007dc1))!important;background:-moz-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:-webkit-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:-o-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:-ms-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:linear-gradient(to bottom,#0061a7 5%,#007dc1 100%)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0061a7', endColorstr='#007dc1', GradientType=0)!important;background-color:#0061a7!important}.wpacu_update_btn:active{position:relative!important;top:1px!important}ul.hire-reasons{margin-bottom:20px}ul.hire-reasons li{font-size:14px;line-height:22px;margin-bottom:12px}ul.hire-reasons li .dashicons{font-size:23px;line-height:23px}ul.hire-reasons li .dashicons.dashicons-yes{color:green}.wpacu-get-help-wrap p{font-size:14px}.wpacu-btns .btn{display:inline-block;font-weight:400;line-height:1.25;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.5rem 1rem;font-size:1rem;border-radius:.25rem;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wpacu-btns .btn.focus,.wpacu-btns .btn:focus{outline:0;-webkit-box-shadow:0 0 0 2px rgba(2,117,216,.25);box-shadow:0 0 0 2px rgba(2,117,216,.25)}.wpacu-btns .btn.disabled,.wpacu-btns .btn:disabled{cursor:not-allowed;opacity:.65}.wpacu-btns .btn.active,.wpacu-btns .btn:active{background-image:none}.wpacu-btns a.btn.disabled,.wpacu-btns fieldset[disabled] a.btn{pointer-events:none}.wpacu-btns .btn-primary{color:#fff;background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-primary:hover{color:#fff;background-color:#025aa5;border-color:#01549b}.wpacu-btns .btn-primary.focus,.wpacu-btns .btn-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(2,117,216,.5);box-shadow:0 0 0 2px rgba(2,117,216,.5)}.wpacu-btns .btn-primary.disabled,.wpacu-btns .btn-primary:disabled{background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-primary.active,.wpacu-btns .btn-primary:active,.wpacu-btns .show>.btn-primary.dropdown-toggle{color:#fff;background-color:#025aa5;background-image:none;border-color:#01549b}.wpacu-btns .btn-secondary{color:#292b2c;background-color:#fff;border-color:#ccc}.wpacu-btns .btn-secondary:hover{color:#292b2c;background-color:#e6e6e6;border-color:#adadad}.wpacu-btns .btn-secondary.focus,.wpacu-btns .btn-secondary:focus{-webkit-box-shadow:0 0 0 2px rgba(204,204,204,.5);box-shadow:0 0 0 2px rgba(204,204,204,.5)}.wpacu-btns .btn-secondary.disabled,.wpacu-btns .btn-secondary:disabled{background-color:#fff;border-color:#ccc}.wpacu-btns .btn-secondary.active,.wpacu-btns .btn-secondary:active,.wpacu-btns .show>.btn-secondary.dropdown-toggle{color:#292b2c;background-color:#e6e6e6;background-image:none;border-color:#adadad}.wpacu-btns .btn-info{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#2aabd2}.wpacu-btns .btn-info.focus,.wpacu-btns .btn-info:focus{-webkit-box-shadow:0 0 0 2px rgba(91,192,222,.5);box-shadow:0 0 0 2px rgba(91,192,222,.5)}.wpacu-btns .btn-info.disabled,.wpacu-btns .btn-info:disabled{background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-info.active,.wpacu-btns .btn-info:active,.wpacu-btns .show>.btn-info.dropdown-toggle{color:#fff;background-color:#31b0d5;background-image:none;border-color:#2aabd2}.wpacu-btns .btn-success{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-success:hover{color:#fff;background-color:#449d44;border-color:#419641}.wpacu-btns .btn-success.focus,.wpacu-btns .btn-success:focus{-webkit-box-shadow:0 0 0 2px rgba(92,184,92,.5);box-shadow:0 0 0 2px rgba(92,184,92,.5)}.wpacu-btns .btn-success.disabled,.wpacu-btns .btn-success:disabled{background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-success.active,.wpacu-btns .btn-success:active,.wpacu-btns .show>.btn-success.dropdown-toggle{color:#fff;background-color:#449d44;background-image:none;border-color:#419641}.wpacu-btns .btn-warning{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#eb9316}.wpacu-btns .btn-warning.focus,.wpacu-btns .btn-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(240,173,78,.5);box-shadow:0 0 0 2px rgba(240,173,78,.5)}.wpacu-btns .btn-warning.disabled,.wpacu-btns .btn-warning:disabled{background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-warning.active,.wpacu-btns .btn-warning:active,.wpacu-btns .show>.btn-warning.dropdown-toggle{color:#fff;background-color:#ec971f;background-image:none;border-color:#eb9316}.wpacu-btns .btn-danger{color:#fff;background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#c12e2a}.wpacu-btns .btn-danger.focus,.wpacu-btns .btn-danger:focus{-webkit-box-shadow:0 0 0 2px rgba(217,83,79,.5);box-shadow:0 0 0 2px rgba(217,83,79,.5)}.wpacu-btns .btn-danger.disabled,.wpacu-btns .btn-danger:disabled{background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-danger.active,.wpacu-btns .btn-danger:active,.wpacu-btns .show>.btn-danger.dropdown-toggle{color:#fff;background-color:#c9302c;background-image:none;border-color:#c12e2a}.wpacu-btns .btn-outline-primary{color:#0275d8;background-image:none;background-color:transparent;border-color:#0275d8}.wpacu-btns .btn-outline-primary:hover{color:#fff;background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-outline-primary.focus,.wpacu-btns .btn-outline-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(2,117,216,.5);box-shadow:0 0 0 2px rgba(2,117,216,.5)}.wpacu-btns .btn-outline-primary.disabled,.wpacu-btns .btn-outline-primary:disabled{color:#0275d8;background-color:transparent}.wpacu-btns .btn-outline-primary.active,.wpacu-btns .btn-outline-primary:active,.wpacu-btns .show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-outline-secondary{color:#ccc;background-image:none;background-color:transparent;border-color:#ccc}.wpacu-btns .btn-outline-secondary:hover{color:#fff;background-color:#ccc;border-color:#ccc}.wpacu-btns .btn-outline-secondary.focus,.wpacu-btns .btn-outline-secondary:focus{-webkit-box-shadow:0 0 0 2px rgba(204,204,204,.5);box-shadow:0 0 0 2px rgba(204,204,204,.5)}.wpacu-btns .btn-outline-secondary.disabled,.wpacu-btns .btn-outline-secondary:disabled{color:#ccc;background-color:transparent}.wpacu-btns .btn-outline-secondary.active,.wpacu-btns .btn-outline-secondary:active,.wpacu-btns .show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#ccc;border-color:#ccc}.wpacu-btns .btn-outline-info{color:#5bc0de;background-image:none;background-color:transparent;border-color:#5bc0de}.wpacu-btns .btn-outline-info:hover{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-outline-info.focus,.wpacu-btns .btn-outline-info:focus{-webkit-box-shadow:0 0 0 2px rgba(91,192,222,.5);box-shadow:0 0 0 2px rgba(91,192,222,.5)}.wpacu-btns .btn-outline-info.disabled,.wpacu-btns .btn-outline-info:disabled{color:#5bc0de;background-color:transparent}.wpacu-btns .btn-outline-info.active,.wpacu-btns .btn-outline-info:active,.wpacu-btns .show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-outline-success{color:#5cb85c;background-image:none;background-color:transparent;border-color:#5cb85c}.wpacu-btns .btn-outline-success:hover{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-outline-success.focus,.wpacu-btns .btn-outline-success:focus{-webkit-box-shadow:0 0 0 2px rgba(92,184,92,.5);box-shadow:0 0 0 2px rgba(92,184,92,.5)}.wpacu-btns .btn-outline-success.disabled,.wpacu-btns .btn-outline-success:disabled{color:#5cb85c;background-color:transparent}.wpacu-btns .btn-outline-success.active,.wpacu-btns .btn-outline-success:active,.wpacu-btns .show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-outline-warning{color:#f0ad4e;background-image:none;background-color:transparent;border-color:#f0ad4e}.wpacu-btns .btn-outline-warning:hover{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-outline-warning.focus,.wpacu-btns .btn-outline-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(240,173,78,.5);box-shadow:0 0 0 2px rgba(240,173,78,.5)}.wpacu-btns .btn-outline-warning.disabled,.wpacu-btns .btn-outline-warning:disabled{color:#f0ad4e;background-color:transparent}.wpacu-btns .btn-outline-warning.active,.wpacu-btns .btn-outline-warning:active,.wpacu-btns .show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-outline-danger{color:#d9534f;background-image:none;background-color:transparent;border-color:#d9534f}.wpacu-btns .btn-outline-danger:hover{color:#fff;background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-outline-danger.focus,.wpacu-btns .btn-outline-danger:focus{-webkit-box-shadow:0 0 0 2px rgba(217,83,79,.5);box-shadow:0 0 0 2px rgba(217,83,79,.5)}.wpacu-btns .btn-outline-danger.disabled,.wpacu-btns .btn-outline-danger:disabled{color:#d9534f;background-color:transparent}.wpacu-btns .btn-outline-danger.active,.wpacu-btns .btn-outline-danger:active,.wpacu-btns .show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-link{font-weight:400;color:#0275d8;border-radius:0}.wpacu-btns .btn-link,.wpacu-btns .btn-link.active,.wpacu-btns .btn-link:active,.wpacu-btns .btn-link:disabled{background-color:transparent}.wpacu-btns .btn-link,.wpacu-btns .btn-link:active,.wpacu-btns .btn-link:focus,.wpacu-btns .btn-link:hover{border-color:transparent}.wpacu-btns .btn-link:focus,.wpacu-btns .btn-link:hover{color:#014c8c;text-decoration:underline;background-color:transparent}.wpacu-btns .btn-link:disabled{color:#636c72}.wpacu-btns .btn-link:disabled:focus,.wpacu-btns .btn-link:disabled:hover{text-decoration:none}.wpacu-btns .btn-group-lg>.btn,.wpacu-btns .btn-lg{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:.3rem}.wpacu-btns .btn-group-sm>.btn,.wpacu-btns .btn-sm{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.wpacu-btns .btn-block{display:block;width:100%}.wpacu-btns .btn-block+.btn-block{margin-top:.5rem}.wpacu-btns input[type=submit].btn-block,.wpacu-btns input[type=reset].btn-block,.wpacu-btns input[type=button].btn-block{width:100%}.wpacu-btns .fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}
1
+ .widefat .check-column.wpacu_check,body.toplevel_page_wpassetcleanup_settings .notice{padding:10px}tr.wpacu_not_load td,tr.wpacu_not_load th{background:#FFE1E1!important}#wpacu_meta_box_content{width:99%}#wpacu_meta_box_content h3{margin-left:0;padding-left:0}#wpacu_meta_box_content div.wpacu_note,#wpacu_wrap_assets div.wpacu_note{padding:10px;background-color:#f5f5f5}#wpacu_meta_box_content .dashicons.dashicons-warning{color:red}#wpacu_meta_box_content div.wpacu_warning,#wpacu_wrap_assets div.wpacu_warning{border:1px solid #c00}#wpacu_meta_box_content div.wpacu_verified{padding:10px;background-color:#f5f5f5;border-left:1px solid #ddd}#wpacu_meta_box_content div.wpacu_verified span{color:#0073aa;font-weight:700}#wpacu_meta_box_content ul.wpacu_asset_options{margin:0;padding:0}#wpacu_meta_box_content ul.wpacu_asset_options li{list-style:none;display:inline-block}#wpacu_wrap_assets img,.wpacu_asset_row td label{display:inline-block!important}#wpacu_meta_box_content ul.wpacu_asset_options label{margin-right:20px;font-weight:400}#wpacu_wrap_assets{color:#000!important;text-align:left;clear:both;width:90%;padding:20px;margin:30px 0 0 15px;border:1px solid #cdcdcd;z-index:10000!important;position:relative;background-color:#fff}#wpacu_wrap_assets p{margin:10px 0;line-height:22px;text-align:left}#wpacu_wrap_assets h1{margin:0 0 20px;font-size:160%;text-align:left}#wpacu_wrap_assets h3{margin:20px 0;font-size:130%}.wpacu_verified{margin:0 0 10px}.wpacu_asset_row td{padding:10px}.wpacu_asset_row td p{margin-bottom:10px;word-wrap:break-word}.wpacu_asset_row td label{cursor:pointer!important;font-size:100%;font-weight:400}.wpacu_asset_row td label span{font-size:100%!important}.wpacu_asset_row td.wpacu_check{width:50px}body.wp-admin .wpacu_asset_row td.wpacu_check{width:25px}label.wpacu_add_global{cursor:pointer}label.wpacu_global_checked{font-weight:700;color:#d54e21}label.wpacu_global_unload_exception{font-weight:700!important}label.wpacu_bulk_unload_active{color:#d54e21}tr.wpacu_global_rule_row.selected{background:#e7e7e7}.nav-tab-wrapper{border-bottom:1px solid #ccc;width:95%}ul.wpacu_asset_options{margin:0;padding:0}ul.wpacu_asset_options li{list-style:none;display:inline-block}ul.wpacu_asset_options li.remove_rule label{font-weight:700}ul.wpacu_asset_options label{margin-right:20px;font-weight:400}ul.wpacu_asset_options label input{margin-right:4px}.wp-asset-clean-up.widefat{width:99%}.wpacu_widefat,.wpacu_widefat td{border:1px solid #e5e5e5!important}.wpacu_striped>tbody>:nth-child(odd),ul.wpacu_striped>:nth-child(odd){background-color:#f9f9f9!important}.wpacu_update_btn{-moz-box-shadow:inset 0 1px 0 0 #54a3f7!important;-webkit-box-shadow:inset 0 1px 0 0 #54a3f7!important;box-shadow:inset 0 1px 0 0 #54a3f7!important;background:-webkit-gradient(linear,left top,left bottom,color-stop(.05,#007dc1),color-stop(1,#0061a7))!important;background:-moz-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:-webkit-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:-o-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:-ms-linear-gradient(top,#007dc1 5%,#0061a7 100%)!important;background:linear-gradient(to bottom,#007dc1 5%,#0061a7 100%)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#007dc1', endColorstr='#0061a7', GradientType=0)!important;background-color:#007dc1!important;-moz-border-radius:3px!important;-webkit-border-radius:3px!important;border-radius:3px!important;border:1px solid #124d77!important;display:inline-block!important;cursor:pointer!important;color:#fff!important;font-size:15px!important;padding:10px 24px!important;text-decoration:none!important;text-shadow:0 1px 0 #154682!important;height:auto!important;line-height:normal!important}.wpacu-btns .btn:focus,.wpacu-btns .btn:hover,.wpacu-btns a{text-decoration:none}.wpacu_update_btn:hover{background:-webkit-gradient(linear,left top,left bottom,color-stop(.05,#0061a7),color-stop(1,#007dc1))!important;background:-moz-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:-webkit-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:-o-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:-ms-linear-gradient(top,#0061a7 5%,#007dc1 100%)!important;background:linear-gradient(to bottom,#0061a7 5%,#007dc1 100%)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0061a7', endColorstr='#007dc1', GradientType=0)!important;background-color:#0061a7!important}.wpacu_update_btn:active{position:relative!important;top:1px!important}ul.hire-reasons{margin-bottom:20px}ul.hire-reasons li{font-size:14px;line-height:22px;margin-bottom:12px}ul.hire-reasons li .dashicons{font-size:23px;line-height:23px}ul.hire-reasons li .dashicons.dashicons-yes{color:green}.wpacu-get-help-wrap p{font-size:14px}.wpacu-btns .btn{display:inline-block;font-weight:400;line-height:1.25;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.5rem 1rem;font-size:1rem;border-radius:.25rem;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wpacu-btns .btn.focus,.wpacu-btns .btn:focus{outline:0;-webkit-box-shadow:0 0 0 2px rgba(2,117,216,.25);box-shadow:0 0 0 2px rgba(2,117,216,.25)}.wpacu-btns .btn.disabled,.wpacu-btns .btn:disabled{cursor:not-allowed;opacity:.65}.wpacu-btns .btn.active,.wpacu-btns .btn:active{background-image:none}.wpacu-btns a.btn.disabled,.wpacu-btns fieldset[disabled] a.btn{pointer-events:none}.wpacu-btns .btn-primary{color:#fff;background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-primary:hover{color:#fff;background-color:#025aa5;border-color:#01549b}.wpacu-btns .btn-primary.focus,.wpacu-btns .btn-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(2,117,216,.5);box-shadow:0 0 0 2px rgba(2,117,216,.5)}.wpacu-btns .btn-primary.disabled,.wpacu-btns .btn-primary:disabled{background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-primary.active,.wpacu-btns .btn-primary:active,.wpacu-btns .show>.btn-primary.dropdown-toggle{color:#fff;background-color:#025aa5;background-image:none;border-color:#01549b}.wpacu-btns .btn-secondary{color:#292b2c;background-color:#fff;border-color:#ccc}.wpacu-btns .btn-secondary:hover{color:#292b2c;background-color:#e6e6e6;border-color:#adadad}.wpacu-btns .btn-secondary.focus,.wpacu-btns .btn-secondary:focus{-webkit-box-shadow:0 0 0 2px rgba(204,204,204,.5);box-shadow:0 0 0 2px rgba(204,204,204,.5)}.wpacu-btns .btn-secondary.disabled,.wpacu-btns .btn-secondary:disabled{background-color:#fff;border-color:#ccc}.wpacu-btns .btn-secondary.active,.wpacu-btns .btn-secondary:active,.wpacu-btns .show>.btn-secondary.dropdown-toggle{color:#292b2c;background-color:#e6e6e6;background-image:none;border-color:#adadad}.wpacu-btns .btn-info{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#2aabd2}.wpacu-btns .btn-info.focus,.wpacu-btns .btn-info:focus{-webkit-box-shadow:0 0 0 2px rgba(91,192,222,.5);box-shadow:0 0 0 2px rgba(91,192,222,.5)}.wpacu-btns .btn-info.disabled,.wpacu-btns .btn-info:disabled{background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-info.active,.wpacu-btns .btn-info:active,.wpacu-btns .show>.btn-info.dropdown-toggle{color:#fff;background-color:#31b0d5;background-image:none;border-color:#2aabd2}.wpacu-btns .btn-success{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-success:hover{color:#fff;background-color:#449d44;border-color:#419641}.wpacu-btns .btn-success.focus,.wpacu-btns .btn-success:focus{-webkit-box-shadow:0 0 0 2px rgba(92,184,92,.5);box-shadow:0 0 0 2px rgba(92,184,92,.5)}.wpacu-btns .btn-success.disabled,.wpacu-btns .btn-success:disabled{background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-success.active,.wpacu-btns .btn-success:active,.wpacu-btns .show>.btn-success.dropdown-toggle{color:#fff;background-color:#449d44;background-image:none;border-color:#419641}.wpacu-btns .btn-warning{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#eb9316}.wpacu-btns .btn-warning.focus,.wpacu-btns .btn-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(240,173,78,.5);box-shadow:0 0 0 2px rgba(240,173,78,.5)}.wpacu-btns .btn-warning.disabled,.wpacu-btns .btn-warning:disabled{background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-warning.active,.wpacu-btns .btn-warning:active,.wpacu-btns .show>.btn-warning.dropdown-toggle{color:#fff;background-color:#ec971f;background-image:none;border-color:#eb9316}.wpacu-btns .btn-danger{color:#fff;background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#c12e2a}.wpacu-btns .btn-danger.focus,.wpacu-btns .btn-danger:focus{-webkit-box-shadow:0 0 0 2px rgba(217,83,79,.5);box-shadow:0 0 0 2px rgba(217,83,79,.5)}.wpacu-btns .btn-danger.disabled,.wpacu-btns .btn-danger:disabled{background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-danger.active,.wpacu-btns .btn-danger:active,.wpacu-btns .show>.btn-danger.dropdown-toggle{color:#fff;background-color:#c9302c;background-image:none;border-color:#c12e2a}.wpacu-btns .btn-outline-primary{color:#0275d8;background-image:none;background-color:transparent;border-color:#0275d8}.wpacu-btns .btn-outline-primary:hover{color:#fff;background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-outline-primary.focus,.wpacu-btns .btn-outline-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(2,117,216,.5);box-shadow:0 0 0 2px rgba(2,117,216,.5)}.wpacu-btns .btn-outline-primary.disabled,.wpacu-btns .btn-outline-primary:disabled{color:#0275d8;background-color:transparent}.wpacu-btns .btn-outline-primary.active,.wpacu-btns .btn-outline-primary:active,.wpacu-btns .show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#0275d8;border-color:#0275d8}.wpacu-btns .btn-outline-secondary{color:#ccc;background-image:none;background-color:transparent;border-color:#ccc}.wpacu-btns .btn-outline-secondary:hover{color:#fff;background-color:#ccc;border-color:#ccc}.wpacu-btns .btn-outline-secondary.focus,.wpacu-btns .btn-outline-secondary:focus{-webkit-box-shadow:0 0 0 2px rgba(204,204,204,.5);box-shadow:0 0 0 2px rgba(204,204,204,.5)}.wpacu-btns .btn-outline-secondary.disabled,.wpacu-btns .btn-outline-secondary:disabled{color:#ccc;background-color:transparent}.wpacu-btns .btn-outline-secondary.active,.wpacu-btns .btn-outline-secondary:active,.wpacu-btns .show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#ccc;border-color:#ccc}.wpacu-btns .btn-outline-info{color:#5bc0de;background-image:none;background-color:transparent;border-color:#5bc0de}.wpacu-btns .btn-outline-info:hover{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-outline-info.focus,.wpacu-btns .btn-outline-info:focus{-webkit-box-shadow:0 0 0 2px rgba(91,192,222,.5);box-shadow:0 0 0 2px rgba(91,192,222,.5)}.wpacu-btns .btn-outline-info.disabled,.wpacu-btns .btn-outline-info:disabled{color:#5bc0de;background-color:transparent}.wpacu-btns .btn-outline-info.active,.wpacu-btns .btn-outline-info:active,.wpacu-btns .show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.wpacu-btns .btn-outline-success{color:#5cb85c;background-image:none;background-color:transparent;border-color:#5cb85c}.wpacu-btns .btn-outline-success:hover{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-outline-success.focus,.wpacu-btns .btn-outline-success:focus{-webkit-box-shadow:0 0 0 2px rgba(92,184,92,.5);box-shadow:0 0 0 2px rgba(92,184,92,.5)}.wpacu-btns .btn-outline-success.disabled,.wpacu-btns .btn-outline-success:disabled{color:#5cb85c;background-color:transparent}.wpacu-btns .btn-outline-success.active,.wpacu-btns .btn-outline-success:active,.wpacu-btns .show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.wpacu-btns .btn-outline-warning{color:#f0ad4e;background-image:none;background-color:transparent;border-color:#f0ad4e}.wpacu-btns .btn-outline-warning:hover{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-outline-warning.focus,.wpacu-btns .btn-outline-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(240,173,78,.5);box-shadow:0 0 0 2px rgba(240,173,78,.5)}.wpacu-btns .btn-outline-warning.disabled,.wpacu-btns .btn-outline-warning:disabled{color:#f0ad4e;background-color:transparent}.wpacu-btns .btn-outline-warning.active,.wpacu-btns .btn-outline-warning:active,.wpacu-btns .show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.wpacu-btns .btn-outline-danger{color:#d9534f;background-image:none;background-color:transparent;border-color:#d9534f}.wpacu-btns .btn-outline-danger:hover{color:#fff;background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-outline-danger.focus,.wpacu-btns .btn-outline-danger:focus{-webkit-box-shadow:0 0 0 2px rgba(217,83,79,.5);box-shadow:0 0 0 2px rgba(217,83,79,.5)}.wpacu-btns .btn-outline-danger.disabled,.wpacu-btns .btn-outline-danger:disabled{color:#d9534f;background-color:transparent}.wpacu-btns .btn-outline-danger.active,.wpacu-btns .btn-outline-danger:active,.wpacu-btns .show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#d9534f;border-color:#d9534f}.wpacu-btns .btn-link{font-weight:400;color:#0275d8;border-radius:0}.wpacu-btns .btn-link,.wpacu-btns .btn-link.active,.wpacu-btns .btn-link:active,.wpacu-btns .btn-link:disabled{background-color:transparent}.wpacu-btns .btn-link,.wpacu-btns .btn-link:active,.wpacu-btns .btn-link:focus,.wpacu-btns .btn-link:hover{border-color:transparent}.wpacu-btns .btn-link:focus,.wpacu-btns .btn-link:hover{color:#014c8c;text-decoration:underline;background-color:transparent}.wpacu-btns .btn-link:disabled{color:#636c72}.wpacu-btns .btn-link:disabled:focus,.wpacu-btns .btn-link:disabled:hover{text-decoration:none}.wpacu-btns .btn-group-lg>.btn,.wpacu-btns .btn-lg{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:.3rem}.wpacu-btns .btn-group-sm>.btn,.wpacu-btns .btn-sm{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.wpacu-btns .btn-block{display:block;width:100%}.wpacu-btns .btn-block+.btn-block{margin-top:.5rem}.wpacu-btns input[type=submit].btn-block,.wpacu-btns input[type=reset].btn-block,.wpacu-btns input[type=button].btn-block{width:100%}.wpacu-btns .fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}
assets/style.scss CHANGED
@@ -139,7 +139,7 @@ label {
139
font-weight: bold !important;
140
}
141
142
- &.wpacu_post_type_unload_active {
143
color: #d54e21;
144
}
145
}
@@ -161,6 +161,12 @@ ul.wpacu_asset_options {
161
li {
162
list-style: none;
163
display: inline-block;
164
}
165
label {
166
margin-right: 20px;
139
font-weight: bold !important;
140
}
141
142
+ &.wpacu_bulk_unload_active {
143
color: #d54e21;
144
}
145
}
161
li {
162
list-style: none;
163
display: inline-block;
164
+
165
+ &.remove_rule {
166
+ label {
167
+ font-weight: bold;
168
+ }
169
+ }
170
}
171
label {
172
margin-right: 20px;
classes/BulkUnloads.php CHANGED
@@ -51,7 +51,7 @@ class BulkUnloads
51
if ($this->wpacuFor === 'everywhere') {
52
$values = Main::instance()->getGlobalUnload();
53
} elseif ($this->wpacuFor === 'post_types') {
54
- $values = Main::instance()->getPostTypeUnload($this->wpacuPostType);
55
}
56
57
return $values;
51
if ($this->wpacuFor === 'everywhere') {
52
$values = Main::instance()->getGlobalUnload();
53
} elseif ($this->wpacuFor === 'post_types') {
54
+ $values = Main::instance()->getBulkUnload('post_type', $this->wpacuPostType);
55
}
56
57
return $values;
classes/Main.php CHANGED
@@ -222,11 +222,19 @@ class Main
222
return;
223
}
224
225
- $type = (Misc::isHomePage()) ? 'front_page' : 'post';
226
-
227
- if ($this->getCurrentPost()) {
228
- $post = $this->getCurrentPost();
229
- $this->postTypesUnloaded = $this->getPostTypeUnload($post->post_type);
230
}
231
232
$this->loadExceptions = $this->getLoadExceptions($type, $this->currentPostId);
@@ -331,7 +339,7 @@ class Main
331
// Any bulk unloaded styles (e.g. for all pages belonging to a post type)? Append them
332
if (empty($this->postTypesUnloaded)) {
333
$post = $this->getCurrentPost();
334
- $this->postTypesUnloaded = $this->getPostTypeUnload($post->post_type);
335
}
336
337
if (!empty($this->postTypesUnloaded['scripts'])) {
@@ -344,6 +352,8 @@ class Main
344
$list = array_unique($list);
345
}
346
347
// Let's see if there are load exceptions for this page
348
if (! empty($list) && ! empty($this->loadExceptions['scripts'])) {
349
foreach ($list as $handleKey => $handle) {
@@ -353,8 +363,6 @@ class Main
353
}
354
}
355
356
- $list = apply_filters('wpacu_filter_scripts', $list);
357
-
358
if (empty($list)) {
359
return;
360
}
@@ -413,7 +421,7 @@ class Main
413
if (! empty($globalUnload['styles']) && $nonAssetConfigPage) {
414
$list = $globalUnload['styles'];
415
} else {
416
- // Post, Page or Front-page
417
$toRemove = $this->getAssetsUnloaded();
418
419
$jsonList = @json_decode($toRemove);
@@ -435,7 +443,7 @@ class Main
435
// Any bulk unloaded styles (e.g. for all pages belonging to a post type)? Append them
436
if (empty($this->postTypesUnloaded)) {
437
$post = $this->getCurrentPost();
438
- $this->postTypesUnloaded = $this->getPostTypeUnload($post->post_type);
439
}
440
441
if (!empty($this->postTypesUnloaded['styles'])) {
@@ -448,6 +456,10 @@ class Main
448
$list = array_unique($list);
449
}
450
451
// Let's see if there are load exceptions for this page
452
if (! empty($list) && ! empty($this->loadExceptions['styles'])) {
453
foreach ($list as $handleKey => $handle) {
@@ -457,8 +469,6 @@ class Main
457
}
458
}
459
460
- $list = apply_filters('wpacu_filter_styles', $list);
461
-
462
if (empty($list)) {
463
return;
464
}
@@ -501,7 +511,7 @@ class Main
501
return $exceptionsListDefault;
502
}
503
504
- if (! in_array($type, array('post', 'front_page'))) {
505
// Invalid request
506
return $exceptionsListDefault;
507
}
@@ -513,7 +523,7 @@ class Main
513
514
// Post or Post of the Homepage (if chosen in the Dashboard)
515
if ($type == 'post'
516
- || $homepageClass->data['show_on_front'] === 'page'
517
) {
518
$exceptionsListJson = get_post_meta(
519
$postId, '_' . WPACU_PLUGIN_NAME . '_load_exceptions',
@@ -524,6 +534,11 @@ class Main
524
$exceptionsListJson = get_option(
525
WPACU_PLUGIN_NAME . '_front_page_load_exceptions'
526
);
527
}
528
529
if ($exceptionsListJson) {
@@ -534,6 +549,14 @@ class Main
534
}
535
}
536
537
return $exceptionsList;
538
}
539
@@ -559,13 +582,15 @@ class Main
559
return $existingList;
560
}
561
562
- /**
563
- * @param $postType
564
- * @return array
565
- */
566
- public function getPostTypeUnload($postType)
567
{
568
- $existingListEmpty = array();
569
570
$existingListAllJson = get_option(WPACU_PLUGIN_NAME.'_bulk_unload');
571
@@ -579,16 +604,16 @@ class Main
579
return $existingListEmpty;
580
}
581
582
- $existingList = array();
583
584
- if (isset($existingListAll['styles']['post_type'][$postType])
585
- && is_array($existingListAll['styles']['post_type'][$postType])) {
586
- $existingList['styles'] = $existingListAll['styles']['post_type'][$postType];
587
}
588
589
- if (isset($existingListAll['scripts']['post_type'][$postType])
590
- && is_array($existingListAll['scripts']['post_type'][$postType])) {
591
- $existingList['scripts'] = $existingListAll['scripts']['post_type'][$postType];
592
}
593
594
return $existingList;
@@ -672,9 +697,11 @@ class Main
672
}
673
}
674
675
- /*
676
- * Style List
677
- */
678
if (! empty($wp_styles)) {
679
/* These styles below are used by this plugin (except admin-bar) and they should not show in the list
680
as they are loaded only when you (or other admin) manage the assets, never for your website visitors */
@@ -779,7 +806,7 @@ class Main
779
$data = array(
780
'is_updateable' => true,
781
'post_type' => '',
782
- 'post_type_unloaded' => array()
783
);
784
785
if ($this->isUpdateable) {
@@ -799,7 +826,14 @@ class Main
799
800
$data['global_unload'] = $this->globalUnloaded;
801
802
- $type = Misc::getShowOnFront() ? 'front_page' : 'post';
803
804
$data['load_exceptions'] = $this->getLoadExceptions($type, $this->getCurrentPostId());
805
} else {
@@ -808,6 +842,10 @@ class Main
808
809
$data['is_woocommerce_shop_page'] = $this->isWooCommerceShopPage;
810
811
if ($this->isSingularPage()) {
812
$post = $this->getCurrentPost();
813
@@ -816,9 +854,17 @@ class Main
816
817
// Are there any assets unloaded for this specific post type?
818
// (e.g. page, post, product (from WooCommerce) or other custom post type)
819
- $data['post_type_unloaded'] = $this->getPostTypeUnload($data['post_type']);
820
}
821
822
$data['total_styles'] = (! empty($data['all']['styles'])) ? count($data['all']['styles']) : false;
823
$data['total_scripts'] = (! empty($data['all']['scripts'])) ? count($data['all']['scripts']) : false;
824
@@ -926,19 +972,31 @@ class Main
926
$data['fetch_url'] = $postUrl;
927
$data['global_unload'] = $this->getGlobalUnload();
928
929
// Post Information
930
- $postData = get_post($postId);
931
932
- // Current Post Type
933
- $data['post_type'] = $postData->post_type;
934
935
- // Are there any assets unloaded for this specific post type?
936
- // (e.g. page, post, product (from WooCommerce) or other custom post type)
937
- $data['post_type_unloaded'] = $this->getPostTypeUnload($data['post_type']);
938
939
- //echo '<pre>'; print_r($data['post_type_unloaded']);
940
941
- $type = ($postId == 0) ? 'front_page' : 'post';
942
943
$data['load_exceptions'] = $this->getLoadExceptions($type, $postId);
944
@@ -1085,6 +1143,9 @@ class Main
1085
}
1086
1087
/**
1088
* @param int $postId
1089
* @return string (The returned value must be a JSON one)
1090
*/
@@ -1105,8 +1166,9 @@ class Main
1105
$this->assetsRemoved = get_post_meta($postId, '_' . WPACU_PLUGIN_NAME . '_no_load', true);
1106
}
1107
1108
- // Premium Extension: Filter assets for pages such as category, tags, author, dates etc.
1109
- $this->assetsRemoved = apply_filters('wpacu_get_assets_unloaded', $this->assetsRemoved);
1110
1111
@json_decode($this->assetsRemoved);
1112
@@ -1144,6 +1206,8 @@ class Main
1144
// Only check option if function `is_shop` exists
1145
$wooCommerceShopPageId = function_exists('is_shop') ? get_option('woocommerce_shop_page_id') : 0;
1146
1147
if (function_exists('is_shop') && is_shop()) {
1148
$this->currentPostId = $wooCommerceShopPageId;
1149
@@ -1165,6 +1229,12 @@ class Main
1165
}
1166
}
1167
1168
if (is_singular() && ($this->currentPostId < 1)) {
1169
global $post;
1170
$this->currentPostId = isset($post->ID) ? $post->ID : 0;
222
return;
223
}
224
225
+ if (Misc::isHomePage()) {
226
+ $type = 'front_page';
227
+ } elseif ( ! empty($this->getCurrentPost()) ) {
228
+ $type = 'post';
229
+ $post = $this->getCurrentPost();
230
+ $this->postTypesUnloaded = $this->getBulkUnload('post_type', $post->post_type);
231
+ } elseif ($this->wpacuProEnabled()) {
232
+ $type = 'for_pro';
233
+ // $this->currentPostId should be 0 in this case
234
+ } else {
235
+ // The request is done for a page such as is_archive(), is_author(), 404, search
236
+ // and the premium extension is not available, thus no load exceptions are available
237
+ return;
238
}
239
240
$this->loadExceptions = $this->getLoadExceptions($type, $this->currentPostId);
339
// Any bulk unloaded styles (e.g. for all pages belonging to a post type)? Append them
340
if (empty($this->postTypesUnloaded)) {
341
$post = $this->getCurrentPost();
342
+ $this->postTypesUnloaded = $this->getBulkUnload('post_type', $post->post_type);
343
}
344
345
if (!empty($this->postTypesUnloaded['scripts'])) {
352
$list = array_unique($list);
353
}
354
355
+ $list = apply_filters('wpacu_filter_scripts', $list);
356
+
357
// Let's see if there are load exceptions for this page
358
if (! empty($list) && ! empty($this->loadExceptions['scripts'])) {
359
foreach ($list as $handleKey => $handle) {
363
}
364
}
365
366
if (empty($list)) {
367
return;
368
}
421
if (! empty($globalUnload['styles']) && $nonAssetConfigPage) {
422
$list = $globalUnload['styles'];
423
} else {
424
+ // Post, Page, Front-page and more (if the Premium Extension is activated)
425
$toRemove = $this->getAssetsUnloaded();
426
427
$jsonList = @json_decode($toRemove);
443
// Any bulk unloaded styles (e.g. for all pages belonging to a post type)? Append them
444
if (empty($this->postTypesUnloaded)) {
445
$post = $this->getCurrentPost();
446
+ $this->postTypesUnloaded = $this->getBulkUnload('post_type', $post->post_type);
447
}
448
449
if (!empty($this->postTypesUnloaded['styles'])) {
456
$list = array_unique($list);
457
}
458
459
+ // Any bulk unloaded styles for 'category', 'post_tag' and more?
460
+ // If the premium extension is enabled, any of the unloaded CSS will be added to the list
461
+ $list = apply_filters('wpacu_filter_styles', $list);
462
+
463
// Let's see if there are load exceptions for this page
464
if (! empty($list) && ! empty($this->loadExceptions['styles'])) {
465
foreach ($list as $handleKey => $handle) {
469
}
470
}
471
472
if (empty($list)) {
473
return;
474
}
511
return $exceptionsListDefault;
512
}
513
514
+ if (! $type) {
515
// Invalid request
516
return $exceptionsListDefault;
517
}
523
524
// Post or Post of the Homepage (if chosen in the Dashboard)
525
if ($type == 'post'
526
+ || ($homepageClass->data['show_on_front'] === 'page' && $postId)
527
) {
528
$exceptionsListJson = get_post_meta(
529
$postId, '_' . WPACU_PLUGIN_NAME . '_load_exceptions',
534
$exceptionsListJson = get_option(
535
WPACU_PLUGIN_NAME . '_front_page_load_exceptions'
536
);
537
+ } elseif (Main::wpacuProEnabled() && $type == 'for_pro') {
538
+ if (class_exists('\\WpAssetCleanUpPro\\Exceptions')) {
539
+ $ExceptionsPro = new \WpAssetCleanUpPro\Exceptions();
540
+ $exceptionsListJson = $ExceptionsPro->getLoadExceptions();
541
+ }
542
}
543
544
if ($exceptionsListJson) {
549
}
550
}
551
552
+ /*
553
+ if (! empty($_POST)) {
554
+ echo '<pre>';
555
+ print_r( $exceptionsList );
556
+ exit;
557
+ }
558
+ */
559
+
560
return $exceptionsList;
561
}
562
582
return $existingList;
583
}
584
585
+ /**
586
+ * @param string $for (could be 'post_type', 'taxonomy' for premium extension etc.)
587
+ * @param string $type
588
+ *
589
+ * @return array
590
+ */
591
+ public function getBulkUnload($for, $type = 'all')
592
{
593
+ $existingListEmpty = array('styles' => array(), 'scripts' => array());
594
595
$existingListAllJson = get_option(WPACU_PLUGIN_NAME.'_bulk_unload');
596
604
return $existingListEmpty;
605
}
606
607
+ $existingList = $existingListEmpty;
608
609
+ if (isset($existingListAll['styles'][$for][$type])
610
+ && is_array($existingListAll['styles'][$for][$type])) {
611
+ $existingList['styles'] = $existingListAll['styles'][$for][$type];
612
}
613
614
+ if (isset($existingListAll['scripts'][$for][$type])
615
+ && is_array($existingListAll['scripts'][$for][$type])) {
616
+ $existingList['scripts'] = $existingListAll['scripts'][$for][$type];
617
}
618
619
return $existingList;
697
}
698
}
699
700
+ $currentUnloadedAll = apply_filters('wpacu_pro_filter_all_bulk_unloads', $currentUnloadedAll);
701
+
702
+ /*
703
+ * Style List
704
+ */
705
if (! empty($wp_styles)) {
706
/* These styles below are used by this plugin (except admin-bar) and they should not show in the list
707
as they are loaded only when you (or other admin) manage the assets, never for your website visitors */
806
$data = array(
807
'is_updateable' => true,
808
'post_type' => '',
809
+ 'bulk_unloaded' => array('post_type' => array())
810
);
811
812
if ($this->isUpdateable) {
826
827
$data['global_unload'] = $this->globalUnloaded;
828
829
+ if (Misc::getShowOnFront()) {
830
+ $type = 'front_page';
831
+ } elseif ($this->getCurrentPostId() > 0) {
832
+ $type = 'post';
833
+ } else {
834
+ // $this->getCurrentPostId() would be 0
835
+ $type = 'for_pro';
836
+ }
837
838
$data['load_exceptions'] = $this->getLoadExceptions($type, $this->getCurrentPostId());
839
} else {
842
843
$data['is_woocommerce_shop_page'] = $this->isWooCommerceShopPage;
844
845
+ $data['is_bulk_unloadable'] = $data['bulk_unloaded_type'] = false;
846
+
847
+ $data['bulk_unloaded']['post_type'] = array('styles' => array(), 'scripts' => array());
848
+
849
if ($this->isSingularPage()) {
850
$post = $this->getCurrentPost();
851
854
855
// Are there any assets unloaded for this specific post type?
856
// (e.g. page, post, product (from WooCommerce) or other custom post type)
857
+ $data['bulk_unloaded']['post_type'] = $this->getBulkUnload('post_type', $data['post_type']);
858
+
859
+ $data['bulk_unloaded_type'] = 'post_type';
860
+
861
+ $data['is_bulk_unloadable'] = true;
862
}
863
864
+ // If the premium extension is enabled, it will also pull the other bulk unloads
865
+ // such as 'taxonomy', 'author' etc.
866
+ $data = apply_filters('wpacu_pro_get_bulk_unloads', $data);
867
+
868
$data['total_styles'] = (! empty($data['all']['styles'])) ? count($data['all']['styles']) : false;
869
$data['total_scripts'] = (! empty($data['all']['scripts'])) ? count($data['all']['scripts']) : false;
870
972
$data['fetch_url'] = $postUrl;
973
$data['global_unload'] = $this->getGlobalUnload();
974
975
+ $data['is_bulk_unloadable'] = $data['bulk_unloaded_type'] = false;
976
+
977
// Post Information
978
+ if ($postId > 0) {
979
+ $postData = get_post( $postId );
980
981
+ // Current Post Type
982
+ $data['post_type'] = $postData->post_type;
983
984
+ // Are there any assets unloaded for this specific post type?
985
+ // (e.g. page, post, product (from WooCommerce) or other custom post type)
986
+ $data['bulk_unloaded']['post_type'] = $this->getBulkUnload('post_type', $data['post_type']);
987
+ $data['bulk_unloaded_type'] = 'post_type';
988
+ $data['is_bulk_unloadable'] = true;
989
+ }
990
991
+ //echo '<pre>'; print_r($data['bulk_unloaded']['post_type']);
992
993
+ if($postId == 0) {
994
+ $type = 'front_page';
995
+ } elseif ($postId > 0) {
996
+ $type = 'post';
997
+ } else {
998
+ $type = 'for_pro';
999
+ }
1000
1001
$data['load_exceptions'] = $this->getLoadExceptions($type, $postId);
1002
1143
}
1144
1145
/**
1146
+ * This method retrieves only the assets that are unloaded per page
1147
+ * Including 404, date and search pages (they are considered as ONE page with the same rules for any URL variation)
1148
+ *
1149
* @param int $postId
1150
* @return string (The returned value must be a JSON one)
1151
*/
1166
$this->assetsRemoved = get_post_meta($postId, '_' . WPACU_PLUGIN_NAME . '_no_load', true);
1167
}
1168
1169
+ // Premium Extension: Filter assets for pages such as category, tag, author, dates etc.
1170
+ // Retrieves "per page" list of unloaded CSS and JavaScript
1171
+ $this->assetsRemoved = apply_filters('wpacu_pro_get_assets_unloaded', $this->assetsRemoved);
1172
1173
@json_decode($this->assetsRemoved);
1174
1206
// Only check option if function `is_shop` exists
1207
$wooCommerceShopPageId = function_exists('is_shop') ? get_option('woocommerce_shop_page_id') : 0;
1208
1209
+ // Check if we are on the WooCommerce Shop Page
1210
+ // Do not mix the WooCommerce Search Page with the Shop Page
1211
if (function_exists('is_shop') && is_shop()) {
1212
$this->currentPostId = $wooCommerceShopPageId;
1213
1229
}
1230
}
1231
1232
+ // Blog Home Page (aka: Posts page) is not a singular page, it's checked separately
1233
+ if (Misc::isBlogPage()) {
1234
+ $this->currentPostId = get_option('page_for_posts');
1235
+ }
1236
+
1237
+ // It has to be a single page (no "Posts page")
1238
if (is_singular() && ($this->currentPostId < 1)) {
1239
global $post;
1240
$this->currentPostId = isset($post->ID) ? $post->ID : 0;
classes/Misc.php CHANGED
@@ -132,17 +132,60 @@ class Misc
132
*/
133
public static function isHomePage()
134
{
135
- // "Your latest posts" -> sometimes it works as is_front_page(), sometimes as is_home())
136
- // "A static page (select below)" -> In this case is_front_page() should work
137
138
- // Sometimes neither of these two options are selected
139
- // (it happens with some themes that have an incorporated page builder)
140
- // and is_home() tends to work fine
141
142
- // Both will be used to be sure the home page is detected
143
- $homePage = (is_front_page() || is_home());
144
145
- return apply_filters('wpacu_home_page', $homePage);
146
}
147
148
/**
132
*/
133
public static function isHomePage()
134
{
135
+ // Docs: https://codex.wordpress.org/Conditional_Tags
136
137
+ // "Your latest posts" -> sometimes it works as is_front_page(), sometimes as is_home())
138
+ // "A static page (select below)" -> In this case is_front_page() should work
139
140
+ // Sometimes neither of these two options are selected
141
+ // (it happens with some themes that have an incorporated page builder)
142
+ // and is_home() tends to work fine
143
144
+ // Both will be used to be sure the home page is detected
145
+
146
+ // VARIOUS SCENARIOS for "Your homepage displays" option from Settings -> Reading
147
+
148
+ // 1) "Your latest posts" is selected
149
+ if (self::getShowOnFront() === 'posts' && is_front_page()) {
150
+ // Default homepage
151
+ return true;
152
+ }
153
+
154
+ // 2) "A static page (select below)" is selected
155
+
156
+ // Note: Either "Homepage:" or "Posts page:" need to have a value set
157
+ // Otherwise, it will default to "Your latest posts", the other choice from "Your homepage displays"
158
+
159
+ if (self::getShowOnFront() === 'page') {
160
+ $pageOnFront = get_option('page_on_front');
161
+
162
+ // "Homepage:" has a value
163
+ if ($pageOnFront > 0 && is_front_page()) {
164
+ // Static Homepage
165
+ return true;
166
+ }
167
+
168
+ // "Homepage:" has no value
169
+ if (! $pageOnFront && self::isBlogPage()) {
170
+ // Blog page
171
+ return true;
172
+ }
173
+
174
+ // Another scenario is when both 'Homepage:' and 'Posts page:' have values
175
+ // If we are on the blog page (which is "Posts page:" value), then it will return false
176
+ // As it's not the main page of the website
177
+ // e.g. Main page: www.yoursite.com - Blog page: www.yoursite.com/blog/
178
+ }
179
+
180
+ return false;
181
+ }
182
+
183
+ /**
184
+ * @return bool
185
+ */
186
+ public static function isBlogPage()
187
+ {
188
+ return (is_home() && !is_front_page());
189
}
190
191
/**
classes/Update.php CHANGED
@@ -32,6 +32,7 @@ class Update
32
33
/**
34
* Priority: 9 (AFTER current post ID is correctly retrieved and BEFORE the data from the database is fetched)
35
*/
36
public function frontendUpdate()
37
{
@@ -58,7 +59,7 @@ class Update
58
}
59
60
if (! wp_verify_nonce($_POST[$nonceName], $nonceAction)) {
61
- $postUrlAnchor = get_permalink($postId).'#wpacu_wrap_assets';
62
wp_die(
63
sprintf(
64
__('The nonce expired or is not correct, thus the request was not processed. %sPlease retry%s.', WPACU_PLUGIN_NAME),
@@ -85,6 +86,9 @@ class Update
85
$this->savePost($post->ID, $post);
86
return;
87
}
88
}
89
90
/**
@@ -98,6 +102,12 @@ class Update
98
*/
99
public function savePost($postId, $post = array())
100
{
101
if (empty($post)) {
102
global $post;
103
}
@@ -148,26 +158,8 @@ class Update
148
// If globally disabled, make exception to load for submitted assets
149
$this->saveLoadExceptions('post', $postId);
150
151
- /*
152
- * Any global (all pages / everywhere) UNLOADS?
153
- * Coming from a POST request
154
- */
155
- $reqStyles = (isset($_POST['wpacu_global_unload_styles']) && is_array($_POST['wpacu_global_unload_styles']))
156
- ? $_POST['wpacu_global_unload_styles'] : array();
157
-
158
- $reqScripts = (isset($_POST['wpacu_global_unload_scripts']) && is_array($_POST['wpacu_global_unload_scripts']))
159
- ? $_POST['wpacu_global_unload_scripts'] : array();
160
-
161
- $this->saveToEverywhereUnloads($reqStyles, $reqScripts);
162
-
163
- /*
164
- * Any global (all pages / everywhere) REMOVED?
165
- * Coming from a POST request
166
- */
167
- $stylesList = isset($_POST['wpacu_options_styles']) ? $_POST['wpacu_options_styles'] : array();
168
- $scriptsList = isset($_POST['wpacu_options_scripts']) ? $_POST['wpacu_options_scripts'] : array();
169
-
170
- $this->removeEverywhereUnloads($stylesList, $scriptsList);
171
172
// Any bulk unloads or removed? (e.g. all pages of a certain post type)
173
$this->saveToBulkUnloads();
@@ -192,44 +184,27 @@ class Update
192
// If globally disabled, make exception to load for submitted assets
193
$this->saveLoadExceptions('front_page');
194
195
- /*
196
- * Any global (all pages / everywhere) UNLOADS?
197
- */
198
- $reqStyles = (isset($_POST['wpacu_global_unload_styles']) && is_array($_POST['wpacu_global_unload_styles']))
199
- ? $_POST['wpacu_global_unload_styles'] : array();
200
-
201
- $reqScripts = (isset($_POST['wpacu_global_unload_scripts']) && is_array($_POST['wpacu_global_unload_scripts']))
202
- ? $_POST['wpacu_global_unload_scripts'] : array();
203
-
204
- $this->saveToEverywhereUnloads($reqStyles, $reqScripts);
205
-
206
- /*
207
- * Any global (all pages / everywhere) REMOVED?
208
- */
209
- $stylesList = isset($_POST['wpacu_options_styles']) ? $_POST['wpacu_options_styles'] : array();
210
- $scriptsList = isset($_POST['wpacu_options_scripts']) ? $_POST['wpacu_options_scripts'] : array();
211
-
212
- $this->removeEverywhereUnloads($stylesList, $scriptsList);
213
}
214
215
- /**
216
- * @param string $type
217
- * @param string $postId
218
- * @return bool
219
- */
220
- public function saveLoadExceptions($type = 'post', $postId = '')
221
{
222
if ($type == 'post' && !$postId) {
223
// $postId needs to have a value if $type is a 'post' type
224
- return false;
225
- }
226
-
227
- if (! in_array($type, array('post', 'front_page'))) {
228
- // Invalid request
229
- return false;
230
}
231
232
- // Any global upload options
233
$isPostOptionStyles = (isset($_POST['wpacu_styles_load_it']) && ! empty($_POST['wpacu_styles_load_it']));
234
$isPostOptionScripts = (isset($_POST['wpacu_scripts_load_it']) && ! empty($_POST['wpacu_scripts_load_it']));
235
@@ -240,10 +215,13 @@ class Update
240
delete_post_meta($postId, '_' . WPACU_PLUGIN_NAME . '_load_exceptions');
241
} elseif ($type == 'front_page') {
242
delete_option(WPACU_PLUGIN_NAME . '_front_page_load_exceptions');
243
}
244
245
if (! $isPostOptionStyles && ! $isPostOptionScripts) {
246
- return false;
247
}
248
249
// Load Exception
@@ -302,10 +280,40 @@ class Update
302
}
303
} elseif ($type == 'front_page') {
304
update_option(WPACU_PLUGIN_NAME . '_front_page_load_exceptions', $jsonLoadExceptions);
305
}
306
}
307
}
308
309
/**
310
* @param array $reqStyles
311
* @param array $reqScripts
@@ -420,14 +428,19 @@ class Update
420
return $isUpdated;
421
}
422
423
- /**
424
- *
425
- */
426
- public function saveToBulkUnloads()
427
{
428
- global $post;
429
430
- $postType = $post->post_type;
431
432
$postStyles = (isset($_POST['wpacu_bulk_unload_styles']) && is_array($_POST['wpacu_bulk_unload_styles']))
433
? $_POST['wpacu_bulk_unload_styles'] : array();
@@ -501,8 +514,12 @@ class Update
501
if (! $postType) {
502
global $post;
503
504
- // At this time (12 Nov 2016) post type unload is the only option in bulk unloads
505
- $postType = $post->post_type;
506
}
507
508
$stylesList = isset($_POST['wpacu_options_post_type_styles'])
32
33
/**
34
* Priority: 9 (AFTER current post ID is correctly retrieved and BEFORE the data from the database is fetched)
35
+ * Form was submitted in the frontend view (not Dashboard) from a singular page, front-page etc.
36
*/
37
public function frontendUpdate()
38
{
59
}
60
61
if (! wp_verify_nonce($_POST[$nonceName], $nonceAction)) {
62
+ $postUrlAnchor = $_SERVER['REQUEST_URI'].'#wpacu_wrap_assets';
63
wp_die(
64
sprintf(
65
__('The nonce expired or is not correct, thus the request was not processed. %sPlease retry%s.', WPACU_PLUGIN_NAME),
86
$this->savePost($post->ID, $post);
87
return;
88
}
89
+
90
+ // Form Submitted from a page such as taxonomy (e.g. 'category'), author page, 404 page, search page etc.
91
+ do_action('wpacu_pro_frontend_update');
92
}
93
94
/**
102
*/
103
public function savePost($postId, $post = array())
104
{
105
+ // This is triggered only if the "WP Asset CleanUp" meta box was loaded with the list of assets
106
+ // Otherwise, $_POST[WPACU_PLUGIN_NAME] will be taken as empty which might be not if there are values in the database
107
+ if (! (isset($_POST['wpacu_unload_assets_area_loaded']) && $_POST['wpacu_unload_assets_area_loaded'])) {
108
+ return;
109
+ }
110
+
111
if (empty($post)) {
112
global $post;
113
}
158
// If globally disabled, make exception to load for submitted assets
159
$this->saveLoadExceptions('post', $postId);
160
161
+ // Add / Remove Site-wide Unloads
162
+ $this->updateEverywhereUnloads();
163
164
// Any bulk unloads or removed? (e.g. all pages of a certain post type)
165
$this->saveToBulkUnloads();
184
// If globally disabled, make exception to load for submitted assets
185
$this->saveLoadExceptions('front_page');
186
187
+ // Add / Remove Site-wide Unloads
188
+ $this->updateEverywhereUnloads();
189
}
190
191
+ /**
192
+ * Lite: For Singular Page (Post, Page, Custom Post Type) and Front Page (Home Page)
193
+ * Pro: 'for_pro' would trigger the actions from the premium extension (if available)
194
+ *
195
+ * This is the function that clears and updates the load exceptions for any of the requested pages
196
+ *
197
+ * @param string $type
198
+ * @param string $postId
199
+ */
200
+ public function saveLoadExceptions($type = 'post', $postId = '')
201
{
202
if ($type == 'post' && !$postId) {
203
// $postId needs to have a value if $type is a 'post' type
204
+ return;
205
}
206
207
+ // Any load exceptions?
208
$isPostOptionStyles = (isset($_POST['wpacu_styles_load_it']) && ! empty($_POST['wpacu_styles_load_it']));
209
$isPostOptionScripts = (isset($_POST['wpacu_scripts_load_it']) && ! empty($_POST['wpacu_scripts_load_it']));
210
215
delete_post_meta($postId, '_' . WPACU_PLUGIN_NAME . '_load_exceptions');
216
} elseif ($type == 'front_page') {
217
delete_option(WPACU_PLUGIN_NAME . '_front_page_load_exceptions');
218
+ } elseif ($type == 'for_pro') {
219
+ // Premium Extensions: Clear existing list for pages like: taxonomy, 404, search, date etc.
220
+ do_action( 'wpacu_pro_clear_load_exceptions' );
221
}
222
223
if (! $isPostOptionStyles && ! $isPostOptionScripts) {
224
+ return;
225
}
226
227
// Load Exception
280
}
281
} elseif ($type == 'front_page') {
282
update_option(WPACU_PLUGIN_NAME . '_front_page_load_exceptions', $jsonLoadExceptions);
283
+ } else {
284
+ // Premium Extensions: Update any load extensions for pages like: taxonomy, 404, search, date etc.
285
+ do_action( 'wpacu_pro_update_load_exceptions', $jsonLoadExceptions );
286
}
287
}
288
}
289
290
+ /**
291
+ * Triggers either "saveToEverywhereUnloads" or "removeEverywhereUnloads" methods
292
+ */
293
+ public function updateEverywhereUnloads()
294
+ {
295
+ /*
296
+ * Any global (all pages / everywhere) UNLOADS?
297
+ * Coming from a POST request
298
+ */
299
+ $reqStyles = (isset($_POST['wpacu_global_unload_styles']) && is_array($_POST['wpacu_global_unload_styles']))
300
+ ? $_POST['wpacu_global_unload_styles'] : array();
301
+
302
+ $reqScripts = (isset($_POST['wpacu_global_unload_scripts']) && is_array($_POST['wpacu_global_unload_scripts']))
303
+ ? $_POST['wpacu_global_unload_scripts'] : array();
304
+
305
+ $this->saveToEverywhereUnloads($reqStyles, $reqScripts);
306
+
307
+ /*
308
+ * Any global (all pages / everywhere) REMOVED?
309
+ * Coming from a POST request
310
+ */
311
+ $stylesList = isset($_POST['wpacu_options_styles']) ? $_POST['wpacu_options_styles'] : array();
312
+ $scriptsList = isset($_POST['wpacu_options_scripts']) ? $_POST['wpacu_options_scripts'] : array();
313
+
314
+ $this->removeEverywhereUnloads($stylesList, $scriptsList);
315
+ }
316
+
317
/**
318
* @param array $reqStyles
319
* @param array $reqScripts
428
return $isUpdated;
429
}
430
431
+ /**
432
+ *
433
+ */
434
+ public function saveToBulkUnloads()
435
{
436
+ global $post;
437
+
438
+ $postType = isset( $post->post_type ) ? $post->post_type : false;
439
440
+ // Free Version: It only deals with 'post_type' bulk unloads
441
+ if ( ! $postType ) {
442
+ return;
443
+ }
444
445
$postStyles = (isset($_POST['wpacu_bulk_unload_styles']) && is_array($_POST['wpacu_bulk_unload_styles']))
446
? $_POST['wpacu_bulk_unload_styles'] : array();
514
if (! $postType) {
515
global $post;
516
517
+ // In the lite version, post type unload is the only option for bulk unloads
518
+ $postType = isset($post->post_type) ? $post->post_type : false;
519
+
520
+ if (! $postType) {
521
+ return false;
522
+ }
523
}
524
525
$stylesList = isset($_POST['wpacu_options_post_type_styles'])
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
=== WP Asset CleanUp (Page Speed Optimizer) ===
2
Contributors: gabelivan
3
Tags: speed, pagespeed, dequeue style, dequeue script, unload style, unload script, disable emojis
4
- Donate link: https://www.gabelivan.com/donate/
5
Requires at least: 4.0
6
Tested up to: 4.9.6
7
- Stable tag: 1.2.6.3
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
@@ -102,6 +102,9 @@ If that's the case, then it's advisable to consult with a developer (ideally the
102
4. Scripts (.JS) are selected for site-wide unload
103
104
== Changelog ==
105
= 1.2.6.3 =
106
* Bug Fix: On some environments, a fatal error shows when activating the plugin (the issue was posted on the support and the ticket solved)
107
1
=== WP Asset CleanUp (Page Speed Optimizer) ===
2
Contributors: gabelivan
3
Tags: speed, pagespeed, dequeue style, dequeue script, unload style, unload script, disable emojis
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7GJZCW6RD8ECS
5
Requires at least: 4.0
6
Tested up to: 4.9.6
7
+ Stable tag: 1.2.6.4
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
102
4. Scripts (.JS) are selected for site-wide unload
103
104
== Changelog ==
105
+ = 1.2.6.4 =
106
+ * Bug Fix: When editing a post/page within the Dashboard and the "Update" button was pressed before the "WP Asset CleanUp" meta box was loading, it sent an empty unloaded list to the plugin and it deleted the current settings for that particular post/page
107
+
108
= 1.2.6.3 =
109
* Bug Fix: On some environments, a fatal error shows when activating the plugin (the issue was posted on the support and the ticket solved)
110
templates/meta-box-loaded.php CHANGED
@@ -6,6 +6,53 @@
6
if (! isset($data)) {
7
exit;
8
}
9
if (! is_404()) {
10
?>
11
<div class="wpacu_verified">
@@ -22,12 +69,12 @@ if (! is_404()) {
22
*/
23
?>
24
25
- <h3><?php _e('Styles (.css files)', WPACU_PLUGIN_NAME); ?></h3>
26
27
<?php
28
if ($data['total_styles']) {
29
?>
30
- <h4>&#10141; Total enqueued files: <strong><?php echo $data['total_styles']; ?></strong></h4>
31
<?php
32
}
33
?>
@@ -60,7 +107,11 @@ if (! empty($data['all']['styles'])) {
60
$class = ($active) ? 'wpacu_not_load' : '';
61
$checked = ($active) ? 'checked="checked"' : '';
62
63
- $globalUnloaded = $postTypeUnloaded = $isLoadException = $isGlobalRule = false;
64
65
// Mark it as unloaded - Everywhere
66
if (in_array($obj->handle, $data['global_unload']['styles'])) {
@@ -68,10 +119,17 @@ if (! empty($data['all']['styles'])) {
68
}
69
70
// Mark it as unloaded - for the Current Post Type
71
- if (isset($data['post_type_unloaded']['styles']) && in_array($obj->handle, $data['post_type_unloaded']['styles'])) {
72
- $postTypeUnloaded = $isGlobalRule = true;
73
}
74
75
if ($isGlobalRule) {
76
if (in_array($obj->handle, $data['load_exceptions']['styles'])) {
77
$isLoadException = true;
@@ -107,7 +165,7 @@ if (! empty($data['all']['styles'])) {
107
// Unloaded Everywhere
108
if ($globalUnloaded) {
109
?>
110
- <p><strong style="color: #d54e21;">This asset is unloaded everywhere</strong></p>
111
<div class="clear"></div>
112
<?php
113
}
@@ -153,67 +211,75 @@ if (! empty($data['all']['styles'])) {
153
</ul>
154
</div>
155
156
- <?php if ($data['post_type']) { ?>
157
<div style="padding: 5px 10px; margin: 15px 0; background: white; border: 1px solid #eee; border-radius: 5px;">
158
<?php } ?>
159
160
<?php
161
// Unloaded On All Pages Belonging to the page's Post Type
162
- if ($postTypeUnloaded) {
163
?>
164
- <p><strong style="color: #d54e21;">This asset is unloaded on all <u><?php echo $data['post_type']; ?></u> post types.</strong></p>
165
<div class="clear"></div>
166
<?php
167
}
168
?>
169
170
- <ul class="wpacu_asset_options">
171
<?php
172
- if ($data['post_type']) {
173
- // [START] ALL PAGES HAVING THE SAME POST TYPE
174
- if ($postTypeUnloaded) {
175
- ?>
176
- <li>
177
- <label><input data-handle="<?php echo $obj->handle; ?>"
178
- class="wpacu_bulk_option wpacu_style"
179
- type="radio"
180
- name="wpacu_options_post_type_styles[<?php echo $obj->handle; ?>]"
181
- checked="checked"
182
- value="default"/>
183
- Keep rule</label>
184
- </li>
185
-
186
- <li>
187
- <label><input data-handle="<?php echo $obj->handle; ?>"
188
- class="wpacu_bulk_option wpacu_style"
189
- type="radio"
190
- name="wpacu_options_post_type_styles[<?php echo $obj->handle; ?>]"
191
- value="remove"/>
192
- Remove rule</label>
193
- </li>
194
<?php
195
- } else {
196
?>
197
- <li>
198
- <label><input data-handle="<?php echo $obj->handle; ?>"
199
- class="wpacu_post_type_unload wpacu_post_type_style"
200
- id="wpacu_bulk_unload_post_type_style_<?php echo $obj->handle; ?>"
201
- type="checkbox"
202
- name="wpacu_bulk_unload_styles[post_type][<?php echo $data['post_type']; ?>][]"
203
- value="<?php echo $obj->handle; ?>"/>
204
- Unload on All Pages of <strong><?php echo $data['post_type']; ?></strong> post type</label>
205
- </li>
206
<?php
207
- }
208
}
209
// [END] ALL PAGES HAVING THE SAME POST TYPE
210
?>
211
- </ul>
212
213
- <?php if ($data['post_type']) { ?>
214
</div>
215
<?php } ?>
216
217
<ul class="wpacu_asset_options">
218
<li id="wpacu_load_it_option_style_<?php echo $obj->handle; ?>">
219
<label><input data-handle="<?php echo $obj->handle; ?>"
@@ -269,12 +335,12 @@ if (! empty($data['all']['styles'])) {
269
* ---------------------
270
*/
271
?>
272
- <h3><?php _e('Scripts (.js files)', WPACU_PLUGIN_NAME); ?></h3>
273
274
<?php
275
if ($data['total_scripts']) {
276
?>
277
- <h4>&#10141; Total enqueued files: <strong><?php echo $data['total_scripts']; ?></strong></h4>
278
<?php
279
}
280
?>
@@ -307,7 +373,10 @@ if (! empty($data['all']['scripts'])) {
307
$class = ($active) ? 'wpacu_not_load' : '';
308
$checked = ($active) ? 'checked="checked"' : '';
309
310
- $globalUnloaded = $postTypeUnloaded = $isLoadException = $isGlobalRule = false;
311
312
// Mark it as unloaded - Everywhere
313
if (in_array($obj->handle, $data['global_unload']['scripts']) && !$class) {
@@ -315,9 +384,13 @@ if (! empty($data['all']['scripts'])) {
315
}
316
317
// Mark it as unloaded - for the Current Post Type
318
- if (isset($data['post_type_unloaded']['scripts']) && in_array($obj->handle, $data['post_type_unloaded']['scripts']) && !$class) {
319
- $postTypeUnloaded = $isGlobalRule = true;
320
- }
321
322
if ($isGlobalRule) {
323
if (in_array($obj->handle, $data['load_exceptions']['scripts'])) {
@@ -346,7 +419,7 @@ if (! empty($data['all']['scripts'])) {
346
// Unloaded Everywhere
347
if ($globalUnloaded) {
348
?>
349
- <p><strong style="color: #d54e21;">This asset is unloaded everywhere</strong></p>
350
<?php
351
}
352
?>
@@ -403,15 +476,15 @@ if (! empty($data['all']['scripts'])) {
403
</ul>
404
</div>
405
406
- <?php if ($data['post_type']) { ?>
407
<div style="padding: 5px 10px; margin: 15px 0; background: white; border: 1px solid #eee; border-radius: 5px;">
408
<?php } ?>
409
410
<?php
411
// Unloaded On All Pages Belonging to the page's Post Type
412
- if ($postTypeUnloaded) {
413
?>
414
- <p><strong style="color: #d54e21;">This asset is unloaded on all <u><?php echo $data['post_type']; ?></u> post types.</strong></p>
415
<div class="clear"></div>
416
<?php
417
}
@@ -419,13 +492,13 @@ if (! empty($data['all']['scripts'])) {
419
420
<ul class="wpacu_asset_options">
421
<?php
422
- if ($data['post_type']) {
423
// [START] ALL PAGES HAVING THE SAME POST TYPE
424
- if ($postTypeUnloaded) {
425
?>
426
<li>
427
<label><input data-handle="<?php echo $obj->handle; ?>"
428
- class="wpacu_post_type_option wpacu_post_type_script"
429
type="radio"
430
name="wpacu_options_post_type_scripts[<?php echo $obj->handle; ?>]"
431
checked="checked"
@@ -435,7 +508,7 @@ if (! empty($data['all']['scripts'])) {
435
436
<li>
437
<label><input data-handle="<?php echo $obj->handle; ?>"
438
- class="wpacu_post_type_option wpacu_post_type_script"
439
type="radio"
440
name="wpacu_options_post_type_scripts[<?php echo $obj->handle; ?>]"
441
value="remove"/>
@@ -446,7 +519,7 @@ if (! empty($data['all']['scripts'])) {
446
?>
447
<li>
448
<label><input data-handle="<?php echo $obj->handle; ?>"
449
- class="wpacu_post_type_unload wpacu_post_type_script"
450
id="wpacu_global_unload_post_type_script_<?php echo $obj->handle; ?>"
451
type="checkbox"
452
name="wpacu_bulk_unload_scripts[post_type][<?php echo $data['post_type']; ?>][]"
@@ -459,10 +532,14 @@ if (! empty($data['all']['scripts'])) {
459
// [END] ALL PAGES HAVING THE SAME POST TYPE
460
?>
461
</ul>
462
- <?php if ($data['post_type']) { ?>
463
</div>
464
<?php } ?>
465
466
<ul class="wpacu_asset_options">
467
<li id="wpacu_load_it_option_script_<?php echo $obj->handle; ?>">
468
<label><input data-handle="<?php echo $obj->handle; ?>"
@@ -521,3 +598,8 @@ if (! empty($data['all']['scripts'])) {
521
* [END] SCRIPTS LIST
522
* -------------------
523
*/
6
if (! isset($data)) {
7
exit;
8
}
9
+
10
+ if (\WpAssetCleanUp\Misc::isHomePage()) {
11
+ ?>
12
+ <p><strong><span style="color: #0f6cab;" class="dashicons dashicons-admin-home"></span> You are currently viewing the home page.</strong></p>
13
+ <?php
14
+ }
15
+
16
+ elseif (\WpAssetCleanUp\Misc::isBlogPage()) {
17
+ ?>
18
+ <p><strong><span style="color: #0f6cab;" class="dashicons dashicons-admin-post"></span> You are currently viewing the page that shows your latest posts.</strong></p>
19
+ <?php
20
+ }
21
+
22
+ elseif ($data['bulk_unloaded_type'] === 'post_type') {
23
+ $isWooPage = $iconShown = false;
24
+
25
+ if (function_exists('is_woocommerce')
26
+ && (is_woocommerce() || is_cart() || is_product_tag() || is_product_category() || is_checkout())
27
+ ) {
28
+ $isWooPage = true;
29
+ $iconShown = WPACU_PLUGIN_URL . '/assets/icons/woocommerce-icon-logo.svg';
30
+ }
31
+
32
+ if (! $iconShown) {
33
+ switch ( $data['post_type'] ) {
34
+ case 'post':
35
+ $dashIconPart = 'post';
36
+ break;
37
+ case 'page':
38
+ $dashIconPart = 'page';
39
+ break;
40
+ case 'attachment':
41
+ $dashIconPart = 'media';
42
+ break;
43
+ default:
44
+ $dashIconPart = 'post';
45
+ }
46
+ }
47
+ ?>
48
+ <p>
49
+ <?php if ($isWooPage) { ?>
50
+ <img src="<?php echo $iconShown; ?>" alt="" style="height: 40px !important; margin-top: -6px; margin-right: 5px;" align="middle" /> <strong>WooCommerce</strong>
51
+ <?php } ?>
52
+ <strong><?php if (! $iconShown) { ?><span style="color: #0f6cab;" class="dashicons dashicons-admin-<?php echo $dashIconPart; ?>"></span> <?php } ?> <u><?php echo $data['post_type']; ?></u> <?php if ($data['post_type'] !== 'post') { echo 'post'; } ?> type.</strong></p>
53
+ <?php
54
+ }
55
+
56
if (! is_404()) {
57
?>
58
<div class="wpacu_verified">
69
*/
70
?>
71
72
+ <h3><span style="font-size: 120%; line-height: 130%;" class="dashicons dashicons-admin-appearance"></span> &nbsp; <?php _e('Styles (.css files)', WPACU_PLUGIN_NAME); ?></h3>
73
74
<?php
75
if ($data['total_styles']) {
76
?>
77
+ <h4>&#10141; Total enqueued stylesheets: <strong><?php echo $data['total_styles']; ?></strong></h4>
78
<?php
79
}
80
?>
107
$class = ($active) ? 'wpacu_not_load' : '';
108
$checked = ($active) ? 'checked="checked"' : '';
109
110
+ /*
111
+ * $isGlobalRule is only used to apply a red background in the style's area to point out that the style is unloaded
112
+ * is set to `true` if either the asset is unloaded everywhere or it's unloaded on a group of pages (such as all pages belonging to 'page' post type)
113
+ */
114
+ $globalUnloaded = $bulkTypeUnloaded = $isPostTypeUnloaded = $isLoadException = $isGlobalRule = false;
115
116
// Mark it as unloaded - Everywhere
117
if (in_array($obj->handle, $data['global_unload']['styles'])) {
119
}
120
121
// Mark it as unloaded - for the Current Post Type
122
+ if ($data['bulk_unloaded_type'] && in_array($obj->handle, $data['bulk_unloaded'][$data['bulk_unloaded_type']]['styles'])) {
123
+ $bulkTypeUnloaded = $isGlobalRule = true;
124
+
125
+ if ($data['bulk_unloaded_type'] === 'post_type') {
126
+ $isPostTypeUnloaded = true;
127
+ }
128
}
129
130
+ // TODO: action call if the premium extension is enabled so we will have bulk unload for taxonomy
131
+ // just like we have for post type on the lite version
132
+
133
if ($isGlobalRule) {
134
if (in_array($obj->handle, $data['load_exceptions']['styles'])) {
135
$isLoadException = true;
165
// Unloaded Everywhere
166
if ($globalUnloaded) {
167
?>
168
+ <p><strong style="color: #d54e21;">This stylesheet file is unloaded everywhere</strong></p>
169
<div class="clear"></div>
170
<?php
171
}
211
</ul>
212
</div>
213
214
+ <?php if ($data['bulk_unloaded_type'] === 'post_type') { ?>
215
<div style="padding: 5px 10px; margin: 15px 0; background: white; border: 1px solid #eee; border-radius: 5px;">
216
<?php } ?>
217
218
<?php
219
// Unloaded On All Pages Belonging to the page's Post Type
220
+ if ($isPostTypeUnloaded) {
221
?>
222
+ <p><strong style="color: #d54e21;">This stylesheet file is unloaded on all <u><?php echo $data['post_type']; ?></u> post types.</strong></p>
223
<div class="clear"></div>
224
<?php
225
}
226
?>
227
228
<?php
229
+ if ($data['bulk_unloaded_type'] === 'post_type') {
230
+ ?>
231
+ <ul class="wpacu_asset_options">
232
<?php
233
+ // [START] ALL PAGES HAVING THE SAME POST TYPE
234
+ if ($isPostTypeUnloaded) {
235
?>
236
+ <li>
237
+ <label><input data-handle="<?php echo $obj->handle; ?>"
238
+ class="wpacu_bulk_option wpacu_style wpacu_keep_bulk_rule"
239
+ type="radio"
240
+ name="wpacu_options_post_type_styles[<?php echo $obj->handle; ?>]"
241
+ checked="checked"
242
+ value="default"/>
243
+ Keep rule</label>
244
+ </li>
245
+
246
+ <li>
247
+ <label><input data-handle="<?php echo $obj->handle; ?>"
248
+ class="wpacu_bulk_option wpacu_style wpacu_remove_bulk_rule"
249
+ type="radio"
250
+ name="wpacu_options_post_type_styles[<?php echo $obj->handle; ?>]"
251
+ value="remove"/>
252
+ Remove rule</label>
253
+ </li>
254
+ <?php
255
+ } else {
256
+ ?>
257
+ <li>
258
+ <label><input data-handle="<?php echo $obj->handle; ?>"
259
+ class="wpacu_bulk_unload wpacu_post_type_unload wpacu_post_type_style"
260
+ id="wpacu_bulk_unload_post_type_style_<?php echo $obj->handle; ?>"
261
+ type="checkbox"
262
+ name="wpacu_bulk_unload_styles[post_type][<?php echo $data['post_type']; ?>][]"
263
+ value="<?php echo $obj->handle; ?>"/>
264
+ Unload on All Pages of <strong><?php echo $data['post_type']; ?></strong> post type</label>
265
+ </li>
266
<?php
267
+ }
268
+ ?>
269
+ </ul>
270
+ <?php
271
}
272
// [END] ALL PAGES HAVING THE SAME POST TYPE
273
?>
274
275
+ <?php if ($data['bulk_unloaded_type'] === 'post_type') { ?>
276
</div>
277
<?php } ?>
278
279
+ <?php
280
+ do_action('wpacu_pro_bulk_unload_output', $data, $obj, 'css');
281
+ ?>
282
+
283
<ul class="wpacu_asset_options">
284
<li id="wpacu_load_it_option_style_<?php echo $obj->handle; ?>">
285
<label><input data-handle="<?php echo $obj->handle; ?>"
335
* ---------------------
336
*/
337
?>
338
+ <h3><span style="font-size: 120%; line-height: 130%;" class="dashicons dashicons-media-code"></span> &nbsp; <?php _e('Scripts (.js files)', WPACU_PLUGIN_NAME); ?></h3>
339
340
<?php
341
if ($data['total_scripts']) {
342
?>
343
+ <h4>&#10141; Total enqueued JavaScript files: <strong><?php echo $data['total_scripts']; ?></strong></h4>
344
<?php
345
}
346
?>
373
$class = ($active) ? 'wpacu_not_load' : '';
374
$checked = ($active) ? 'checked="checked"' : '';
375
376
+ /*
377
+ * $isGlobalRule is only used to apply a red background in the script's area to point out that the script is unloaded
378
+ */
379
+ $globalUnloaded = $bulkTypeUnloaded = $isPostTypeUnloaded = $isLoadException = $isGlobalRule = false;
380
381
// Mark it as unloaded - Everywhere
382
if (in_array($obj->handle, $data['global_unload']['scripts']) && !$class) {
384
}
385
386
// Mark it as unloaded - for the Current Post Type
387
+ if ($data['bulk_unloaded_type'] && in_array($obj->handle, $data['bulk_unloaded'][$data['bulk_unloaded_type']]['scripts'])) {
388
+ $bulkTypeUnloaded = $isGlobalRule = true;
389
+
390
+ if ($data['bulk_unloaded_type'] === 'post_type') {
391
+ $isPostTypeUnloaded = true;
392
+ }
393
+ }
394
395
if ($isGlobalRule) {
396
if (in_array($obj->handle, $data['load_exceptions']['scripts'])) {
419
// Unloaded Everywhere
420
if ($globalUnloaded) {
421
?>
422
+ <p><strong style="color: #d54e21;">This JavaScript file is unloaded everywhere</strong></p>
423
<?php
424
}
425
?>
476
</ul>
477
</div>
478
479
+ <?php if ($data['bulk_unloaded_type'] === 'post_type') { ?>
480
<div style="padding: 5px 10px; margin: 15px 0; background: white; border: 1px solid #eee; border-radius: 5px;">
481
<?php } ?>
482
483
<?php
484
// Unloaded On All Pages Belonging to the page's Post Type
485
+ if ($isPostTypeUnloaded) {
486
?>
487
+ <p><strong style="color: #d54e21;">This JavaScript file is unloaded on all <u><?php echo $data['post_type']; ?></u> post types.</strong></p>
488
<div class="clear"></div>
489
<?php
490
}
492
493
<ul class="wpacu_asset_options">
494
<?php
495
+ if ($data['bulk_unloaded_type'] === 'post_type') {
496
// [START] ALL PAGES HAVING THE SAME POST TYPE
497
+ if ($isPostTypeUnloaded) {
498
?>
499
<li>
500
<label><input data-handle="<?php echo $obj->handle; ?>"
501
+ class="wpacu_post_type_option wpacu_post_type_script wpacu_keep_bulk_rule"
502
type="radio"
503
name="wpacu_options_post_type_scripts[<?php echo $obj->handle; ?>]"
504
checked="checked"
508
509
<li>
510
<label><input data-handle="<?php echo $obj->handle; ?>"
511
+ class="wpacu_post_type_option wpacu_remove_bulk_rule wpacu_post_type_script"
512
type="radio"
513
name="wpacu_options_post_type_scripts[<?php echo $obj->handle; ?>]"
514
value="remove"/>
519
?>
520
<li>
521
<label><input data-handle="<?php echo $obj->handle; ?>"
522
+ class="wpacu_bulk_unload wpacu_post_type_unload wpacu_post_type_script"
523
id="wpacu_global_unload_post_type_script_<?php echo $obj->handle; ?>"
524
type="checkbox"
525
name="wpacu_bulk_unload_scripts[post_type][<?php echo $data['post_type']; ?>][]"
532
// [END] ALL PAGES HAVING THE SAME POST TYPE
533
?>
534
</ul>
535
+ <?php if ($data['bulk_unloaded_type'] === 'post_type') { ?>
536
</div>
537
<?php } ?>
538
539
+ <?php
540
+ do_action('wpacu_pro_bulk_unload_output', $data, $obj, 'js');
541
+ ?>
542
+
543
<ul class="wpacu_asset_options">
544
<li id="wpacu_load_it_option_script_<?php echo $obj->handle; ?>">
545
<label><input data-handle="<?php echo $obj->handle; ?>"
598
* [END] SCRIPTS LIST
599
* -------------------
600
*/
601
+
602
+ // Bug Fix: Make sure that savePost() from Update class is triggered ONLY if the meta box is loaded
603
+ // Otherwise, an early form submit will erase any selected assets for unload by sending an empty $_POST[WPACU_PLUGIN_NAME] request
604
+ ?>
605
+ <input type="hidden" name="wpacu_unload_assets_area_loaded" value="1" />
templates/settings-frontend.php CHANGED
@@ -18,7 +18,7 @@ if (! isset($data)) {
18
<?php
19
if ($data['is_woocommerce_shop_page']) {
20
?>
21
- <p><strong>This is the "Shop" page from WooCommerce plugin. Unloading assets will also take effect for the pagination/sorting pages (e.g. /2, /3, /?orderby=popularity etc.).</strong></p>
22
<?php
23
}
24
@@ -30,7 +30,7 @@ if (! isset($data)) {
30
<?php
31
}
32
33
- do_action('wpacu_frontend_before_asset_list');
34
35
require_once 'meta-box-loaded.php';
36
@@ -44,10 +44,9 @@ if (! isset($data)) {
44
if ($data['is_updateable']) {
45
?>
46
<div style="margin: 10px 0;">
47
- <input class="wpacu_update_btn"
48
- type="submit"
49
- name="submit"
50
- value="<?php esc_attr_e('UPDATE', WPACU_PLUGIN_NAME); ?>" />
51
</div>
52
53
<p align="right"><small>Powered by WP Asset CleanUp</small></p>
18
<?php
19
if ($data['is_woocommerce_shop_page']) {
20
?>
21
+ <p><strong><span style="color: #0f6cab;" class="dashicons dashicons-cart"></span> This a WooCommerce shop page ('product' type archive). Unloading assets will also take effect for the pagination/sorting pages (e.g. /2, /3, /?orderby=popularity etc.).</strong></p>
22
<?php
23
}
24
30
<?php
31
}
32
33
+ do_action('wpacu_pro_frontend_before_asset_list');
34
35
require_once 'meta-box-loaded.php';
36
44
if ($data['is_updateable']) {
45
?>
46
<div style="margin: 10px 0;">
47
+ <button class="wpacu_update_btn"
48
+ type="submit"
49
+ name="submit"><span class="dashicons dashicons-update"></span> <?php esc_attr_e('UPDATE', WPACU_PLUGIN_NAME); ?></button>
50
</div>
51
52
<p align="right"><small>Powered by WP Asset CleanUp</small></p>
wpacu.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
* Plugin Name: WP Asset CleanUp (Page Speed Optimizer)
4
* Plugin URI: https://wordpress.org/plugins/wp-asset-clean-up/
5
- * Version: 1.2.6.3
6
* Description: Prevent Chosen Scripts & Styles from loading in Posts/Pages that you don't need
7
* Author: Gabriel Livan
8
* Author URI: http://www.gabelivan.com/
2
/*
3
* Plugin Name: WP Asset CleanUp (Page Speed Optimizer)
4
* Plugin URI: https://wordpress.org/plugins/wp-asset-clean-up/
5
+ * Version: 1.2.6.4
6
* Description: Prevent Chosen Scripts & Styles from loading in Posts/Pages that you don't need
7
* Author: Gabriel Livan
8
* Author URI: http://www.gabelivan.com/