PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | js/minify.js +248 -129 3.2.9 → 4.7.0 View file →
@@ -1,8 +1,11 @@
1 1 (function ($) {
2 2 var wp_optimize = window.wp_optimize || {};
3 + var block_ui = wp_optimize.block_ui;
3 4 var send_command = wp_optimize.send_command;
4 5 var refresh_frequency = wpoptimize.refresh_frequency || 30000;
6 + var heartbeat = WP_Optimize_Heartbeat();
7 + var heartbeat_agents = [];
5 8
6 9 if (!send_command) {
7 10 console.error('WP-Optimize Minify: wp_optimize.send_command is required.');
8 11 return;
@@ -30,12 +33,14 @@
30 33 * The standard handler for clearing the cache. Safe to use
31 34 */
32 35 $('.purge_minify_cache').on('click', function(e) {
33 36 e.preventDefault();
34 - $.blockUI();
37 + block_ui(wpoptimize.clearing_cache);
35 38 send_command('purge_minify_cache', null, function(response) {
36 - minify.updateFilesLists(response.files);
37 - minify.updateStats(response.files);
39 + if (response.hasOwnProperty('files')) {
40 + minify.updateFilesLists(response.files);
41 + minify.updateStats(response.files);
42 + }
38 43 }).always(function() {
39 44 $.unblockUI();
40 45 });
41 46 });
@@ -44,12 +49,14 @@
44 49 * Removes the entire cache dir.
45 50 * Use with caution, as cached html may still reference those files.
46 51 */
47 52 $('.purge_all_minify_cache').on('click', function() {
48 - $.blockUI();
53 + block_ui(wpoptimize.clearing_cache);
49 54 send_command('purge_all_minify_cache', null, function(response) {
50 - minify.updateFilesLists(response.files);
51 - minify.updateStats(response.files);
55 + if (response.hasOwnProperty('files')) {
56 + minify.updateFilesLists(response.files);
57 + minify.updateStats(response.files);
58 + }
52 59 }).always(function() {
53 60 $.unblockUI();
54 61 });
55 62 });
@@ -54,12 +61,12 @@
54 61 });
55 62 });
56 63
57 64 /**
58 - * Forces minifiy to create a new cache, safe to use
65 + * Forces minify to create a new cache, safe to use
59 66 */
60 67 $('.minify_increment_cache').on('click', function() {
61 - $.blockUI();
68 + block_ui(wpoptimize.creating_cache);
62 69 send_command('minify_increment_cache', null, function(response) {
63 70 if (response.hasOwnProperty('files')) {
64 71 minify.updateFilesLists(response.files);
65 72 minify.updateStats(response.files);
@@ -67,13 +74,12 @@
67 74 }).always(function() {
68 75 $.unblockUI();
69 76 });
70 77 });
71 -
72 78
73 79 // ======= SLIDERS ========
74 80 // Generic slider save
75 - $('#wp-optimize-nav-tab-wpo_minify-status-contents form :input, #wp-optimize-nav-tab-wpo_minify-js-contents form :input, #wp-optimize-nav-tab-wpo_minify-css-contents form :input, #wp-optimize-nav-tab-wpo_minify-font-contents form :input, #wp-optimize-nav-tab-wpo_minify-settings-contents form :input, #wp-optimize-nav-tab-wpo_minify-advanced-contents form :input').on('change', function() {
81 + $('#wp-optimize-nav-tab-wpo_minify-status-contents form :input, #wp-optimize-nav-tab-wpo_minify-js-contents form :input, #wp-optimize-nav-tab-wpo_minify-css-contents form :input, #wp-optimize-nav-tab-wpo_minify-font-contents form :input, #wp-optimize-nav-tab-wpo_minify-analytics-contents form :input, #wp-optimize-nav-tab-wpo_minify-settings-contents form :input, #wp-optimize-nav-tab-wpo_minify-advanced-contents form :input').on('change', function() {
76 82 $(this).closest('form').data('need_saving', true);
77 83 });
78 84
79 85 $('input[type=checkbox].wpo-save-setting').on('change', function(e) {
@@ -81,9 +87,9 @@
81 87 val = input.prop('checked'),
82 88 name = input.prop('name'),
83 89 data = {};
84 90 data[name] = val;
85 - $.blockUI();
91 + block_ui(wpoptimize.saving);
86 92 send_command('save_minify_settings', data, function(response) {
87 93 if (response.success) {
88 94 input.trigger('wp-optimize/minify/saved_setting');
89 95 if (response.hasOwnProperty('files')) {
@@ -108,24 +114,45 @@
108 114 $('#wpo_min_enable_minify').on('wp-optimize/minify/saved_setting', function() {
109 115
110 116 $(this).closest('.wpo_section').toggleClass('wpo-feature-is-disabled', !$(this).is(':checked'));
111 117 });
112 -
118 +
113 119 // Toggle wpo-feature-is-disabled class
114 120 $('#wpo_min_enable_minify_css, #wpo_min_enable_minify_js')
115 - // Set value on status change
121 + // Update UI when setting is saved
116 122 .on('wp-optimize/minify/saved_setting', function() {
117 - $('#wp-optimize-nav-tab-wrapper__wpo_minify a[data-tab="' + $(this).data('tabname') + '"] span.disabled').toggleClass('hidden', $(this).is(':checked'));
123 + toggle_minify_tab_section($(this));
118 124 })
119 - // Set value on page load
125 + // Initialize UI on page load
120 126 .each(function() {
121 - $('#wp-optimize-nav-tab-wrapper__wpo_minify a[data-tab="' + $(this).data('tabname') + '"] span.disabled').toggleClass('hidden', $(this).is(':checked'));
127 + toggle_minify_tab_section($(this));
122 128 });
123 -
129 +
130 + /**
131 + * Toggle the UI state of a minify tab section based on the associated checkbox state.
132 + *
133 + * - For JS minification, only elements marked with `.show-if-enabled` are toggled.
134 + *
135 + * @param {jQuery} $el The checkbox element controlling the minified setting
136 + *
137 + * @return {void}
138 + */
139 + function toggle_minify_tab_section($el) {
140 + var tab_name = $el.data('tabname');
141 + var tab_id = '#wpo_section_' + tab_name;
142 + var is_checked = $el.is(':checked');
143 +
144 + var $section = $el.is('#wpo_min_enable_minify_js') ? $(tab_id + ' .show-if-enabled') : $(tab_id);
145 +
146 + $('#wp-optimize-nav-tab-wrapper__wpo_minify a[data-tab="' + tab_name + '"] span.disabled').toggleClass('hidden', is_checked);
147 +
148 + $section.toggleClass('wpo-disabled-section', !is_checked);
149 + }
150 +
124 151 // slider enable Debug mode
125 152 $('#wpo_min_enable_minify_debug').on('wp-optimize/minify/saved_setting', function() {
126 153 // Refresh the page as it's needed to show the extra options
127 - $.blockUI({message: '<h1>'+wpoptimize.page_refresh+'</h1>'});
154 + block_ui(wpoptimize.page_refresh);
128 155 location.href = $('#wp-optimize-nav-tab-wpo_minify-advanced').prop('href');
129 156 });
130 157
131 158 // Edit default exclusions
@@ -133,8 +160,18 @@
133 160 // Show exclusions section
134 161 $('.wpo-minify-default-exclusions').toggleClass('hidden', !$(this).prop('checked'));
135 162 });
136 163
164 + var disable_google_fonts_processing = $('#disable_google_fonts_processing');
165 +
166 + function handle_disable_google_fonts_processing() {
167 + $('#wp-optimize-nav-tab-wpo_minify-font-contents .google_fonts_option:not(.skip-disable-processing)').prop('disabled', disable_google_fonts_processing.is(':checked'));
168 + }
169 +
170 + disable_google_fonts_processing.on('change', handle_disable_google_fonts_processing);
171 +
172 + handle_disable_google_fonts_processing();
173 +
137 174 // Save settings
138 175 $('.wp-optimize-save-minify-settings').on('click', function(e) {
139 176 e.preventDefault();
140 177 var btn = $(this),
@@ -142,11 +179,16 @@
142 179 success_icon = spinner.next(),
143 180 $need_refresh_btn = null;
144 181
145 182 spinner.show();
146 - $.blockUI();
183 + block_ui(wpoptimize.saving);
147 184
148 185 var data = {};
186 +
187 + var merge_state = {
188 + js: null,
189 + css: null
190 + };
149 191
150 192 var tabs = $('[data-whichpage="wpo_minify"] .wp-optimize-nav-tab-contents form');
151 193 tabs.each(function() {
152 194 var tab = $(this);
@@ -152,8 +194,16 @@
152 194 var tab = $(this);
153 195 if (true === tab.data('need_saving')) {
154 196 data = Object.assign(data, gather_data(tab));
155 197 tab.data('need_saving', false);
198 +
199 + if (typeof data.enable_merging_of_js !== 'undefined') {
200 + merge_state.js = data.enable_merging_of_js === 'true';
201 + }
202 +
203 + if (typeof data.enable_merging_of_css !== 'undefined') {
204 + merge_state.css = data.enable_merging_of_css === 'true';
205 + }
156 206 }
157 207 });
158 208
159 209 send_command('save_minify_settings', data, function(response) {
@@ -159,9 +209,9 @@
159 209 send_command('save_minify_settings', data, function(response) {
160 210 if (response.hasOwnProperty('error')) {
161 211 // show error
162 212 console.log(response.error);
163 - $('.wpo-error__enabling-cache').removeClass('wpo_hidden').find('p').text(response.error.message);
213 + wp_optimize.notices.show_notice(response.success, response.error);
164 214 } else {
165 215 $('.wpo-error__enabling-cache').addClass('wpo_hidden').find('p').text('');
166 216 }
167 217
@@ -168,8 +218,14 @@
168 218 if (response.hasOwnProperty('files')) {
169 219 minify.updateFilesLists(response.files);
170 220 minify.updateStats(response.files);
171 221 }
222 +
223 + $.each(merge_state, function(type, enabled) {
224 + if (null !== enabled) {
225 + toggle_minify_notice(type, enabled, false);
226 + }
227 + });
172 228
173 229 spinner.hide();
174 230 success_icon.show();
175 231 setTimeout(function() {
@@ -180,116 +236,172 @@
180 236 }).always(function() {
181 237 $.unblockUI();
182 238 });
183 239 })
184 -
240 +
185 241 // Dismiss information notice
186 - $('.wp-optimize-minify-status-information-notice').on('click', '.notice-dismiss', function(e) {
242 + $('.wpo_section_notice_minify').on('click', '.notice-dismiss', function(e) {
187 243 e.preventDefault();
188 - send_command('hide_minify_notice');
244 + toggle_minify_notice('minify', null, true);
189 245 });
246 +
247 + $('.wpo_section_notice_js').on('click', '.notice-dismiss', function(e) {
248 + e.preventDefault();
249 + toggle_minify_notice('js', null, true);
250 + });
251 +
252 + $('.wpo_section_notice_css').on('click', '.notice-dismiss', function(e) {
253 + e.preventDefault();
254 + toggle_minify_notice('css', null, true);
255 + });
256 +
257 + /**
258 + * Toggle visibility of a WP-Optimize minify notice and persist user preference.
259 + *
260 + * @param {string} type - Notice type ('minify', 'js', 'css').
261 + * @param {boolean|null} merging_enabled - Whether the JS/CSS merging checkbox is enabled (true = checked, false = unchecked, null = not applicable).
262 + * @param {boolean} force_hide - Whether to hide forcefully (true) or (false).
263 + *
264 + * @returns {void}
265 + */
266 + function toggle_minify_notice(type, merging_enabled, force_hide) {
267 + var $notice = $('.wpo_section_notice_' + type);
268 + if (!$notice.length) return;
269 +
270 + send_command('toggle_minify_notice', { type: type, merging_enabled: merging_enabled, force_hide: force_hide }, function(response) {
271 + if (response.hasOwnProperty('success') && response.success === true) {
272 + if (response.hasOwnProperty('hide') && response.hide === true) {
273 + $notice.stop(true, true).slideUp(300);
274 + }
275 +
276 + if (response.hasOwnProperty('hide') && response.hide === false) {
277 + $notice.stop(true, true).slideDown(300);
278 + }
279 + }
280 + if (response.hasOwnProperty('message') && response.success !== true) {
281 + wp_optimize.notices.show_notice('error', response.message);
282 + }
283 + });
284 + }
190 285
191 286 // Show logs
192 287 $('#wpo_min_jsprocessed, #wpo_min_cssprocessed').on('click', '.log', function(e) {
193 288 e.preventDefault();
194 289 $(this).nextAll('.wpo_min_log').slideToggle('fast');
290 + var link_text = $(this).text().trim();
291 + if (wpoptimize.show_information === link_text) {
292 + $(this).text(wpoptimize.hide_information);
293 + } else {
294 + $(this).text(wpoptimize.show_information);
295 + }
195 296 });
196 297
298 + // Delete log file
299 + $('#wpo_min_jsprocessed, #wpo_min_cssprocessed').on('click', '.delete-file', function(e) {
300 + e.preventDefault();
301 +
302 + var filename = $(this).data('filename');
303 +
304 + if ('' === filename || undefined === filename) {
305 + alert(wpoptimize.cache_file_not_found);
306 + return false;
307 + }
308 +
309 + block_ui(wpoptimize.deleting);
310 + send_command('delete_minify_cache_file', filename, function(response) {
311 + if('' !== response.files) {
312 + minify.updateFilesLists(response.files);
313 + minify.updateStats(response.files);
314 + }
315 + if('' !== response.result) {
316 + alert(response.result);
317 + }
318 + if('' !== response.error) {
319 + alert(response.error);
320 + }
321 + }).always(function() {
322 + $.unblockUI();
323 + });
324 + });
325 +
326 + // Trigger combined meta.json file download
327 + $('.wpo-minify-download-metas-button').on('click', function(e) {
328 + e.preventDefault();
329 + send_command('get_minify_meta_files', null, function(response) {
330 + if (response.hasOwnProperty('error')) {
331 + // show error
332 + alert(response.error);
333 + return;
334 + }
335 +
336 + var link = document.body.appendChild(document.createElement('a'));
337 + link.setAttribute('download', 'combined_metas.json');
338 + link.setAttribute('style', "display:none;");
339 + link.setAttribute('href', 'data:text/json' + ';charset=UTF-8,' + encodeURIComponent(JSON.stringify(response.combined_metas)));
340 + link.click();
341 + })
342 + });
343 +
197 344 // Handle js excludes
198 345 $('#wpo_min_jsprocessed').on('click', '.exclude', function(e) {
199 346 e.preventDefault();
200 - var el = $(this);
201 - var excluded_file = get_excluded_file(el);
202 - add_excluded_js_file(excluded_file);
203 - tab_need_saving('js');
204 - highlight_excluded_item(el);
347 + get_url_and_tab_saving($(this), '#exclude_js', 'js');
205 348 });
206 349
207 350 // Handle css excludes
208 351 $('#wpo_min_cssprocessed').on('click', '.exclude', function(e) {
209 352 e.preventDefault();
210 - var el = $(this);
211 - var excluded_file = get_excluded_file(el);
212 - add_excluded_css_file(excluded_file);
213 - tab_need_saving('css');
214 - highlight_excluded_item(el);
353 + get_url_and_tab_saving($(this), '#exclude_css', 'css');
215 354 });
216 355
217 - /**
218 - * Get excluded file url
219 - *
220 - * @param {HTMLElement} el
221 - *
222 - * @return {string}
223 - */
224 - function get_excluded_file(el) {
225 - return el.data('url');
226 - }
227 -
228 - /**
229 - * Exclude js file
230 - *
231 - * @param {string} excluded_file File url
232 - */
233 - function add_excluded_js_file(excluded_file) {
234 - var $js_textarea = $('#exclude_js');
235 - var list_of_excluded_files = $js_textarea.val();
236 - list_of_excluded_files += excluded_file + '\n';
237 - $js_textarea.val(list_of_excluded_files);
238 - }
239 -
240 - /**
241 - * Exclude css file
242 - *
243 - * @param {string} excluded_file File url
244 - */
245 - function add_excluded_css_file(excluded_file) {
246 - var $css_textarea = $('#exclude_css');
247 - var list_of_excluded_files = $css_textarea.val();
248 - list_of_excluded_files += excluded_file + '\n';
249 - $css_textarea.val(list_of_excluded_files);
250 - }
251 -
252 356 // Handle defer
253 357 $('#wpo_min_jsprocessed').on('click', '.defer', function(e) {
254 358 e.preventDefault();
255 - add_deferred_file($(this));
359 + get_url_and_tab_saving($(this), '#async_js', 'js');
256 360 });
257 361
258 362 // Handle async loading
259 363 $('#wpo_min_cssprocessed').on('click', '.async', function(e) {
260 364 e.preventDefault();
261 - add_async_file($(this));
365 + get_url_and_tab_saving($(this), '#async_css', 'css');
262 366 });
263 -
367 +
264 368 /**
265 - * Add deferred file
369 + * Get url from an element and then save it
266 370 *
267 - * @param {HTMLElement} el target element
371 + * @param {HTMLElement} el
372 + * @param {string} target_el_id
373 + * @param {string} tab_name
374 + *
375 + * @return void
268 376 */
269 - function add_deferred_file(el) {
270 - var deferred_file = el.data('url');
271 - var $async_js_textarea = $('#async_js');
272 - var list_of_deferred_files = $async_js_textarea.val();
273 - list_of_deferred_files += deferred_file + '\n';
274 - $async_js_textarea.val(list_of_deferred_files);
275 - tab_need_saving('js');
377 + function get_url_and_tab_saving(el, target_el_id, tab_name) {
378 + var file_url = el.data('url');
379 + if ('' === file_url || undefined === file_url) {
380 + return;
381 + }
382 +
383 + add_url_to_next_line(target_el_id, file_url);
384 + tab_need_saving(tab_name);
276 385 highlight_excluded_item(el);
277 386 }
278 -
387 +
279 388 /**
280 - * Add asynchronously loading file
389 + * Add url to the next line of the element textarea
281 390 *
282 - * @param {HTMLElement} el target element
391 + * @param {string} target_el_id
392 + * @param {string} file_url
393 + *
394 + * @return void
283 395 */
284 - function add_async_file(el) {
285 - var async_file = el.data('url');
286 - var $async_css_textarea = $('#async_css');
287 - var list_of_async_files = $async_css_textarea.val();
288 - list_of_async_files += async_file + '\n';
289 - $async_css_textarea.val(list_of_async_files);
290 - tab_need_saving('css');
291 - highlight_excluded_item(el);
396 + function add_url_to_next_line(target_el_id, file_url) {
397 + var $textarea = $(target_el_id);
398 + var list_of_files = $textarea.val().trim();
399 + if ('' !== list_of_files) {
400 + list_of_files += '\n';
401 + }
402 + list_of_files += file_url;
403 + $textarea.val(list_of_files);
292 404 }
293 405
294 406 /**
295 407 *
@@ -341,10 +453,9 @@
341 453 /**
342 454 * Minify Preloader functionality
343 455 */
344 456 var run_minify_preload_btn = $('#wp_optimize_run_minify_preload'),
345 - minify_preload_status_el = $('#wp_optimize_preload_minify_status'),
346 - check_status_interval = null;
457 + minify_preload_status_el = $('#wp_optimize_preload_minify_status');
347 458
348 459 run_minify_preload_btn.on('click', function() {
349 460 var btn = $(this),
350 461 is_running = btn.data('running'),
@@ -353,10 +464,11 @@
353 464 btn.prop('disabled', true);
354 465
355 466 if (is_running) {
356 467 btn.data('running', false);
357 - clearInterval(check_status_interval);
358 - check_status_interval = null;
468 +
469 + heartbeat.cancel_agents(heartbeat_agents);
470 +
359 471 send_command(
360 472 'cancel_minify_preload',
361 473 null,
362 474 function(response) {
@@ -419,18 +531,20 @@
419 531 run_update_minify_preload_status();
420 532 }
421 533
422 534 /**
423 - * Create interval action for update preloader status.
535 + * Create heartbeat agent action for update preloader status.
424 536 *
425 537 * @return void
426 538 */
427 539 function run_update_minify_preload_status() {
428 - if (check_status_interval) return;
540 + var agent = heartbeat.add_agent({
541 + command: 'get_minify_preload_status',
542 + callback: update_minify_preload_status,
543 + _keep: false
544 + });
429 545
430 - check_status_interval = setInterval(function() {
431 - update_minify_preload_status();
432 - }, 5000);
546 + if (null !== agent) heartbeat_agents.push(agent);
433 547 }
434 548
435 549 /**
436 550 * Update minify preload status ajax action.
@@ -436,22 +550,19 @@
436 550 * Update minify preload status ajax action.
437 551 *
438 552 * @return void
439 553 */
440 - function update_minify_preload_status() {
441 - send_command('get_minify_preload_status', null, function(response) {
442 - if (response.done) {
443 - run_minify_preload_btn.val(wpoptimize.run_now);
444 - run_minify_preload_btn.data('running', false);
445 - clearInterval(check_status_interval);
446 - check_status_interval = null;
447 - } else {
448 - run_minify_preload_btn.val(wpoptimize.cancel);
449 - run_minify_preload_btn.data('running', true);
450 - }
451 - minify_preload_status_el.text(response.message);
452 - update_minify_size_information(response);
453 - });
554 + function update_minify_preload_status(response) {
555 + if (response.done) {
556 + run_minify_preload_btn.val(wpoptimize.run_now);
557 + run_minify_preload_btn.data('running', false);
558 + } else {
559 + run_minify_preload_btn.val(wpoptimize.cancel);
560 + run_minify_preload_btn.data('running', true);
561 + run_update_minify_preload_status();
562 + }
563 + minify_preload_status_el.text(response.message);
564 + update_minify_size_information(response);
454 565 }
455 566
456 567 /**
457 568 * Run update information about minify size.
@@ -461,8 +572,16 @@
461 572 function update_minify_size_information(response) {
462 573 $('#wpo_min_cache_size').text(response.size);
463 574 $('#wpo_min_cache_total_size').text(response.total_size);
464 575 }
576 +
577 + // switch for visibility (analytics setting tab).
578 + var $analytics = $('#wpo-analytics-hidden-content');
579 +
580 + $('#wpo_enable_analytics').on('change', function () {
581 + $analytics.css('display', $(this).prop('checked') ? 'block' : 'none');
582 + });
583 +
465 584 return this;
466 585 }
467 586
468 587 /**
@@ -476,12 +595,10 @@
476 595 stamp: new Date().getTime()
477 596 };
478 597
479 598 send_command('get_minify_cached_files', data, function(response) {
480 -
481 599 minify.updateFilesLists(response);
482 600 minify.updateStats(response);
483 -
484 601 });
485 602
486 603 if (refresh_frequency) setTimeout(minify.getFiles.bind(this), refresh_frequency);
487 604 }
@@ -486,8 +603,9 @@
486 603 if (refresh_frequency) setTimeout(minify.getFiles.bind(this), refresh_frequency);
487 604 }
488 605
489 606 minify.updateFilesLists = function(data) {
607 + if (null === data) return;
490 608 // reset
491 609 var wpominarr = [];
492 610
493 611 // js
@@ -497,9 +615,10 @@
497 615 if ($('#'+this.uid).length == 0) {
498 616 $('#wpo_min_jsprocessed ul.processed').append('\
499 617 <li id="'+this.uid+'">\
500 618 <span class="filename"><a href="'+this.file_url+'" target="_blank">'+this.filename+'</a> ('+this.fsize+')</span>\
501 - <a href="#" class="log">' + wpoptimize.toggle_info + '</a>\
619 + <a href="#" class="log">' + wpoptimize.show_information + '</a>\
620 + <a href="#" class="delete-file" data-filename="' + this.filename + '">' + wpoptimize.delete_file + '</a>\
502 621 <div class="hidden save_notice">\
503 622 <p>' + wpoptimize.added_notice + '</p>\
504 623 <p><button class="button button-primary save-exclusions">' + wpoptimize.save_notice + '</button></p>\
505 624 </div>\
@@ -519,9 +638,10 @@
519 638 if ($('#'+this.uid).length == 0) {
520 639 $('#wpo_min_cssprocessed ul.processed').append('\
521 640 <li id="'+this.uid+'">\
522 641 <span class="filename"><a href="'+this.file_url+'" target="_blank">'+this.filename+'</a> ('+this.fsize+')</span>\
523 - <a href="#" class="log">' + wpoptimize.toggle_info + '</a>\
642 + <a href="#" class="log">' + wpoptimize.show_information + '</a>\
643 + <a href="#" class="delete-file" data-filename="' + this.filename + '">' + wpoptimize.delete_file + '</a>\
524 644 <div class="hidden save_notice">\
525 645 <p>' + wpoptimize.added_to_list + '</p>\
526 646 <p><button class="button button-primary save-exclusions">' + wpoptimize.save_notice + '</button></p>\
527 647 </div>\
@@ -530,9 +650,8 @@
530 650 ');
531 651 }
532 652 });
533 653 }
534 -
535 654 $('#wpo_min_cssprocessed ul.processed .no-files-yet').toggle(!data.css.length);
536 655
537 656 // Remove <li> if it's not in the files array
538 657 $('#wpo_min_jsprocessed ul.processed > li, #wpo_min_cssprocessed ul.processed > li').each(function () {
@@ -553,9 +672,9 @@
553 672 }
554 673 };
555 674
556 675 /**
557 - * Gather data from the given form
676 + * Gather data from the given form
558 677 *
559 678 * @param {HTMLFormElement} form
560 679 *
561 680 * @returns {Array} Array of collected data from the form
@@ -575,17 +694,17 @@
575 694 });
576 695 return data;
577 696 }
578 697
579 - /**
580 - * Reduces the form elements array into an object
581 - *
582 - * @param {Object} collection An empty object
583 - * @param {*} item form input element as array element
584 - *
585 - * @returns {Object} collection An object of form data
586 - */
587 - function form_serialize_reduce_cb(collection, item) {
698 + /**
699 + * Reduces the form elements array into an object
700 + *
701 + * @param {Object} collection An empty object
702 + * @param {*} item form input element as array element
703 + *
704 + * @returns {Object} collection An object of form data
705 + */
706 + function form_serialize_reduce_cb(collection, item) {
588 707 // Ignore items containing [], which we expect to be returned as arrays
589 708 if (item.name.includes('[]')) return collection;
590 709 collection[item.name] = item.value;
591 710 return collection;