Completed
Push — master ( cc2ade...5aeeae )
by frank
02:10
created
classes/autoptimizeConfig.php 1 patch
Spacing   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
2
+if (!defined('ABSPATH')) exit; // Exit if accessed directly.
3 3
 
4 4
 class autoptimizeConfig
5 5
 {
@@ -13,28 +13,28 @@  discard block
 block discarded – undo
13 13
      */
14 14
     private function __construct()
15 15
     {
16
-        if ( is_admin() ) {
16
+        if (is_admin()) {
17 17
             // Add the admin page and settings.
18
-            add_action( 'admin_menu', array( $this, 'addmenu' ) );
19
-            add_action( 'admin_init', array( $this, 'registersettings' ) );
18
+            add_action('admin_menu', array($this, 'addmenu'));
19
+            add_action('admin_init', array($this, 'registersettings'));
20 20
 
21 21
             // Set meta info.
22
-            if ( function_exists( 'plugin_row_meta' ) ) {
22
+            if (function_exists('plugin_row_meta')) {
23 23
                 // 2.8 and higher.
24
-                add_filter( 'plugin_row_meta', array( $this, 'setmeta' ), 10, 2 );
25
-            } elseif ( function_exists( 'post_class' ) ) {
24
+                add_filter('plugin_row_meta', array($this, 'setmeta'), 10, 2);
25
+            } elseif (function_exists('post_class')) {
26 26
                 // 2.7 and lower.
27
-                $plugin = plugin_basename( AUTOPTIMIZE_PLUGIN_DIR . 'autoptimize.php' );
28
-                add_filter( 'plugin_action_links_' . $plugin, array( $this, 'setmeta' ) );
27
+                $plugin = plugin_basename(AUTOPTIMIZE_PLUGIN_DIR.'autoptimize.php');
28
+                add_filter('plugin_action_links_'.$plugin, array($this, 'setmeta'));
29 29
             }
30 30
 
31 31
             // Clean cache?
32
-            if ( get_option( 'autoptimize_cache_clean' ) ) {
32
+            if (get_option('autoptimize_cache_clean')) {
33 33
                 autoptimizeCache::clearall();
34
-                update_option( 'autoptimize_cache_clean', 0 );
34
+                update_option('autoptimize_cache_clean', 0);
35 35
             }
36 36
 
37
-            $this->settings_screen_do_remote_http = apply_filters( 'autoptimize_settingsscreen_remotehttp', $this->settings_screen_do_remote_http );
37
+            $this->settings_screen_do_remote_http = apply_filters('autoptimize_settingsscreen_remotehttp', $this->settings_screen_do_remote_http);
38 38
         }
39 39
 
40 40
         // Adds the Autoptimize Toolbar to the Admin bar.
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     static public function instance()
49 49
     {
50 50
         // Only one instance.
51
-        if ( null === self::$instance ) {
51
+        if (null === self::$instance) {
52 52
             self::$instance = new autoptimizeConfig();
53 53
         }
54 54
 
@@ -174,28 +174,28 @@  discard block
 block discarded – undo
174 174
 
175 175
 <div class="wrap">
176 176
 
177
-<?php if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) { ?>
178
-<div class="notice-error notice"><?php echo '<p>' . sprintf( __( '<strong>You are using a very old version of PHP</strong> (5.2.x or older) which has <a href=%s>serious security and performance issues</a>. Support for PHP 5.5 and below will be removed in one of the next AO released, please ask your hoster to provide you with an upgrade path to 7.x.', 'autoptimize' ), '"http://blog.futtta.be/2016/03/15/why-would-you-still-be-on-php-5-2/" target="_blank"' ) . '</p>'; ?></div>
177
+<?php if (version_compare(PHP_VERSION, '5.3.0') < 0) { ?>
178
+<div class="notice-error notice"><?php echo '<p>'.sprintf(__('<strong>You are using a very old version of PHP</strong> (5.2.x or older) which has <a href=%s>serious security and performance issues</a>. Support for PHP 5.5 and below will be removed in one of the next AO released, please ask your hoster to provide you with an upgrade path to 7.x.', 'autoptimize'), '"http://blog.futtta.be/2016/03/15/why-would-you-still-be-on-php-5-2/" target="_blank"').'</p>'; ?></div>
179 179
 <?php } ?>
180 180
 
181
-<?php if ( defined( 'AUTOPTIMIZE_LEGACY_MINIFIERS' ) ) { ?>
181
+<?php if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) { ?>
182 182
     <div class="notice-error notice"><p>
183
-        <?php _e( "You are using the (no longer supported) AUTOPTIMIZE_LEGACY_MINIFIERS constant. Ensure your site is working properly and remove the constant, it doesn't do anything any more.", 'autoptimize' ); ?>
183
+        <?php _e("You are using the (no longer supported) AUTOPTIMIZE_LEGACY_MINIFIERS constant. Ensure your site is working properly and remove the constant, it doesn't do anything any more.", 'autoptimize'); ?>
184 184
     </p></div>
185 185
 <?php } ?>
186 186
 
187 187
 <div id="autoptimize_main">
188 188
     <div id="ao_title_and_button">
189
-        <h1 id="ao_title"><?php _e( 'Autoptimize Settings', 'autoptimize' ); ?>
189
+        <h1 id="ao_title"><?php _e('Autoptimize Settings', 'autoptimize'); ?>
190 190
         <span id="ao_adv_button">
191
-        <?php if ( get_option( 'autoptimize_show_adv', '1' ) == '1' ) { ?>
192
-            <a href="javascript:void(0);" id="ao_show_adv" class="button" style="display:none;"><span><?php _e("Show advanced settings","autoptimize") ?></span></a>
193
-            <a href="javascript:void(0);" id="ao_hide_adv" class="button"><span><?php _e("Hide advanced settings","autoptimize") ?></span></a>
191
+        <?php if (get_option('autoptimize_show_adv', '1') == '1') { ?>
192
+            <a href="javascript:void(0);" id="ao_show_adv" class="button" style="display:none;"><span><?php _e("Show advanced settings", "autoptimize") ?></span></a>
193
+            <a href="javascript:void(0);" id="ao_hide_adv" class="button"><span><?php _e("Hide advanced settings", "autoptimize") ?></span></a>
194 194
             <style>tr.ao_adv{display:table-row;} li.ao_adv{display:list-item;}</style>
195 195
             <?php $hiddenClass = ''; ?>
196 196
         <?php } else { ?>
197
-            <a href="javascript:void(0);" id="ao_show_adv" class="button"><span><?php _e("Show advanced settings","autoptimize") ?></span></a>
198
-            <a href="javascript:void(0);" id="ao_hide_adv" class="button" style="display:none;"><span><?php _e("Hide advanced settings","autoptimize") ?></span></a>
197
+            <a href="javascript:void(0);" id="ao_show_adv" class="button"><span><?php _e("Show advanced settings", "autoptimize") ?></span></a>
198
+            <a href="javascript:void(0);" id="ao_hide_adv" class="button" style="display:none;"><span><?php _e("Hide advanced settings", "autoptimize") ?></span></a>
199 199
             <?php $hiddenClass = 'hidden '; ?>
200 200
         <?php } ?>
201 201
         </span>
@@ -205,196 +205,196 @@  discard block
 block discarded – undo
205 205
     <?php echo $this->ao_admin_tabs(); ?>
206 206
 
207 207
 <form method="post" action="options.php">
208
-<?php settings_fields( 'autoptimize' ); ?>
208
+<?php settings_fields('autoptimize'); ?>
209 209
 
210 210
 <ul>
211 211
 
212 212
 <li class="itemDetail">
213
-<h2 class="itemTitle"><?php _e('JavaScript Options','autoptimize'); ?></h2>
213
+<h2 class="itemTitle"><?php _e('JavaScript Options', 'autoptimize'); ?></h2>
214 214
 <table class="form-table">
215 215
 <tr valign="top">
216
-<th scope="row"><?php _e('Optimize JavaScript Code?','autoptimize'); ?></th>
217
-<td><input type="checkbox" id="autoptimize_js" name="autoptimize_js" <?php echo get_option('autoptimize_js')?'checked="checked" ':''; ?>/></td>
216
+<th scope="row"><?php _e('Optimize JavaScript Code?', 'autoptimize'); ?></th>
217
+<td><input type="checkbox" id="autoptimize_js" name="autoptimize_js" <?php echo get_option('autoptimize_js') ? 'checked="checked" ' : ''; ?>/></td>
218 218
 </tr>
219
-<tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
220
-<th scope="row"><?php _e( 'Aggregate JS-files?', 'autoptimize' ); ?></th>
221
-<td><label class="cb_label"><input type="checkbox" id="autoptimize_js_aggregate" name="autoptimize_js_aggregate" <?php echo $conf->get( 'autoptimize_js_aggregate' ) ? 'checked="checked" ':''; ?>/>
222
-<?php _e( 'Aggregate all linked JS-files to have them loaded non-render blocking? If this option is off, the individual JS-files will remain in place but will be minified.', 'autoptimize' ); ?></label></td>
219
+<tr valign="top" class="<?php echo $hiddenClass; ?>js_sub ao_adv">
220
+<th scope="row"><?php _e('Aggregate JS-files?', 'autoptimize'); ?></th>
221
+<td><label class="cb_label"><input type="checkbox" id="autoptimize_js_aggregate" name="autoptimize_js_aggregate" <?php echo $conf->get('autoptimize_js_aggregate') ? 'checked="checked" ' : ''; ?>/>
222
+<?php _e('Aggregate all linked JS-files to have them loaded non-render blocking? If this option is off, the individual JS-files will remain in place but will be minified.', 'autoptimize'); ?></label></td>
223 223
 </tr>
224
-<tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv js_aggregate">
225
-<th scope="row"><?php _e('Also aggregate inline JS?','autoptimize'); ?></th>
226
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_include_inline" <?php echo get_option('autoptimize_js_include_inline')?'checked="checked" ':''; ?>/>
227
-<?php _e('Let Autoptimize also extract JS from the HTML. <strong>Warning</strong>: this can make Autoptimize\'s cache size grow quickly, so only enable this if you know what you\'re doing.','autoptimize'); ?></label></td>
224
+<tr valign="top" class="<?php echo $hiddenClass; ?>js_sub ao_adv js_aggregate">
225
+<th scope="row"><?php _e('Also aggregate inline JS?', 'autoptimize'); ?></th>
226
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_include_inline" <?php echo get_option('autoptimize_js_include_inline') ? 'checked="checked" ' : ''; ?>/>
227
+<?php _e('Let Autoptimize also extract JS from the HTML. <strong>Warning</strong>: this can make Autoptimize\'s cache size grow quickly, so only enable this if you know what you\'re doing.', 'autoptimize'); ?></label></td>
228 228
 </tr>
229
-<tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv js_aggregate">
230
-<th scope="row"><?php _e('Force JavaScript in &lt;head&gt;?','autoptimize'); ?></th>
231
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_forcehead" <?php echo get_option('autoptimize_js_forcehead')?'checked="checked" ':''; ?>/>
232
-<?php _e('Load JavaScript early, this can potentially fix some JS-errors, but makes the JS render blocking.','autoptimize'); ?></label></td>
229
+<tr valign="top" class="<?php echo $hiddenClass; ?>js_sub ao_adv js_aggregate">
230
+<th scope="row"><?php _e('Force JavaScript in &lt;head&gt;?', 'autoptimize'); ?></th>
231
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_forcehead" <?php echo get_option('autoptimize_js_forcehead') ? 'checked="checked" ' : ''; ?>/>
232
+<?php _e('Load JavaScript early, this can potentially fix some JS-errors, but makes the JS render blocking.', 'autoptimize'); ?></label></td>
233 233
 </tr>
234 234
 <?php if (get_option('autoptimize_js_justhead')) { ?>
235
-<tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv js_aggregate">
236
-<th scope="row"><?php _e('Look for scripts only in &lt;head&gt;?','autoptimize'); echo ' <i>'. __('(deprecated)','autoptimize') . '</i>'; ?></th>
237
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_justhead" <?php echo get_option('autoptimize_js_justhead')?'checked="checked" ':''; ?>/>
238
-<?php _e('Mostly useful in combination with previous option when using jQuery-based templates, but might help keeping cache size under control.','autoptimize'); ?></label></td>
235
+<tr valign="top" class="<?php echo $hiddenClass; ?>js_sub ao_adv js_aggregate">
236
+<th scope="row"><?php _e('Look for scripts only in &lt;head&gt;?', 'autoptimize'); echo ' <i>'.__('(deprecated)', 'autoptimize').'</i>'; ?></th>
237
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_justhead" <?php echo get_option('autoptimize_js_justhead') ? 'checked="checked" ' : ''; ?>/>
238
+<?php _e('Mostly useful in combination with previous option when using jQuery-based templates, but might help keeping cache size under control.', 'autoptimize'); ?></label></td>
239 239
 </tr>
240 240
 <?php } ?>
241
-<tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
242
-<th scope="row"><?php _e('Exclude scripts from Autoptimize:','autoptimize'); ?></th>
243
-<td><label><input type="text" style="width:100%;" name="autoptimize_js_exclude" value="<?php echo get_option('autoptimize_js_exclude',"wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery.js"); ?>"/><br />
244
-<?php _e('A comma-separated list of scripts you want to exclude from being optimized, for example \'whatever.js, another.js\' (without the quotes) to exclude those scripts from being aggregated by Autoptimize.','autoptimize'); ?></label></td>
241
+<tr valign="top" class="<?php echo $hiddenClass; ?>js_sub ao_adv">
242
+<th scope="row"><?php _e('Exclude scripts from Autoptimize:', 'autoptimize'); ?></th>
243
+<td><label><input type="text" style="width:100%;" name="autoptimize_js_exclude" value="<?php echo get_option('autoptimize_js_exclude', "wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery.js"); ?>"/><br />
244
+<?php _e('A comma-separated list of scripts you want to exclude from being optimized, for example \'whatever.js, another.js\' (without the quotes) to exclude those scripts from being aggregated by Autoptimize.', 'autoptimize'); ?></label></td>
245 245
 </tr>
246
-<tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv js_aggregate">
247
-<th scope="row"><?php _e('Add try-catch wrapping?','autoptimize'); ?></th>
248
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_trycatch" <?php echo get_option('autoptimize_js_trycatch')?'checked="checked" ':''; ?>/>
249
-<?php _e('If your scripts break because of a JS-error, you might want to try this.','autoptimize'); ?></label></td>
246
+<tr valign="top" class="<?php echo $hiddenClass; ?>js_sub ao_adv js_aggregate">
247
+<th scope="row"><?php _e('Add try-catch wrapping?', 'autoptimize'); ?></th>
248
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_js_trycatch" <?php echo get_option('autoptimize_js_trycatch') ? 'checked="checked" ' : ''; ?>/>
249
+<?php _e('If your scripts break because of a JS-error, you might want to try this.', 'autoptimize'); ?></label></td>
250 250
 </tr>
251 251
 </table>
252 252
 </li>
253 253
 
254 254
 <li class="itemDetail">
255
-<h2 class="itemTitle"><?php _e('CSS Options','autoptimize'); ?></h2>
255
+<h2 class="itemTitle"><?php _e('CSS Options', 'autoptimize'); ?></h2>
256 256
 <table class="form-table">
257 257
 <tr valign="top">
258
-<th scope="row"><?php _e('Optimize CSS Code?','autoptimize'); ?></th>
259
-<td><input type="checkbox" id="autoptimize_css" name="autoptimize_css" <?php echo get_option('autoptimize_css')?'checked="checked" ':''; ?>/></td>
258
+<th scope="row"><?php _e('Optimize CSS Code?', 'autoptimize'); ?></th>
259
+<td><input type="checkbox" id="autoptimize_css" name="autoptimize_css" <?php echo get_option('autoptimize_css') ? 'checked="checked" ' : ''; ?>/></td>
260 260
 </tr>
261
-<tr class="<?php echo $hiddenClass;?>css_sub ao_adv" valign="top">
262
-<th scope="row"><?php _e( 'Aggregate CSS-files?', 'autoptimize' ); ?></th>
263
-<td><label class="cb_label"><input type="checkbox" id="autoptimize_css_aggregate" name="autoptimize_css_aggregate" <?php echo $conf->get( 'autoptimize_css_aggregate' ) ? 'checked="checked" ' : ''; ?>/>
264
-<?php _e('Aggregate all linked CSS-files? If this option is off, the individual CSS-files will remain in place but will be minified.', 'autoptimize' ); ?></label></td>
261
+<tr class="<?php echo $hiddenClass; ?>css_sub ao_adv" valign="top">
262
+<th scope="row"><?php _e('Aggregate CSS-files?', 'autoptimize'); ?></th>
263
+<td><label class="cb_label"><input type="checkbox" id="autoptimize_css_aggregate" name="autoptimize_css_aggregate" <?php echo $conf->get('autoptimize_css_aggregate') ? 'checked="checked" ' : ''; ?>/>
264
+<?php _e('Aggregate all linked CSS-files? If this option is off, the individual CSS-files will remain in place but will be minified.', 'autoptimize'); ?></label></td>
265 265
 </tr>
266
-<tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv css_aggregate">
267
-<th scope="row"><?php _e('Also aggregate inline CSS?','autoptimize'); ?></th>
268
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_include_inline" <?php echo get_option('autoptimize_css_include_inline','1')?'checked="checked" ':''; ?>/>
269
-<?php _e('Check this option for Autoptimize to also aggregate CSS in the HTML.','autoptimize'); ?></label></td>
266
+<tr valign="top" class="<?php echo $hiddenClass; ?>css_sub ao_adv css_aggregate">
267
+<th scope="row"><?php _e('Also aggregate inline CSS?', 'autoptimize'); ?></th>
268
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_include_inline" <?php echo get_option('autoptimize_css_include_inline', '1') ? 'checked="checked" ' : ''; ?>/>
269
+<?php _e('Check this option for Autoptimize to also aggregate CSS in the HTML.', 'autoptimize'); ?></label></td>
270 270
 </tr>
271
-<tr class="<?php echo $hiddenClass;?>css_sub ao_adv css_aggregate" valign="top">
272
-<th scope="row"><?php _e('Generate data: URIs for images?','autoptimize'); ?></th>
273
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_datauris" <?php echo get_option('autoptimize_css_datauris')?'checked="checked" ':''; ?>/>
274
-<?php _e('Enable this to include small background-images in the CSS itself instead of as separate downloads.','autoptimize'); ?></label></td>
271
+<tr class="<?php echo $hiddenClass; ?>css_sub ao_adv css_aggregate" valign="top">
272
+<th scope="row"><?php _e('Generate data: URIs for images?', 'autoptimize'); ?></th>
273
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_datauris" <?php echo get_option('autoptimize_css_datauris') ? 'checked="checked" ' : ''; ?>/>
274
+<?php _e('Enable this to include small background-images in the CSS itself instead of as separate downloads.', 'autoptimize'); ?></label></td>
275 275
 </tr>
276 276
 <?php if (get_option('autoptimize_css_justhead')) { ?>
277
-<tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv css_aggregate">
278
-<th scope="row"><?php _e('Look for styles only in &lt;head&gt;?','autoptimize'); echo ' <i>'. __('(deprecated)','autoptimize') . '</i>'; ?></th>
279
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead')?'checked="checked" ':''; ?>/>
280
-<?php _e('Don\'t autoptimize CSS outside the head-section. If the cache gets big, you might want to enable this.','autoptimize'); ?></label></td>
277
+<tr valign="top" class="<?php echo $hiddenClass; ?>css_sub ao_adv css_aggregate">
278
+<th scope="row"><?php _e('Look for styles only in &lt;head&gt;?', 'autoptimize'); echo ' <i>'.__('(deprecated)', 'autoptimize').'</i>'; ?></th>
279
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead') ? 'checked="checked" ' : ''; ?>/>
280
+<?php _e('Don\'t autoptimize CSS outside the head-section. If the cache gets big, you might want to enable this.', 'autoptimize'); ?></label></td>
281 281
 </tr>
282 282
 <?php } ?>
283
-<tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv">
284
-<th scope="row"><?php _e('Inline and Defer CSS?','autoptimize'); ?></th>
285
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_defer" id="autoptimize_css_defer" <?php echo get_option('autoptimize_css_defer')?'checked="checked" ':''; ?>/>
283
+<tr valign="top" class="<?php echo $hiddenClass; ?>css_sub ao_adv">
284
+<th scope="row"><?php _e('Inline and Defer CSS?', 'autoptimize'); ?></th>
285
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_defer" id="autoptimize_css_defer" <?php echo get_option('autoptimize_css_defer') ? 'checked="checked" ' : ''; ?>/>
286 286
 <?php
287
-_e( 'Inline "above the fold CSS" while loading the main autoptimized CSS only after page load. <a href="http://wordpress.org/plugins/autoptimize/faq/" target="_blank">Check the FAQ</a> for more info.', 'autoptimize' );
288
-if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'autoptimize-criticalcss/ao_criticss_aas.php' ) ) {
287
+_e('Inline "above the fold CSS" while loading the main autoptimized CSS only after page load. <a href="http://wordpress.org/plugins/autoptimize/faq/" target="_blank">Check the FAQ</a> for more info.', 'autoptimize');
288
+if (function_exists('is_plugin_active') && !is_plugin_active('autoptimize-criticalcss/ao_criticss_aas.php')) {
289 289
     echo ' ';
290
-    $critcss_install_url = network_admin_url() . 'plugin-install.php?s=autoptimize+criticalcss&tab=search&type=term';
291
-    echo sprintf( __( 'This can be fully automated for different types of pages with the %s.', 'autoptimize' ), '<a href="'.$critcss_install_url.'">Autoptimize CriticalCSS Power-Up</a>' );
290
+    $critcss_install_url = network_admin_url().'plugin-install.php?s=autoptimize+criticalcss&tab=search&type=term';
291
+    echo sprintf(__('This can be fully automated for different types of pages with the %s.', 'autoptimize'), '<a href="'.$critcss_install_url.'">Autoptimize CriticalCSS Power-Up</a>');
292 292
 }
293 293
 ?>
294 294
 </label></td>
295 295
 </tr>
296
-<tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv" id="autoptimize_css_defer_inline">
296
+<tr valign="top" class="<?php echo $hiddenClass; ?>css_sub ao_adv" id="autoptimize_css_defer_inline">
297 297
 <th scope="row"></th>
298
-<td><label><textarea rows="10" cols="10" style="width:100%;" placeholder="<?php _e('Paste the above the fold CSS here.','autoptimize'); ?>" name="autoptimize_css_defer_inline"><?php echo get_option('autoptimize_css_defer_inline'); ?></textarea></label></td>
298
+<td><label><textarea rows="10" cols="10" style="width:100%;" placeholder="<?php _e('Paste the above the fold CSS here.', 'autoptimize'); ?>" name="autoptimize_css_defer_inline"><?php echo get_option('autoptimize_css_defer_inline'); ?></textarea></label></td>
299 299
 </tr>
300
-<tr valign="top" class="<?php echo $hiddenClass;?>ao_adv css_sub css_aggregate">
301
-<th scope="row"><?php _e('Inline all CSS?','autoptimize'); ?></th>
302
-<td><label class="cb_label"><input type="checkbox" id="autoptimize_css_inline" name="autoptimize_css_inline" <?php echo get_option('autoptimize_css_inline')?'checked="checked" ':''; ?>/>
303
-<?php _e('Inlining all CSS can improve performance for sites with a low pageviews/ visitor-rate, but may slow down performance otherwise.','autoptimize'); ?></label></td>
300
+<tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv css_sub css_aggregate">
301
+<th scope="row"><?php _e('Inline all CSS?', 'autoptimize'); ?></th>
302
+<td><label class="cb_label"><input type="checkbox" id="autoptimize_css_inline" name="autoptimize_css_inline" <?php echo get_option('autoptimize_css_inline') ? 'checked="checked" ' : ''; ?>/>
303
+<?php _e('Inlining all CSS can improve performance for sites with a low pageviews/ visitor-rate, but may slow down performance otherwise.', 'autoptimize'); ?></label></td>
304 304
 </tr>
305
-<tr valign="top" class="<?php echo $hiddenClass;?>ao_adv css_sub">
306
-<th scope="row"><?php _e('Exclude CSS from Autoptimize:','autoptimize'); ?></th>
307
-<td><label><input type="text" style="width:100%;" name="autoptimize_css_exclude" value="<?php echo get_option('autoptimize_css_exclude','wp-content/cache/, wp-content/uploads/, admin-bar.min.css, dashicons.min.css'); ?>"/><br />
308
-<?php _e('A comma-separated list of CSS you want to exclude from being optimized.','autoptimize'); ?></label></td>
305
+<tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv css_sub">
306
+<th scope="row"><?php _e('Exclude CSS from Autoptimize:', 'autoptimize'); ?></th>
307
+<td><label><input type="text" style="width:100%;" name="autoptimize_css_exclude" value="<?php echo get_option('autoptimize_css_exclude', 'wp-content/cache/, wp-content/uploads/, admin-bar.min.css, dashicons.min.css'); ?>"/><br />
308
+<?php _e('A comma-separated list of CSS you want to exclude from being optimized.', 'autoptimize'); ?></label></td>
309 309
 </tr>
310 310
 </table>
311 311
 </li>
312 312
 
313 313
 <li class="itemDetail">
314
-<h2 class="itemTitle"><?php _e('HTML Options','autoptimize'); ?></h2>
314
+<h2 class="itemTitle"><?php _e('HTML Options', 'autoptimize'); ?></h2>
315 315
 <table class="form-table">
316 316
 <tr valign="top">
317
-<th scope="row"><?php _e('Optimize HTML Code?','autoptimize'); ?></th>
318
-<td><input type="checkbox" id="autoptimize_html" name="autoptimize_html" <?php echo get_option('autoptimize_html')?'checked="checked" ':''; ?>/></td>
317
+<th scope="row"><?php _e('Optimize HTML Code?', 'autoptimize'); ?></th>
318
+<td><input type="checkbox" id="autoptimize_html" name="autoptimize_html" <?php echo get_option('autoptimize_html') ? 'checked="checked" ' : ''; ?>/></td>
319 319
 </tr>
320
-<tr class="<?php echo $hiddenClass;?>html_sub ao_adv" valign="top">
321
-<th scope="row"><?php _e('Keep HTML comments?','autoptimize'); ?></th>
322
-<td><label class="cb_label"><input type="checkbox" name="autoptimize_html_keepcomments" <?php echo get_option('autoptimize_html_keepcomments')?'checked="checked" ':''; ?>/>
323
-<?php _e('Enable this if you want HTML comments to remain in the page.','autoptimize'); ?></label></td>
320
+<tr class="<?php echo $hiddenClass; ?>html_sub ao_adv" valign="top">
321
+<th scope="row"><?php _e('Keep HTML comments?', 'autoptimize'); ?></th>
322
+<td><label class="cb_label"><input type="checkbox" name="autoptimize_html_keepcomments" <?php echo get_option('autoptimize_html_keepcomments') ? 'checked="checked" ' : ''; ?>/>
323
+<?php _e('Enable this if you want HTML comments to remain in the page.', 'autoptimize'); ?></label></td>
324 324
 </tr>
325 325
 </table>
326 326
 </li>
327 327
 
328 328
 <li class="itemDetail">
329
-<h2 class="itemTitle"><?php _e('CDN Options','autoptimize'); ?></h2>
329
+<h2 class="itemTitle"><?php _e('CDN Options', 'autoptimize'); ?></h2>
330 330
 <table class="form-table">
331 331
 <tr valign="top">
332
-<th scope="row"><?php _e('CDN Base URL','autoptimize'); ?></th>
333
-<td><label><input id="cdn_url" type="text" name="autoptimize_cdn_url" pattern="^(https?:)?\/\/([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*(:\d{2,5})?\/?$" style="width:100%" value="<?php echo esc_url(get_option('autoptimize_cdn_url',''),array("http","https")); ?>" /><br />
334
-<?php _e('Enter your CDN root URL to enable CDN for Autoptimized files. The URL can be http, https or protocol-relative (e.g. <code>//cdn.example.com/</code>). This is not needed for Cloudflare.','autoptimize'); ?></label></td>
332
+<th scope="row"><?php _e('CDN Base URL', 'autoptimize'); ?></th>
333
+<td><label><input id="cdn_url" type="text" name="autoptimize_cdn_url" pattern="^(https?:)?\/\/([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*(:\d{2,5})?\/?$" style="width:100%" value="<?php echo esc_url(get_option('autoptimize_cdn_url', ''), array("http", "https")); ?>" /><br />
334
+<?php _e('Enter your CDN root URL to enable CDN for Autoptimized files. The URL can be http, https or protocol-relative (e.g. <code>//cdn.example.com/</code>). This is not needed for Cloudflare.', 'autoptimize'); ?></label></td>
335 335
 </tr>
336 336
 </table>
337 337
 </li>
338 338
 
339
-<li class="<?php echo $hiddenClass;?>itemDetail ao_adv">
340
-<h2 class="itemTitle"><?php _e('Cache Info','autoptimize'); ?></h2>
339
+<li class="<?php echo $hiddenClass; ?>itemDetail ao_adv">
340
+<h2 class="itemTitle"><?php _e('Cache Info', 'autoptimize'); ?></h2>
341 341
 <table class="form-table" >
342
-<tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
343
-<th scope="row"><?php _e('Cache folder','autoptimize'); ?></th>
342
+<tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv">
343
+<th scope="row"><?php _e('Cache folder', 'autoptimize'); ?></th>
344 344
 <td><?php echo htmlentities(AUTOPTIMIZE_CACHE_DIR); ?></td>
345 345
 </tr>
346
-<tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
347
-<th scope="row"><?php _e('Can we write?','autoptimize'); ?></th>
348
-<td><?php echo (autoptimizeCache::cacheavail() ? __('Yes','autoptimize') : __('No','autoptimize')); ?></td>
346
+<tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv">
347
+<th scope="row"><?php _e('Can we write?', 'autoptimize'); ?></th>
348
+<td><?php echo (autoptimizeCache::cacheavail() ? __('Yes', 'autoptimize') : __('No', 'autoptimize')); ?></td>
349 349
 </tr>
350
-<tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
351
-<th scope="row"><?php _e('Cached styles and scripts','autoptimize'); ?></th>
350
+<tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv">
351
+<th scope="row"><?php _e('Cached styles and scripts', 'autoptimize'); ?></th>
352 352
 <td><?php
353 353
     $AOstatArr = autoptimizeCache::stats();
354
-    if ( ! empty( $AOstatArr ) && is_array( $AOstatArr ) ) {
355
-        $AOcacheSize = size_format( $AOstatArr[1], 2 );
354
+    if (!empty($AOstatArr) && is_array($AOstatArr)) {
355
+        $AOcacheSize = size_format($AOstatArr[1], 2);
356 356
         $details = '';
357
-        if ( $AOcacheSize > 0 ) {
358
-            $details = ', ~' . $AOcacheSize . ' total';
357
+        if ($AOcacheSize > 0) {
358
+            $details = ', ~'.$AOcacheSize.' total';
359 359
         }
360
-        printf( __( '%1$s files, totalling %2$s Kbytes (calculated at %3$s)', 'autoptimize' ), $AOstatArr[0], $AOcacheSize, date( 'H:i e', $AOstatArr[2] ) );
360
+        printf(__('%1$s files, totalling %2$s Kbytes (calculated at %3$s)', 'autoptimize'), $AOstatArr[0], $AOcacheSize, date('H:i e', $AOstatArr[2]));
361 361
     }
362 362
 ?></td>
363 363
 </tr>
364 364
 </table>
365 365
 </li>
366 366
 
367
-<li class="<?php echo $hiddenClass;?>itemDetail ao_adv">
368
-<h2 class="itemTitle"><?php _e('Misc Options','autoptimize'); ?></h2>
367
+<li class="<?php echo $hiddenClass; ?>itemDetail ao_adv">
368
+<h2 class="itemTitle"><?php _e('Misc Options', 'autoptimize'); ?></h2>
369 369
 <table class="form-table">
370
-    <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
371
-    <th scope="row"><?php _e('Save aggregated script/css as static files?','autoptimize'); ?></th>
372
-    <td><label class="cb_label"><input type="checkbox" name="autoptimize_cache_nogzip" <?php echo get_option('autoptimize_cache_nogzip','1')?'checked="checked" ':''; ?>/>
373
-    <?php _e('By default files saved are static css/js, uncheck this option if your webserver doesn\'t properly handle the compression and expiry.','autoptimize'); ?></label></td>
370
+    <tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv">
371
+    <th scope="row"><?php _e('Save aggregated script/css as static files?', 'autoptimize'); ?></th>
372
+    <td><label class="cb_label"><input type="checkbox" name="autoptimize_cache_nogzip" <?php echo get_option('autoptimize_cache_nogzip', '1') ? 'checked="checked" ' : ''; ?>/>
373
+    <?php _e('By default files saved are static css/js, uncheck this option if your webserver doesn\'t properly handle the compression and expiry.', 'autoptimize'); ?></label></td>
374 374
     </tr>
375 375
     <?php
376 376
     $_min_excl_class = 'ao_adv';
377
-    if ( !$conf->get( 'autoptimize_css_aggregate' ) && !$conf->get( 'autoptimize_js_aggregate' ) ) {
377
+    if (!$conf->get('autoptimize_css_aggregate') && !$conf->get('autoptimize_js_aggregate')) {
378 378
         $_min_excl_class = ' hidden';
379 379
     }
380 380
     ?>
381 381
     <tr valign="top" id="min_excl_row" class="<?php echo $hiddenClass.$_min_excl_class; ?>">
382
-        <th scope="row"><?php _e('Minify excluded CSS and JS files?','autoptimize'); ?></th>
383
-        <td><label class="cb_label"><input type="checkbox" name="autoptimize_minify_excluded" <?php echo get_option('autoptimize_minify_excluded','1')?'checked="checked" ':''; ?>/>
384
-        <?php _e('When aggregating JS or CSS, excluded files that are not minified (based on filename) are by default minified by Autoptimize despite being excluded. Uncheck this option if anything breaks despite excluding.','autoptimize'); ?></label></td>
382
+        <th scope="row"><?php _e('Minify excluded CSS and JS files?', 'autoptimize'); ?></th>
383
+        <td><label class="cb_label"><input type="checkbox" name="autoptimize_minify_excluded" <?php echo get_option('autoptimize_minify_excluded', '1') ? 'checked="checked" ' : ''; ?>/>
384
+        <?php _e('When aggregating JS or CSS, excluded files that are not minified (based on filename) are by default minified by Autoptimize despite being excluded. Uncheck this option if anything breaks despite excluding.', 'autoptimize'); ?></label></td>
385 385
     </tr>
386
-    <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
387
-    <th scope="row"><?php _e('Also optimize for logged in users?','autoptimize'); ?></th>
388
-    <td><label class="cb_label"><input type="checkbox" name="autoptimize_optimize_logged" <?php echo get_option('autoptimize_optimize_logged','1')?'checked="checked" ':''; ?>/>
389
-    <?php _e('By default Autoptimize is also active for logged on users, uncheck not to optimize when logged in e.g. to use a pagebuilder.','autoptimize'); ?></label></td>
386
+    <tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv">
387
+    <th scope="row"><?php _e('Also optimize for logged in users?', 'autoptimize'); ?></th>
388
+    <td><label class="cb_label"><input type="checkbox" name="autoptimize_optimize_logged" <?php echo get_option('autoptimize_optimize_logged', '1') ? 'checked="checked" ' : ''; ?>/>
389
+    <?php _e('By default Autoptimize is also active for logged on users, uncheck not to optimize when logged in e.g. to use a pagebuilder.', 'autoptimize'); ?></label></td>
390 390
     </tr>
391 391
     <?php
392
-    if ( function_exists("is_checkout") || function_exists("is_cart") || function_exists("edd_is_checkout") || function_exists("wpsc_is_cart") || function_exists("wpsc_is_checkout") ) {
392
+    if (function_exists("is_checkout") || function_exists("is_cart") || function_exists("edd_is_checkout") || function_exists("wpsc_is_cart") || function_exists("wpsc_is_checkout")) {
393 393
     ?>
394
-    <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
395
-        <th scope="row"><?php _e('Also optimize shop cart/ checkout?','autoptimize'); ?></th>
396
-        <td><label class="cb_label"><input type="checkbox" name="autoptimize_optimize_checkout" <?php echo get_option('autoptimize_optimize_checkout','1')?'checked="checked" ':''; ?>/>
397
-            <?php _e('By default Autoptimize is also active on your shop\'s cart/ checkout, uncheck not to optimize those.','autoptimize'); ?></label>
394
+    <tr valign="top" class="<?php echo $hiddenClass; ?>ao_adv">
395
+        <th scope="row"><?php _e('Also optimize shop cart/ checkout?', 'autoptimize'); ?></th>
396
+        <td><label class="cb_label"><input type="checkbox" name="autoptimize_optimize_checkout" <?php echo get_option('autoptimize_optimize_checkout', '1') ? 'checked="checked" ' : ''; ?>/>
397
+            <?php _e('By default Autoptimize is also active on your shop\'s cart/ checkout, uncheck not to optimize those.', 'autoptimize'); ?></label>
398 398
         </td>
399 399
     </tr>
400 400
     <?php } ?>
@@ -403,11 +403,11 @@  discard block
 block discarded – undo
403 403
 
404 404
 </ul>
405 405
 
406
-<input type="hidden" id="autoptimize_show_adv" name="autoptimize_show_adv" value="<?php echo get_option('autoptimize_show_adv','1'); ?>">
406
+<input type="hidden" id="autoptimize_show_adv" name="autoptimize_show_adv" value="<?php echo get_option('autoptimize_show_adv', '1'); ?>">
407 407
 
408 408
 <p class="submit">
409
-<input type="submit" class="button-secondary" value="<?php _e('Save Changes','autoptimize') ?>" />
410
-<input type="submit" class="button-primary" name="autoptimize_cache_clean" value="<?php _e('Save Changes and Empty Cache','autoptimize') ?>" />
409
+<input type="submit" class="button-secondary" value="<?php _e('Save Changes', 'autoptimize') ?>" />
410
+<input type="submit" class="button-primary" name="autoptimize_cache_clean" value="<?php _e('Save Changes and Empty Cache', 'autoptimize') ?>" />
411 411
 </p>
412 412
 
413 413
 </form>
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
     <div class="autoptimize_banner hidden">
417 417
       <ul>
418 418
     <?php
419
-    if ( $this->settings_screen_do_remote_http ) {
420
-        $AO_banner = get_transient( 'autoptimize_banner' );
421
-        if ( empty( $AO_banner ) ) {
422
-            $banner_resp = wp_remote_get( 'https://misc.optimizingmatters.com/autoptimize_news.html?ao_ver='.AUTOPTIMIZE_PLUGIN_VERSION );
423
-            if ( ! is_wp_error( $banner_resp ) ) {
424
-                if ( '200' == wp_remote_retrieve_response_code( $banner_resp ) ) {
425
-                    $AO_banner = wp_kses_post( wp_remote_retrieve_body( $banner_resp ) );
419
+    if ($this->settings_screen_do_remote_http) {
420
+        $AO_banner = get_transient('autoptimize_banner');
421
+        if (empty($AO_banner)) {
422
+            $banner_resp = wp_remote_get('https://misc.optimizingmatters.com/autoptimize_news.html?ao_ver='.AUTOPTIMIZE_PLUGIN_VERSION);
423
+            if (!is_wp_error($banner_resp)) {
424
+                if ('200' == wp_remote_retrieve_response_code($banner_resp)) {
425
+                    $AO_banner = wp_kses_post(wp_remote_retrieve_body($banner_resp));
426 426
                     set_transient('autoptimize_banner', $AO_banner, DAY_IN_SECONDS);
427 427
                 }
428 428
             }
@@ -430,17 +430,17 @@  discard block
 block discarded – undo
430 430
         echo $AO_banner;
431 431
     }
432 432
     ?>
433
-        <li><?php _e("Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check out the FAQ here</a>.","autoptimize"); ?></li>
434
-        <li><?php _e("Happy with Autoptimize?","autoptimize"); ?><br /><a href="<?php echo network_admin_url(); ?>plugin-install.php?tab=search&type=author&s=optimizingmatters"><?php _e("Try my other plugins!","autoptimize"); ?></a></li>
433
+        <li><?php _e("Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check out the FAQ here</a>.", "autoptimize"); ?></li>
434
+        <li><?php _e("Happy with Autoptimize?", "autoptimize"); ?><br /><a href="<?php echo network_admin_url(); ?>plugin-install.php?tab=search&type=author&s=optimizingmatters"><?php _e("Try my other plugins!", "autoptimize"); ?></a></li>
435 435
     </ul>
436 436
     </div>
437 437
     <div style="margin-left:10px;margin-top:-5px;">
438 438
         <h2>
439
-            <?php _e("futtta about","autoptimize") ?>
439
+            <?php _e("futtta about", "autoptimize") ?>
440 440
             <select id="feed_dropdown" >
441
-                <option value="1"><?php _e("Autoptimize","autoptimize") ?></option>
442
-                <option value="2"><?php _e("WordPress","autoptimize") ?></option>
443
-                <option value="3"><?php _e("Web Technology","autoptimize") ?></option>
441
+                <option value="1"><?php _e("Autoptimize", "autoptimize") ?></option>
442
+                <option value="2"><?php _e("WordPress", "autoptimize") ?></option>
443
+                <option value="3"><?php _e("Web Technology", "autoptimize") ?></option>
444 444
             </select>
445 445
         </h2>
446 446
         <div id="futtta_feed">
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             </div>
456 456
         </div>
457 457
     </div>
458
-    <div style="float:right;margin:50px 15px;"><a href="http://blog.futtta.be/2013/10/21/do-not-donate-to-me/" target="_blank"><img width="100px" height="85px" src="<?php echo plugins_url().'/'.plugin_basename(dirname(__FILE__)).'/external/do_not_donate_smallest.png'; ?>" title="<?php _e("Do not donate for this plugin!","autoptimize"); ?>"></a></div>
458
+    <div style="float:right;margin:50px 15px;"><a href="http://blog.futtta.be/2013/10/21/do-not-donate-to-me/" target="_blank"><img width="100px" height="85px" src="<?php echo plugins_url().'/'.plugin_basename(dirname(__FILE__)).'/external/do_not_donate_smallest.png'; ?>" title="<?php _e("Do not donate for this plugin!", "autoptimize"); ?>"></a></div>
459 459
 </div>
460 460
 
461 461
 <script type="text/javascript">
@@ -626,49 +626,49 @@  discard block
 block discarded – undo
626 626
 
627 627
     public function addmenu()
628 628
     {
629
-        $hook = add_options_page( __( 'Autoptimize Options', 'autoptimize' ), 'Autoptimize', 'manage_options', 'autoptimize', array( $this, 'show' ) );
630
-        add_action( 'admin_print_scripts-' . $hook, array( $this, 'autoptimize_admin_scripts' ) );
631
-        add_action( 'admin_print_styles-' . $hook, array( $this, 'autoptimize_admin_styles' ) );
629
+        $hook = add_options_page(__('Autoptimize Options', 'autoptimize'), 'Autoptimize', 'manage_options', 'autoptimize', array($this, 'show'));
630
+        add_action('admin_print_scripts-'.$hook, array($this, 'autoptimize_admin_scripts'));
631
+        add_action('admin_print_styles-'.$hook, array($this, 'autoptimize_admin_styles'));
632 632
     }
633 633
 
634 634
     public function autoptimize_admin_scripts()
635 635
     {
636
-        wp_enqueue_script( 'jqcookie', plugins_url( '/external/js/jquery.cookie.min.js', __FILE__ ), array( 'jquery' ), null, true );
637
-        wp_enqueue_script( 'unslider', plugins_url( '/external/js/unslider-min.js', __FILE__ ), array( 'jquery' ), null, true );
636
+        wp_enqueue_script('jqcookie', plugins_url('/external/js/jquery.cookie.min.js', __FILE__), array('jquery'), null, true);
637
+        wp_enqueue_script('unslider', plugins_url('/external/js/unslider-min.js', __FILE__), array('jquery'), null, true);
638 638
     }
639 639
 
640 640
     public function autoptimize_admin_styles()
641 641
     {
642
-        wp_enqueue_style( 'unslider', plugins_url( '/external/js/unslider.css', __FILE__ ) );
643
-        wp_enqueue_style( 'unslider-dots', plugins_url( '/external/js/unslider-dots.css', __FILE__ ) );
642
+        wp_enqueue_style('unslider', plugins_url('/external/js/unslider.css', __FILE__));
643
+        wp_enqueue_style('unslider-dots', plugins_url('/external/js/unslider-dots.css', __FILE__));
644 644
     }
645 645
 
646 646
     public function registersettings() {
647
-        register_setting( 'autoptimize', 'autoptimize_html' );
648
-        register_setting( 'autoptimize', 'autoptimize_html_keepcomments' );
649
-        register_setting( 'autoptimize', 'autoptimize_js' );
650
-        register_setting( 'autoptimize', 'autoptimize_js_aggregate' );
651
-        register_setting( 'autoptimize', 'autoptimize_js_exclude' );
652
-        register_setting( 'autoptimize', 'autoptimize_js_trycatch' );
653
-        register_setting( 'autoptimize', 'autoptimize_js_justhead' );
654
-        register_setting( 'autoptimize', 'autoptimize_js_forcehead' );
655
-        register_setting( 'autoptimize', 'autoptimize_js_include_inline' );
656
-        register_setting( 'autoptimize', 'autoptimize_css' );
657
-        register_setting( 'autoptimize', 'autoptimize_css_aggregate' );
658
-        register_setting( 'autoptimize', 'autoptimize_css_exclude' );
659
-        register_setting( 'autoptimize', 'autoptimize_css_justhead' );
660
-        register_setting( 'autoptimize', 'autoptimize_css_datauris' );
661
-        register_setting( 'autoptimize', 'autoptimize_css_defer' );
662
-        register_setting( 'autoptimize', 'autoptimize_css_defer_inline' );
663
-        register_setting( 'autoptimize', 'autoptimize_css_inline' );
664
-        register_setting( 'autoptimize', 'autoptimize_css_include_inline' );
665
-        register_setting( 'autoptimize', 'autoptimize_cdn_url' );
666
-        register_setting( 'autoptimize', 'autoptimize_cache_clean' );
667
-        register_setting( 'autoptimize', 'autoptimize_cache_nogzip' );
668
-        register_setting( 'autoptimize', 'autoptimize_show_adv' );
669
-        register_setting( 'autoptimize', 'autoptimize_optimize_logged' );
670
-        register_setting( 'autoptimize', 'autoptimize_optimize_checkout' );
671
-        register_setting( 'autoptimize', 'autoptimize_minify_excluded' );
647
+        register_setting('autoptimize', 'autoptimize_html');
648
+        register_setting('autoptimize', 'autoptimize_html_keepcomments');
649
+        register_setting('autoptimize', 'autoptimize_js');
650
+        register_setting('autoptimize', 'autoptimize_js_aggregate');
651
+        register_setting('autoptimize', 'autoptimize_js_exclude');
652
+        register_setting('autoptimize', 'autoptimize_js_trycatch');
653
+        register_setting('autoptimize', 'autoptimize_js_justhead');
654
+        register_setting('autoptimize', 'autoptimize_js_forcehead');
655
+        register_setting('autoptimize', 'autoptimize_js_include_inline');
656
+        register_setting('autoptimize', 'autoptimize_css');
657
+        register_setting('autoptimize', 'autoptimize_css_aggregate');
658
+        register_setting('autoptimize', 'autoptimize_css_exclude');
659
+        register_setting('autoptimize', 'autoptimize_css_justhead');
660
+        register_setting('autoptimize', 'autoptimize_css_datauris');
661
+        register_setting('autoptimize', 'autoptimize_css_defer');
662
+        register_setting('autoptimize', 'autoptimize_css_defer_inline');
663
+        register_setting('autoptimize', 'autoptimize_css_inline');
664
+        register_setting('autoptimize', 'autoptimize_css_include_inline');
665
+        register_setting('autoptimize', 'autoptimize_cdn_url');
666
+        register_setting('autoptimize', 'autoptimize_cache_clean');
667
+        register_setting('autoptimize', 'autoptimize_cache_nogzip');
668
+        register_setting('autoptimize', 'autoptimize_show_adv');
669
+        register_setting('autoptimize', 'autoptimize_optimize_logged');
670
+        register_setting('autoptimize', 'autoptimize_optimize_checkout');
671
+        register_setting('autoptimize', 'autoptimize_minify_excluded');
672 672
     }
673 673
 
674 674
     public function setmeta($links, $file = null)
@@ -676,20 +676,20 @@  discard block
 block discarded – undo
676 676
         // Inspired on http://wpengineer.com/meta-links-for-wordpress-plugins/.
677 677
         // Do it only once - saves time.
678 678
         static $plugin;
679
-        if ( empty( $plugin ) ) {
680
-            $plugin = plugin_basename( AUTOPTIMIZE_PLUGIN_DIR . 'autoptimize.php' );
679
+        if (empty($plugin)) {
680
+            $plugin = plugin_basename(AUTOPTIMIZE_PLUGIN_DIR.'autoptimize.php');
681 681
         }
682 682
 
683
-        if ( null === $file ) {
683
+        if (null === $file) {
684 684
             // 2.7 and lower.
685
-            $settings_link = sprintf( '<a href="options-general.php?page=autoptimize">%s</a>', __( 'Settings' ) );
686
-            array_unshift( $links, $settings_link );
685
+            $settings_link = sprintf('<a href="options-general.php?page=autoptimize">%s</a>', __('Settings'));
686
+            array_unshift($links, $settings_link);
687 687
         } else {
688 688
             // 2.8 and higher.
689 689
             // If it's us, add the link.
690
-            if ( $file === $plugin ) {
691
-                $newlink = array( sprintf( '<a href="options-general.php?page=autoptimize">%s</a>', __( 'Settings' ) ) );
692
-                $links = array_merge( $links, $newlink );
690
+            if ($file === $plugin) {
691
+                $newlink = array(sprintf('<a href="options-general.php?page=autoptimize">%s</a>', __('Settings')));
692
+                $links = array_merge($links, $newlink);
693 693
             }
694 694
         }
695 695
 
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
             'autoptimize_imgopt_select_field_2'   => '2', // quality glossy.
762 762
             'autoptimize_imgopt_checkbox_field_3' => '0', // lazy load off.
763 763
             'autoptimize_imgopt_checkbox_field_4' => '0', // webp off (might be removed).
764
-            'autoptimize_imgopt_text_field_5'     => '',  // lazy load exclusions empty.
764
+            'autoptimize_imgopt_text_field_5'     => '', // lazy load exclusions empty.
765 765
         );
766 766
         return $defaults;
767 767
     }
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
      */
774 774
     public static function get_ao_css_preload_polyfill()
775 775
     {
776
-        $preload_poly = apply_filters('autoptimize_css_preload_polyfill','<script data-cfasync=\'false\'>!function(t){"use strict";t.loadCSS||(t.loadCSS=function(){});var e=loadCSS.relpreload={};if(e.support=function(){var e;try{e=t.document.createElement("link").relList.supports("preload")}catch(t){e=!1}return function(){return e}}(),e.bindMediaToggle=function(t){function e(){t.media=a}var a=t.media||"all";t.addEventListener?t.addEventListener("load",e):t.attachEvent&&t.attachEvent("onload",e),setTimeout(function(){t.rel="stylesheet",t.media="only x"}),setTimeout(e,3e3)},e.poly=function(){if(!e.support())for(var a=t.document.getElementsByTagName("link"),n=0;n<a.length;n++){var o=a[n];"preload"!==o.rel||"style"!==o.getAttribute("as")||o.getAttribute("data-loadcss")||(o.setAttribute("data-loadcss",!0),e.bindMediaToggle(o))}},!e.support()){e.poly();var a=t.setInterval(e.poly,500);t.addEventListener?t.addEventListener("load",function(){e.poly(),t.clearInterval(a)}):t.attachEvent&&t.attachEvent("onload",function(){e.poly(),t.clearInterval(a)})}"undefined"!=typeof exports?exports.loadCSS=loadCSS:t.loadCSS=loadCSS}("undefined"!=typeof global?global:this);</script>');
776
+        $preload_poly = apply_filters('autoptimize_css_preload_polyfill', '<script data-cfasync=\'false\'>!function(t){"use strict";t.loadCSS||(t.loadCSS=function(){});var e=loadCSS.relpreload={};if(e.support=function(){var e;try{e=t.document.createElement("link").relList.supports("preload")}catch(t){e=!1}return function(){return e}}(),e.bindMediaToggle=function(t){function e(){t.media=a}var a=t.media||"all";t.addEventListener?t.addEventListener("load",e):t.attachEvent&&t.attachEvent("onload",e),setTimeout(function(){t.rel="stylesheet",t.media="only x"}),setTimeout(e,3e3)},e.poly=function(){if(!e.support())for(var a=t.document.getElementsByTagName("link"),n=0;n<a.length;n++){var o=a[n];"preload"!==o.rel||"style"!==o.getAttribute("as")||o.getAttribute("data-loadcss")||(o.setAttribute("data-loadcss",!0),e.bindMediaToggle(o))}},!e.support()){e.poly();var a=t.setInterval(e.poly,500);t.addEventListener?t.addEventListener("load",function(){e.poly(),t.clearInterval(a)}):t.attachEvent&&t.attachEvent("onload",function(){e.poly(),t.clearInterval(a)})}"undefined"!=typeof exports?exports.loadCSS=loadCSS:t.loadCSS=loadCSS}("undefined"!=typeof global?global:this);</script>');
777 777
         return $preload_poly;
778 778
     }
779 779
 
@@ -784,55 +784,55 @@  discard block
 block discarded – undo
784 784
      */
785 785
     public static function get_ao_css_preload_onload()
786 786
     {
787
-        $preload_onload = apply_filters('autoptimize_filter_css_preload_onload',"this.onload=null;this.rel='stylesheet'");
787
+        $preload_onload = apply_filters('autoptimize_filter_css_preload_onload', "this.onload=null;this.rel='stylesheet'");
788 788
         return $preload_onload;
789 789
     }
790 790
 
791 791
     public function get($key)
792 792
     {
793
-        if ( ! is_array( $this->config ) ) {
793
+        if (!is_array($this->config)) {
794 794
             // Default config.
795 795
             $config = self::get_defaults();
796 796
 
797 797
             // Override with user settings.
798
-            foreach ( array_keys( $config ) as $name ) {
799
-                $conf = get_option( $name );
800
-                if ( false !== $conf ) {
798
+            foreach (array_keys($config) as $name) {
799
+                $conf = get_option($name);
800
+                if (false !== $conf) {
801 801
                     // It was set before!
802
-                    $config[ $name ] = $conf;
802
+                    $config[$name] = $conf;
803 803
                 }
804 804
             }
805 805
 
806 806
             // Save for next call.
807
-            $this->config = apply_filters( 'autoptimize_filter_get_config', $config );
807
+            $this->config = apply_filters('autoptimize_filter_get_config', $config);
808 808
         }
809 809
 
810
-        if ( isset( $this->config[ $key ] ) ) {
811
-            return $this->config[ $key ];
810
+        if (isset($this->config[$key])) {
811
+            return $this->config[$key];
812 812
         }
813 813
 
814 814
         return false;
815 815
     }
816 816
 
817 817
     private function getFutttaFeeds($url) {
818
-        if ( $this->settings_screen_do_remote_http ) {
819
-            $rss = fetch_feed( $url );
818
+        if ($this->settings_screen_do_remote_http) {
819
+            $rss = fetch_feed($url);
820 820
             $maxitems = 0;
821 821
 
822
-            if ( ! is_wp_error( $rss ) ) {
823
-                $maxitems = $rss->get_item_quantity( 7 );
824
-                $rss_items = $rss->get_items( 0, $maxitems );
822
+            if (!is_wp_error($rss)) {
823
+                $maxitems = $rss->get_item_quantity(7);
824
+                $rss_items = $rss->get_items(0, $maxitems);
825 825
             }
826 826
             ?>
827 827
             <ul>
828
-                <?php if ( $maxitems == 0 ) : ?>
829
-                    <li><?php _e( 'No items', 'autoptimize' ); ?></li>
828
+                <?php if ($maxitems == 0) : ?>
829
+                    <li><?php _e('No items', 'autoptimize'); ?></li>
830 830
                 <?php else : ?>
831
-                    <?php foreach ( $rss_items as $item ) : ?>
831
+                    <?php foreach ($rss_items as $item) : ?>
832 832
                         <li>
833
-                            <a href="<?php echo esc_url( $item->get_permalink() ); ?>"
834
-                                title="<?php printf( __( 'Posted %s', 'autoptimize' ), $item->get_date('j F Y | g:i a') ); ?>">
835
-                                <?php echo esc_html( $item->get_title() ); ?>
833
+                            <a href="<?php echo esc_url($item->get_permalink()); ?>"
834
+                                title="<?php printf(__('Posted %s', 'autoptimize'), $item->get_date('j F Y | g:i a')); ?>">
835
+                                <?php echo esc_html($item->get_title()); ?>
836 836
                             </a>
837 837
                         </li>
838 838
                     <?php endforeach; ?>
@@ -845,23 +845,23 @@  discard block
 block discarded – undo
845 845
     // based on http://wordpress.stackexchange.com/a/58826
846 846
     static function ao_admin_tabs()
847 847
     {
848
-        $tabs = apply_filters( 'autoptimize_filter_settingsscreen_tabs' ,array( 'autoptimize' => __( 'JS, CSS  &amp; HTML', 'autoptimize' ) ) );
848
+        $tabs = apply_filters('autoptimize_filter_settingsscreen_tabs', array('autoptimize' => __('JS, CSS  &amp; HTML', 'autoptimize')));
849 849
         $tabContent = '';
850 850
         $tabs_count = count($tabs);
851
-        if ( $tabs_count > 1 ) {
852
-            if ( isset( $_GET['page'] ) ) {
851
+        if ($tabs_count > 1) {
852
+            if (isset($_GET['page'])) {
853 853
                 $currentId = $_GET['page'];
854 854
             } else {
855 855
                 $currentId = "autoptimize";
856 856
             }
857 857
             $tabContent .= '<h2 class="nav-tab-wrapper">';
858 858
             foreach ($tabs as $tabId => $tabName) {
859
-                if ( $currentId == $tabId ) {
859
+                if ($currentId == $tabId) {
860 860
                     $class = ' nav-tab-active';
861
-                } else{
861
+                } else {
862 862
                     $class = '';
863 863
                 }
864
-                $tabContent .= '<a class="nav-tab' . $class . '" href="?page=' . $tabId . '">' . $tabName . '</a>';
864
+                $tabContent .= '<a class="nav-tab'.$class.'" href="?page='.$tabId.'">'.$tabName.'</a>';
865 865
             }
866 866
             $tabContent .= '</h2>';
867 867
         } else {
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
      */
879 879
     public static function is_admin_and_not_ajax()
880 880
     {
881
-        return ( is_admin() && ! self::doing_ajax() );
881
+        return (is_admin() && !self::doing_ajax());
882 882
     }
883 883
 
884 884
     /**
@@ -888,9 +888,9 @@  discard block
 block discarded – undo
888 888
      */
889 889
     protected static function doing_ajax()
890 890
     {
891
-        if ( function_exists( 'wp_doing_ajax' ) ) {
891
+        if (function_exists('wp_doing_ajax')) {
892 892
             return wp_doing_ajax();
893 893
         }
894
-        return ( defined( 'DOING_AJAX' ) && DOING_AJAX );
894
+        return (defined('DOING_AJAX') && DOING_AJAX);
895 895
     }
896 896
 }
Please login to merge, or discard this patch.