Breeze – WordPress Cache Plugin - Version 1.0.9

Version Description

  • Add: Option to move JS file to footer during minification
  • Add: Option to deffer loading for JS files
  • Add: Option to include inline CSS
  • Add: Option to include inline JS
Download this release

Release Info

Developer adeelkhan
Plugin Icon 128x128 Breeze – WordPress Cache Plugin
Version 1.0.9
Comparing to
See all releases

Code changes from version 1.0.8 to 1.0.9

assets/css/style.css CHANGED
@@ -1,125 +1,234 @@
 
 
 
 
 
1
  .breeze-notice {
2
- background-color: #FFF;
3
- padding:10px;
4
- margin: 15px 0 15px 0;
5
- border: 1px solid #CCC;
 
 
 
 
6
  }
7
- .breeze-header{
8
- width: 200px;
9
- }
10
 
11
- .breeze-header .breeze-logo{
12
- background-image: url("../images/breez-logo200x46.png");
13
- height: 70px;
14
- background-repeat: no-repeat;
15
  }
16
 
17
- .breeze-header a{
18
- text-decoration: none;
19
- color: #000;
20
  }
 
 
 
 
 
21
  #breeze-tabs .nav-tab.active {
22
- background-color: #FFF;
23
- color: #464646;
24
  }
25
 
26
  .tab-child {
27
- overflow: hidden;
28
- background: #fff;
29
- border-bottom: 1px solid #CCC;
30
- border-left: 1px solid #CCC;
31
- border-right: 1px solid #CCC;
32
- padding: 10px 10px 30px 10px
33
  }
34
 
35
  #breeze-tabs-content .tab-pane {
36
- display: none
 
 
37
  }
38
 
39
  #breeze-tabs-content .tab-pane.active {
40
- display: block
41
  }
42
 
43
  .tab-content {
44
- overflow: auto;
45
  }
 
46
  .tabs-below > .nav-tabs,
47
  .tabs-right > .nav-tabs,
48
  .tabs-left > .nav-tabs {
49
- border-bottom: 0;
50
  }
51
- .tab-content > .tab-pane{
52
- display: none;
 
53
  }
54
- .tab-content > .active{
55
- display: block;
 
56
  }
57
 
58
  /*Table*/
59
- #breeze-tabs-content table tr td:first-child{
60
- width: 20%;
61
- font-weight: bold;
62
  }
63
- #breeze-tabs-content table tr td.last-td{
64
- font-weight: normal;
65
- padding-top: 30px;
 
66
  }
67
- #breeze-tabs-content table tr td{
68
- vertical-align: top;
69
- padding: 3px;
 
70
  }
71
 
72
- #breeze-tabs-content table ul{
73
- margin: 0 ;
74
  }
75
- #breeze-tabs-content table tr td label{
76
- vertical-align: top;
 
77
  }
78
- #breeze-tabs-content table tr td.input-middle{
79
- vertical-align: middle;
 
80
  }
81
- .breeze-top-notice{
82
- margin: 10px 0 5px 0;
 
83
  }
84
- .breeze-top-notice label{
85
- padding-left: 15px;
86
- font-size: 15px;
87
- font-weight: 400;
 
 
88
  }
89
- label.breeze_tool_tip{
90
- vertical-align: middle !important;
 
91
  }
92
 
93
  .ui-accordion-header:after {
94
- font-family: dashicons;
95
- content: "\f347";
96
- float: right;
97
  }
 
98
  .ui-accordion-header[aria-expanded='true']:after {
99
- content: "\f343";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
 
102
  /*Style for FAQ tab*/
 
 
 
 
103
  #faq-content {
104
- margin: 20px;
105
  }
106
 
107
  .faq-block {
108
- border: 1px solid;
109
- border-color: #eee transparent;
110
- padding-bottom: 10px;
111
  }
112
 
113
  .faq-question {
114
- cursor: pointer;
115
- margin: 0;
116
- padding: 1em 0;
117
  }
118
 
119
  .faq-question:focus {
120
- outline: none;
121
  }
122
 
123
  .faq-answer * {
124
- font-size: 14px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
1
+ .breeze-input-group .blur {
2
+ opacity: 0.5;
3
+ cursor: not-allowed;
4
+ }
5
+
6
  .breeze-notice {
7
+ background-color: #FFF;
8
+ padding: 10px;
9
+ margin: 15px 0 15px 0;
10
+ border: 1px solid #CCC;
11
+ }
12
+
13
+ .breeze-header {
14
+ width: 200px;
15
  }
 
 
 
16
 
17
+ .breeze-header .breeze-logo {
18
+ background-image: url("../images/breez-logo200x46.png");
19
+ height: 70px;
20
+ background-repeat: no-repeat;
21
  }
22
 
23
+ .breeze-header a {
24
+ text-decoration: none;
25
+ color: #000;
26
  }
27
+
28
+ #breeze-tabs {
29
+ border-bottom: none;
30
+ }
31
+
32
  #breeze-tabs .nav-tab.active {
33
+ background-color: #FFF;
34
+ color: #464646;
35
  }
36
 
37
  .tab-child {
38
+ overflow: hidden;
39
+ background: #fff;
40
+ border: 1px solid #CCC;
41
+ padding: 10px 10px 30px 10px
 
 
42
  }
43
 
44
  #breeze-tabs-content .tab-pane {
45
+ display: none;
46
+ float: left;
47
+ width: 80%;
48
  }
49
 
50
  #breeze-tabs-content .tab-pane.active {
51
+ display: block
52
  }
53
 
54
  .tab-content {
55
+ overflow: auto;
56
  }
57
+
58
  .tabs-below > .nav-tabs,
59
  .tabs-right > .nav-tabs,
60
  .tabs-left > .nav-tabs {
61
+ border-bottom: 0;
62
  }
63
+
64
+ .tab-content > .tab-pane {
65
+ display: none;
66
  }
67
+
68
+ .tab-content > .active {
69
+ display: block;
70
  }
71
 
72
  /*Table*/
73
+ #breeze-tabs-content table tr td:first-child {
74
+ width: 20%;
75
+ font-weight: bold;
76
  }
77
+
78
+ #breeze-tabs-content table tr td.last-td {
79
+ font-weight: normal;
80
+ padding-top: 30px;
81
  }
82
+
83
+ #breeze-tabs-content table tr td {
84
+ vertical-align: top;
85
+ padding: 3px;
86
  }
87
 
88
+ #breeze-tabs-content table ul {
89
+ margin: 0;
90
  }
91
+
92
+ #breeze-tabs-content table tr td label {
93
+ vertical-align: top;
94
  }
95
+
96
+ #breeze-tabs-content table tr td.input-middle {
97
+ vertical-align: middle;
98
  }
99
+
100
+ .breeze-top-notice {
101
+ margin: 10px 0 5px 0;
102
  }
103
+
104
+ .breeze-top-notice p {
105
+ padding-left: 15px;
106
+ font-size: 15px;
107
+ font-weight: 400;
108
+ margin: 0;
109
  }
110
+
111
+ .breeze_tool_tip {
112
+ vertical-align: middle !important;
113
  }
114
 
115
  .ui-accordion-header:after {
116
+ font-family: dashicons;
117
+ content: "\f347";
118
+ float: right;
119
  }
120
+
121
  .ui-accordion-header[aria-expanded='true']:after {
122
+ content: "\f343";
123
+ }
124
+
125
+ .tab-child textarea {
126
+ width: 95%;
127
+ max-width: 630px;
128
+ }
129
+
130
+ .breeze-list-url .breeze-input-group {
131
+ white-space: nowrap;
132
+ }
133
+
134
+ .breeze-input-group .breeze-input-url {
135
+ width: 85%;
136
+ max-width: 560px;
137
+ }
138
+
139
+ .breeze-input-group span {
140
+ vertical-align: text-bottom;
141
+ cursor: pointer;
142
+ }
143
+
144
+ .breeze-input-group span.sort-handle {
145
+ cursor: move;
146
+ }
147
+
148
+ .breeze-input-group span.sort-handle span.moveUp:before,
149
+ .breeze-input-group span.sort-handle span.moveDown:before {
150
+ font-size: 30px;
151
+ margin-left: -7px;
152
  }
153
 
154
  /*Style for FAQ tab*/
155
+ #breeze-tabs-content #tab-content-faq {
156
+ width: 100%;
157
+ }
158
+
159
  #faq-content {
160
+ margin: 20px;
161
  }
162
 
163
  .faq-block {
164
+ border: 1px solid;
165
+ border-color: #eee transparent;
166
+ padding-bottom: 10px;
167
  }
168
 
169
  .faq-question {
170
+ cursor: pointer;
171
+ margin: 0;
172
+ padding: 1em 0;
173
  }
174
 
175
  .faq-question:focus {
176
+ outline: none;
177
  }
178
 
179
  .faq-answer * {
180
+ font-size: 14px;
181
+ }
182
+
183
+ /*Right-side content*/
184
+ #breeze-and-cloudways {
185
+ display: none;
186
+ float: left;
187
+ max-width: calc(20% - 20px);
188
+ margin-left: 20px;
189
+ }
190
+
191
+ #breeze-and-cloudways .rs-title {
192
+ padding: 0 5px 10px;
193
+ margin: 0;
194
+ border-bottom: 1px solid #11acdf;
195
+ color: #11acdf;
196
+ font-size: 20px;
197
+ line-height: 120%;
198
+ margin-bottom: 15px;
199
+ }
200
+
201
+ #breeze-and-cloudways .rs-content {
202
+ margin-bottom: 15px;
203
+ }
204
+
205
+ #breeze-and-cloudways .rs-content:not(:last-child) {
206
+ padding-bottom: 15px;
207
+ border-bottom: 1px solid #ccc;
208
+ }
209
+
210
+ #breeze-and-cloudways .rs-content p {
211
+ color: #000;
212
+ margin: 0 0 15px;
213
+ }
214
+
215
+ #breeze-and-cloudways .rs-content h4 {
216
+ margin: 0 0 5px;
217
+ color: #000;
218
+ }
219
+
220
+ #breeze-and-cloudways .rs-content ul {
221
+ list-style: disc;
222
+ margin: 15px 0 15px 20px;
223
+ color: #000;
224
+ font-weight: 500;
225
+ }
226
+
227
+ #breeze-and-cloudways .rs-content ul li {
228
+ margin-bottom: 10px;
229
+ }
230
+
231
+ #breeze-and-cloudways .rs-content button a {
232
+ color: #fff;
233
+ text-decoration: none;
234
  }
assets/js/breeze-configuration.js CHANGED
@@ -16,7 +16,90 @@ jQuery(document).ready(function($){
16
  }
17
  });
18
 
19
- // Tab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  $("#breeze-tabs .nav-tab").click(function (e) {
21
  e.preventDefault();
22
  $("#breeze-tabs .nav-tab").removeClass('active');
@@ -26,6 +109,19 @@ jQuery(document).ready(function($){
26
  $("#breeze-tabs-content .tab-pane").removeClass('active');
27
  $("#tab-content-" + id_tab).addClass('active');
28
  document.cookie = 'breeze_active_tab=' + id_tab;
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  });
30
 
31
  // Cookie do
