PluginProbe
Autoptimize / 2.1.2
Autoptimize v2.1.2
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
← All changes | classes/autoptimizeConfig.php +23 -53 2.3.22.1.2 View file →
@@ -69,16 +69,8 @@
69 69 #ao_show_adv:before {
70 70 content: "\f108 \f140";
71 71 }
72 72
73 -/* animate "show adv" button */
74 -#ao_show_adv { animation: watchmenow 3s linear 5s 10; }
75 -#ao_show_adv:hover { animation: none; }
76 -@keyframes watchmenow {
77 - 0% { box-shadow: unset; }
78 - 100% { box-shadow: 0px 0px 20px yellow; }
79 -}
80 -
81 73 /* form */
82 74 .itemDetail {
83 75 background: #fff;
84 76 border: 1px solid #ccc;
@@ -158,9 +150,9 @@
158 150
159 151 <div class="wrap">
160 152
161 153 <?php if (version_compare(PHP_VERSION, '5.3.0') < 0) { ?>
162 -<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>
154 +<div class="notice-error notice"><?php _e('<p><strong>You are using a very old version of PHP</strong> (5.2.x or older) which has <a href="http://blog.futtta.be/2016/03/15/why-would-you-still-be-on-php-5-2/" target="_blank">serious security and performance issues</a>. Please ask your hoster to provide you with an upgrade path to 5.6 or 7.0</p>','autoptimize'); ?></div>
163 155 <?php } ?>
164 156
165 157 <div id="autoptimize_main">
166 158 <div id="ao_title_and_button">
@@ -217,13 +209,13 @@
217 209 </tr>
218 210 <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
219 211 <th scope="row"><?php _e('Force JavaScript in &lt;head&gt;?','autoptimize'); ?></th>
220 212 <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_forcehead" <?php echo get_option('autoptimize_js_forcehead')?'checked="checked" ':''; ?>/>
221 -<?php _e('Load JavaScript early, this can potentially fix some JS-errors, but makes the JS render blocking.','autoptimize'); ?></label></td>
213 +<?php _e('Load JavaScript early, reducing the chance of JS-errors but making it render blocking. You can disable this if you\'re not aggregating inline JS and you want JS to be deferred.','autoptimize'); ?></label></td>
222 214 </tr>
223 215 <?php if (get_option('autoptimize_js_justhead')) { ?>
224 216 <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
225 -<th scope="row"><?php _e('Look for scripts only in &lt;head&gt;?','autoptimize'); echo ' <i>'. __('(deprecated)','autoptimize') . '</i>'; ?></th>
217 +<th scope="row"><?php _e('Look for scripts only in &lt;head&gt;?','autoptimize'); _e(' <i>(deprecated)</i>','autoptimize'); ?></th>
226 218 <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_justhead" <?php echo get_option('autoptimize_js_justhead')?'checked="checked" ':''; ?>/>
227 219 <?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>
228 220 </tr>
229 221 <?php } ?>
@@ -229,9 +221,9 @@
229 221 <?php } ?>
230 222 <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
231 223 <th scope="row"><?php _e('Also aggregate inline JS?','autoptimize'); ?></th>
232 224 <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_include_inline" <?php echo get_option('autoptimize_js_include_inline')?'checked="checked" ':''; ?>/>
233 -<?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>
225 +<?php _e('Check this option for Autoptimize to also aggregate JS in the HTML. If this option is not enabled, you might have to "force JavaScript in head".','autoptimize'); ?></label></td>
234 226 </tr>
235 227 <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
236 228 <th scope="row"><?php _e('Exclude scripts from Autoptimize:','autoptimize'); ?></th>
237 229 <td><label><input type="text" style="width:100%;" name="autoptimize_js_exclude" value="<?php echo get_option('autoptimize_js_exclude',"seal.js, js/jquery/jquery.js"); ?>"/><br />
@@ -256,11 +248,16 @@
256 248 <th scope="row"><?php _e('Generate data: URIs for images?','autoptimize'); ?></th>
257 249 <td><label class="cb_label"><input type="checkbox" name="autoptimize_css_datauris" <?php echo get_option('autoptimize_css_datauris')?'checked="checked" ':''; ?>/>
258 250 <?php _e('Enable this to include small background-images in the CSS itself instead of as separate downloads.','autoptimize'); ?></label></td>
259 251 </tr>
252 +<tr class="<?php echo $hiddenClass;?>css_sub ao_adv" valign="top">
253 +<th scope="row"><?php _e('Remove Google Fonts?','autoptimize'); ?></th>
254 +<td><label class="cb_label"><input type="checkbox" name="autoptimize_css_nogooglefont" <?php echo get_option('autoptimize_css_nogooglefont')?'checked="checked" ':''; ?>/>
255 +<?php _e('Check this if you don\'t need or want Google Fonts being loaded.','autoptimize'); ?></label></td>
256 +</tr>
260 257 <?php if (get_option('autoptimize_css_justhead')) { ?>
261 258 <tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv">
262 -<th scope="row"><?php _e('Look for styles only in &lt;head&gt;?','autoptimize'); echo ' <i>'. __('(deprecated)','autoptimize') . '</i>'; ?></th>
259 +<th scope="row"><?php _e('Look for styles only in &lt;head&gt;?','autoptimize'); _e(' <i>(deprecated)</i>','autoptimize'); ?></th>
263 260 <td><label class="cb_label"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead')?'checked="checked" ':''; ?>/>
264 261 <?php _e('Don\'t autoptimize CSS outside the head-section. If the cache gets big, you might want to enable this.','autoptimize'); ?></label></td>
265 262 </tr>
266 263 <?php } ?>
@@ -296,9 +293,9 @@
296 293 <table class="form-table">
297 294 <tr valign="top">
298 295 <th scope="row"><?php _e('CDN Base URL','autoptimize'); ?></th>
299 296 <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 />
300 -<?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>
297 +<?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>).','autoptimize'); ?></label></td>
301 298 </tr>
302 299 </table>
303 300 </li>
304 301
@@ -317,44 +314,19 @@
317 314 <th scope="row"><?php _e('Cached styles and scripts','autoptimize'); ?></th>
318 315 <td><?php
319 316 $AOstatArr=autoptimizeCache::stats();
320 317 $AOcacheSize=round($AOstatArr[1]/1024);
321 - printf( __( '%1$s files, totalling %2$s Kbytes (calculated at %3$s)', 'autoptimize'), $AOstatArr[0], $AOcacheSize, date("H:i e", $AOstatArr[2]) );
318 + echo $AOstatArr[0].__(' files, totalling ','autoptimize').$AOcacheSize.__(' Kbytes (calculated at ','autoptimize').date("H:i e", $AOstatArr[2]).')';
322 319 ?></td>
323 320 </tr>
321 +<tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
322 +<th scope="row"><?php _e('Save aggregated script/css as static files?','autoptimize'); ?></th>
323 +<td><label class="cb_label"><input type="checkbox" name="autoptimize_cache_nogzip" <?php echo get_option('autoptimize_cache_nogzip','1')?'checked="checked" ':''; ?>/>
324 +<?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>
325 +</tr>
324 326 </table>
325 327 </li>
326 328
327 -<li class="<?php echo $hiddenClass;?>itemDetail ao_adv">
328 -<h2 class="itemTitle"><?php _e('Misc Options','autoptimize'); ?></h2>
329 -<table class="form-table">
330 - <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
331 - <th scope="row"><?php _e('Save aggregated script/css as static files?','autoptimize'); ?></th>
332 - <td><label class="cb_label"><input type="checkbox" name="autoptimize_cache_nogzip" <?php echo get_option('autoptimize_cache_nogzip','1')?'checked="checked" ':''; ?>/>
333 - <?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>
334 - </td>
335 - </tr>
336 - <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
337 - <th scope="row"><?php _e('Also optimize for logged in users?','autoptimize'); ?></th>
338 - <td><label class="cb_label"><input type="checkbox" name="autoptimize_optimize_logged" <?php echo get_option('autoptimize_optimize_logged','1')?'checked="checked" ':''; ?>/>
339 - <?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>
340 - </td>
341 - </tr>
342 - <?php
343 - if ( function_exists("is_checkout") || function_exists("is_cart") || function_exists("edd_is_checkout") || function_exists("wpsc_is_cart") || function_exists("wpsc_is_checkout") ) {
344 - ?>
345 - <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
346 - <th scope="row"><?php _e('Also optimize shop cart/ checkout?','autoptimize'); ?></th>
347 - <td><label class="cb_label"><input type="checkbox" name="autoptimize_optimize_checkout" <?php echo get_option('autoptimize_optimize_checkout','1')?'checked="checked" ':''; ?>/>
348 - <?php _e('By default Autoptimize is also active on your shop\'s cart/ checkout, uncheck not to optimize those.','autoptimize'); ?></label>
349 - </td>
350 - </tr>
351 - <?php
352 - }
353 - ?>
354 -</table>
355 -</li>
356 -
357 329 </ul>
358 330
359 331 <input type="hidden" id="autoptimize_show_adv" name="autoptimize_show_adv" value="<?php echo get_option('autoptimize_show_adv','0'); ?>">
360 332
@@ -382,9 +354,9 @@
382 354 }
383 355 echo $AO_banner;
384 356 }
385 357 ?>
386 - <li><?php _e("Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check out the FAQ here</a>.","autoptimize"); ?></li>
358 + <li><?php _e("Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check out the FAQ</a> or post your question on <a href='http://wordpress.org/support/plugin/autoptimize'>the support-forum</a>.","autoptimize"); ?></li>
387 359 <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>
388 360 </ul>
389 361 </div>
390 362 <div style="margin-left:10px;margin-top:-5px;">
@@ -407,9 +379,9 @@
407 379 <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_webtech"); ?>
408 380 </div>
409 381 </div>
410 382 </div>
411 - <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>
383 + <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!"); ?>"></a></div>
412 384 </div>
413 385
414 386 <script type="text/javascript">
415 387 var feed = new Array;
@@ -578,14 +550,13 @@
578 550 register_setting('autoptimize','autoptimize_css_defer');
579 551 register_setting('autoptimize','autoptimize_css_defer_inline');
580 552 register_setting('autoptimize','autoptimize_css_inline');
581 553 register_setting('autoptimize','autoptimize_css_include_inline');
554 + register_setting('autoptimize','autoptimize_css_nogooglefont');
582 555 register_setting('autoptimize','autoptimize_cdn_url');
583 556 register_setting('autoptimize','autoptimize_cache_clean');
584 557 register_setting('autoptimize','autoptimize_cache_nogzip');
585 558 register_setting('autoptimize','autoptimize_show_adv');
586 - register_setting('autoptimize','autoptimize_optimize_logged');
587 - register_setting('autoptimize','autoptimize_optimize_checkout');
588 559 }
589 560
590 561 public function setmeta($links,$file=null) {
591 562 //Inspired on http://wpengineer.com/meta-links-for-wordpress-plugins/
@@ -628,13 +599,12 @@
628 599 'autoptimize_css_defer' => 0,
629 600 'autoptimize_css_defer_inline' => "",
630 601 'autoptimize_css_inline' => 0,
631 602 'autoptimize_css_datauris' => 0,
603 + 'autoptimize_css_nogooglefont' => 0,
632 604 'autoptimize_cdn_url' => "",
633 605 'autoptimize_cache_nogzip' => 1,
634 - 'autoptimize_show_adv' => 0,
635 - 'autoptimize_optimize_logged' => 1,
636 - 'autoptimize_optimize_checkout' => 1
606 + 'autoptimize_show_adv' => 0
637 607 );
638 608
639 609 //Override with user settings
640 610 foreach(array_keys($config) as $name) {
@@ -645,9 +615,9 @@
645 615 }
646 616 }
647 617
648 618 //Save for next question
649 - $this->config = apply_filters( 'autoptimize_filter_get_config', $config );
619 + $this->config = $config;
650 620 }
651 621
652 622 if(isset($this->config[$key]))
653 623 return $this->config[$key];