@@ -35,7 +131,7 @@ jQuery(document).ready(function($){
35
  active_tab = 'basic';
36
  }
37
 
38
- if ($("#tab-" + active_tab).length === 0) {
39
  firstTab = $('#breeze-tabs').find('a:first-child');
40
  tabType = firstTab.attr('id').replace('tab-', '');
41
  firstTab.addClass('active');
@@ -44,6 +140,19 @@ jQuery(document).ready(function($){
44
  $("#tab-" + active_tab).addClass('active');
45
  $("#tab-content-" + active_tab).addClass('active');
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
 
49
  function getCookie(cname) {
@@ -58,10 +167,4 @@ jQuery(document).ready(function($){
58
  }
59
 
60
  setTabFromCookie();
61
-
62
- $('#faq-content').accordion({
63
- collapsible: true,
64
- animate: 200,
65
- header: '.faq-question'
66
- });
67
  });
16
  }
17
  });
18
 
19
+ function initRemoveBtn() {
20
+ $('.breeze-input-group span.item-remove').unbind('click').click(function () {
21
+ var inputURL = $(this).closest('.breeze-input-group');
22
+ inputURL.fadeOut(300, function () {
23
+ inputURL.remove();
24
+ validateMoveButtons();
25
+ });
26
+ });
27
+ }
28
+ initRemoveBtn();
29
+
30
+ function initSortableHandle() {
31
+ $('.breeze-list-url').sortable({
32
+ handle: $('span.sort-handle'),
33
+ stop: validateMoveButtons
34
+ });
35
+ }
36
+ initSortableHandle();
37
+
38
+ function initMoveButtons() {
39
+ $('.sort-handle span').unbind('click').click(function (e) {
40
+ var inputGroup = $(this).parents('.breeze-input-group');
41
+ if ($(this).hasClass('moveUp')) {
42
+ inputGroup.insertBefore(inputGroup.prev());
43
+ } else {
44
+ inputGroup.insertAfter(inputGroup.next());
45
+ }
46
+
47
+ validateMoveButtons();
48
+ });
49
+ }
50
+ initMoveButtons();
51
+
52
+ function validateMoveButtons() {
53
+ var listURL = $('.breeze-list-url');
54
+ listURL.find('.breeze-input-group').find('.sort-handle').find('span').removeClass('blur');
55
+ listURL.find('.breeze-input-group:first-child').find('.moveUp').addClass('blur');
56
+ listURL.find('.breeze-input-group:last-child').find('.moveDown').addClass('blur');
57
+ }
58
+ validateMoveButtons();
59
+
60
+ $('button.add-url').unbind('click').click(function () {
61
+ var defer = $(this).attr('id').indexOf('defer') > -1;
62
+ var listURL = $(this).closest('td').find('.breeze-list-url');
63
+ var html = '';
64
+ var listInput = listURL.find('.breeze-input-group');
65
+ var emptyInput = false;
66
+
67
+ listInput.each(function () {
68
+ var thisInput = $(this).find('.breeze-input-url');
69
+ if (thisInput.val().trim() === '') {
70
+ thisInput.focus();
71
+ emptyInput = true;
72
+ return false;
73
+ }
74
+ });
75
+
76
+ if (emptyInput) return false;
77
+
78
+ html += '<div class="breeze-input-group">';
79
+ html += ' <span class="sort-handle">';
80
+ html += ' <span class="dashicons dashicons-arrow-up moveUp"></span>';
81
+ html += ' <span class="dashicons dashicons-arrow-down moveDown"></span>';
82
+ html += ' </span>';
83
+ html += ' <input type="text" size="98"';
84
+ html += 'class="breeze-input-url"';
85
+ if (!defer) {
86
+ html += 'name="move-to-footer-js[]"';
87
+ } else {
88
+ html += 'name="defer-js[]"';
89
+ }
90
+ html += 'placeholder="Enter URL..."';
91
+ html += 'value="" />';
92
+ html += ' <span class="dashicons dashicons-no item-remove" title="Remove"></span>';
93
+ html += '</div>';
94
+
95
+ listURL.append(html);
96
+ initRemoveBtn();
97
+ initSortableHandle();
98
+ initMoveButtons();
99
+ validateMoveButtons();
100
+ });
101
+
102
+ // Change tab
103
  $("#breeze-tabs .nav-tab").click(function (e) {
104
  e.preventDefault();
105
  $("#breeze-tabs .nav-tab").removeClass('active');
109
  $("#breeze-tabs-content .tab-pane").removeClass('active');
110
  $("#tab-content-" + id_tab).addClass('active');
111
  document.cookie = 'breeze_active_tab=' + id_tab;
112
+
113
+ // Toggle right-side content
114
+ if (id_tab === 'faq') {
115
+ $('#breeze-and-cloudways').hide();
116
+ $('#faq-content').accordion({
117
+ collapsible: true,
118
+ animate: 200,
119
+ header: '.faq-question',
120
+ heightStyle: 'content'
121
+ });
122
+ } else {
123
+ $('#breeze-and-cloudways').show();
124
+ }
125
  });
126
 
127
  // Cookie do
131
  active_tab = 'basic';
132
  }
133
 
134
+ if ($("#tab-" + active_tab).length === 0) { // Tab not found (multisite case)
135
  firstTab = $('#breeze-tabs').find('a:first-child');
136
  tabType = firstTab.attr('id').replace('tab-', '');
137
  firstTab.addClass('active');
140
  $("#tab-" + active_tab).addClass('active');
141
  $("#tab-content-" + active_tab).addClass('active');
142
  }
143
+
144
+ // Toggle right-side content
145
+ if (active_tab === 'faq') {
146
+ $('#breeze-and-cloudways').hide();
147
+ $('#faq-content').accordion({
148
+ collapsible: true,
149
+ animate: 200,
150
+ header: '.faq-question',
151
+ heightStyle: 'content'
152
+ });
153
+ } else {
154
+ $('#breeze-and-cloudways').show();
155
+ }
156
  }
157
 
158
  function getCookie(cname) {
167
  }
168
 
169
  setTabFromCookie();
 
 
 
 
 
 
170
  });
breeze.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Breeze
4
  * Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
5
- * Version: 1.0.8
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
2
  /**
3
  * Plugin Name: Breeze
4
  * Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
5
+ * Version: 1.0.9
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
inc/breeze-admin.php CHANGED
@@ -219,18 +219,6 @@ class Breeze_Admin {
219
  'target' => '_blank'),
220
  );
221
  $wp_admin_bar->add_node( $args );
222
-
223
- // add feedback item
224
- $args = array(
225
- 'id' => 'breeze-feedback',
226
- 'title' => esc_html(__('Feedback', 'breeze')),
227
- 'href' => 'https://www.surveymonkey.com/r/YNV2XVL',
228
- 'parent' => 'breeze-topbar',
229
- 'meta' => array( 'class' => 'breeze-toolbar-group',
230
- 'target' => '_blank'),
231
- );
232
- $wp_admin_bar->add_node( $args );
233
-
234
  }
235
  }
236
 
@@ -271,6 +259,8 @@ class Breeze_Admin {
271
  'breeze-mobile-cache' => '1',
272
  'breeze-disable-admin' => '1',
273
  'breeze-display-clean' => '1',
 
 
274
  );
275
  $basic= array_merge($default_basic,$basic);
276
 
@@ -282,7 +272,9 @@ class Breeze_Admin {
282
  'breeze-group-css' => '0',
283
  'breeze-group-js' => '0',
284
  'breeze-exclude-css' => array(),
285
- 'breeze-exclude-js' => array()
 
 
286
  );
287
  $advanced= array_merge($default_advanced,$advanced);
288
 
219
  'target' => '_blank'),
220
  );
221
  $wp_admin_bar->add_node( $args );
 
 
 
 
 
 
 
 
 
 
 
 
222
  }
223
  }
224
 
259
  'breeze-mobile-cache' => '1',
260
  'breeze-disable-admin' => '1',
261
  'breeze-display-clean' => '1',
262
+ 'breeze-include-inline-js' => '0',
263
+ 'breeze-include-inline-css' => '0',
264
  );
265
  $basic= array_merge($default_basic,$basic);
266
 
272
  'breeze-group-css' => '0',
273
  'breeze-group-js' => '0',
274
  'breeze-exclude-css' => array(),
275
+ 'breeze-exclude-js' => array(),
276
+ 'breeze-move-to-footer-js' => array(),
277
+ 'breeze-defer-js' => array()
278
  );
279
  $advanced= array_merge($default_advanced,$advanced);
280
 
inc/breeze-configuration.php CHANGED
@@ -49,9 +49,12 @@ class Breeze_Configuration{
49
  'breeze-desktop-cache' => (int)$_POST['desktop-cache'],
50
  'breeze-mobile-cache' => (int)$_POST['mobile-cache'],
51
  'breeze-disable-admin' => '1',
52
- 'breeze-display-clean' => '1'
 
 
53
  );
54
  update_option('breeze_basic_settings',$basic);
 
55
  // Update settings for network sites
56
  if (is_multisite()) {
57
  foreach ($sites as $site) {
@@ -100,12 +103,32 @@ class Breeze_Configuration{
100
  $exclude_urls = $this->string_convert_arr(sanitize_textarea_field($_POST['exclude-urls']));
101
  $exclude_css = $this->string_convert_arr(sanitize_textarea_field($_POST['exclude-css']));
102
  $exclude_js = $this->string_convert_arr(sanitize_textarea_field($_POST['exclude-js']));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  $advanced = array(
104
  'breeze-exclude-urls' => $exclude_urls,
105
  'breeze-group-css' => (isset($_POST['group-css']) ? '1' : '0'),
106
  'breeze-group-js' => (isset($_POST['group-js']) ? '1' : '0'),
107
  'breeze-exclude-css' => $exclude_css,
108
- 'breeze-exclude-js' => $exclude_js
 
 
109
  );
110
  update_option('breeze_advanced_settings',$advanced);
111
  // Update settings for network sites
49
  'breeze-desktop-cache' => (int)$_POST['desktop-cache'],
50
  'breeze-mobile-cache' => (int)$_POST['mobile-cache'],
51
  'breeze-disable-admin' => '1',
52
+ 'breeze-display-clean' => '1',
53
+ 'breeze-include-inline-js' => (isset($_POST['include-inline-js']) ? '1' : '0'),
54
+ 'breeze-include-inline-css' => (isset($_POST['include-inline-css']) ? '1' : '0'),
55
  );
56
  update_option('breeze_basic_settings',$basic);
57
+
58
  // Update settings for network sites
59
  if (is_multisite()) {
60
  foreach ($sites as $site) {
103
  $exclude_urls = $this->string_convert_arr(sanitize_textarea_field($_POST['exclude-urls']));
104
  $exclude_css = $this->string_convert_arr(sanitize_textarea_field($_POST['exclude-css']));
105
  $exclude_js = $this->string_convert_arr(sanitize_textarea_field($_POST['exclude-js']));
106
+ $move_to_footer_js = $defer_js = array();
107
+
108
+ if (!empty($_POST['move-to-footer-js'])) {
109
+ foreach ($_POST['move-to-footer-js'] as $url) {
110
+ if (trim($url) == '') continue;
111
+ $url = current(explode('?', $url, 2));
112
+ $move_to_footer_js[sanitize_text_field($url)] = sanitize_text_field($url);
113
+ }
114
+ }
115
+
116
+ if (!empty($_POST['defer-js'])) {
117
+ foreach ($_POST['defer-js'] as $url) {
118
+ if (trim($url) == '') continue;
119
+ $url = current(explode('?', $url, 2));
120
+ $defer_js[sanitize_text_field($url)] = sanitize_text_field($url);
121
+ }
122
+ }
123
+
124
  $advanced = array(
125
  'breeze-exclude-urls' => $exclude_urls,
126
  'breeze-group-css' => (isset($_POST['group-css']) ? '1' : '0'),
127
  'breeze-group-js' => (isset($_POST['group-js']) ? '1' : '0'),
128
  'breeze-exclude-css' => $exclude_css,
129
+ 'breeze-exclude-js' => $exclude_js,
130
+ 'breeze-move-to-footer-js' => $move_to_footer_js,
131
+ 'breeze-defer-js' => $defer_js
132
  );
133
  update_option('breeze_advanced_settings',$advanced);
134
  // Update settings for network sites
inc/minification/breeze-minification-scripts.php CHANGED
@@ -5,7 +5,8 @@
5
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
6
 
7
  class Breeze_MinificationScripts extends Breeze_MinificationBase {
8
- private $scripts = array();
 
9
  private $dontmove = array('document.write','html5.js','show_ads.js','google_ad','blogcatalog.com/w','tweetmeme.com/i','mybloglog.com/','histats.com/js','ads.smowtion.com/ad.js','statcounter.com/counter/counter.js','widgets.amung.us','ws.amazon.com/widgets','media.fastclick.net','/ads/','comment-form-quicktags/quicktags.php','edToolbar','intensedebate.com','scripts.chitika.net/','_gaq.push','jotform.com/','admin-bar.min.js','GoogleAnalyticsObject','plupload.full.min.js','syntaxhighlighter','adsbygoogle','gist.github.com','_stq','nonce','post_id','data-noptimize');
10
  private $domove = array('gaJsHost','load_cmc','jd.gallery.transitions.js','swfobject.embedSWF(','tiny_mce.js','tinyMCEPreInit.go');
11
  private $domovelast = array('addthis.com','/afsonline/show_afs_search.js','disqus.js','networkedblogs.com/getnetworkwidget','infolinks.com/js/','jd.gallery.js.php','jd.gallery.transitions.js','swfobject.embedSWF(','linkwithin.com/widget.js','tiny_mce.js','tinyMCEPreInit.go');
@@ -23,9 +24,18 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
23
  private $inject_min_late = '';
24
  private $group_js = false;
25
  private $custom_js_exclude = array();
26
- private $js_group_val = array();
27
- private $js_min_arr = array();
28
- private $url_group_arr = array();
 
 
 
 
 
 
 
 
 
29
  //Reads the page and collects script tags
30
  public function read($options) {
31
  $noptimizeJS = apply_filters( 'breeze_filter_js_noptimize', false, $this->content );
@@ -65,6 +75,16 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
65
  $this->custom_js_exclude = $options['custom_js_exclude'];
66
  }
67
 
 
 
 
 
 
 
 
 
 
 
68
  // filter to "late inject minified JS", default to true for now (it is faster)
69
  $this->inject_min_late = apply_filters('breeze_filter_js_inject_min_late',true);
70
 
@@ -106,117 +126,155 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
106
  $this->content = $this->hide_comments($this->content);
107
 
108
  //Get script files
109
- if(preg_match_all('#<script.*</script>#Usmi',$this->content,$matches)) {
110
- foreach($matches[0] as $tag) {
111
- // only consider aggregation whitelisted in should_aggregate-function
112
- if( !$this->should_aggregate($tag) ) {
113
- $tag='';
114
- continue;
115
- }
116
- if(preg_match('/src=("|\')?(.*(\ |\>))("|\')?/Usmi',$tag,$source)) {
117
- $source[2] = substr($source[2], 0, -1);
118
- if ($this->isremovable($tag,$this->jsremovables)) {
119
- $this->content = str_replace($tag,'',$this->content);
120
- continue;
121
- }
122
- // External script
123
- $url = current(explode('?',$source[2],2));
124
- if ($url[0] == "'" || $url[0] == '"') {
125
- $url = substr($url, 1);
126
- }
127
- if ($url[strlen($url) - 1] == '"' || $url[strlen($url) - 1] == "'") {
128
- $url = substr($url, 0 , -1);
129
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  //exclude js
132
  if(in_array($url,$this->custom_js_exclude)){
133
  continue;
134
  }
135
 
136
- $path = $this->getpath($url);
137
- if($path !== false && preg_match('#\.js$#',$path)) {
138
- //Inline
139
- if($this->ismergeable($tag)) {
140
- //We can merge it
141
- $this->scripts[] = $path;
142
-
143
- } else {
144
- //No merge, but maybe we can move it
145
- if($this->ismovable($tag)) {
146
- //Yeah, move it
147
- if($this->movetolast($tag)) {
148
- $this->move['last'][] = $tag;
149
- } else {
150
- $this->move['first'][] = $tag;
151
- }
152
- } else {
153
- //We shouldn't touch this
154
- $tag = '';
155
- }
156
- }
157
- } else {
158
- //External script (example: google analytics)
159
- //OR Script is dynamic (.php etc)
160
- if($this->ismovable($tag)) {
161
- if($this->movetolast($tag)) {
162
- $this->move['last'][] = $tag;
163
- } else {
164
- $this->move['first'][] = $tag;
165
- }
166
- } else {
167
- //We shouldn't touch this
168
- $tag = '';
169
- }
170
- }
171
- } else {
172
- // Inline script
173
- if ($this->group_js) {
174
- // Exclude inline JS while group minification files to avoid large caching size
175
- continue;
176
- }
 
 
 
 
 
 
 
 
177
 
178
- if ($this->isremovable($tag,$this->jsremovables)) {
179
- $this->content = str_replace($tag,'',$this->content);
180
- continue;
181
- }
182
-
183
- // unhide comments, as javascript may be wrapped in comment-tags for old times' sake
184
- $tag = $this->restore_comments($tag);
185
- if($this->ismergeable($tag) && ( $this->include_inline )) {
186
- preg_match('#<script.*>(.*)</script>#Usmi',$tag,$code);
187
- $code = preg_replace('#.*<!\[CDATA\[(?:\s*\*/)?(.*)(?://|/\*)\s*?\]\]>.*#sm','$1',$code[1]);
188
- $code = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/','',$code);
189
- $this->scripts[] = 'INLINE;'.$code;
190
- } else {
191
- // Can we move this?
192
- if($this->ismovable($tag)) {
193
- if($this->movetolast($tag)) {
194
- $this->move['last'][] = $tag;
195
- } else {
196
- $this->move['first'][] = $tag;
197
- }
198
- } else {
199
- //We shouldn't touch this
200
- $tag = '';
201
- }
202
- }
203
- // re-hide comments to be able to do the removal based on tag from $this->content
204
- $tag = $this->hide_comments($tag);
205
- }
206
  //Remove the original script tag
207
- $this->content = str_replace($tag,'',$this->content);
208
- }
209
-
210
- return true;
211
- }
212
-
213
- // No script files, great ;-)
214
- return false;
215
- }
216
-
 
 
 
 
 
 
 
 
 
 
217
  //Joins and optimizes JS
218
- public function minify() {
219
- foreach($this->scripts as $script) {
220
  if(preg_match('#^INLINE;#',$script)) {
221
  //Inline script
222
  $script = preg_replace('#^INLINE;#','',$script);
@@ -230,15 +288,15 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
230
  $script=$tmpscript;
231
  $this->alreadyminified=true;
232
  }
233
- if($this->group_js == true){
234
- $this->jscode .= "\n" . $script;
235
- }else{
236
- $this->js_group_val[] = $script;
237
- }
238
 
 
 
 
 
 
239
  } else {
240
- //External script
241
- if($script !== false && file_exists($script) && is_readable($script)) {
242
  $scriptsrc = file_get_contents($script);
243
  $scriptsrc = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$scriptsrc);
244
  $scriptsrc = rtrim($scriptsrc,";\n\t\r").';';
@@ -256,26 +314,33 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
256
  if($this->group_js == true){
257
  $this->jscode .= "\n" . $scriptsrc;
258
  }else{
259
- $this->js_group_val[] = $scriptsrc;
 
 
 
 
260
  }
261
-
262
  }/*else{
263
  //Couldn't read JS. Maybe getpath isn't working?
264
  }*/
265
  }
266
  }
267
- if($this->group_js == true){
 
 
 
268
  //Check for already-minified code
269
  $this->md5hash = md5($this->jscode);
270
  $ccheck = new Breeze_MinificationCache($this->md5hash,'js');
271
  if($ccheck->check()) {
272
  $this->jscode = $ccheck->retrieve();
273
- return true;
274
  }
275
  unset($ccheck);
276
 
277
  //$this->jscode has all the uncompressed code now.
278
- if ($this->alreadyminified!==true) {
 
279
  if (class_exists('JSMin') && apply_filters( 'breeze_js_do_minify' , true)) {
280
  if (@is_callable(array("JSMin","minify"))) {
281
  $tmp_jscode = trim(JSMin::minify($this->jscode));
@@ -283,57 +348,117 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
283
  $this->jscode = $tmp_jscode;
284
  unset($tmp_jscode);
285
  }
286
- $this->jscode = $this->inject_minified($this->jscode);
287
- $this->jscode = apply_filters( 'breeze_js_after_minify', $this->jscode );
288
- return true;
289
- } else {
290
- $this->jscode = $this->inject_minified($this->jscode);
291
- return false;
292
  }
293
- } else {
294
- $this->jscode = $this->inject_minified($this->jscode);
295
- return false;
296
  }
 
 
297
  }
298
- }else{
299
- foreach ($this->js_group_val as $jscode){
300
- //Check for already-minified code
301
- $this->md5hash = md5($jscode);
302
- $ccheck = new Breeze_MinificationCache($this->md5hash,'js');
303
- if($ccheck->check()) {
304
- $js_exist = $ccheck->retrieve();
305
- $this->js_min_arr[] = $this->md5hash .'_breezejsgroup_'.$js_exist;
306
- continue;
 
 
 
 
 
 
 
 
 
307
  }
308
- unset($ccheck);
309
 
310
- //$this->jscode has all the uncompressed code now.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
 
312
- if (class_exists('JSMin') && apply_filters( 'breeze_js_do_minify' , true)) {
313
- if (@is_callable(array("JSMin","minify"))) {
314
  $tmp_jscode = trim(JSMin::minify($jscode));
315
  if (!empty($tmp_jscode)) {
316
  $jscode = $tmp_jscode;
317
  unset($tmp_jscode);
318
  }
319
- $jscode = $this->inject_minified($jscode);
320
- $jscode = apply_filters( 'breeze_js_after_minify', $jscode );
321
- $this->js_min_arr[] = $this->md5hash .'_breezejsgroup_'.$jscode;
322
- } else {
323
- $jscode = $this->inject_minified($jscode);
324
- $this->js_min_arr[] = $this->md5hash .'_breezejsgroup_'.$jscode;
325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  }
327
- } else {
328
- $jscode = $this->inject_minified($jscode);
329
- $this->js_min_arr[] = $this->md5hash .'_breezejsgroup_'.$jscode;
330
  }
331
 
 
 
 
332
  }
333
  }
334
- return true;
 
335
  }
336
-
337
  //Caches the JS in uncompressed, deflated and gzipped form.
338
  public function cache() {
339
  if($this->group_js == true){
@@ -345,7 +470,19 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
345
  $this->url = breeze_CACHE_URL.$cache->getname();
346
  $this->url = $this->url_replace_cdn($this->url);
347
  }else{
348
- foreach ($this->js_min_arr as $js_min){
 
 
 
 
 
 
 
 
 
 
 
 
349
  $namehash = substr($js_min, 0 , strpos($js_min,'_breezejsgroup_'));
350
  $js_code = substr($js_min,strpos($js_min,'_breezejsgroup_')+strlen('_breezejsgroup_'));
351
  $cache = new Breeze_MinificationCache($namehash,'js');
@@ -354,7 +491,7 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
354
  $cache->cache($js_code,'text/javascript');
355
  }
356
  $url = breeze_CACHE_URL.$cache->getname();
357
- $this->url_group_arr[]= $this->url_replace_cdn($url);
358
  }
359
  }
360
  }
@@ -363,45 +500,100 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
363
  public function getcontent() {
364
  // Restore the full content
365
  if(!empty($this->restofcontent)) {
366
- $this->content .= $this->restofcontent;
367
  $this->restofcontent = '';
368
  }
369
-
370
- // Add the scripts taking forcehead/ deferred (default) into account
371
- if($this->forcehead == true) {
372
- $replaceTag=array("</head>","before");
373
- $defer="";
374
- } else {
375
- $replaceTag=array("</body>","before");
376
- $defer="defer ";
377
- }
378
-
379
- $defer = apply_filters( 'breeze_filter_js_defer', $defer );
380
- if($this->group_js == true){
381
- $bodyreplacementpayload = '<script type="text/javascript" '.$defer.'src="'.$this->url.'"></script>';
382
- $bodyreplacementpayload = apply_filters('breeze_filter_js_bodyreplacementpayload',$bodyreplacementpayload);
383
- }else{
384
- $arrscript = array();
385
- foreach ($this->url_group_arr as $url){
386
- $arrscript[] = '<script type="text/javascript" '.$defer.'src="'.$url.'"></script>';
387
  }
388
- $bodyreplacementpayload = implode('',$arrscript);
 
 
389
  }
390
- $bodyreplacement = implode('',$this->move['first']);
391
- $bodyreplacement .= $bodyreplacementpayload;
392
- $bodyreplacement .= implode('',$this->move['last']);
393
- $replaceTag = apply_filters( 'breeze_filter_js_replacetag', $replaceTag );
394
 
395
- if($this->group_js == true){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  if (strlen($this->jscode)>0) {
397
  $this->inject_in_html($bodyreplacement,$replaceTag);
398
  }
399
- }else{
400
- if(count($this->js_min_arr) > 0)
401
- $this->inject_in_html($bodyreplacement,$replaceTag);
402
- }
 
 
 
 
 
 
 
 
 
 
 
 
403
 
 
 
404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
 
406
  // restore comments
407
  $this->content = $this->restore_comments($this->content);
@@ -489,7 +681,8 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
489
  //Should be in 'first'
490
  return false;
491
  }
492
- /**
 
493
  * Determines wheter a <script> $tag should be aggregated or not.
494
  *
495
  * We consider these as "aggregation-safe" currently:
5
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
6
 
7
  class Breeze_MinificationScripts extends Breeze_MinificationBase {
8
+ private $head_scripts = array();
9
+ private $footer_scripts = array();
10
  private $dontmove = array('document.write','html5.js','show_ads.js','google_ad','blogcatalog.com/w','tweetmeme.com/i','mybloglog.com/','histats.com/js','ads.smowtion.com/ad.js','statcounter.com/counter/counter.js','widgets.amung.us','ws.amazon.com/widgets','media.fastclick.net','/ads/','comment-form-quicktags/quicktags.php','edToolbar','intensedebate.com','scripts.chitika.net/','_gaq.push','jotform.com/','admin-bar.min.js','GoogleAnalyticsObject','plupload.full.min.js','syntaxhighlighter','adsbygoogle','gist.github.com','_stq','nonce','post_id','data-noptimize');
11
  private $domove = array('gaJsHost','load_cmc','jd.gallery.transitions.js','swfobject.embedSWF(','tiny_mce.js','tinyMCEPreInit.go');
12
  private $domovelast = array('addthis.com','/afsonline/show_afs_search.js','disqus.js','networkedblogs.com/getnetworkwidget','infolinks.com/js/','jd.gallery.js.php','jd.gallery.transitions.js','swfobject.embedSWF(','linkwithin.com/widget.js','tiny_mce.js','tinyMCEPreInit.go');
24
  private $inject_min_late = '';
25
  private $group_js = false;
26
  private $custom_js_exclude = array();
27
+ private $js_head_group = array();
28
+ private $js_footer_group = array();
29
+ private $js_min_head = array();
30
+ private $js_min_footer = array();
31
+ private $url_group_head = array();
32
+ private $url_group_footer = array();
33
+ private $jscode_inline_head = array();
34
+ private $jscode_inline_footer = array();
35
+ private $move_to_footer_js = array();
36
+ private $move_to_footer = array();
37
+ private $defer_js = array();
38
+
39
  //Reads the page and collects script tags
40
  public function read($options) {
41
  $noptimizeJS = apply_filters( 'breeze_filter_js_noptimize', false, $this->content );
75
  $this->custom_js_exclude = $options['custom_js_exclude'];
76
  }
77
 
78
+ // JS files will move to footer
79
+ if(!empty($options['move_to_footer_js'])){
80
+ $this->move_to_footer_js = $options['move_to_footer_js'];
81
+ }
82
+
83
+ // JS files will move to footer
84
+ if(!empty($options['defer_js'])){
85
+ $this->defer_js = $options['defer_js'];
86
+ }
87
+
88
  // filter to "late inject minified JS", default to true for now (it is faster)
89
  $this->inject_min_late = apply_filters('breeze_filter_js_inject_min_late',true);
90
 
126
  $this->content = $this->hide_comments($this->content);
127
 
128
  //Get script files
129
+ $exploded_content = explode('</head>', $this->content, 2);
130
+ $this->getJS($exploded_content[0]);
131
+ $this->getJS($exploded_content[1], false);
132
+
133
+ if (!empty($this->head_scripts) || !empty($this->footer_scripts)) {
134
+ // Re-order moving to footer JS files
135
+ $ordered_moving_js = array_intersect_key($this->move_to_footer_js, $this->move_to_footer);
136
+ $ordered_moving_js = array_map(array($this, 'getpath'), $ordered_moving_js);
137
+ $this->footer_scripts = array_merge($ordered_moving_js, $this->footer_scripts);
138
+ return true;
139
+ }
140
+
141
+ // No script files, great!
142
+ return false;
143
+ }
144
+
145
+ //Get all JS in page
146
+ private function getJS($content, $head = true) {
147
+ if(preg_match_all('#<script.*</script>#Usmi',$content,$matches)) {
148
+ foreach($matches[0] as $tag) {
149
+ // only consider aggregation whitelisted in should_aggregate-function
150
+ if( !$this->should_aggregate($tag) ) {
151
+ $tag='';
152
+ continue;
153
+ }
154
+
155
+ if(preg_match('/\ssrc=("|\')?(.*(\ |\>))("|\')?/Usmi',$tag,$source)) {
156
+ $source[2] = substr($source[2], 0, -1);
157
+ if ($this->isremovable($tag,$this->jsremovables)) {
158
+ $content = str_replace($tag,'',$content);
159
+ continue;
160
+ }
161
+
162
+ // External script
163
+ $url = current(explode('?',$source[2],2));
164
+ if ($url[0] == "'" || $url[0] == '"') {
165
+ $url = substr($url, 1);
166
+ }
167
+ if ($url[strlen($url) - 1] == '"' || $url[strlen($url) - 1] == "'") {
168
+ $url = substr($url, 0 , -1);
169
+ }
170
 
171
  //exclude js
172
  if(in_array($url,$this->custom_js_exclude)){
173
  continue;
174
  }
175
 
176
+ $path = $this->getpath($url);
177
+ if($path !== false && preg_match('#\.js$#',$path)) {
178
+ //Inline
179
+ if($this->ismergeable($tag)) {
180
+ //We can merge it
181
+ if ($head) {
182
+ // If this file will be move to footer
183
+ if (in_array($url, $this->move_to_footer_js)) {
184
+ $this->move_to_footer[$url] = $path;
185
+ } else {
186
+ $this->head_scripts[$url] = $path;
187
+ }
188
+ } else {
189
+ $this->footer_scripts[$url] = $path;
190
+ }
191
+ } else {
192
+ //No merge, but maybe we can move it
193
+ if($this->ismovable($tag)) {
194
+ //Yeah, move it
195
+ if($this->movetolast($tag)) {
196
+ $this->move['last'][] = $tag;
197
+ } else {
198
+ $this->move['first'][] = $tag;
199
+ }
200
+ } else {
201
+ //We shouldn't touch this
202
+ $tag = '';
203
+ }
204
+ }
205
+ } else {
206
+ //External script (example: google analytics)
207
+ //OR Script is dynamic (.php etc)
208
+ if($this->ismovable($tag)) {
209
+ if($this->movetolast($tag)) {
210
+ $this->move['last'][] = $tag;
211
+ } else {
212
+ $this->move['first'][] = $tag;
213
+ }
214
+ } else {
215
+ //We shouldn't touch this
216
+ $tag = '';
217
+ }
218
+ }
219
+ } else {
220
+ // Inline script
221
+ if ($this->isremovable($tag,$this->jsremovables)) {
222
+ $content = str_replace($tag,'',$content);
223
+ continue;
224
+ }
225
 
226
+ // unhide comments, as javascript may be wrapped in comment-tags for old times' sake
227
+ $tag = $this->restore_comments($tag);
228
+ if($this->ismergeable($tag) && ( $this->include_inline )) {
229
+ preg_match('#<script.*>(.*)</script>#Usmi',$tag,$code);
230
+ $code = preg_replace('#.*<!\[CDATA\[(?:\s*\*/)?(.*)(?://|/\*)\s*?\]\]>.*#sm','$1',$code[1]);
231
+ $code = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/','',$code);
232
+
233
+ if ($head) {
234
+ $this->head_scripts[] = 'INLINE;'.$code;
235
+ } else {
236
+ $this->footer_scripts[] = 'INLINE;'.$code;
237
+ }
238
+ } else {
239
+ // Can we move this?
240
+ if($this->ismovable($tag)) {
241
+ if($this->movetolast($tag)) {
242
+ $this->move['last'][] = $tag;
243
+ } else {
244
+ $this->move['first'][] = $tag;
245
+ }
246
+ } else {
247
+ //We shouldn't touch this
248
+ $tag = '';
249
+ }
250
+ }
251
+ // re-hide comments to be able to do the removal based on tag from $this->content
252
+ $tag = $this->hide_comments($tag);
253
+ }
254
  //Remove the original script tag
255
+ $content = str_replace($tag,'',$content);
256
+ }
257
+ }
258
+
259
+ if ($head) {
260
+ $this->content = $content;
261
+ } else {
262
+ $this->content .= '</head>' . $content;
263
+ }
264
+
265
+ return true;
266
+ }
267
+
268
+ public function minify() {
269
+ $this->runMinify($this->head_scripts);
270
+ $this->runMinify($this->footer_scripts, false);
271
+
272
+ return true;
273
+ }
274
+
275
  //Joins and optimizes JS
276
+ private function runMinify($scripts, $head = true) {
277
+ foreach($scripts as $url => $script) {
278
  if(preg_match('#^INLINE;#',$script)) {
279
  //Inline script
280
  $script = preg_replace('#^INLINE;#','',$script);
288
  $script=$tmpscript;
289
  $this->alreadyminified=true;
290
  }
 
 
 
 
 
291
 
292
+ if ($head) {
293
+ $this->js_head_group[] = $script;
294
+ } else {
295
+ $this->js_footer_group[] = $script;
296
+ }
297
  } else {
298
+ //External script
299
+ if($script !== false && file_exists($script) && is_readable($script)) {
300
  $scriptsrc = file_get_contents($script);
301
  $scriptsrc = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$scriptsrc);
302
  $scriptsrc = rtrim($scriptsrc,";\n\t\r").';';
314
  if($this->group_js == true){
315
  $this->jscode .= "\n" . $scriptsrc;
316
  }else{
317
+ if ($head) {
318
+ $this->js_head_group[$url] = $scriptsrc;
319
+ } else {
320
+ $this->js_footer_group[$url] = $scriptsrc;
321
+ }
322
  }
 
323
  }/*else{
324
  //Couldn't read JS. Maybe getpath isn't working?
325
  }*/
326
  }
327
  }
328
+
329
+ // Minify JS
330
+ // When using group JS
331
+ if (!$head && !empty($this->jscode)) {
332
  //Check for already-minified code
333
  $this->md5hash = md5($this->jscode);
334
  $ccheck = new Breeze_MinificationCache($this->md5hash,'js');
335
  if($ccheck->check()) {
336
  $this->jscode = $ccheck->retrieve();
337
+ $this->alreadyminified = true;
338
  }
339
  unset($ccheck);
340
 
341
  //$this->jscode has all the uncompressed code now.
342
+
343
+ if ($this->alreadyminified !== true) {
344
  if (class_exists('JSMin') && apply_filters( 'breeze_js_do_minify' , true)) {
345
  if (@is_callable(array("JSMin","minify"))) {
346
  $tmp_jscode = trim(JSMin::minify($this->jscode));
348
  $this->jscode = $tmp_jscode;
349
  unset($tmp_jscode);
350
  }
 
 
 
 
 
 
351
  }
 
 
 
352
  }
353
+
354
+ $this->jscode = $this->inject_minified($this->jscode);
355
  }
356
+
357
+ // Get the inline JS and minify
358
+ if (!empty($this->js_head_group) || !empty($this->js_footer_group)) {
359
+ if (!empty($this->js_head_group)) {
360
+ foreach ($this->js_head_group as $jscode) {
361
+ //$this->jscode has all the uncompressed code now.
362
+ if (class_exists('JSMin') && apply_filters('breeze_js_do_minify', true)) {
363
+ if (@is_callable(array("JSMin", "minify"))) {
364
+ $tmp_jscode = trim(JSMin::minify($jscode));
365
+ if (!empty($tmp_jscode)) {
366
+ $jscode = $tmp_jscode;
367
+ unset($tmp_jscode);
368
+ }
369
+ }
370
+ }
371
+
372
+ $this->jscode_inline_head[] = $this->inject_minified($jscode);
373
+ }
374
  }
 
375
 
376
+ if (!empty($this->js_footer_group)) {
377
+ foreach ($this->js_footer_group as $jscode) {
378
+ //$this->jscode has all the uncompressed code now.
379
+ if (class_exists('JSMin') && apply_filters('breeze_js_do_minify', true)) {
380
+ if (@is_callable(array("JSMin", "minify"))) {
381
+ $tmp_jscode = trim(JSMin::minify($jscode));
382
+ if (!empty($tmp_jscode)) {
383
+ $jscode = $tmp_jscode;
384
+ unset($tmp_jscode);
385
+ }
386
+ }
387
+ }
388
+
389
+ $this->jscode_inline_footer[] = $this->inject_minified($jscode);
390
+ }
391
+ }
392
+ }
393
+
394
+ return true;
395
+ }
396
+
397
+ // Not using group JS
398
+ if (!empty($this->js_head_group) || !empty($this->js_footer_group)) {
399
+ if ($head && !empty($this->js_head_group)) {
400
+ foreach ($this->js_head_group as $url => $jscode) {
401
+ //Check for already-minified code
402
+ $this->md5hash = md5($jscode);
403
+ $ccheck = new Breeze_MinificationCache($this->md5hash, 'js');
404
+
405
+ if ($ccheck->check()) {
406
+ $js_exist = $ccheck->retrieve();
407
+ $this->js_min_head[$url] = $this->md5hash . '_breezejsgroup_' . $js_exist;
408
+ continue;
409
+ }
410
+ unset($ccheck);
411
+
412
+ //$this->jscode has all the uncompressed code now.
413
 
414
+ if (class_exists('JSMin') && apply_filters('breeze_js_do_minify', true)) {
415
+ if (@is_callable(array("JSMin", "minify"))) {
416
  $tmp_jscode = trim(JSMin::minify($jscode));
417
  if (!empty($tmp_jscode)) {
418
  $jscode = $tmp_jscode;
419
  unset($tmp_jscode);
420
  }
421
+ }
422
+ }
 
 
 
 
423
 
424
+ $jscode = $this->inject_minified($jscode);
425
+ $this->js_min_head[$url] = $this->md5hash . '_breezejsgroup_' . $jscode;
426
+ }
427
+ }
428
+
429
+ if (!$head && !empty($this->js_footer_group)) {
430
+ foreach ($this->js_footer_group as $url => $jscode) {
431
+ //Check for already-minified code
432
+ $this->md5hash = md5($jscode);
433
+ $ccheck = new Breeze_MinificationCache($this->md5hash, 'js');
434
+ if ($ccheck->check()) {
435
+ $js_exist = $ccheck->retrieve();
436
+ $this->js_min_footer[$url] = $this->md5hash . '_breezejsgroup_' . $js_exist;
437
+ continue;
438
+ }
439
+ unset($ccheck);
440
+
441
+ //$this->jscode has all the uncompressed code now.
442
+
443
+ if (class_exists('JSMin') && apply_filters('breeze_js_do_minify', true)) {
444
+ if (@is_callable(array("JSMin", "minify"))) {
445
+ $tmp_jscode = trim(JSMin::minify($jscode));
446
+ if (!empty($tmp_jscode)) {
447
+ $jscode = $tmp_jscode;
448
+ unset($tmp_jscode);
449
+ }
450
  }
 
 
 
451
  }
452
 
453
+ $jscode = $this->inject_minified($jscode);
454
+ $this->js_min_footer[$url] = $this->md5hash . '_breezejsgroup_' . $jscode;
455
+ }
456
  }
457
  }
458
+
459
+ return true;
460
  }
461
+
462
  //Caches the JS in uncompressed, deflated and gzipped form.
463
  public function cache() {
464
  if($this->group_js == true){
470
  $this->url = breeze_CACHE_URL.$cache->getname();
471
  $this->url = $this->url_replace_cdn($this->url);
472
  }else{
473
+ foreach ($this->js_min_head as $old_url => $js_min){
474
+ $namehash = substr($js_min, 0 , strpos($js_min,'_breezejsgroup_'));
475
+ $js_code = substr($js_min,strpos($js_min,'_breezejsgroup_')+strlen('_breezejsgroup_'));
476
+ $cache = new Breeze_MinificationCache($namehash,'js');
477
+ if(!$cache->check()) {
478
+ //Cache our code
479
+ $cache->cache($js_code,'text/javascript');
480
+ }
481
+ $url = breeze_CACHE_URL.$cache->getname();
482
+ $this->url_group_head[$old_url]= $this->url_replace_cdn($url);
483
+ }
484
+
485
+ foreach ($this->js_min_footer as $old_url => $js_min){
486
  $namehash = substr($js_min, 0 , strpos($js_min,'_breezejsgroup_'));
487
  $js_code = substr($js_min,strpos($js_min,'_breezejsgroup_')+strlen('_breezejsgroup_'));
488
  $cache = new Breeze_MinificationCache($namehash,'js');
491
  $cache->cache($js_code,'text/javascript');
492
  }
493
  $url = breeze_CACHE_URL.$cache->getname();
494
+ $this->url_group_footer[$old_url]= $this->url_replace_cdn($url);
495
  }
496
  }
497
  }
500
  public function getcontent() {
501
  // Restore the full content
502
  if(!empty($this->restofcontent)) {
503
+ $this->content .= $this->restofcontent;
504
  $this->restofcontent = '';
505
  }
506
+
507
+ // Load inline JS to html
508
+ if (!empty($this->jscode_inline_head)) {
509
+ $replaceTag = array("</head>", "before");
510
+
511
+ foreach ($this->jscode_inline_head as $js) {
512
+ $jsHead[] = '<script type="text/javascript">'.$js.'</script>';
 
 
 
 
 
 
 
 
 
 
 
513
  }
514
+ $jsReplacement = '';
515
+ $jsReplacement .= implode('', $jsHead);
516
+ $this->inject_in_html($jsReplacement, $replaceTag);
517
  }
 
 
 
 
518
 
519
+ if (!empty($this->jscode_inline_footer)) {
520
+ $replaceTag = array("</body>", "before");
521
+
522
+ foreach ($this->jscode_inline_footer as $js) {
523
+ $jsFooter[] = '<script type="text/javascript">'.$js.'</script>';
524
+ }
525
+ $jsReplacement = '';
526
+ $jsReplacement .= implode('', $jsFooter);
527
+ $this->inject_in_html($jsReplacement, $replaceTag);
528
+ }
529
+
530
+ //$defer = apply_filters('breeze_filter_js_defer', $defer);
531
+
532
+ if ($this->group_js == true) {
533
+ $replaceTag = array("</body>", "before");
534
+
535
+ $bodyreplacementpayload = '<script type="text/javascript" defer src="'.$this->url.'"></script>';
536
+ $bodyreplacementpayload = apply_filters('breeze_filter_js_bodyreplacementpayload', $bodyreplacementpayload);
537
+
538
+ $bodyreplacement = implode('',$this->move['first']);
539
+ $bodyreplacement .= $bodyreplacementpayload;
540
+ $bodyreplacement .= implode('',$this->move['last']);
541
+
542
+ $replaceTag = apply_filters( 'breeze_filter_js_replacetag', $replaceTag );
543
+
544
  if (strlen($this->jscode)>0) {
545
  $this->inject_in_html($bodyreplacement,$replaceTag);
546
  }
547
+ } else {
548
+ $headScript = array();
549
+ $footerScript = array();
550
+
551
+ if (!empty($this->url_group_head)) {
552
+ $replaceTag = array("</head>", "before");
553
+
554
+ foreach ($this->url_group_head as $old_url => $url) {
555
+ $defer = '';
556
+ if (gettype($old_url) == 'string' && in_array($old_url, $this->defer_js)) {
557
+ $defer = 'defer ';
558
+ }
559
+
560
+ $headScript[] = '<script type="text/javascript" ' . $defer . 'src="' . $url . '"></script>';
561
+ }
562
+ $jsReplacementPayload = implode('', $headScript);
563
 
564
+ $jsReplacement = implode('', $this->move['first']);
565
+ $jsReplacement .= $jsReplacementPayload;
566
 
567
+ $replaceTag = apply_filters('breeze_filter_js_replacetag', $replaceTag);
568
+
569
+ if (!empty($this->js_min_head)) {
570
+ $this->inject_in_html($jsReplacement, $replaceTag);
571
+ }
572
+ }
573
+
574
+ if (!empty($this->url_group_footer)) {
575
+ $replaceTag = array("</body>", "before");
576
+
577
+ foreach ($this->url_group_footer as $old_url => $url) {
578
+ $defer = '';
579
+ if (gettype($old_url) == 'string' && in_array($old_url, $this->defer_js)) {
580
+ $defer = 'defer ';
581
+ }
582
+
583
+ $footerScript[] = '<script type="text/javascript" ' . $defer . 'src="' . $url . '"></script>';
584
+ }
585
+ $jsReplacementPayload = implode('', $footerScript);
586
+
587
+ $jsReplacement = $jsReplacementPayload;
588
+ $jsReplacement .= implode('', $this->move['last']);
589
+
590
+ $replaceTag = apply_filters('breeze_filter_js_replacetag', $replaceTag);
591
+
592
+ if (!empty($this->js_min_footer)) {
593
+ $this->inject_in_html($jsReplacement, $replaceTag);
594
+ }
595
+ }
596
+ }
597
 
598
  // restore comments
599
  $this->content = $this->restore_comments($this->content);
681
  //Should be in 'first'
682
  return false;
683
  }
684
+
685
+ /**
686
  * Determines wheter a <script> $tag should be aggregated or not.
687
  *
688
  * We consider these as "aggregation-safe" currently:
inc/minification/breeze-minify-main.php CHANGED
@@ -141,12 +141,17 @@ class Breeze_Minify {
141
 
142
  // Choose the classes
143
  $classes = array();
 
144
  if (!empty($conf['breeze-minify-js']))
145
  $classes[] = 'Breeze_MinificationScripts';
146
  if (!empty($conf['breeze-minify-css']))
147
  $classes[] = 'Breeze_MinificationStyles';
148
  if (!empty($conf['breeze-minify-html']))
149
  $classes[] = 'Breeze_MinificationHtml';
 
 
 
 
150
  $groupcss = false;
151
  $groupjs = false;
152
  if (!empty($minify['breeze-group-css'])){
@@ -155,6 +160,7 @@ class Breeze_Minify {
155
  if (!empty($minify['breeze-group-js'])){
156
  $groupjs = true;
157
  }
 
158
  // Set some options
159
  $classoptions = array(
160
  'Breeze_MinificationScripts' => array(
@@ -163,9 +169,11 @@ class Breeze_Minify {
163
  'trycatch' => false,
164
  'js_exclude' => "s_sid, smowtion_size, sc_project, WAU_, wau_add, comment-form-quicktags, edToolbar, ch_client, seal.js",
165
  'cdn_url' => "",
166
- 'include_inline' => true,
167
  'group_js' => $groupjs,
168
- 'custom_js_exclude' => $minify['breeze-exclude-js']
 
 
169
  ),
170
  'Breeze_MinificationStyles' => array(
171
  'justhead' => false,
@@ -175,7 +183,7 @@ class Breeze_Minify {
175
  'inline' => false,
176
  'css_exclude' => "admin-bar.min.css, dashicons.min.css",
177
  'cdn_url' => "",
178
- 'include_inline' => true,
179
  'nogooglefont' => false,
180
  'groupcss' => $groupcss,
181
  'custom_css_exclude' => $minify['breeze-exclude-css']
141
 
142
  // Choose the classes
143
  $classes = array();
144
+ $js_include_inline = $css_include_inline = false;
145
  if (!empty($conf['breeze-minify-js']))
146
  $classes[] = 'Breeze_MinificationScripts';
147
  if (!empty($conf['breeze-minify-css']))
148
  $classes[] = 'Breeze_MinificationStyles';
149
  if (!empty($conf['breeze-minify-html']))
150
  $classes[] = 'Breeze_MinificationHtml';
151
+ if (!empty($conf['breeze-include-inline-js']))
152
+ $js_include_inline = true;
153
+ if (!empty($conf['breeze-include-inline-css']))
154
+ $css_include_inline = true;
155
  $groupcss = false;
156
  $groupjs = false;
157
  if (!empty($minify['breeze-group-css'])){
160
  if (!empty($minify['breeze-group-js'])){
161
  $groupjs = true;
162
  }
163
+
164
  // Set some options
165
  $classoptions = array(
166
  'Breeze_MinificationScripts' => array(
169
  'trycatch' => false,
170
  'js_exclude' => "s_sid, smowtion_size, sc_project, WAU_, wau_add, comment-form-quicktags, edToolbar, ch_client, seal.js",
171
  'cdn_url' => "",
172
+ 'include_inline' => $js_include_inline,
173
  'group_js' => $groupjs,
174
+ 'custom_js_exclude' => $minify['breeze-exclude-js'],
175
+ 'move_to_footer_js' => $minify['breeze-move-to-footer-js'],
176
+ 'defer_js' => $minify['breeze-defer-js']
177
  ),
178
  'Breeze_MinificationStyles' => array(
179
  'justhead' => false,
183
  'inline' => false,
184
  'css_exclude' => "admin-bar.min.css, dashicons.min.css",
185
  'cdn_url' => "",
186
+ 'include_inline' => $css_include_inline,
187
  'nogooglefont' => false,
188
  'groupcss' => $groupcss,
189
  'custom_css_exclude' => $minify['breeze-exclude-css']
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Cloudways
3
  Tags: cache, caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
4
  Requires at least: 4.5
5
  Tested up to: 4.9.1
6
- Stable tag: 1.0.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -116,7 +116,7 @@ You can get your questions answered on the WordPress support forums. If you are
116
  = How can I test and verify the results? =
117
 
118
  You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:
119
- <a style="margin-top: 10px" href="https://developers.google.com/speed/pagespeed/" target="_blank">Google Page Speed</a>
120
  <a href="https://www.webpagetest.org/test" target="_blank">WebPagetest</a>
121
  <a href="https://tools.pingdom.com/" target="_blank">Pingdom</a>
122
 
@@ -145,6 +145,12 @@ Using Gzip, Breeze compresses the request files, further reducing the size of th
145
 
146
  == Changelog ==
147
 
 
 
 
 
 
 
148
  = 1.0.8 =
149
  * Fix: Cache exclusion for pages that returns status code other than 200
150
 
3
  Tags: cache, caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
4
  Requires at least: 4.5
5
  Tested up to: 4.9.1
6
+ Stable tag: 1.0.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
116
  = How can I test and verify the results? =
117
 
118
  You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:
119
+ <a href="https://developers.google.com/speed/pagespeed/" target="_blank">Google Page Speed</a>
120
  <a href="https://www.webpagetest.org/test" target="_blank">WebPagetest</a>
121
  <a href="https://tools.pingdom.com/" target="_blank">Pingdom</a>
122
 
145
 
146
  == Changelog ==
147
 
148
+ = 1.0.9 =
149
+ * Add: Option to move JS file to footer during minification
150
+ * Add: Option to deffer loading for JS files
151
+ * Add: Option to include inline CSS
152
+ * Add: Option to include inline JS
153
+
154
  = 1.0.8 =
155
  * Fix: Cache exclusion for pages that returns status code other than 200
156
 
views/breeze-setting-views.php CHANGED
@@ -15,6 +15,8 @@ if (is_multisite() && get_current_screen()->base !== 'settings_page_breeze-netwo
15
  'faq' => __('FAQs', 'breeze')
16
  );
17
  }
 
 
18
  ?>
19
  <?php if (isset($_REQUEST['database-cleanup']) && $_REQUEST['database-cleanup'] == 'success'): ?>
20
  <div id="message-save-settings" class="notice notice-success" style="margin: 10px 0px 10px 0;padding: 10px;"><strong><?php _e('Database cleanup successful', 'breeze'); ?></strong></div>
@@ -30,9 +32,7 @@ if (is_multisite() && get_current_screen()->base !== 'settings_page_breeze-netwo
30
  </a>
31
  </div>
32
 
33
- <h1></h1>
34
-
35
- <div style="clear: both"></div>
36
 
37
  <ul id="breeze-tabs" class="nav-tab-wrapper">
38
  <?php
@@ -54,12 +54,12 @@ if (is_multisite() && get_current_screen()->base !== 'settings_page_breeze-netwo
54
  echo '</div>';
55
  if ($key == 'database'){
56
  echo '<p class="submit">
57
- <input type="submit" class="button button-primary" value="Optimize"/>
58
  </p>';
59
  }else{
60
  if ($key != 'faq') {
61
  echo '<p class="submit">
62
- <input type="submit" class="button button-primary" value="Save Changes"/>
63
  </p>';
64
  }
65
  }
@@ -67,5 +67,26 @@ if (is_multisite() && get_current_screen()->base !== 'settings_page_breeze-netwo
67
  echo '</div>';
68
  }
69
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  </div>
71
  </div>
15
  'faq' => __('FAQs', 'breeze')
16
  );
17
  }
18
+
19
+ wp_enqueue_script('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js');
20
  ?>
21
  <?php if (isset($_REQUEST['database-cleanup']) && $_REQUEST['database-cleanup'] == 'success'): ?>
22
  <div id="message-save-settings" class="notice notice-success" style="margin: 10px 0px 10px 0;padding: 10px;"><strong><?php _e('Database cleanup successful', 'breeze'); ?></strong></div>
32
  </a>
33
  </div>
34
 
35
+ <h1 style="clear: both"></h1>
 
 
36
 
37
  <ul id="breeze-tabs" class="nav-tab-wrapper">
38
  <?php
54
  echo '</div>';
55
  if ($key == 'database'){
56
  echo '<p class="submit">
57
+ <input type="submit" class="button button-primary" value="'. __('Optimize', 'breeze') .'"/>
58
  </p>';
59
  }else{
60
  if ($key != 'faq') {
61
  echo '<p class="submit">
62
+ <input type="submit" class="button button-primary" value="'. __('Save Changes', 'breeze') .'"/>
63
  </p>';
64
  }
65
  }
67
  echo '</div>';
68
  }
69
  ?>
70
+
71
+ <!--Right-side content-->
72
+ <div id="breeze-and-cloudways" class="rs-block">
73
+ <h3 class="rs-title"><?php _e('Want to Experience Better Performance?', 'breeze') ?></h3>
74
+ <div class="rs-content">
75
+ <p><?php _e('Take advantage of powerful features by deploying WordPress and Breeze on Cloudways.', 'breeze') ?></p>
76
+ <ul>
77
+ <li><?php _e('Fully Compatible with Varnish', 'breeze') ?></li>
78
+ <li><?php _e('One-Click setup of CloudwaysCDN', 'breeze') ?></li>
79
+ <li><?php _e('24/7 Expert Human Support', 'breeze') ?></li>
80
+ <li><?php _e('WooCommerce Compatible', 'breeze') ?></li>
81
+ </ul>
82
+ <button class="button button-primary">
83
+ <a href="https://www.cloudways.com/en/wordpress-cloud-hosting.php?utm_source=breeze-plugin&utm_medium=breeze&utm_campaign=breeze" target="_blank"><?php _e('Find Out More', 'breeze') ?></a>
84
+ </button>
85
+ </div>
86
+ <div class="rs-content">
87
+ <h4><?php _e('Rate Breeze', 'breeze') ?></h4>
88
+ <p><?php _e('If you are satisfied with Breeze\'s performance, <a href="https://wordpress.org/plugins/breeze#reviews" target="_blank">drop us a rating here.</a>', 'breeze') ?></p>
89
+ </div>
90
+ </div>
91
  </div>
92
  </div>
views/tabs/advanced.php CHANGED
@@ -14,8 +14,8 @@
14
  $output = implode("\n", $advanced['breeze-exclude-urls']);
15
  echo esc_textarea($output);
16
  } ?></textarea>
17
- <br>
18
- <label class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Add the URLs of the pages (one per line) you wish to exclude from the WordPress internal cache. To exclude URLs from the Varnish cache, please refer to this ', 'breeze') ?><a href="https://support.cloudways.com/how-to-exclude-url-from-varnish/" target="_blank"><?php _e('Knowledge Base','breeze')?></a><?php _e(' article.','breeze')?> </label>
19
  </td>
20
  </tr>
21
  <tr>
@@ -25,18 +25,20 @@
25
  <td>
26
  <ul>
27
  <li>
28
- <input type="checkbox" name="group-css" value="1" <?php checked($advanced['breeze-group-css'],'1')?>/>
29
- <label class="breeze_tool_tip"><?php _e('CSS','breeze')?></label>
 
30
  </li>
31
  <li>
32
- <input type="checkbox" name="group-js" value="1" <?php checked($advanced['breeze-group-js'],'1')?>/>
33
- <label class="breeze_tool_tip"><?php _e('JS','breeze')?></label>
 
34
  </li>
35
  <li>
36
- <label class="breeze_tool_tip">
37
  <b>Note:&nbsp;</b><?php _e('Group CSS and JS files to combine them into a single file. This will reduce the number of HTTP requests to your server.', 'breeze') ?><br>
38
  <b><?php _e('Important: Enable Minification to use this option.','breeze')?></b>
39
- </label>
40
  </li>
41
  </ul>
42
  </td>
@@ -51,8 +53,8 @@
51
  $output = implode("\n", $advanced['breeze-exclude-css']);
52
  echo esc_textarea($output);
53
  } ?></textarea>
54
- <br>
55
- <label class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use this option to exclude CSS files from Minification and Grouping. Enter the URLs of CSS files on each line.', 'breeze') ?></label>
56
  </td>
57
  </tr>
58
  <tr>
@@ -65,8 +67,111 @@
65
  $output = implode("\n", $advanced['breeze-exclude-js']);
66
  echo esc_textarea($output);
67
  } ?></textarea>
68
- <br>
69
- <label class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use this option to exclude JS files from Minification and Grouping. Enter the URLs of JS files on each line.', 'breeze') ?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  </td>
71
  </tr>
72
  </table>
14
  $output = implode("\n", $advanced['breeze-exclude-urls']);
15
  echo esc_textarea($output);
16
  } ?></textarea>
17
+ <br/>
18
+ <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Add the URLs of the pages (one per line) you wish to exclude from the WordPress internal cache. To exclude URLs from the Varnish cache, please refer to this ', 'breeze') ?><a href="https://support.cloudways.com/how-to-exclude-url-from-varnish/" target="_blank"><?php _e('Knowledge Base','breeze')?></a><?php _e(' article.','breeze')?> </span>
19
  </td>
20
  </tr>
21
  <tr>
25
  <td>
26
  <ul>
27
  <li>
28
+ <input type="checkbox" name="group-css" id="group-css"
29
+ value="1" <?php checked($advanced['breeze-group-css'],'1')?>/>
30
+ <label class="breeze_tool_tip" for="group-css"><?php _e('CSS','breeze')?></label>
31
  </li>
32
  <li>
33
+ <input type="checkbox" name="group-js" id="group-js"
34
+ value="1" <?php checked($advanced['breeze-group-js'],'1')?>/>
35
+ <label class="breeze_tool_tip" for="group-js"><?php _e('JS','breeze')?></label>
36
  </li>
37
  <li>
38
+ <span class="breeze_tool_tip">
39
  <b>Note:&nbsp;</b><?php _e('Group CSS and JS files to combine them into a single file. This will reduce the number of HTTP requests to your server.', 'breeze') ?><br>
40
  <b><?php _e('Important: Enable Minification to use this option.','breeze')?></b>
41
+ </span>
42
  </li>
43
  </ul>
44
  </td>
53
  $output = implode("\n", $advanced['breeze-exclude-css']);
54
  echo esc_textarea($output);
55
  } ?></textarea>
56
+ <br/>
57
+ <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use this option to exclude CSS files from Minification and Grouping. Enter the URLs of CSS files on each line.', 'breeze') ?></span>
58
  </td>
59
  </tr>
60
  <tr>
67
  $output = implode("\n", $advanced['breeze-exclude-js']);
68
  echo esc_textarea($output);
69
  } ?></textarea>
70
+ <br/>
71
+ <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use this option to exclude JS files from Minification and Grouping. Enter the URLs of JS files on each line.', 'breeze') ?></span>
72
+ </td>
73
+ </tr>
74
+ <tr>
75
+ <td>
76
+ <label for="move-to-footer-js" class="breeze_tool_tip"><?php _e('Move JS files to footer', 'breeze') ?></label>
77
+ </td>
78
+ <td>
79
+ <div class="breeze-list-url">
80
+ <?php if (!empty($advanced['breeze-move-to-footer-js'])) : ?>
81
+ <?php foreach ($advanced['breeze-move-to-footer-js'] as $js_url) : ?>
82
+ <div class="breeze-input-group">
83
+ <span class="sort-handle">
84
+ <span class="dashicons dashicons-arrow-up moveUp"></span>
85
+ <span class="dashicons dashicons-arrow-down moveDown"></span>
86
+ </span>
87
+ <input type="text" size="98"
88
+ class="breeze-input-url"
89
+ name="move-to-footer-js[]"
90
+ placeholder="<?php _e('Enter URL...', 'breeze') ?>"
91
+ value="<?php echo esc_html($js_url) ?>" />
92
+ <span class="dashicons dashicons-no item-remove" title="<?php _e('Remove', 'breeze') ?>"></span>
93
+ </div>
94
+ <?php endforeach; ?>
95
+ <?php else : ?>
96
+ <div class="breeze-input-group">
97
+ <span class="sort-handle">
98
+ <span class="dashicons dashicons-arrow-up moveUp"></span>
99
+ <span class="dashicons dashicons-arrow-down moveDown"></span>
100
+ </span>
101
+ <input type="text" size="98"
102
+ class="breeze-input-url"
103
+ id="move-to-footer-js"
104
+ name="move-to-footer-js[]"
105
+ placeholder="<?php _e('Enter URL...', 'breeze') ?>"
106
+ value="" />
107
+ <span class="dashicons dashicons-no" title="<?php _e('Remove', 'breeze') ?>"></span>
108
+ </div>
109
+ <?php endif; ?>
110
+ </div>
111
+ <div style="margin: 10px 0">
112
+ <button type="button" class="button add-url" id="add-move-to-footer-js">
113
+ <?php _e('Add URL', 'breeze') ?>
114
+ </button>
115
+ </div>
116
+ <div>
117
+ <span class="breeze_tool_tip">
118
+ <b>Note:&nbsp;</b>
119
+ <?php _e('Enter the complete URLs of JS files to be moved to the footer during minification process.', 'breeze') ?>
120
+ </span>
121
+ <span class="breeze_tool_tip">
122
+ <?php _e('You should add the URL of original files as URL of minified files are not supported.', 'breeze') ?>
123
+ </span>
124
+ </div>
125
+ </td>
126
+ </tr>
127
+ <tr>
128
+ <td>
129
+ <label for="defer-js" class="breeze_tool_tip"><?php _e('JS files with deferred loading', 'breeze') ?></label>
130
+ </td>
131
+ <td>
132
+ <div class="breeze-list-url">
133
+ <?php if (!empty($advanced['breeze-defer-js'])) : ?>
134
+ <?php foreach ($advanced['breeze-defer-js'] as $js_url) : ?>
135
+ <div class="breeze-input-group">
136
+ <span class="sort-handle">
137
+ <span class="dashicons dashicons-arrow-up moveUp"></span>
138
+ <span class="dashicons dashicons-arrow-down moveDown"></span>
139
+ </span>
140
+ <input type="text" size="98"
141
+ class="breeze-input-url"
142
+ name="defer-js[]"
143
+ placeholder="<?php _e('Enter URL...', 'breeze') ?>"
144
+ value="<?php echo esc_html($js_url) ?>" />
145
+ <span class="dashicons dashicons-no item-remove" title="<?php _e('Remove', 'breeze') ?>"></span>
146
+ </div>
147
+ <?php endforeach; ?>
148
+ <?php else : ?>
149
+ <div class="breeze-input-group">
150
+ <span class="sort-handle">
151
+ <span class="dashicons dashicons-arrow-up moveUp"></span>
152
+ <span class="dashicons dashicons-arrow-down moveDown"></span>
153
+ </span>
154
+ <input type="text" size="98"
155
+ class="breeze-input-url"
156
+ name="defer-js[]"
157
+ id="defer-js"
158
+ placeholder="<?php _e('Enter URL...', 'breeze') ?>"
159
+ value="" />
160
+ <span class="dashicons dashicons-no item-remove" title="<?php _e('Remove', 'breeze') ?>"></span>
161
+ </div>
162
+ <?php endif; ?>
163
+ </div>
164
+ <div style="margin: 10px 0">
165
+ <button type="button" class="button add-url" id="add-defer-js">
166
+ <?php _e('Add URL', 'breeze') ?>
167
+ </button>
168
+ </div>
169
+ <div>
170
+ <span class="breeze_tool_tip">
171
+ <b>Note:&nbsp;</b>
172
+ <?php _e('You should add the URL of original files as URL of minified files are not supported.', 'breeze') ?>
173
+ </span>
174
+ </div>
175
  </td>
176
  </tr>
177
  </table>
views/tabs/basic.php CHANGED
@@ -11,9 +11,9 @@ $basic = get_option('breeze_basic_settings');
11
  <td>
12
  <input type="checkbox" id="cache-system" name="cache-system"
13
  value='1' <?php checked($basic['breeze-active'], '1') ?>/>
14
- <label class="breeze_tool_tip">
15
  <?php _e('This is the basic cache that we recommend should be kept enabled in all cases. Basic cache will build the internal and static caches for the WordPress websites.', 'breeze') ?>
16
- </label>
17
  </td>
18
  </tr>
19
  <tr>
@@ -23,9 +23,9 @@ $basic = get_option('breeze_basic_settings');
23
  <td>
24
  <input type="text" id="cache-ttl" size="5" name="cache-ttl"
25
  value='<?php echo(!empty($basic['breeze-ttl']) ? (int)$basic['breeze-ttl'] : '1440'); ?>'/>
26
- <label class="breeze_tool_tip" style="vertical-align: baseline">
27
  <?php _e('Automatically purge internal cache after X minutes. By default this is set to 1440 minutes (1 day)', 'breeze') ?>
28
- </label>
29
  </td>
30
  </tr>
31
  <tr>
@@ -35,26 +35,46 @@ $basic = get_option('breeze_basic_settings');
35
  <td>
36
  <ul>
37
  <li>
38
- <input type="checkbox" name="minification-html"
39
  value="1" <?php checked($basic['breeze-minify-html'], '1') ?>/>
40
- <label class="breeze_tool_tip"><?php _e('HTML', 'breeze') ?></label>
 
 
41
  </li>
42
  <li>
43
- <input type="checkbox" name="minification-css"
44
  value="1" <?php checked($basic['breeze-minify-css'], '1') ?>/>
45
- <label class="breeze_tool_tip"><?php _e('CSS', 'breeze') ?></label>
 
 
46
  </li>
47
  <li>
48
- <input type="checkbox" name="minification-js"
49
  value="1" <?php checked($basic['breeze-minify-js'], '1') ?>/>
50
- <label class="breeze_tool_tip"><?php _e('JS', 'breeze') ?></label>
 
 
 
 
 
 
 
 
 
51
  </li>
52
  <li>
53
- <label><?php _e('Check the above boxes to minify HTML, CSS, or JS files.', 'breeze') ?></label>
 
 
 
 
 
 
 
54
  <br>
55
- <label><b>Note:&nbsp;</b>
56
  <span style="color: #ff0000"><?php _e('We recommend testing minification on a staging website before deploying it on a live website. Minification is known to cause issues on the frontend.', 'breeze') ?></span>
57
- </label>
58
  </li>
59
  </ul>
60
 
@@ -67,7 +87,7 @@ $basic = get_option('breeze_basic_settings');
67
  <td>
68
  <input type="checkbox" id="gzip-compression" name="gzip-compression"
69
  value='1' <?php checked($basic['breeze-gzip-compression'], '1') ?>/>
70
- <label class="breeze_tool_tip"><?php _e('Enable this to compress your files making HTTP requests fewer and faster.', 'breeze') ?></label>
71
  </td>
72
  </tr>
73
  <tr>
@@ -77,7 +97,7 @@ $basic = get_option('breeze_basic_settings');
77
  <td>
78
  <input type="checkbox" id="browser-cache" name="browser-cache"
79
  value='1' <?php checked($basic['breeze-browser-cache'], '1') ?>/>
80
- <label class="breeze_tool_tip"><?php _e('Enable this to add expires headers to static files. This will ask browsers to either request a file from server or fetch from the browser’s cache.', 'breeze') ?></label>
81
  </td>
82
  </tr>
83
 
11
  <td>
12
  <input type="checkbox" id="cache-system" name="cache-system"
13
  value='1' <?php checked($basic['breeze-active'], '1') ?>/>
14
+ <span class="breeze_tool_tip">
15
  <?php _e('This is the basic cache that we recommend should be kept enabled in all cases. Basic cache will build the internal and static caches for the WordPress websites.', 'breeze') ?>
16
+ </span>
17
  </td>
18
  </tr>
19
  <tr>
23
  <td>
24
  <input type="text" id="cache-ttl" size="5" name="cache-ttl"
25
  value='<?php echo(!empty($basic['breeze-ttl']) ? (int)$basic['breeze-ttl'] : '1440'); ?>'/>
26
+ <span class="breeze_tool_tip" style="vertical-align: baseline">
27
  <?php _e('Automatically purge internal cache after X minutes. By default this is set to 1440 minutes (1 day)', 'breeze') ?>
28
+ </span>
29
  </td>
30
  </tr>
31
  <tr>
35
  <td>
36
  <ul>
37
  <li>
38
+ <input type="checkbox" name="minification-html" id="minification-html"
39
  value="1" <?php checked($basic['breeze-minify-html'], '1') ?>/>
40
+ <label class="breeze_tool_tip" for="minification-html">
41
+ <?php _e('HTML', 'breeze') ?>
42
+ </label>
43
  </li>
44
  <li>
45
+ <input type="checkbox" name="minification-css" id="minification-css"
46
  value="1" <?php checked($basic['breeze-minify-css'], '1') ?>/>
47
+ <label class="breeze_tool_tip" for="minification-css">
48
+ <?php _e('CSS', 'breeze') ?>
49
+ </label>
50
  </li>
51
  <li>
52
+ <input type="checkbox" name="minification-js" id="minification-js"
53
  value="1" <?php checked($basic['breeze-minify-js'], '1') ?>/>
54
+ <label class="breeze_tool_tip" for="minification-js">
55
+ <?php _e('JS', 'breeze') ?>
56
+ </label>
57
+ </li>
58
+ <li>
59
+ <input type="checkbox" name="include-inline-js" id="include-inline-js"
60
+ value="1" <?php checked($basic['breeze-include-inline-js'], '1') ?>/>
61
+ <label class="breeze_tool_tip" for="include-inline-js">
62
+ <?php _e('Include inline JS', 'breeze') ?>
63
+ </label>
64
  </li>
65
  <li>
66
+ <input type="checkbox" name="include-inline-css" id="include-inline-css"
67
+ value="1" <?php checked($basic['breeze-include-inline-css'], '1') ?>/>
68
+ <label class="breeze_tool_tip" for="include-inline-css">
69
+ <?php _e('Include inline CSS', 'breeze') ?>
70
+ </label>
71
+ </li>
72
+ <li>
73
+ <span><?php _e('Check the above boxes to minify HTML, CSS, or JS files.', 'breeze') ?></span>
74
  <br>
75
+ <span><b>Note:&nbsp;</b>
76
  <span style="color: #ff0000"><?php _e('We recommend testing minification on a staging website before deploying it on a live website. Minification is known to cause issues on the frontend.', 'breeze') ?></span>
77
+ </span>
78
  </li>
79
  </ul>
80
 
87
  <td>
88
  <input type="checkbox" id="gzip-compression" name="gzip-compression"
89
  value='1' <?php checked($basic['breeze-gzip-compression'], '1') ?>/>
90
+ <span class="breeze_tool_tip"><?php _e('Enable this to compress your files making HTTP requests fewer and faster.', 'breeze') ?></span>
91
  </td>
92
  </tr>
93
  <tr>
97
  <td>
98
  <input type="checkbox" id="browser-cache" name="browser-cache"
99
  value='1' <?php checked($basic['breeze-browser-cache'], '1') ?>/>
100
+ <span class="breeze_tool_tip"><?php _e('Enable this to add expires headers to static files. This will ask browsers to either request a file from server or fetch from the browser’s cache.', 'breeze') ?></span>
101
  </td>
102
  </tr>
103
 
views/tabs/cdn.php CHANGED
@@ -19,7 +19,7 @@
19
  </td>
20
  <td>
21
  <input type="checkbox" id="activate-cdn" name="activate-cdn" value="1" <?php checked($cdn_integration['cdn-active'],'1')?>/>
22
- <label class="breeze_tool_tip"><?php _e('Enable to make CDN effective on your website.', 'breeze')?></label>
23
  </td>
24
  </tr>
25
  <tr>
@@ -28,9 +28,9 @@
28
  </td>
29
  <td>
30
  <input type="text" id="cdn-url" name="cdn-url" size="50" placeholder="<?php _e('https://www.domain.com','breeze')?>" value="<?php echo (($cdn_integration['cdn-url'])?esc_html($cdn_integration['cdn-url']):''); ?>"/>
31
- <label style="vertical-align: baseline" class="breeze_tool_tip"><?php _e('Enter CDN CNAME.', 'breeze')?></label>
32
  <br>
33
- <label class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use double slash ‘//’ at the start of CDN CNAME, if you have some pages on HTTP and some are on HTTPS.', 'breeze') ?></label>
34
  </td>
35
  </tr>
36
  <tr>
@@ -40,7 +40,7 @@
40
  <td>
41
  <input type="text" id="cdn-content" name="cdn-content" size="50" value="<?php echo (($cdn_content_value)?esc_html($cdn_content_value):''); ?>"/>
42
  <br>
43
- <label class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Enter the directories (comma separated) of which you want the CDN to serve the content.', 'breeze') ?></label>
44
  </td>
45
  </tr>
46
  <tr>
@@ -50,7 +50,7 @@
50
  <td>
51
  <input type="text" id="cdn-exclude-content" name="cdn-exclude-content" size="50" value="<?php echo (($cdn_exclude_content_value)?esc_html($cdn_exclude_content_value):''); ?>" />
52
  <br>
53
- <label class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Exclude file types or directories from CDN. Example, enter .css to exclude the CSS files.', 'breeze') ?></label>
54
  </td>
55
  </tr>
56
  <tr>
@@ -59,7 +59,7 @@
59
  </td>
60
  <td>
61
  <input type="checkbox" id="cdn-relative-path" name="cdn-relative-path" value="1" <?php checked($cdn_integration['cdn-relative-path'], '1')?>/>
62
- <label class="breeze_tool_tip"><?php _e('Keep this option enabled. Use this option to enable relative path for your CDN on your WordPress site.', 'breeze')?></label>
63
  </td>
64
  </tr>
65
  </table>
19
  </td>
20
  <td>
21
  <input type="checkbox" id="activate-cdn" name="activate-cdn" value="1" <?php checked($cdn_integration['cdn-active'],'1')?>/>
22
+ <span class="breeze_tool_tip"><?php _e('Enable to make CDN effective on your website.', 'breeze')?></span>
23
  </td>
24
  </tr>
25
  <tr>
28
  </td>
29
  <td>
30
  <input type="text" id="cdn-url" name="cdn-url" size="50" placeholder="<?php _e('https://www.domain.com','breeze')?>" value="<?php echo (($cdn_integration['cdn-url'])?esc_html($cdn_integration['cdn-url']):''); ?>"/>
31
+ <span style="vertical-align: baseline" class="breeze_tool_tip"><?php _e('Enter CDN CNAME.', 'breeze')?></span>
32
  <br>
33
+ <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use double slash ‘//’ at the start of CDN CNAME, if you have some pages on HTTP and some are on HTTPS.', 'breeze') ?></span>
34
  </td>
35
  </tr>
36
  <tr>
40
  <td>
41
  <input type="text" id="cdn-content" name="cdn-content" size="50" value="<?php echo (($cdn_content_value)?esc_html($cdn_content_value):''); ?>"/>
42
  <br>
43
+ <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Enter the directories (comma separated) of which you want the CDN to serve the content.', 'breeze') ?></span>
44
  </td>
45
  </tr>
46
  <tr>
50
  <td>
51
  <input type="text" id="cdn-exclude-content" name="cdn-exclude-content" size="50" value="<?php echo (($cdn_exclude_content_value)?esc_html($cdn_exclude_content_value):''); ?>" />
52
  <br>
53
+ <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Exclude file types or directories from CDN. Example, enter .css to exclude the CSS files.', 'breeze') ?></span>
54
  </td>
55
  </tr>
56
  <tr>
59
  </td>
60
  <td>
61
  <input type="checkbox" id="cdn-relative-path" name="cdn-relative-path" value="1" <?php checked($cdn_integration['cdn-relative-path'], '1')?>/>
62
+ <span class="breeze_tool_tip"><?php _e('Keep this option enabled. Use this option to enable relative path for your CDN on your WordPress site.', 'breeze')?></span>
63
  </td>
64
  </tr>
65
  </table>
views/tabs/database.php CHANGED
@@ -23,7 +23,7 @@ if (is_multisite()) {
23
  }
24
  ?>
25
  <div class="breeze-top-notice">
26
- <label class="breeze_tool_tip"><?php _e('Important: Backup your databases before using the following options!','breeze')?></label>
27
  </div>
28
  <table cellspacing="15">
29
  <tr>
@@ -32,7 +32,7 @@ if (is_multisite()) {
32
  </td>
33
  <td>
34
  <input type="checkbox" id="data0" name="all_control" value="all_data"/>
35
- <label class="breeze_tool_tip"><?php _e('Select all following options. Click Optimize to perform actions.','breeze')?></label>
36
  </td>
37
  </tr>
38
  <tr>
@@ -41,7 +41,7 @@ if (is_multisite()) {
41
  </td>
42
  <td>
43
  <input type="checkbox" id="data1" name="clean[]" class="clean-data" value="revisions"/>
44
- <label class="breeze_tool_tip"><?php _e('Use this option to delete all post revisions from the WordPress database.','breeze')?></label>
45
  </td>
46
  </tr>
47
  <tr>
@@ -50,7 +50,7 @@ if (is_multisite()) {
50
  </td>
51
  <td>
52
  <input type="checkbox" id="data2" name="clean[]" class="clean-data" value="drafted"/>
53
- <label class="breeze_tool_tip"><?php _e('Use this option to delete auto saved drafts from the WordPress database.','breeze')?></label>
54
  </td>
55
  </tr>
56
  <tr>
@@ -59,7 +59,7 @@ if (is_multisite()) {
59
  </td>
60
  <td>
61
  <input type="checkbox" id="data3" name="clean[]" class="clean-data" value="trash"/>
62
- <label class="breeze_tool_tip"><?php _e('Use this option to delete all trashed content from the WordPress database.','breeze')?></label>
63
 
64
  </td>
65
  </tr>
@@ -69,7 +69,7 @@ if (is_multisite()) {
69
  </td>
70
  <td>
71
  <input type="checkbox" id="data4" name="clean[]" class="clean-data" value="comments"/>
72
- <label class="breeze_tool_tip"><?php _e('Use this option to delete trash and spam comments from the WordPress database.','breeze')?></label>
73
  </td>
74
  </tr>
75
  <tr>
@@ -78,7 +78,7 @@ if (is_multisite()) {
78
  </td>
79
  <td>
80
  <input type="checkbox" id="data5" name="clean[]" class="clean-data" value="trackbacks"/>
81
- <label class="breeze_tool_tip"><?php _e('Use this option to delete Trackbacks and Pingbacks from the WordPress database.','breeze')?></label>
82
  </td>
83
  </tr>
84
  <tr>
@@ -87,7 +87,7 @@ if (is_multisite()) {
87
  </td>
88
  <td>
89
  <input type="checkbox" id="data6" name="clean[]" class="clean-data" value="transient"/>
90
- <label class="breeze_tool_tip"><?php _e('Delete expired and active transients from the WordPress database.','breeze')?></label>
91
  </td>
92
  </tr>
93
  </table>
23
  }
24
  ?>
25
  <div class="breeze-top-notice">
26
+ <p class="breeze_tool_tip"><?php _e('Important: Backup your databases before using the following options!','breeze')?></p>
27
  </div>
28
  <table cellspacing="15">
29
  <tr>
32
  </td>
33
  <td>
34
  <input type="checkbox" id="data0" name="all_control" value="all_data"/>
35
+ <span class="breeze_tool_tip"><?php _e('Select all following options. Click Optimize to perform actions.','breeze')?></span>
36
  </td>
37
  </tr>
38
  <tr>
41
  </td>
42
  <td>
43
  <input type="checkbox" id="data1" name="clean[]" class="clean-data" value="revisions"/>
44
+ <span class="breeze_tool_tip"><?php _e('Use this option to delete all post revisions from the WordPress database.','breeze')?></span>
45
  </td>
46
  </tr>
47
  <tr>
50
  </td>
51
  <td>
52
  <input type="checkbox" id="data2" name="clean[]" class="clean-data" value="drafted"/>
53
+ <span class="breeze_tool_tip"><?php _e('Use this option to delete auto saved drafts from the WordPress database.','breeze')?></span>
54
  </td>
55
  </tr>
56
  <tr>
59
  </td>
60
  <td>
61
  <input type="checkbox" id="data3" name="clean[]" class="clean-data" value="trash"/>
62
+ <span class="breeze_tool_tip"><?php _e('Use this option to delete all trashed content from the WordPress database.','breeze')?></span>
63
 
64
  </td>
65
  </tr>
69
  </td>
70
  <td>
71
  <input type="checkbox" id="data4" name="clean[]" class="clean-data" value="comments"/>
72
+ <span class="breeze_tool_tip"><?php _e('Use this option to delete trash and spam comments from the WordPress database.','breeze')?></span>
73
  </td>
74
  </tr>
75
  <tr>
78
  </td>
79
  <td>
80
  <input type="checkbox" id="data5" name="clean[]" class="clean-data" value="trackbacks"/>
81
+ <span class="breeze_tool_tip"><?php _e('Use this option to delete Trackbacks and Pingbacks from the WordPress database.','breeze')?></span>
82
  </td>
83
  </tr>
84
  <tr>
87
  </td>
88
  <td>
89
  <input type="checkbox" id="data6" name="clean[]" class="clean-data" value="transient"/>
90
+ <span class="breeze_tool_tip"><?php _e('Delete expired and active transients from the WordPress database.','breeze')?></span>
91
  </td>
92
  </tr>
93
  </table>
views/tabs/faq.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
  defined('ABSPATH') or die;
3
-
4
- wp_enqueue_script('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js');
5
  ?>
6
  <div id="faq-content">
7
  <div class="faq-block">
@@ -105,10 +103,10 @@ wp_enqueue_script('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/
105
  </div>
106
 
107
  <div class="faq-block">
108
- <h3 class="faq-question"><?php _e('How can I test and verify the results (mentioned on the page)?', 'breeze') ?></h3>
109
  <div class="faq-answer">
110
  <p><?php _e('You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:', 'breeze') ?></p>
111
- <ul>
112
  <li><a href="https://developers.google.com/speed/pagespeed/" target="_blank"><?php _e('Google Page Speed', 'breeze') ?></a></li>
113
  <li><a href="https://www.webpagetest.org/test" target="_blank"><?php _e('WebPagetest', 'breeze') ?></a></li>
114
  <li><a href="https://tools.pingdom.com/" target="_blank"><?php _e('Pingdom', 'breeze') ?></a></li>
@@ -117,17 +115,17 @@ wp_enqueue_script('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/
117
  </div>
118
 
119
  <div class="faq-block">
120
- <h3 class="faq-question"><?php _e('Does Breeze plugin work with Visual Builder(insert link)?', 'breeze') ?></h3>
121
  <div class="faq-answer">
122
  <p><?php _e('Yes, Breeze Plugin is compatible with Visual Builder.', 'breeze') ?></p>
123
  </div>
124
  </div>
125
 
126
  <div class="faq-block">
127
- <h3 class="faq-question"><?php _e('What popular CDN are supported by Breze Plugin?', 'breeze') ?></h3>
128
  <div class="faq-answer">
129
  <p><?php _e('Breeze supports the following three popular CDNs:', 'breeze') ?></p>
130
- <ul>
131
  <li><a href="https://support.cloudways.com/how-to-use-breeze-with-maxcdn/" target="_blank"><?php _e('MaxCDN', 'breeze') ?></a></li>
132
  <li><a href="https://support.cloudways.com/how-to-use-breeze-with-keycdn/" target="_blank"><?php _e('KeyCDN', 'breeze') ?></a></li>
133
  <li><a href="https://support.cloudways.com/how-to-use-breeze-with-amazon-cloudfront/" target="_blank"><?php _e('Amazon Cloudfront', 'breeze') ?></a></li>
1
  <?php
2
  defined('ABSPATH') or die;
 
 
3
  ?>
4
  <div id="faq-content">
5
  <div class="faq-block">
103
  </div>
104
 
105
  <div class="faq-block">
106
+ <h3 class="faq-question"><?php _e('How can I test and verify the results?', 'breeze') ?></h3>
107
  <div class="faq-answer">
108
  <p><?php _e('You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:', 'breeze') ?></p>
109
+ <ul style="margin-top: 10px">
110
  <li><a href="https://developers.google.com/speed/pagespeed/" target="_blank"><?php _e('Google Page Speed', 'breeze') ?></a></li>
111
  <li><a href="https://www.webpagetest.org/test" target="_blank"><?php _e('WebPagetest', 'breeze') ?></a></li>
112
  <li><a href="https://tools.pingdom.com/" target="_blank"><?php _e('Pingdom', 'breeze') ?></a></li>
115
  </div>
116
 
117
  <div class="faq-block">
118
+ <h3 class="faq-question"><?php _e('Does Breeze plugin work with Visual Builder?', 'breeze') ?></h3>
119
  <div class="faq-answer">
120
  <p><?php _e('Yes, Breeze Plugin is compatible with Visual Builder.', 'breeze') ?></p>
121
  </div>
122
  </div>
123
 
124
  <div class="faq-block">
125
+ <h3 class="faq-question"><?php _e('What popular CDN are supported by Breeze Plugin?', 'breeze') ?></h3>
126
  <div class="faq-answer">
127
  <p><?php _e('Breeze supports the following three popular CDNs:', 'breeze') ?></p>
128
+ <ul style="margin-top: 10px">
129
  <li><a href="https://support.cloudways.com/how-to-use-breeze-with-maxcdn/" target="_blank"><?php _e('MaxCDN', 'breeze') ?></a></li>
130
  <li><a href="https://support.cloudways.com/how-to-use-breeze-with-keycdn/" target="_blank"><?php _e('KeyCDN', 'breeze') ?></a></li>
131
  <li><a href="https://support.cloudways.com/how-to-use-breeze-with-amazon-cloudfront/" target="_blank"><?php _e('Amazon Cloudfront', 'breeze') ?></a></li>
views/tabs/varnish.php CHANGED
@@ -5,7 +5,7 @@ $varnish = get_option('breeze_varnish_cache');
5
  $check_varnish = Breeze_Admin::check_varnish();
6
  ?>
7
  <div class="breeze-top-notice">
8
- <label class="breeze_tool_tip"><?php _e('By default Varnish is enabled on all WordPress websites hosted on Cloudways.','breeze')?></label>
9
  </div>
10
  <table cellspacing="15">
11
  <tr>
@@ -14,12 +14,12 @@ $check_varnish = Breeze_Admin::check_varnish();
14
  </td>
15
  <td>
16
  <input type="checkbox" id="auto-purge-varnish" name="auto-purge-varnish" value="1" <?php checked($varnish['auto-purge-varnish'], '1')?>/>
17
- <label class="breeze_tool_tip" ><?php _e('Keep this option enabled to automatically purge Varnish cache on actions like publishing new blog posts, pages and comments.','breeze')?></label>
18
  <br>
19
  <?php if( !$check_varnish): ?>
20
- <label><b>Note:&nbsp;</b>
21
- <span style="color: #ff0000"><?php _e('Seems Varnish is disabled on your Application. Please refer to ', 'breeze') ?><a href="https://support.cloudways.com/most-common-varnish-issues-and-queries/" target="_blank">this KB</a><?php _e(' and learn how to enable it.','breeze') ?> </span>
22
- </label>
23
  <?php endif; ?>
24
  </td>
25
  </tr>
@@ -30,7 +30,8 @@ $check_varnish = Breeze_Admin::check_varnish();
30
  <td>
31
  <input type="text" id="varnish-server-ip" size="20" name="varnish-server-ip"
32
  value='<?php echo(!empty($varnish['breeze-varnish-server-ip']) ? esc_html($varnish['breeze-varnish-server-ip']) : '127.0.0.1'); ?>'/>
33
- <br/><span class="breeze_tool_tip" ><strong><?php _e('Note: Keep this default if you are a Cloudways customer. Otherwise ask your hosting provider on what to set here.','breeze')?></strong></span>
 
34
  </td>
35
  </tr>
36
  <tr>
@@ -39,7 +40,7 @@ $check_varnish = Breeze_Admin::check_varnish();
39
  </td>
40
  <td>
41
  <input type="button" id="purge-varnish-button" class="button" value="<?php _e('Purge','breeze')?>" />
42
- <label style="vertical-align: bottom"><?php _e('Use this option to instantly Purge Varnish Cache on entire website. ', 'breeze') ?></label>
43
  </td>
44
  </tr>
45
  </table>
5
  $check_varnish = Breeze_Admin::check_varnish();
6
  ?>
7
  <div class="breeze-top-notice">
8
+ <p class="breeze_tool_tip"><?php _e('By default Varnish is enabled on all WordPress websites hosted on Cloudways.','breeze')?></p>
9
  </div>
10
  <table cellspacing="15">
11
  <tr>
14
  </td>
15
  <td>
16
  <input type="checkbox" id="auto-purge-varnish" name="auto-purge-varnish" value="1" <?php checked($varnish['auto-purge-varnish'], '1')?>/>
17
+ <span class="breeze_tool_tip" ><?php _e('Keep this option enabled to automatically purge Varnish cache on actions like publishing new blog posts, pages and comments.','breeze')?></span>
18
  <br>
19
  <?php if( !$check_varnish): ?>
20
+ <span><b>Note:&nbsp;</b>
21
+ <span style="color: #ff0000"><?php _e('Seems Varnish is disabled on your Application. Please refer to ', 'breeze') ?><a href="https://support.cloudways.com/most-common-varnish-issues-and-queries/" target="_blank"><?php _e('this KB', 'breeze') ?></a><?php _e(' and learn how to enable it.','breeze') ?> </span>
22
+ </span>
23
  <?php endif; ?>
24
  </td>
25
  </tr>
30
  <td>
31
  <input type="text" id="varnish-server-ip" size="20" name="varnish-server-ip"
32
  value='<?php echo(!empty($varnish['breeze-varnish-server-ip']) ? esc_html($varnish['breeze-varnish-server-ip']) : '127.0.0.1'); ?>'/>
33
+ <br/>
34
+ <span class="breeze_tool_tip"><strong><?php _e('Note: Keep this default if you are a Cloudways customer. Otherwise ask your hosting provider on what to set here.','breeze')?></strong></span>
35
  </td>
36
  </tr>
37
  <tr>
40
  </td>
41
  <td>
42
  <input type="button" id="purge-varnish-button" class="button" value="<?php _e('Purge','breeze')?>" />
43
+ <span style="vertical-align: bottom; margin-left: 5px"><?php _e('Use this option to instantly Purge Varnish Cache on entire website. ', 'breeze') ?></span>
44
  </td>
45
  </tr>
46
  </table>