Autoptimize - Version 2.1.0

Version Description

  • new: Autoptimize now appears in admin-toolbar with an easy view on cache size and the possibility to purge the cache (pass false to autoptimize_filter_toolbar_show filter to disable), a big thanks to Pablo Custo for his hard work on this nice feature!
  • new: An extra "More Optimization"-tab is shown (can be hidden with autoptimize_filter_show_partner_tabs-filter) with information about related optimization tools- and services.
  • new: If cache size becomes too big, a mail will be sent to the site admin (pass false to autoptimize_filter_cachecheck_sendmail filter to disable or pass alternative email to the autoptimize_filter_cachecheck_mailto filter to change email-address)
  • new: power-users can enable Autoptimize to pre-gzip the autoptimized files by passing true to autoptimize_filter_cache_create_static_gzip, kudo's to (Draikin)[https://github.com/Draikin] for this!
  • improvement: admin GUI updated (again; thanks Pablo!) with some responsiveness added in the mix (not showing the right hand column on smaller screen-sizes)
  • improvement: settings-screen now accepts protocol-relative URL for CDN base URL
  • improvement: new (smarter) defaults for JS (don't force in head + exclude jquery.js) and CSS optimization (include inline CSS)
  • Misc. bugfixes & small improvements (see commit-log on GitHub)
  • Minimal version updated from 2.7 (!) to 4.0
  • Tested and confirmed working on WordPress 4.6
Download this release

Release Info

Developer futtta
Plugin Icon 128x128 Autoptimize
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.1 to 2.1.0

Files changed (45) hide show
  1. README.md +0 -227
  2. autoptimize.php +211 -194
  3. classes/autoptimizeBase.php +253 -244
  4. classes/autoptimizeCache.php +193 -189
  5. classes/autoptimizeConfig.php +529 -385
  6. classes/autoptimizeHTML.php +75 -76
  7. classes/autoptimizeScripts.php +369 -369
  8. classes/autoptimizeStyles.php +662 -658
  9. classes/autoptimizeToolbar.php +136 -0
  10. classes/external/js/unslider-min.js +1 -1
  11. classes/external/js/unslider.css +1 -1
  12. classes/external/php/minify-2.3.1-jsmin.php +457 -0
  13. classes/index.html +1 -0
  14. classes/static/loading.gif +0 -0
  15. classes/static/toolbar.css +242 -0
  16. classes/static/toolbar.js +73 -0
  17. classlesses/autoptimizeCacheChecker.php +37 -27
  18. classlesses/autoptimizeFontRegex.php +7 -0
  19. classlesses/autoptimizePageCacheFlush.php +43 -43
  20. classlesses/autoptimizePartners.php +120 -0
  21. classlesses/autoptimizeUpdateCode.php +62 -62
  22. classlesses/index.html +1 -0
  23. config/index.html +1 -0
  24. index.html +1 -0
  25. localization/autoptimize-de_DE.mo +0 -0
  26. localization/autoptimize-de_DE.po +0 -316
  27. localization/autoptimize-es_ES.mo +0 -0
  28. localization/autoptimize-es_ES.po +0 -211
  29. localization/autoptimize-fr_FR.mo +0 -0
  30. localization/autoptimize-fr_FR.po +0 -422
  31. localization/autoptimize-nl_BE.mo +0 -0
  32. localization/autoptimize-nl_BE.po +0 -385
  33. localization/autoptimize-nl_NL.mo +0 -0
  34. localization/autoptimize-nl_NL.po +0 -385
  35. localization/autoptimize-pl_PL.mo +0 -0
  36. localization/autoptimize-pl_PL.po +0 -411
  37. localization/autoptimize-pt_BR.mo +0 -0
  38. localization/autoptimize-pt_BR.po +0 -458
  39. localization/autoptimize-sv_SE.mo +0 -0
  40. localization/autoptimize-sv_SE.po +0 -305
  41. localization/autoptimize-tr_TR.mo +0 -0
  42. localization/autoptimize-tr_TR.po +0 -412
  43. localization/autoptimize.pot +5 -1
  44. localization/index.html +1 -0
  45. readme.txt +58 -24
README.md DELETED
@@ -1,227 +0,0 @@
1
- Autoptimize
2
- ===========
3
-
4
- The [official Autoptimize repo on Github can be found here](https://github.com/futtta/autoptimize/).
5
-
6
- ## Example use of Autoptimize's API
7
-
8
- ### Filter: `autoptimize_filter_css_datauri_maxsize`
9
-
10
- ```php
11
- add_filter('autoptimize_filter_css_datauri_maxsize','my_ao_override_dataursize',10,1);
12
- /**
13
- * Change the threshold at which background images are turned into data URI-s.
14
- *
15
- * @param $urisize: default size
16
- * @return: your own preferred size
17
- */
18
- function my_ao_override_dataursize($urisizeIn) {
19
- return 100000;
20
- }
21
- ```
22
-
23
- ### Filter: `autoptimize_filter_css_datauri_exclude`
24
-
25
- ```php
26
- add_filter('autoptimize_filter_css_datauri_exclude','my_ao_exclude_image',10,1);
27
- /**
28
- * Exclude background images from being turned into data URI-s.
29
- *
30
- * @param $imageexcl: default images excluded (empty)
31
- * @return: comma-seperated list of images to exclude
32
- */
33
- function my_ao_exclude_image($imageexcl) {
34
- return "adfreebutton.jpg, otherimage.png";
35
- }
36
- ```
37
-
38
- ### Filter: `autoptimize_filter_js_defer`
39
-
40
- ```php
41
- add_filter('autoptimize_filter_js_defer','my_ao_override_defer',10,1);
42
- /**
43
- * Change flag added to Javascript.
44
- *
45
- * @param $defer: default value, "" when forced in head, "defer " when not forced in head
46
- * @return: new value
47
- */
48
- function my_ao_override_defer($defer) {
49
- return $defer."async ";
50
- }
51
- ```
52
-
53
- ### Filter: autoptimize_filter_noptimize
54
-
55
- ```php
56
- add_filter('autoptimize_filter_noptimize','my_ao_noptimize',10,0);
57
- /**
58
- * Stop autoptimize from optimizing, e.g. based on URL as in example.
59
- *
60
- * @return: boolean, true or false
61
- */
62
- function my_ao_noptimize() {
63
- if (strpos($_SERVER['REQUEST_URI'],'no-autoptimize-now')!==false) {
64
- return true;
65
- } else {
66
- return false;
67
- }
68
- }
69
- ```
70
-
71
- ### Filter: `autoptimize_filter_js_exclude`
72
-
73
- ```php
74
- add_filter('autoptimize_filter_js_exclude','my_ao_override_jsexclude',10,1);
75
- /**
76
- * JS optimization exclude strings, as configured in admin page.
77
- *
78
- * @param $exclude: comma-seperated list of exclude strings
79
- * @return: comma-seperated list of exclude strings
80
- */
81
- function my_ao_override_jsexclude($exclude) {
82
- return $exclude.", customize-support";
83
- }
84
- ```
85
-
86
- ### Filter: `autoptimize_filter_css_exclude`
87
-
88
- ```php
89
- add_filter('autoptimize_filter_css_exclude','my_ao_override_cssexclude',10,1);
90
- /**
91
- * CSS optimization exclude strings, as configured in admin page.
92
- *
93
- * @param $exclude: comma-seperated list of exclude strings
94
- * @return: comma-seperated list of exclude strings
95
- */
96
- function my_ao_override_cssexclude($exclude) {
97
- return $exclude.", recentcomments";
98
- }
99
- ```
100
-
101
- ## Filter: `autoptimize_filter_js_movelast`
102
-
103
- ```php
104
- add_filter('autoptimize_filter_js_movelast','my_ao_override_movelast',10,1);
105
- /**
106
- * Internal array of what script can be moved to the bottom of the HTML.
107
- *
108
- * @param array $movelast
109
- * @return: updated array
110
- */
111
- function my_ao_override_movelast($movelast) {
112
- $movelast[]="console.log";
113
- return $movelast;
114
- }
115
- ```
116
-
117
- ### Filter: `autoptimize_filter_css_replacetag`
118
-
119
- ```php
120
- add_filter('autoptimize_filter_css_replacetag','my_ao_override_css_replacetag',10,1);
121
- /**
122
- * Where in the HTML is optimized CSS injected.
123
- *
124
- * @param array $replacetag, containing the html-tag and the method (inject "before", "after" or "replace")
125
- * @return array with updated values
126
- */
127
- function my_ao_override_css_replacetag($replacetag) {
128
- return array("<head>","after");
129
- }
130
- ```
131
-
132
- ### Filter: `autoptimize_filter_js_replacetag`
133
-
134
- ```php
135
- add_filter('autoptimize_filter_js_replacetag','my_ao_override_js_replacetag',10,1);
136
- /**
137
- * Where in the HTML optimized JS is injected.
138
- *
139
- * @param array $replacetag, containing the html-tag and the method (inject "before", "after" or "replace")
140
- * @return array with updated values
141
- */
142
- function my_ao_override_js_replacetag($replacetag) {
143
- return array("<injectjs />","replace");
144
- }
145
- ```
146
-
147
- ### Filter: `autoptimize_js_do_minify`
148
-
149
- ```php
150
- add_filter('autoptimize_js_do_minify','my_ao_js_minify',10,1);
151
- /**
152
- * Do we want to minify?
153
- * If set to false autoptimize effectively only aggregates, but does not minify.
154
- *
155
- * @return: boolean true or false
156
- */
157
- function my_ao_js_minify() {
158
- return false;
159
- }
160
- ```
161
-
162
- ### Filter: `autoptimize_css_do_minify`
163
-
164
- ```php
165
- add_filter('autoptimize_css_do_minify','my_ao_css_minify',10,1);
166
- /**
167
- * Do we want to minify?
168
- * If set to false autoptimize effectively only aggregates, but does not minify.
169
- *
170
- * @return: boolean true or false
171
- */
172
- function my_ao_css_minify() {
173
- return false;
174
- }
175
- ```
176
-
177
- ### Filter: `autoptimize_js_include_inline`
178
-
179
- ```php
180
- add_filter('autoptimize_js_include_inline','my_ao_js_include_inline',10,1);
181
- /**
182
- * Do we want AO to also aggregate inline JS?
183
- *
184
- * @return: boolean true or false
185
- */
186
- function my_ao_js_include_inline() {
187
- return false;
188
- }
189
- ```
190
-
191
- ### Filter: `autoptimize_css_include_inline`
192
-
193
- ```php
194
- add_filter('autoptimize_css_include_inline','my_ao_css_include_inline',10,1);
195
- /**
196
- * Do we want AO to also aggregate inline CSS?
197
- *
198
- * @return: boolean true or false
199
- */
200
- function my_ao_css_include_inline() {
201
- return false;
202
- }
203
- ```
204
-
205
- ### Filter: `autoptimize_filter_css_defer_inline`
206
-
207
- ```php
208
- add_filter('autoptimize_filter_css_defer_inline','my_ao_css_defer_inline',10,1);
209
- /**
210
- * What CSS to inline when "defer and inline" is activated.
211
- *
212
- * @param $inlined: string with above the fold CSS as configured in admin
213
- * @return: updated string with above the fold CSS
214
- */
215
- function my_ao_css_defer_inline($inlined) {
216
- return $inlined."h2,h1{color:red !important;}";
217
- }
218
- ```
219
-
220
- ### Filter: `autoptimize_separate_blog_caches`
221
-
222
- ```php
223
- add_filter('autoptimize_separate_blog_caches','__return_false',10,1);
224
- /**
225
- * Do not separate cache folders in multisite setup.
226
- */
227
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
autoptimize.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Autoptimize
4
  Plugin URI: http://blog.futtta.be/autoptimize
5
  Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
6
- Version: 2.0.1
7
  Author: Frank Goossens (futtta)
8
  Author URI: http://blog.futtta.be/
9
  Domain Path: localization/
@@ -19,11 +19,19 @@ define('AUTOPTIMIZE_PLUGIN_DIR',plugin_dir_path(__FILE__));
19
  // Load config class
20
  include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeConfig.php');
21
 
 
 
 
 
 
 
 
 
22
  // Do we gzip when caching (needed early to load autoptimizeCache.php)
23
  define('AUTOPTIMIZE_CACHE_NOGZIP',(bool) get_option('autoptimize_cache_nogzip'));
24
 
25
  // Load cache class
26
- include(AUTOPTIMIZE_PLUGIN_DIR.'/classes/autoptimizeCache.php');
27
 
28
  // wp-content dir name (automagically set, should not be needed), dirname of AO cache dir and AO-prefix can be overridden in wp-config.php
29
  if (!defined('AUTOPTIMIZE_WP_CONTENT_NAME')) { define('AUTOPTIMIZE_WP_CONTENT_NAME','/'.wp_basename( WP_CONTENT_DIR )); }
@@ -32,10 +40,10 @@ if (!defined('AUTOPTIMIZE_CACHEFILE_PREFIX')) { define('AUTOPTIMIZE_CACHEFILE_PR
32
 
33
  // Plugin dir constants (plugin url's defined later to accomodate domain mapped sites)
34
  if (is_multisite() && apply_filters( 'autoptimize_separate_blog_caches' , true )) {
35
- $blog_id = get_current_blog_id();
36
- define('AUTOPTIMIZE_CACHE_DIR', WP_CONTENT_DIR.AUTOPTIMIZE_CACHE_CHILD_DIR.$blog_id.'/' );
37
  } else {
38
- define('AUTOPTIMIZE_CACHE_DIR', WP_CONTENT_DIR.AUTOPTIMIZE_CACHE_CHILD_DIR);
39
  }
40
  define('AUTOPTIMIZE_CACHE_DELAY',true);
41
  define('WP_ROOT_DIR',str_replace(AUTOPTIMIZE_WP_CONTENT_NAME,'',WP_CONTENT_DIR));
@@ -46,229 +54,238 @@ $conf = autoptimizeConfig::instance();
46
  /* Check if we're updating, in which case we might need to do stuff and flush the cache
47
  to avoid old versions of aggregated files lingering around */
48
 
49
- $autoptimize_version="2.0.0";
50
  $autoptimize_db_version=get_option('autoptimize_version','none');
51
 
52
  if ($autoptimize_db_version !== $autoptimize_version) {
53
- if ($autoptimize_db_version==="none") {
54
- add_action('admin_notices', 'autoptimize_install_config_notice');
55
- } else {
56
- // updating, include the update-code
57
- include(AUTOPTIMIZE_PLUGIN_DIR.'/classlesses/autoptimizeUpdateCode.php');
58
- }
59
-
60
- update_option('autoptimize_version',$autoptimize_version);
61
- $autoptimize_db_version=$autoptimize_version;
62
  }
63
 
64
  // Load translations
65
- load_plugin_textdomain('autoptimize',false,plugin_basename(dirname( __FILE__ )).'/localization');
 
 
 
66
 
67
  function autoptimize_uninstall(){
68
- autoptimizeCache::clearall();
69
-
70
- $delete_options=array("autoptimize_cache_clean", "autoptimize_cache_nogzip", "autoptimize_css", "autoptimize_css_datauris", "autoptimize_css_justhead", "autoptimize_css_defer", "autoptimize_css_defer_inline", "autoptimize_css_inline", "autoptimize_css_exclude", "autoptimize_html", "autoptimize_html_keepcomments", "autoptimize_js", "autoptimize_js_exclude", "autoptimize_js_forcehead", "autoptimize_js_justhead", "autoptimize_js_trycatch", "autoptimize_version", "autoptimize_show_adv", "autoptimize_cdn_url", "autoptimize_cachesize_notice","autoptimize_css_include_inline","autoptimize_js_include_inline","autoptimize_css_nogooglefont");
71
-
72
- if ( !is_multisite() ) {
73
- foreach ($delete_options as $del_opt) { delete_option( $del_opt ); }
74
- } else {
75
- global $wpdb;
76
- $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
77
- $original_blog_id = get_current_blog_id();
78
- foreach ( $blog_ids as $blog_id )
79
- {
80
- switch_to_blog( $blog_id );
81
- foreach ($delete_options as $del_opt) { delete_option( $del_opt ); }
82
- }
83
- switch_to_blog( $original_blog_id );
84
- }
85
-
86
- if ( wp_get_schedule( 'ao_cachechecker' ) ) {
87
- wp_clear_scheduled_hook( 'ao_cachechecker' );
88
- }
89
  }
90
 
91
  function autoptimize_install_config_notice() {
92
- echo '<div class="updated"><p>';
93
- _e('Thank you for installing and activating Autoptimize. Please configure it under "Settings" -> "Autoptimize" to start improving your site\'s performance.', 'autoptimize' );
94
- echo '</p></div>';
95
  }
96
 
97
  function autoptimize_update_config_notice() {
98
  echo '<div class="updated"><p>';
99
- _e('Autoptimize has just been updated. Please <strong>test your site now</strong> and adapt Autoptimize config if needed.', 'autoptimize' );
100
- echo '</p></div>';
101
  }
102
 
103
  function autoptimize_cache_unavailable_notice() {
104
- echo '<div class="error"><p>';
105
- _e('Autoptimize cannot write to the cache directory (default: /wp-content/cache/autoptimize), please fix to enable CSS/ JS optimization!', 'autoptimize' );
106
- echo '</p></div>';
107
  }
108
 
109
-
110
  // Set up the buffering
111
  function autoptimize_start_buffering() {
112
- $ao_noptimize = false;
113
-
114
- // noptimize in qs to get non-optimized page for debugging
115
- if (array_key_exists("ao_noptimize",$_GET)) {
116
- if ( ($_GET["ao_noptimize"]==="1") && (apply_filters('autoptimize_filter_honor_qs_noptimize',true)) ) {
117
- $ao_noptimize = true;
118
- }
119
- }
120
-
121
- // check for DONOTMINIFY constant as used by e.g. WooCommerce POS
122
- if (defined('DONOTMINIFY') && (constant('DONOTMINIFY')===true || constant('DONOTMINIFY')==="true")) {
123
- $ao_noptimize = true;
124
- }
125
-
126
- // filter you can use to block autoptimization on your own terms
127
- $ao_noptimize = (bool) apply_filters( 'autoptimize_filter_noptimize', $ao_noptimize );
128
-
129
- if (!is_feed() && !$ao_noptimize && !is_admin()) {
130
- // Config element
131
- $conf = autoptimizeConfig::instance();
132
-
133
- // Load our base class
134
- include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeBase.php');
135
-
136
- // Load extra classes and set some vars
137
- if($conf->get('autoptimize_html')) {
138
- include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeHTML.php');
139
- // BUG: new minify-html does not support keeping HTML comments, skipping for now
140
- // if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) {
141
- @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-html.php');
142
- // } else {
143
- // @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-2.1.7-html.php');
144
- // }
145
- }
146
-
147
- if($conf->get('autoptimize_js')) {
148
- include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeScripts.php');
149
- if (!class_exists('JSMin')) {
150
- if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) {
151
- @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/jsmin-1.1.1.php');
152
- } else {
153
- @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-2.1.7-jsmin.php');
154
- }
155
- }
156
- if ( ! defined( 'CONCATENATE_SCRIPTS' )) {
157
- define('CONCATENATE_SCRIPTS',false);
158
- }
159
- if ( ! defined( 'COMPRESS_SCRIPTS' )) {
160
- define('COMPRESS_SCRIPTS',false);
161
- }
162
- }
163
-
164
- if($conf->get('autoptimize_css')) {
165
- include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeStyles.php');
166
- if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) {
167
- if (!class_exists('Minify_CSS_Compressor')) {
168
- @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-css-compressor.php');
169
- }
170
- } else {
171
- if (!class_exists('CSSmin')) {
172
- @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/yui-php-cssmin-2.4.8-4_fgo.php');
173
- }
174
- }
175
- if ( ! defined( 'COMPRESS_CSS' )) {
176
- define('COMPRESS_CSS',false);
177
- }
178
- }
179
-
180
- // Now, start the real thing!
181
- ob_start('autoptimize_end_buffering');
182
- }
 
 
 
 
 
 
 
183
  }
184
 
185
  // Action on end, this is where the magic happens
186
  function autoptimize_end_buffering($content) {
187
- if ( stripos($content,"<html") === false || stripos($content,"<html amp") !== false || stripos($content,"<html ⚡") !== false ||stripos($content,"<xsl:stylesheet") !== false ) { return $content;}
188
-
189
- // load URL constants as late as possible to allow domain mapper to kick in
190
- if (function_exists("domain_mapping_siteurl")) {
191
- define('AUTOPTIMIZE_WP_SITE_URL',domain_mapping_siteurl(get_current_blog_id()));
192
- define('AUTOPTIMIZE_WP_CONTENT_URL',str_replace(get_original_url(AUTOPTIMIZE_WP_SITE_URL),AUTOPTIMIZE_WP_SITE_URL,content_url()));
193
- } else {
194
- define('AUTOPTIMIZE_WP_SITE_URL',site_url());
195
- define('AUTOPTIMIZE_WP_CONTENT_URL',content_url());
196
- }
197
-
198
- if ( is_multisite() && apply_filters( 'autoptimize_separate_blog_caches' , true ) ) {
199
- $blog_id = get_current_blog_id();
200
- define('AUTOPTIMIZE_CACHE_URL',AUTOPTIMIZE_WP_CONTENT_URL.AUTOPTIMIZE_CACHE_CHILD_DIR.$blog_id.'/' );
201
- } else {
202
- define('AUTOPTIMIZE_CACHE_URL',AUTOPTIMIZE_WP_CONTENT_URL.AUTOPTIMIZE_CACHE_CHILD_DIR);
203
- }
204
- define('AUTOPTIMIZE_WP_ROOT_URL',str_replace(AUTOPTIMIZE_WP_CONTENT_NAME,'',AUTOPTIMIZE_WP_CONTENT_URL));
205
-
206
- // Config element
207
- $conf = autoptimizeConfig::instance();
208
-
209
- // Choose the classes
210
- $classes = array();
211
- if($conf->get('autoptimize_js'))
212
- $classes[] = 'autoptimizeScripts';
213
- if($conf->get('autoptimize_css'))
214
- $classes[] = 'autoptimizeStyles';
215
- if($conf->get('autoptimize_html'))
216
- $classes[] = 'autoptimizeHTML';
217
-
218
- // Set some options
219
- $classoptions = array(
220
- 'autoptimizeScripts' => array(
221
- 'justhead' => $conf->get('autoptimize_js_justhead'),
222
- 'forcehead' => $conf->get('autoptimize_js_forcehead'),
223
- 'trycatch' => $conf->get('autoptimize_js_trycatch'),
224
- 'js_exclude' => $conf->get('autoptimize_js_exclude'),
225
- 'cdn_url' => $conf->get('autoptimize_cdn_url'),
226
- 'include_inline' => $conf->get('autoptimize_js_include_inline')
227
- ),
228
- 'autoptimizeStyles' => array(
229
- 'justhead' => $conf->get('autoptimize_css_justhead'),
230
- 'datauris' => $conf->get('autoptimize_css_datauris'),
231
- 'defer' => $conf->get('autoptimize_css_defer'),
232
- 'defer_inline' => $conf->get('autoptimize_css_defer_inline'),
233
- 'inline' => $conf->get('autoptimize_css_inline'),
234
- 'css_exclude' => $conf->get('autoptimize_css_exclude'),
235
- 'cdn_url' => $conf->get('autoptimize_cdn_url'),
236
- 'include_inline' => $conf->get('autoptimize_css_include_inline'),
237
- 'nogooglefont' => $conf->get('autoptimize_css_nogooglefont')
238
- ),
239
- 'autoptimizeHTML' => array(
240
- 'keepcomments' => $conf->get('autoptimize_html_keepcomments')
241
- )
242
- );
243
-
244
- $content = apply_filters( 'autoptimize_filter_html_before_minify', $content );
245
- // Run the classes
246
- foreach($classes as $name) {
247
- $instance = new $name($content);
248
- if($instance->read($classoptions[$name]))
249
- {
250
- $instance->minify();
251
- $instance->cache();
252
- $content = $instance->getcontent();
253
- }
254
- unset($instance);
255
- }
256
- $content = apply_filters( 'autoptimize_html_after_minify', $content );
257
- return $content;
 
258
  }
259
 
260
  if ( autoptimizeCache::cacheavail() ) {
261
- $conf = autoptimizeConfig::instance();
262
- if( $conf->get('autoptimize_html') || $conf->get('autoptimize_js') || $conf->get('autoptimize_css') ) {
263
- // Hook to wordpress
264
  if (defined('AUTOPTIMIZE_INIT_EARLIER')) {
265
  add_action('init','autoptimize_start_buffering',-1);
266
  } else {
267
- add_action('template_redirect','autoptimize_start_buffering',2);
268
  }
269
- }
270
  } else {
271
- add_action('admin_notices', 'autoptimize_cache_unavailable_notice');
272
  }
273
 
274
  register_uninstall_hook(__FILE__, "autoptimize_uninstall");
3
  Plugin Name: Autoptimize
4
  Plugin URI: http://blog.futtta.be/autoptimize
5
  Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
6
+ Version: 2.1.0
7
  Author: Frank Goossens (futtta)
8
  Author URI: http://blog.futtta.be/
9
  Domain Path: localization/
19
  // Load config class
20
  include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeConfig.php');
21
 
22
+ // Load toolbar class
23
+ include( AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeToolbar.php' );
24
+
25
+ // Load partners tab if admin
26
+ if (is_admin()) {
27
+ include AUTOPTIMIZE_PLUGIN_DIR.'classlesses/autoptimizePartners.php';
28
+ }
29
+
30
  // Do we gzip when caching (needed early to load autoptimizeCache.php)
31
  define('AUTOPTIMIZE_CACHE_NOGZIP',(bool) get_option('autoptimize_cache_nogzip'));
32
 
33
  // Load cache class
34
+ include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeCache.php');
35
 
36
  // wp-content dir name (automagically set, should not be needed), dirname of AO cache dir and AO-prefix can be overridden in wp-config.php
37
  if (!defined('AUTOPTIMIZE_WP_CONTENT_NAME')) { define('AUTOPTIMIZE_WP_CONTENT_NAME','/'.wp_basename( WP_CONTENT_DIR )); }
40
 
41
  // Plugin dir constants (plugin url's defined later to accomodate domain mapped sites)
42
  if (is_multisite() && apply_filters( 'autoptimize_separate_blog_caches' , true )) {
43
+ $blog_id = get_current_blog_id();
44
+ define('AUTOPTIMIZE_CACHE_DIR', WP_CONTENT_DIR.AUTOPTIMIZE_CACHE_CHILD_DIR.$blog_id.'/' );
45
  } else {
46
+ define('AUTOPTIMIZE_CACHE_DIR', WP_CONTENT_DIR.AUTOPTIMIZE_CACHE_CHILD_DIR);
47
  }
48
  define('AUTOPTIMIZE_CACHE_DELAY',true);
49
  define('WP_ROOT_DIR',str_replace(AUTOPTIMIZE_WP_CONTENT_NAME,'',WP_CONTENT_DIR));
54
  /* Check if we're updating, in which case we might need to do stuff and flush the cache
55
  to avoid old versions of aggregated files lingering around */
56
 
57
+ $autoptimize_version="2.1.0";
58
  $autoptimize_db_version=get_option('autoptimize_version','none');
59
 
60
  if ($autoptimize_db_version !== $autoptimize_version) {
61
+ if ($autoptimize_db_version==="none") {
62
+ add_action('admin_notices', 'autoptimize_install_config_notice');
63
+ } else {
64
+ // updating, include the update-code
65
+ include(AUTOPTIMIZE_PLUGIN_DIR.'classlesses/autoptimizeUpdateCode.php');
66
+ }
67
+
68
+ update_option('autoptimize_version',$autoptimize_version);
69
+ $autoptimize_db_version=$autoptimize_version;
70
  }
71
 
72
  // Load translations
73
+ function autoptimize_load_plugin_textdomain() {
74
+ load_plugin_textdomain('autoptimize',false,plugin_basename(dirname( __FILE__ )).'/localization');
75
+ }
76
+ add_action( 'init', 'autoptimize_load_plugin_textdomain' );
77
 
78
  function autoptimize_uninstall(){
79
+ autoptimizeCache::clearall();
80
+
81
+ $delete_options=array("autoptimize_cache_clean", "autoptimize_cache_nogzip", "autoptimize_css", "autoptimize_css_datauris", "autoptimize_css_justhead", "autoptimize_css_defer", "autoptimize_css_defer_inline", "autoptimize_css_inline", "autoptimize_css_exclude", "autoptimize_html", "autoptimize_html_keepcomments", "autoptimize_js", "autoptimize_js_exclude", "autoptimize_js_forcehead", "autoptimize_js_justhead", "autoptimize_js_trycatch", "autoptimize_version", "autoptimize_show_adv", "autoptimize_cdn_url", "autoptimize_cachesize_notice","autoptimize_css_include_inline","autoptimize_js_include_inline","autoptimize_css_nogooglefont");
82
+
83
+ if ( !is_multisite() ) {
84
+ foreach ($delete_options as $del_opt) { delete_option( $del_opt ); }
85
+ } else {
86
+ global $wpdb;
87
+ $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
88
+ $original_blog_id = get_current_blog_id();
89
+ foreach ( $blog_ids as $blog_id ) {
90
+ switch_to_blog( $blog_id );
91
+ foreach ($delete_options as $del_opt) { delete_option( $del_opt ); }
92
+ }
93
+ switch_to_blog( $original_blog_id );
94
+ }
95
+
96
+ if ( wp_get_schedule( 'ao_cachechecker' ) ) {
97
+ wp_clear_scheduled_hook( 'ao_cachechecker' );
98
+ }
 
99
  }
100
 
101
  function autoptimize_install_config_notice() {
102
+ echo '<div class="updated"><p>';
103
+ _e('Thank you for installing and activating Autoptimize. Please configure it under "Settings" -> "Autoptimize" to start improving your site\'s performance.', 'autoptimize' );
104
+ echo '</p></div>';
105
  }
106
 
107
  function autoptimize_update_config_notice() {
108
  echo '<div class="updated"><p>';
109
+ _e('Autoptimize has just been updated. Please <strong>test your site now</strong> and adapt Autoptimize config if needed.', 'autoptimize' );
110
+ echo '</p></div>';
111
  }
112
 
113
  function autoptimize_cache_unavailable_notice() {
114
+ echo '<div class="error"><p>';
115
+ _e('Autoptimize cannot write to the cache directory (default: /wp-content/cache/autoptimize), please fix to enable CSS/ JS optimization!', 'autoptimize' );
116
+ echo '</p></div>';
117
  }
118
 
 
119
  // Set up the buffering
120
  function autoptimize_start_buffering() {
121
+ $ao_noptimize = false;
122
+
123
+ // noptimize in qs to get non-optimized page for debugging
124
+ if (array_key_exists("ao_noptimize",$_GET)) {
125
+ if ( ($_GET["ao_noptimize"]==="1") && (apply_filters('autoptimize_filter_honor_qs_noptimize',true)) ) {
126
+ $ao_noptimize = true;
127
+ }
128
+ }
129
+
130
+ // check for DONOTMINIFY constant as used by e.g. WooCommerce POS
131
+ if (defined('DONOTMINIFY') && (constant('DONOTMINIFY')===true || constant('DONOTMINIFY')==="true")) {
132
+ $ao_noptimize = true;
133
+ }
134
+
135
+ // filter you can use to block autoptimization on your own terms
136
+ $ao_noptimize = (bool) apply_filters( 'autoptimize_filter_noptimize', $ao_noptimize );
137
+
138
+ if (!is_feed() && !$ao_noptimize && !is_admin() && ( !function_exists('is_customize_preview') || !is_customize_preview() ) ) {
139
+ // Config element
140
+ $conf = autoptimizeConfig::instance();
141
+
142
+ // Load our base class
143
+ include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeBase.php');
144
+
145
+ // Load extra classes and set some vars
146
+ if($conf->get('autoptimize_html')) {
147
+ include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeHTML.php');
148
+ // BUG: new minify-html does not support keeping HTML comments, skipping for now
149
+ // if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) {
150
+ @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-html.php');
151
+ // } else {
152
+ // @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-2.1.7-html.php');
153
+ // }
154
+ }
155
+
156
+ if($conf->get('autoptimize_js')) {
157
+ include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeScripts.php');
158
+ if (!class_exists('JSMin')) {
159
+ if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) {
160
+ @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/jsmin-1.1.1.php');
161
+ } else {
162
+ @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-2.3.1-jsmin.php');
163
+ }
164
+ }
165
+ if ( ! defined( 'CONCATENATE_SCRIPTS' )) {
166
+ define('CONCATENATE_SCRIPTS',false);
167
+ }
168
+ if ( ! defined( 'COMPRESS_SCRIPTS' )) {
169
+ define('COMPRESS_SCRIPTS',false);
170
+ }
171
+ }
172
+
173
+ if($conf->get('autoptimize_css')) {
174
+ include(AUTOPTIMIZE_PLUGIN_DIR.'classes/autoptimizeStyles.php');
175
+ if (defined('AUTOPTIMIZE_LEGACY_MINIFIERS')) {
176
+ if (!class_exists('Minify_CSS_Compressor')) {
177
+ @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/minify-css-compressor.php');
178
+ }
179
+ } else {
180
+ if (!class_exists('CSSmin')) {
181
+ @include(AUTOPTIMIZE_PLUGIN_DIR.'classes/external/php/yui-php-cssmin-2.4.8-4_fgo.php');
182
+ }
183
+ }
184
+ if ( ! defined( 'COMPRESS_CSS' )) {
185
+ define('COMPRESS_CSS',false);
186
+ }
187
+ }
188
+
189
+ // filter to be used with care, kills all output buffers when true. use with extreme caution. you have been warned!
190
+ if (apply_filters('autoptimize_filter_obkiller',false)) {
191
+ while (ob_get_level() > 0) {
192
+ ob_end_clean();
193
+ }
194
+ }
195
+
196
+ // Now, start the real thing!
197
+ ob_start('autoptimize_end_buffering');
198
+ }
199
  }
200
 
201
  // Action on end, this is where the magic happens
202
  function autoptimize_end_buffering($content) {
203
+ if ( ((stripos($content,"<html") === false) && (stripos($content,"<!DOCTYPE html") === false)) || preg_match('/<html[^>]*(?:amp|⚡)/',$content) === 1 || stripos($content,"<xsl:stylesheet") !== false ) { return $content; }
204
+
205
+ // load URL constants as late as possible to allow domain mapper to kick in
206
+ if (function_exists("domain_mapping_siteurl")) {
207
+ define('AUTOPTIMIZE_WP_SITE_URL',domain_mapping_siteurl(get_current_blog_id()));
208
+ define('AUTOPTIMIZE_WP_CONTENT_URL',str_replace(get_original_url(AUTOPTIMIZE_WP_SITE_URL),AUTOPTIMIZE_WP_SITE_URL,content_url()));
209
+ } else {
210
+ define('AUTOPTIMIZE_WP_SITE_URL',site_url());
211
+ define('AUTOPTIMIZE_WP_CONTENT_URL',content_url());
212
+ }
213
+
214
+ if ( is_multisite() && apply_filters( 'autoptimize_separate_blog_caches' , true ) ) {
215
+ $blog_id = get_current_blog_id();
216
+ define('AUTOPTIMIZE_CACHE_URL',AUTOPTIMIZE_WP_CONTENT_URL.AUTOPTIMIZE_CACHE_CHILD_DIR.$blog_id.'/' );
217
+ } else {
218
+ define('AUTOPTIMIZE_CACHE_URL',AUTOPTIMIZE_WP_CONTENT_URL.AUTOPTIMIZE_CACHE_CHILD_DIR);
219
+ }
220
+ define('AUTOPTIMIZE_WP_ROOT_URL',str_replace(AUTOPTIMIZE_WP_CONTENT_NAME,'',AUTOPTIMIZE_WP_CONTENT_URL));
221
+
222
+ // Config element
223
+ $conf = autoptimizeConfig::instance();
224
+
225
+ // Choose the classes
226
+ $classes = array();
227
+ if($conf->get('autoptimize_js'))
228
+ $classes[] = 'autoptimizeScripts';
229
+ if($conf->get('autoptimize_css'))
230
+ $classes[] = 'autoptimizeStyles';
231
+ if($conf->get('autoptimize_html'))
232
+ $classes[] = 'autoptimizeHTML';
233
+
234
+ // Set some options
235
+ $classoptions = array(
236
+ 'autoptimizeScripts' => array(
237
+ 'justhead' => $conf->get('autoptimize_js_justhead'),
238
+ 'forcehead' => $conf->get('autoptimize_js_forcehead'),
239
+ 'trycatch' => $conf->get('autoptimize_js_trycatch'),
240
+ 'js_exclude' => $conf->get('autoptimize_js_exclude'),
241
+ 'cdn_url' => $conf->get('autoptimize_cdn_url'),
242
+ 'include_inline' => $conf->get('autoptimize_js_include_inline')
243
+ ),
244
+ 'autoptimizeStyles' => array(
245
+ 'justhead' => $conf->get('autoptimize_css_justhead'),
246
+ 'datauris' => $conf->get('autoptimize_css_datauris'),
247
+ 'defer' => $conf->get('autoptimize_css_defer'),
248
+ 'defer_inline' => $conf->get('autoptimize_css_defer_inline'),
249
+ 'inline' => $conf->get('autoptimize_css_inline'),
250
+ 'css_exclude' => $conf->get('autoptimize_css_exclude'),
251
+ 'cdn_url' => $conf->get('autoptimize_cdn_url'),
252
+ 'include_inline' => $conf->get('autoptimize_css_include_inline'),
253
+ 'nogooglefont' => $conf->get('autoptimize_css_nogooglefont')
254
+ ),
255
+ 'autoptimizeHTML' => array(
256
+ 'keepcomments' => $conf->get('autoptimize_html_keepcomments')
257
+ )
258
+ );
259
+
260
+ $content = apply_filters( 'autoptimize_filter_html_before_minify', $content );
261
+
262
+ // Run the classes
263
+ foreach($classes as $name) {
264
+ $instance = new $name($content);
265
+ if($instance->read($classoptions[$name])) {
266
+ $instance->minify();
267
+ $instance->cache();
268
+ $content = $instance->getcontent();
269
+ }
270
+ unset($instance);
271
+ }
272
+
273
+ $content = apply_filters( 'autoptimize_html_after_minify', $content );
274
+ return $content;
275
  }
276
 
277
  if ( autoptimizeCache::cacheavail() ) {
278
+ $conf = autoptimizeConfig::instance();
279
+ if( $conf->get('autoptimize_html') || $conf->get('autoptimize_js') || $conf->get('autoptimize_css') ) {
280
+ // Hook to wordpress
281
  if (defined('AUTOPTIMIZE_INIT_EARLIER')) {
282
  add_action('init','autoptimize_start_buffering',-1);
283
  } else {
284
+ add_action('template_redirect','autoptimize_start_buffering',2);
285
  }
286
+ }
287
  } else {
288
+ add_action('admin_notices', 'autoptimize_cache_unavailable_notice');
289
  }
290
 
291
  register_uninstall_hook(__FILE__, "autoptimize_uninstall");
classes/autoptimizeBase.php CHANGED
@@ -2,274 +2,283 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  abstract class autoptimizeBase {
5
- protected $content = '';
6
- protected $tagWarning = false;
7
-
8
- public function __construct($content) {
9
- $this->content = $content;
10
- }
11
-
12
- //Reads the page and collects tags
13
- abstract public function read($justhead);
14
-
15
- //Joins and optimizes collected things
16
- abstract public function minify();
17
-
18
- //Caches the things
19
- abstract public function cache();
20
-
21
- //Returns the content
22
- abstract public function getcontent();
23
-
24
- //Converts an URL to a full path
25
- protected function getpath($url) {
26
- $url=apply_filters( 'autoptimize_filter_cssjs_alter_url', $url);
27
-
28
- if (strpos($url,'%')!==false) {
29
- $url=urldecode($url);
30
- }
31
 
32
- // normalize
33
- if (strpos($url,'//')===0) {
34
- if (is_ssl()) {
35
- $url = "https:".$url;
36
- } else {
37
- $url = "http:".$url;
38
- }
39
- } else if ((strpos($url,'//')===false) && (strpos($url,parse_url(AUTOPTIMIZE_WP_SITE_URL,PHP_URL_HOST))===false)) {
40
- $url = AUTOPTIMIZE_WP_SITE_URL.$url;
41
- }
 
 
 
 
 
 
 
42
 
43
- // first check; hostname wp site should be hostname of url
44
- $thisHost=@parse_url($url,PHP_URL_HOST);
45
- if ($thisHost!==parse_url(AUTOPTIMIZE_WP_SITE_URL,PHP_URL_HOST)) {
46
- /*
47
- * first try to get all domains from WPML (if available)
48
- * then explicitely declare $this->cdn_url as OK as well
49
- * then apply own filter autoptimize_filter_cssjs_multidomain takes an array of hostnames
50
- * each item in that array will be considered part of the same WP multisite installation
51
- */
52
- $multidomains = array();
53
-
54
- $multidomainsWPML = apply_filters('wpml_setting', array(), 'language_domains');
55
- if (!empty($multidomainsWPML)) {
56
- $multidomains = array_map(array($this,"ao_getDomain"),$multidomainsWPML);
57
- }
58
-
59
- if (!empty($this->cdn_url)) {
60
- $multidomains[]=parse_url($this->cdn_url,PHP_URL_HOST);
61
- }
62
-
63
- $multidomains = apply_filters('autoptimize_filter_cssjs_multidomain', $multidomains);
64
-
65
- if (!empty($multidomains)) {
66
- if (in_array($thisHost,$multidomains)) {
67
- $url=str_replace($thisHost, parse_url(AUTOPTIMIZE_WP_SITE_URL,PHP_URL_HOST), $url);
68
- } else {
69
- return false;
70
- }
71
- } else {
72
- return false;
73
- }
74
- }
75
-
76
- // try to remove "wp root url" from url while not minding http<>https
77
- $tmp_ao_root = preg_replace('/https?/','',AUTOPTIMIZE_WP_ROOT_URL);
78
- $tmp_url = preg_replace('/https?/','',$url);
79
- $path = str_replace($tmp_ao_root,'',$tmp_url);
80
-
81
- // final check; if path starts with :// or //, this is not a URL in the WP context and we have to assume we can't aggregate
82
- if (preg_match('#^:?//#',$path)) {
83
- /** External script/css (adsense, etc) */
84
- return false;
85
- }
86
 
87
- $path = str_replace('//','/',WP_ROOT_DIR.$path);
88
- return $path;
89
- }
90
 
91
- // needed for WPML-filter
92
- protected function ao_getDomain($in) {
93
  // make sure the url starts with something vaguely resembling a protocol
94
  if ((strpos($in,"http")!==0) && (strpos($in,"//")!==0)) {
95
  $in="http://".$in;
96
  }
97
 
98
  // do the actual parse_url
99
- $out = parse_url($in,PHP_URL_HOST);
100
 
101
  // fallback if parse_url does not understand the url is in fact a url
102
- if (empty($out)) $out=$in;
103
 
104
- return $out;
105
- }
106
 
107
 
108
- // logger
109
- protected function ao_logger($logmsg,$appendHTML=true) {
110
- if ($appendHTML) {
111
- $logmsg="<!--noptimize--><!-- ".$logmsg." --><!--/noptimize-->";
112
- $this->content.=$logmsg;
113
- } else {
114
- error_log("Autoptimize: ".$logmsg);
115
- }
116
- }
117
 
118
- // hide everything between noptimize-comment tags
119
- protected function hide_noptimize($noptimize_in) {
120
- if ( preg_match( '/<!--\s?noptimize\s?-->/', $noptimize_in ) ) {
121
- $noptimize_out = preg_replace_callback(
122
- '#<!--\s?noptimize\s?-->.*?<!--\s?/\s?noptimize\s?-->#is',
123
- create_function(
124
- '$matches',
125
- 'return "%%NOPTIMIZE%%".base64_encode($matches[0])."%%NOPTIMIZE%%";'
126
- ),
127
- $noptimize_in
128
- );
129
- } else {
130
- $noptimize_out = $noptimize_in;
131
- }
132
- return $noptimize_out;
133
- }
134
-
135
- // unhide noptimize-tags
136
- protected function restore_noptimize($noptimize_in) {
137
- if ( strpos( $noptimize_in, '%%NOPTIMIZE%%' ) !== false ) {
138
- $noptimize_out = preg_replace_callback(
139
- '#%%NOPTIMIZE%%(.*?)%%NOPTIMIZE%%#is',
140
- create_function(
141
- '$matches',
142
- 'return base64_decode($matches[1]);'
143
- ),
144
- $noptimize_in
145
- );
146
- } else {
147
- $noptimize_out = $noptimize_in;
148
- }
149
- return $noptimize_out;
150
- }
151
 
152
- protected function hide_iehacks($iehacks_in) {
153
- if ( strpos( $iehacks_in, '<!--[if' ) !== false ) {
154
- $iehacks_out = preg_replace_callback(
155
- '#<!--\[if.*?\[endif\]-->#is',
156
- create_function(
157
- '$matches',
158
- 'return "%%IEHACK%%".base64_encode($matches[0])."%%IEHACK%%";'
159
- ),
160
- $iehacks_in
161
- );
162
- } else {
163
- $iehacks_out = $iehacks_in;
164
- }
165
- return $iehacks_out;
166
- }
167
 
168
- protected function restore_iehacks($iehacks_in) {
169
- if ( strpos( $iehacks_in, '%%IEHACK%%' ) !== false ) {
170
- $iehacks_out = preg_replace_callback(
171
- '#%%IEHACK%%(.*?)%%IEHACK%%#is',
172
- create_function(
173
- '$matches',
174
- 'return base64_decode($matches[1]);'
175
- ),
176
- $iehacks_in
177
- );
178
- } else {
179
- $iehacks_out=$iehacks_in;
180
- }
181
- return $iehacks_out;
182
- }
183
 
184
- protected function hide_comments($comments_in) {
185
- if ( strpos( $comments_in, '<!--' ) !== false ) {
186
- $comments_out = preg_replace_callback(
187
- '#<!--.*?-->#is',
188
- create_function(
189
- '$matches',
190
- 'return "%%COMMENTS%%".base64_encode($matches[0])."%%COMMENTS%%";'
191
- ),
192
- $comments_in
193
- );
194
- } else {
195
- $comments_out = $comments_in;
196
- }
197
- return $comments_out;
198
  }
 
 
199
 
200
- protected function restore_comments($comments_in) {
201
- if ( strpos( $comments_in, '%%COMMENTS%%' ) !== false ) {
202
- $comments_out = preg_replace_callback(
203
- '#%%COMMENTS%%(.*?)%%COMMENTS%%#is',
204
- create_function(
205
- '$matches',
206
- 'return base64_decode($matches[1]);'
207
- ),
208
- $comments_in
209
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  } else {
211
- $comments_out=$comments_in;
212
  }
213
- return $comments_out;
214
- }
215
-
216
- protected function url_replace_cdn( $url ) {
217
- $cdn_url = apply_filters( 'autoptimize_filter_base_cdnurl', $this->cdn_url );
218
- if ( !empty($cdn_url) ) {
219
- // secondly prepend domain-less absolute URL's
220
- if ( ( substr( $url, 0, 1 ) === '/' ) && ( substr( $url, 1, 1 ) !== '/' ) ) {
221
- $url = rtrim( $cdn_url, '/' ) . $url;
222
- } else {
223
- // get wordpress base URL
224
- $WPSiteBreakdown = parse_url( AUTOPTIMIZE_WP_SITE_URL );
225
- $WPBaseUrl = $WPSiteBreakdown['scheme'] . '://' . $WPSiteBreakdown['host'];
226
- if ( ! empty( $WPSiteBreakdown['port'] ) ) {
227
- $WPBaseUrl .= ":" . $WPSiteBreakdown['port'];
228
- }
229
- // three: replace full url's with scheme
230
- $tmp_url = str_replace( $WPBaseUrl, rtrim( $cdn_url, '/' ), $url );
231
- if ( $tmp_url === $url ) {
232
- // last attempt; replace scheme-less URL's
233
- $url = str_replace( preg_replace( '/https?:/', '', $WPBaseUrl ), rtrim( $cdn_url, '/' ), $url );
234
- } else {
235
- $url = $tmp_url;
236
- }
237
- }
238
- }
239
 
240
- // allow API filter to take alter after CDN replacement
241
- $url = apply_filters( 'autoptimize_filter_base_replace_cdn', $url );
242
- return $url;
243
- }
244
 
245
- protected function inject_in_html($payload,$replaceTag) {
246
- if (strpos($this->content,$replaceTag[0])!== false) {
247
- if ($replaceTag[1]==="after") {
248
- $replaceBlock=$replaceTag[0].$payload;
249
- } else if ($replaceTag[1]==="replace"){
250
- $replaceBlock=$payload;
251
- } else {
252
- $replaceBlock=$payload.$replaceTag[0];
253
- }
254
- $this->content = substr_replace($this->content,$replaceBlock,strpos($this->content,$replaceTag[0]),strlen($replaceTag[0]));
255
- } else {
256
- $this->content .= $payload;
257
- if (!$this->tagWarning) {
258
- $this->content .= "<!--noptimize--><!-- Autoptimize found a problem with the HTML in your Theme, tag ".$replaceTag[0]." missing --><!--/noptimize-->";
259
- $this->tagWarning=true;
260
- }
261
- }
262
- }
263
-
264
- protected function isremovable($tag, $removables) {
265
- foreach ($removables as $match) {
266
- if (strpos($tag,$match)!==false) {
267
- return true;
268
- }
269
- }
270
- return false;
271
- }
272
-
273
  // inject already minified code in optimized JS/CSS
274
  protected function inject_minified($in) {
275
  if ( strpos( $in, '%%INJECTLATER%%' ) !== false ) {
@@ -288,7 +297,7 @@ abstract class autoptimizeBase {
288
  $filecontent=preg_replace("#^\s*\/\/.*$#Um","",$filecontent);
289
  }
290
 
291
- $filecontent=preg_replace("#^\s*\/\*[^!].*\*\/\s?#Us","",$filecontent);
292
  $filecontent=preg_replace("#(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+#", "\n", $filecontent);
293
 
294
  // specific stuff for JS-files
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  abstract class autoptimizeBase {
5
+ protected $content = '';
6
+ protected $tagWarning = false;
7
+
8
+ public function __construct($content) {
9
+ $this->content = $content;
10
+ }
11
+
12
+ //Reads the page and collects tags
13
+ abstract public function read($justhead);
14
+
15
+ //Joins and optimizes collected things
16
+ abstract public function minify();
17
+
18
+ //Caches the things
19
+ abstract public function cache();
20
+
21
+ //Returns the content
22
+ abstract public function getcontent();
23
+
24
+ //Converts an URL to a full path
25
+ protected function getpath($url) {
26
+ $url=apply_filters( 'autoptimize_filter_cssjs_alter_url', $url);
27
+
28
+ if (strpos($url,'%')!==false) {
29
+ $url=urldecode($url);
30
+ }
31
 
32
+ $siteHost=parse_url(AUTOPTIMIZE_WP_SITE_URL,PHP_URL_HOST);
33
+
34
+ // normalize
35
+ if (strpos($url,'//')===0) {
36
+ if (is_ssl()) {
37
+ $url = "https:".$url;
38
+ } else {
39
+ $url = "http:".$url;
40
+ }
41
+ } else if ((strpos($url,'//')===false) && (strpos($url,$siteHost)===false)) {
42
+ if (AUTOPTIMIZE_WP_SITE_URL === $siteHost) {
43
+ $url = AUTOPTIMIZE_WP_SITE_URL.$url;
44
+ } else {
45
+ $subdir_levels=substr_count(preg_replace("/https?:\/\//","",AUTOPTIMIZE_WP_SITE_URL),"/");
46
+ $url = AUTOPTIMIZE_WP_SITE_URL.str_repeat("/..",$subdir_levels).$url;
47
+ }
48
+ }
49
 
50
+ // first check; hostname wp site should be hostname of url
51
+ $thisHost=@parse_url($url,PHP_URL_HOST);
52
+ if ($thisHost !== $siteHost) {
53
+ /*
54
+ * first try to get all domains from WPML (if available)
55
+ * then explicitely declare $this->cdn_url as OK as well
56
+ * then apply own filter autoptimize_filter_cssjs_multidomain takes an array of hostnames
57
+ * each item in that array will be considered part of the same WP multisite installation
58
+ */
59
+ $multidomains = array();
60
+
61
+ $multidomainsWPML = apply_filters('wpml_setting', array(), 'language_domains');
62
+ if (!empty($multidomainsWPML)) {
63
+ $multidomains = array_map(array($this,"ao_getDomain"),$multidomainsWPML);
64
+ }
65
+
66
+ if (!empty($this->cdn_url)) {
67
+ $multidomains[]=parse_url($this->cdn_url,PHP_URL_HOST);
68
+ }
69
+
70
+ $multidomains = apply_filters('autoptimize_filter_cssjs_multidomain', $multidomains);
71
+
72
+ if (!empty($multidomains)) {
73
+ if (in_array($thisHost,$multidomains)) {
74
+ $url=str_replace($thisHost, parse_url(AUTOPTIMIZE_WP_SITE_URL,PHP_URL_HOST), $url);
75
+ } else {
76
+ return false;
77
+ }
78
+ } else {
79
+ return false;
80
+ }
81
+ }
82
+
83
+ // try to remove "wp root url" from url while not minding http<>https
84
+ $tmp_ao_root = preg_replace('/https?:/','',AUTOPTIMIZE_WP_ROOT_URL);
85
+ $tmp_url = preg_replace('/https?:/','',$url);
86
+ $path = str_replace($tmp_ao_root,'',$tmp_url);
87
+
88
+ // final check; if path starts with :// or //, this is not a URL in the WP context and we have to assume we can't aggregate
89
+ if (preg_match('#^:?//#',$path)) {
90
+ /** External script/css (adsense, etc) */
91
+ return false;
92
+ }
93
 
94
+ $path = str_replace('//','/',WP_ROOT_DIR.$path);
95
+ return $path;
96
+ }
97
 
98
+ // needed for WPML-filter
99
+ protected function ao_getDomain($in) {
100
  // make sure the url starts with something vaguely resembling a protocol
101
  if ((strpos($in,"http")!==0) && (strpos($in,"//")!==0)) {
102
  $in="http://".$in;
103
  }
104
 
105
  // do the actual parse_url
106
+ $out = parse_url($in,PHP_URL_HOST);
107
 
108
  // fallback if parse_url does not understand the url is in fact a url
109
+ if (empty($out)) $out=$in;
110
 
111
+ return $out;
112
+ }
113
 
114
 
115
+ // logger
116
+ protected function ao_logger($logmsg,$appendHTML=true) {
117
+ if ($appendHTML) {
118
+ $logmsg="<!--noptimize--><!-- ".$logmsg." --><!--/noptimize-->";
119
+ $this->content.=$logmsg;
120
+ } else {
121
+ error_log("Autoptimize: ".$logmsg);
122
+ }
123
+ }
124
 
125
+ // hide everything between noptimize-comment tags
126
+ protected function hide_noptimize($noptimize_in) {
127
+ if ( preg_match( '/<!--\s?noptimize\s?-->/', $noptimize_in ) ) {
128
+ $noptimize_out = preg_replace_callback(
129
+ '#<!--\s?noptimize\s?-->.*?<!--\s?/\s?noptimize\s?-->#is',
130
+ create_function(
131
+ '$matches',
132
+ 'return "%%NOPTIMIZE%%".base64_encode($matches[0])."%%NOPTIMIZE%%";'
133
+ ),
134
+ $noptimize_in
135
+ );
136
+ } else {
137
+ $noptimize_out = $noptimize_in;
138
+ }
139
+ return $noptimize_out;
140
+ }
141
+
142
+ // unhide noptimize-tags
143
+ protected function restore_noptimize($noptimize_in) {
144
+ if ( strpos( $noptimize_in, '%%NOPTIMIZE%%' ) !== false ) {
145
+ $noptimize_out = preg_replace_callback(
146
+ '#%%NOPTIMIZE%%(.*?)%%NOPTIMIZE%%#is',
147
+ create_function(
148
+ '$matches',
149
+ 'return base64_decode($matches[1]);'
150
+ ),
151
+ $noptimize_in
152
+ );
153
+ } else {
154
+ $noptimize_out = $noptimize_in;
155
+ }
156
+ return $noptimize_out;
157
+ }
158
 
159
+ protected function hide_iehacks($iehacks_in) {
160
+ if ( strpos( $iehacks_in, '<!--[if' ) !== false ) {
161
+ $iehacks_out = preg_replace_callback(
162
+ '#<!--\[if.*?\[endif\]-->#is',
163
+ create_function(
164
+ '$matches',
165
+ 'return "%%IEHACK%%".base64_encode($matches[0])."%%IEHACK%%";'
166
+ ),
167
+ $iehacks_in
168
+ );
169
+ } else {
170
+ $iehacks_out = $iehacks_in;
171
+ }
172
+ return $iehacks_out;
173
+ }
174
 
175
+ protected function restore_iehacks($iehacks_in) {
176
+ if ( strpos( $iehacks_in, '%%IEHACK%%' ) !== false ) {
177
+ $iehacks_out = preg_replace_callback(
178
+ '#%%IEHACK%%(.*?)%%IEHACK%%#is',
179
+ create_function(
180
+ '$matches',
181
+ 'return base64_decode($matches[1]);'
182
+ ),
183
+ $iehacks_in
184
+ );
185
+ } else {
186
+ $iehacks_out=$iehacks_in;
187
+ }
188
+ return $iehacks_out;
189
+ }
190
 
191
+ protected function hide_comments($comments_in) {
192
+ if ( strpos( $comments_in, '<!--' ) !== false ) {
193
+ $comments_out = preg_replace_callback(
194
+ '#<!--.*?-->#is',
195
+ create_function(
196
+ '$matches',
197
+ 'return "%%COMMENTS%%".base64_encode($matches[0])."%%COMMENTS%%";'
198
+ ),
199
+ $comments_in
200
+ );
201
+ } else {
202
+ $comments_out = $comments_in;
 
 
203
  }
204
+ return $comments_out;
205
+ }
206
 
207
+ protected function restore_comments($comments_in) {
208
+ if ( strpos( $comments_in, '%%COMMENTS%%' ) !== false ) {
209
+ $comments_out = preg_replace_callback(
210
+ '#%%COMMENTS%%(.*?)%%COMMENTS%%#is',
211
+ create_function(
212
+ '$matches',
213
+ 'return base64_decode($matches[1]);'
214
+ ),
215
+ $comments_in
216
+ );
217
+ } else {
218
+ $comments_out=$comments_in;
219
+ }
220
+ return $comments_out;
221
+ }
222
+
223
+ protected function url_replace_cdn( $url ) {
224
+ // API filter to change base CDN URL
225
+ $cdn_url = apply_filters( 'autoptimize_filter_base_cdnurl', $this->cdn_url );
226
+
227
+ if ( !empty($cdn_url) ) {
228
+ // prepend domain-less absolute URL's
229
+ if ( ( substr( $url, 0, 1 ) === '/' ) && ( substr( $url, 1, 1 ) !== '/' ) ) {
230
+ $url = rtrim( $cdn_url, '/' ) . $url;
231
+ } else {
232
+ // get wordpress base URL
233
+ $WPSiteBreakdown = parse_url( AUTOPTIMIZE_WP_SITE_URL );
234
+ $WPBaseUrl = $WPSiteBreakdown['scheme'] . '://' . $WPSiteBreakdown['host'];
235
+ if ( ! empty( $WPSiteBreakdown['port'] ) ) {
236
+ $WPBaseUrl .= ":" . $WPSiteBreakdown['port'];
237
+ }
238
+ // replace full url's with scheme
239
+ $tmp_url = str_replace( $WPBaseUrl, rtrim( $cdn_url, '/' ), $url );
240
+ if ( $tmp_url === $url ) {
241
+ // last attempt; replace scheme-less URL's
242
+ $url = str_replace( preg_replace( '/https?:/', '', $WPBaseUrl ), rtrim( $cdn_url, '/' ), $url );
243
  } else {
244
+ $url = $tmp_url;
245
  }
246
+ }
247
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
+ // allow API filter to alter URL after CDN replacement
250
+ $url = apply_filters( 'autoptimize_filter_base_replace_cdn', $url );
251
+ return $url;
252
+ }
253
 
254
+ protected function inject_in_html($payload,$replaceTag) {
255
+ if (strpos($this->content,$replaceTag[0])!== false) {
256
+ if ($replaceTag[1]==="after") {
257
+ $replaceBlock=$replaceTag[0].$payload;
258
+ } else if ($replaceTag[1]==="replace"){
259
+ $replaceBlock=$payload;
260
+ } else {
261
+ $replaceBlock=$payload.$replaceTag[0];
262
+ }
263
+ $this->content = substr_replace($this->content,$replaceBlock,strpos($this->content,$replaceTag[0]),strlen($replaceTag[0]));
264
+ } else {
265
+ $this->content .= $payload;
266
+ if (!$this->tagWarning) {
267
+ $this->content .= "<!--noptimize--><!-- Autoptimize found a problem with the HTML in your Theme, tag \"".str_replace(array("<",">"),"",$replaceTag[0])."\" missing --><!--/noptimize-->";
268
+ $this->tagWarning=true;
269
+ }
270
+ }
271
+ }
272
+
273
+ protected function isremovable($tag, $removables) {
274
+ foreach ($removables as $match) {
275
+ if (strpos($tag,$match)!==false) {
276
+ return true;
277
+ }
278
+ }
279
+ return false;
280
+ }
281
+
282
  // inject already minified code in optimized JS/CSS
283
  protected function inject_minified($in) {
284
  if ( strpos( $in, '%%INJECTLATER%%' ) !== false ) {
297
  $filecontent=preg_replace("#^\s*\/\/.*$#Um","",$filecontent);
298
  }
299
 
300
+ $filecontent=preg_replace("#^\s*\/\*[^!].*\*\/\s?#Um","",$filecontent);
301
  $filecontent=preg_replace("#(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+#", "\n", $filecontent);
302
 
303
  // specific stuff for JS-files
classes/autoptimizeCache.php CHANGED
@@ -2,180 +2,184 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeCache {
5
- private $filename;
6
- private $mime;
7
- private $cachedir;
8
- private $delayed;
9
-
10
- public function __construct($md5,$ext='php') {
11
- $this->cachedir = AUTOPTIMIZE_CACHE_DIR;
12
- $this->delayed = AUTOPTIMIZE_CACHE_DELAY;
13
- $this->nogzip = AUTOPTIMIZE_CACHE_NOGZIP;
14
- if($this->nogzip == false) {
15
- $this->filename = AUTOPTIMIZE_CACHEFILE_PREFIX.$md5.'.php';
16
- } else {
17
- if (in_array($ext, array("js","css"))) {
18
- $this->filename = $ext.'/'.AUTOPTIMIZE_CACHEFILE_PREFIX.$md5.'.'.$ext;
19
- } else {
20
- $this->filename = '/'.AUTOPTIMIZE_CACHEFILE_PREFIX.$md5.'.'.$ext;
21
- }
22
- }
23
- }
24
-
25
- public function check() {
26
- if(!file_exists($this->cachedir.$this->filename)) {
27
- // No cached file, sorry
28
- return false;
29
- }
30
- // Cache exists!
31
- return true;
32
- }
33
-
34
- public function retrieve() {
35
- if($this->check()) {
36
- if($this->nogzip == false) {
37
- return file_get_contents($this->cachedir.$this->filename.'.none');
38
- } else {
39
- return file_get_contents($this->cachedir.$this->filename);
40
- }
41
- }
42
- return false;
43
- }
44
-
45
- public function cache($code,$mime) {
46
- if($this->nogzip == false) {
47
- $file = ($this->delayed ? 'delayed.php' : 'default.php');
48
- $phpcode = file_get_contents(AUTOPTIMIZE_PLUGIN_DIR.'/config/'.$file);
49
- $phpcode = str_replace(array('%%CONTENT%%','exit;'),array($mime,''),$phpcode);
50
- file_put_contents($this->cachedir.$this->filename,$phpcode, LOCK_EX);
51
- file_put_contents($this->cachedir.$this->filename.'.none',$code, LOCK_EX);
52
- if(!$this->delayed) {
53
- // Compress now!
54
- file_put_contents($this->cachedir.$this->filename.'.deflate',gzencode($code,9,FORCE_DEFLATE), LOCK_EX);
55
- file_put_contents($this->cachedir.$this->filename.'.gzip',gzencode($code,9,FORCE_GZIP), LOCK_EX);
56
- }
57
- } else {
58
- // Write code to cache without doing anything else
59
- file_put_contents($this->cachedir.$this->filename,$code, LOCK_EX);
60
- }
61
- }
62
-
63
- public function getname() {
64
- apply_filters('autoptimize_filter_cache_getname',AUTOPTIMIZE_CACHE_URL.$this->filename);
65
- return $this->filename;
66
- }
67
-
68
- static function clearall() {
69
- if(!autoptimizeCache::cacheavail()) {
70
- return false;
71
- }
72
-
73
- // scan the cachedirs
74
- foreach (array("","js","css") as $scandirName) {
75
- $scan[$scandirName] = scandir(AUTOPTIMIZE_CACHE_DIR.$scandirName);
76
- }
77
-
78
- // clear the cachedirs
79
- foreach ($scan as $scandirName=>$scanneddir) {
80
- $thisAoCacheDir=rtrim(AUTOPTIMIZE_CACHE_DIR.$scandirName,"/")."/";
81
- foreach($scanneddir as $file) {
82
- if(!in_array($file,array('.','..')) && strpos($file,AUTOPTIMIZE_CACHEFILE_PREFIX) !== false && is_file($thisAoCacheDir.$file)) {
83
- @unlink($thisAoCacheDir.$file);
84
- }
85
- }
86
- }
 
 
 
 
87
 
88
- @unlink(AUTOPTIMIZE_CACHE_DIR."/.htaccess");
89
- delete_transient("autoptimize_stats");
90
 
91
  // add cachepurged action
92
- if (!function_exists('autoptimize_do_cachepurged_action')) {
93
- function autoptimize_do_cachepurged_action() {
94
- do_action("autoptimize_action_cachepurged");
95
- }
96
- }
97
- add_action("plugins_loaded","autoptimize_do_cachepurged_action",11);
98
 
99
- // try to purge caching plugins cache-files?
100
  include_once(AUTOPTIMIZE_PLUGIN_DIR.'classlesses/autoptimizePageCacheFlush.php');
101
  add_action("autoptimize_action_cachepurged","autoptimize_flush_pagecache",10,0);
102
 
103
- return true;
104
- }
105
 
106
- static function stats() {
107
- $AOstats=get_transient("autoptimize_stats");
108
 
109
- if (empty($AOstats)) {
110
- // Cache not available :(
111
- if(!autoptimizeCache::cacheavail()) {
112
- return 0;
113
- }
114
-
115
- // Count cached info
116
- $count = 0;
117
- $size = 0;
118
-
119
- // scan the cachedirs
120
- foreach (array("","js","css") as $scandirName) {
121
- $scan[$scandirName] = scandir(AUTOPTIMIZE_CACHE_DIR.$scandirName);
122
- }
123
-
124
- foreach ($scan as $scandirName=>$scanneddir) {
125
- $thisAoCacheDir=rtrim(AUTOPTIMIZE_CACHE_DIR.$scandirName,"/")."/";
126
- foreach($scanneddir as $file) {
127
- if(!in_array($file,array('.','..')) && strpos($file,AUTOPTIMIZE_CACHEFILE_PREFIX) !== false) {
128
- if(is_file($thisAoCacheDir.$file)) {
129
- if(AUTOPTIMIZE_CACHE_NOGZIP && (strpos($file,'.js') !== false || strpos($file,'.css') !== false || strpos($file,'.img') !== false || strpos($file,'.txt') !== false )) {
130
- $count++;
131
- } elseif(!AUTOPTIMIZE_CACHE_NOGZIP && strpos($file,'.none') !== false) {
132
- $count++;
133
- }
134
- $size+=filesize($thisAoCacheDir.$file);
135
- }
136
- }
137
- }
138
- }
139
- $AOstats=array($count,$size,time());
140
- if ($count>100) {
141
- set_transient("autoptimize_stats",$AOstats,HOUR_IN_SECONDS);
142
  }
143
- }
144
- // print the number of instances
145
- return $AOstats;
146
- }
 
 
 
 
 
 
 
147
 
148
- static function cacheavail() {
149
- if(!defined('AUTOPTIMIZE_CACHE_DIR')) {
150
- // We didn't set a cache
151
- return false;
152
- }
153
-
154
- foreach (array("","js","css") as $checkDir) {
155
- if(!autoptimizeCache::checkCacheDir(AUTOPTIMIZE_CACHE_DIR.$checkDir)) {
156
- return false;
157
- }
158
- }
159
-
160
- /** write index.html here to avoid prying eyes */
161
- $indexFile=AUTOPTIMIZE_CACHE_DIR.'/index.html';
162
- if(!is_file($indexFile)) {
163
- @file_put_contents($indexFile,'<html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>');
164
- }
165
 
166
- /** write .htaccess here to overrule wp_super_cache */
167
- $htAccess=AUTOPTIMIZE_CACHE_DIR.'/.htaccess';
168
- if(!is_file($htAccess)) {
169
- /**
170
- * create wp-content/AO_htaccess_tmpl with
171
- * whatever htaccess rules you might need
172
- * if you want to override default AO htaccess
173
- */
174
- $htaccess_tmpl=WP_CONTENT_DIR."/AO_htaccess_tmpl";
175
- if (is_file($htaccess_tmpl)) {
176
- $htAccessContent=file_get_contents($htaccess_tmpl);
177
- } else if (is_multisite() || AUTOPTIMIZE_CACHE_NOGZIP == false) {
178
- $htAccessContent='<IfModule mod_headers.c>
179
  Header set Vary "Accept-Encoding"
180
  Header set Cache-Control "max-age=10672000, must-revalidate"
181
  </IfModule>
@@ -201,8 +205,8 @@ class autoptimizeCache {
201
  Allow from all
202
  </Files>
203
  </IfModule>';
204
- } else {
205
- $htAccessContent='<IfModule mod_headers.c>
206
  Header set Vary "Accept-Encoding"
207
  Header set Cache-Control "max-age=10672000, must-revalidate"
208
  </IfModule>
@@ -228,34 +232,34 @@ class autoptimizeCache {
228
  Deny from all
229
  </Files>
230
  </IfModule>';
231
- }
232
- @file_put_contents($htAccess,$htAccessContent);
233
- }
 
234
  // All OK
235
  return true;
236
- }
237
 
238
- static function checkCacheDir($dir) {
239
- // Check and create if not exists
240
- if(!file_exists($dir)) {
241
- @mkdir($dir,0775,true);
242
- if(!file_exists($dir)) {
243
- return false;
244
- }
245
- }
246
 
247
- // check if we can now write
248
- if(!is_writable($dir)) {
249
- return false;
250
- }
251
 
252
- // and write index.html here to avoid prying eyes
253
- $indexFile=$dir.'/index.html';
254
- if(!is_file($indexFile)) {
255
- @file_put_contents($indexFile,'<html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>');
256
- }
257
-
258
- return true;
259
- }
260
  }
261
-
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeCache {
5
+ private $filename;
6
+ private $mime;
7
+ private $cachedir;
8
+ private $delayed;
9
+
10
+ public function __construct($md5,$ext='php') {
11
+ $this->cachedir = AUTOPTIMIZE_CACHE_DIR;
12
+ $this->delayed = AUTOPTIMIZE_CACHE_DELAY;
13
+ $this->nogzip = AUTOPTIMIZE_CACHE_NOGZIP;
14
+ if($this->nogzip == false) {
15
+ $this->filename = AUTOPTIMIZE_CACHEFILE_PREFIX.$md5.'.php';
16
+ } else {
17
+ if (in_array($ext, array("js","css"))) {
18
+ $this->filename = $ext.'/'.AUTOPTIMIZE_CACHEFILE_PREFIX.$md5.'.'.$ext;
19
+ } else {
20
+ $this->filename = AUTOPTIMIZE_CACHEFILE_PREFIX.$md5.'.'.$ext;
21
+ }
22
+ }
23
+ }
24
+
25
+ public function check() {
26
+ if(!file_exists($this->cachedir.$this->filename)) {
27
+ // No cached file, sorry
28
+ return false;
29
+ }
30
+ // Cache exists!
31
+ return true;
32
+ }
33
+
34
+ public function retrieve() {
35
+ if($this->check()) {
36
+ if($this->nogzip == false) {
37
+ return file_get_contents($this->cachedir.$this->filename.'.none');
38
+ } else {
39
+ return file_get_contents($this->cachedir.$this->filename);
40
+ }
41
+ }
42
+ return false;
43
+ }
44
+
45
+ public function cache($code,$mime) {
46
+ if($this->nogzip == false) {
47
+ $file = ($this->delayed ? 'delayed.php' : 'default.php');
48
+ $phpcode = file_get_contents(AUTOPTIMIZE_PLUGIN_DIR.'/config/'.$file);
49
+ $phpcode = str_replace(array('%%CONTENT%%','exit;'),array($mime,''),$phpcode);
50
+ file_put_contents($this->cachedir.$this->filename,$phpcode, LOCK_EX);
51
+ file_put_contents($this->cachedir.$this->filename.'.none',$code, LOCK_EX);
52
+ if(!$this->delayed) {
53
+ // Compress now!
54
+ file_put_contents($this->cachedir.$this->filename.'.deflate',gzencode($code,9,FORCE_DEFLATE), LOCK_EX);
55
+ file_put_contents($this->cachedir.$this->filename.'.gzip',gzencode($code,9,FORCE_GZIP), LOCK_EX);
56
+ }
57
+ } else {
58
+ // Write code to cache without doing anything else
59
+ file_put_contents($this->cachedir.$this->filename,$code, LOCK_EX);
60
+ if (apply_filters('autoptimize_filter_cache_create_static_gzip', false)) {
61
+ // Create an additional cached gzip file
62
+ file_put_contents($this->cachedir.$this->filename.'.gzip',gzencode($code,9,FORCE_GZIP), LOCK_EX);
63
+ }
64
+ }
65
+ }
66
+
67
+ public function getname() {
68
+ apply_filters('autoptimize_filter_cache_getname',AUTOPTIMIZE_CACHE_URL.$this->filename);
69
+ return $this->filename;
70
+ }
71
+
72
+ static function clearall() {
73
+ if(!autoptimizeCache::cacheavail()) {
74
+ return false;
75
+ }
76
+
77
+ // scan the cachedirs
78
+ foreach (array("","js","css") as $scandirName) {
79
+ $scan[$scandirName] = scandir(AUTOPTIMIZE_CACHE_DIR.$scandirName);
80
+ }
81
+
82
+ // clear the cachedirs
83
+ foreach ($scan as $scandirName=>$scanneddir) {
84
+ $thisAoCacheDir=rtrim(AUTOPTIMIZE_CACHE_DIR.$scandirName,"/")."/";
85
+ foreach($scanneddir as $file) {
86
+ if(!in_array($file,array('.','..')) && strpos($file,AUTOPTIMIZE_CACHEFILE_PREFIX) !== false && is_file($thisAoCacheDir.$file)) {
87
+ @unlink($thisAoCacheDir.$file);
88
+ }
89
+ }
90
+ }
91
 
92
+ @unlink(AUTOPTIMIZE_CACHE_DIR."/.htaccess");
93
+ delete_transient("autoptimize_stats");
94
 
95
  // add cachepurged action
96
+ if (!function_exists('autoptimize_do_cachepurged_action')) {
97
+ function autoptimize_do_cachepurged_action() {
98
+ do_action("autoptimize_action_cachepurged");
99
+ }
100
+ }
101
+ add_action("shutdown","autoptimize_do_cachepurged_action",11);
102
 
103
+ // try to purge caching plugins cache-files?
104
  include_once(AUTOPTIMIZE_PLUGIN_DIR.'classlesses/autoptimizePageCacheFlush.php');
105
  add_action("autoptimize_action_cachepurged","autoptimize_flush_pagecache",10,0);
106
 
107
+ return true;
108
+ }
109
 
110
+ static function stats() {
111
+ $AOstats=get_transient("autoptimize_stats");
112
 
113
+ if (empty($AOstats)) {
114
+ // Cache not available :(
115
+ if(!autoptimizeCache::cacheavail()) {
116
+ return 0;
117
+ }
118
+
119
+ // Count cached info
120
+ $count = 0;
121
+ $size = 0;
122
+
123
+ // scan the cachedirs
124
+ foreach (array("","js","css") as $scandirName) {
125
+ $scan[$scandirName] = scandir(AUTOPTIMIZE_CACHE_DIR.$scandirName);
126
+ }
127
+
128
+ foreach ($scan as $scandirName=>$scanneddir) {
129
+ $thisAoCacheDir=rtrim(AUTOPTIMIZE_CACHE_DIR.$scandirName,"/")."/";
130
+ foreach($scanneddir as $file) {
131
+ if(!in_array($file,array('.','..')) && strpos($file,AUTOPTIMIZE_CACHEFILE_PREFIX) !== false) {
132
+ if(is_file($thisAoCacheDir.$file)) {
133
+ if(AUTOPTIMIZE_CACHE_NOGZIP && (strpos($file,'.js') !== false || strpos($file,'.css') !== false || strpos($file,'.img') !== false || strpos($file,'.txt') !== false )) {
134
+ $count++;
135
+ } elseif(!AUTOPTIMIZE_CACHE_NOGZIP && strpos($file,'.none') !== false) {
136
+ $count++;
137
+ }
138
+ $size+=filesize($thisAoCacheDir.$file);
 
 
 
 
 
 
 
139
  }
140
+ }
141
+ }
142
+ }
143
+ $AOstats=array($count,$size,time());
144
+ if ($count>100) {
145
+ set_transient("autoptimize_stats",$AOstats,HOUR_IN_SECONDS);
146
+ }
147
+ }
148
+ // print the number of instances
149
+ return $AOstats;
150
+ }
151
 
152
+ static function cacheavail() {
153
+ if(!defined('AUTOPTIMIZE_CACHE_DIR')) {
154
+ // We didn't set a cache
155
+ return false;
156
+ }
157
+
158
+ foreach (array("","js","css") as $checkDir) {
159
+ if(!autoptimizeCache::checkCacheDir(AUTOPTIMIZE_CACHE_DIR.$checkDir)) {
160
+ return false;
161
+ }
162
+ }
163
+
164
+ /** write index.html here to avoid prying eyes */
165
+ $indexFile=AUTOPTIMIZE_CACHE_DIR.'/index.html';
166
+ if(!is_file($indexFile)) {
167
+ @file_put_contents($indexFile,'<html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>');
168
+ }
169
 
170
+ /** write .htaccess here to overrule wp_super_cache */
171
+ $htAccess=AUTOPTIMIZE_CACHE_DIR.'/.htaccess';
172
+ if(!is_file($htAccess)) {
173
+ /**
174
+ * create wp-content/AO_htaccess_tmpl with
175
+ * whatever htaccess rules you might need
176
+ * if you want to override default AO htaccess
177
+ */
178
+ $htaccess_tmpl=WP_CONTENT_DIR."/AO_htaccess_tmpl";
179
+ if (is_file($htaccess_tmpl)) {
180
+ $htAccessContent=file_get_contents($htaccess_tmpl);
181
+ } else if (is_multisite() || AUTOPTIMIZE_CACHE_NOGZIP == false) {
182
+ $htAccessContent='<IfModule mod_headers.c>
183
  Header set Vary "Accept-Encoding"
184
  Header set Cache-Control "max-age=10672000, must-revalidate"
185
  </IfModule>
205
  Allow from all
206
  </Files>
207
  </IfModule>';
208
+ } else {
209
+ $htAccessContent='<IfModule mod_headers.c>
210
  Header set Vary "Accept-Encoding"
211
  Header set Cache-Control "max-age=10672000, must-revalidate"
212
  </IfModule>
232
  Deny from all
233
  </Files>
234
  </IfModule>';
235
+ }
236
+ @file_put_contents($htAccess,$htAccessContent);
237
+ }
238
+
239
  // All OK
240
  return true;
241
+ }
242
 
243
+ static function checkCacheDir($dir) {
244
+ // Check and create if not exists
245
+ if(!file_exists($dir)) {
246
+ @mkdir($dir,0775,true);
247
+ if(!file_exists($dir)) {
248
+ return false;
249
+ }
250
+ }
251
 
252
+ // check if we can now write
253
+ if(!is_writable($dir)) {
254
+ return false;
255
+ }
256
 
257
+ // and write index.html here to avoid prying eyes
258
+ $indexFile=$dir.'/index.html';
259
+ if(!is_file($indexFile)) {
260
+ @file_put_contents($indexFile,'<html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>');
261
+ }
262
+
263
+ return true;
264
+ }
265
  }
 
classes/autoptimizeConfig.php CHANGED
@@ -2,203 +2,332 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeConfig {
5
- private $config = null;
6
- static private $instance = null;
7
-
8
- //Singleton: private construct
9
- private function __construct() {
10
- if( is_admin() ) {
11
- //Add the admin page and settings
12
- add_action('admin_menu',array($this,'addmenu'));
13
- add_action('admin_init',array($this,'registersettings'));
14
-
15
- //Set meta info
16
- if(function_exists('plugin_row_meta')) {
17
- //2.8+
18
- add_filter('plugin_row_meta',array($this,'setmeta'),10,2);
19
- } elseif(function_exists('post_class')) {
20
- //2.7
21
- $plugin = plugin_basename(AUTOPTIMIZE_PLUGIN_DIR.'/autoptimize.php');
22
- add_filter('plugin_action_links_'.$plugin,array($this,'setmeta'));
23
- }
24
-
25
- //Clean cache?
26
- if(get_option('autoptimize_cache_clean')) {
27
- autoptimizeCache::clearall();
28
- update_option('autoptimize_cache_clean',0);
29
- }
30
- }
31
- }
32
-
33
- static public function instance() {
34
- //Only one instance
35
- if (self::$instance == null) {
36
- self::$instance = new autoptimizeConfig();
37
- }
38
-
39
- return self::$instance;
40
- }
41
-
42
- public function show() {
 
 
 
 
43
  ?>
44
- <style>input[type=url]:invalid {color: red; border-color:red;} .form-table th{font-weight:100;} #futtta_feed ul{list-style:outside;} #futtta_feed {font-size:medium; margin:0px 20px;} #ao_hide_adv,#ao_show_adv{float:right;margin-top:10px;margin-right:10px;}</style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  <div class="wrap">
47
 
48
- <h1><?php _e('Autoptimize Settings','autoptimize'); ?></h1>
 
 
49
 
50
- <div style="float:left;width:70%;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  <?php echo $this->ao_admin_tabs(); ?>
53
 
54
- <?php
55
- if (get_option('autoptimize_show_adv','0')=='1') {
56
- ?>
57
- <a href="javascript:void(0);" id="ao_show_adv" class="button" style="display:none;"><?php _e("Show advanced settings","autoptimize") ?></a>
58
- <a href="javascript:void(0);" id="ao_hide_adv" class="button"><?php _e("Hide advanced settings","autoptimize") ?></a>
59
- <style>.ao_adv {display:table-row};</style>
60
- <?php
61
- } else {
62
- ?>
63
- <a href="javascript:void(0);" id="ao_show_adv" class="button"><?php _e("Show advanced settings","autoptimize") ?></a>
64
- <a href="javascript:void(0);" id="ao_hide_adv" class="button" style="display:none;"><?php _e("Hide advanced settings","autoptimize") ?></a>
65
- <?php
66
- }
67
- ?>
68
-
69
  <form method="post" action="options.php">
70
  <?php settings_fields('autoptimize'); ?>
71
 
72
- <h2><?php _e('HTML Options','autoptimize'); ?></h2>
 
 
 
73
  <table class="form-table">
74
  <tr valign="top">
75
  <th scope="row"><?php _e('Optimize HTML Code?','autoptimize'); ?></th>
76
  <td><input type="checkbox" id="autoptimize_html" name="autoptimize_html" <?php echo get_option('autoptimize_html')?'checked="checked" ':''; ?>/></td>
77
  </tr>
78
- <tr class="html_sub" valign="top">
79
  <th scope="row"><?php _e('Keep HTML comments?','autoptimize'); ?></th>
80
- <td><label for="autoptimize_html_keepcomments"><input type="checkbox" name="autoptimize_html_keepcomments" <?php echo get_option('autoptimize_html_keepcomments')?'checked="checked" ':''; ?>/>
81
  <?php _e('Enable this if you want HTML comments to remain in the page.','autoptimize'); ?></label></td>
82
  </tr>
83
  </table>
 
84
 
85
- <h2><?php _e('JavaScript Options','autoptimize'); ?></h2>
 
86
  <table class="form-table">
87
  <tr valign="top">
88
  <th scope="row"><?php _e('Optimize JavaScript Code?','autoptimize'); ?></th>
89
  <td><input type="checkbox" id="autoptimize_js" name="autoptimize_js" <?php echo get_option('autoptimize_js')?'checked="checked" ':''; ?>/></td>
90
  </tr>
91
- <tr valign="top" class="hidden js_sub ao_adv">
92
  <th scope="row"><?php _e('Force JavaScript in &lt;head&gt;?','autoptimize'); ?></th>
93
- <td><label for="autoptimize_js_forcehead"><input type="checkbox" name="autoptimize_js_forcehead" <?php echo get_option('autoptimize_js_forcehead','1')?'checked="checked" ':''; ?>/>
94
  <?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>
95
  </tr>
96
  <?php if (get_option('autoptimize_js_justhead')) { ?>
97
- <tr valign="top" class="hidden js_sub ao_adv">
98
  <th scope="row"><?php _e('Look for scripts only in &lt;head&gt;?','autoptimize'); _e(' <i>(deprecated)</i>','autoptimize'); ?></th>
99
- <td><label for="autoptimize_js_justhead"><input type="checkbox" name="autoptimize_js_justhead" <?php echo get_option('autoptimize_js_justhead')?'checked="checked" ':''; ?>/>
100
  <?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>
101
  </tr>
102
  <?php } ?>
103
- <tr valign="top" class="hidden js_sub ao_adv">
104
  <th scope="row"><?php _e('Also aggregate inline JS?','autoptimize'); ?></th>
105
- <td><label for="autoptimize_js_include_inline"><input type="checkbox" name="autoptimize_js_include_inline" <?php echo get_option('autoptimize_js_include_inline')?'checked="checked" ':''; ?>/>
106
  <?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>
107
  </tr>
108
- <tr valign="top" class="hidden js_sub ao_adv">
109
  <th scope="row"><?php _e('Exclude scripts from Autoptimize:','autoptimize'); ?></th>
110
- <td><label for="autoptimize_js_exclude"><input type="text" style="width:100%;" name="autoptimize_js_exclude" value="<?php echo get_option('autoptimize_js_exclude',"s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,seal.js"); ?>"/><br />
111
- <?php _e('A comma-seperated 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 and minimized by Autoptimize.','autoptimize'); ?></label></td>
112
  </tr>
113
- <tr valign="top" class="hidden js_sub ao_adv">
114
  <th scope="row"><?php _e('Add try-catch wrapping?','autoptimize'); ?></th>
115
- <td><label for="autoptimize_js_trycatch"><input type="checkbox" name="autoptimize_js_trycatch" <?php echo get_option('autoptimize_js_trycatch')?'checked="checked" ':''; ?>/>
116
  <?php _e('If your scripts break because of a JS-error, you might want to try this.','autoptimize'); ?></label></td>
117
  </tr>
118
  </table>
 
119
 
120
- <h2><?php _e('CSS Options','autoptimize'); ?></h2>
 
121
  <table class="form-table">
122
  <tr valign="top">
123
  <th scope="row"><?php _e('Optimize CSS Code?','autoptimize'); ?></th>
124
  <td><input type="checkbox" id="autoptimize_css" name="autoptimize_css" <?php echo get_option('autoptimize_css')?'checked="checked" ':''; ?>/></td>
125
  </tr>
126
- <tr class="hidden css_sub ao_adv" valign="top">
127
  <th scope="row"><?php _e('Generate data: URIs for images?','autoptimize'); ?></th>
128
- <td><label for="autoptimize_css_datauris"><input type="checkbox" name="autoptimize_css_datauris" <?php echo get_option('autoptimize_css_datauris')?'checked="checked" ':''; ?>/>
129
- <?php _e('Enable this to include small background-images in the CSS itself instead of as seperate downloads.','autoptimize'); ?></label></td>
130
  </tr>
131
- <tr class="hidden css_sub ao_adv" valign="top">
132
  <th scope="row"><?php _e('Remove Google Fonts?','autoptimize'); ?></th>
133
- <td><label for="autoptimize_css_datauris"><input type="checkbox" name="autoptimize_css_nogooglefont" <?php echo get_option('autoptimize_css_nogooglefont')?'checked="checked" ':''; ?>/>
134
  <?php _e('Check this if you don\'t need or want Google Fonts being loaded.','autoptimize'); ?></label></td>
135
  </tr>
136
  <?php if (get_option('autoptimize_css_justhead')) { ?>
137
- <tr valign="top" class="hidden css_sub ao_adv">
138
  <th scope="row"><?php _e('Look for styles only in &lt;head&gt;?','autoptimize'); _e(' <i>(deprecated)</i>','autoptimize'); ?></th>
139
- <td><label for="autoptimize_css_justhead"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead')?'checked="checked" ':''; ?>/>
140
  <?php _e('Don\'t autoptimize CSS outside the head-section. If the cache gets big, you might want to enable this.','autoptimize'); ?></label></td>
141
  </tr>
142
  <?php } ?>
143
- <tr valign="top" class="hidden css_sub ao_adv">
144
  <th scope="row"><?php _e('Also aggregate inline CSS?','autoptimize'); ?></th>
145
- <td><label for="autoptimize_css_include_inline"><input type="checkbox" name="autoptimize_css_include_inline" <?php echo get_option('autoptimize_css_include_inline')?'checked="checked" ':''; ?>/>
146
  <?php _e('Check this option for Autoptimize to also aggregate CSS in the HTML.','autoptimize'); ?></label></td>
147
  </tr>
148
- <tr valign="top" class="hidden css_sub ao_adv">
149
  <th scope="row"><?php _e('Inline and Defer CSS?','autoptimize'); ?></th>
150
- <td><label for="autoptimize_css_defer"><input type="checkbox" name="autoptimize_css_defer" id="autoptimize_css_defer" <?php echo get_option('autoptimize_css_defer')?'checked="checked" ':''; ?>/>
151
  <?php _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> before activating this option!','autoptimize'); ?></label></td>
152
  </tr>
153
- <tr valign="top" class="hidden css_sub ao_adv" id="autoptimize_css_defer_inline">
154
  <th scope="row"></th>
155
- <td><label for="autoptimize_css_defer_inline"><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>
156
  </tr>
157
- <tr valign="top" class="hidden ao_adv css_sub">
158
  <th scope="row"><?php _e('Inline all CSS?','autoptimize'); ?></th>
159
- <td><label for="autoptimize_css_inline"><input type="checkbox" id="autoptimize_css_inline" name="autoptimize_css_inline" <?php echo get_option('autoptimize_css_inline')?'checked="checked" ':''; ?>/>
160
  <?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>
161
  </tr>
162
- <tr valign="top" class="hidden ao_adv css_sub">
163
  <th scope="row"><?php _e('Exclude CSS from Autoptimize:','autoptimize'); ?></th>
164
- <td><label for="autoptimize_css_exclude"><input type="text" style="width:100%;" name="autoptimize_css_exclude" value="<?php echo get_option('autoptimize_css_exclude','admin-bar.min.css, dashicons.min.css'); ?>"/><br />
165
- <?php _e('A comma-seperated list of CSS you want to exclude from being optimized.','autoptimize'); ?></label></td>
166
  </tr>
167
  </table>
 
168
 
169
- <h2><?php _e('CDN Options','autoptimize'); ?></h2>
 
170
  <table class="form-table">
171
  <tr valign="top">
172
  <th scope="row"><?php _e('CDN Base URL','autoptimize'); ?></th>
173
- <td><label for="autoptimize_url"><input id="cdn_url" type="url" name="autoptimize_cdn_url" pattern="^(https?:)?\/\/([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*(:\d{2,5})?\/?$" style="width:100%" value="<?php $it = get_option('autoptimize_cdn_url','');echo htmlentities($it); ?>" /><br />
174
- <?php _e('Enter your CDN blog root directory URL if you want to enable CDN for images referenced in the CSS.','autoptimize'); ?></label></td>
175
  </tr>
176
  </table>
 
177
 
178
- <h2 class="hidden ao_adv"><?php _e('Cache Info','autoptimize'); ?></h2>
 
179
  <table class="form-table" >
180
- <tr valign="top" class="hidden ao_adv">
181
  <th scope="row"><?php _e('Cache folder','autoptimize'); ?></th>
182
  <td><?php echo htmlentities(AUTOPTIMIZE_CACHE_DIR); ?></td>
183
  </tr>
184
- <tr valign="top" class="hidden ao_adv">
185
  <th scope="row"><?php _e('Can we write?','autoptimize'); ?></th>
186
  <td><?php echo (autoptimizeCache::cacheavail() ? __('Yes','autoptimize') : __('No','autoptimize')); ?></td>
187
  </tr>
188
- <tr valign="top" class="hidden ao_adv">
189
  <th scope="row"><?php _e('Cached styles and scripts','autoptimize'); ?></th>
190
  <td><?php
191
- $AOstatArr=autoptimizeCache::stats();
192
- $AOcacheSize=round($AOstatArr[1]/1024);
193
- echo $AOstatArr[0].__(' files, totalling ','autoptimize').$AOcacheSize.__(' Kbytes (calculated at ','autoptimize').date("H:i e", $AOstatArr[2]).')';
194
  ?></td>
195
  </tr>
196
- <tr valign="top" class="hidden ao_adv">
197
  <th scope="row"><?php _e('Save aggregated script/css as static files?','autoptimize'); ?></th>
198
- <td><label for="autoptimize_cache_nogzip"><input type="checkbox" name="autoptimize_cache_nogzip" <?php echo get_option('autoptimize_cache_nogzip','1')?'checked="checked" ':''; ?>/>
199
  <?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>
200
  </tr>
201
  </table>
 
 
 
 
202
  <input type="hidden" id="autoptimize_show_adv" name="autoptimize_show_adv" value="<?php echo get_option('autoptimize_show_adv','0'); ?>">
203
 
204
  <p class="submit">
@@ -208,14 +337,14 @@ if (get_option('autoptimize_show_adv','0')=='1') {
208
 
209
  </form>
210
  </div>
211
- <style>.autoptimize_banner ul li {font-size:medium;text-align:center;} .unslider-arrow {left:unset;}</style>
212
- <div class="autoptimize_banner">
213
- <ul>
214
  <?php
215
  if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) {
216
  $AO_banner=get_transient("autoptimize_banner");
217
  if (empty($AO_banner)) {
218
- $banner_resp = wp_remote_get("http://optimizingmatters.com/autoptimize_news.html");
219
  if (!is_wp_error($banner_resp)) {
220
  if (wp_remote_retrieve_response_code($banner_resp)=="200") {
221
  $AO_banner = wp_kses_post(wp_remote_retrieve_body($banner_resp));
@@ -228,297 +357,312 @@ if (get_option('autoptimize_show_adv','0')=='1') {
228
  ?>
229
  <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>
230
  <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>
231
- </ul>
232
- </div>
233
- <div style="float:right;width:30%" id="autoptimize_admin_feed">
234
- <div style="margin-left:10px;margin-top:-5px;">
235
- <h2>
236
- <?php _e("futtta about","autoptimize") ?>
237
- <select id="feed_dropdown" >
238
- <option value="1"><?php _e("Autoptimize","autoptimize") ?></option>
239
- <option value="2"><?php _e("WordPress","autoptimize") ?></option>
240
- <option value="3"><?php _e("Web Technology","autoptimize") ?></option>
241
- </select>
242
- </h2>
243
- <div id="futtta_feed">
244
- <div id="autoptimizefeed">
245
- <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_autoptimize"); ?>
246
- </div>
247
- <div id="wordpressfeed">
248
- <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_wordpress"); ?>
249
- </div>
250
- <div id="webtechfeed">
251
- <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_webtech"); ?>
252
- </div>
253
- </div>
254
  </div>
255
- <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 content_url(); ?>/plugins/autoptimize/classes/external/do_not_donate_smallest.png" title="<?php _e("Do not donate for this plugin!"); ?>"></a></div>
 
256
  </div>
257
 
258
  <script type="text/javascript">
259
- var feed = new Array;
260
- feed[1]="autoptimizefeed";
261
- feed[2]="wordpressfeed";
262
- feed[3]="webtechfeed";
263
- cookiename="autoptimize_feed";
264
-
265
- jQuery(document).ready(function() {
266
- check_ini_state();
267
-
268
- jQuery('.autoptimize_banner').unslider({autoplay:true, delay:5000});
269
-
270
- jQuery( "#ao_show_adv" ).click(function() {
271
- jQuery( "#ao_show_adv" ).hide();
272
- jQuery( "#ao_hide_adv" ).show();
273
- jQuery( ".ao_adv" ).show("slow");
274
- if (jQuery("#autoptimize_css").attr('checked')) {
275
- jQuery(".css_sub:visible").fadeTo("fast",1);
276
- if (!jQuery("#autoptimize_css_defer").attr('checked')) {
277
- jQuery("#autoptimize_css_defer_inline").hide();
278
- }
279
- }
280
- if (jQuery("#autoptimize_js").attr('checked')) {
281
- jQuery(".js_sub:visible").fadeTo("fast",1);
282
- }
283
- check_ini_state()
284
- jQuery( "input#autoptimize_show_adv" ).val("1");
285
- });
286
-
287
- jQuery( "#ao_hide_adv" ).click(function() {
288
- jQuery( "#ao_hide_adv" ).hide();
289
- jQuery( "#ao_show_adv" ).show();
290
- jQuery( ".ao_adv" ).hide("slow");
291
- if (!jQuery("#autoptimize_css").attr('checked')) {
292
- jQuery(".css_sub:visible").fadeTo("fast",.33);
293
- }
294
- if (!jQuery("#autoptimize_js").attr('checked')) {
295
- jQuery(".js_sub:visible").fadeTo("fast",.33);
296
- }
297
- check_ini_state()
298
- jQuery( "input#autoptimize_show_adv" ).val("0");
299
- });
300
-
301
- jQuery( "#autoptimize_html" ).change(function() {
302
- if (this.checked) {
303
- jQuery(".html_sub:visible").fadeTo("fast",1);
304
- } else {
305
- jQuery(".html_sub:visible").fadeTo("fast",.33);
306
- }
307
- });
308
-
309
- jQuery( "#autoptimize_js" ).change(function() {
310
- if (this.checked) {
311
- jQuery(".js_sub:visible").fadeTo("fast",1);
312
- } else {
313
- jQuery(".js_sub:visible").fadeTo("fast",.33);
314
- }
315
- });
316
-
317
- jQuery( "#autoptimize_css" ).change(function() {
318
- if (this.checked) {
319
- jQuery(".css_sub:visible").fadeTo("fast",1);
320
- } else {
321
- jQuery(".css_sub:visible").fadeTo("fast",.33);
322
- }
323
- });
324
-
325
- jQuery( "#autoptimize_css_inline" ).change(function() {
326
- if (this.checked) {
327
- jQuery("#autoptimize_css_defer").prop("checked",false);
328
- jQuery("#autoptimize_css_defer_inline").hide("slow");
329
- }
330
- });
331
-
332
- jQuery( "#autoptimize_css_defer" ).change(function() {
333
- if (this.checked) {
334
- jQuery("#autoptimize_css_inline").prop("checked",false);
335
- jQuery("#autoptimize_css_defer_inline").show("slow");
336
- } else {
337
- jQuery("#autoptimize_css_defer_inline").hide("slow");
338
- }
339
- });
340
-
341
- jQuery("#feed_dropdown").change(function() { show_feed(jQuery("#feed_dropdown").val()) });
342
- feedid=jQuery.cookie(cookiename);
343
- if(typeof(feedid) !== "string") feedid=1;
344
- show_feed(feedid);
345
- })
346
-
347
- function check_ini_state() {
348
- if (!jQuery("#autoptimize_css_defer").attr('checked')) {
349
- jQuery("#autoptimize_css_defer_inline").hide();
350
- }
351
- if (!jQuery("#autoptimize_html").attr('checked')) {
352
- jQuery(".html_sub:visible").fadeTo('fast',.33);
353
- }
354
- if (!jQuery("#autoptimize_css").attr('checked')) {
355
- jQuery(".css_sub:visible").fadeTo('fast',.33);
356
- }
357
- if (!jQuery("#autoptimize_js").attr('checked')) {
358
- jQuery(".js_sub:visible").fadeTo('fast',.33);
359
  }
360
- }
361
-
362
- function show_feed(id) {
363
- jQuery('#futtta_feed').children().hide();
364
- jQuery('#'+feed[id]).show();
365
- jQuery("#feed_dropdown").val(id);
366
- jQuery.cookie(cookiename,id,{ expires: 365 });
367
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  </script>
369
  </div>
370
 
371
  <?php
372
- }
373
-
374
- public function addmenu() {
375
- $hook=add_options_page(__('Autoptimize Options','autoptimize'),'Autoptimize','manage_options','autoptimize',array($this,'show'));
376
- add_action( 'admin_print_scripts-'.$hook,array($this,'autoptimize_admin_scripts'));
377
- add_action( 'admin_print_styles-'.$hook,array($this,'autoptimize_admin_styles'));
378
- }
379
-
380
- public function autoptimize_admin_scripts() {
381
- wp_enqueue_script('jqcookie', plugins_url('/external/js/jquery.cookie.min.js', __FILE__), array('jquery'),null,true);
382
- wp_enqueue_script('unslider', plugins_url('/external/js/unslider-min.js', __FILE__), array('jquery'),null,true);
383
- }
384
-
385
- public function autoptimize_admin_styles() {
386
- wp_enqueue_style('unslider', plugins_url('/external/js/unslider.css', __FILE__));
387
- wp_enqueue_style('unslider-dots', plugins_url('/external/js/unslider-dots.css', __FILE__));
388
- }
389
-
390
-
391
- public function registersettings() {
392
- register_setting('autoptimize','autoptimize_html');
393
- register_setting('autoptimize','autoptimize_html_keepcomments');
394
- register_setting('autoptimize','autoptimize_js');
395
- register_setting('autoptimize','autoptimize_js_exclude');
396
- register_setting('autoptimize','autoptimize_js_trycatch');
397
- register_setting('autoptimize','autoptimize_js_justhead');
398
- register_setting('autoptimize','autoptimize_js_forcehead');
399
- register_setting('autoptimize','autoptimize_js_include_inline');
400
- register_setting('autoptimize','autoptimize_css');
401
- register_setting('autoptimize','autoptimize_css_exclude');
402
- register_setting('autoptimize','autoptimize_css_justhead');
403
- register_setting('autoptimize','autoptimize_css_datauris');
404
- register_setting('autoptimize','autoptimize_css_defer');
405
- register_setting('autoptimize','autoptimize_css_defer_inline');
406
- register_setting('autoptimize','autoptimize_css_inline');
407
- register_setting('autoptimize','autoptimize_css_include_inline');
408
- register_setting('autoptimize','autoptimize_css_nogooglefont');
409
- register_setting('autoptimize','autoptimize_cdn_url');
410
- register_setting('autoptimize','autoptimize_cache_clean');
411
- register_setting('autoptimize','autoptimize_cache_nogzip');
412
- register_setting('autoptimize','autoptimize_show_adv');
413
- }
414
-
415
- public function setmeta($links,$file=null) {
416
- //Inspired on http://wpengineer.com/meta-links-for-wordpress-plugins/
417
- //Do it only once - saves time
418
- static $plugin;
419
- if(empty($plugin))
420
- $plugin = plugin_basename(AUTOPTIMIZE_PLUGIN_DIR.'/autoptimize.php');
421
-
422
- if($file===null) {
423
- //2.7
424
- $settings_link = sprintf('<a href="options-general.php?page=autoptimize">%s</a>', __('Settings'));
425
- array_unshift($links,$settings_link);
426
- } else {
427
- //2.8
428
- //If it's us, add the link
429
- if($file === $plugin) {
430
- $newlink = array(sprintf('<a href="options-general.php?page=autoptimize">%s</a>',__('Settings')));
431
- $links = array_merge($links,$newlink);
432
- }
433
- }
434
-
435
- return $links;
436
- }
437
-
438
- public function get($key) {
439
- if(!is_array($this->config)) {
440
- //Default config
441
- $config = array('autoptimize_html' => 0,
442
- 'autoptimize_html_keepcomments' => 0,
443
- 'autoptimize_js' => 0,
444
- 'autoptimize_js_exclude' => "s_sid, smowtion_size, sc_project, WAU_, wau_add, comment-form-quicktags, edToolbar, ch_client, seal.js",
445
- 'autoptimize_js_trycatch' => 0,
446
- 'autoptimize_js_justhead' => 0,
447
- 'autoptimize_js_include_inline' => 0,
448
- 'autoptimize_js_forcehead' => 1,
449
- 'autoptimize_css' => 0,
450
- 'autoptimize_css_exclude' => "admin-bar.min.css, dashicons.min.css",
451
- 'autoptimize_css_justhead' => 0,
452
- 'autoptimize_css_include_inline' => 0,
453
- 'autoptimize_css_defer' => 0,
454
- 'autoptimize_css_defer_inline' => "",
455
- 'autoptimize_css_inline' => 0,
456
- 'autoptimize_css_datauris' => 0,
457
- 'autoptimize_css_nogooglefont' => 0,
458
- 'autoptimize_cdn_url' => "",
459
- 'autoptimize_cache_nogzip' => 1,
460
- 'autoptimize_show_adv' => 0
461
- );
462
-
463
- //Override with user settings
464
- foreach(array_keys($config) as $name) {
465
- $conf = get_option($name);
466
- if($conf!==false) {
467
- //It was set before!
468
- $config[$name] = $conf;
469
- }
470
- }
471
-
472
- //Save for next question
473
- $this->config = $config;
474
- }
475
-
476
- if(isset($this->config[$key]))
477
- return $this->config[$key];
478
-
479
- return false;
480
- }
481
-
482
- private function getFutttaFeeds($url) {
483
- if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) {
484
- $rss = fetch_feed( $url );
485
- $maxitems = 0;
486
-
487
- if ( ! is_wp_error( $rss ) ) {
488
- $maxitems = $rss->get_item_quantity( 7 );
489
- $rss_items = $rss->get_items( 0, $maxitems );
490
- }
491
- ?>
492
- <ul>
493
- <?php if ( $maxitems == 0 ) : ?>
494
- <li><?php _e( 'No items', 'autoptimize' ); ?></li>
495
- <?php else : ?>
496
- <?php foreach ( $rss_items as $item ) : ?>
497
- <li>
498
- <a href="<?php echo esc_url( $item->get_permalink() ); ?>"
499
- title="<?php printf( __( 'Posted %s', 'autoptimize' ), $item->get_date('j F Y | g:i a') ); ?>">
500
- <?php echo esc_html( $item->get_title() ); ?>
501
- </a>
502
- </li>
503
- <?php endforeach; ?>
504
- <?php endif; ?>
505
- </ul>
506
- <?php
507
- }
508
- }
509
-
510
  // based on http://wordpress.stackexchange.com/a/58826
511
  static function ao_admin_tabs(){
512
- $tabs = apply_filters('autoptimize_filter_settingsscreen_tabs',array('autoptimize' => __('Main','autoptimize')));
513
  $tabContent="";
514
-
515
  if (count($tabs)>1) {
516
- if(isset($_GET['page'])){
517
- $currentId = $_GET['page'];
518
- } else {
519
- $currentId = "autoptimize";
520
- }
521
-
522
  $tabContent .= "<h2 class=\"nav-tab-wrapper\">";
523
  foreach($tabs as $tabId => $tabName){
524
  if($currentId == $tabId){
@@ -532,7 +676,7 @@ if (get_option('autoptimize_show_adv','0')=='1') {
532
  } else {
533
  $tabContent = "<hr/>";
534
  }
535
-
536
  return $tabContent;
537
  }
538
  }
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeConfig {
5
+ private $config = null;
6
+ static private $instance = null;
7
+
8
+ //Singleton: private construct
9
+ private function __construct() {
10
+ if( is_admin() ) {
11
+ //Add the admin page and settings
12
+ add_action('admin_menu',array($this,'addmenu'));
13
+ add_action('admin_init',array($this,'registersettings'));
14
+
15
+ //Set meta info
16
+ if(function_exists('plugin_row_meta')) {
17
+ //2.8+
18
+ add_filter('plugin_row_meta',array($this,'setmeta'),10,2);
19
+ } elseif(function_exists('post_class')) {
20
+ //2.7
21
+ $plugin = plugin_basename(AUTOPTIMIZE_PLUGIN_DIR.'autoptimize.php');
22
+ add_filter('plugin_action_links_'.$plugin,array($this,'setmeta'));
23
+ }
24
+
25
+ //Clean cache?
26
+ if(get_option('autoptimize_cache_clean')) {
27
+ autoptimizeCache::clearall();
28
+ update_option('autoptimize_cache_clean',0);
29
+ }
30
+ }
31
+
32
+ //Add the Autoptimize Toolbar to the Admin bar
33
+ //(we loaded outside the verification of is_admin to also be displayed on the frontend toolbar)
34
+ $toolbar = new autoptimizeToolbar();
35
+ }
36
+
37
+ static public function instance() {
38
+ //Only one instance
39
+ if (self::$instance == null) {
40
+ self::$instance = new autoptimizeConfig();
41
+ }
42
+
43
+ return self::$instance;
44
+ }
45
+
46
+ public function show() {
47
  ?>
48
+ <style>
49
+ /* title and button */
50
+ #ao_title_and_button:after {content:''; display:block; clear:both;}
51
+ #ao_adv_button{float:right;}
52
+ #ao_hide_adv:before, #ao_show_adv:before {
53
+ display: inline-block;
54
+ float: left;
55
+ height: 20px;
56
+ width: 35px;
57
+ background: none;
58
+ color: #b4b9be;
59
+ font: normal 20px/26px dashicons;
60
+ letter-spacing: -4px;
61
+ text-align: left;
62
+ speak: none;
63
+ -webkit-font-smoothing: antialiased;
64
+ -moz-osx-font-smoothing: grayscale;
65
+ }
66
+ #ao_hide_adv:before {
67
+ content: "\f108 \f142";
68
+ }
69
+ #ao_show_adv:before {
70
+ content: "\f108 \f140";
71
+ }
72
+
73
+ /* form */
74
+ .itemDetail {
75
+ background: #fff;
76
+ border: 1px solid #ccc;
77
+ padding: 15px;
78
+ margin: 15px 10px 10px 0;
79
+ }
80
+ .itemTitle {
81
+ margin-top: 0;
82
+ }
83
+ input[type=url]:invalid {color: red; border-color:red;} .form-table th{font-weight:100;}
84
+ #autoptimize_main .cb_label {display: block; padding-left: 25px; text-indent: -25px;}
85
+
86
+ /* rss block */
87
+ #futtta_feed ul{list-style:outside;}
88
+ #futtta_feed {font-size:medium; margin:0px 20px;}
89
+
90
+ /* banner + unslider */
91
+ .autoptimize_banner {
92
+ margin: 0 38px;
93
+ padding-bottom: 5px;
94
+ }
95
+ .autoptimize_banner ul li {
96
+ font-size:medium;
97
+ text-align:center;
98
+ }
99
+ .unslider {
100
+ position:relative;
101
+ }
102
+ .unslider-arrow {
103
+ display: block;
104
+ left: unset;
105
+ margin-top: -35px;
106
+ margin-left: 7px;
107
+ margin-right: 7px;
108
+ border-radius: 32px;
109
+ background: rgba(0, 0, 0, 0.10) no-repeat 50% 50%;
110
+ color: rgba(255, 255, 255, 0.8);
111
+ font: normal 20px/1 dashicons;
112
+ speak: none;
113
+ padding: 3px 2px 3px 4px;
114
+ -webkit-font-smoothing: antialiased;
115
+ -moz-osx-font-smoothing: grayscale;
116
+ }
117
+ .unslider-arrow:hover {
118
+ background-color: rgba(0, 0, 0, 0.20);
119
+ color: #FFF;
120
+ }
121
+ .unslider-arrow.prev {
122
+ padding: 3px 4px 3px 2px;
123
+ }
124
+ .unslider-arrow.next {
125
+ right: 0px;
126
+ }
127
+ .unslider-arrow.prev::before {
128
+ content: "\f341";
129
+ }
130
+ .unslider-arrow.next::before {
131
+ content: "\f345";
132
+ }
133
+ /* responsive stuff: hide admin-feed on smaller screens */
134
+ @media (min-width: 961px) {
135
+ #autoptimize_main {float:left;width:69%;}
136
+ #autoptimize_admin_feed{float:right;width:30%;display:block !important;}
137
+ }
138
+ @media (max-width: 960px) {
139
+ #autoptimize_main {width:100%;}
140
+ #autoptimize_admin_feed {width:0%;display:none !important;}
141
+ }
142
+ @media (max-width: 782px) {
143
+ #ao_hide_adv span, #ao_show_adv span {display: none;}
144
+ #ao_hide_adv,#ao_show_adv {height: 34px;padding: 4px 12px 8px 8px;}
145
+ #ao_hide_adv:before,#ao_show_adv:before {font-size: 25px;}
146
+ #autoptimize_main input[type="checkbox"] {margin-left: 10px;}
147
+ #autoptimize_main .cb_label {display: block; padding-left: 45px; text-indent: -45px;}
148
+ }
149
+ </style>
150
 
151
  <div class="wrap">
152
 
153
+ <?php if (version_compare(PHP_VERSION, '5.3.0') < 0) { ?>
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>
155
+ <?php } ?>
156
 
157
+ <div id="autoptimize_main">
158
+ <div id="ao_title_and_button">
159
+ <h1 id="ao_title"><?php _e('Autoptimize Settings','autoptimize'); ?>
160
+ <span id="ao_adv_button">
161
+ <?php
162
+ if (get_option('autoptimize_show_adv','0')=='1') {
163
+ ?>
164
+ <a href="javascript:void(0);" id="ao_show_adv" class="button" style="display:none;"><span><?php _e("Show advanced settings","autoptimize") ?></span></a>
165
+ <a href="javascript:void(0);" id="ao_hide_adv" class="button"><span><?php _e("Hide advanced settings","autoptimize") ?></span></a>
166
+ <style>tr.ao_adv{display:table-row;} li.ao_adv{display:list-item;}</style>
167
+ <?php
168
+ $hiddenClass="";
169
+ } else {
170
+ ?>
171
+ <a href="javascript:void(0);" id="ao_show_adv" class="button"><span><?php _e("Show advanced settings","autoptimize") ?></span></a>
172
+ <a href="javascript:void(0);" id="ao_hide_adv" class="button" style="display:none;"><span><?php _e("Hide advanced settings","autoptimize") ?></span></a>
173
+ <?php
174
+ $hiddenClass="hidden ";
175
+ }
176
+ ?>
177
+ </span>
178
+ </h1>
179
+ </div>
180
 
181
  <?php echo $this->ao_admin_tabs(); ?>
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  <form method="post" action="options.php">
184
  <?php settings_fields('autoptimize'); ?>
185
 
186
+ <ul>
187
+
188
+ <li class="itemDetail">
189
+ <h2 class="itemTitle"><?php _e('HTML Options','autoptimize'); ?></h2>
190
  <table class="form-table">
191
  <tr valign="top">
192
  <th scope="row"><?php _e('Optimize HTML Code?','autoptimize'); ?></th>
193
  <td><input type="checkbox" id="autoptimize_html" name="autoptimize_html" <?php echo get_option('autoptimize_html')?'checked="checked" ':''; ?>/></td>
194
  </tr>
195
+ <tr class="<?php echo $hiddenClass;?>html_sub ao_adv" valign="top">
196
  <th scope="row"><?php _e('Keep HTML comments?','autoptimize'); ?></th>
197
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_html_keepcomments" <?php echo get_option('autoptimize_html_keepcomments')?'checked="checked" ':''; ?>/>
198
  <?php _e('Enable this if you want HTML comments to remain in the page.','autoptimize'); ?></label></td>
199
  </tr>
200
  </table>
201
+ </li>
202
 
203
+ <li class="itemDetail">
204
+ <h2 class="itemTitle"><?php _e('JavaScript Options','autoptimize'); ?></h2>
205
  <table class="form-table">
206
  <tr valign="top">
207
  <th scope="row"><?php _e('Optimize JavaScript Code?','autoptimize'); ?></th>
208
  <td><input type="checkbox" id="autoptimize_js" name="autoptimize_js" <?php echo get_option('autoptimize_js')?'checked="checked" ':''; ?>/></td>
209
  </tr>
210
+ <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
211
  <th scope="row"><?php _e('Force JavaScript in &lt;head&gt;?','autoptimize'); ?></th>
212
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_forcehead" <?php echo get_option('autoptimize_js_forcehead')?'checked="checked" ':''; ?>/>
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>
214
  </tr>
215
  <?php if (get_option('autoptimize_js_justhead')) { ?>
216
+ <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
217
  <th scope="row"><?php _e('Look for scripts only in &lt;head&gt;?','autoptimize'); _e(' <i>(deprecated)</i>','autoptimize'); ?></th>
218
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_justhead" <?php echo get_option('autoptimize_js_justhead')?'checked="checked" ':''; ?>/>
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>
220
  </tr>
221
  <?php } ?>
222
+ <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
223
  <th scope="row"><?php _e('Also aggregate inline JS?','autoptimize'); ?></th>
224
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_include_inline" <?php echo get_option('autoptimize_js_include_inline')?'checked="checked" ':''; ?>/>
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>
226
  </tr>
227
+ <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
228
  <th scope="row"><?php _e('Exclude scripts from Autoptimize:','autoptimize'); ?></th>
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 />
230
+ <?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 and minimized by Autoptimize.','autoptimize'); ?></label></td>
231
  </tr>
232
+ <tr valign="top" class="<?php echo $hiddenClass;?>js_sub ao_adv">
233
  <th scope="row"><?php _e('Add try-catch wrapping?','autoptimize'); ?></th>
234
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_js_trycatch" <?php echo get_option('autoptimize_js_trycatch')?'checked="checked" ':''; ?>/>
235
  <?php _e('If your scripts break because of a JS-error, you might want to try this.','autoptimize'); ?></label></td>
236
  </tr>
237
  </table>
238
+ </li>
239
 
240
+ <li class="itemDetail">
241
+ <h2 class="itemTitle"><?php _e('CSS Options','autoptimize'); ?></h2>
242
  <table class="form-table">
243
  <tr valign="top">
244
  <th scope="row"><?php _e('Optimize CSS Code?','autoptimize'); ?></th>
245
  <td><input type="checkbox" id="autoptimize_css" name="autoptimize_css" <?php echo get_option('autoptimize_css')?'checked="checked" ':''; ?>/></td>
246
  </tr>
247
+ <tr class="<?php echo $hiddenClass;?>css_sub ao_adv" valign="top">
248
  <th scope="row"><?php _e('Generate data: URIs for images?','autoptimize'); ?></th>
249
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_css_datauris" <?php echo get_option('autoptimize_css_datauris')?'checked="checked" ':''; ?>/>
250
+ <?php _e('Enable this to include small background-images in the CSS itself instead of as separate downloads.','autoptimize'); ?></label></td>
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>
257
  <?php if (get_option('autoptimize_css_justhead')) { ?>
258
+ <tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv">
259
  <th scope="row"><?php _e('Look for styles only in &lt;head&gt;?','autoptimize'); _e(' <i>(deprecated)</i>','autoptimize'); ?></th>
260
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead')?'checked="checked" ':''; ?>/>
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>
262
  </tr>
263
  <?php } ?>
264
+ <tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv">
265
  <th scope="row"><?php _e('Also aggregate inline CSS?','autoptimize'); ?></th>
266
+ <td><label class="cb_label"><input type="checkbox" name="autoptimize_css_include_inline" <?php echo get_option('autoptimize_css_include_inline','1')?'checked="checked" ':''; ?>/>
267
  <?php _e('Check this option for Autoptimize to also aggregate CSS in the HTML.','autoptimize'); ?></label></td>
268
  </tr>
269
+ <tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv">
270
  <th scope="row"><?php _e('Inline and Defer CSS?','autoptimize'); ?></th>
271
+ <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" ':''; ?>/>
272
  <?php _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> before activating this option!','autoptimize'); ?></label></td>
273
  </tr>
274
+ <tr valign="top" class="<?php echo $hiddenClass;?>css_sub ao_adv" id="autoptimize_css_defer_inline">
275
  <th scope="row"></th>
276
+ <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>
277
  </tr>
278
+ <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv css_sub">
279
  <th scope="row"><?php _e('Inline all CSS?','autoptimize'); ?></th>
280
+ <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" ':''; ?>/>
281
  <?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>
282
  </tr>
283
+ <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv css_sub">
284
  <th scope="row"><?php _e('Exclude CSS from Autoptimize:','autoptimize'); ?></th>
285
+ <td><label><input type="text" style="width:100%;" name="autoptimize_css_exclude" value="<?php echo get_option('autoptimize_css_exclude','admin-bar.min.css, dashicons.min.css'); ?>"/><br />
286
+ <?php _e('A comma-separated list of CSS you want to exclude from being optimized.','autoptimize'); ?></label></td>
287
  </tr>
288
  </table>
289
+ </li>
290
 
291
+ <li class="itemDetail">
292
+ <h2 class="itemTitle"><?php _e('CDN Options','autoptimize'); ?></h2>
293
  <table class="form-table">
294
  <tr valign="top">
295
  <th scope="row"><?php _e('CDN Base URL','autoptimize'); ?></th>
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 />
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>
298
  </tr>
299
  </table>
300
+ </li>
301
 
302
+ <li class="<?php echo $hiddenClass;?>itemDetail ao_adv">
303
+ <h2 class="itemTitle"><?php _e('Cache Info','autoptimize'); ?></h2>
304
  <table class="form-table" >
305
+ <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
306
  <th scope="row"><?php _e('Cache folder','autoptimize'); ?></th>
307
  <td><?php echo htmlentities(AUTOPTIMIZE_CACHE_DIR); ?></td>
308
  </tr>
309
+ <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
310
  <th scope="row"><?php _e('Can we write?','autoptimize'); ?></th>
311
  <td><?php echo (autoptimizeCache::cacheavail() ? __('Yes','autoptimize') : __('No','autoptimize')); ?></td>
312
  </tr>
313
+ <tr valign="top" class="<?php echo $hiddenClass;?>ao_adv">
314
  <th scope="row"><?php _e('Cached styles and scripts','autoptimize'); ?></th>
315
  <td><?php
316
+ $AOstatArr=autoptimizeCache::stats();
317
+ $AOcacheSize=round($AOstatArr[1]/1024);
318
+ echo $AOstatArr[0].__(' files, totalling ','autoptimize').$AOcacheSize.__(' Kbytes (calculated at ','autoptimize').date("H:i e", $AOstatArr[2]).')';
319
  ?></td>
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>
326
  </table>
327
+ </li>
328
+
329
+ </ul>
330
+
331
  <input type="hidden" id="autoptimize_show_adv" name="autoptimize_show_adv" value="<?php echo get_option('autoptimize_show_adv','0'); ?>">
332
 
333
  <p class="submit">
337
 
338
  </form>
339
  </div>
340
+ <div id="autoptimize_admin_feed" class="hidden">
341
+ <div class="autoptimize_banner hidden">
342
+ <ul>
343
  <?php
344
  if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) {
345
  $AO_banner=get_transient("autoptimize_banner");
346
  if (empty($AO_banner)) {
347
+ $banner_resp = wp_remote_get("http://misc.optimizingmatters.com/autoptimize_news.html");
348
  if (!is_wp_error($banner_resp)) {
349
  if (wp_remote_retrieve_response_code($banner_resp)=="200") {
350
  $AO_banner = wp_kses_post(wp_remote_retrieve_body($banner_resp));
357
  ?>
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>
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>
360
+ </ul>
361
+ </div>
362
+ <div style="margin-left:10px;margin-top:-5px;">
363
+ <h2>
364
+ <?php _e("futtta about","autoptimize") ?>
365
+ <select id="feed_dropdown" >
366
+ <option value="1"><?php _e("Autoptimize","autoptimize") ?></option>
367
+ <option value="2"><?php _e("WordPress","autoptimize") ?></option>
368
+ <option value="3"><?php _e("Web Technology","autoptimize") ?></option>
369
+ </select>
370
+ </h2>
371
+ <div id="futtta_feed">
372
+ <div id="autoptimizefeed">
373
+ <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_autoptimize"); ?>
374
+ </div>
375
+ <div id="wordpressfeed">
376
+ <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_wordpress"); ?>
377
+ </div>
378
+ <div id="webtechfeed">
379
+ <?php $this->getFutttaFeeds("http://feeds.feedburner.com/futtta_webtech"); ?>
380
+ </div>
 
 
381
  </div>
382
+ </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>
384
  </div>
385
 
386
  <script type="text/javascript">
387
+ var feed = new Array;
388
+ feed[1]="autoptimizefeed";
389
+ feed[2]="wordpressfeed";
390
+ feed[3]="webtechfeed";
391
+ cookiename="autoptimize_feed";
392
+
393
+ jQuery(document).ready(function() {
394
+ check_ini_state();
395
+ jQuery('#autoptimize_admin_feed').fadeTo("slow",1).show();
396
+ jQuery('.autoptimize_banner').unslider({autoplay:true, delay:3500, infinite: false, arrows:{prev:'<a class="unslider-arrow prev"></a>', next:'<a class="unslider-arrow next"></a>'}}).fadeTo("slow",1).show();
397
+
398
+ jQuery( "#feed_dropdown" ).change(function() {
399
+ jQuery("#futtta_feed").fadeTo(0,0);
400
+ jQuery("#futtta_feed").fadeTo("slow",1);
401
+ });
402
+
403
+ jQuery( "#ao_show_adv" ).click(function() {
404
+ jQuery( "#ao_show_adv" ).hide();
405
+ jQuery( "#ao_hide_adv" ).show();
406
+ jQuery( ".ao_adv" ).removeClass("hidden");
407
+ jQuery( ".ao_adv" ).show("slow");
408
+ if (jQuery("#autoptimize_css").attr('checked')) {
409
+ jQuery(".css_sub:visible").fadeTo("fast",1);
410
+ if (!jQuery("#autoptimize_css_defer").attr('checked')) {
411
+ jQuery("#autoptimize_css_defer_inline").hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  }
413
+ }
414
+ if (jQuery("#autoptimize_js").attr('checked')) {
415
+ jQuery(".js_sub:visible").fadeTo("fast",1);
416
+ }
417
+ check_ini_state()
418
+ jQuery( "input#autoptimize_show_adv" ).val("1");
419
+ });
420
+
421
+ jQuery( "#ao_hide_adv" ).click(function() {
422
+ jQuery( "#ao_hide_adv" ).hide();
423
+ jQuery( "#ao_show_adv" ).show();
424
+ jQuery( ".ao_adv" ).hide("slow");
425
+ jQuery( ".ao_adv" ).addClass("hidden");
426
+ if (!jQuery("#autoptimize_css").attr('checked')) {
427
+ jQuery(".css_sub:visible").fadeTo("fast",.33);
428
+ }
429
+ if (!jQuery("#autoptimize_js").attr('checked')) {
430
+ jQuery(".js_sub:visible").fadeTo("fast",.33);
431
+ }
432
+ check_ini_state()
433
+ jQuery( "input#autoptimize_show_adv" ).val("0");
434
+ });
435
+
436
+ jQuery( "#autoptimize_html" ).change(function() {
437
+ if (this.checked) {
438
+ jQuery(".html_sub:visible").fadeTo("fast",1);
439
+ } else {
440
+ jQuery(".html_sub:visible").fadeTo("fast",.33);
441
+ }
442
+ });
443
+
444
+ jQuery( "#autoptimize_js" ).change(function() {
445
+ if (this.checked) {
446
+ jQuery(".js_sub:visible").fadeTo("fast",1);
447
+ } else {
448
+ jQuery(".js_sub:visible").fadeTo("fast",.33);
449
+ }
450
+ });
451
+
452
+ jQuery( "#autoptimize_css" ).change(function() {
453
+ if (this.checked) {
454
+ jQuery(".css_sub:visible").fadeTo("fast",1);
455
+ } else {
456
+ jQuery(".css_sub:visible").fadeTo("fast",.33);
457
+ }
458
+ });
459
+
460
+ jQuery( "#autoptimize_css_inline" ).change(function() {
461
+ if (this.checked) {
462
+ jQuery("#autoptimize_css_defer").prop("checked",false);
463
+ jQuery("#autoptimize_css_defer_inline").hide("slow");
464
+ }
465
+ });
466
+
467
+ jQuery( "#autoptimize_css_defer" ).change(function() {
468
+ if (this.checked) {
469
+ jQuery("#autoptimize_css_inline").prop("checked",false);
470
+ jQuery("#autoptimize_css_defer_inline").show("slow");
471
+ } else {
472
+ jQuery("#autoptimize_css_defer_inline").hide("slow");
473
+ }
474
+ });
475
+
476
+ jQuery("#feed_dropdown").change(function() { show_feed(jQuery("#feed_dropdown").val()) });
477
+ feedid=jQuery.cookie(cookiename);
478
+ if(typeof(feedid) !== "string") feedid=1;
479
+ show_feed(feedid);
480
+ })
481
+
482
+ // validate cdn_url
483
+ var cdn_url=document.getElementById("cdn_url");
484
+ cdn_url_baseCSS=cdn_url.style.cssText;
485
+ if ("validity" in cdn_url) {
486
+ jQuery("#cdn_url").focusout(function (event) {
487
+ if (cdn_url.validity.valid) {
488
+ cdn_url.style.cssText=cdn_url_baseCSS;
489
+ } else {
490
+ cdn_url.style.cssText=cdn_url_baseCSS+"border:1px solid #f00;color:#f00;box-shadow: 0 0 2px #f00;";
491
+ }});
492
+ }
493
+
494
+ function check_ini_state() {
495
+ if (!jQuery("#autoptimize_css_defer").attr('checked')) {
496
+ jQuery("#autoptimize_css_defer_inline").hide();
497
+ }
498
+ if (!jQuery("#autoptimize_html").attr('checked')) {
499
+ jQuery(".html_sub:visible").fadeTo('fast',.33);
500
+ }
501
+ if (!jQuery("#autoptimize_css").attr('checked')) {
502
+ jQuery(".css_sub:visible").fadeTo('fast',.33);
503
+ }
504
+ if (!jQuery("#autoptimize_js").attr('checked')) {
505
+ jQuery(".js_sub:visible").fadeTo('fast',.33);
506
+ }
507
+ }
508
+
509
+ function show_feed(id) {
510
+ jQuery('#futtta_feed').children().hide();
511
+ jQuery('#'+feed[id]).show();
512
+ jQuery("#feed_dropdown").val(id);
513
+ jQuery.cookie(cookiename,id,{ expires: 365 });
514
+ }
515
  </script>
516
  </div>
517
 
518
  <?php
519
+ }
520
+
521
+ public function addmenu() {
522
+ $hook=add_options_page(__('Autoptimize Options','autoptimize'),'Autoptimize','manage_options','autoptimize',array($this,'show'));
523
+ add_action( 'admin_print_scripts-'.$hook,array($this,'autoptimize_admin_scripts'));
524
+ add_action( 'admin_print_styles-'.$hook,array($this,'autoptimize_admin_styles'));
525
+ }
526
+
527
+ public function autoptimize_admin_scripts() {
528
+ wp_enqueue_script('jqcookie', plugins_url('/external/js/jquery.cookie.min.js', __FILE__), array('jquery'),null,true);
529
+ wp_enqueue_script('unslider', plugins_url('/external/js/unslider-min.js', __FILE__), array('jquery'),null,true);
530
+ }
531
+
532
+ public function autoptimize_admin_styles() {
533
+ wp_enqueue_style('unslider', plugins_url('/external/js/unslider.css', __FILE__));
534
+ wp_enqueue_style('unslider-dots', plugins_url('/external/js/unslider-dots.css', __FILE__));
535
+ }
536
+
537
+ public function registersettings() {
538
+ register_setting('autoptimize','autoptimize_html');
539
+ register_setting('autoptimize','autoptimize_html_keepcomments');
540
+ register_setting('autoptimize','autoptimize_js');
541
+ register_setting('autoptimize','autoptimize_js_exclude');
542
+ register_setting('autoptimize','autoptimize_js_trycatch');
543
+ register_setting('autoptimize','autoptimize_js_justhead');
544
+ register_setting('autoptimize','autoptimize_js_forcehead');
545
+ register_setting('autoptimize','autoptimize_js_include_inline');
546
+ register_setting('autoptimize','autoptimize_css');
547
+ register_setting('autoptimize','autoptimize_css_exclude');
548
+ register_setting('autoptimize','autoptimize_css_justhead');
549
+ register_setting('autoptimize','autoptimize_css_datauris');
550
+ register_setting('autoptimize','autoptimize_css_defer');
551
+ register_setting('autoptimize','autoptimize_css_defer_inline');
552
+ register_setting('autoptimize','autoptimize_css_inline');
553
+ register_setting('autoptimize','autoptimize_css_include_inline');
554
+ register_setting('autoptimize','autoptimize_css_nogooglefont');
555
+ register_setting('autoptimize','autoptimize_cdn_url');
556
+ register_setting('autoptimize','autoptimize_cache_clean');
557
+ register_setting('autoptimize','autoptimize_cache_nogzip');
558
+ register_setting('autoptimize','autoptimize_show_adv');
559
+ }
560
+
561
+ public function setmeta($links,$file=null) {
562
+ //Inspired on http://wpengineer.com/meta-links-for-wordpress-plugins/
563
+ //Do it only once - saves time
564
+ static $plugin;
565
+ if(empty($plugin))
566
+ $plugin = plugin_basename(AUTOPTIMIZE_PLUGIN_DIR.'autoptimize.php');
567
+
568
+ if($file===null) {
569
+ //2.7
570
+ $settings_link = sprintf('<a href="options-general.php?page=autoptimize">%s</a>', __('Settings'));
571
+ array_unshift($links,$settings_link);
572
+ } else {
573
+ //2.8
574
+ //If it's us, add the link
575
+ if($file === $plugin) {
576
+ $newlink = array(sprintf('<a href="options-general.php?page=autoptimize">%s</a>',__('Settings')));
577
+ $links = array_merge($links,$newlink);
578
+ }
579
+ }
580
+
581
+ return $links;
582
+ }
583
+
584
+ public function get($key) {
585
+ if(!is_array($this->config)) {
586
+ //Default config
587
+ $config = array('autoptimize_html' => 0,
588
+ 'autoptimize_html_keepcomments' => 0,
589
+ 'autoptimize_js' => 0,
590
+ 'autoptimize_js_exclude' => "seal.js, js/jquery/jquery.js",
591
+ 'autoptimize_js_trycatch' => 0,
592
+ 'autoptimize_js_justhead' => 0,
593
+ 'autoptimize_js_include_inline' => 0,
594
+ 'autoptimize_js_forcehead' => 0,
595
+ 'autoptimize_css' => 0,
596
+ 'autoptimize_css_exclude' => "admin-bar.min.css, dashicons.min.css",
597
+ 'autoptimize_css_justhead' => 0,
598
+ 'autoptimize_css_include_inline' => 1,
599
+ 'autoptimize_css_defer' => 0,
600
+ 'autoptimize_css_defer_inline' => "",
601
+ 'autoptimize_css_inline' => 0,
602
+ 'autoptimize_css_datauris' => 0,
603
+ 'autoptimize_css_nogooglefont' => 0,
604
+ 'autoptimize_cdn_url' => "",
605
+ 'autoptimize_cache_nogzip' => 1,
606
+ 'autoptimize_show_adv' => 0
607
+ );
608
+
609
+ //Override with user settings
610
+ foreach(array_keys($config) as $name) {
611
+ $conf = get_option($name);
612
+ if($conf!==false) {
613
+ //It was set before!
614
+ $config[$name] = $conf;
615
+ }
616
+ }
617
+
618
+ //Save for next question
619
+ $this->config = $config;
620
+ }
621
+
622
+ if(isset($this->config[$key]))
623
+ return $this->config[$key];
624
+
625
+ return false;
626
+ }
627
+
628
+ private function getFutttaFeeds($url) {
629
+ if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) {
630
+ $rss = fetch_feed( $url );
631
+ $maxitems = 0;
632
+
633
+ if ( ! is_wp_error( $rss ) ) {
634
+ $maxitems = $rss->get_item_quantity( 7 );
635
+ $rss_items = $rss->get_items( 0, $maxitems );
636
+ }
637
+ ?>
638
+ <ul>
639
+ <?php if ( $maxitems == 0 ) : ?>
640
+ <li><?php _e( 'No items', 'autoptimize' ); ?></li>
641
+ <?php else : ?>
642
+ <?php foreach ( $rss_items as $item ) : ?>
643
+ <li>
644
+ <a href="<?php echo esc_url( $item->get_permalink() ); ?>"
645
+ title="<?php printf( __( 'Posted %s', 'autoptimize' ), $item->get_date('j F Y | g:i a') ); ?>">
646
+ <?php echo esc_html( $item->get_title() ); ?>
647
+ </a>
648
+ </li>
649
+ <?php endforeach; ?>
650
+ <?php endif; ?>
651
+ </ul>
652
+ <?php
653
+ }
654
+ }
655
+
 
656
  // based on http://wordpress.stackexchange.com/a/58826
657
  static function ao_admin_tabs(){
658
+ $tabs = apply_filters('autoptimize_filter_settingsscreen_tabs',array('autoptimize' => __('Main','autoptimize')));
659
  $tabContent="";
 
660
  if (count($tabs)>1) {
661
+ if(isset($_GET['page'])){
662
+ $currentId = $_GET['page'];
663
+ } else {
664
+ $currentId = "autoptimize";
665
+ }
 
666
  $tabContent .= "<h2 class=\"nav-tab-wrapper\">";
667
  foreach($tabs as $tabId => $tabName){
668
  if($currentId == $tabId){
676
  } else {
677
  $tabContent = "<hr/>";
678
  }
679
+
680
  return $tabContent;
681
  }
682
  }
classes/autoptimizeHTML.php CHANGED
@@ -1,87 +1,86 @@
1
  <?php
2
-
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  class autoptimizeHTML extends autoptimizeBase {
6
- private $keepcomments = false;
7
- private $exclude = array('<!-- ngg_resource_manager_marker -->');
8
-
9
- public function read($options) {
10
- // Remove the HTML comments?
11
- $this->keepcomments = (bool) $options['keepcomments'];
12
-
13
- // filter to force xhtml
14
- $this->forcexhtml = (bool) apply_filters( 'autoptimize_filter_html_forcexhtml', false );
15
-
16
- // filter to add strings to be excluded from HTML minification
17
- $excludeHTML = apply_filters( 'autoptimize_filter_html_exclude','' );
18
- if ($excludeHTML!=="") {
19
- $exclHTMLArr = array_filter(array_map('trim',explode(",",$excludeHTML)));
20
- $this->exclude = array_merge($exclHTMLArr,$this->exclude);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
-
23
- // Nothing else for HTML
24
- return true;
25
- }
26
-
27
- //Joins and optimizes CSS
28
- public function minify() {
29
- $noptimizeHTML = apply_filters( 'autoptimize_filter_html_noptimize', false, $this->content );
30
- if ($noptimizeHTML)
31
- return false;
32
-
33
- if(class_exists('Minify_HTML')) {
34
- // wrap the to-be-excluded strings in noptimize tags
35
- foreach ($this->exclude as $exclString) {
36
- if (strpos($this->content,$exclString)!==false) {
37
- $replString="<!--noptimize-->".$exclString."<!--/noptimize-->";
38
- $this->content=str_replace($exclString,$replString,$this->content);
39
- }
40
- }
41
 
42
- // noptimize me
43
- $this->content = $this->hide_noptimize($this->content);
44
 
45
- // Minify html
46
- $options = array('keepComments' => $this->keepcomments);
47
- if ($this->forcexhtml) {
48
- $options['xhtml'] = true;
49
- }
50
 
51
- if (@is_callable(array(new Minify_HTML,"minify"))) {
52
- $tmp_content = Minify_HTML::minify($this->content,$options);
53
- if (!empty($tmp_content)) {
54
- $this->content = $tmp_content;
55
- unset($tmp_content);
56
- }
57
- }
58
 
59
- // restore noptimize
60
- $this->content = $this->restore_noptimize($this->content);
61
-
62
- // remove the noptimize-wrapper from around the excluded strings
63
- foreach ($this->exclude as $exclString) {
64
- $replString="<!--noptimize-->".$exclString."<!--/noptimize-->";
65
- if (strpos($this->content,$replString)!==false) {
66
- $this->content=str_replace($replString,$exclString,$this->content);
67
- }
68
- }
69
 
70
- return true;
71
- }
72
-
73
- // Didn't minify :(
74
- return false;
75
- }
76
-
77
- // Does nothing
78
- public function cache() {
79
- //No cache for HTML
80
- return true;
81
- }
82
-
83
- //Returns the content
84
- public function getcontent() {
85
- return $this->content;
86
- }
87
  }
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeHTML extends autoptimizeBase {
5
+ private $keepcomments = false;
6
+ private $exclude = array('<!-- ngg_resource_manager_marker -->');
7
+
8
+ public function read($options) {
9
+ // Remove the HTML comments?
10
+ $this->keepcomments = (bool) $options['keepcomments'];
11
+
12
+ // filter to force xhtml
13
+ $this->forcexhtml = (bool) apply_filters( 'autoptimize_filter_html_forcexhtml', false );
14
+
15
+ // filter to add strings to be excluded from HTML minification
16
+ $excludeHTML = apply_filters( 'autoptimize_filter_html_exclude','' );
17
+ if ($excludeHTML!=="") {
18
+ $exclHTMLArr = array_filter(array_map('trim',explode(",",$excludeHTML)));
19
+ $this->exclude = array_merge($exclHTMLArr,$this->exclude);
20
+ }
21
+
22
+ // Nothing else for HTML
23
+ return true;
24
+ }
25
+
26
+ //Joins and optimizes CSS
27
+ public function minify() {
28
+ $noptimizeHTML = apply_filters( 'autoptimize_filter_html_noptimize', false, $this->content );
29
+ if ($noptimizeHTML)
30
+ return false;
31
+
32
+ if(class_exists('Minify_HTML')) {
33
+ // wrap the to-be-excluded strings in noptimize tags
34
+ foreach ($this->exclude as $exclString) {
35
+ if (strpos($this->content,$exclString)!==false) {
36
+ $replString="<!--noptimize-->".$exclString."<!--/noptimize-->";
37
+ $this->content=str_replace($exclString,$replString,$this->content);
38
  }
39
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
+ // noptimize me
42
+ $this->content = $this->hide_noptimize($this->content);
43
 
44
+ // Minify html
45
+ $options = array('keepComments' => $this->keepcomments);
46
+ if ($this->forcexhtml) {
47
+ $options['xhtml'] = true;
48
+ }
49
 
50
+ if (@is_callable(array("Minify_HTML","minify"))) {
51
+ $tmp_content = Minify_HTML::minify($this->content,$options);
52
+ if (!empty($tmp_content)) {
53
+ $this->content = $tmp_content;
54
+ unset($tmp_content);
55
+ }
56
+ }
57
 
58
+ // restore noptimize
59
+ $this->content = $this->restore_noptimize($this->content);
60
+
61
+ // remove the noptimize-wrapper from around the excluded strings
62
+ foreach ($this->exclude as $exclString) {
63
+ $replString="<!--noptimize-->".$exclString."<!--/noptimize-->";
64
+ if (strpos($this->content,$replString)!==false) {
65
+ $this->content=str_replace($replString,$exclString,$this->content);
66
+ }
67
+ }
68
 
69
+ return true;
70
+ }
71
+
72
+ // Didn't minify :(
73
+ return false;
74
+ }
75
+
76
+ // Does nothing
77
+ public function cache() {
78
+ //No cache for HTML
79
+ return true;
80
+ }
81
+
82
+ //Returns the content
83
+ public function getcontent() {
84
+ return $this->content;
85
+ }
86
  }
classes/autoptimizeScripts.php CHANGED
@@ -2,407 +2,407 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeScripts extends autoptimizeBase {
5
- private $scripts = array();
6
- private $dontmove = array('document.write','html5.js','show_ads.js','google_ad','blogcatalog.com/w','tweetmeme.com/i','mybloglog.com/','histats.com/js','ads.smowtion.com/ad.js','statcounter.com/counter/counter.js','widgets.amung.us','ws.amazon.com/widgets','media.fastclick.net','/ads/','comment-form-quicktags/quicktags.php','edToolbar','intensedebate.com','scripts.chitika.net/','_gaq.push','jotform.com/','admin-bar.min.js','GoogleAnalyticsObject','plupload.full.min.js','syntaxhighlighter','adsbygoogle','gist.github.com','_stq','nonce','post_id','data-noptimize');
7
- private $domove = array('gaJsHost','load_cmc','jd.gallery.transitions.js','swfobject.embedSWF(','tiny_mce.js','tinyMCEPreInit.go');
8
- private $domovelast = array('addthis.com','/afsonline/show_afs_search.js','disqus.js','networkedblogs.com/getnetworkwidget','infolinks.com/js/','jd.gallery.js.php','jd.gallery.transitions.js','swfobject.embedSWF(','linkwithin.com/widget.js','tiny_mce.js','tinyMCEPreInit.go');
9
- private $trycatch = false;
10
- private $alreadyminified = false;
11
- private $forcehead = true;
12
- private $include_inline = false;
13
- private $jscode = '';
14
- private $url = '';
15
- private $move = array('first' => array(), 'last' => array());
16
- private $restofcontent = '';
17
- private $md5hash = '';
18
- private $whitelist = '';
19
- private $jsremovables = array();
20
- private $inject_min_late = '';
21
-
22
- //Reads the page and collects script tags
23
- public function read($options) {
24
- $noptimizeJS = apply_filters( 'autoptimize_filter_js_noptimize', false, $this->content );
25
- if ($noptimizeJS) return false;
26
 
27
- // only optimize known good JS?
28
- $whitelistJS = apply_filters( 'autoptimize_filter_js_whitelist', "" );
29
- if (!empty($whitelistJS)) {
30
- $this->whitelist = array_filter(array_map('trim',explode(",",$whitelistJS)));
31
- }
32
-
33
- // is there JS we should simply remove
34
- $removableJS = apply_filters( 'autoptimize_filter_js_removables', '');
35
- if (!empty($removableJS)) {
36
- $this->jsremovables = array_filter(array_map('trim',explode(",",$removableJS)));
37
- }
38
 
39
- // only header?
40
- if( apply_filters('autoptimize_filter_js_justhead',$options['justhead']) == true ) {
41
- $content = explode('</head>',$this->content,2);
42
- $this->content = $content[0].'</head>';
43
- $this->restofcontent = $content[1];
44
- }
45
-
46
- // include inline?
47
- if( apply_filters('autoptimize_js_include_inline',$options['include_inline']) == true ) {
48
- $this->include_inline = true;
49
- }
50
 
51
- // filter to "late inject minified JS", default to true for now (it is faster)
52
- $this->inject_min_late = apply_filters('autoptimize_filter_js_inject_min_late',true);
 
 
 
 
 
 
 
 
 
53
 
54
- // filters to override hardcoded do(nt)move(last) array contents (array in, array out!)
55
- $this->dontmove = apply_filters( 'autoptimize_filter_js_dontmove', $this->dontmove );
56
- $this->domovelast = apply_filters( 'autoptimize_filter_js_movelast', $this->domovelast );
57
- $this->domove = apply_filters( 'autoptimize_filter_js_domove', $this->domove );
58
 
59
- // get extra exclusions settings or filter
60
- $excludeJS = $options['js_exclude'];
61
- $excludeJS = apply_filters( 'autoptimize_filter_js_exclude', $excludeJS );
62
- if ($excludeJS!=="") {
63
- $exclJSArr = array_filter(array_map('trim',explode(",",$excludeJS)));
64
- $this->dontmove = array_merge($exclJSArr,$this->dontmove);
65
- }
66
 
67
- //Should we add try-catch?
68
- if($options['trycatch'] == true)
69
- $this->trycatch = true;
 
 
 
 
70
 
71
- // force js in head?
72
- if($options['forcehead'] == true) {
73
- $this->forcehead = true;
74
- } else {
75
- $this->forcehead = false;
76
- }
77
- $this->forcehead = apply_filters( 'autoptimize_filter_js_forcehead', $this->forcehead );
78
 
79
- // get cdn url
80
- $this->cdn_url = $options['cdn_url'];
81
-
82
- // noptimize me
83
- $this->content = $this->hide_noptimize($this->content);
 
 
84
 
85
- // Save IE hacks
86
- $this->content = $this->hide_iehacks($this->content);
 
 
 
87
 
88
- // comments
89
- $this->content = $this->hide_comments($this->content);
90
 
91
- //Get script files
92
- if(preg_match_all('#<script.*</script>#Usmi',$this->content,$matches)) {
93
- foreach($matches[0] as $tag) {
94
- // only consider aggregation whitelisted in should_aggregate-function
95
- if( !$this->should_aggregate($tag) ) {
96
- $tag='';
97
- continue;
98
- }
99
- if(preg_match('#src=("|\')(.*)("|\')#Usmi',$tag,$source)) {
100
- if ($this->isremovable($tag,$this->jsremovables)) {
101
- $this->content = str_replace($tag,'',$this->content);
102
- continue;
103
- }
104
-
105
- // External script
106
- $url = current(explode('?',$source[2],2));
107
- $path = $this->getpath($url);
108
- if($path !== false && preg_match('#\.js$#',$path)) {
109
- //Inline
110
- if($this->ismergeable($tag)) {
111
- //We can merge it
112
- $this->scripts[] = $path;
113
- } else {
114
- //No merge, but maybe we can move it
115
- if($this->ismovable($tag)) {
116
- //Yeah, move it
117
- if($this->movetolast($tag)) {
118
- $this->move['last'][] = $tag;
119
- } else {
120
- $this->move['first'][] = $tag;
121
- }
122
- } else {
123
- //We shouldn't touch this
124
- $tag = '';
125
- }
126
- }
127
- } else {
128
- //External script (example: google analytics)
129
- //OR Script is dynamic (.php etc)
130
- if($this->ismovable($tag)) {
131
- if($this->movetolast($tag)) {
132
- $this->move['last'][] = $tag;
133
- } else {
134
- $this->move['first'][] = $tag;
135
- }
136
- } else {
137
- //We shouldn't touch this
138
- $tag = '';
139
- }
140
- }
141
- } else {
142
- // Inline script
143
- if ($this->isremovable($tag,$this->jsremovables)) {
144
- $this->content = str_replace($tag,'',$this->content);
145
- continue;
146
- }
147
-
148
- // unhide comments, as javascript may be wrapped in comment-tags for old times' sake
149
- $tag = $this->restore_comments($tag);
150
- if($this->ismergeable($tag) && ( $this->include_inline )) {
151
- preg_match('#<script.*>(.*)</script>#Usmi',$tag,$code);
152
- $code = preg_replace('#.*<!\[CDATA\[(?:\s*\*/)?(.*)(?://|/\*)\s*?\]\]>.*#sm','$1',$code[1]);
153
- $code = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/','',$code);
154
- $this->scripts[] = 'INLINE;'.$code;
155
- } else {
156
- // Can we move this?
157
- if($this->ismovable($tag)) {
158
- if($this->movetolast($tag)) {
159
- $this->move['last'][] = $tag;
160
- } else {
161
- $this->move['first'][] = $tag;
162
- }
163
- } else {
164
- //We shouldn't touch this
165
- $tag = '';
166
- }
167
- }
168
- // re-hide comments to be able to do the removal based on tag from $this->content
169
- $tag = $this->hide_comments($tag);
170
- }
171
-
172
- //Remove the original script tag
173
- $this->content = str_replace($tag,'',$this->content);
174
- }
175
-
176
- return true;
177
- }
178
-
179
- // No script files, great ;-)
180
- return false;
181
- }
182
-
183
- //Joins and optimizes JS
184
- public function minify() {
185
- foreach($this->scripts as $script) {
186
- if(preg_match('#^INLINE;#',$script)) {
187
- //Inline script
188
- $script = preg_replace('#^INLINE;#','',$script);
189
- $script = rtrim( $script, ";\n\t\r" ) . ';';
190
- //Add try-catch?
191
- if($this->trycatch) {
192
- $script = 'try{'.$script.'}catch(e){}';
193
- }
194
- $tmpscript = apply_filters( 'autoptimize_js_individual_script', $script, "" );
195
- if ( has_filter('autoptimize_js_individual_script') && !empty($tmpscript) ) {
196
- $script=$tmpscript;
197
- $this->alreadyminified=true;
198
- }
199
- $this->jscode .= "\n" . $script;
200
- } else {
201
- //External script
202
- if($script !== false && file_exists($script) && is_readable($script)) {
203
- $scriptsrc = file_get_contents($script);
204
- $scriptsrc = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$scriptsrc);
205
- $scriptsrc = rtrim($scriptsrc,";\n\t\r").';';
206
- //Add try-catch?
207
- if($this->trycatch) {
208
- $scriptsrc = 'try{'.$scriptsrc.'}catch(e){}';
209
- }
210
- $tmpscriptsrc = apply_filters( 'autoptimize_js_individual_script', $scriptsrc, $script );
211
- if ( has_filter('autoptimize_js_individual_script') && !empty($tmpscriptsrc) ) {
212
- $scriptsrc=$tmpscriptsrc;
213
- $this->alreadyminified=true;
214
- } else if ((strpos($script,"min.js")!==false) && ($this->inject_min_late===true)) {
215
- $scriptsrc="%%INJECTLATER%%".base64_encode($script)."|".md5($scriptsrc)."%%INJECTLATER%%";
216
- }
217
- $this->jscode .= "\n".$scriptsrc;
218
- }/*else{
219
- //Couldn't read JS. Maybe getpath isn't working?
220
- }*/
221
- }
222
- }
223
 
224
- //Check for already-minified code
225
- $this->md5hash = md5($this->jscode);
226
- $ccheck = new autoptimizeCache($this->md5hash,'js');
227
- if($ccheck->check()) {
228
- $this->jscode = $ccheck->retrieve();
229
- return true;
230
- }
231
- unset($ccheck);
232
-
233
- //$this->jscode has all the uncompressed code now.
234
- if ($this->alreadyminified!==true) {
235
- if (class_exists('JSMin') && apply_filters( 'autoptimize_js_do_minify' , true)) {
236
- if (@is_callable(array("JSMin","minify"))) {
237
- $tmp_jscode = trim(JSMin::minify($this->jscode));
238
- if (!empty($tmp_jscode)) {
239
- $this->jscode = $tmp_jscode;
240
- unset($tmp_jscode);
241
- }
242
- $this->jscode = $this->inject_minified($this->jscode);
243
- $this->jscode = apply_filters( 'autoptimize_js_after_minify', $this->jscode );
244
- return true;
245
- } else {
246
- $this->jscode = $this->inject_minified($this->jscode);
247
- return false;
248
- }
249
- } else {
250
- $this->jscode = $this->inject_minified($this->jscode);
251
- return false;
252
- }
253
- }
254
- return true;
255
- }
256
-
257
- //Caches the JS in uncompressed, deflated and gzipped form.
258
- public function cache() {
259
- $cache = new autoptimizeCache($this->md5hash,'js');
260
- if(!$cache->check()) {
261
- //Cache our code
262
- $cache->cache($this->jscode,'text/javascript');
263
- }
264
- $this->url = AUTOPTIMIZE_CACHE_URL.$cache->getname();
265
- $this->url = $this->url_replace_cdn($this->url);
266
- }
267
-
268
- // Returns the content
269
- public function getcontent() {
270
- // Restore the full content
271
- if(!empty($this->restofcontent)) {
272
- $this->content .= $this->restofcontent;
273
- $this->restofcontent = '';
274
- }
275
-
276
- // Add the scripts taking forcehead/ deferred (default) into account
277
- if($this->forcehead == true) {
278
- $replaceTag=array("</head>","before");
279
- $defer="";
280
- } else {
281
- $replaceTag=array("</body>","before");
282
- $defer="defer ";
283
- }
284
-
285
- $defer = apply_filters( 'autoptimize_filter_js_defer', $defer );
286
- $bodyreplacementpayload = '<script type="text/javascript" '.$defer.'src="'.$this->url.'"></script>';
287
- $bodyreplacementpayload = apply_filters('autoptimize_filter_js_bodyreplacementpayload',$bodyreplacementpayload);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
 
289
- $bodyreplacement = implode('',$this->move['first']);
290
- $bodyreplacement .= $bodyreplacementpayload;
291
- $bodyreplacement .= implode('',$this->move['last']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
- $replaceTag = apply_filters( 'autoptimize_filter_js_replacetag', $replaceTag );
 
 
294
 
295
- if (strlen($this->jscode)>0) {
296
- $this->inject_in_html($bodyreplacement,$replaceTag);
297
- }
298
-
299
 
300
- // restore comments
301
- $this->content = $this->restore_comments($this->content);
 
 
 
 
302
 
303
- // Restore IE hacks
304
- $this->content = $this->restore_iehacks($this->content);
305
-
306
- // Restore noptimize
307
- $this->content = $this->restore_noptimize($this->content);
308
 
309
- // Return the modified HTML
310
- return $this->content;
311
- }
312
-
313
- // Checks against the white- and blacklists
314
- private function ismergeable($tag) {
315
- if (!empty($this->whitelist)) {
316
- foreach ($this->whitelist as $match) {
317
- if(strpos($tag,$match)!==false) {
318
- return true;
319
- }
320
- }
321
- // no match with whitelist
322
- return false;
323
- } else {
324
- foreach($this->domove as $match) {
325
- if(strpos($tag,$match)!==false) {
326
- //Matched something
327
- return false;
328
- }
329
- }
330
-
331
- if ($this->movetolast($tag)) {
332
- return false;
333
- }
334
-
335
- foreach($this->dontmove as $match) {
336
- if(strpos($tag,$match)!==false) {
337
- //Matched something
338
- return false;
339
- }
340
- }
341
-
342
- // If we're here it's safe to merge
343
- return true;
344
- }
345
- }
346
-
347
- //Checks agains the blacklist
348
- private function ismovable($tag) {
349
- if ($this->include_inline !== true || apply_filters('autoptimize_filter_js_unmovable',false)) {
350
- return false;
351
- }
352
-
353
- foreach($this->domove as $match) {
354
- if(strpos($tag,$match)!==false) {
355
- //Matched something
356
- return true;
357
- }
358
- }
359
-
360
- if ($this->movetolast($tag)) {
361
- return true;
362
- }
363
-
364
- foreach($this->dontmove as $match) {
365
- if(strpos($tag,$match)!==false) {
366
- //Matched something
367
- return false;
368
- }
369
- }
370
-
371
- //If we're here it's safe to move
372
- return true;
373
- }
374
-
375
- private function movetolast($tag) {
376
- foreach($this->domovelast as $match) {
377
- if(strpos($tag,$match)!==false) {
378
- //Matched, return true
379
- return true;
380
- }
381
- }
382
-
383
- //Should be in 'first'
384
- return false;
385
- }
386
- /**
 
387
  * Determines wheter a <script> $tag should be aggregated or not.
388
  *
389
  * We consider these as "aggregation-safe" currently:
390
  * - script tags without a `type` attribute
391
  * - script tags with an explicit `type` of `text/javascript`, 'text/ecmascript',
392
- * 'application/javascript' or 'application/ecmascript'
393
  *
394
  * Everything else should return false.
395
  *
396
  * @param string $tag
397
  * @return bool
398
- *
399
- * original function by https://github.com/zytzagoo/ on his AO fork, thanks Tomas!
400
  */
401
  public function should_aggregate($tag) {
402
  preg_match('#<(script[^>]*)>#i',$tag,$scripttag);
403
- if ( strpos($scripttag[1], 'type=')===false ) {
404
  return true;
405
- } else if ( preg_match('/type=["\']?(?:text|application)\/(?:javascript|ecmascript)["\']?/i', $scripttag[1]) ) {
406
  return true;
407
  } else {
408
  return false;
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeScripts extends autoptimizeBase {
5
+ private $scripts = array();
6
+ private $dontmove = array('document.write','html5.js','show_ads.js','google_ad','blogcatalog.com/w','tweetmeme.com/i','mybloglog.com/','histats.com/js','ads.smowtion.com/ad.js','statcounter.com/counter/counter.js','widgets.amung.us','ws.amazon.com/widgets','media.fastclick.net','/ads/','comment-form-quicktags/quicktags.php','edToolbar','intensedebate.com','scripts.chitika.net/','_gaq.push','jotform.com/','admin-bar.min.js','GoogleAnalyticsObject','plupload.full.min.js','syntaxhighlighter','adsbygoogle','gist.github.com','_stq','nonce','post_id','data-noptimize');
7
+ private $domove = array('gaJsHost','load_cmc','jd.gallery.transitions.js','swfobject.embedSWF(','tiny_mce.js','tinyMCEPreInit.go');
8
+ private $domovelast = array('addthis.com','/afsonline/show_afs_search.js','disqus.js','networkedblogs.com/getnetworkwidget','infolinks.com/js/','jd.gallery.js.php','jd.gallery.transitions.js','swfobject.embedSWF(','linkwithin.com/widget.js','tiny_mce.js','tinyMCEPreInit.go');
9
+ private $trycatch = false;
10
+ private $alreadyminified = false;
11
+ private $forcehead = true;
12
+ private $include_inline = false;
13
+ private $jscode = '';
14
+ private $url = '';
15
+ private $move = array('first' => array(), 'last' => array());
16
+ private $restofcontent = '';
17
+ private $md5hash = '';
18
+ private $whitelist = '';
19
+ private $jsremovables = array();
20
+ private $inject_min_late = '';
21
+
22
+ //Reads the page and collects script tags
23
+ public function read($options) {
24
+ $noptimizeJS = apply_filters( 'autoptimize_filter_js_noptimize', false, $this->content );
25
+ if ($noptimizeJS) return false;
26
 
27
+ // only optimize known good JS?
28
+ $whitelistJS = apply_filters( 'autoptimize_filter_js_whitelist', "" );
29
+ if (!empty($whitelistJS)) {
30
+ $this->whitelist = array_filter(array_map('trim',explode(",",$whitelistJS)));
31
+ }
 
 
 
 
 
 
32
 
33
+ // is there JS we should simply remove
34
+ $removableJS = apply_filters( 'autoptimize_filter_js_removables', '');
35
+ if (!empty($removableJS)) {
36
+ $this->jsremovables = array_filter(array_map('trim',explode(",",$removableJS)));
37
+ }
 
 
 
 
 
 
38
 
39
+ // only header?
40
+ if( apply_filters('autoptimize_filter_js_justhead',$options['justhead']) == true ) {
41
+ $content = explode('</head>',$this->content,2);
42
+ $this->content = $content[0].'</head>';
43
+ $this->restofcontent = $content[1];
44
+ }
45
+
46
+ // include inline?
47
+ if( apply_filters('autoptimize_js_include_inline',$options['include_inline']) == true ) {
48
+ $this->include_inline = true;
49
+ }
50
 
51
+ // filter to "late inject minified JS", default to true for now (it is faster)
52
+ $this->inject_min_late = apply_filters('autoptimize_filter_js_inject_min_late',true);
 
 
53
 
54
+ // filters to override hardcoded do(nt)move(last) array contents (array in, array out!)
55
+ $this->dontmove = apply_filters( 'autoptimize_filter_js_dontmove', $this->dontmove );
56
+ $this->domovelast = apply_filters( 'autoptimize_filter_js_movelast', $this->domovelast );
57
+ $this->domove = apply_filters( 'autoptimize_filter_js_domove', $this->domove );
 
 
 
58
 
59
+ // get extra exclusions settings or filter
60
+ $excludeJS = $options['js_exclude'];
61
+ $excludeJS = apply_filters( 'autoptimize_filter_js_exclude', $excludeJS );
62
+ if ($excludeJS!=="") {
63
+ $exclJSArr = array_filter(array_map('trim',explode(",",$excludeJS)));
64
+ $this->dontmove = array_merge($exclJSArr,$this->dontmove);
65
+ }
66
 
67
+ //Should we add try-catch?
68
+ if($options['trycatch'] == true)
69
+ $this->trycatch = true;
 
 
 
 
70
 
71
+ // force js in head?
72
+ if($options['forcehead'] == true) {
73
+ $this->forcehead = true;
74
+ } else {
75
+ $this->forcehead = false;
76
+ }
77
+ $this->forcehead = apply_filters( 'autoptimize_filter_js_forcehead', $this->forcehead );
78
 
79
+ // get cdn url
80
+ $this->cdn_url = $options['cdn_url'];
81
+
82
+ // noptimize me
83
+ $this->content = $this->hide_noptimize($this->content);
84
 
85
+ // Save IE hacks
86
+ $this->content = $this->hide_iehacks($this->content);
87
 
88
+ // comments
89
+ $this->content = $this->hide_comments($this->content);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
+ //Get script files
92
+ if(preg_match_all('#<script.*</script>#Usmi',$this->content,$matches)) {
93
+ foreach($matches[0] as $tag) {
94
+ // only consider aggregation whitelisted in should_aggregate-function
95
+ if( !$this->should_aggregate($tag) ) {
96
+ $tag='';
97
+ continue;
98
+ }
99
+ if(preg_match('#<script[^>]*src=("|\')([^>]*)("|\')#Usmi',$tag,$source)) {
100
+ if ($this->isremovable($tag,$this->jsremovables)) {
101
+ $this->content = str_replace($tag,'',$this->content);
102
+ continue;
103
+ }
104
+
105
+ // External script
106
+ $url = current(explode('?',$source[2],2));
107
+ $path = $this->getpath($url);
108
+ if($path !== false && preg_match('#\.js$#',$path)) {
109
+ //Inline
110
+ if($this->ismergeable($tag)) {
111
+ //We can merge it
112
+ $this->scripts[] = $path;
113
+ } else {
114
+ //No merge, but maybe we can move it
115
+ if($this->ismovable($tag)) {
116
+ //Yeah, move it
117
+ if($this->movetolast($tag)) {
118
+ $this->move['last'][] = $tag;
119
+ } else {
120
+ $this->move['first'][] = $tag;
121
+ }
122
+ } else {
123
+ //We shouldn't touch this
124
+ $tag = '';
125
+ }
126
+ }
127
+ } else {
128
+ //External script (example: google analytics)
129
+ //OR Script is dynamic (.php etc)
130
+ if($this->ismovable($tag)) {
131
+ if($this->movetolast($tag)) {
132
+ $this->move['last'][] = $tag;
133
+ } else {
134
+ $this->move['first'][] = $tag;
135
+ }
136
+ } else {
137
+ //We shouldn't touch this
138
+ $tag = '';
139
+ }
140
+ }
141
+ } else {
142
+ // Inline script
143
+ if ($this->isremovable($tag,$this->jsremovables)) {
144
+ $this->content = str_replace($tag,'',$this->content);
145
+ continue;
146
+ }
147
+
148
+ // unhide comments, as javascript may be wrapped in comment-tags for old times' sake
149
+ $tag = $this->restore_comments($tag);
150
+ if($this->ismergeable($tag) && ( $this->include_inline )) {
151
+ preg_match('#<script.*>(.*)</script>#Usmi',$tag,$code);
152
+ $code = preg_replace('#.*<!\[CDATA\[(?:\s*\*/)?(.*)(?://|/\*)\s*?\]\]>.*#sm','$1',$code[1]);
153
+ $code = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/','',$code);
154
+ $this->scripts[] = 'INLINE;'.$code;
155
+ } else {
156
+ // Can we move this?
157
+ if($this->ismovable($tag)) {
158
+ if($this->movetolast($tag)) {
159
+ $this->move['last'][] = $tag;
160
+ } else {
161
+ $this->move['first'][] = $tag;
162
+ }
163
+ } else {
164
+ //We shouldn't touch this
165
+ $tag = '';
166
+ }
167
+ }
168
+ // re-hide comments to be able to do the removal based on tag from $this->content
169
+ $tag = $this->hide_comments($tag);
170
+ }
171
+
172
+ //Remove the original script tag
173
+ $this->content = str_replace($tag,'',$this->content);
174
+ }
175
+
176
+ return true;
177
+ }
178
+
179
+ // No script files, great ;-)
180
+ return false;
181
+ }
182
+
183
+ //Joins and optimizes JS
184
+ public function minify() {
185
+ foreach($this->scripts as $script) {
186
+ if(preg_match('#^INLINE;#',$script)) {
187
+ //Inline script
188
+ $script = preg_replace('#^INLINE;#','',$script);
189
+ $script = rtrim( $script, ";\n\t\r" ) . ';';
190
+ //Add try-catch?
191
+ if($this->trycatch) {
192
+ $script = 'try{'.$script.'}catch(e){}';
193
+ }
194
+ $tmpscript = apply_filters( 'autoptimize_js_individual_script', $script, "" );
195
+ if ( has_filter('autoptimize_js_individual_script') && !empty($tmpscript) ) {
196
+ $script=$tmpscript;
197
+ $this->alreadyminified=true;
198
+ }
199
+ $this->jscode .= "\n" . $script;
200
+ } else {
201
+ //External script
202
+ if($script !== false && file_exists($script) && is_readable($script)) {
203
+ $scriptsrc = file_get_contents($script);
204
+ $scriptsrc = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$scriptsrc);
205
+ $scriptsrc = rtrim($scriptsrc,";\n\t\r").';';
206
+ //Add try-catch?
207
+ if($this->trycatch) {
208
+ $scriptsrc = 'try{'.$scriptsrc.'}catch(e){}';
209
+ }
210
+ $tmpscriptsrc = apply_filters( 'autoptimize_js_individual_script', $scriptsrc, $script );
211
+ if ( has_filter('autoptimize_js_individual_script') && !empty($tmpscriptsrc) ) {
212
+ $scriptsrc=$tmpscriptsrc;
213
+ $this->alreadyminified=true;
214
+ } else if ((( strpos($script,"min.js") !== false ) || ( strpos($script,"wp-includes/js/jquery/jquery.js") !== false )) && ( $this->inject_min_late === true )) {
215
+ $scriptsrc="%%INJECTLATER%%".base64_encode($script)."|".md5($scriptsrc)."%%INJECTLATER%%";
216
+ }
217
+ $this->jscode .= "\n".$scriptsrc;
218
+ }/*else{
219
+ //Couldn't read JS. Maybe getpath isn't working?
220
+ }*/
221
+ }
222
+ }
223
 
224
+ //Check for already-minified code
225
+ $this->md5hash = md5($this->jscode);
226
+ $ccheck = new autoptimizeCache($this->md5hash,'js');
227
+ if($ccheck->check()) {
228
+ $this->jscode = $ccheck->retrieve();
229
+ return true;
230
+ }
231
+ unset($ccheck);
232
+
233
+ //$this->jscode has all the uncompressed code now.
234
+ if ($this->alreadyminified!==true) {
235
+ if (class_exists('JSMin') && apply_filters( 'autoptimize_js_do_minify' , true)) {
236
+ if (@is_callable(array("JSMin","minify"))) {
237
+ $tmp_jscode = trim(JSMin::minify($this->jscode));
238
+ if (!empty($tmp_jscode)) {
239
+ $this->jscode = $tmp_jscode;
240
+ unset($tmp_jscode);
241
+ }
242
+ $this->jscode = $this->inject_minified($this->jscode);
243
+ $this->jscode = apply_filters( 'autoptimize_js_after_minify', $this->jscode );
244
+ return true;
245
+ } else {
246
+ $this->jscode = $this->inject_minified($this->jscode);
247
+ return false;
248
+ }
249
+ } else {
250
+ $this->jscode = $this->inject_minified($this->jscode);
251
+ return false;
252
+ }
253
+ }
254
+ return true;
255
+ }
256
+
257
+ //Caches the JS in uncompressed, deflated and gzipped form.
258
+ public function cache() {
259
+ $cache = new autoptimizeCache($this->md5hash,'js');
260
+ if(!$cache->check()) {
261
+ //Cache our code
262
+ $cache->cache($this->jscode,'text/javascript');
263
+ }
264
+ $this->url = AUTOPTIMIZE_CACHE_URL.$cache->getname();
265
+ $this->url = $this->url_replace_cdn($this->url);
266
+ }
267
+
268
+ // Returns the content
269
+ public function getcontent() {
270
+ // Restore the full content
271
+ if(!empty($this->restofcontent)) {
272
+ $this->content .= $this->restofcontent;
273
+ $this->restofcontent = '';
274
+ }
275
+
276
+ // Add the scripts taking forcehead/ deferred (default) into account
277
+ if($this->forcehead == true) {
278
+ $replaceTag=array("</head>","before");
279
+ $defer="";
280
+ } else {
281
+ $replaceTag=array("</body>","before");
282
+ $defer="defer ";
283
+ }
284
+
285
+ $defer = apply_filters( 'autoptimize_filter_js_defer', $defer );
286
+ $bodyreplacementpayload = '<script type="text/javascript" '.$defer.'src="'.$this->url.'"></script>';
287
+ $bodyreplacementpayload = apply_filters('autoptimize_filter_js_bodyreplacementpayload',$bodyreplacementpayload);
288
 
289
+ $bodyreplacement = implode('',$this->move['first']);
290
+ $bodyreplacement .= $bodyreplacementpayload;
291
+ $bodyreplacement .= implode('',$this->move['last']);
292
 
293
+ $replaceTag = apply_filters( 'autoptimize_filter_js_replacetag', $replaceTag );
 
 
 
294
 
295
+ if (strlen($this->jscode)>0) {
296
+ $this->inject_in_html($bodyreplacement,$replaceTag);
297
+ }
298
+
299
+ // restore comments
300
+ $this->content = $this->restore_comments($this->content);
301
 
302
+ // Restore IE hacks
303
+ $this->content = $this->restore_iehacks($this->content);
304
+
305
+ // Restore noptimize
306
+ $this->content = $this->restore_noptimize($this->content);
307
 
308
+ // Return the modified HTML
309
+ return $this->content;
310
+ }
311
+
312
+ // Checks against the white- and blacklists
313
+ private function ismergeable($tag) {
314
+ if (!empty($this->whitelist)) {
315
+ foreach ($this->whitelist as $match) {
316
+ if(strpos($tag,$match)!==false) {
317
+ return true;
318
+ }
319
+ }
320
+ // no match with whitelist
321
+ return false;
322
+ } else {
323
+ foreach($this->domove as $match) {
324
+ if(strpos($tag,$match)!==false) {
325
+ // Matched something
326
+ return false;
327
+ }
328
+ }
329
+
330
+ if ($this->movetolast($tag)) {
331
+ return false;
332
+ }
333
+
334
+ foreach($this->dontmove as $match) {
335
+ if(strpos($tag,$match)!==false) {
336
+ //Matched something
337
+ return false;
338
+ }
339
+ }
340
+
341
+ // If we're here it's safe to merge
342
+ return true;
343
+ }
344
+ }
345
+
346
+ // Checks againstt the blacklist
347
+ private function ismovable($tag) {
348
+ if ($this->include_inline !== true || apply_filters('autoptimize_filter_js_unmovable',true)) {
349
+ return false;
350
+ }
351
+
352
+ foreach($this->domove as $match) {
353
+ if(strpos($tag,$match)!==false) {
354
+ // Matched something
355
+ return true;
356
+ }
357
+ }
358
+
359
+ if ($this->movetolast($tag)) {
360
+ return true;
361
+ }
362
+
363
+ foreach($this->dontmove as $match) {
364
+ if(strpos($tag,$match)!==false) {
365
+ // Matched something
366
+ return false;
367
+ }
368
+ }
369
+
370
+ // If we're here it's safe to move
371
+ return true;
372
+ }
373
+
374
+ private function movetolast($tag) {
375
+ foreach($this->domovelast as $match) {
376
+ if(strpos($tag,$match)!==false) {
377
+ // Matched, return true
378
+ return true;
379
+ }
380
+ }
381
+
382
+ // Should be in 'first'
383
+ return false;
384
+ }
385
+
386
+ /**
387
  * Determines wheter a <script> $tag should be aggregated or not.
388
  *
389
  * We consider these as "aggregation-safe" currently:
390
  * - script tags without a `type` attribute
391
  * - script tags with an explicit `type` of `text/javascript`, 'text/ecmascript',
392
+ * 'application/javascript' or 'application/ecmascript'
393
  *
394
  * Everything else should return false.
395
  *
396
  * @param string $tag
397
  * @return bool
398
+ *
399
+ * original function by https://github.com/zytzagoo/ on his AO fork, thanks Tomas!
400
  */
401
  public function should_aggregate($tag) {
402
  preg_match('#<(script[^>]*)>#i',$tag,$scripttag);
403
+ if ( strpos($scripttag[1], 'type')===false ) {
404
  return true;
405
+ } else if ( preg_match('/type\s*=\s*["\']?(?:text|application)\/(?:javascript|ecmascript)["\']?/i', $scripttag[1]) ) {
406
  return true;
407
  } else {
408
  return false;
classes/autoptimizeStyles.php CHANGED
@@ -1,658 +1,662 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
-
4
- class autoptimizeStyles extends autoptimizeBase {
5
- private $css = array();
6
- private $csscode = array();
7
- private $url = array();
8
- private $restofcontent = '';
9
- private $mhtml = '';
10
- private $datauris = false;
11
- private $hashmap = array();
12
- private $alreadyminified = false;
13
- private $inline = false;
14
- private $defer = false;
15
- private $defer_inline = false;
16
- private $whitelist = '';
17
- private $cssinlinesize = '';
18
- private $cssremovables = array();
19
- private $include_inline = false;
20
- private $inject_min_late = '';
21
-
22
- //Reads the page and collects style tags
23
- public function read($options) {
24
- $noptimizeCSS = apply_filters( 'autoptimize_filter_css_noptimize', false, $this->content );
25
- if ($noptimizeCSS) return false;
26
-
27
- $whitelistCSS = apply_filters( 'autoptimize_filter_css_whitelist', '' );
28
- if (!empty($whitelistCSS)) {
29
- $this->whitelist = array_filter(array_map('trim',explode(",",$whitelistCSS)));
30
- }
31
-
32
- if ($options['nogooglefont'] == true) {
33
- $removableCSS = "fonts.googleapis.com";
34
- } else {
35
- $removableCSS = "";
36
- }
37
- $removableCSS = apply_filters( 'autoptimize_filter_css_removables', $removableCSS);
38
- if (!empty($removableCSS)) {
39
- $this->cssremovables = array_filter(array_map('trim',explode(",",$removableCSS)));
40
- }
41
-
42
- $this->cssinlinesize = apply_filters('autoptimize_filter_css_inlinesize',256);
43
-
44
- // filter to "late inject minified CSS", default to true for now (it is faster)
45
- $this->inject_min_late = apply_filters('autoptimize_filter_css_inject_min_late',true);
46
-
47
- // Remove everything that's not the header
48
- if ( apply_filters('autoptimize_filter_css_justhead',$options['justhead']) == true ) {
49
- $content = explode('</head>',$this->content,2);
50
- $this->content = $content[0].'</head>';
51
- $this->restofcontent = $content[1];
52
- }
53
-
54
- // include inline?
55
- if( apply_filters('autoptimize_css_include_inline',$options['include_inline']) == true ) {
56
- $this->include_inline = true;
57
- }
58
-
59
- // what CSS shouldn't be autoptimized
60
- $excludeCSS = $options['css_exclude'];
61
- $excludeCSS = apply_filters( 'autoptimize_filter_css_exclude', $excludeCSS );
62
- if ($excludeCSS!=="") {
63
- $this->dontmove = array_filter(array_map('trim',explode(",",$excludeCSS)));
64
- } else {
65
- $this->dontmove = "";
66
- }
67
-
68
- // should we defer css?
69
- // value: true/ false
70
- $this->defer = $options['defer'];
71
- $this->defer = apply_filters( 'autoptimize_filter_css_defer', $this->defer );
72
-
73
- // should we inline while deferring?
74
- // value: inlined CSS
75
- $this->defer_inline = $options['defer_inline'];
76
-
77
- // should we inline?
78
- // value: true/ false
79
- $this->inline = $options['inline'];
80
- $this->inline = apply_filters( 'autoptimize_filter_css_inline', $this->inline );
81
-
82
- // get cdn url
83
- $this->cdn_url = $options['cdn_url'];
84
-
85
- // Store data: URIs setting for later use
86
- $this->datauris = $options['datauris'];
87
-
88
- // noptimize me
89
- $this->content = $this->hide_noptimize($this->content);
90
-
91
- // exclude (no)script, as those may contain CSS which should be left as is
92
- if ( strpos( $this->content, '<script' ) !== false ) {
93
- $this->content = preg_replace_callback(
94
- '#<(?:no)?script.*?<\/(?:no)?script>#is',
95
- create_function(
96
- '$matches',
97
- 'return "%%SCRIPT%%".base64_encode($matches[0])."%%SCRIPT%%";'
98
- ),
99
- $this->content
100
- );
101
- }
102
-
103
- // Save IE hacks
104
- $this->content = $this->hide_iehacks($this->content);
105
-
106
- // hide comments
107
- $this->content = $this->hide_comments($this->content);
108
-
109
- // Get <style> and <link>
110
- if(preg_match_all('#(<style[^>]*>.*</style>)|(<link[^>]*stylesheet[^>]*>)#Usmi',$this->content,$matches)) {
111
- foreach($matches[0] as $tag) {
112
- if ($this->isremovable($tag,$this->cssremovables)) {
113
- $this->content = str_replace($tag,'',$this->content);
114
- } else if ($this->ismovable($tag)) {
115
- // Get the media
116
- if(strpos($tag,'media=')!==false) {
117
- preg_match('#media=(?:"|\')([^>]*)(?:"|\')#Ui',$tag,$medias);
118
- $medias = explode(',',$medias[1]);
119
- $media = array();
120
- foreach($medias as $elem) {
121
- if (empty($elem)) { $elem="all"; }
122
- $media[] = $elem;
123
- }
124
- } else {
125
- // No media specified - applies to all
126
- $media = array('all');
127
- }
128
- $media = apply_filters( 'autoptimize_filter_css_tagmedia',$media,$tag );
129
-
130
- if(preg_match('#<link.*href=("|\')(.*)("|\')#Usmi',$tag,$source)) {
131
- // <link>
132
- $url = current(explode('?',$source[2],2));
133
- $path = $this->getpath($url);
134
-
135
- if($path!==false && preg_match('#\.css$#',$path)) {
136
- // Good link
137
- $this->css[] = array($media,$path);
138
- }else{
139
- // Link is dynamic (.php etc)
140
- $tag = '';
141
- }
142
- } else {
143
- // inline css in style tags can be wrapped in comment tags, so restore comments
144
- $tag = $this->restore_comments($tag);
145
- preg_match('#<style.*>(.*)</style>#Usmi',$tag,$code);
146
-
147
- // and re-hide them to be able to to the removal based on tag
148
- $tag = $this->hide_comments($tag);
149
-
150
- if ( $this->include_inline ) {
151
- $code = preg_replace('#^.*<!\[CDATA\[(?:\s*\*/)?(.*)(?://|/\*)\s*?\]\]>.*$#sm','$1',$code[1]);
152
- $this->css[] = array($media,'INLINE;'.$code);
153
- } else {
154
- $tag = '';
155
- }
156
- }
157
-
158
- // Remove the original style tag
159
- $this->content = str_replace($tag,'',$this->content);
160
- }
161
- }
162
- return true;
163
- }
164
- // Really, no styles?
165
- return false;
166
- }
167
-
168
- // Joins and optimizes CSS
169
- public function minify() {
170
- foreach($this->css as $group) {
171
- list($media,$css) = $group;
172
- if(preg_match('#^INLINE;#',$css)) {
173
- // <style>
174
- $css = preg_replace('#^INLINE;#','',$css);
175
- $css = $this->fixurls(ABSPATH.'/index.php',$css);
176
- $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, "" );
177
- if ( has_filter('autoptimize_css_individual_style') && !empty($tmpstyle) ) {
178
- $css=$tmpstyle;
179
- $this->alreadyminified=true;
180
- }
181
- } else {
182
- //<link>
183
- if($css !== false && file_exists($css) && is_readable($css)) {
184
- $cssPath = $css;
185
- $css = $this->fixurls($cssPath,file_get_contents($cssPath));
186
- $css = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$css);
187
- $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, $cssPath );
188
- if (has_filter('autoptimize_css_individual_style') && !empty($tmpstyle)) {
189
- $css=$tmpstyle;
190
- $this->alreadyminified=true;
191
- } else if ($this->can_inject_late($cssPath,$css)) {
192
- $css="%%INJECTLATER%%".base64_encode($cssPath)."|".md5($css)."%%INJECTLATER%%";
193
- }
194
- } else {
195
- // Couldn't read CSS. Maybe getpath isn't working?
196
- $css = '';
197
- }
198
- }
199
-
200
- foreach($media as $elem) {
201
- if(!isset($this->csscode[$elem]))
202
- $this->csscode[$elem] = '';
203
- $this->csscode[$elem] .= "\n/*FILESTART*/".$css;
204
- }
205
- }
206
-
207
- // Check for duplicate code
208
- $md5list = array();
209
- $tmpcss = $this->csscode;
210
- foreach($tmpcss as $media => $code) {
211
- $md5sum = md5($code);
212
- $medianame = $media;
213
- foreach($md5list as $med => $sum) {
214
- // If same code
215
- if($sum === $md5sum) {
216
- //Add the merged code
217
- $medianame = $med.', '.$media;
218
- $this->csscode[$medianame] = $code;
219
- $md5list[$medianame] = $md5list[$med];
220
- unset($this->csscode[$med], $this->csscode[$media]);
221
- unset($md5list[$med]);
222
- }
223
- }
224
- $md5list[$medianame] = $md5sum;
225
- }
226
- unset($tmpcss);
227
-
228
- // Manage @imports, while is for recursive import management
229
- foreach ($this->csscode as &$thiscss) {
230
- // Flag to trigger import reconstitution and var to hold external imports
231
- $fiximports = false;
232
- $external_imports = "";
233
-
234
- while(preg_match_all('#^(/*\s?)@import.*(?:;|$)#Um',$thiscss,$matches)) {
235
- foreach($matches[0] as $import) {
236
- if ($this->isremovable($import,$this->cssremovables)) {
237
- $thiscss = str_replace($import,'',$thiscss);
238
- $import_ok = true;
239
- } else {
240
- $url = trim(preg_replace('#^.*((?:https?:|ftp:)?//.*\.css).*$#','$1',trim($import))," \t\n\r\0\x0B\"'");
241
- $path = $this->getpath($url);
242
- $import_ok = false;
243
- if (file_exists($path) && is_readable($path)) {
244
- $code = addcslashes($this->fixurls($path,file_get_contents($path)),"\\");
245
- $code = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$code);
246
- $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $code, "" );
247
- if ( has_filter('autoptimize_css_individual_style') && !empty($tmpstyle)) {
248
- $code=$tmpstyle;
249
- $this->alreadyminified=true;
250
- } else if ($this->can_inject_late($path,$code)) {
251
- $code="%%INJECTLATER%%".base64_encode($path)."|".md5($code)."%%INJECTLATER%%";
252
- }
253
-
254
- if(!empty($code)) {
255
- $tmp_thiscss = preg_replace('#(/\*FILESTART\*/.*)'.preg_quote($import,'#').'#Us','/*FILESTART2*/'.$code.'$1',$thiscss);
256
- if (!empty($tmp_thiscss)) {
257
- $thiscss = $tmp_thiscss;
258
- $import_ok = true;
259
- unset($tmp_thiscss);
260
- }
261
- unset($code);
262
- }
263
- }
264
- }
265
-
266
- if (!$import_ok) {
267
- // external imports and general fall-back
268
- $external_imports .= $import;
269
- $thiscss = str_replace($import,'',$thiscss);
270
- $fiximports = true;
271
- }
272
- }
273
- $thiscss = preg_replace('#/\*FILESTART\*/#','',$thiscss);
274
- $thiscss = preg_replace('#/\*FILESTART2\*/#','/*FILESTART*/',$thiscss);
275
- }
276
-
277
- // add external imports to top of aggregated CSS
278
- if($fiximports) {
279
- $thiscss=$external_imports.$thiscss;
280
- }
281
- }
282
- unset($thiscss);
283
-
284
- // $this->csscode has all the uncompressed code now.
285
- $mhtmlcount = 0;
286
- foreach($this->csscode as &$code) {
287
- // Check for already-minified code
288
- $hash = md5($code);
289
- $ccheck = new autoptimizeCache($hash,'css');
290
- if($ccheck->check()) {
291
- $code = $ccheck->retrieve();
292
- $this->hashmap[md5($code)] = $hash;
293
- continue;
294
- }
295
- unset($ccheck);
296
-
297
- // Do the imaging!
298
- $imgreplace = array();
299
- preg_match_all('#(background[^;}]*url\((?!\s?"?\s?data)(.*)\)[^;}]*)(?:;|$|})#Usm',$code,$matches);
300
-
301
- if(($this->datauris == true) && (function_exists('base64_encode')) && (is_array($matches))) {
302
- foreach($matches[2] as $count => $quotedurl) {
303
- $iurl = trim($quotedurl," \t\n\r\0\x0B\"'");
304
-
305
- // if querystring, remove it from url
306
- if (strpos($iurl,'?') !== false) { $iurl = strtok($iurl,'?'); }
307
-
308
- $ipath = $this->getpath($iurl);
309
-
310
- $datauri_max_size = 4096;
311
- $datauri_max_size = (int) apply_filters( 'autoptimize_filter_css_datauri_maxsize', $datauri_max_size );
312
- $datauri_exclude = apply_filters( 'autoptimize_filter_css_datauri_exclude', "");
313
- if (!empty($datauri_exclude)) {
314
- $no_datauris=array_filter(array_map('trim',explode(",",$datauri_exclude)));
315
- foreach ($no_datauris as $no_datauri) {
316
- if (strpos($iurl,$no_datauri)!==false) {
317
- $ipath=false;
318
- break;
319
- }
320
- }
321
- }
322
-
323
- if($ipath != false && preg_match('#\.(jpe?g|png|gif|bmp)$#i',$ipath) && file_exists($ipath) && is_readable($ipath) && filesize($ipath) <= $datauri_max_size) {
324
- $ihash=md5($ipath);
325
- $icheck = new autoptimizeCache($ihash,'img');
326
- if($icheck->check()) {
327
- // we have the base64 image in cache
328
- $headAndData=$icheck->retrieve();
329
- $_base64data=explode(";base64,",$headAndData);
330
- $base64data=$_base64data[1];
331
- } else {
332
- // It's an image and we don't have it in cache, get the type
333
- $explA=explode('.',$ipath);
334
- $type=end($explA);
335
-
336
- switch($type) {
337
- case 'jpeg':
338
- $dataurihead = 'data:image/jpeg;base64,';
339
- break;
340
- case 'jpg':
341
- $dataurihead = 'data:image/jpeg;base64,';
342
- break;
343
- case 'gif':
344
- $dataurihead = 'data:image/gif;base64,';
345
- break;
346
- case 'png':
347
- $dataurihead = 'data:image/png;base64,';
348
- break;
349
- case 'bmp':
350
- $dataurihead = 'data:image/bmp;base64,';
351
- break;
352
- default:
353
- $dataurihead = 'data:application/octet-stream;base64,';
354
- }
355
-
356
- // Encode the data
357
- $base64data = base64_encode(file_get_contents($ipath));
358
- $headAndData=$dataurihead.$base64data;
359
-
360
- // Save in cache
361
- $icheck->cache($headAndData,"text/plain");
362
- }
363
- unset($icheck);
364
-
365
- // Add it to the list for replacement
366
- $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$headAndData,$matches[1][$count]).";\n*".str_replace($quotedurl,'mhtml:%%MHTML%%!'.$mhtmlcount,$matches[1][$count]).";\n_".$matches[1][$count].';';
367
-
368
- // Store image on the mhtml document
369
- $this->mhtml .= "--_\r\nContent-Location:{$mhtmlcount}\r\nContent-Transfer-Encoding:base64\r\n\r\n{$base64data}\r\n";
370
- $mhtmlcount++;
371
- } else {
372
- // just cdn the URL if applicable
373
- if (!empty($this->cdn_url)) {
374
- $url = trim($quotedurl," \t\n\r\0\x0B\"'");
375
- $cdn_url=$this->url_replace_cdn($url);
376
- $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$cdn_url,$matches[1][$count]);
377
- }
378
- }
379
- }
380
- } else if ((is_array($matches)) && (!empty($this->cdn_url))) {
381
- // change background image urls to cdn-url
382
- foreach($matches[2] as $count => $quotedurl) {
383
- $url = trim($quotedurl," \t\n\r\0\x0B\"'");
384
- $cdn_url=$this->url_replace_cdn($url);
385
- $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$cdn_url,$matches[1][$count]);
386
- }
387
- }
388
-
389
- if(!empty($imgreplace)) {
390
- $code = str_replace(array_keys($imgreplace),array_values($imgreplace),$code);
391
- }
392
-
393
- // CDN the fonts!
394
- if ((!empty($this->cdn_url))&&apply_filters("autoptimize_filter_css_fonts_cdn",false)) {
395
- $fontreplace = array();
396
- $fonturl_regex = <<<'LOD'
397
- ~(?(DEFINE)(?<quoted_content>(["']) (?>[^"'\\]++ | \\{2} | \\. | (?!\g{-1})["'] )*+ \g{-1})(?<comment> /\* .*? \*/ ) (?<url_skip>(?: data: ) [^"'\s)}]*+ ) (?<other_content>(?> [^u}/"']++ | \g<quoted_content> | \g<comment> | \Bu | u(?!rl\s*+\() | /(?!\*) | \g<url_start> \g<url_skip> ["']?+ )++ ) (?<anchor> \G(?<!^) ["']?+ | @font-face \s*+ { ) (?<url_start> url\( \s*+ ["']?+ ) ) \g<comment> (*SKIP)(*FAIL) | \g<anchor> \g<other_content>?+ \g<url_start> \K ((?:(?:https?:)?(?://[[:alnum:]\-\.]+)(?::[0-9]+)?)?\/[^"'\s)}]*+) ~xs
398
- LOD;
399
-
400
- preg_match_all($fonturl_regex,$code,$matches);
401
- if (is_array($matches)) {
402
- foreach($matches[8] as $count => $quotedurl) {
403
- $url = trim($quotedurl," \t\n\r\0\x0B\"'");
404
- $cdn_url=$this->url_replace_cdn($url);
405
- $fontreplace[$matches[8][$count]] = str_replace($quotedurl,$cdn_url,$matches[8][$count]);
406
- }
407
- if(!empty($fontreplace)) {
408
- $code = str_replace(array_keys($fontreplace),array_values($fontreplace),$code);
409
- }
410
- }
411
- }
412
-
413
- // Minify
414
- if (($this->alreadyminified!==true) && (apply_filters( "autoptimize_css_do_minify", true))) {
415
- if (class_exists('Minify_CSS_Compressor')) {
416
- $tmp_code = trim(Minify_CSS_Compressor::process($code));
417
- } else if(class_exists('CSSmin')) {
418
- $cssmin = new CSSmin();
419
- if (method_exists($cssmin,"run")) {
420
- $tmp_code = trim($cssmin->run($code));
421
- } elseif (@is_callable(array($cssmin,"minify"))) {
422
- $tmp_code = trim(CssMin::minify($code));
423
- }
424
- }
425
- if (!empty($tmp_code)) {
426
- $code = $tmp_code;
427
- unset($tmp_code);
428
- }
429
- }
430
-
431
- $code = $this->inject_minified($code);
432
-
433
- $tmp_code = apply_filters( 'autoptimize_css_after_minify',$code );
434
- if (!empty($tmp_code)) {
435
- $code = $tmp_code;
436
- unset($tmp_code);
437
- }
438
-
439
- $this->hashmap[md5($code)] = $hash;
440
- }
441
- unset($code);
442
- return true;
443
- }
444
-
445
- //Caches the CSS in uncompressed, deflated and gzipped form.
446
- public function cache() {
447
- if($this->datauris) {
448
- // MHTML Preparation
449
- $this->mhtml = "/*\r\nContent-Type: multipart/related; boundary=\"_\"\r\n\r\n".$this->mhtml."*/\r\n";
450
- $md5 = md5($this->mhtml);
451
- $cache = new autoptimizeCache($md5,'txt');
452
- if(!$cache->check()) {
453
- // Cache our images for IE
454
- $cache->cache($this->mhtml,'text/plain');
455
- }
456
- $mhtml = AUTOPTIMIZE_CACHE_URL.$cache->getname();
457
- }
458
-
459
- // CSS cache
460
- foreach($this->csscode as $media => $code) {
461
- $md5 = $this->hashmap[md5($code)];
462
-
463
- if($this->datauris) {
464
- // Images for ie! Get the right url
465
- $code = str_replace('%%MHTML%%',$mhtml,$code);
466
- }
467
-
468
- $cache = new autoptimizeCache($md5,'css');
469
- if(!$cache->check()) {
470
- // Cache our code
471
- $cache->cache($code,'text/css');
472
- }
473
- $this->url[$media] = AUTOPTIMIZE_CACHE_URL.$cache->getname();
474
- }
475
- }
476
-
477
- //Returns the content
478
- public function getcontent() {
479
- // restore IE hacks
480
- $this->content = $this->restore_iehacks($this->content);
481
-
482
- // restore comments
483
- $this->content = $this->restore_comments($this->content);
484
-
485
- // restore (no)script
486
- if ( strpos( $this->content, '%%SCRIPT%%' ) !== false ) {
487
- $this->content = preg_replace_callback(
488
- '#%%SCRIPT%%(.*?)%%SCRIPT%%#is',
489
- create_function(
490
- '$matches',
491
- 'return base64_decode($matches[1]);'
492
- ),
493
- $this->content
494
- );
495
- }
496
-
497
- // restore noptimize
498
- $this->content = $this->restore_noptimize($this->content);
499
-
500
- //Restore the full content
501
- if(!empty($this->restofcontent)) {
502
- $this->content .= $this->restofcontent;
503
- $this->restofcontent = '';
504
- }
505
-
506
- // Inject the new stylesheets
507
- $replaceTag = array("<title","before");
508
- $replaceTag = apply_filters( 'autoptimize_filter_css_replacetag', $replaceTag );
509
-
510
- if ($this->inline == true) {
511
- foreach($this->csscode as $media => $code) {
512
- $this->inject_in_html('<style type="text/css" media="'.$media.'">'.$code.'</style>',$replaceTag);
513
- }
514
- } else {
515
- if ($this->defer == true) {
516
- $deferredCssBlock = "<script data-cfasync='false'>function lCss(url,media) {var d=document;var l=d.createElement('link');l.rel='stylesheet';l.type='text/css';l.href=url;l.media=media;aoin=d.getElementsByTagName('noscript')[0];aoin.parentNode.insertBefore(l,aoin.nextSibling);}function deferredCSS() {";
517
- $noScriptCssBlock = "<noscript>";
518
- $defer_inline_code=$this->defer_inline;
519
- $defer_inline_code=apply_filters( 'autoptimize_filter_css_defer_inline', $defer_inline_code );
520
- if(!empty($defer_inline_code)){
521
-
522
- $iCssHash=md5($defer_inline_code);
523
- $iCssCache = new autoptimizeCache($iCssHash,'css');
524
- if($iCssCache->check()) {
525
- // we have the optimized inline CSS in cache
526
- $defer_inline_code=$iCssCache->retrieve();
527
- } else {
528
- if (class_exists('Minify_CSS_Compressor')) {
529
- $tmp_code = trim(Minify_CSS_Compressor::process($this->defer_inline));
530
- } else if(class_exists('CSSmin')) {
531
- $cssmin = new CSSmin();
532
- $tmp_code = trim($cssmin->run($defer_inline_code));
533
- }
534
-
535
- if (!empty($tmp_code)) {
536
- $defer_inline_code = $tmp_code;
537
- $iCssCache->cache($defer_inline_code,"text/css");
538
- unset($tmp_code);
539
- }
540
- }
541
- $code_out='<style type="text/css" id="aoatfcss" media="all">'.$defer_inline_code.'</style>';
542
- $this->inject_in_html($code_out,$replaceTag);
543
- }
544
- }
545
-
546
- foreach($this->url as $media => $url) {
547
- $url = $this->url_replace_cdn($url);
548
-
549
- //Add the stylesheet either deferred (import at bottom) or normal links in head
550
- if($this->defer == true) {
551
- $deferredCssBlock .= "lCss('".$url."','".$media."');";
552
- $noScriptCssBlock .= '<link type="text/css" media="'.$media.'" href="'.$url.'" rel="stylesheet" />';
553
- } else {
554
- if (strlen($this->csscode[$media]) > $this->cssinlinesize) {
555
- $this->inject_in_html('<link type="text/css" media="'.$media.'" href="'.$url.'" rel="stylesheet" />',$replaceTag);
556
- } else if (strlen($this->csscode[$media])>0) {
557
- $this->inject_in_html('<style type="text/css" media="'.$media.'">'.$this->csscode[$media].'</style>',$replaceTag);
558
- }
559
- }
560
- }
561
-
562
- if($this->defer == true) {
563
- $deferredCssBlock .= "}if(window.addEventListener){window.addEventListener('DOMContentLoaded',deferredCSS,false);}else{window.onload = deferredCSS;}</script>";
564
- $noScriptCssBlock .= "</noscript>";
565
- $this->inject_in_html($noScriptCssBlock,$replaceTag);
566
- $this->inject_in_html($deferredCssBlock,array('</body>','before'));
567
- }
568
- }
569
-
570
- //Return the modified stylesheet
571
- return $this->content;
572
- }
573
-
574
- static function fixurls($file,$code) {
575
- $file = str_replace(WP_ROOT_DIR,'/',$file);
576
- $dir = dirname($file); //Like /wp-content
577
-
578
- // quick fix for import-troubles in e.g. arras theme
579
- $code=preg_replace('#@import ("|\')(.+?)\.css("|\')#','@import url("${2}.css")',$code);
580
-
581
- if(preg_match_all('#url\((?!data)(?!\#)(?!"\#)(.*)\)#Usi',$code,$matches)) {
582
- $replace = array();
583
- foreach($matches[1] as $k => $url) {
584
- // Remove quotes
585
- $url = trim($url," \t\n\r\0\x0B\"'");
586
- $noQurl = trim($url,"\"'");
587
- if ($url!==$noQurl) {
588
- $removedQuotes=true;
589
- } else {
590
- $removedQuotes=false;
591
- }
592
- $url=$noQurl;
593
- if(substr($url,0,1)=='/' || preg_match('#^(https?://|ftp://|data:)#i',$url)) {
594
- //URL is absolute
595
- continue;
596
- } else {
597
- // relative URL
598
- $newurl = preg_replace('/https?:/','',str_replace(" ","%20",AUTOPTIMIZE_WP_ROOT_URL.str_replace('//','/',$dir.'/'.$url)));
599
-
600
- $hash = md5($url);
601
- $code = str_replace($matches[0][$k],$hash,$code);
602
-
603
- if (!empty($removedQuotes)) {
604
- $replace[$hash] = 'url(\''.$newurl.'\')';
605
- } else {
606
- $replace[$hash] = 'url('.$newurl.')';
607
- }
608
- }
609
- }
610
- //Do the replacing here to avoid breaking URLs
611
- $code = str_replace(array_keys($replace),array_values($replace),$code);
612
- }
613
- return $code;
614
- }
615
-
616
- private function ismovable($tag) {
617
- if (!empty($this->whitelist)) {
618
- foreach ($this->whitelist as $match) {
619
- if(strpos($tag,$match)!==false) {
620
- return true;
621
- }
622
- }
623
- // no match with whitelist
624
- return false;
625
- } else {
626
- if (is_array($this->dontmove)) {
627
- foreach($this->dontmove as $match) {
628
- if(strpos($tag,$match)!==false) {
629
- //Matched something
630
- return false;
631
- }
632
- }
633
- }
634
-
635
- //If we're here it's safe to move
636
- return true;
637
- }
638
- }
639
-
640
- private function can_inject_late($cssPath,$css) {
641
- if ((strpos($cssPath,"min.css")===false) || ($this->inject_min_late!==true)) {
642
- // late-inject turned off or file not minified based on filename
643
- return false;
644
- } else if (strpos($css,"@import")!==false) {
645
- // can't late-inject files with imports as those need to be aggregated
646
- return false;
647
- } else if ( (strpos($css,"@font-face")!==false ) && ( apply_filters("autoptimize_filter_css_fonts_cdn",false)===true) && (!empty($this->cdn_url)) ) {
648
- // don't late-inject CSS with font-src's if fonts are set to be CDN'ed
649
- return false;
650
- } else if ( (($this->datauris == true) || (!empty($this->cdn_url))) && preg_match("#background[^;}]*url\(#Ui",$css) ) {
651
- // don't late-inject CSS with images if CDN is set OR is image inlining is on
652
- return false;
653
- } else {
654
- // phew, all is safe, we can late-inject
655
- return true;
656
- }
657
- }
658
- }
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class autoptimizeStyles extends autoptimizeBase {
5
+ private $css = array();
6
+ private $csscode = array();
7
+ private $url = array();
8
+ private $restofcontent = '';
9
+ private $mhtml = '';
10
+ private $datauris = false;
11
+ private $hashmap = array();
12
+ private $alreadyminified = false;
13
+ private $inline = false;
14
+ private $defer = false;
15
+ private $defer_inline = false;
16
+ private $whitelist = '';
17
+ private $cssinlinesize = '';
18
+ private $cssremovables = array();
19
+ private $include_inline = false;
20
+ private $inject_min_late = '';
21
+
22
+ //Reads the page and collects style tags
23
+ public function read($options) {
24
+ $noptimizeCSS = apply_filters( 'autoptimize_filter_css_noptimize', false, $this->content );
25
+ if ($noptimizeCSS) return false;
26
+
27
+ $whitelistCSS = apply_filters( 'autoptimize_filter_css_whitelist', '' );
28
+ if (!empty($whitelistCSS)) {
29
+ $this->whitelist = array_filter(array_map('trim',explode(",",$whitelistCSS)));
30
+ }
31
+
32
+ if ($options['nogooglefont'] == true) {
33
+ $removableCSS = "fonts.googleapis.com";
34
+ } else {
35
+ $removableCSS = "";
36
+ }
37
+ $removableCSS = apply_filters( 'autoptimize_filter_css_removables', $removableCSS);
38
+ if (!empty($removableCSS)) {
39
+ $this->cssremovables = array_filter(array_map('trim',explode(",",$removableCSS)));
40
+ }
41
+
42
+ $this->cssinlinesize = apply_filters('autoptimize_filter_css_inlinesize',256);
43
+
44
+ // filter to "late inject minified CSS", default to true for now (it is faster)
45
+ $this->inject_min_late = apply_filters('autoptimize_filter_css_inject_min_late',true);
46
+
47
+ // Remove everything that's not the header
48
+ if ( apply_filters('autoptimize_filter_css_justhead',$options['justhead']) == true ) {
49
+ $content = explode('</head>',$this->content,2);
50
+ $this->content = $content[0].'</head>';
51
+ $this->restofcontent = $content[1];
52
+ }
53
+
54
+ // include inline?
55
+ if( apply_filters('autoptimize_css_include_inline',$options['include_inline']) == true ) {
56
+ $this->include_inline = true;
57
+ }
58
+
59
+ // what CSS shouldn't be autoptimized
60
+ $excludeCSS = $options['css_exclude'];
61
+ $excludeCSS = apply_filters( 'autoptimize_filter_css_exclude', $excludeCSS );
62
+ if ($excludeCSS!=="") {
63
+ $this->dontmove = array_filter(array_map('trim',explode(",",$excludeCSS)));
64
+ } else {
65
+ $this->dontmove = "";
66
+ }
67
+
68
+ // should we defer css?
69
+ // value: true/ false
70
+ $this->defer = $options['defer'];
71
+ $this->defer = apply_filters( 'autoptimize_filter_css_defer', $this->defer );
72
+
73
+ // should we inline while deferring?
74
+ // value: inlined CSS
75
+ $this->defer_inline = $options['defer_inline'];
76
+ $this->defer_inline = apply_filters( 'autoptimize_filter_css_defer_inline', $this->defer_inline );
77
+
78
+ // should we inline?
79
+ // value: true/ false
80
+ $this->inline = $options['inline'];
81
+ $this->inline = apply_filters( 'autoptimize_filter_css_inline', $this->inline );
82
+
83
+ // get cdn url
84
+ $this->cdn_url = $options['cdn_url'];
85
+
86
+ // Store data: URIs setting for later use
87
+ $this->datauris = $options['datauris'];
88
+
89
+ // noptimize me
90
+ $this->content = $this->hide_noptimize($this->content);
91
+
92
+ // exclude (no)script, as those may contain CSS which should be left as is
93
+ if ( strpos( $this->content, '<script' ) !== false ) {
94
+ $this->content = preg_replace_callback(
95
+ '#<(?:no)?script.*?<\/(?:no)?script>#is',
96
+ create_function(
97
+ '$matches',
98
+ 'return "%%SCRIPT%%".base64_encode($matches[0])."%%SCRIPT%%";'
99
+ ),
100
+ $this->content
101
+ );
102
+ }
103
+
104
+ // Save IE hacks
105
+ $this->content = $this->hide_iehacks($this->content);
106
+
107
+ // hide comments
108
+ $this->content = $this->hide_comments($this->content);
109
+
110
+ // Get <style> and <link>
111
+ if(preg_match_all('#(<style[^>]*>.*</style>)|(<link[^>]*stylesheet[^>]*>)#Usmi',$this->content,$matches)) {
112
+ foreach($matches[0] as $tag) {
113
+ if ($this->isremovable($tag,$this->cssremovables)) {
114
+ $this->content = str_replace($tag,'',$this->content);
115
+ } else if ($this->ismovable($tag)) {
116
+ // Get the media
117
+ if(strpos($tag,'media=')!==false) {
118
+ preg_match('#media=(?:"|\')([^>]*)(?:"|\')#Ui',$tag,$medias);
119
+ $medias = explode(',',$medias[1]);
120
+ $media = array();
121
+ foreach($medias as $elem) {
122
+ if (empty($elem)) { $elem="all"; }
123
+ $media[] = $elem;
124
+ }
125
+ } else {
126
+ // No media specified - applies to all
127
+ $media = array('all');
128
+ }
129
+ $media = apply_filters( 'autoptimize_filter_css_tagmedia',$media,$tag );
130
+
131
+ if(preg_match('#<link.*href=("|\')(.*)("|\')#Usmi',$tag,$source)) {
132
+ // <link>
133
+ $url = current(explode('?',$source[2],2));
134
+ $path = $this->getpath($url);
135
+
136
+ if($path!==false && preg_match('#\.css$#',$path)) {
137
+ // Good link
138
+ $this->css[] = array($media,$path);
139
+ }else{
140
+ // Link is dynamic (.php etc)
141
+ $tag = '';
142
+ }
143
+ } else {
144
+ // inline css in style tags can be wrapped in comment tags, so restore comments
145
+ $tag = $this->restore_comments($tag);
146
+ preg_match('#<style.*>(.*)</style>#Usmi',$tag,$code);
147
+
148
+ // and re-hide them to be able to to the removal based on tag
149
+ $tag = $this->hide_comments($tag);
150
+
151
+ if ( $this->include_inline ) {
152
+ $code = preg_replace('#^.*<!\[CDATA\[(?:\s*\*/)?(.*)(?://|/\*)\s*?\]\]>.*$#sm','$1',$code[1]);
153
+ $this->css[] = array($media,'INLINE;'.$code);
154
+ } else {
155
+ $tag = '';
156
+ }
157
+ }
158
+
159
+ // Remove the original style tag
160
+ $this->content = str_replace($tag,'',$this->content);
161
+ }
162
+ }
163
+ return true;
164
+ }
165
+ // Really, no styles?
166
+ return false;
167
+ }
168
+
169
+ // Joins and optimizes CSS
170
+ public function minify() {
171
+ foreach($this->css as $group) {
172
+ list($media,$css) = $group;
173
+ if(preg_match('#^INLINE;#',$css)) {
174
+ // <style>
175
+ $css = preg_replace('#^INLINE;#','',$css);
176
+ $css = $this->fixurls(ABSPATH.'/index.php',$css);
177
+ $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, "" );
178
+ if ( has_filter('autoptimize_css_individual_style') && !empty($tmpstyle) ) {
179
+ $css=$tmpstyle;
180
+ $this->alreadyminified=true;
181
+ }
182
+ } else {
183
+ //<link>
184
+ if($css !== false && file_exists($css) && is_readable($css)) {
185
+ $cssPath = $css;
186
+ $css = $this->fixurls($cssPath,file_get_contents($cssPath));
187
+ $css = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$css);
188
+ $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, $cssPath );
189
+ if (has_filter('autoptimize_css_individual_style') && !empty($tmpstyle)) {
190
+ $css=$tmpstyle;
191
+ $this->alreadyminified=true;
192
+ } else if ($this->can_inject_late($cssPath,$css)) {
193
+ $css="%%INJECTLATER%%".base64_encode($cssPath)."|".md5($css)."%%INJECTLATER%%";
194
+ }
195
+ } else {
196
+ // Couldn't read CSS. Maybe getpath isn't working?
197
+ $css = '';
198
+ }
199
+ }
200
+
201
+ foreach($media as $elem) {
202
+ if(!isset($this->csscode[$elem]))
203
+ $this->csscode[$elem] = '';
204
+ $this->csscode[$elem] .= "\n/*FILESTART*/".$css;
205
+ }
206
+ }
207
+
208
+ // Check for duplicate code
209
+ $md5list = array();
210
+ $tmpcss = $this->csscode;
211
+ foreach($tmpcss as $media => $code) {
212
+ $md5sum = md5($code);
213
+ $medianame = $media;
214
+ foreach($md5list as $med => $sum) {
215
+ // If same code
216
+ if($sum === $md5sum) {
217
+ //Add the merged code
218
+ $medianame = $med.', '.$media;
219
+ $this->csscode[$medianame] = $code;
220
+ $md5list[$medianame] = $md5list[$med];
221
+ unset($this->csscode[$med], $this->csscode[$media]);
222
+ unset($md5list[$med]);
223
+ }
224
+ }
225
+ $md5list[$medianame] = $md5sum;
226
+ }
227
+ unset($tmpcss);
228
+
229
+ // Manage @imports, while is for recursive import management
230
+ foreach ($this->csscode as &$thiscss) {
231
+ // Flag to trigger import reconstitution and var to hold external imports
232
+ $fiximports = false;
233
+ $external_imports = "";
234
+
235
+ // remove comments to avoid importing commented-out imports
236
+ $thiscss_nocomments=preg_replace('#/\*.*\*/#Um','',$thiscss);
237
+ while(preg_match_all('#@import.*(?:;|$)#Um',$thiscss_nocomments,$matches)) {
238
+ foreach($matches[0] as $import) {
239
+ if ($this->isremovable($import,$this->cssremovables)) {
240
+ $thiscss = str_replace($import,'',$thiscss);
241
+ $import_ok = true;
242
+ } else {
243
+ $url = trim(preg_replace('#^.*((?:https?:|ftp:)?//.*\.css).*$#','$1',trim($import))," \t\n\r\0\x0B\"'");
244
+ $path = $this->getpath($url);
245
+ $import_ok = false;
246
+ if (file_exists($path) && is_readable($path)) {
247
+ $code = addcslashes($this->fixurls($path,file_get_contents($path)),"\\");
248
+ $code = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$code);
249
+ $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $code, "" );
250
+ if ( has_filter('autoptimize_css_individual_style') && !empty($tmpstyle)) {
251
+ $code=$tmpstyle;
252
+ $this->alreadyminified=true;
253
+ } else if ($this->can_inject_late($path,$code)) {
254
+ $code="%%INJECTLATER%%".base64_encode($path)."|".md5($code)."%%INJECTLATER%%";
255
+ }
256
+
257
+ if(!empty($code)) {
258
+ $tmp_thiscss = preg_replace('#(/\*FILESTART\*/.*)'.preg_quote($import,'#').'#Us','/*FILESTART2*/'.$code.'$1',$thiscss);
259
+ if (!empty($tmp_thiscss)) {
260
+ $thiscss = $tmp_thiscss;
261
+ $import_ok = true;
262
+ unset($tmp_thiscss);
263
+ }
264
+ unset($code);
265
+ }
266
+ }
267
+ }
268
+
269
+ if (!$import_ok) {
270
+ // external imports and general fall-back
271
+ $external_imports .= $import;
272
+ $thiscss = str_replace($import,'',$thiscss);
273
+ $fiximports = true;
274
+ }
275
+ }
276
+ $thiscss = preg_replace('#/\*FILESTART\*/#','',$thiscss);
277
+ $thiscss = preg_replace('#/\*FILESTART2\*/#','/*FILESTART*/',$thiscss);
278
+
279
+ // and update $thiscss_nocomments before going into next iteration in while loop
280
+ $thiscss_nocomments=preg_replace('#/\*.*\*/#Um','',$thiscss);
281
+ }
282
+ unset($thiscss_nocomments);
283
+
284
+ // add external imports to top of aggregated CSS
285
+ if($fiximports) {
286
+ $thiscss=$external_imports.$thiscss;
287
+ }
288
+ }
289
+ unset($thiscss);
290
+
291
+ // $this->csscode has all the uncompressed code now.
292
+ $mhtmlcount = 0;
293
+ foreach($this->csscode as &$code) {
294
+ // Check for already-minified code
295
+ $hash = md5($code);
296
+ $ccheck = new autoptimizeCache($hash,'css');
297
+ if($ccheck->check()) {
298
+ $code = $ccheck->retrieve();
299
+ $this->hashmap[md5($code)] = $hash;
300
+ continue;
301
+ }
302
+ unset($ccheck);
303
+
304
+ // Do the imaging!
305
+ $imgreplace = array();
306
+ preg_match_all('#(background[^;{}]*url\((?!\s?"?\'?\s?data)(.*)\)[^;}]*)(?:;|$|})#Usm',$code,$matches);
307
+
308
+ if(($this->datauris == true) && (function_exists('base64_encode')) && (is_array($matches))) {
309
+ foreach($matches[2] as $count => $quotedurl) {
310
+ $iurl = trim($quotedurl," \t\n\r\0\x0B\"'");
311
+
312
+ // if querystring, remove it from url
313
+ if (strpos($iurl,'?') !== false) { $iurl = strtok($iurl,'?'); }
314
+
315
+ $ipath = $this->getpath($iurl);
316
+
317
+ $datauri_max_size = 4096;
318
+ $datauri_max_size = (int) apply_filters( 'autoptimize_filter_css_datauri_maxsize', $datauri_max_size );
319
+ $datauri_exclude = apply_filters( 'autoptimize_filter_css_datauri_exclude', "");
320
+ if (!empty($datauri_exclude)) {
321
+ $no_datauris=array_filter(array_map('trim',explode(",",$datauri_exclude)));
322
+ foreach ($no_datauris as $no_datauri) {
323
+ if (strpos($iurl,$no_datauri)!==false) {
324
+ $ipath=false;
325
+ break;
326
+ }
327
+ }
328
+ }
329
+
330
+ if($ipath != false && preg_match('#\.(jpe?g|png|gif|bmp)$#i',$ipath) && file_exists($ipath) && is_readable($ipath) && filesize($ipath) <= $datauri_max_size) {
331
+ $ihash=md5($ipath);
332
+ $icheck = new autoptimizeCache($ihash,'img');
333
+ if($icheck->check()) {
334
+ // we have the base64 image in cache
335
+ $headAndData=$icheck->retrieve();
336
+ $_base64data=explode(";base64,",$headAndData);
337
+ $base64data=$_base64data[1];
338
+ } else {
339
+ // It's an image and we don't have it in cache, get the type
340
+ $explA=explode('.',$ipath);
341
+ $type=end($explA);
342
+
343
+ switch($type) {
344
+ case 'jpeg':
345
+ $dataurihead = 'data:image/jpeg;base64,';
346
+ break;
347
+ case 'jpg':
348
+ $dataurihead = 'data:image/jpeg;base64,';
349
+ break;
350
+ case 'gif':
351
+ $dataurihead = 'data:image/gif;base64,';
352
+ break;
353
+ case 'png':
354
+ $dataurihead = 'data:image/png;base64,';
355
+ break;
356
+ case 'bmp':
357
+ $dataurihead = 'data:image/bmp;base64,';
358
+ break;
359
+ default:
360
+ $dataurihead = 'data:application/octet-stream;base64,';
361
+ }
362
+
363
+ // Encode the data
364
+ $base64data = base64_encode(file_get_contents($ipath));
365
+ $headAndData=$dataurihead.$base64data;
366
+
367
+ // Save in cache
368
+ $icheck->cache($headAndData,"text/plain");
369
+ }
370
+ unset($icheck);
371
+
372
+ // Add it to the list for replacement
373
+ $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$headAndData,$matches[1][$count]).";\n*".str_replace($quotedurl,'mhtml:%%MHTML%%!'.$mhtmlcount,$matches[1][$count]).";\n_".$matches[1][$count].';';
374
+
375
+ // Store image on the mhtml document
376
+ $this->mhtml .= "--_\r\nContent-Location:{$mhtmlcount}\r\nContent-Transfer-Encoding:base64\r\n\r\n{$base64data}\r\n";
377
+ $mhtmlcount++;
378
+ } else {
379
+ // just cdn the URL if applicable
380
+ if (!empty($this->cdn_url)) {
381
+ $url = trim($quotedurl," \t\n\r\0\x0B\"'");
382
+ $cdn_url=$this->url_replace_cdn($url);
383
+ $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$cdn_url,$matches[1][$count]);
384
+ }
385
+ }
386
+ }
387
+ } else if ((is_array($matches)) && (!empty($this->cdn_url))) {
388
+ // change background image urls to cdn-url
389
+ foreach($matches[2] as $count => $quotedurl) {
390
+ $url = trim($quotedurl," \t\n\r\0\x0B\"'");
391
+ $cdn_url=$this->url_replace_cdn($url);
392
+ $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$cdn_url,$matches[1][$count]);
393
+ }
394
+ }
395
+
396
+ if(!empty($imgreplace)) {
397
+ $code = str_replace(array_keys($imgreplace),array_values($imgreplace),$code);
398
+ }
399
+
400
+ // CDN the fonts!
401
+ if ( (!empty($this->cdn_url)) && (apply_filters('autoptimize_filter_css_fonts_cdn',false)) && (version_compare(PHP_VERSION, '5.3.0') >= 0) ) {
402
+ $fontreplace = array();
403
+ include_once(AUTOPTIMIZE_PLUGIN_DIR.'classlesses/autoptimizeFontRegex.php');
404
+
405
+ preg_match_all($fonturl_regex,$code,$matches);
406
+ if (is_array($matches)) {
407
+ foreach($matches[8] as $count => $quotedurl) {
408
+ $url = trim($quotedurl," \t\n\r\0\x0B\"'");
409
+ $cdn_url=$this->url_replace_cdn($url);
410
+ $fontreplace[$matches[8][$count]] = str_replace($quotedurl,$cdn_url,$matches[8][$count]);
411
+ }
412
+ if(!empty($fontreplace)) {
413
+ $code = str_replace(array_keys($fontreplace),array_values($fontreplace),$code);
414
+ }
415
+ }
416
+ }
417
+
418
+ // Minify
419
+ if (($this->alreadyminified!==true) && (apply_filters( "autoptimize_css_do_minify", true))) {
420
+ if (class_exists('Minify_CSS_Compressor')) {
421
+ $tmp_code = trim(Minify_CSS_Compressor::process($code));
422
+ } else if(class_exists('CSSmin')) {
423
+ $cssmin = new CSSmin();
424
+ if (method_exists($cssmin,"run")) {
425
+ $tmp_code = trim($cssmin->run($code));
426
+ } elseif (@is_callable(array($cssmin,"minify"))) {
427
+ $tmp_code = trim(CssMin::minify($code));
428
+ }
429
+ }
430
+ if (!empty($tmp_code)) {
431
+ $code = $tmp_code;
432
+ unset($tmp_code);
433
+ }
434
+ }
435
+
436
+ $code = $this->inject_minified($code);
437
+
438
+ $tmp_code = apply_filters( 'autoptimize_css_after_minify',$code );
439
+ if (!empty($tmp_code)) {
440
+ $code = $tmp_code;
441
+ unset($tmp_code);
442
+ }
443
+
444
+ $this->hashmap[md5($code)] = $hash;
445
+ }
446
+ unset($code);
447
+ return true;
448
+ }
449
+
450
+ //Caches the CSS in uncompressed, deflated and gzipped form.
451
+ public function cache() {
452
+ if($this->datauris) {
453
+ // MHTML Preparation
454
+ $this->mhtml = "/*\r\nContent-Type: multipart/related; boundary=\"_\"\r\n\r\n".$this->mhtml."*/\r\n";
455
+ $md5 = md5($this->mhtml);
456
+ $cache = new autoptimizeCache($md5,'txt');
457
+ if(!$cache->check()) {
458
+ // Cache our images for IE
459
+ $cache->cache($this->mhtml,'text/plain');
460
+ }
461
+ $mhtml = AUTOPTIMIZE_CACHE_URL.$cache->getname();
462
+ }
463
+
464
+ // CSS cache
465
+ foreach($this->csscode as $media => $code) {
466
+ $md5 = $this->hashmap[md5($code)];
467
+
468
+ if($this->datauris) {
469
+ // Images for ie! Get the right url
470
+ $code = str_replace('%%MHTML%%',$mhtml,$code);
471
+ }
472
+
473
+ $cache = new autoptimizeCache($md5,'css');
474
+ if(!$cache->check()) {
475
+ // Cache our code
476
+ $cache->cache($code,'text/css');
477
+ }
478
+ $this->url[$media] = AUTOPTIMIZE_CACHE_URL.$cache->getname();
479
+ }
480
+ }
481
+
482
+ //Returns the content
483
+ public function getcontent() {
484
+ // restore IE hacks
485
+ $this->content = $this->restore_iehacks($this->content);
486
+
487
+ // restore comments
488
+ $this->content = $this->restore_comments($this->content);
489
+
490
+ // restore (no)script
491
+ if ( strpos( $this->content, '%%SCRIPT%%' ) !== false ) {
492
+ $this->content = preg_replace_callback(
493
+ '#%%SCRIPT%%(.*?)%%SCRIPT%%#is',
494
+ create_function(
495
+ '$matches',
496
+ 'return base64_decode($matches[1]);'
497
+ ),
498
+ $this->content
499
+ );
500
+ }
501
+
502
+ // restore noptimize
503
+ $this->content = $this->restore_noptimize($this->content);
504
+
505
+ //Restore the full content
506
+ if(!empty($this->restofcontent)) {
507
+ $this->content .= $this->restofcontent;
508
+ $this->restofcontent = '';
509
+ }
510
+
511
+ // Inject the new stylesheets
512
+ $replaceTag = array("<title","before");
513
+ $replaceTag = apply_filters( 'autoptimize_filter_css_replacetag', $replaceTag );
514
+
515
+ if ($this->inline == true) {
516
+ foreach($this->csscode as $media => $code) {
517
+ $this->inject_in_html('<style type="text/css" media="'.$media.'">'.$code.'</style>',$replaceTag);
518
+ }
519
+ } else {
520
+ if ($this->defer == true) {
521
+ $deferredCssBlock = "<script data-cfasync='false'>function lCss(url,media) {var d=document;var l=d.createElement('link');l.rel='stylesheet';l.type='text/css';l.href=url;l.media=media;aoin=d.getElementById('aonoscrcss');aoin.parentNode.insertBefore(l,aoin.nextSibling);}function deferredCSS() {";
522
+ $noScriptCssBlock = "<noscript id=\"aonoscrcss\">";
523
+ $defer_inline_code=$this->defer_inline;
524
+ if(!empty($defer_inline_code)){
525
+ if ( apply_filters( 'autoptimize_filter_css_critcss_minify',true ) ) {
526
+ $iCssHash=md5($defer_inline_code);
527
+ $iCssCache = new autoptimizeCache($iCssHash,'css');
528
+ if($iCssCache->check()) {
529
+ // we have the optimized inline CSS in cache
530
+ $defer_inline_code=$iCssCache->retrieve();
531
+ } else {
532
+ if (class_exists('Minify_CSS_Compressor')) {
533
+ $tmp_code = trim(Minify_CSS_Compressor::process($defer_inline_code));
534
+ } else if(class_exists('CSSmin')) {
535
+ $cssmin = new CSSmin();
536
+ $tmp_code = trim($cssmin->run($defer_inline_code));
537
+ }
538
+ if (!empty($tmp_code)) {
539
+ $defer_inline_code = $tmp_code;
540
+ $iCssCache->cache($defer_inline_code,"text/css");
541
+ unset($tmp_code);
542
+ }
543
+ }
544
+ }
545
+ $code_out='<style type="text/css" id="aoatfcss" media="all">'.$defer_inline_code.'</style>';
546
+ $this->inject_in_html($code_out,$replaceTag);
547
+ }
548
+ }
549
+
550
+ foreach($this->url as $media => $url) {
551
+ $url = $this->url_replace_cdn($url);
552
+
553
+ //Add the stylesheet either deferred (import at bottom) or normal links in head
554
+ if($this->defer == true) {
555
+ $deferredCssBlock .= "lCss('".$url."','".$media."');";
556
+ $noScriptCssBlock .= '<link type="text/css" media="'.$media.'" href="'.$url.'" rel="stylesheet" />';
557
+ } else {
558
+ if (strlen($this->csscode[$media]) > $this->cssinlinesize) {
559
+ $this->inject_in_html('<link type="text/css" media="'.$media.'" href="'.$url.'" rel="stylesheet" />',$replaceTag);
560
+ } else if (strlen($this->csscode[$media])>0) {
561
+ $this->inject_in_html('<style type="text/css" media="'.$media.'">'.$this->csscode[$media].'</style>',$replaceTag);
562
+ }
563
+ }
564
+ }
565
+
566
+ if($this->defer == true) {
567
+ $deferredCssBlock .= "}if(window.addEventListener){window.addEventListener('DOMContentLoaded',deferredCSS,false);}else{window.onload = deferredCSS;}</script>";
568
+ $noScriptCssBlock .= "</noscript>";
569
+ $this->inject_in_html($noScriptCssBlock,$replaceTag);
570
+ $this->inject_in_html($deferredCssBlock,array('</body>','before'));
571
+ }
572
+ }
573
+
574
+ //Return the modified stylesheet
575
+ return $this->content;
576
+ }
577
+
578
+ static function fixurls($file,$code) {
579
+ $file = str_replace(WP_ROOT_DIR,'/',$file);
580
+ $dir = dirname($file); //Like /wp-content
581
+
582
+ // quick fix for import-troubles in e.g. arras theme
583
+ $code=preg_replace('#@import ("|\')(.+?)\.css("|\')#','@import url("${2}.css")',$code);
584
+
585
+ if(preg_match_all('#url\((?!data)(?!\#)(?!"\#)(.*)\)#Usi',$code,$matches)) {
586
+ $replace = array();
587
+ foreach($matches[1] as $k => $url) {
588
+ // Remove quotes
589
+ $url = trim($url," \t\n\r\0\x0B\"'");
590
+ $noQurl = trim($url,"\"'");
591
+ if ($url!==$noQurl) {
592
+ $removedQuotes=true;
593
+ } else {
594
+ $removedQuotes=false;
595
+ }
596
+ $url=$noQurl;
597
+ if(substr($url,0,1)=='/' || preg_match('#^(https?://|ftp://|data:)#i',$url)) {
598
+ //URL is absolute
599
+ continue;
600
+ } else {
601
+ // relative URL
602
+ $newurl = preg_replace('/https?:/','',str_replace(" ","%20",AUTOPTIMIZE_WP_ROOT_URL.str_replace('//','/',$dir.'/'.$url)));
603
+
604
+ $hash = md5($url);
605
+ $code = str_replace($matches[0][$k],$hash,$code);
606
+
607
+ if (!empty($removedQuotes)) {
608
+ $replace[$hash] = 'url(\''.$newurl.'\')';
609
+ } else {
610
+ $replace[$hash] = 'url('.$newurl.')';
611
+ }
612
+ }
613
+ }
614
+ //Do the replacing here to avoid breaking URLs
615
+ $code = str_replace(array_keys($replace),array_values($replace),$code);
616
+ }
617
+ return $code;
618
+ }
619
+
620
+ private function ismovable($tag) {
621
+ if (!empty($this->whitelist)) {
622
+ foreach ($this->whitelist as $match) {
623
+ if(strpos($tag,$match)!==false) {
624
+ return true;
625
+ }
626
+ }
627
+ // no match with whitelist
628
+ return false;
629
+ } else {
630
+ if (is_array($this->dontmove)) {
631
+ foreach($this->dontmove as $match) {
632
+ if(strpos($tag,$match)!==false) {
633
+ //Matched something
634
+ return false;
635
+ }
636
+ }
637
+ }
638
+
639
+ //If we're here it's safe to move
640
+ return true;
641
+ }
642
+ }
643
+
644
+ private function can_inject_late($cssPath,$css) {
645
+ if ((strpos($cssPath,"min.css")===false) || ($this->inject_min_late!==true)) {
646
+ // late-inject turned off or file not minified based on filename
647
+ return false;
648
+ } else if (strpos($css,"@import")!==false) {
649
+ // can't late-inject files with imports as those need to be aggregated
650
+ return false;
651
+ } else if ( (strpos($css,"@font-face")!==false ) && ( apply_filters("autoptimize_filter_css_fonts_cdn",false)===true) && (!empty($this->cdn_url)) ) {
652
+ // don't late-inject CSS with font-src's if fonts are set to be CDN'ed
653
+ return false;
654
+ } else if ( (($this->datauris == true) || (!empty($this->cdn_url))) && preg_match("#background[^;}]*url\(#Ui",$css) ) {
655
+ // don't late-inject CSS with images if CDN is set OR is image inlining is on
656
+ return false;
657
+ } else {
658
+ // phew, all is safe, we can late-inject
659
+ return true;
660
+ }
661
+ }
662
+ }
classes/autoptimizeToolbar.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class autoptimizeToolbar {
5
+
6
+ public function __construct()
7
+ {
8
+ // If Cache is not available we don't add the Autoptimize Toolbar
9
+ if( !autoptimizeCache::cacheavail() ) return;
10
+
11
+ // Load admin toolbar feature once WordPress, all plugins, and the theme are fully loaded and instantiated.
12
+ add_action( 'wp_loaded', array( $this, 'load_toolbar' ) );
13
+ }
14
+
15
+ public function load_toolbar()
16
+ {
17
+ // We check that the current user has the appropriate permissions
18
+ if( current_user_can( 'manage_options' ) && apply_filters( 'autoptimize_filter_toolbar_show', true ) )
19
+ {
20
+ // Load custom styles and scripts
21
+ if( is_admin() ) {
22
+ // in the case of back-end
23
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
24
+ } else {
25
+ // in the case of front-end
26
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
27
+ }
28
+
29
+ // Create a handler for the AJAX toolbar requests
30
+ add_action( 'wp_ajax_autoptimize_delete_cache', array( $this, 'delete_cache' ) );
31
+
32
+ // Add the Autoptimize Toolbar to the Admin bar
33
+ add_action( 'admin_bar_menu', array($this, 'add_toolbar'), 100 );
34
+ }
35
+ }
36
+
37
+ public function add_toolbar()
38
+ {
39
+ global $wp_admin_bar;
40
+
41
+ // Retrieve the Autoptimize Cache Stats information
42
+ $stats = autoptimizeCache::stats();
43
+
44
+ // Set the Max Size recommended for cache files
45
+ $max_size = apply_filters('autoptimize_filter_cachecheck_maxsize', 512 * 1024 * 1024);
46
+
47
+ // Retrieve the current Total Files in cache
48
+ $files = $stats[0];
49
+ // Retrieve the current Total Size of the cache
50
+ $bytes = $stats[1];
51
+
52
+ $size = $this->format_filesize($bytes);
53
+
54
+ // We calculated the percentage of cache used
55
+ $percentage = ceil( $bytes / $max_size * 100 );
56
+ if( $percentage > 100 ) $percentage = 100;
57
+
58
+ // We define the type of color indicator for the current state of cache size.
59
+ // "green" if the size is less than 80% of the total recommended
60
+ // "orange" if over 80%
61
+ // "red" if over 100%
62
+ $color = ( $percentage == 100 ) ? 'red' : ( ( $percentage > 80 ) ? 'orange' : 'green' );
63
+
64
+ // Create or add new items into the Admin Toolbar.
65
+ // Main Autoptimize node
66
+ $wp_admin_bar->add_node( array(
67
+ 'id' => 'autoptimize',
68
+ 'title' => '<span class="ab-icon"></span><span class="ab-label">' . __("Autoptimize",'autoptimize') . '</span>',
69
+ 'href' => admin_url( 'options-general.php?page=autoptimize' ),
70
+ 'meta' => array( 'class' => 'bullet-' . $color )
71
+ ));
72
+
73
+ // Cache Info node
74
+ $wp_admin_bar->add_node( array(
75
+ 'id' => 'autoptimize-cache-info',
76
+ 'title' => '<p>' . __( "Cache Info", 'autoptimize' ) . '</p>' .
77
+ '<div class="autoptimize-radial-bar" percentage="' . $percentage . '">' .
78
+ '<div class="circle">'.
79
+ '<div class="mask full"><div class="fill bg-' . $color . '"></div></div>'.
80
+ '<div class="mask half"><div class="fill bg-' . $color . '"></div></div>'.
81
+ '<div class="shadow"></div>'.
82
+ '</div>'.
83
+ '<div class="inset"><div class="percentage"><div class="numbers ' . $color . '">' . $percentage . '%</div></div></div>'.
84
+ '</div>' .
85
+ '<table>' .
86
+ '<tr><td>' . __( "Size", 'autoptimize' ) . ':</td><td class="size ' . $color . '">' . $size . '</td></tr>' .
87
+ '<tr><td>' . __( "Files", 'autoptimize' ) . ':</td><td class="files white">' . $files . '</td></tr>' .
88
+ '</table>',
89
+ 'parent'=> 'autoptimize'
90
+ ));
91
+
92
+ // Delete Cache node
93
+ $wp_admin_bar->add_node( array(
94
+ 'id' => 'autoptimize-delete-cache',
95
+ 'title' => __("Delete Cache",'autoptimize'),
96
+ 'parent'=> 'autoptimize'
97
+ ));
98
+ }
99
+
100
+ public function delete_cache()
101
+ {
102
+ check_ajax_referer( 'ao_delcache_nonce', 'nonce' );
103
+ if( current_user_can( 'manage_options' ))
104
+ {
105
+ // We call the function for cleaning the Autoptimize cache
106
+ autoptimizeCache::clearall();
107
+ }
108
+
109
+ wp_die();
110
+ // NOTE: Remember that any return values of this function must be in JSON format
111
+ }
112
+
113
+ public function enqueue_scripts()
114
+ {
115
+ // Autoptimize Toolbar Styles
116
+ wp_enqueue_style( 'autoptimize-toolbar', plugins_url('/static/toolbar.css', __FILE__ ), array(), time(), "all" );
117
+
118
+ // Autoptimize Toolbar Javascript
119
+ wp_enqueue_script( 'autoptimize-toolbar', plugins_url( '/static/toolbar.js', __FILE__ ), array('jquery'), time(), true );
120
+
121
+ // Localizes a registered script with data for a JavaScript variable. (We need this for the AJAX work properly in the front-end mode)
122
+ wp_localize_script( 'autoptimize-toolbar', 'autoptimize_ajax_object', array(
123
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
124
+ 'error_msg' => __( 'Your Autoptimize cache might not have been purged successfully, please check on the <a href=' . admin_url( 'options-general.php?page=autoptimize' ) . ' style="white-space:nowrap;">Autoptimize settings page</a>.', 'autoptimize' ),
125
+ 'dismiss_msg' => __( 'Dismiss this notice.' ),
126
+ 'nonce' => wp_create_nonce( 'ao_delcache_nonce' )
127
+ ) );
128
+ }
129
+
130
+ public function format_filesize($bytes, $decimals = 2)
131
+ {
132
+ $units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' );
133
+ for ($i = 0; ($bytes / 1024) > 0.9; $i++, $bytes /= 1024) {}
134
+ return sprintf( "%1.{$decimals}f %s", round( $bytes, $decimals ), $units[$i] );
135
+ }
136
+ }
classes/external/js/unslider-min.js CHANGED
@@ -1 +1 @@
1
- !function($){return $?($.Unslider=function(t,n){var e=this;return e._="unslider",e.defaults={autoplay:!1,delay:3e3,speed:750,easing:"swing",keys:{prev:37,next:39},nav:!0,arrows:{prev:'<a class="'+e._+'-arrow prev">←</a>',next:'<a class="'+e._+'-arrow next">→</a>'},animation:"horizontal",selectors:{container:"ul:first",slides:"li"},animateHeight:!1,activeClass:e._+"-active"},e.$context=t,e.options={},e.$parent=null,e.$container=null,e.$slides=null,e.$nav=null,e.$arrows=[],e.total=0,e.current=0,e.prefix=e._+"-",e.eventSuffix="."+e.prefix+~~(2e3*Math.random()),e.interval=null,e.init=function(t){return e.options=$.extend({},e.defaults,t),e.$container=e.$context.find(e.options.selectors.container).addClass(e.prefix+"wrap"),e.$slides=e.$container.children(e.options.selectors.slides),e.setup(),["nav","arrows","keys","infinite"].forEach(function(t){e.options[t]&&e["init"+$._ucfirst(t)]()}),void 0!==typeof jQuery.event.special.swipe&&e.initSwipe(),e.options.autoplay&&e.start(),e.calculateSlides(),e.$context.trigger(e._+".ready"),e.animate(e.options.index||e.current,"init")},e.setup=function(){e.$context.addClass(e.prefix+"slider "+e.prefix+e.options.animation).wrap('<div class="'+e._+'" />'),e.$parent=e.$context.parent("."+e._);var t=e.$context.css("position");"static"===t&&e.$context.css("position","relative"),e.$context.css("overflow","hidden")},e.calculateSlides=function(){e.total=e.$slides.length,"fade"!==e.options.animation&&(e.$container.css("width",100*e.total+"%").addClass(e.prefix+"carousel"),e.$slides.css("width",100/e.total+"%"))},e.start=function(){return e.interval=setTimeout(function(){e.next(),e.start()},e.options.delay),e},e.stop=function(){return clearTimeout(e.interval),e},e.initNav=function(){var t=$('<nav class="'+e.prefix+'nav"><ol /></nav>');e.$slides.each(function(n){var i=this.getAttribute("data-nav")||n+1;$.isFunction(e.options.nav)&&(i=e.options.nav.call(e.$slides.eq(n),n,i)),t.children("ol").append('<li data-slide="'+n+'">'+i+"</li>")}),e.$nav=t.insertAfter(e.$context),e.$nav.find("li").on("click"+e.eventSuffix,function(){var t=$(this).addClass(e.options.activeClass);t.siblings().removeClass(e.options.activeClass),e.animate(t.attr("data-slide"))})},e.initArrows=function(){e.options.arrows===!0&&(e.options.arrows=e.defaults.arrows),$.each(e.options.arrows,function(t,n){e.$arrows.push($(n).insertAfter(e.$context).on("click"+e.eventSuffix,e[t]))})},e.initKeys=function(){e.options.keys===!0&&(e.options.keys=e.defaults.keys),$(document).on("keyup"+e.eventSuffix,function(t){$.each(e.options.keys,function(n,i){t.which===i&&$.isFunction(e[n])&&e[n].call(e)})})},e.initSwipe=function(){var t=e.$slides.width();e.$container.on({swipeleft:e.next,swiperight:e.prev,movestart:function(t){return t.distX>t.distY&&t.distX<-t.distY||t.distX<t.distY&&t.distX>-t.distY?!!t.preventDefault():void e.$container.css("position","relative")}}),"fade"!==e.options.animation&&e.$container.on({move:function(n){e.$container.css("left",100*n.distX/t+"%")},moveend:function(){e.$container.animate({left:0},200)}})},e.initInfinite=function(){var t=["first","last"];t.forEach(function(n,i){e.$slides.push.apply(e.$slides,e.$slides.filter(':not(".'+e._+'-cloned")')[n]().clone().addClass(e._+"-cloned")["insert"+(0===i?"After":"Before")](e.$slides[t[~~!i]]()))}),e.$container.css("margin-left","-100%")},e.destroyArrows=function(){e.$arrows.forEach(function(t){t.remove()})},e.destroySwipe=function(){e.$container.off("movestart swipeleft move moveend").css("left",0)},e.destroyKeys=function(){$(document).off("keyup"+e.eventSuffix)},e.setIndex=function(t){return 0>t&&(t=e.total-1),e.current=Math.min(Math.max(0,t),e.total-1),e.options.nav&&e.$nav.find('[data-slide="'+e.current+'"]')._toggleActive(e.options.activeClass),e.$slides.eq(e.current)._toggleActive(e.options.activeClass),e},e.animate=function(t,n){if("first"===t&&(t=0),"last"===t&&(t=e.total),isNaN(t))return e;e.options.autoplay&&e.stop().start(),e.setIndex(t),e.$context.trigger(e._+".change",[t,e.$slides.eq(t)]);var i="animate"+$._ucfirst(e.options.animation);return $.isFunction(e[i])&&e[i](e.current,n),e},e.next=function(){var t=e.current+1;return t>=e.total&&(t=0),e.animate(t,"next")},e.prev=function(){return e.animate(e.current-1,"prev")},e.animateHorizontal=function(t){if(e.options.animateHeight&&e._move(e.$context,{height:e.$slides.eq(t).height()},!1),e.options.infinite){var n;t===e.total-1&&(n=e.total-3,t=-1),t===e.total-2&&(n=0,t=e.total-2),"number"==typeof n&&(e.setIndex(n),e.$context.on(e._+".moved",function(){e.current===n&&e.$container.css("left",-(100*n)+"%").off(e._+".moved")}))}return e._move(e.$container,{left:-(100*t)+"%"})},e.animateFade=function(t,n){var i=e.$slides.eq(t).addClass(e.options.activeClass);e._move(i.siblings().removeClass(e.options.activeClass),{opacity:0}),e._move(i,{opacity:1},!1)},e._move=function(t,n,i){return i!==!1&&(i=function(){e.$context.trigger(e._+".moved")}),t._move(n,e.options.speed,e.options.easing,i)},e.init(n)},$.fn._toggleActive=function(t){return this.addClass(t).siblings().removeClass(t)},$._ucfirst=function(t){return t.toString().toLowerCase().replace(/^./,function(t){return t.toUpperCase()})},$.fn._move=function(){return this.stop(!0,!0),$.fn.velocity?$.fn.velocity.apply(this,arguments):$.fn.animate.apply(this,arguments)},void($.fn.unslider=function(t){return this.each(function(){var n=$(this);if("string"==typeof t&&n.data("unslider")){t=t.split(":");var e=t[0],i=n.data("unslider")[e];if(t[1]){var o=t[1].split(",");return $.isFunction(i)&&i.apply(n,o)}return $.isFunction(i)&&i()}return n.data("unslider",new $.Unslider(n,t))})})):console.warn("Unslider needs jQuery")}(window.jQuery);
1
+ !function($){return $?($.Unslider=function(t,n){var e=this;return e._="unslider",e.defaults={autoplay:!1,delay:3e3,speed:750,easing:"swing",keys:{prev:37,next:39},nav:!0,arrows:{prev:'<a class="'+e._+'-arrow prev">Prev</a>',next:'<a class="'+e._+'-arrow next">Next</a>'},animation:"horizontal",selectors:{container:"ul:first",slides:"li"},animateHeight:!1,activeClass:e._+"-active",swipe:!0,swipeThreshold:.2},e.$context=t,e.options={},e.$parent=null,e.$container=null,e.$slides=null,e.$nav=null,e.$arrows=[],e.total=0,e.current=0,e.prefix=e._+"-",e.eventSuffix="."+e.prefix+~~(2e3*Math.random()),e.interval=null,e.init=function(t){return e.options=$.extend({},e.defaults,t),e.$container=e.$context.find(e.options.selectors.container).addClass(e.prefix+"wrap"),e.$slides=e.$container.children(e.options.selectors.slides),e.setup(),$.each(["nav","arrows","keys","infinite"],function(t,n){e.options[n]&&e["init"+$._ucfirst(n)]()}),jQuery.event.special.swipe&&e.options.swipe&&e.initSwipe(),e.options.autoplay&&e.start(),e.calculateSlides(),e.$context.trigger(e._+".ready"),e.animate(e.options.index||e.current,"init")},e.setup=function(){e.$context.addClass(e.prefix+e.options.animation).wrap('<div class="'+e._+'" />'),e.$parent=e.$context.parent("."+e._);var t=e.$context.css("position");"static"===t&&e.$context.css("position","relative"),e.$context.css("overflow","hidden")},e.calculateSlides=function(){if(e.total=e.$slides.length,"fade"!==e.options.animation){var t="width";"vertical"===e.options.animation&&(t="height"),e.$container.css(t,100*e.total+"%").addClass(e.prefix+"carousel"),e.$slides.css(t,100/e.total+"%")}},e.start=function(){return e.interval=setTimeout(function(){e.next()},e.options.delay),e},e.stop=function(){return clearTimeout(e.interval),e},e.initNav=function(){var t=$('<nav class="'+e.prefix+'nav"><ol /></nav>');e.$slides.each(function(n){var i=this.getAttribute("data-nav")||n+1;$.isFunction(e.options.nav)&&(i=e.options.nav.call(e.$slides.eq(n),n,i)),t.children("ol").append('<li data-slide="'+n+'">'+i+"</li>")}),e.$nav=t.insertAfter(e.$context),e.$nav.find("li").on("click"+e.eventSuffix,function(){var t=$(this).addClass(e.options.activeClass);t.siblings().removeClass(e.options.activeClass),e.animate(t.attr("data-slide"))})},e.initArrows=function(){e.options.arrows===!0&&(e.options.arrows=e.defaults.arrows),$.each(e.options.arrows,function(t,n){e.$arrows.push($(n).insertAfter(e.$context).on("click"+e.eventSuffix,e[t]))})},e.initKeys=function(){e.options.keys===!0&&(e.options.keys=e.defaults.keys),$(document).on("keyup"+e.eventSuffix,function(t){$.each(e.options.keys,function(n,i){t.which===i&&$.isFunction(e[n])&&e[n].call(e)})})},e.initSwipe=function(){var t=e.$slides.width();"fade"!==e.options.animation&&e.$container.on({movestart:function(t){return t.distX>t.distY&&t.distX<-t.distY||t.distX<t.distY&&t.distX>-t.distY?!!t.preventDefault():void e.$container.css("position","relative")},move:function(n){e.$container.css("left",-(100*e.current)+100*n.distX/t+"%")},moveend:function(n){Math.abs(n.distX)/t>e.options.swipeThreshold?e[n.distX<0?"next":"prev"]():e.$container.animate({left:-(100*e.current)+"%"},e.options.speed/2)}})},e.initInfinite=function(){var t=["first","last"];$.each(t,function(n,i){e.$slides.push.apply(e.$slides,e.$slides.filter(':not(".'+e._+'-clone")')[i]().clone().addClass(e._+"-clone")["insert"+(0===n?"After":"Before")](e.$slides[t[~~!n]]()))})},e.destroyArrows=function(){$.each(e.$arrows,function(t,n){n.remove()})},e.destroySwipe=function(){e.$container.off("movestart move moveend")},e.destroyKeys=function(){$(document).off("keyup"+e.eventSuffix)},e.setIndex=function(t){return 0>t&&(t=e.total-1),e.current=Math.min(Math.max(0,t),e.total-1),e.options.nav&&e.$nav.find('[data-slide="'+e.current+'"]')._active(e.options.activeClass),e.$slides.eq(e.current)._active(e.options.activeClass),e},e.animate=function(t,n){if("first"===t&&(t=0),"last"===t&&(t=e.total),isNaN(t))return e;e.options.autoplay&&e.stop().start(),e.setIndex(t),e.$context.trigger(e._+".change",[t,e.$slides.eq(t)]);var i="animate"+$._ucfirst(e.options.animation);return $.isFunction(e[i])&&e[i](e.current,n),e},e.next=function(){var t=e.current+1;return t>=e.total&&(t=0),e.animate(t,"next")},e.prev=function(){return e.animate(e.current-1,"prev")},e.animateHorizontal=function(t){var n="left";return"rtl"===e.$context.attr("dir")&&(n="right"),e.options.infinite&&e.$container.css("margin-"+n,"-100%"),e.slide(n,t)},e.animateVertical=function(t){return e.options.animateHeight=!0,e.options.infinite&&e.$container.css("margin-top",-e.$slides.outerHeight()),e.slide("top",t)},e.slide=function(t,n){if(e.options.animateHeight&&e._move(e.$context,{height:e.$slides.eq(n).outerHeight()},!1),e.options.infinite){var i;n===e.total-1&&(i=e.total-3,n=-1),n===e.total-2&&(i=0,n=e.total-2),"number"==typeof i&&(e.setIndex(i),e.$context.on(e._+".moved",function(){e.current===i&&e.$container.css(t,-(100*i)+"%").off(e._+".moved")}))}var o={};return o[t]=-(100*n)+"%",e._move(e.$container,o)},e.animateFade=function(t){var n=e.$slides.eq(t).addClass(e.options.activeClass);e._move(n.siblings().removeClass(e.options.activeClass),{opacity:0}),e._move(n,{opacity:1},!1)},e._move=function(t,n,i,o){return i!==!1&&(i=function(){e.$context.trigger(e._+".moved")}),t._move(n,o||e.options.speed,e.options.easing,i)},e.init(n)},$.fn._active=function(t){return this.addClass(t).siblings().removeClass(t)},$._ucfirst=function(t){return(t+"").toLowerCase().replace(/^./,function(t){return t.toUpperCase()})},$.fn._move=function(){return this.stop(!0,!0),$.fn[$.fn.velocity?"velocity":"animate"].apply(this,arguments)},void($.fn.unslider=function(t){return this.each(function(){var n=$(this);if("string"==typeof t&&n.data("unslider")){t=t.split(":");var e=n.data("unslider")[t[0]];if($.isFunction(e))return e.apply(n,t[1]?t[1].split(","):null)}return n.data("unslider",new $.Unslider(n,t))})})):console.warn("Unslider needs jQuery")}(window.jQuery);
classes/external/js/unslider.css CHANGED
@@ -1 +1 @@
1
- .unslider{overflow:auto}.unslider-wrap{position:relative}.unslider-wrap.unslider-carousel li{float:left}.unslider-fade{position:relative}.unslider-fade .unslider-wrap li{position:absolute;left:0;top:0;right:0;z-index:8}.unslider-fade .unslider-wrap li.unslider-active{z-index:10}.unslider li{list-style:none;margin:0;padding:0;border:none}.unslider-arrow{position:absolute;left:20px;z-index:2;cursor:pointer}.unslider-arrow.next{left:auto;right:20px}
1
+ .unslider{overflow:auto;margin:0;padding:0}.unslider-wrap{position:relative}.unslider-wrap.unslider-carousel>li{float:left}.unslider-vertical>ul{height:100%}.unslider-vertical li{float:none;width:100%}.unslider-fade{position:relative}.unslider-fade .unslider-wrap li{position:absolute;left:0;top:0;right:0;z-index:8}.unslider-fade .unslider-wrap li.unslider-active{z-index:10}.unslider li,.unslider ol,.unslider ul{list-style:none;margin:0;padding:0;border:none}.unslider-arrow{position:absolute;left:20px;z-index:2;cursor:pointer}.unslider-arrow.next{left:auto;right:20px}
classes/external/php/minify-2.3.1-jsmin.php ADDED
@@ -0,0 +1,457 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JSMin.php - modified PHP implementation of Douglas Crockford's JSMin.
4
+ *
5
+ * <code>
6
+ * $minifiedJs = JSMin::minify($js);
7
+ * </code>
8
+ *
9
+ * This is a modified port of jsmin.c. Improvements:
10
+ *
11
+ * Does not choke on some regexp literals containing quote characters. E.g. /'/
12
+ *
13
+ * Spaces are preserved after some add/sub operators, so they are not mistakenly
14
+ * converted to post-inc/dec. E.g. a + ++b -> a+ ++b
15
+ *
16
+ * Preserves multi-line comments that begin with /*!
17
+ *
18
+ * PHP 5 or higher is required.
19
+ *
20
+ * Permission is hereby granted to use this version of the library under the
21
+ * same terms as jsmin.c, which has the following license:
22
+ *
23
+ * --
24
+ * Copyright (c) 2002 Douglas Crockford (www.crockford.com)
25
+ *
26
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
27
+ * this software and associated documentation files (the "Software"), to deal in
28
+ * the Software without restriction, including without limitation the rights to
29
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
30
+ * of the Software, and to permit persons to whom the Software is furnished to do
31
+ * so, subject to the following conditions:
32
+ *
33
+ * The above copyright notice and this permission notice shall be included in all
34
+ * copies or substantial portions of the Software.
35
+ *
36
+ * The Software shall be used for Good, not Evil.
37
+ *
38
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44
+ * SOFTWARE.
45
+ * --
46
+ *
47
+ * @package JSMin
48
+ * @author Ryan Grove <ryan@wonko.com> (PHP port)
49
+ * @author Steve Clay <steve@mrclay.org> (modifications + cleanup)
50
+ * @author Andrea Giammarchi <http://www.3site.eu> (spaceBeforeRegExp)
51
+ * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
52
+ * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
53
+ * @license http://opensource.org/licenses/mit-license.php MIT License
54
+ * @link http://code.google.com/p/jsmin-php/
55
+ */
56
+
57
+ class JSMin {
58
+ const ORD_LF = 10;
59
+ const ORD_SPACE = 32;
60
+ const ACTION_KEEP_A = 1;
61
+ const ACTION_DELETE_A = 2;
62
+ const ACTION_DELETE_A_B = 3;
63
+
64
+ protected $a = "\n";
65
+ protected $b = '';
66
+ protected $input = '';
67
+ protected $inputIndex = 0;
68
+ protected $inputLength = 0;
69
+ protected $lookAhead = null;
70
+ protected $output = '';
71
+ protected $lastByteOut = '';
72
+ protected $keptComment = '';
73
+
74
+ /**
75
+ * Minify Javascript.
76
+ *
77
+ * @param string $js Javascript to be minified
78
+ *
79
+ * @return string
80
+ */
81
+ public static function minify($js)
82
+ {
83
+ $jsmin = new JSMin($js);
84
+ return $jsmin->min();
85
+ }
86
+
87
+ /**
88
+ * @param string $input
89
+ */
90
+ public function __construct($input)
91
+ {
92
+ $this->input = $input;
93
+ }
94
+
95
+ /**
96
+ * Perform minification, return result
97
+ *
98
+ * @return string
99
+ */
100
+ public function min()
101
+ {
102
+ if ($this->output !== '') { // min already run
103
+ return $this->output;
104
+ }
105
+
106
+ $mbIntEnc = null;
107
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
108
+ $mbIntEnc = mb_internal_encoding();
109
+ mb_internal_encoding('8bit');
110
+ }
111
+
112
+ if (isset($this->input[0]) && $this->input[0] === "\xef") {
113
+ $this->input = substr($this->input, 3);
114
+ }
115
+
116
+ $this->input = str_replace("\r\n", "\n", $this->input);
117
+ $this->inputLength = strlen($this->input);
118
+
119
+ $this->action(self::ACTION_DELETE_A_B);
120
+
121
+ while ($this->a !== null) {
122
+ // determine next command
123
+ $command = self::ACTION_KEEP_A; // default
124
+ if ($this->a === ' ') {
125
+ if (($this->lastByteOut === '+' || $this->lastByteOut === '-')
126
+ && ($this->b === $this->lastByteOut)) {
127
+ // Don't delete this space. If we do, the addition/subtraction
128
+ // could be parsed as a post-increment
129
+ } elseif (! $this->isAlphaNum($this->b)) {
130
+ $command = self::ACTION_DELETE_A;
131
+ }
132
+ } elseif ($this->a === "\n") {
133
+ if ($this->b === ' ') {
134
+ $command = self::ACTION_DELETE_A_B;
135
+
136
+ // in case of mbstring.func_overload & 2, must check for null b,
137
+ // otherwise mb_strpos will give WARNING
138
+ } elseif ($this->b === null
139
+ || (false === strpos('{[(+-!~', $this->b)
140
+ && ! $this->isAlphaNum($this->b))) {
141
+ $command = self::ACTION_DELETE_A;
142
+ }
143
+ } elseif (! $this->isAlphaNum($this->a)) {
144
+ if ($this->b === ' '
145
+ || ($this->b === "\n"
146
+ && (false === strpos('}])+-"\'', $this->a)))) {
147
+ $command = self::ACTION_DELETE_A_B;
148
+ }
149
+ }
150
+ $this->action($command);
151
+ }
152
+ $this->output = trim($this->output);
153
+
154
+ if ($mbIntEnc !== null) {
155
+ mb_internal_encoding($mbIntEnc);
156
+ }
157
+ return $this->output;
158
+ }
159
+
160
+ /**
161
+ * ACTION_KEEP_A = Output A. Copy B to A. Get the next B.
162
+ * ACTION_DELETE_A = Copy B to A. Get the next B.
163
+ * ACTION_DELETE_A_B = Get the next B.
164
+ *
165
+ * @param int $command
166
+ * @throws JSMin_UnterminatedRegExpException|JSMin_UnterminatedStringException
167
+ */
168
+ protected function action($command)
169
+ {
170
+ // make sure we don't compress "a + ++b" to "a+++b", etc.
171
+ if ($command === self::ACTION_DELETE_A_B
172
+ && $this->b === ' '
173
+ && ($this->a === '+' || $this->a === '-')) {
174
+ // Note: we're at an addition/substraction operator; the inputIndex
175
+ // will certainly be a valid index
176
+ if ($this->input[$this->inputIndex] === $this->a) {
177
+ // This is "+ +" or "- -". Don't delete the space.
178
+ $command = self::ACTION_KEEP_A;
179
+ }
180
+ }
181
+
182
+ switch ($command) {
183
+ case self::ACTION_KEEP_A: // 1
184
+ $this->output .= $this->a;
185
+
186
+ if ($this->keptComment) {
187
+ $this->output = rtrim($this->output, "\n");
188
+ $this->output .= $this->keptComment;
189
+ $this->keptComment = '';
190
+ }
191
+
192
+ $this->lastByteOut = $this->a;
193
+
194
+ // fallthrough intentional
195
+ case self::ACTION_DELETE_A: // 2
196
+ $this->a = $this->b;
197
+ if ($this->a === "'" || $this->a === '"' || $this->a === '`') { // string/template literal
198
+ $delimiter = $this->a;
199
+ $str = $this->a; // in case needed for exception
200
+ for(;;) {
201
+ $this->output .= $this->a;
202
+ $this->lastByteOut = $this->a;
203
+ $this->a = $this->get();
204
+ if ($this->a === $this->b) { // end quote
205
+ break;
206
+ }
207
+ if ($delimiter === '`' && $this->a === "\n") {
208
+ // leave the newline
209
+ } elseif ($this->isEOF($this->a)) {
210
+ $byte = $this->inputIndex - 1;
211
+ throw new JSMin_UnterminatedStringException(
212
+ "JSMin: Unterminated String at byte {$byte}: {$str}");
213
+ }
214
+ $str .= $this->a;
215
+ if ($this->a === '\\') {
216
+ $this->output .= $this->a;
217
+ $this->lastByteOut = $this->a;
218
+ $this->a = $this->get();
219
+ $str .= $this->a;
220
+ }
221
+ }
222
+ }
223
+
224
+ // fallthrough intentional
225
+ case self::ACTION_DELETE_A_B: // 3
226
+ $this->b = $this->next();
227
+ if ($this->b === '/' && $this->isRegexpLiteral()) {
228
+ $this->output .= $this->a . $this->b;
229
+ $pattern = '/'; // keep entire pattern in case we need to report it in the exception
230
+ for(;;) {
231
+ $this->a = $this->get();
232
+ $pattern .= $this->a;
233
+ if ($this->a === '[') {
234
+ for(;;) {
235
+ $this->output .= $this->a;
236
+ $this->a = $this->get();
237
+ $pattern .= $this->a;
238
+ if ($this->a === ']') {
239
+ break;
240
+ }
241
+ if ($this->a === '\\') {
242
+ $this->output .= $this->a;
243
+ $this->a = $this->get();
244
+ $pattern .= $this->a;
245
+ }
246
+ if ($this->isEOF($this->a)) {
247
+ throw new JSMin_UnterminatedRegExpException(
248
+ "JSMin: Unterminated set in RegExp at byte "
249
+ . $this->inputIndex .": {$pattern}");
250
+ }
251
+ }
252
+ }
253
+
254
+ if ($this->a === '/') { // end pattern
255
+ break; // while (true)
256
+ } elseif ($this->a === '\\') {
257
+ $this->output .= $this->a;
258
+ $this->a = $this->get();
259
+ $pattern .= $this->a;
260
+ } elseif ($this->isEOF($this->a)) {
261
+ $byte = $this->inputIndex - 1;
262
+ throw new JSMin_UnterminatedRegExpException(
263
+ "JSMin: Unterminated RegExp at byte {$byte}: {$pattern}");
264
+ }
265
+ $this->output .= $this->a;
266
+ $this->lastByteOut = $this->a;
267
+ }
268
+ $this->b = $this->next();
269
+ }
270
+ // end case ACTION_DELETE_A_B
271
+ }
272
+ }
273
+
274
+ /**
275
+ * @return bool
276
+ */
277
+ protected function isRegexpLiteral()
278
+ {
279
+ if (false !== strpos("(,=:[!&|?+-~*{;", $this->a)) {
280
+ // we can't divide after these tokens
281
+ return true;
282
+ }
283
+
284
+ // check if first non-ws token is "/" (see starts-regex.js)
285
+ $length = strlen($this->output);
286
+ if ($this->a === ' ' || $this->a === "\n") {
287
+ if ($length < 2) { // weird edge case
288
+ return true;
289
+ }
290
+ }
291
+
292
+ // if the "/" follows a keyword, it must be a regexp, otherwise it's best to assume division
293
+
294
+ $subject = $this->output . trim($this->a);
295
+ if (!preg_match('/(?:case|else|in|return|typeof)$/', $subject, $m)) {
296
+ // not a keyword
297
+ return false;
298
+ }
299
+
300
+ // can't be sure it's a keyword yet (see not-regexp.js)
301
+ $charBeforeKeyword = substr($subject, 0 - strlen($m[0]) - 1, 1);
302
+ if ($this->isAlphaNum($charBeforeKeyword)) {
303
+ // this is really an identifier ending in a keyword, e.g. "xreturn"
304
+ return false;
305
+ }
306
+
307
+ // it's a regexp. Remove unneeded whitespace after keyword
308
+ if ($this->a === ' ' || $this->a === "\n") {
309
+ $this->a = '';
310
+ }
311
+
312
+ return true;
313
+ }
314
+
315
+ /**
316
+ * Return the next character from stdin. Watch out for lookahead. If the character is a control character,
317
+ * translate it to a space or linefeed.
318
+ *
319
+ * @return string
320
+ */
321
+ protected function get()
322
+ {
323
+ $c = $this->lookAhead;
324
+ $this->lookAhead = null;
325
+ if ($c === null) {
326
+ // getc(stdin)
327
+ if ($this->inputIndex < $this->inputLength) {
328
+ $c = $this->input[$this->inputIndex];
329
+ $this->inputIndex += 1;
330
+ } else {
331
+ $c = null;
332
+ }
333
+ }
334
+ if (ord($c) >= self::ORD_SPACE || $c === "\n" || $c === null) {
335
+ return $c;
336
+ }
337
+ if ($c === "\r") {
338
+ return "\n";
339
+ }
340
+ return ' ';
341
+ }
342
+
343
+ /**
344
+ * Does $a indicate end of input?
345
+ *
346
+ * @param string $a
347
+ * @return bool
348
+ */
349
+ protected function isEOF($a)
350
+ {
351
+ return ord($a) <= self::ORD_LF;
352
+ }
353
+
354
+ /**
355
+ * Get next char (without getting it). If is ctrl character, translate to a space or newline.
356
+ *
357
+ * @return string
358
+ */
359
+ protected function peek()
360
+ {
361
+ $this->lookAhead = $this->get();
362
+ return $this->lookAhead;
363
+ }
364
+
365
+ /**
366
+ * Return true if the character is a letter, digit, underscore, dollar sign, or non-ASCII character.
367
+ *
368
+ * @param string $c
369
+ *
370
+ * @return bool
371
+ */
372
+ protected function isAlphaNum($c)
373
+ {
374
+ return (preg_match('/^[a-z0-9A-Z_\\$\\\\]$/', $c) || ord($c) > 126);
375
+ }
376
+
377
+ /**
378
+ * Consume a single line comment from input (possibly retaining it)
379
+ */
380
+ protected function consumeSingleLineComment()
381
+ {
382
+ $comment = '';
383
+ while (true) {
384
+ $get = $this->get();
385
+ $comment .= $get;
386
+ if (ord($get) <= self::ORD_LF) { // end of line reached
387
+ // if IE conditional comment
388
+ if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
389
+ $this->keptComment .= "/{$comment}";
390
+ }
391
+ return;
392
+ }
393
+ }
394
+ }
395
+
396
+ /**
397
+ * Consume a multiple line comment from input (possibly retaining it)
398
+ *
399
+ * @throws JSMin_UnterminatedCommentException
400
+ */
401
+ protected function consumeMultipleLineComment()
402
+ {
403
+ $this->get();
404
+ $comment = '';
405
+ for(;;) {
406
+ $get = $this->get();
407
+ if ($get === '*') {
408
+ if ($this->peek() === '/') { // end of comment reached
409
+ $this->get();
410
+ if (0 === strpos($comment, '!')) {
411
+ // preserved by YUI Compressor
412
+ if (!$this->keptComment) {
413
+ // don't prepend a newline if two comments right after one another
414
+ $this->keptComment = "\n";
415
+ }
416
+ $this->keptComment .= "/*!" . substr($comment, 1) . "*/\n";
417
+ } else if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
418
+ // IE conditional
419
+ $this->keptComment .= "/*{$comment}*/";
420
+ }
421
+ return;
422
+ }
423
+ } elseif ($get === null) {
424
+ throw new JSMin_UnterminatedCommentException(
425
+ "JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}");
426
+ }
427
+ $comment .= $get;
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Get the next character, skipping over comments. Some comments may be preserved.
433
+ *
434
+ * @return string
435
+ */
436
+ protected function next()
437
+ {
438
+ $get = $this->get();
439
+ if ($get === '/') {
440
+ switch ($this->peek()) {
441
+ case '/':
442
+ $this->consumeSingleLineComment();
443
+ $get = "\n";
444
+ break;
445
+ case '*':
446
+ $this->consumeMultipleLineComment();
447
+ $get = ' ';
448
+ break;
449
+ }
450
+ }
451
+ return $get;
452
+ }
453
+ }
454
+
455
+ class JSMin_UnterminatedStringException extends Exception {}
456
+ class JSMin_UnterminatedCommentException extends Exception {}
457
+ class JSMin_UnterminatedRegExpException extends Exception {}
classes/index.html ADDED
@@ -0,0 +1 @@
 
1
+ <html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>
classes/static/loading.gif ADDED
Binary file
classes/static/toolbar.css ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Loading Modal */
2
+ .autoptimize-loading
3
+ {
4
+ display: none;
5
+ position: fixed;
6
+ background-color: rgba(102, 102, 102, 0.8);
7
+ background-image: url('loading.gif');
8
+ background-position: center;
9
+ background-repeat: no-repeat;
10
+ top: 0;
11
+ left: 0;
12
+ width: 100%;
13
+ height: 100%;
14
+ z-index: 9000000000;
15
+ }
16
+
17
+ /* Toolbar Font Colors */
18
+ #wp-admin-bar-autoptimize .white
19
+ {
20
+ color: #EEE;
21
+ }
22
+
23
+ #wp-admin-bar-autoptimize .green
24
+ {
25
+ color: #26BD26;
26
+ }
27
+
28
+ #wp-admin-bar-autoptimize .orange
29
+ {
30
+ color: #EC9103;
31
+ }
32
+
33
+ #wp-admin-bar-autoptimize .red
34
+ {
35
+ color: #EA1919;
36
+ }
37
+
38
+ #wp-admin-bar-autoptimize .bg-green
39
+ {
40
+ background: #26BD26;
41
+ }
42
+
43
+ #wp-admin-bar-autoptimize .bg-orange
44
+ {
45
+ background: #EC9103;
46
+ }
47
+
48
+ #wp-admin-bar-autoptimize .bg-red
49
+ {
50
+ background: #EA1919;
51
+ }
52
+
53
+ /* Toolbar Bullet Icons */
54
+ #wp-admin-bar-autoptimize.bullet-green .ab-icon::before,
55
+ #wp-admin-bar-autoptimize.bullet-green:hover .ab-icon::before
56
+ {
57
+ content: "\f159";
58
+ color: #02CA02;
59
+ font-size: 14px;
60
+ }
61
+
62
+ #wp-admin-bar-autoptimize.bullet-orange .ab-icon::before,
63
+ #wp-admin-bar-autoptimize.bullet-orange:hover .ab-icon::before
64
+ {
65
+ content: "\f159";
66
+ color: #EC9103;
67
+ font-size: 14px;
68
+ }
69
+
70
+ #wp-admin-bar-autoptimize.bullet-red .ab-icon::before,
71
+ #wp-admin-bar-autoptimize.bullet-red:hover .ab-icon::before
72
+ {
73
+ content: "\f159";
74
+ color: #EA1919;
75
+ font-size: 14px;
76
+ -webkit-animation: blink 1s step-end infinite;
77
+ animation: blink 1s step-end infinite;
78
+ }
79
+
80
+ @-webkit-keyframes blink { 50% { visibility: hidden; }}
81
+ @keyframes blink { 50% { visibility: hidden; }}
82
+
83
+
84
+ /* Some cosmetic Toolbar things */
85
+ #wp-admin-bar-autoptimize table, #wp-admin-bar-autoptimize th, #wp-admin-bar-autoptimize td
86
+ {
87
+ border: 0px !important;
88
+ }
89
+
90
+ #wp-admin-bar-autoptimize-default
91
+ {
92
+ padding-top: 0 !important;
93
+ }
94
+
95
+ #wp-admin-bar-autoptimize-delete-cache .ab-item
96
+ {
97
+ cursor: pointer !important;
98
+ background: #464b50;
99
+ }
100
+
101
+ #wp-admin-bar-autoptimize-delete-cache .ab-item:hover
102
+ {
103
+ color: rgba(240,245,250,0.85) !important;
104
+ background: #B57373 !important;
105
+ }
106
+
107
+ #wp-admin-bar-autoptimize-cache-info
108
+ {
109
+ padding-top: 8px !important;
110
+ padding-bottom: 8px !important;
111
+ }
112
+
113
+ #wp-admin-bar-autoptimize-cache-info,
114
+ #wp-admin-bar-autoptimize-cache-info .ab-item
115
+ {
116
+ height: auto !important;
117
+ cursor: default !important;
118
+ }
119
+
120
+ #wp-admin-bar-autoptimize-cache-info td + td
121
+ {
122
+ padding-left: 3px;
123
+ }
124
+
125
+ #wp-admin-bar-autoptimize-cache-info .ab-item,
126
+ #wp-admin-bar-autoptimize-cache-info .ab-item:hover
127
+ {
128
+ color: #b4b9be !important;
129
+ }
130
+
131
+ #wp-admin-bar-autoptimize-cache-info .ab-item > p
132
+ {
133
+ display: block;
134
+ }
135
+
136
+ #wp-admin-bar-autoptimize-cache-info .ab-item p,
137
+ #wp-admin-bar-autoptimize-cache-info .ab-item td
138
+ {
139
+ font-size: 11px !important;
140
+ line-height: 16px !important;
141
+ }
142
+
143
+ #wp-admin-bar-autoptimize-cache-info .ab-item table
144
+ {
145
+ display: inline-block !important;
146
+ margin-left: 10px !important;
147
+ }
148
+
149
+ /* Radial Bar */
150
+ .autoptimize-radial-bar
151
+ {
152
+ display: inline-block !important;
153
+ margin-top: 5px !important;
154
+ }
155
+ .autoptimize-radial-bar,
156
+ .autoptimize-radial-bar .mask,
157
+ .autoptimize-radial-bar .fill,
158
+ .autoptimize-radial-bar .shadow
159
+ {
160
+ width : 36px !important;
161
+ height : 36px !important;
162
+ }
163
+ .autoptimize-radial-bar
164
+ {
165
+ background-color : #d6dadc;
166
+ }
167
+ .autoptimize-radial-bar .fill
168
+ {
169
+ background-color : #02ca02;
170
+ }
171
+ .autoptimize-radial-bar .numbers
172
+ {
173
+ color : #02ca02;
174
+ }
175
+ .autoptimize-radial-bar .mask
176
+ {
177
+ clip : rect(0px, 36px, 36px, 18px);
178
+ }
179
+ .autoptimize-radial-bar .fill
180
+ {
181
+ clip : rect(0px, 18px, 36px, 0px);
182
+ }
183
+ .autoptimize-radial-bar .inset
184
+ {
185
+ width : 26px !important;
186
+ height : 26px !important;
187
+
188
+ margin-left : 5px !important;
189
+ margin-top : 5px !important;
190
+
191
+ background-color : #32373c;
192
+ }
193
+ .autoptimize-radial-bar .percentage
194
+ {
195
+ width : 26px !important;
196
+ height : 16px !important;
197
+ line-height : 11px !important;
198
+
199
+ top : 7px !important;
200
+ left : 0px !important;
201
+
202
+ overflow : hidden;
203
+ }
204
+ .autoptimize-radial-bar .numbers
205
+ {
206
+ width : 26px !important;
207
+ font-weight : 600 !important;
208
+ font-size : 9px !important;
209
+
210
+ margin-top : -10px !important;
211
+
212
+ display : inline-block;
213
+ vertical-align : top;
214
+ text-align : center;
215
+ }
216
+
217
+ .autoptimize-radial-bar .inset
218
+ {
219
+ box-shadow : 3px 3px 5px rgba(0,0,0,0.3) !important;
220
+ }
221
+ .autoptimize-radial-bar .shadow
222
+ {
223
+ box-shadow : 3px 3px 5px rgba(0,0,0,0.3) inset !important;
224
+ }
225
+
226
+ .autoptimize-radial-bar .mask,
227
+ .autoptimize-radial-bar .fill,
228
+ .autoptimize-radial-bar .shadow,
229
+ .autoptimize-radial-bar .inset,
230
+ .autoptimize-radial-bar .percentage
231
+ {
232
+ position : absolute !important;
233
+ }
234
+
235
+ .autoptimize-radial-bar,
236
+ .autoptimize-radial-bar .mask,
237
+ .autoptimize-radial-bar .fill,
238
+ .autoptimize-radial-bar .shadow,
239
+ .autoptimize-radial-bar .inset
240
+ {
241
+ border-radius : 50% !important;
242
+ }
classes/static/toolbar.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready(function()
2
+ {
3
+
4
+ var percentage = jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar' ).attr('percentage');
5
+ var rotate = percentage * 1.8;
6
+
7
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar .mask.full, #wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar .fill' ).css({
8
+ '-webkit-transform' : 'rotate(' + rotate + 'deg)',
9
+ '-ms-transform' : 'rotate(' + rotate + 'deg)',
10
+ 'transform' : 'rotate(' + rotate + 'deg)'
11
+ });
12
+
13
+ // Fix Background color of circle percentage & delete cache to fit with the current color theme
14
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar .inset' ).css( 'background-color', jQuery( '#wp-admin-bar-autoptimize .ab-sub-wrapper' ).css( 'background-color') );
15
+ jQuery( '#wp-admin-bar-autoptimize-delete-cache .ab-item' ).css( 'background-color', jQuery( '#wpadminbar' ).css( 'background-color') );
16
+
17
+ jQuery( '#wp-admin-bar-autoptimize-default li' ).click(function(e)
18
+ {
19
+ var id = ( typeof e.target.id != 'undefined' && e.target.id ) ? e.target.id : jQuery( e.target ).parent( 'li' ).attr( 'id' );
20
+ var action = '';
21
+
22
+ if( id == 'wp-admin-bar-autoptimize-delete-cache' ){
23
+ action = 'autoptimize_delete_cache';
24
+ } else {
25
+ return;
26
+ }
27
+
28
+ // Remove the class "hover" from drop-down Autoptimize menu to hide it.
29
+ jQuery( '#wp-admin-bar-autoptimize' ).removeClass( 'hover' );
30
+
31
+ // Create and Show the Autoptimize Loading Modal
32
+ var modal_loading = jQuery( '<div class="autoptimize-loading"></div>' ).appendTo( 'body' ).show();
33
+
34
+ jQuery.ajax({
35
+ type : 'GET',
36
+ url : autoptimize_ajax_object.ajaxurl,
37
+ data : {'action':action, 'nonce':autoptimize_ajax_object.nonce},
38
+ dataType: 'json',
39
+ cache : false,
40
+ timeout : 5000,
41
+ success : function( data )
42
+ {
43
+ // Remove the Autoptimize Loading Modal
44
+ modal_loading.remove();
45
+
46
+ // Reset output values & class names of cache info
47
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .size' ).attr( 'class', 'size green' ).html( '0.00 B' );
48
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .files' ).html( '0' );
49
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .percentage .numbers' ).attr( 'class', 'numbers green' ).html( '0%' );
50
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar .fill' ).attr( 'class', 'fill bg-green' );
51
+
52
+ // Reset the class names of bullet icon
53
+ jQuery( '#wp-admin-bar-autoptimize' ).attr( 'class', 'menupop bullet-green' );
54
+
55
+ // Reset the Radial Bar progress
56
+ jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar .mask.full, #wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar .fill' ).css({
57
+ '-webkit-transform' : 'rotate(0deg)',
58
+ '-ms-transform' : 'rotate(0deg)',
59
+ 'transform' : 'rotate(0deg)'
60
+ });
61
+ },
62
+ error: function( jqXHR, textStatus )
63
+ {
64
+ // Remove the Autoptimize Loading Modal
65
+ modal_loading.remove();
66
+
67
+ // WordPress Admin Notice
68
+ jQuery( '<div id="ao-delete-cache-timeout" class="notice notice-error is-dismissible"><p><strong><span style="display:block;clear:both;">' + autoptimize_ajax_object.error_msg + '</span></strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + autoptimize_ajax_object.dismiss_msg + '</span></button></div><br>' ).insertAfter( '#wpbody .wrap h1:first-of-type' ).show();
69
+
70
+ }
71
+ });
72
+ });
73
+ });
classlesses/autoptimizeCacheChecker.php CHANGED
@@ -13,42 +13,52 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
  */
14
 
15
  if (is_admin()) {
16
- add_action('plugins_loaded','ao_cachechecker_setup');
17
  }
18
 
19
  function ao_cachechecker_setup() {
20
- $doCacheCheck = (bool) apply_filters( 'autoptimize_filter_cachecheck_do', true);
21
- $cacheCheckSchedule = wp_get_schedule( 'ao_cachechecker' );
22
- if (!$cacheCheckSchedule && $doCacheCheck) {
23
- $AOCCfreq = apply_filters('autoptimize_filter_cachecheck_frequency','daily');
24
- if (!in_array($AOCCfreq,array('hourly','daily','monthly'))) {
25
- $AOCCfreq='daily';
26
- }
27
- wp_schedule_event(time(), $AOCCfreq, 'ao_cachechecker');
28
- } else if ($cacheCheckSchedule && !$doCacheCheck) {
29
- wp_clear_scheduled_hook( 'ao_cachechecker' );
30
- }
31
  }
32
 
33
  add_action('ao_cachechecker', 'ao_cachechecker_cronjob');
34
  function ao_cachechecker_cronjob() {
35
- $maxSize = (int) apply_filters( "autoptimize_filter_cachecheck_maxsize", 512000);
36
- $doCacheCheck = (bool) apply_filters( "autoptimize_filter_cachecheck_do", true);
37
- $statArr=autoptimizeCache::stats();
38
- $cacheSize=round($statArr[1]/1024);
39
- if (($cacheSize>$maxSize) && ($doCacheCheck)) {
40
- update_option("autoptimize_cachesize_notice",true);
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  add_action('admin_notices', 'autoptimize_cachechecker_notice');
45
  function autoptimize_cachechecker_notice() {
46
- if ((bool) get_option("autoptimize_cachesize_notice",false)) {
47
- $statArr=autoptimizeCache::stats();
48
- $cacheSize=round($statArr[1]/1024);
49
- echo '<div class="update-nag">';
50
- _e('Autoptimize\'s cache size is getting big, consider purging the cache.<br /><br />Have a look at <a href="https://wordpress.org/plugins/autoptimize/faq/" target="_blank">the Autoptimize FAQ</a> to see how you can keep the cache size under control.', 'autoptimize' );
51
- echo '</div>';
52
- update_option("autoptimize_cachesize_notice",false);
53
- }
54
  }
13
  */
14
 
15
  if (is_admin()) {
16
+ add_action('plugins_loaded','ao_cachechecker_setup');
17
  }
18
 
19
  function ao_cachechecker_setup() {
20
+ $doCacheCheck = (bool) apply_filters( 'autoptimize_filter_cachecheck_do', true);
21
+ $cacheCheckSchedule = wp_get_schedule( 'ao_cachechecker' );
22
+ $AOCCfreq = apply_filters('autoptimize_filter_cachecheck_frequency','daily');
23
+ if (!in_array($AOCCfreq,array('hourly','daily','monthly'))) {
24
+ $AOCCfreq='daily';
25
+ }
26
+ if ( $doCacheCheck && ( !$cacheCheckSchedule || $cacheCheckSchedule !== $AOCCfreq ) ) {
27
+ wp_schedule_event(time(), $AOCCfreq, 'ao_cachechecker');
28
+ } else if ( $cacheCheckSchedule && !$doCacheCheck ) {
29
+ wp_clear_scheduled_hook( 'ao_cachechecker' );
30
+ }
31
  }
32
 
33
  add_action('ao_cachechecker', 'ao_cachechecker_cronjob');
34
  function ao_cachechecker_cronjob() {
35
+ $maxSize = (int) apply_filters( "autoptimize_filter_cachecheck_maxsize", 512000);
36
+ $doCacheCheck = (bool) apply_filters( "autoptimize_filter_cachecheck_do", true);
37
+ $statArr=autoptimizeCache::stats();
38
+ $cacheSize=round($statArr[1]/1024);
39
+ if (($cacheSize>$maxSize) && ($doCacheCheck)) {
40
+ update_option("autoptimize_cachesize_notice",true);
41
+ if (apply_filters('autoptimize_filter_cachecheck_sendmail',true)) {
42
+ $ao_mailto=apply_filters('autoptimize_filter_cachecheck_mailto',get_option('admin_email',''));
43
+ $ao_mailsubject=__('Autoptimize cache size warning','autoptimize');
44
+ $ao_mailbody=__('Autoptimize\'s cache size is getting big, consider purging the cache. Have a look at https://wordpress.org/plugins/autoptimize/faq/ to see how you can keep the cache size under control.', 'autoptimize');
45
+
46
+ if (!empty($ao_mailto)) {
47
+ $ao_mailresult=wp_mail($ao_mailto,$ao_mailsubject,$ao_mailbody);
48
+ if (!$ao_mailresult) {
49
+ error_log("Autoptimize could not send cache size warning mail.");
50
+ }
51
+ }
52
+ }
53
+ }
54
  }
55
 
56
  add_action('admin_notices', 'autoptimize_cachechecker_notice');
57
  function autoptimize_cachechecker_notice() {
58
+ if ((bool) get_option("autoptimize_cachesize_notice",false)) {
59
+ echo '<div class="notice notice-warning"><p>';
60
+ _e('<strong>Autoptimize\'s cache size is getting big</strong>, consider purging the cache. Have a look at <a href="https://wordpress.org/plugins/autoptimize/faq/" target="_blank">the Autoptimize FAQ</a> to see how you can keep the cache size under control.', 'autoptimize' );
61
+ echo '</p></div>';
62
+ update_option("autoptimize_cachesize_notice",false);
63
+ }
 
 
64
  }
classlesses/autoptimizeFontRegex.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ // regex to find fonts, externalised to avoid nasty errors for php<5.3
3
+
4
+ $fonturl_regex = <<<'LOD'
5
+ ~(?(DEFINE)(?<quoted_content>(["']) (?>[^"'\\]++ | \\{2} | \\. | (?!\g{-1})["'] )*+ \g{-1})(?<comment> /\* .*? \*/ ) (?<url_skip>(?: data: ) [^"'\s)}]*+ ) (?<other_content>(?> [^u}/"']++ | \g<quoted_content> | \g<comment> | \Bu | u(?!rl\s*+\() | /(?!\*) | \g<url_start> \g<url_skip> ["']?+ )++ ) (?<anchor> \G(?<!^) ["']?+ | @font-face \s*+ { ) (?<url_start> url\( \s*+ ["']?+ ) ) \g<comment> (*SKIP)(*FAIL) | \g<anchor> \g<other_content>?+ \g<url_start> \K ((?:(?:https?:)?(?://[[:alnum:]\-\.]+)(?::[0-9]+)?)?\/[^"'\s)}]*+) ~xs
6
+ LOD;
7
+ ?>
classlesses/autoptimizePageCacheFlush.php CHANGED
@@ -3,50 +3,50 @@
3
  // hyper cache and gator cache hook into AO, so we don't need to :-)
4
 
5
  function autoptimize_flush_pagecache() {
6
- if(function_exists('wp_cache_clear_cache')) {
7
- if (is_multisite()) {
8
- $blog_id = get_current_blog_id();
9
- wp_cache_clear_cache($blog_id);
10
- } else {
11
- wp_cache_clear_cache();
12
- }
13
- } else if ( has_action('cachify_flush_cache') ) {
14
- do_action('cachify_flush_cache');
15
- } else if ( function_exists('w3tc_pgcache_flush') ) {
16
- w3tc_pgcache_flush();
17
- } else if ( function_exists('wp_fast_cache_bulk_delete_all') ) {
18
- wp_fast_cache_bulk_delete_all(); // still to retest
19
- } else if (class_exists("WpFastestCache")) {
20
- $wpfc = new WpFastestCache();
21
- $wpfc -> deleteCache();
22
- } else if ( class_exists("c_ws_plugin__qcache_purging_routines") ) {
23
- c_ws_plugin__qcache_purging_routines::purge_cache_dir(); // quick cache, still to retest
24
- } else if ( class_exists("zencache") ) {
25
- zencache::clear();
26
- } else if ( class_exists("comet_cache") ) {
27
- comet_cache::clear();
28
- } else if ( class_exists("WpeCommon") ) {
29
- if ( apply_filters('autoptimize_flush_wpengine_aggressive', false) ) {
30
- if ( method_exists( "WpeCommon", "purge_memcached" ) ) {
31
- WpeCommon::purge_memcached();
32
  }
33
- if ( method_exists( "WpeCommon", "clear_maxcdn_cache" ) ) {
34
- WpeCommon::clear_maxcdn_cache();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
  }
37
- if ( method_exists( "WpeCommon", "purge_varnish_cache" ) ) {
38
- WpeCommon::purge_varnish_cache();
39
- }
40
- } else if(file_exists(WP_CONTENT_DIR.'/wp-cache-config.php') && function_exists('prune_super_cache')){
41
- // fallback for WP-Super-Cache
42
- global $cache_path;
43
- if (is_multisite()) {
44
- $blog_id = get_current_blog_id();
45
- prune_super_cache( get_supercache_dir( $blog_id ), true );
46
- prune_super_cache( $cache_path . 'blogs/', true );
47
- } else {
48
- prune_super_cache($cache_path.'supercache/',true);
49
- prune_super_cache($cache_path,true);
50
- }
51
- }
52
  }
3
  // hyper cache and gator cache hook into AO, so we don't need to :-)
4
 
5
  function autoptimize_flush_pagecache() {
6
+ if(function_exists('wp_cache_clear_cache')) {
7
+ if (is_multisite()) {
8
+ $blog_id = get_current_blog_id();
9
+ wp_cache_clear_cache($blog_id);
10
+ } else {
11
+ wp_cache_clear_cache();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
+ } else if ( has_action('cachify_flush_cache') ) {
14
+ do_action('cachify_flush_cache');
15
+ } else if ( function_exists('w3tc_pgcache_flush') ) {
16
+ w3tc_pgcache_flush();
17
+ } else if ( function_exists('wp_fast_cache_bulk_delete_all') ) {
18
+ wp_fast_cache_bulk_delete_all(); // still to retest
19
+ } else if (class_exists("WpFastestCache")) {
20
+ $wpfc = new WpFastestCache();
21
+ $wpfc -> deleteCache();
22
+ } else if ( class_exists("c_ws_plugin__qcache_purging_routines") ) {
23
+ c_ws_plugin__qcache_purging_routines::purge_cache_dir(); // quick cache, still to retest
24
+ } else if ( class_exists("zencache") ) {
25
+ zencache::clear();
26
+ } else if ( class_exists("comet_cache") ) {
27
+ comet_cache::clear();
28
+ } else if ( class_exists("WpeCommon") ) {
29
+ if ( apply_filters('autoptimize_flush_wpengine_aggressive', false) ) {
30
+ if ( method_exists( "WpeCommon", "purge_memcached" ) ) {
31
+ WpeCommon::purge_memcached();
32
+ }
33
+ if ( method_exists( "WpeCommon", "clear_maxcdn_cache" ) ) {
34
+ WpeCommon::clear_maxcdn_cache();
35
+ }
36
+ }
37
+ if ( method_exists( "WpeCommon", "purge_varnish_cache" ) ) {
38
+ WpeCommon::purge_varnish_cache();
39
+ }
40
+ } else if(file_exists(WP_CONTENT_DIR.'/wp-cache-config.php') && function_exists('prune_super_cache')){
41
+ // fallback for WP-Super-Cache
42
+ global $cache_path;
43
+ if (is_multisite()) {
44
+ $blog_id = get_current_blog_id();
45
+ prune_super_cache( get_supercache_dir( $blog_id ), true );
46
+ prune_super_cache( $cache_path . 'blogs/', true );
47
+ } else {
48
+ prune_super_cache($cache_path.'supercache/',true);
49
+ prune_super_cache($cache_path,true);
50
  }
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
classlesses/autoptimizePartners.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Classlessly add a "more tools" tab to promote (future) AO addons and/ or affiliate services
4
+ */
5
+
6
+ add_action('admin_init', 'ao_partner_tabs_preinit');
7
+ function ao_partner_tabs_preinit() {
8
+ if (apply_filters('autoptimize_filter_show_partner_tabs',true)) {
9
+ add_filter('autoptimize_filter_settingsscreen_tabs','ao_add_partner_tabs');
10
+ }
11
+ }
12
+
13
+ function ao_add_partner_tabs($in) {
14
+ $in=array_merge($in,array('ao_partners' => __('Optimize More!','autoptimize')));
15
+ return $in;
16
+ }
17
+
18
+ add_action('admin_menu','ao_partners_init');
19
+ function ao_partners_init() {
20
+ if (apply_filters('autoptimize_filter_show_partner_tabs',true)) {
21
+ $hook=add_submenu_page(NULL,'AO partner','AO partner','manage_options','ao_partners','ao_partners');
22
+ // register_settings here as well if needed
23
+ }
24
+ }
25
+
26
+ function ao_partners() {
27
+ ?>
28
+ <style>
29
+ .itemDetail {
30
+ background: #fff;
31
+ width: 250px;
32
+ min-height: 270px;
33
+ border: 1px solid #ccc;
34
+ float: left;
35
+ padding: 15px;
36
+ position: relative;
37
+ margin: 0 10px 10px 0;
38
+ }
39
+ .itemTitle {
40
+ margin-top:0px;
41
+ margin-bottom:10px;
42
+ }
43
+ .itemImage {
44
+ text-align: center;
45
+ }
46
+ .itemImage img {
47
+ max-width: 95%;
48
+ max-height: 150px;
49
+ }
50
+ .itemDescription {
51
+ margin-bottom:30px;
52
+ }
53
+ .itemButtonRow {
54
+ position: absolute;
55
+ bottom: 10px;
56
+ right: 10px;
57
+ width:100%;
58
+ }
59
+ .itemButton {
60
+ float:right;
61
+ }
62
+ .itemButton a {
63
+ text-decoration: none;
64
+ color: #555;
65
+ }
66
+ .itemButton a:hover {
67
+ text-decoration: none;
68
+ color: #23282d;
69
+ }
70
+ </style>
71
+ <div class="wrap">
72
+ <h1><?php _e('Autoptimize Settings','autoptimize'); ?></h1>
73
+ <?php echo autoptimizeConfig::ao_admin_tabs(); ?>
74
+ <?php
75
+ _e("<h2>These Autoptimize power-ups and related services will improve your site's performance even more!</h2>","autoptimize");
76
+ ?>
77
+ <div>
78
+ <?php getAOPartnerFeed(); ?>
79
+ </div>
80
+ </div>
81
+ <?php
82
+ }
83
+
84
+ function getAOPartnerFeed() {
85
+ $noFeedText=__( 'Have a look at <a href="http://optimizingmatters.com/">optimizingmatters.com</a> for Autoptimize power-ups!', 'autoptimize' );
86
+
87
+ if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) {
88
+ $rss = fetch_feed( "http://feeds.feedburner.com/OptimizingMattersDownloads" );
89
+ $maxitems = 0;
90
+
91
+ if ( ! is_wp_error( $rss ) ) {
92
+ $maxitems = $rss->get_item_quantity( 20 );
93
+ $rss_items = $rss->get_items( 0, $maxitems );
94
+ } ?>
95
+ <ul>
96
+ <?php
97
+ if ( $maxitems == 0 ) {
98
+ echo $noFeedText;
99
+ } else {
100
+ foreach ( $rss_items as $item ) :
101
+ $itemURL = esc_url( $item->get_permalink() ); ?>
102
+ <li class="itemDetail">
103
+ <h3 class="itemTitle"><a href="<?php echo $itemURL; ?>" target="_blank"><?php echo esc_html( $item->get_title() ); ?></a></h3>
104
+ <?php
105
+ if (($enclosure = $item->get_enclosure()) && (strpos($enclosure->get_type(),"image")!==false) ) {
106
+ $itemImgURL=esc_url($enclosure->get_link());
107
+ echo "<div class=\"itemImage\"><a href=\"".$itemURL."\" target=\"_blank\"><img src=\"".$itemImgURL."\"/></a></div>";
108
+ }
109
+ ?>
110
+ <div class="itemDescription"><?php echo wp_kses_post($item -> get_description() ); ?></div>
111
+ <div class="itemButtonRow"><div class="itemButton button-secondary"><a href="<?php echo $itemURL; ?>" target="_blank">More info</a></div></div>
112
+ </li>
113
+ <?php endforeach; ?>
114
+ <?php } ?>
115
+ </ul>
116
+ <?php
117
+ } else {
118
+ echo $noFeedText;
119
+ }
120
+ }
classlesses/autoptimizeUpdateCode.php CHANGED
@@ -3,72 +3,72 @@
3
  * below code handles updates and is only included by autoptimize.php if/ when needed
4
  */
5
 
6
- $majorUp = false;
7
  $autoptimize_major_version=substr($autoptimize_db_version,0,3);
8
 
9
  switch($autoptimize_major_version) {
10
- case "1.6":
11
- // from back in the days when I did not yet consider multisite
12
- // if user was on version 1.6.x, force advanced options to be shown by default
13
- update_option('autoptimize_show_adv','1');
14
 
15
- // and remove old options
16
- $to_delete_options=array("autoptimize_cdn_css","autoptimize_cdn_css_url","autoptimize_cdn_js","autoptimize_cdn_js_url","autoptimize_cdn_img","autoptimize_cdn_img_url","autoptimize_css_yui","autoptimize_js_yui");
17
- foreach ($to_delete_options as $del_opt) {
18
- delete_option( $del_opt );
19
- }
20
- $majorUp = true;
21
- case "1.7":
22
- // force 3.8 dashicons in CSS exclude options when upgrading from 1.7 to 1.8
23
- if ( !is_multisite() ) {
24
- $css_exclude = get_option('autoptimize_css_exclude');
25
- if (empty($css_exclude)) {
26
- $css_exclude = "admin-bar.min.css, dashicons.min.css";
27
- } else if (strpos($css_exclude,"dashicons.min.css")===false) {
28
- $css_exclude .= ", dashicons.min.css";
29
- }
30
- update_option('autoptimize_css_exclude',$css_exclude);
31
- } else {
32
- global $wpdb;
33
- $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
34
- $original_blog_id = get_current_blog_id();
35
- foreach ( $blog_ids as $blog_id ) {
36
- switch_to_blog( $blog_id );
37
- $css_exclude = get_option('autoptimize_css_exclude');
38
- if (empty($css_exclude)) {
39
- $css_exclude = "admin-bar.min.css, dashicons.min.css";
40
- } else if (strpos($css_exclude,"dashicons.min.css")===false) {
41
- $css_exclude .= ", dashicons.min.css";
42
- }
43
- update_option('autoptimize_css_exclude',$css_exclude);
44
- }
45
- switch_to_blog( $original_blog_id );
46
- }
47
- $majorUp = true;
48
- case "1.9":
49
- /*
50
- * 2.0 will not aggregate inline CSS/JS by default, but we want users
51
- * upgrading from 1.9 to keep their inline code aggregated by default.
52
- */
53
- if ( !is_multisite() ) {
54
- update_option('autoptimize_css_include_inline','on');
55
- update_option('autoptimize_js_include_inline','on');
56
- } else {
57
- global $wpdb;
58
- $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
59
- $original_blog_id = get_current_blog_id();
60
- foreach ( $blog_ids as $blog_id ) {
61
- switch_to_blog( $blog_id );
62
- update_option('autoptimize_css_include_inline','on');
63
- update_option('autoptimize_js_include_inline','on');
64
- }
65
- switch_to_blog( $original_blog_id );
66
- }
67
- $majorUp = true;
68
- }
69
 
70
  if ( $majorUp === true ) {
71
- // clear cache and notify user to check result if major upgrade
72
- autoptimizeCache::clearall();
73
- add_action('admin_notices', 'autoptimize_update_config_notice');
74
  }
3
  * below code handles updates and is only included by autoptimize.php if/ when needed
4
  */
5
 
6
+ $majorUp = false;
7
  $autoptimize_major_version=substr($autoptimize_db_version,0,3);
8
 
9
  switch($autoptimize_major_version) {
10
+ case "1.6":
11
+ // from back in the days when I did not yet consider multisite
12
+ // if user was on version 1.6.x, force advanced options to be shown by default
13
+ update_option('autoptimize_show_adv','1');
14
 
15
+ // and remove old options
16
+ $to_delete_options=array("autoptimize_cdn_css","autoptimize_cdn_css_url","autoptimize_cdn_js","autoptimize_cdn_js_url","autoptimize_cdn_img","autoptimize_cdn_img_url","autoptimize_css_yui","autoptimize_js_yui");
17
+ foreach ($to_delete_options as $del_opt) {
18
+ delete_option( $del_opt );
19
+ }
20
+ $majorUp = true;
21
+ case "1.7":
22
+ // force 3.8 dashicons in CSS exclude options when upgrading from 1.7 to 1.8
23
+ if ( !is_multisite() ) {
24
+ $css_exclude = get_option('autoptimize_css_exclude');
25
+ if (empty($css_exclude)) {
26
+ $css_exclude = "admin-bar.min.css, dashicons.min.css";
27
+ } else if (strpos($css_exclude,"dashicons.min.css")===false) {
28
+ $css_exclude .= ", dashicons.min.css";
29
+ }
30
+ update_option('autoptimize_css_exclude',$css_exclude);
31
+ } else {
32
+ global $wpdb;
33
+ $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
34
+ $original_blog_id = get_current_blog_id();
35
+ foreach ( $blog_ids as $blog_id ) {
36
+ switch_to_blog( $blog_id );
37
+ $css_exclude = get_option('autoptimize_css_exclude');
38
+ if (empty($css_exclude)) {
39
+ $css_exclude = "admin-bar.min.css, dashicons.min.css";
40
+ } else if (strpos($css_exclude,"dashicons.min.css")===false) {
41
+ $css_exclude .= ", dashicons.min.css";
42
+ }
43
+ update_option('autoptimize_css_exclude',$css_exclude);
44
+ }
45
+ switch_to_blog( $original_blog_id );
46
+ }
47
+ $majorUp = true;
48
+ case "1.9":
49
+ /*
50
+ * 2.0 will not aggregate inline CSS/JS by default, but we want users
51
+ * upgrading from 1.9 to keep their inline code aggregated by default.
52
+ */
53
+ if ( !is_multisite() ) {
54
+ update_option('autoptimize_css_include_inline','on');
55
+ update_option('autoptimize_js_include_inline','on');
56
+ } else {
57
+ global $wpdb;
58
+ $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
59
+ $original_blog_id = get_current_blog_id();
60
+ foreach ( $blog_ids as $blog_id ) {
61
+ switch_to_blog( $blog_id );
62
+ update_option('autoptimize_css_include_inline','on');
63
+ update_option('autoptimize_js_include_inline','on');
64
+ }
65
+ switch_to_blog( $original_blog_id );
66
+ }
67
+ $majorUp = true;
68
+ }
69
 
70
  if ( $majorUp === true ) {
71
+ // clear cache and notify user to check result if major upgrade
72
+ autoptimizeCache::clearall();
73
+ add_action('admin_notices', 'autoptimize_update_config_notice');
74
  }
classlesses/index.html ADDED
@@ -0,0 +1 @@
 
1
+ <html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>
config/index.html ADDED
@@ -0,0 +1 @@
 
1
+ <html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>
index.html ADDED
@@ -0,0 +1 @@
 
1
+ <html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>
localization/autoptimize-de_DE.mo DELETED
Binary file
localization/autoptimize-de_DE.po DELETED
@@ -1,316 +0,0 @@
1
- # Copyright (C) 2014 Autoptimize
2
- # This file is distributed under the same license as the Autoptimize package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Autoptimize 1.9.0\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
7
- "POT-Creation-Date: 2014-08-22 05:35:46+00:00\n"
8
- "PO-Revision-Date: 2014-08-25 21:22+0100\n"
9
- "Last-Translator: Josef Seidl <info@blog-it-solutions.de>\n"
10
- "Language-Team: Josef Seidl, Blog IT-Solutions <info@blog-it-solutions.de>\n"
11
- "Language: de_DE\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.6.8\n"
16
-
17
- #: autoptimize.php:124
18
- msgid ""
19
- "Thank you for installing and activating Autoptimize. Please configure it "
20
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
21
- "performance."
22
- msgstr ""
23
- "Vielen Dank für die Installation und Aktivierung von Autoptimize. Bitte "
24
- "konfiguriere das Plugin unter \"Einstellungen\" -> \"Autoptimize\" um die "
25
- "Performance deiner Webseite zu verbessern."
26
-
27
- #: autoptimize.php:130
28
- msgid ""
29
- "Autoptimize has just been updated. Please <strong>test your site now</"
30
- "strong> and adapt Autoptimize config if needed."
31
- msgstr ""
32
- "Autoptimize wurde aktualisiert. Bitte <strong>teste nun deine Seite</strong> "
33
- "und passe gegebenenfalls die Einstellungen von Autoptimize an."
34
-
35
- #: classes/autoptimizeConfig.php:48
36
- msgid "Autoptimize Settings"
37
- msgstr "Autoptimize Einstellungen"
38
-
39
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
40
- msgid "Show advanced settings"
41
- msgstr "Erweiterte Einstellungen einblenden"
42
-
43
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
44
- msgid "Hide advanced settings"
45
- msgstr "Erweiterte Einstellungen ausblenden"
46
-
47
- #: classes/autoptimizeConfig.php:69
48
- msgid "HTML Options"
49
- msgstr "HTML Optionen"
50
-
51
- #: classes/autoptimizeConfig.php:72
52
- msgid "Optimize HTML Code?"
53
- msgstr "HTML Code optimieren?"
54
-
55
- #: classes/autoptimizeConfig.php:76
56
- msgid "Keep HTML comments?"
57
- msgstr "HTML Kommentare beibehalten?"
58
-
59
- #: classes/autoptimizeConfig.php:78
60
- msgid ""
61
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
62
- "AdSense to function properly."
63
- msgstr ""
64
- "Aktiviere diese Option, wenn HTML Kommentare erhalten bleiben sollen. "
65
- "Einzelne Kommentare z.B. für AdSense können auch mit dem noptimize-Tag "
66
- "ausgeschlossen werden (näheres in der <a href=\"http://wordpress.org/plugins/"
67
- "autoptimize/faq/\" target=\"_blank\">FAQ</a>)."
68
-
69
- #: classes/autoptimizeConfig.php:82
70
- msgid "JavaScript Options"
71
- msgstr "JavaScript Optionen"
72
-
73
- #: classes/autoptimizeConfig.php:85
74
- msgid "Optimize JavaScript Code?"
75
- msgstr "JavaScript Code optimieren?"
76
-
77
- #: classes/autoptimizeConfig.php:89
78
- msgid "Force JavaScript in &lt;head&gt;?"
79
- msgstr "Erzwinge JavaScript in &lt;head&gt;?"
80
-
81
- #: classes/autoptimizeConfig.php:91
82
- msgid ""
83
- "For performance reasons it is better to include JavaScript at the bottom of "
84
- "HTML, but this sometimes breaks things. Especially useful for jQuery-based "
85
- "themes."
86
- msgstr ""
87
- "Standardmäßig wird JavaScript am Ende des HTML-Dokuments geladen. Das "
88
- "verursacht aber manchmal Probleme, insbesondere wenn das verwendete Theme "
89
- "auf jQuery basiert."
90
-
91
- #: classes/autoptimizeConfig.php:94
92
- msgid "Look for scripts only in &lt;head&gt;?"
93
- msgstr "Nach Skripten nur in &lt;head&gt; suchen?"
94
-
95
- #: classes/autoptimizeConfig.php:96
96
- msgid ""
97
- "Mostly useful in combination with previous option when using jQuery-based "
98
- "templates, but might help keeping cache size under control."
99
- msgstr ""
100
- "Oft in Kombination mit der vorhergehenden Option nützlich, wenn "
101
- "beispielsweise ein jQuery-Theme genutzt wird. Diese Einstellung kann unter "
102
- "Umständen auch helfen die Größe des Caches unter Kontrolle zu halten."
103
-
104
- #: classes/autoptimizeConfig.php:99
105
- msgid "Exclude scripts from Autoptimize:"
106
- msgstr "Folgende Skripte von Autoptimize ausschließen:"
107
-
108
- #: classes/autoptimizeConfig.php:101
109
- msgid ""
110
- "A comma-seperated list of scripts you want to exclude from being optimized, "
111
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
112
- "scripts from being aggregated and minimized by Autoptimize."
113
- msgstr ""
114
- "Eine Komma getrennte Liste mit Skripten die von der Optimierung durch "
115
- "Autoptimize ausgeschlossen werden sollen. Beispiel: 'whatever.js, another."
116
- "js' (ohne Anführungszeichen)"
117
-
118
- #: classes/autoptimizeConfig.php:104
119
- msgid "Add try-catch wrapping?"
120
- msgstr "Try-Catch Block hinzufügen?"
121
-
122
- #: classes/autoptimizeConfig.php:106
123
- msgid ""
124
- "If your scripts break because of an script error, you might want to try this."
125
- msgstr ""
126
- "Wenn das Laden der Skripte aufgrund eines Skriptfehlers unterbrochen wird, "
127
- "kannst du diese Option ausprobieren."
128
-
129
- #: classes/autoptimizeConfig.php:110
130
- msgid "CSS Options"
131
- msgstr "CSS Optionen"
132
-
133
- #: classes/autoptimizeConfig.php:113
134
- msgid "Optimize CSS Code?"
135
- msgstr "CSS Code optimieren?"
136
-
137
- #: classes/autoptimizeConfig.php:117
138
- msgid "Generate data: URIs for images?"
139
- msgstr "data: URIs für Bilder generieren (Inline Images)?"
140
-
141
- #: classes/autoptimizeConfig.php:119
142
- msgid ""
143
- "Enable this to include small background-images in the CSS itself instead of "
144
- "as seperate downloads."
145
- msgstr ""
146
- "Aktiviere diese Option um kleine Bilder (Standard <= 4KB) als "
147
- "Hintergrundbilder direkt in CSS einzufügen. Dadurch reduzierst du HTTP-"
148
- "Anfragen an den Webserver."
149
-
150
- #: classes/autoptimizeConfig.php:122
151
- msgid "Look for styles only in &lt;head&gt;?"
152
- msgstr "Nach CSS nur in &lt;head&gt; suchen?"
153
-
154
- #: classes/autoptimizeConfig.php:124
155
- msgid ""
156
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
157
- "might want to enable this."
158
- msgstr ""
159
- "Optimiere CSS nicht außerhalb des HEAD-Bereichs. Die Aktivierung dieser "
160
- "Option kann sinnvoll sein, wenn der Cache sehr groß wird."
161
-
162
- #: classes/autoptimizeConfig.php:127
163
- msgid "Inline and Defer CSS?"
164
- msgstr "Inline und Defer CSS?"
165
-
166
- #: classes/autoptimizeConfig.php:129
167
- msgid ""
168
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
169
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
170
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
171
- msgstr ""
172
- "Füge den \"above the fold\" CSS-Code als Inline CSS in den HEAD-Bereich des "
173
- "HTML-Dokuments ein und lade das restliche CSS erst am Ende, nachdem die "
174
- "Seite schon geladen ist. Bitte <a href=\"http://wordpress.org/plugins/"
175
- "autoptimize/faq/\" target=\"_blank\">prüfe die FAQ</a> bevor du diese Option "
176
- "aktivierst."
177
-
178
- #: classes/autoptimizeConfig.php:133
179
- msgid "Paste the above the fold CSS here."
180
- msgstr "Füge den \"above the fold\" CSS-Code hier ein."
181
-
182
- #: classes/autoptimizeConfig.php:136
183
- msgid "Inline all CSS?"
184
- msgstr "Gesamten CSS-Code Inline einfügen?"
185
-
186
- #: classes/autoptimizeConfig.php:138
187
- msgid ""
188
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
189
- "visitor-rate, but may slow down performance otherwise."
190
- msgstr ""
191
- "Das Inlining des gesamten CSS-Codes im HEAD-Bereich des HTML-Dokuments kann "
192
- "die Geschwindigkeit von Seiten mit einem niedrigen Seiten/Sitzung-Wert "
193
- "steigern. Andererseits kann die Seite unter Umständen auch langsamer werden."
194
-
195
- #: classes/autoptimizeConfig.php:141
196
- msgid "Exclude CSS from Autoptimize:"
197
- msgstr "Folgende CSS-Dateien von Autoptimize ausschließen:"
198
-
199
- #: classes/autoptimizeConfig.php:143
200
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
201
- msgstr ""
202
- "Eine Komma getrennte Liste mit CSS-Dateien die von der Optimierung "
203
- "ausgeschlossen werden sollen."
204
-
205
- #: classes/autoptimizeConfig.php:147
206
- msgid "CDN Options"
207
- msgstr "CDN Optionen"
208
-
209
- #: classes/autoptimizeConfig.php:150
210
- msgid "CDN Base URL"
211
- msgstr "CDN Basis URL:"
212
-
213
- #: classes/autoptimizeConfig.php:152
214
- msgid ""
215
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
216
- "referenced in the CSS."
217
- msgstr ""
218
- "Gib hier die URL deines CDN Root-Verzeichnisses ein, wenn du ein CDN für "
219
- "Bilder und referenzierte CSS-Dateien aktivieren möchtest."
220
-
221
- #: classes/autoptimizeConfig.php:156
222
- msgid "Cache Info"
223
- msgstr "Cache Info"
224
-
225
- #: classes/autoptimizeConfig.php:159
226
- msgid "Cache folder"
227
- msgstr "Cache Ordner:"
228
-
229
- #: classes/autoptimizeConfig.php:163
230
- msgid "Can we write?"
231
- msgstr "Schreibberechtigung?"
232
-
233
- #: classes/autoptimizeConfig.php:164
234
- msgid "Yes"
235
- msgstr "Ja"
236
-
237
- #: classes/autoptimizeConfig.php:164
238
- msgid "No"
239
- msgstr "Nein"
240
-
241
- #: classes/autoptimizeConfig.php:167
242
- msgid "Cached styles and scripts"
243
- msgstr "Anzahl gecachter Dateien:"
244
-
245
- #: classes/autoptimizeConfig.php:171
246
- msgid "Save aggregated script/css as static files?"
247
- msgstr "Optimierte CSS / Skript-Dateien als statische Dateien speichern?"
248
-
249
- #: classes/autoptimizeConfig.php:173
250
- msgid ""
251
- "By default files saved are static css/js, uncheck this option if your "
252
- "webserver doesn't properly handle the compression and expiry."
253
- msgstr ""
254
- "Standardmäßig werden CSS- und JavaScript-Dateien bereits statisch "
255
- "gespeichert. Deaktiviere diese Option, wenn dein Webserver mit der "
256
- "Verarbeitung von komprimierten Dateien und Expires-Header Probleme hat."
257
-
258
- #: classes/autoptimizeConfig.php:179
259
- msgid "Save Changes"
260
- msgstr "Änderungen speichern"
261
-
262
- #: classes/autoptimizeConfig.php:180
263
- msgid "Save Changes and Empty Cache"
264
- msgstr "Änderungen speichern und Cache leeren"
265
-
266
- #: classes/autoptimizeConfig.php:188
267
- msgid "futtta about"
268
- msgstr "Über futtta"
269
-
270
- #. Plugin Name of the plugin/theme
271
- #: classes/autoptimizeConfig.php:190
272
- msgid "Autoptimize"
273
- msgstr "Autoptimize"
274
-
275
- #: classes/autoptimizeConfig.php:191
276
- msgid "WordPress"
277
- msgstr "WordPress"
278
-
279
- #: classes/autoptimizeConfig.php:192
280
- msgid "Web Technology"
281
- msgstr "Web Technologien"
282
-
283
- #: classes/autoptimizeConfig.php:197
284
- msgid "Do not donate for this plugin!"
285
- msgstr "Bitte spende nicht für dieses Plugin!"
286
-
287
- #: classes/autoptimizeConfig.php:313
288
- msgid "Autoptimize Options"
289
- msgstr "Autoptimize Optionen"
290
-
291
- #: classes/autoptimizeConfig.php:358 classes/autoptimizeConfig.php:364
292
- msgid "Settings"
293
- msgstr "Einstellungen"
294
-
295
- #. Plugin URI of the plugin/theme
296
- msgid "http://blog.futtta.be/autoptimize"
297
- msgstr "http://blog.futtta.be/autoptimize"
298
-
299
- #. Description of the plugin/theme
300
- msgid ""
301
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
302
- "compressing it."
303
- msgstr ""
304
- "Optimiert deine Webseite, fügt CSS und JavaScripte Code zusammen und "
305
- "komprimiert diesen."
306
-
307
- #. Author of the plugin/theme
308
- msgid "Frank Goossens (futtta)"
309
- msgstr "Frank Goossens (futtta)"
310
-
311
- #. Author URI of the plugin/theme
312
- msgid "http://blog.futtta.be/"
313
- msgstr "http://blog.futtta.be/"
314
-
315
- #~ msgid "Defer CSS loading?"
316
- #~ msgstr "Laden von CSS verzögern?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-es_ES.mo DELETED
Binary file
localization/autoptimize-es_ES.po DELETED
@@ -1,211 +0,0 @@
1
- # Spanish translation for autoptimize
2
- # Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
3
- # This file is distributed under the same license as the autoptimize package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: autoptimize\n"
9
- "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
- "POT-Creation-Date: 2009-10-19 21:41+0000\n"
11
- "PO-Revision-Date: 2009-10-24 02:41+0000\n"
12
- "Last-Translator: Emilio <Unknown>\n"
13
- "Language-Team: Spanish <es@li.org>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "X-Launchpad-Export-Date: 2009-10-25 02:04+0000\n"
18
- "X-Generator: Launchpad (build Unknown)\n"
19
-
20
- #: classes/autoptimizeConfig.php:50
21
- msgid "Autoptimize Settings"
22
- msgstr "Configuración de Autoptimize"
23
-
24
- #: classes/autoptimizeConfig.php:71
25
- msgid "HTML Options"
26
- msgstr "Opciones de HTML"
27
-
28
- #: classes/autoptimizeConfig.php:74
29
- msgid "Optimize HTML Code?"
30
- msgstr "¿Optimizar el código HTML?"
31
-
32
- #: classes/autoptimizeConfig.php:78
33
- msgid "Keep HTML comments?"
34
- msgstr "¿Mantener comentarios HTML?"
35
-
36
- #: classes/autoptimizeConfig.php:80
37
- msgid ""
38
- "Disabled by default. Enable this if you want HTML comments to remain in the "
39
- "page."
40
- msgstr ""
41
- "Deshabilitado por defecto. Habilite esto si quiere mantener los comentarios "
42
- "HTML en la página."
43
-
44
- #: classes/autoptimizeConfig.php:84
45
- msgid "JavaScript Options"
46
- msgstr "Opciones de JavaScript"
47
-
48
- #: classes/autoptimizeConfig.php:87
49
- msgid "Optimize JavaScript Code?"
50
- msgstr "¿Optimizar el código JavaScript?"
51
-
52
- #: classes/autoptimizeConfig.php:91
53
- msgid "Look for scripts only in &lt;head&gt;?"
54
- msgstr "¿Buscar scripts solo en &lt;head&gt;?"
55
-
56
- #: classes/autoptimizeConfig.php:93 classes/autoptimizeConfig.php:116
57
- msgid ""
58
- "Disabled by default. If the cache gets big, you might want to enable this."
59
- msgstr ""
60
- "Deshabilitado por defecto. Si el cache se hace grande, tal vez quiera "
61
- "habilitar esto."
62
-
63
- #: classes/autoptimizeConfig.php:96
64
- msgid "Add try-catch wrapping?"
65
- msgstr "¿Añadir envolturas try-catch?"
66
-
67
- #: classes/autoptimizeConfig.php:98
68
- msgid ""
69
- "Disabled by default. If your scripts break because of an script error, you "
70
- "might want to try this."
71
- msgstr ""
72
- "Deshabilitado por defecto. Si sus scripts dejan de funcionar por un error de "
73
- "scripting, tal vez quiera probar esto."
74
-
75
- #: classes/autoptimizeConfig.php:101 classes/autoptimizeConfig.php:124
76
- msgid "Use YUI compression?"
77
- msgstr "¿Comprimir con YUI?"
78
-
79
- #: classes/autoptimizeConfig.php:103 classes/autoptimizeConfig.php:126
80
- msgid ""
81
- "Disabled by default. Read [autoptimize]/yui/README.txt for more information."
82
- msgstr ""
83
- "Deshabilitado por defecto. Lea [autoptimize]/yui/README.txt para más "
84
- "información."
85
-
86
- #: classes/autoptimizeConfig.php:107
87
- msgid "CSS Options"
88
- msgstr "Opciones de CSS"
89
-
90
- #: classes/autoptimizeConfig.php:110
91
- msgid "Optimize CSS Code?"
92
- msgstr "¿Optimizar el código CSS?"
93
-
94
- #: classes/autoptimizeConfig.php:114
95
- msgid "Look for styles on just &lt;head&gt;?"
96
- msgstr "¿Buscar estilos solo en &lt;head&gt;?"
97
-
98
- #: classes/autoptimizeConfig.php:119
99
- msgid "Generate data: URIs for images?"
100
- msgstr "¿Generar data: URIs de imágenes?"
101
-
102
- #: classes/autoptimizeConfig.php:121
103
- msgid "Disabled by default. Enable this to include images on the CSS itself."
104
- msgstr ""
105
- "Deshabilitador por defecto. Habilite esto para incluir imágenes en el código "
106
- "CSS."
107
-
108
- #: classes/autoptimizeConfig.php:130
109
- msgid "CDN Options"
110
- msgstr "Opciones de CDN"
111
-
112
- #: classes/autoptimizeConfig.php:133
113
- msgid "Rewrite JavaScript URLs?"
114
- msgstr "¿Reescribir URLs de JavaScript?"
115
-
116
- #: classes/autoptimizeConfig.php:135 classes/autoptimizeConfig.php:145
117
- #: classes/autoptimizeConfig.php:155
118
- msgid ""
119
- "Disabled by default. Do not enable this unless you know what you are doing."
120
- msgstr ""
121
- "Deshabilitado por defecto. No habilite esto a menos que sepa lo que está "
122
- "haciendo."
123
-
124
- #: classes/autoptimizeConfig.php:138
125
- msgid "JavaScript Base URL"
126
- msgstr "URL Base para JavaScript"
127
-
128
- #: classes/autoptimizeConfig.php:140 classes/autoptimizeConfig.php:150
129
- #: classes/autoptimizeConfig.php:160
130
- msgid ""
131
- "This is the new base URL that will be used when rewriting. It should point "
132
- "to the blog root directory."
133
- msgstr ""
134
- "Esta es la nueva URL de base que se utilizará al reescribir. Debe apuntar al "
135
- "directorio principal del blog."
136
-
137
- #: classes/autoptimizeConfig.php:143
138
- msgid "Rewrite CSS URLs?"
139
- msgstr "¿Reescribir URLs de CSS?"
140
-
141
- #: classes/autoptimizeConfig.php:148
142
- msgid "CSS Base URL"
143
- msgstr "URL Base para CSS"
144
-
145
- #: classes/autoptimizeConfig.php:153
146
- msgid "Rewrite Image URLs?"
147
- msgstr "¿Reescribir URLs de Imágenes?"
148
-
149
- #: classes/autoptimizeConfig.php:158
150
- msgid "Image Base URL"
151
- msgstr "URL Base para Imágenes"
152
-
153
- #: classes/autoptimizeConfig.php:164
154
- msgid "Cache Info"
155
- msgstr "Información sobre el Caché"
156
-
157
- #: classes/autoptimizeConfig.php:167
158
- msgid "Cache folder"
159
- msgstr "Carpeta de Caché"
160
-
161
- #: classes/autoptimizeConfig.php:171
162
- msgid "Can we write?"
163
- msgstr "¿Se puede escribir?"
164
-
165
- #: classes/autoptimizeConfig.php:172
166
- msgid "Yes"
167
- msgstr "Si"
168
-
169
- #: classes/autoptimizeConfig.php:172
170
- msgid "No"
171
- msgstr "No"
172
-
173
- #: classes/autoptimizeConfig.php:175
174
- msgid "Cached styles and scripts"
175
- msgstr "Estilos y scripts cacheados"
176
-
177
- #: classes/autoptimizeConfig.php:179
178
- msgid "Do not compress cache files"
179
- msgstr "No comprimir archivos de cache"
180
-
181
- #: classes/autoptimizeConfig.php:181
182
- msgid ""
183
- "Disabled by default. Enable this if you want to compress the served files "
184
- "using your webserver."
185
- msgstr ""
186
- "Deshabilitado por defecto. Habilite esto si quiere comprimir los archivos "
187
- "servidos usando su servidor web."
188
-
189
- #: classes/autoptimizeConfig.php:188
190
- msgid "Save Changes"
191
- msgstr "Guardar Cambios"
192
-
193
- #: classes/autoptimizeConfig.php:189
194
- msgid "Save Changes and Empty Cache"
195
- msgstr "Guardar Cambios y Vaciar el Caché"
196
-
197
- #: classes/autoptimizeConfig.php:199
198
- msgid "Autoptimize Options"
199
- msgstr "Configuración de Autoptimize"
200
-
201
- #: classes/autoptimizeConfig.php:236 classes/autoptimizeConfig.php:243
202
- msgid "Settings"
203
- msgstr "Configuración"
204
-
205
- #. Description of an extension
206
- msgid ""
207
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
208
- "compressing it."
209
- msgstr ""
210
- "Optimiza tu sitio web, concatenando el código CSS y Javascript, y "
211
- "comprimiéndolo."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-fr_FR.mo DELETED
Binary file
localization/autoptimize-fr_FR.po DELETED
@@ -1,422 +0,0 @@
1
- # Copyright (C) 2013 Autoptimize
2
- # This file is distributed under the same license as the Autoptimize package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Autoptimize 1.8.0\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
- "POT-Creation-Date: 2015-12-17 13:52+0100\n"
8
- "PO-Revision-Date: 2015-12-17 14:17+0100\n"
9
- "Last-Translator: frank goossens (futtta) <futtta@gmail.com>\n"
10
- "Language-Team: WordPress Hébergement <contact@wordpress-hebergement.fr>\n"
11
- "Language: fr\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.8.6\n"
16
-
17
- #: autoptimize.php:93
18
- msgid ""
19
- "Thank you for installing and activating Autoptimize. Please configure it "
20
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
21
- "performance."
22
- msgstr ""
23
- "Merci d'avoir installé et activé Autoptimize. Vous pouvez maintenant le "
24
- "paramétrer via \"Réglages\" -> \"Autoptimize\" et commencer à améliorer les "
25
- "performances de votre site"
26
-
27
- #: autoptimize.php:99
28
- msgid ""
29
- "Autoptimize has just been updated. Please <strong>test your site now</"
30
- "strong> and adapt Autoptimize config if needed."
31
- msgstr ""
32
- "Autoptimize vient d'être mis à jour. Vous pouvez maintenant <trong>tester "
33
- "votre site</strong> et adapter si besoin les paramètres d'Autoptimize."
34
-
35
- #: autoptimize.php:105
36
- msgid ""
37
- "Autoptimize cannot write to the cache directory (default: /wp-content/cache/"
38
- "autoptimize), please fix to enable CSS/ JS optimization!"
39
- msgstr ""
40
- "Autoptimize n’a pas les droits d’écriture sur le répertoire de cache (par "
41
- "défaut: /wp-content/cache/autoptimize). Merci de corriger cela pour "
42
- "permettre l’optimisation de vos CSS et javascripts."
43
-
44
- #: classes/autoptimizeConfig.php:48
45
- msgid "Autoptimize Settings"
46
- msgstr "Configuration d'Autoptimize"
47
-
48
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
49
- msgid "Show advanced settings"
50
- msgstr "Afficher les paramètres avancés"
51
-
52
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
53
- msgid "Hide advanced settings"
54
- msgstr "Cacher les paramètres avancés"
55
-
56
- #: classes/autoptimizeConfig.php:69
57
- msgid "HTML Options"
58
- msgstr "Options HTML"
59
-
60
- #: classes/autoptimizeConfig.php:72
61
- msgid "Optimize HTML Code?"
62
- msgstr "Optimiser le code HTML"
63
-
64
- #: classes/autoptimizeConfig.php:76
65
- msgid "Keep HTML comments?"
66
- msgstr "Préserver les commentaires HTML"
67
-
68
- #: classes/autoptimizeConfig.php:78
69
- msgid ""
70
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
71
- "AdSense to function properly."
72
- msgstr ""
73
- "Sélectionnez cette option si vous souhaitez que vos commentaires HTML "
74
- "restent dans la page (nécessaire par exemple pour qu'Adsense fonctionne)"
75
-
76
- #: classes/autoptimizeConfig.php:82
77
- msgid "JavaScript Options"
78
- msgstr "Options JavaScript"
79
-
80
- #: classes/autoptimizeConfig.php:85
81
- msgid "Optimize JavaScript Code?"
82
- msgstr "Optimiser le code JavaScript ?"
83
-
84
- #: classes/autoptimizeConfig.php:89
85
- msgid "Force JavaScript in &lt;head&gt;?"
86
- msgstr "Forcer le JavaScript à charger dans l'en-tête de la page ?"
87
-
88
- #: classes/autoptimizeConfig.php:91
89
- msgid ""
90
- "Load JavaScript early, reducing the chance of JS-errors but making it render "
91
- "blocking. You can disable this if you're not aggregating inline JS and you "
92
- "want JS to be deferred."
93
- msgstr ""
94
- "Charger le JavaScript au début, diminuant ainsi le risque d’erreurs-"
95
- "javascript, mais ralenti l’affichage de la page. Vous pouvez désactiver cela "
96
- "si vous n’agrégez pas vos javascripts en mode inline et que vous voulez que "
97
- "le chargement des javascripts soit reporté."
98
-
99
- #: classes/autoptimizeConfig.php:95
100
- msgid "Look for scripts only in &lt;head&gt;?"
101
- msgstr "Chercher les scripts uniquement dans l'en-tête ?"
102
-
103
- #: classes/autoptimizeConfig.php:95 classes/autoptimizeConfig.php:135
104
- msgid " <i>(deprecated)</i>"
105
- msgstr " <i>(obsolètes)</i>"
106
-
107
- #: classes/autoptimizeConfig.php:97
108
- msgid ""
109
- "Mostly useful in combination with previous option when using jQuery-based "
110
- "templates, but might help keeping cache size under control."
111
- msgstr ""
112
- "Surtout utile combiné aux précédentes options lorsque vous utilisez des "
113
- "templates à base de jQuery, mais peut aussi permettre de diminuer la taille "
114
- "du cache."
115
-
116
- #: classes/autoptimizeConfig.php:101
117
- msgid "Also aggregate inline JS?"
118
- msgstr "Agréger aussi les javascripts inline?"
119
-
120
- #: classes/autoptimizeConfig.php:103
121
- msgid ""
122
- "Check this option for Autoptimize to also aggregate JS in the HTML. If this "
123
- "option is not enabled, you might have to \"force JavaScript in head\"."
124
- msgstr ""
125
- "Cochez cette option pour qu’Autoptimize agrège également le javascript dans "
126
- "le code HTML. Si cette option n’est pas activée, vous devrez peut-être « "
127
- "forcer le JavaScript à charger dans l’en-tête de la page »."
128
-
129
- #: classes/autoptimizeConfig.php:106
130
- msgid "Exclude scripts from Autoptimize:"
131
- msgstr "Scripts à exclure d'Autoptimize"
132
-
133
- #: classes/autoptimizeConfig.php:108
134
- msgid ""
135
- "A comma-seperated list of scripts you want to exclude from being optimized, "
136
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
137
- "scripts from being aggregated and minimized by Autoptimize."
138
- msgstr ""
139
- "Liste des scripts - séparés par des virgules - que vous ne souhaitez pas "
140
- "Autoptimiser. Par exemple: 'monscript.js, monautrescript.js' (sans les "
141
- "gullemets) pour exclure ces scripts de l'aggrégation et la compression "
142
- "réalisée par Autoptimize."
143
-
144
- #: classes/autoptimizeConfig.php:111
145
- msgid "Add try-catch wrapping?"
146
- msgstr "Ajouter une gestion des erreurs (trycatch) ?"
147
-
148
- #: classes/autoptimizeConfig.php:113
149
- msgid ""
150
- "If your scripts break because of a JS-error, you might want to try this."
151
- msgstr ""
152
- "Si vos scripts cassent à cause d’une erreur JS, vous pourriez vouloir "
153
- "essayer ceci."
154
-
155
- #: classes/autoptimizeConfig.php:117
156
- msgid "CSS Options"
157
- msgstr "Options CSS"
158
-
159
- #: classes/autoptimizeConfig.php:120
160
- msgid "Optimize CSS Code?"
161
- msgstr "Optimiser le code CSS"
162
-
163
- #: classes/autoptimizeConfig.php:124
164
- msgid "Generate data: URIs for images?"
165
- msgstr "Génération de données: URI pour les images?"
166
-
167
- #: classes/autoptimizeConfig.php:126
168
- msgid ""
169
- "Enable this to include small background-images in the CSS itself instead of "
170
- "as seperate downloads."
171
- msgstr ""
172
- "Sélectionnez cette option pour inclure les petites images de fond dans le "
173
- "CSS lui-même au lieu d'un chargement séparé."
174
-
175
- #: classes/autoptimizeConfig.php:129
176
- msgid "Remove Google Fonts?"
177
- msgstr "Supprimer les polices Google ?"
178
-
179
- #: classes/autoptimizeConfig.php:131
180
- msgid "Check this if you don't need or want Google Fonts being loaded."
181
- msgstr ""
182
- "Cochez cette case si vous n’avez pas besoin ou ne souhaitez pas que les "
183
- "polices Google Fonts soient chargées."
184
-
185
- #: classes/autoptimizeConfig.php:135
186
- msgid "Look for styles only in &lt;head&gt;?"
187
- msgstr "Ne rechercher les styles que dans l'en-tête ?"
188
-
189
- #: classes/autoptimizeConfig.php:137
190
- msgid ""
191
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
192
- "might want to enable this."
193
- msgstr ""
194
- "N'optimise pas les CSS situés en dehors de l'en-tête. Si votre cache devient "
195
- "trop important, vous pouvez utliser cette option."
196
-
197
- #: classes/autoptimizeConfig.php:141
198
- msgid "Also aggregate inline CSS?"
199
- msgstr "Agréger aussi les CSS inline?"
200
-
201
- #: classes/autoptimizeConfig.php:143
202
- msgid "Check this option for Autoptimize to also aggregate CSS in the HTML."
203
- msgstr ""
204
- "Cochez cette option pour qu’Autoptimize agrège aussi les CSS dans le fichier "
205
- "HTML."
206
-
207
- #: classes/autoptimizeConfig.php:146
208
- msgid "Inline and Defer CSS?"
209
- msgstr "Inclure CSS principal dans l'HTML, reporter le reste."
210
-
211
- #: classes/autoptimizeConfig.php:148
212
- msgid ""
213
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
214
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
215
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
216
- msgstr ""
217
- "Include le CSS principal dans le code HTML, mais ne chargez les CSS "
218
- "optimizées qu'après le chargement du page. <strong>Avertissement</strong>: "
219
- "<a href=\"http://wordpress.org/plugins/autoptimize/faq/\" target=\"_blank"
220
- "\">Lisez le FAQ (en Anglais)</a> avant d'activer cette option!"
221
-
222
- #: classes/autoptimizeConfig.php:152
223
- msgid "Paste the above the fold CSS here."
224
- msgstr "Copiéz le CSS principal (\"above the fold\") ici."
225
-
226
- #: classes/autoptimizeConfig.php:155
227
- msgid "Inline all CSS?"
228
- msgstr "Mettez tout les CSS dans votre code HTML."
229
-
230
- #: classes/autoptimizeConfig.php:157
231
- msgid ""
232
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
233
- "visitor-rate, but may slow down performance otherwise."
234
- msgstr ""
235
- "Mettre les CSS dans le code HTML peut améliorer la performance moyenne si "
236
- "votre site atteint une ratio vue pages/ visiteurs baisse, sinon la "
237
- "performance moyenne pourrait être plus mauvaise."
238
-
239
- #: classes/autoptimizeConfig.php:160
240
- msgid "Exclude CSS from Autoptimize:"
241
- msgstr "Exclure ces CSS d'Autoptimise."
242
-
243
- #: classes/autoptimizeConfig.php:162
244
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
245
- msgstr ""
246
- "Liste des fichiers CSS - séparés par des virgules - que vous souhaitez "
247
- "exclure de l'Autoptimisation."
248
-
249
- #: classes/autoptimizeConfig.php:166
250
- msgid "CDN Options"
251
- msgstr "Options CDN"
252
-
253
- #: classes/autoptimizeConfig.php:169
254
- msgid "CDN Base URL"
255
- msgstr "Base URL du CDN"
256
-
257
- #: classes/autoptimizeConfig.php:171
258
- msgid ""
259
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
260
- "referenced in the CSS."
261
- msgstr ""
262
- "Saisissez l'URL du répertoire racine de votre site si vous souhaitez "
263
- "utiliser un CDN pour les images référencés dans le CSS."
264
-
265
- #: classes/autoptimizeConfig.php:175
266
- msgid "Cache Info"
267
- msgstr "Informations du cache"
268
-
269
- #: classes/autoptimizeConfig.php:178
270
- msgid "Cache folder"
271
- msgstr "Répertoire du cache"
272
-
273
- #: classes/autoptimizeConfig.php:182
274
- msgid "Can we write?"
275
- msgstr "Droits d'écriture ?"
276
-
277
- #: classes/autoptimizeConfig.php:183
278
- msgid "Yes"
279
- msgstr "Oui"
280
-
281
- #: classes/autoptimizeConfig.php:183
282
- msgid "No"
283
- msgstr "Non"
284
-
285
- #: classes/autoptimizeConfig.php:186
286
- msgid "Cached styles and scripts"
287
- msgstr "Styles et scripts en cache"
288
-
289
- #: classes/autoptimizeConfig.php:194
290
- msgid "Save aggregated script/css as static files?"
291
- msgstr "Enregistrer les scripts/css en tant que fichiers statiques ?"
292
-
293
- #: classes/autoptimizeConfig.php:196
294
- msgid ""
295
- "By default files saved are static css/js, uncheck this option if your "
296
- "webserver doesn't properly handle the compression and expiry."
297
- msgstr ""
298
- "Par defaut les fichiers JS/ CSS seront servi d'une manière statique. "
299
- "Désactivez cette option si votre serveur web ne peut pas gérer la "
300
- "compression et l'expiration des fichiers."
301
-
302
- #: classes/autoptimizeConfig.php:202
303
- msgid "Save Changes"
304
- msgstr "Enregistrer les modifications"
305
-
306
- #: classes/autoptimizeConfig.php:203
307
- msgid "Save Changes and Empty Cache"
308
- msgstr "Enregistrer les modifications et vider le cache"
309
-
310
- #: classes/autoptimizeConfig.php:224
311
- msgid ""
312
- "Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check "
313
- "out the FAQ</a> or post your question on <a href='http://wordpress.org/"
314
- "support/plugin/autoptimize'>the support-forum</a>."
315
- msgstr ""
316
- "Besoin d’aide ? <a href=‘https://wordpress.org/plugins/autoptimize/"
317
- "faq/'>Consultez la FAQ</a> ou posez votre question sur <a href=‘http://"
318
- "wordpress.org/support/plugin/autoptimize'>le forum de support</a>."
319
-
320
- #: classes/autoptimizeConfig.php:225
321
- msgid "Happy with Autoptimize?"
322
- msgstr "Heureux avec Autoptimize ?"
323
-
324
- #: classes/autoptimizeConfig.php:225
325
- msgid "Try my other plugins!"
326
- msgstr "Essayez mes autres plugins !"
327
-
328
- #: classes/autoptimizeConfig.php:231
329
- msgid "futtta about"
330
- msgstr "futta à propos de"
331
-
332
- #. Plugin Name of the plugin/theme
333
- #: classes/autoptimizeConfig.php:233
334
- msgid "Autoptimize"
335
- msgstr "Autoptimize"
336
-
337
- #: classes/autoptimizeConfig.php:234
338
- msgid "WordPress"
339
- msgstr "WordPress"
340
-
341
- #: classes/autoptimizeConfig.php:235
342
- msgid "Web Technology"
343
- msgstr "La technologie Web"
344
-
345
- #: classes/autoptimizeConfig.php:250
346
- msgid "Do not donate for this plugin!"
347
- msgstr "Ne faites pas de don pas pour ce plugin!"
348
-
349
- #: classes/autoptimizeConfig.php:370
350
- msgid "Autoptimize Options"
351
- msgstr "Options Autoptimize "
352
-
353
- #: classes/autoptimizeConfig.php:419 classes/autoptimizeConfig.php:425
354
- msgid "Settings"
355
- msgstr "Paramètres"
356
-
357
- #: classes/autoptimizeConfig.php:488
358
- msgid "No items"
359
- msgstr "Aucun élément"
360
-
361
- #: classes/autoptimizeConfig.php:493
362
- msgid "Posted %s"
363
- msgstr "Publié %s"
364
-
365
- #: classlesses/autoptimizeCacheChecker.php:50
366
- msgid ""
367
- "Autoptimize's cache size is getting big, consider purging the cache.<br /"
368
- "><br />Have a look at <a href=\"https://wordpress.org/plugins/autoptimize/"
369
- "faq/\" target=\"_blank\">the Autoptimize FAQ</a> to see how you can keep the "
370
- "cache size under control."
371
- msgstr ""
372
- "La taille de cache d’Autoptimize devient importante, pensez à purger le "
373
- "cache.<br><br>Jetez un oeil à <a href=\"https://wordpress.org/plugins/"
374
- "autoptimize/faq/\"  target=\"_blank\">La FAQ de Autoptimize</a> pour voir "
375
- "comment vous pouvez maîtriser la taille du cache."
376
-
377
- #. Plugin URI of the plugin/theme
378
- msgid "http://blog.futtta.be/autoptimize"
379
- msgstr "http://blog.futtta.be/autoptimize"
380
-
381
- #. Description of the plugin/theme
382
- msgid ""
383
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
384
- "compressing it."
385
- msgstr ""
386
- "Optimise votre site web en rassemblant les CSS et JavaScript et en les "
387
- "compressant."
388
-
389
- #. Author of the plugin/theme
390
- msgid "Frank Goossens (futtta)"
391
- msgstr "Frank Goossens (futtta)"
392
-
393
- #. Author URI of the plugin/theme
394
- msgid "http://blog.futtta.be/"
395
- msgstr "http://blog.futtta.be/"
396
-
397
- #~ msgid ""
398
- #~ "For performance reasons it is better to include JavaScript at the bottom "
399
- #~ "of HTML, but this sometimes breaks things. Especially useful for jQuery-"
400
- #~ "based themes."
401
- #~ msgstr ""
402
- #~ "Pour améliorer les performances, il est préférable d'inclure le "
403
- #~ "JavaScript à la fin du code HTML, mais cela peut parfois 'casser' "
404
- #~ "certaines pages (notamment pour les thèmes à base de jQuery)."
405
-
406
- #~ msgid ""
407
- #~ "If your scripts break because of an script error, you might want to try "
408
- #~ "this."
409
- #~ msgstr ""
410
- #~ "Si votre script est 'cassé' par des erreurs, vous pouvez essayer cette "
411
- #~ "option."
412
-
413
- #~ msgid "Defer CSS loading?"
414
- #~ msgstr "Reporter le chargement des CSS"
415
-
416
- #~ msgid ""
417
- #~ "Normally CSS is loaded in the &lt;head&gt;-section of the HTML, but for "
418
- #~ "mobile performance reasons having it deferred can be better."
419
- #~ msgstr ""
420
- #~ "Normalement, les CSS sont chargés dans l'en-tête du code HTML, mais pour "
421
- #~ "améliorer les performances de lecture par un terminal mobile, il peut "
422
- #~ "être préférable de reporter ce chargement."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-nl_BE.mo DELETED
Binary file
localization/autoptimize-nl_BE.po DELETED
@@ -1,385 +0,0 @@
1
- # Translation of Development (trunk) in Dutch
2
- # This file is distributed under the same license as the Development (trunk) package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Development (trunk)\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
- "POT-Creation-Date: 2015-12-08 22:03:53+00:00\n"
8
- "PO-Revision-Date: 2015-12-15 15:06+0100\n"
9
- "Last-Translator: \n"
10
- "Language-Team: \n"
11
- "Language: nl\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
- "X-Generator: Poedit 1.6.8\n"
17
-
18
- #: autoptimize.php:93
19
- msgid ""
20
- "Thank you for installing and activating Autoptimize. Please configure it "
21
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
22
- "performance."
23
- msgstr ""
24
- "Tof dat je Autoptimize geïnstalleerd hebt! Je kunt de plugin nu configureren "
25
- "onder \"Instellingen\" -> \"Autoptimize\"."
26
-
27
- #: autoptimize.php:99
28
- msgid ""
29
- "Autoptimize has just been updated. Please <strong>test your site now</"
30
- "strong> and adapt Autoptimize config if needed."
31
- msgstr ""
32
- "Autoptimize is juist geüpdate, <strong>test je site nu</strong> en wijzig de "
33
- "Autoptimize instellingen indien nodig."
34
-
35
- #: autoptimize.php:105
36
- msgid ""
37
- "Autoptimize cannot write to the cache directory (default: /wp-content/cache/"
38
- "autoptimize), please fix to enable CSS/ JS optimization!"
39
- msgstr ""
40
- "Autoptimize kan niet naar het cache directory schrijven (standaard: /wp-"
41
- "content/cache/autoptimize), probeer dit te wijzigen om CSS/ JS optimalisatie "
42
- "mogelijk te maken!"
43
-
44
- #: classes/autoptimizeConfig.php:48
45
- msgid "Autoptimize Settings"
46
- msgstr "Autoptimize Instellingen"
47
-
48
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
49
- msgid "Show advanced settings"
50
- msgstr "Toon geadvanceerde instellingen"
51
-
52
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
53
- msgid "Hide advanced settings"
54
- msgstr "Verberg geadvanceerde instellingen"
55
-
56
- #: classes/autoptimizeConfig.php:69
57
- msgid "HTML Options"
58
- msgstr "HTML Opties"
59
-
60
- #: classes/autoptimizeConfig.php:72
61
- msgid "Optimize HTML Code?"
62
- msgstr "Optimaliseer HTML Code?"
63
-
64
- #: classes/autoptimizeConfig.php:76
65
- msgid "Keep HTML comments?"
66
- msgstr "HTML commentaar bewaren?"
67
-
68
- #: classes/autoptimizeConfig.php:78
69
- msgid ""
70
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
71
- "AdSense to function properly."
72
- msgstr ""
73
- "Activeer deze optie om commentaar-blokken in de HTML te behouden, nodig voor "
74
- "onder andere bepaalde AdSense configuraties."
75
-
76
- #: classes/autoptimizeConfig.php:82
77
- msgid "JavaScript Options"
78
- msgstr "JavaScript Opties"
79
-
80
- #: classes/autoptimizeConfig.php:85
81
- msgid "Optimize JavaScript Code?"
82
- msgstr "Optimaliseer JavaScript Code?"
83
-
84
- #: classes/autoptimizeConfig.php:89
85
- msgid "Force JavaScript in &lt;head&gt;?"
86
- msgstr "Duw JavaScript in &lt;head&gt;?"
87
-
88
- #: classes/autoptimizeConfig.php:91
89
- msgid ""
90
- "Load JavaScript early, reducing the chance of JS-errors but making it render "
91
- "blocking. You can disable this if you're not aggregating inline JS and you "
92
- "want JS to be deferred."
93
- msgstr ""
94
- "Door JavaScript vroeg te laden, verminder je de kans op JS-fouten, maar maak "
95
- "je die wel blokkerend voor de rendering van je pagina. Je kunt deze optie "
96
- "uitzetten als je de inline JS mee aggregeert en de JS laat wilt laden. "
97
-
98
- #: classes/autoptimizeConfig.php:95
99
- msgid "Look for scripts only in &lt;head&gt;?"
100
- msgstr "Haal javascript enkel uit &lt;head&gt;?"
101
-
102
- #: classes/autoptimizeConfig.php:95 classes/autoptimizeConfig.php:135
103
- msgid " <i>(deprecated)</i>"
104
- msgstr " <i>(verouderd)</i>"
105
-
106
- #: classes/autoptimizeConfig.php:97
107
- msgid ""
108
- "Mostly useful in combination with previous option when using jQuery-based "
109
- "templates, but might help keeping cache size under control."
110
- msgstr ""
111
- "Vooral nuttig in combinatie met de vorige optie voor jQuery-gebaseerde "
112
- "sites, maar kan ook helpen om de cache-size onder controle te houden."
113
-
114
- #: classes/autoptimizeConfig.php:101
115
- msgid "Also aggregate inline JS?"
116
- msgstr "Inline JS ook aggregeren en optimaliseren? "
117
-
118
- #: classes/autoptimizeConfig.php:103
119
- msgid ""
120
- "Check this option for Autoptimize to also aggregate JS in the HTML. If this "
121
- "option is not enabled, you might have to \"force JavaScript in head\"."
122
- msgstr ""
123
- "Activeer deze optie om Autoptimize ook JS in the HTML te laten aggregeren. "
124
- "Als deze optie niet aanstaan, moet je de optie om Javascript vroeg te laden "
125
- "misschien aanzetten."
126
-
127
- #: classes/autoptimizeConfig.php:106
128
- msgid "Exclude scripts from Autoptimize:"
129
- msgstr "Sluit deze scripts uit van optimalisering:"
130
-
131
- #: classes/autoptimizeConfig.php:108
132
- msgid ""
133
- "A comma-seperated list of scripts you want to exclude from being optimized, "
134
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
135
- "scripts from being aggregated and minimized by Autoptimize."
136
- msgstr ""
137
- "Lijst van scripts die je wilt uitsluiten van optimalisatie, gescheiden door "
138
- "komma's. Voorbeeld; 'whatever.js, another.js' (zonder de quotes)."
139
-
140
- #: classes/autoptimizeConfig.php:111
141
- msgid "Add try-catch wrapping?"
142
- msgstr "Voeg try-catch toe rond javascript?"
143
-
144
- #: classes/autoptimizeConfig.php:113
145
- msgid ""
146
- "If your scripts break because of a JS-error, you might want to try this."
147
- msgstr "Als je errors krijgt bij javascript-aggregatie, kun je dit proberen."
148
-
149
- #: classes/autoptimizeConfig.php:117
150
- msgid "CSS Options"
151
- msgstr "CSS Opties"
152
-
153
- #: classes/autoptimizeConfig.php:120
154
- msgid "Optimize CSS Code?"
155
- msgstr "Optimaliseer CSS Code?"
156
-
157
- #: classes/autoptimizeConfig.php:124
158
- msgid "Generate data: URIs for images?"
159
- msgstr "Vervang image-links in CSS door data: URIs?"
160
-
161
- #: classes/autoptimizeConfig.php:126
162
- msgid ""
163
- "Enable this to include small background-images in the CSS itself instead of "
164
- "as seperate downloads."
165
- msgstr ""
166
- "Acitveer deze optie om kleine background-images in de CSS te bewaren in "
167
- "plaats van aparte files."
168
-
169
- #: classes/autoptimizeConfig.php:129
170
- msgid "Remove Google Fonts?"
171
- msgstr "Google Fonts verwijderen?"
172
-
173
- #: classes/autoptimizeConfig.php:131
174
- msgid "Check this if you don't need or want Google Fonts being loaded."
175
- msgstr "Vink deze optie aan als je geen Google Fonts wilt laden."
176
-
177
- #: classes/autoptimizeConfig.php:135
178
- msgid "Look for styles only in &lt;head&gt;?"
179
- msgstr "Haal CSS enkel uit &lt;head&gt;?"
180
-
181
- #: classes/autoptimizeConfig.php:137
182
- msgid ""
183
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
184
- "might want to enable this."
185
- msgstr ""
186
- "De CSS buiten de &lt;head&gt; niet mee optimaliseren. Kan helpen om de cache-"
187
- "omvang te beperken."
188
-
189
- #: classes/autoptimizeConfig.php:141
190
- msgid "Also aggregate inline CSS?"
191
- msgstr "CSS in HTML ook aggregeren en optimaliseren?"
192
-
193
- #: classes/autoptimizeConfig.php:143
194
- msgid "Check this option for Autoptimize to also aggregate CSS in the HTML."
195
- msgstr ""
196
- "Activeer deze optie om Autoptimize ook CSS in de HTML te laten aggregeren. "
197
-
198
- #: classes/autoptimizeConfig.php:146
199
- msgid "Inline and Defer CSS?"
200
- msgstr "Basis CSS in HTML laden, de rest uitstellen?"
201
-
202
- #: classes/autoptimizeConfig.php:148
203
- msgid ""
204
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
205
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
206
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
207
- msgstr ""
208
- "De \"above the fold CSS\" in de HTML laden, de rest van de geoptimaliseerde "
209
- "CSS pas na de volledige pagina. <a href=\"http://wordpress.org/plugins/"
210
- "autoptimize/faq/\" target=\"_blank\">Bekijk de FAQ</a> voor je deze optie "
211
- "activeert!"
212
-
213
- #: classes/autoptimizeConfig.php:152
214
- msgid "Paste the above the fold CSS here."
215
- msgstr "Kopiëer de above the fold CSS hier."
216
-
217
- #: classes/autoptimizeConfig.php:155
218
- msgid "Inline all CSS?"
219
- msgstr "Alle CSS rechtstreeks in HTML laden?"
220
-
221
- #: classes/autoptimizeConfig.php:157
222
- msgid ""
223
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
224
- "visitor-rate, but may slow down performance otherwise."
225
- msgstr ""
226
- "Alle CSS rechtstreeks in de HTML laden kan de gemiddelde performantie voor "
227
- "sites met een lage pageview/ bezoeker-ratio verbeteren, maar zal in andere "
228
- "gevallen de performantie verslechteren."
229
-
230
- #: classes/autoptimizeConfig.php:160
231
- msgid "Exclude CSS from Autoptimize:"
232
- msgstr "Sluit deze CSS uit van optimalisering:"
233
-
234
- #: classes/autoptimizeConfig.php:162
235
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
236
- msgstr ""
237
- "Lijst van CSS die je wilt uitsluiten van optimalisatie, gescheiden door "
238
- "komma's. Voorbeeld; 'whatever.css, style.css' (zonder de quotes)."
239
-
240
- #: classes/autoptimizeConfig.php:166
241
- msgid "CDN Options"
242
- msgstr "CDN Opties"
243
-
244
- #: classes/autoptimizeConfig.php:169
245
- msgid "CDN Base URL"
246
- msgstr "Basis CDN URL"
247
-
248
- #: classes/autoptimizeConfig.php:171
249
- msgid ""
250
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
251
- "referenced in the CSS."
252
- msgstr ""
253
- "Vul hier je CDN blog root directory URL in om afbeeldingen in je CSS via je "
254
- "CDN te laden."
255
-
256
- #: classes/autoptimizeConfig.php:175
257
- msgid "Cache Info"
258
- msgstr "Cache Info"
259
-
260
- #: classes/autoptimizeConfig.php:178
261
- msgid "Cache folder"
262
- msgstr "Cache folder"
263
-
264
- #: classes/autoptimizeConfig.php:182
265
- msgid "Can we write?"
266
- msgstr "Kunnen we schrijven naar die folder?"
267
-
268
- #: classes/autoptimizeConfig.php:183
269
- msgid "Yes"
270
- msgstr "Ja"
271
-
272
- #: classes/autoptimizeConfig.php:183
273
- msgid "No"
274
- msgstr "Nee"
275
-
276
- #: classes/autoptimizeConfig.php:186
277
- msgid "Cached styles and scripts"
278
- msgstr "CSS en scripts in cache"
279
-
280
- #: classes/autoptimizeConfig.php:194
281
- msgid "Save aggregated script/css as static files?"
282
- msgstr "Bewaar geoptimaliseerde CSS en JS als statische bestanden?"
283
-
284
- #: classes/autoptimizeConfig.php:196
285
- msgid ""
286
- "By default files saved are static css/js, uncheck this option if your "
287
- "webserver doesn't properly handle the compression and expiry."
288
- msgstr ""
289
- "Standaard worden bestanden als statische css/js bewaard, deactiveer deze "
290
- "optie als je webserver compressie en cache-baarheid niet zelf kan afhandelen."
291
-
292
- #: classes/autoptimizeConfig.php:202
293
- msgid "Save Changes"
294
- msgstr "Bewaar wijzigingen"
295
-
296
- #: classes/autoptimizeConfig.php:203
297
- msgid "Save Changes and Empty Cache"
298
- msgstr "Bewaar en maak cache leeg."
299
-
300
- #: classes/autoptimizeConfig.php:224
301
- msgid ""
302
- "Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check "
303
- "out the FAQ</a> or post your question on <a href='http://wordpress.org/"
304
- "support/plugin/autoptimize'>the support-forum</a>."
305
- msgstr ""
306
- "Hulp nodig? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Bekijk "
307
- "de FAQ</a> of post je vraag in <a href='http://wordpress.org/support/plugin/"
308
- "autoptimize'>het support-forum</a>. "
309
-
310
- #: classes/autoptimizeConfig.php:225
311
- msgid "Happy with Autoptimize?"
312
- msgstr "Tevreden met Autoptimize?"
313
-
314
- #: classes/autoptimizeConfig.php:225
315
- msgid "Try my other plugins!"
316
- msgstr "Probeer mijn andere plugins!"
317
-
318
- #: classes/autoptimizeConfig.php:231
319
- msgid "futtta about"
320
- msgstr "futtta over"
321
-
322
- #. Plugin Name of the plugin/theme
323
- #: classes/autoptimizeConfig.php:233
324
- msgid "Autoptimize"
325
- msgstr "Autoptimize"
326
-
327
- #: classes/autoptimizeConfig.php:234
328
- msgid "WordPress"
329
- msgstr "WordPress"
330
-
331
- #: classes/autoptimizeConfig.php:235
332
- msgid "Web Technology"
333
- msgstr "Web Technologie"
334
-
335
- #: classes/autoptimizeConfig.php:250
336
- msgid "Do not donate for this plugin!"
337
- msgstr "Geef geen geld voor deze plugin!"
338
-
339
- #: classes/autoptimizeConfig.php:370
340
- msgid "Autoptimize Options"
341
- msgstr "Autoptimize Opties"
342
-
343
- #: classes/autoptimizeConfig.php:419 classes/autoptimizeConfig.php:425
344
- msgid "Settings"
345
- msgstr "Instellingen"
346
-
347
- #: classes/autoptimizeConfig.php:488
348
- msgid "No items"
349
- msgstr "Geen items"
350
-
351
- #: classes/autoptimizeConfig.php:493
352
- msgid "Posted %s"
353
- msgstr "Gepost op %s"
354
-
355
- #: classlesses/autoptimizeCacheChecker.php:50
356
- msgid ""
357
- "Autoptimize's cache size is getting big, consider purging the cache.<br /"
358
- "><br />Have a look at <a href=\"https://wordpress.org/plugins/autoptimize/"
359
- "faq/\" target=\"_blank\">the Autoptimize FAQ</a> to see how you can keep the "
360
- "cache size under control."
361
- msgstr ""
362
- "Er zitten veel files in Autoptimize's cache, overweeg om die leeg te maken."
363
- "<br /><br />In <a href=\"https://wordpress.org/plugins/autoptimize/faq/\" "
364
- "target=\"_blank\">de Autoptimize FAQ</a> vind je meer info over hoe je de "
365
- "cache onder controle kunt houden. "
366
-
367
- #. Plugin URI of the plugin/theme
368
- msgid "http://blog.futtta.be/autoptimize"
369
- msgstr "http://blog.futtta.be/autoptimize"
370
-
371
- #. Description of the plugin/theme
372
- msgid ""
373
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
374
- "compressing it."
375
- msgstr ""
376
- "Optimaliseert je website door CSS en JavaScript te combineren en samen te "
377
- "drukken."
378
-
379
- #. Author of the plugin/theme
380
- msgid "Frank Goossens (futtta)"
381
- msgstr "Frank Goossens (futtta)"
382
-
383
- #. Author URI of the plugin/theme
384
- msgid "http://blog.futtta.be/"
385
- msgstr "http://blog.futtta.be/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-nl_NL.mo DELETED
Binary file
localization/autoptimize-nl_NL.po DELETED
@@ -1,385 +0,0 @@
1
- # Translation of Development (trunk) in Dutch
2
- # This file is distributed under the same license as the Development (trunk) package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Development (trunk)\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
- "POT-Creation-Date: 2015-12-08 22:03:53+00:00\n"
8
- "PO-Revision-Date: 2015-12-15 15:06+0100\n"
9
- "Last-Translator: \n"
10
- "Language-Team: \n"
11
- "Language: nl\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
- "X-Generator: Poedit 1.6.8\n"
17
-
18
- #: autoptimize.php:93
19
- msgid ""
20
- "Thank you for installing and activating Autoptimize. Please configure it "
21
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
22
- "performance."
23
- msgstr ""
24
- "Tof dat je Autoptimize geïnstalleerd hebt! Je kunt de plugin nu configureren "
25
- "onder \"Instellingen\" -> \"Autoptimize\"."
26
-
27
- #: autoptimize.php:99
28
- msgid ""
29
- "Autoptimize has just been updated. Please <strong>test your site now</"
30
- "strong> and adapt Autoptimize config if needed."
31
- msgstr ""
32
- "Autoptimize is juist geüpdate, <strong>test je site nu</strong> en wijzig de "
33
- "Autoptimize instellingen indien nodig."
34
-
35
- #: autoptimize.php:105
36
- msgid ""
37
- "Autoptimize cannot write to the cache directory (default: /wp-content/cache/"
38
- "autoptimize), please fix to enable CSS/ JS optimization!"
39
- msgstr ""
40
- "Autoptimize kan niet naar het cache directory schrijven (standaard: /wp-"
41
- "content/cache/autoptimize), probeer dit te wijzigen om CSS/ JS optimalisatie "
42
- "mogelijk te maken!"
43
-
44
- #: classes/autoptimizeConfig.php:48
45
- msgid "Autoptimize Settings"
46
- msgstr "Autoptimize Instellingen"
47
-
48
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
49
- msgid "Show advanced settings"
50
- msgstr "Toon geadvanceerde instellingen"
51
-
52
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
53
- msgid "Hide advanced settings"
54
- msgstr "Verberg geadvanceerde instellingen"
55
-
56
- #: classes/autoptimizeConfig.php:69
57
- msgid "HTML Options"
58
- msgstr "HTML Opties"
59
-
60
- #: classes/autoptimizeConfig.php:72
61
- msgid "Optimize HTML Code?"
62
- msgstr "Optimaliseer HTML Code?"
63
-
64
- #: classes/autoptimizeConfig.php:76
65
- msgid "Keep HTML comments?"
66
- msgstr "HTML commentaar bewaren?"
67
-
68
- #: classes/autoptimizeConfig.php:78
69
- msgid ""
70
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
71
- "AdSense to function properly."
72
- msgstr ""
73
- "Activeer deze optie om commentaar-blokken in de HTML te behouden, nodig voor "
74
- "onder andere bepaalde AdSense configuraties."
75
-
76
- #: classes/autoptimizeConfig.php:82
77
- msgid "JavaScript Options"
78
- msgstr "JavaScript Opties"
79
-
80
- #: classes/autoptimizeConfig.php:85
81
- msgid "Optimize JavaScript Code?"
82
- msgstr "Optimaliseer JavaScript Code?"
83
-
84
- #: classes/autoptimizeConfig.php:89
85
- msgid "Force JavaScript in &lt;head&gt;?"
86
- msgstr "Duw JavaScript in &lt;head&gt;?"
87
-
88
- #: classes/autoptimizeConfig.php:91
89
- msgid ""
90
- "Load JavaScript early, reducing the chance of JS-errors but making it render "
91
- "blocking. You can disable this if you're not aggregating inline JS and you "
92
- "want JS to be deferred."
93
- msgstr ""
94
- "Door JavaScript vroeg te laden, verminder je de kans op JS-fouten, maar maak "
95
- "je die wel blokkerend voor de rendering van je pagina. Je kunt deze optie "
96
- "uitzetten als je de inline JS mee aggregeert en de JS laat wilt laden. "
97
-
98
- #: classes/autoptimizeConfig.php:95
99
- msgid "Look for scripts only in &lt;head&gt;?"
100
- msgstr "Haal javascript enkel uit &lt;head&gt;?"
101
-
102
- #: classes/autoptimizeConfig.php:95 classes/autoptimizeConfig.php:135
103
- msgid " <i>(deprecated)</i>"
104
- msgstr " <i>(verouderd)</i>"
105
-
106
- #: classes/autoptimizeConfig.php:97
107
- msgid ""
108
- "Mostly useful in combination with previous option when using jQuery-based "
109
- "templates, but might help keeping cache size under control."
110
- msgstr ""
111
- "Vooral nuttig in combinatie met de vorige optie voor jQuery-gebaseerde "
112
- "sites, maar kan ook helpen om de cache-size onder controle te houden."
113
-
114
- #: classes/autoptimizeConfig.php:101
115
- msgid "Also aggregate inline JS?"
116
- msgstr "Inline JS ook aggregeren en optimaliseren? "
117
-
118
- #: classes/autoptimizeConfig.php:103
119
- msgid ""
120
- "Check this option for Autoptimize to also aggregate JS in the HTML. If this "
121
- "option is not enabled, you might have to \"force JavaScript in head\"."
122
- msgstr ""
123
- "Activeer deze optie om Autoptimize ook JS in the HTML te laten aggregeren. "
124
- "Als deze optie niet aanstaan, moet je de optie om Javascript vroeg te laden "
125
- "misschien aanzetten."
126
-
127
- #: classes/autoptimizeConfig.php:106
128
- msgid "Exclude scripts from Autoptimize:"
129
- msgstr "Sluit deze scripts uit van optimalisering:"
130
-
131
- #: classes/autoptimizeConfig.php:108
132
- msgid ""
133
- "A comma-seperated list of scripts you want to exclude from being optimized, "
134
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
135
- "scripts from being aggregated and minimized by Autoptimize."
136
- msgstr ""
137
- "Lijst van scripts die je wilt uitsluiten van optimalisatie, gescheiden door "
138
- "komma's. Voorbeeld; 'whatever.js, another.js' (zonder de quotes)."
139
-
140
- #: classes/autoptimizeConfig.php:111
141
- msgid "Add try-catch wrapping?"
142
- msgstr "Voeg try-catch toe rond javascript?"
143
-
144
- #: classes/autoptimizeConfig.php:113
145
- msgid ""
146
- "If your scripts break because of a JS-error, you might want to try this."
147
- msgstr "Als je errors krijgt bij javascript-aggregatie, kun je dit proberen."
148
-
149
- #: classes/autoptimizeConfig.php:117
150
- msgid "CSS Options"
151
- msgstr "CSS Opties"
152
-
153
- #: classes/autoptimizeConfig.php:120
154
- msgid "Optimize CSS Code?"
155
- msgstr "Optimaliseer CSS Code?"
156
-
157
- #: classes/autoptimizeConfig.php:124
158
- msgid "Generate data: URIs for images?"
159
- msgstr "Vervang image-links in CSS door data: URIs?"
160
-
161
- #: classes/autoptimizeConfig.php:126
162
- msgid ""
163
- "Enable this to include small background-images in the CSS itself instead of "
164
- "as seperate downloads."
165
- msgstr ""
166
- "Acitveer deze optie om kleine background-images in de CSS te bewaren in "
167
- "plaats van aparte files."
168
-
169
- #: classes/autoptimizeConfig.php:129
170
- msgid "Remove Google Fonts?"
171
- msgstr "Google Fonts verwijderen?"
172
-
173
- #: classes/autoptimizeConfig.php:131
174
- msgid "Check this if you don't need or want Google Fonts being loaded."
175
- msgstr "Vink deze optie aan als je geen Google Fonts wilt laden."
176
-
177
- #: classes/autoptimizeConfig.php:135
178
- msgid "Look for styles only in &lt;head&gt;?"
179
- msgstr "Haal CSS enkel uit &lt;head&gt;?"
180
-
181
- #: classes/autoptimizeConfig.php:137
182
- msgid ""
183
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
184
- "might want to enable this."
185
- msgstr ""
186
- "De CSS buiten de &lt;head&gt; niet mee optimaliseren. Kan helpen om de cache-"
187
- "omvang te beperken."
188
-
189
- #: classes/autoptimizeConfig.php:141
190
- msgid "Also aggregate inline CSS?"
191
- msgstr "CSS in HTML ook aggregeren en optimaliseren?"
192
-
193
- #: classes/autoptimizeConfig.php:143
194
- msgid "Check this option for Autoptimize to also aggregate CSS in the HTML."
195
- msgstr ""
196
- "Activeer deze optie om Autoptimize ook CSS in de HTML te laten aggregeren. "
197
-
198
- #: classes/autoptimizeConfig.php:146
199
- msgid "Inline and Defer CSS?"
200
- msgstr "Basis CSS in HTML laden, de rest uitstellen?"
201
-
202
- #: classes/autoptimizeConfig.php:148
203
- msgid ""
204
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
205
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
206
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
207
- msgstr ""
208
- "De \"above the fold CSS\" in de HTML laden, de rest van de geoptimaliseerde "
209
- "CSS pas na de volledige pagina. <a href=\"http://wordpress.org/plugins/"
210
- "autoptimize/faq/\" target=\"_blank\">Bekijk de FAQ</a> voor je deze optie "
211
- "activeert!"
212
-
213
- #: classes/autoptimizeConfig.php:152
214
- msgid "Paste the above the fold CSS here."
215
- msgstr "Kopiëer de above the fold CSS hier."
216
-
217
- #: classes/autoptimizeConfig.php:155
218
- msgid "Inline all CSS?"
219
- msgstr "Alle CSS rechtstreeks in HTML laden?"
220
-
221
- #: classes/autoptimizeConfig.php:157
222
- msgid ""
223
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
224
- "visitor-rate, but may slow down performance otherwise."
225
- msgstr ""
226
- "Alle CSS rechtstreeks in de HTML laden kan de gemiddelde performantie voor "
227
- "sites met een lage pageview/ bezoeker-ratio verbeteren, maar zal in andere "
228
- "gevallen de performantie verslechteren."
229
-
230
- #: classes/autoptimizeConfig.php:160
231
- msgid "Exclude CSS from Autoptimize:"
232
- msgstr "Sluit deze CSS uit van optimalisering:"
233
-
234
- #: classes/autoptimizeConfig.php:162
235
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
236
- msgstr ""
237
- "Lijst van CSS die je wilt uitsluiten van optimalisatie, gescheiden door "
238
- "komma's. Voorbeeld; 'whatever.css, style.css' (zonder de quotes)."
239
-
240
- #: classes/autoptimizeConfig.php:166
241
- msgid "CDN Options"
242
- msgstr "CDN Opties"
243
-
244
- #: classes/autoptimizeConfig.php:169
245
- msgid "CDN Base URL"
246
- msgstr "Basis CDN URL"
247
-
248
- #: classes/autoptimizeConfig.php:171
249
- msgid ""
250
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
251
- "referenced in the CSS."
252
- msgstr ""
253
- "Vul hier je CDN blog root directory URL in om afbeeldingen in je CSS via je "
254
- "CDN te laden."
255
-
256
- #: classes/autoptimizeConfig.php:175
257
- msgid "Cache Info"
258
- msgstr "Cache Info"
259
-
260
- #: classes/autoptimizeConfig.php:178
261
- msgid "Cache folder"
262
- msgstr "Cache folder"
263
-
264
- #: classes/autoptimizeConfig.php:182
265
- msgid "Can we write?"
266
- msgstr "Kunnen we schrijven naar die folder?"
267
-
268
- #: classes/autoptimizeConfig.php:183
269
- msgid "Yes"
270
- msgstr "Ja"
271
-
272
- #: classes/autoptimizeConfig.php:183
273
- msgid "No"
274
- msgstr "Nee"
275
-
276
- #: classes/autoptimizeConfig.php:186
277
- msgid "Cached styles and scripts"
278
- msgstr "CSS en scripts in cache"
279
-
280
- #: classes/autoptimizeConfig.php:194
281
- msgid "Save aggregated script/css as static files?"
282
- msgstr "Bewaar geoptimaliseerde CSS en JS als statische bestanden?"
283
-
284
- #: classes/autoptimizeConfig.php:196
285
- msgid ""
286
- "By default files saved are static css/js, uncheck this option if your "
287
- "webserver doesn't properly handle the compression and expiry."
288
- msgstr ""
289
- "Standaard worden bestanden als statische css/js bewaard, deactiveer deze "
290
- "optie als je webserver compressie en cache-baarheid niet zelf kan afhandelen."
291
-
292
- #: classes/autoptimizeConfig.php:202
293
- msgid "Save Changes"
294
- msgstr "Bewaar wijzigingen"
295
-
296
- #: classes/autoptimizeConfig.php:203
297
- msgid "Save Changes and Empty Cache"
298
- msgstr "Bewaar en maak cache leeg."
299
-
300
- #: classes/autoptimizeConfig.php:224
301
- msgid ""
302
- "Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check "
303
- "out the FAQ</a> or post your question on <a href='http://wordpress.org/"
304
- "support/plugin/autoptimize'>the support-forum</a>."
305
- msgstr ""
306
- "Hulp nodig? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Bekijk "
307
- "de FAQ</a> of post je vraag in <a href='http://wordpress.org/support/plugin/"
308
- "autoptimize'>het support-forum</a>. "
309
-
310
- #: classes/autoptimizeConfig.php:225
311
- msgid "Happy with Autoptimize?"
312
- msgstr "Tevreden met Autoptimize?"
313
-
314
- #: classes/autoptimizeConfig.php:225
315
- msgid "Try my other plugins!"
316
- msgstr "Probeer mijn andere plugins!"
317
-
318
- #: classes/autoptimizeConfig.php:231
319
- msgid "futtta about"
320
- msgstr "futtta over"
321
-
322
- #. Plugin Name of the plugin/theme
323
- #: classes/autoptimizeConfig.php:233
324
- msgid "Autoptimize"
325
- msgstr "Autoptimize"
326
-
327
- #: classes/autoptimizeConfig.php:234
328
- msgid "WordPress"
329
- msgstr "WordPress"
330
-
331
- #: classes/autoptimizeConfig.php:235
332
- msgid "Web Technology"
333
- msgstr "Web Technologie"
334
-
335
- #: classes/autoptimizeConfig.php:250
336
- msgid "Do not donate for this plugin!"
337
- msgstr "Geef geen geld voor deze plugin!"
338
-
339
- #: classes/autoptimizeConfig.php:370
340
- msgid "Autoptimize Options"
341
- msgstr "Autoptimize Opties"
342
-
343
- #: classes/autoptimizeConfig.php:419 classes/autoptimizeConfig.php:425
344
- msgid "Settings"
345
- msgstr "Instellingen"
346
-
347
- #: classes/autoptimizeConfig.php:488
348
- msgid "No items"
349
- msgstr "Geen items"
350
-
351
- #: classes/autoptimizeConfig.php:493
352
- msgid "Posted %s"
353
- msgstr "Gepost op %s"
354
-
355
- #: classlesses/autoptimizeCacheChecker.php:50
356
- msgid ""
357
- "Autoptimize's cache size is getting big, consider purging the cache.<br /"
358
- "><br />Have a look at <a href=\"https://wordpress.org/plugins/autoptimize/"
359
- "faq/\" target=\"_blank\">the Autoptimize FAQ</a> to see how you can keep the "
360
- "cache size under control."
361
- msgstr ""
362
- "Er zitten veel files in Autoptimize's cache, overweeg om die leeg te maken."
363
- "<br /><br />In <a href=\"https://wordpress.org/plugins/autoptimize/faq/\" "
364
- "target=\"_blank\">de Autoptimize FAQ</a> vind je meer info over hoe je de "
365
- "cache onder controle kunt houden. "
366
-
367
- #. Plugin URI of the plugin/theme
368
- msgid "http://blog.futtta.be/autoptimize"
369
- msgstr "http://blog.futtta.be/autoptimize"
370
-
371
- #. Description of the plugin/theme
372
- msgid ""
373
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
374
- "compressing it."
375
- msgstr ""
376
- "Optimaliseert je website door CSS en JavaScript te combineren en samen te "
377
- "drukken."
378
-
379
- #. Author of the plugin/theme
380
- msgid "Frank Goossens (futtta)"
381
- msgstr "Frank Goossens (futtta)"
382
-
383
- #. Author URI of the plugin/theme
384
- msgid "http://blog.futtta.be/"
385
- msgstr "http://blog.futtta.be/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-pl_PL.mo DELETED
Binary file
localization/autoptimize-pl_PL.po DELETED
@@ -1,411 +0,0 @@
1
- # Copyright (C) 2013 Autoptimize
2
- # This file is distributed under the same license as the Autoptimize package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Autoptimize 1.7.0\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
- "POT-Creation-Date: 2015-12-08 22:03:53+00:00\n"
8
- "PO-Revision-Date: 2015-12-11 21:52+0100\n"
9
- "Last-Translator: Jakub Sierpiński <jakub.sierpinski@lostar.eu>\n"
10
- "Language-Team: LANGUAGE <LL@li.org>\n"
11
- "Language: pl_PL\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.6.3\n"
16
- "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
17
- "|| n%100>=20) ? 1 : 2);\n"
18
-
19
- #: autoptimize.php:93
20
- msgid ""
21
- "Thank you for installing and activating Autoptimize. Please configure it "
22
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
23
- "performance."
24
- msgstr ""
25
- "Dziękujemy za zainstalowanie i aktywację Autoptimize. Proszę skonfiguruj "
26
- "plugin w menu \"Ustawienia\" -> \"Autoptimize\" aby rozpocząć zwiększanie "
27
- "wydajności Twojej witryny."
28
-
29
- #: autoptimize.php:99
30
- msgid ""
31
- "Autoptimize has just been updated. Please <strong>test your site now</"
32
- "strong> and adapt Autoptimize config if needed."
33
- msgstr ""
34
- "Autoptimize został właśnie uaktualniony. Prosimy o <strong>przetestowanie "
35
- "Twojej witryny</strong> i zmienienie ustawień Autoptimize jeżeli to "
36
- "konieczne. "
37
-
38
- #: autoptimize.php:105
39
- msgid ""
40
- "Autoptimize cannot write to the cache directory (default: /wp-content/cache/"
41
- "autoptimize), please fix to enable CSS/ JS optimization!"
42
- msgstr ""
43
- "Autoptimize nie może zapisywać do katalogu pamięci podręcznej (domyślnie: /"
44
- "wp-content/cache/autoptimize). Proszę napraw to, aby włączyć optymalizację "
45
- "CSS/JS!"
46
-
47
- #: classes/autoptimizeConfig.php:48
48
- msgid "Autoptimize Settings"
49
- msgstr "Ustawienia Autoptimize"
50
-
51
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
52
- msgid "Show advanced settings"
53
- msgstr "Pokaż ustawienia zaawansowane"
54
-
55
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
56
- msgid "Hide advanced settings"
57
- msgstr "Ukryj ustawienia zaawansowane"
58
-
59
- #: classes/autoptimizeConfig.php:69
60
- msgid "HTML Options"
61
- msgstr "Opcje HTML"
62
-
63
- #: classes/autoptimizeConfig.php:72
64
- msgid "Optimize HTML Code?"
65
- msgstr "Optymalizuj kod HTML?"
66
-
67
- #: classes/autoptimizeConfig.php:76
68
- msgid "Keep HTML comments?"
69
- msgstr "Zachowaj komentarze HTML?"
70
-
71
- #: classes/autoptimizeConfig.php:78
72
- msgid ""
73
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
74
- "AdSense to function properly."
75
- msgstr ""
76
- "Wybierz tą opcję jeżeli chcesz zachować komentarze HTML na stronie. Jest to "
77
- "potrzebne n.p. do prawidłowego działania AdSense."
78
-
79
- #: classes/autoptimizeConfig.php:82
80
- msgid "JavaScript Options"
81
- msgstr "Opcje Javascript"
82
-
83
- #: classes/autoptimizeConfig.php:85
84
- msgid "Optimize JavaScript Code?"
85
- msgstr "Optymalizuj kod JavaScript?"
86
-
87
- #: classes/autoptimizeConfig.php:89
88
- msgid "Force JavaScript in &lt;head&gt;?"
89
- msgstr "Wymuś JavaScript w &lt;head&gt;?"
90
-
91
- #: classes/autoptimizeConfig.php:91
92
- msgid ""
93
- "Load JavaScript early, reducing the chance of JS-errors but making it render "
94
- "blocking. You can disable this if you're not aggregating inline JS and you "
95
- "want JS to be deferred."
96
- msgstr ""
97
- "Ładuje JavaScript wcześnie, aby zmniejszyć szanse wystąpienia błędów JS, ale "
98
- "również blokuje wyświetlanie. Możesz wyłączyć to, jeżeli nie łączysz JS w "
99
- "treści strony i nie chcesz aby przetwarzanie JS było opóźnione."
100
-
101
- #: classes/autoptimizeConfig.php:95
102
- msgid "Look for scripts only in &lt;head&gt;?"
103
- msgstr "Wyszukuj skryptów tylko w &lt;head&gt;?"
104
-
105
- #: classes/autoptimizeConfig.php:95 classes/autoptimizeConfig.php:135
106
- msgid " <i>(deprecated)</i>"
107
- msgstr "<i>(przestarzałe)</i>"
108
-
109
- #: classes/autoptimizeConfig.php:97
110
- msgid ""
111
- "Mostly useful in combination with previous option when using jQuery-based "
112
- "templates, but might help keeping cache size under control."
113
- msgstr ""
114
- "Przeważnie użyteczne w połączeniu z poprzednią opcją w momencie kiedy "
115
- "używasz szablonów opartch na jQuery, ale może również pomóc utrzymać rozmiar "
116
- "pamięci podręcznej w ryzach."
117
-
118
- #: classes/autoptimizeConfig.php:101
119
- msgid "Also aggregate inline JS?"
120
- msgstr "Także łączyć razem JS z treści strony?"
121
-
122
- #: classes/autoptimizeConfig.php:103
123
- msgid ""
124
- "Check this option for Autoptimize to also aggregate JS in the HTML. If this "
125
- "option is not enabled, you might have to \"force JavaScript in head\"."
126
- msgstr ""
127
- "Zaznacz tą opcję, aby Autoptimize łączył razem JS w HTML-u. Jeżeli ta opcja "
128
- "nie jest zaznaczona, może będziesz musiał \"Wymusić JavaScript w &lt;head&gt;"
129
- "\"."
130
-
131
- #: classes/autoptimizeConfig.php:106
132
- msgid "Exclude scripts from Autoptimize:"
133
- msgstr "Skrypty wyłączone z Autoptimize:"
134
-
135
- #: classes/autoptimizeConfig.php:108
136
- msgid ""
137
- "A comma-seperated list of scripts you want to exclude from being optimized, "
138
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
139
- "scripts from being aggregated and minimized by Autoptimize."
140
- msgstr ""
141
- "Rozdzielona przecinkami lista skryptów, które chcesz wyłączyć z optymizacji. "
142
- "Na przykład \"whatever.js, another.js\" (bez cudzysłowów) wyłączy te skrypty "
143
- "z łączenia i zmniejszania przez Autoptimize."
144
-
145
- #: classes/autoptimizeConfig.php:111
146
- msgid "Add try-catch wrapping?"
147
- msgstr "Opakować skrypt w try-catch?"
148
-
149
- #: classes/autoptimizeConfig.php:113
150
- msgid ""
151
- "If your scripts break because of a JS-error, you might want to try this."
152
- msgstr ""
153
- "Jeżeli Twój skrypt przestanie działać z powodu błedu JS możesz chcieć to "
154
- "właczyć."
155
-
156
- #: classes/autoptimizeConfig.php:117
157
- msgid "CSS Options"
158
- msgstr "Opcje CSS"
159
-
160
- #: classes/autoptimizeConfig.php:120
161
- msgid "Optimize CSS Code?"
162
- msgstr "Optymalizuj kod CSS?"
163
-
164
- #: classes/autoptimizeConfig.php:124
165
- msgid "Generate data: URIs for images?"
166
- msgstr "Twórz URI data: dla obrazów?"
167
-
168
- #: classes/autoptimizeConfig.php:126
169
- msgid ""
170
- "Enable this to include small background-images in the CSS itself instead of "
171
- "as seperate downloads."
172
- msgstr ""
173
- "Włącz to, aby zawrzeć małe obrazki tła w samym pliku CSS zamiast jako osobne "
174
- "pliki."
175
-
176
- #: classes/autoptimizeConfig.php:129
177
- msgid "Remove Google Fonts?"
178
- msgstr "Usunąć Google Fonts?"
179
-
180
- #: classes/autoptimizeConfig.php:131
181
- msgid "Check this if you don't need or want Google Fonts being loaded."
182
- msgstr ""
183
- "Zaznacz tą opcję, jeżeli nie potrzebujesz, lub nie chcesz ładować Google "
184
- "Fonts."
185
-
186
- #: classes/autoptimizeConfig.php:135
187
- msgid "Look for styles only in &lt;head&gt;?"
188
- msgstr "Wyszukuj styli tylko w &lt;head&gt;?"
189
-
190
- #: classes/autoptimizeConfig.php:137
191
- msgid ""
192
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
193
- "might want to enable this."
194
- msgstr ""
195
- "Nie autoptimizuj CSS poza sekcją head. Jeżeli pamięć podręczna zrobi się za "
196
- "duża, możesz chcieć to włączyć."
197
-
198
- #: classes/autoptimizeConfig.php:141
199
- msgid "Also aggregate inline CSS?"
200
- msgstr "Także łączyć razem CSS z treści strony?"
201
-
202
- #: classes/autoptimizeConfig.php:143
203
- msgid "Check this option for Autoptimize to also aggregate CSS in the HTML."
204
- msgstr "Zaznacz tą opcję, aby Autoptimize łączył razem CSS w HTML-u."
205
-
206
- #: classes/autoptimizeConfig.php:146
207
- msgid "Inline and Defer CSS?"
208
- msgstr "Włączyć CSS w treść strony i opóźnić jego ładowanie?"
209
-
210
- #: classes/autoptimizeConfig.php:148
211
- msgid ""
212
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
213
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
214
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
215
- msgstr ""
216
- "Włącz \"CSS nad foldem\" w treść strony, a zoptymizowany CSS wczytaj dopiero "
217
- "po załadowaniu strony. <a href=\"http://wordpress.org/plugins/autoptimize/"
218
- "faq/\" target=\"_blank\">Sprawdź FAQ</a> przed aktywacją tej opcji!"
219
-
220
- #: classes/autoptimizeConfig.php:152
221
- msgid "Paste the above the fold CSS here."
222
- msgstr "Wklej tutaj kod CSS dla części \"nad foldem\"."
223
-
224
- #: classes/autoptimizeConfig.php:155
225
- msgid "Inline all CSS?"
226
- msgstr "Włącz cały CSS w treść strony?"
227
-
228
- #: classes/autoptimizeConfig.php:157
229
- msgid ""
230
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
231
- "visitor-rate, but may slow down performance otherwise."
232
- msgstr ""
233
- "Włączenie całego CSS do strony może zwiększyć wydajność dla serwisów z "
234
- "niskim stosunkiem stron na odwiedzającego, ale może zmniejszyć wydajność w "
235
- "przeciwnym wypadku."
236
-
237
- #: classes/autoptimizeConfig.php:160
238
- msgid "Exclude CSS from Autoptimize:"
239
- msgstr "Wyłącz CSS z Autoptimize:"
240
-
241
- #: classes/autoptimizeConfig.php:162
242
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
243
- msgstr ""
244
- "Rozdzielana przecinkami lista plików CSS, którechcesz wyłączyć z optymizacji."
245
-
246
- #: classes/autoptimizeConfig.php:166
247
- msgid "CDN Options"
248
- msgstr "Opcje CDN"
249
-
250
- #: classes/autoptimizeConfig.php:169
251
- msgid "CDN Base URL"
252
- msgstr "Bazowy URL CDN"
253
-
254
- #: classes/autoptimizeConfig.php:171
255
- msgid ""
256
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
257
- "referenced in the CSS."
258
- msgstr ""
259
- "Wprowadź CDN-owy URL katalogu głównego Twojego bloga jeżeli chcesz włączyć "
260
- "użycie CDN dla obrazów, do których odwołują się pliki CSS."
261
-
262
- #: classes/autoptimizeConfig.php:175
263
- msgid "Cache Info"
264
- msgstr "Informacje Pamięci Podręcznej"
265
-
266
- #: classes/autoptimizeConfig.php:178
267
- msgid "Cache folder"
268
- msgstr "Folder pamięci podręcznej"
269
-
270
- #: classes/autoptimizeConfig.php:182
271
- msgid "Can we write?"
272
- msgstr "Czy możemy zapisywać?"
273
-
274
- #: classes/autoptimizeConfig.php:183
275
- msgid "Yes"
276
- msgstr "Tak"
277
-
278
- #: classes/autoptimizeConfig.php:183
279
- msgid "No"
280
- msgstr "Nie"
281
-
282
- #: classes/autoptimizeConfig.php:186
283
- msgid "Cached styles and scripts"
284
- msgstr "Zbuforowane style i skrypty"
285
-
286
- #: classes/autoptimizeConfig.php:194
287
- msgid "Save aggregated script/css as static files?"
288
- msgstr "Zapisać połączony scrypt/css jako plik statyczny?"
289
-
290
- #: classes/autoptimizeConfig.php:196
291
- msgid ""
292
- "By default files saved are static css/js, uncheck this option if your "
293
- "webserver doesn't properly handle the compression and expiry."
294
- msgstr ""
295
- "Domyślnie pliki są zapisywane jako statyczny css/js. Odznacz tą opcję jeżeli "
296
- "Twój serwer nie obsługuje prawidłowo kompresji lub wygaśnięcia."
297
-
298
- #: classes/autoptimizeConfig.php:202
299
- msgid "Save Changes"
300
- msgstr "Zapisz Zmiany"
301
-
302
- #: classes/autoptimizeConfig.php:203
303
- msgid "Save Changes and Empty Cache"
304
- msgstr "Zapisz Zmiany i Opróżnij Pamięć Podręczną"
305
-
306
- #: classes/autoptimizeConfig.php:224
307
- msgid ""
308
- "Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check "
309
- "out the FAQ</a> or post your question on <a href='http://wordpress.org/"
310
- "support/plugin/autoptimize'>the support-forum</a>."
311
- msgstr ""
312
- "Potrzebujsz pomocy? <a href='https://wordpress.org/plugins/autoptimize/"
313
- "faq/'>Sprawdź nasz FAQ (często zadawane pytania)</a>, lub zapytaj na <a "
314
- "href='http://wordpress.org/support/plugin/autoptimize'>forum wsparcia</a>."
315
-
316
- #: classes/autoptimizeConfig.php:225
317
- msgid "Happy with Autoptimize?"
318
- msgstr "Zadowolony z Autoptimize?"
319
-
320
- #: classes/autoptimizeConfig.php:225
321
- msgid "Try my other plugins!"
322
- msgstr "Wypróbuj inne moje pluginy!"
323
-
324
- #: classes/autoptimizeConfig.php:231
325
- msgid "futtta about"
326
- msgstr "o futtta"
327
-
328
- #. Plugin Name of the plugin/theme
329
- #: classes/autoptimizeConfig.php:233
330
- msgid "Autoptimize"
331
- msgstr "Autoptimize"
332
-
333
- #: classes/autoptimizeConfig.php:234
334
- msgid "WordPress"
335
- msgstr "WordPress"
336
-
337
- #: classes/autoptimizeConfig.php:235
338
- msgid "Web Technology"
339
- msgstr "Technologie WWW"
340
-
341
- #: classes/autoptimizeConfig.php:250
342
- msgid "Do not donate for this plugin!"
343
- msgstr "Nie przesyłaj swoich datków za ten plugin!"
344
-
345
- #: classes/autoptimizeConfig.php:370
346
- msgid "Autoptimize Options"
347
- msgstr "Opcje Autoptimize"
348
-
349
- #: classes/autoptimizeConfig.php:419 classes/autoptimizeConfig.php:425
350
- msgid "Settings"
351
- msgstr "Ustawienia"
352
-
353
- #: classes/autoptimizeConfig.php:488
354
- msgid "No items"
355
- msgstr "Brak elementów"
356
-
357
- #: classes/autoptimizeConfig.php:493
358
- msgid "Posted %s"
359
- msgstr "Wysłano %s"
360
-
361
- #: classlesses/autoptimizeCacheChecker.php:50
362
- msgid ""
363
- "Autoptimize's cache size is getting big, consider purging the cache.<br /"
364
- "><br />Have a look at <a href=\"https://wordpress.org/plugins/autoptimize/"
365
- "faq/\" target=\"_blank\">the Autoptimize FAQ</a> to see how you can keep the "
366
- "cache size under control."
367
- msgstr ""
368
- "Pamięć podręczna Autoptimize robi się duża. Przemyść czyszczenie pamięci "
369
- "podręcznej. <br /><br />Rzuć okiem na <a href=\"https://wordpress.org/"
370
- "plugins/autoptimize/faq/\" target=\"_blank\">FAQ Autoptimize (często "
371
- "zadawane pytania)</a> aby zobaczyć jak utrzymać rozmiar pamięci podręcznej "
372
- "pod kontrolą."
373
-
374
- #. Plugin URI of the plugin/theme
375
- msgid "http://blog.futtta.be/autoptimize"
376
- msgstr "http://blog.futtta.be/autoptimize"
377
-
378
- #. Description of the plugin/theme
379
- msgid ""
380
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
381
- "compressing it."
382
- msgstr ""
383
- "Optymalizuje Twoją witrynę łącząc kod CSS i JavaScript, oraz kompresując go."
384
-
385
- #. Author of the plugin/theme
386
- msgid "Frank Goossens (futtta)"
387
- msgstr "Frank Goossens (futtta)"
388
-
389
- #. Author URI of the plugin/theme
390
- msgid "http://blog.futtta.be/"
391
- msgstr "http://blog.futtta.be/"
392
-
393
- #~ msgid ""
394
- #~ "For performance reasons it is better to include JavaScript at the bottom "
395
- #~ "of HTML, but this sometimes breaks things. Especially useful for jQuery-"
396
- #~ "based themes."
397
- #~ msgstr ""
398
- #~ "Z powodów wydajności lepiej jest umieścić JavaSkrypt na końcu HTML, ale "
399
- #~ "czasami to nie działa prawidłowo. Przydatne zwłaszcza w przypadku "
400
- #~ "szablonów opartych na jQuery."
401
-
402
- #~ msgid "Defer CSS loading?"
403
- #~ msgstr "Opóźnij ładowanie CSS?"
404
-
405
- #~ msgid ""
406
- #~ "Normally CSS is loaded in the &lt;head&gt;-section of the HTML, but for "
407
- #~ "mobile performance reasons having it deferred can be better."
408
- #~ msgstr ""
409
- #~ "Normalnie CSS jest ładowany w sekcji &lt;head&gt; pliku HTML, ale z "
410
- #~ "powodu wydajności na urządzeniach mobilnych opóźnienie jego wczytywania "
411
- #~ "może być lepsze."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-pt_BR.mo DELETED
Binary file
localization/autoptimize-pt_BR.po DELETED
@@ -1,458 +0,0 @@
1
- # Spanish translation for autoptimize
2
- # Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
3
- # This file is distributed under the same license as the autoptimize package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: Autoptimize\n"
9
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
10
- "POT-Creation-Date: 2015-12-08 21:03-0200\n"
11
- "PO-Revision-Date: 2015-12-08 21:25-0200\n"
12
- "Last-Translator: Leonardo Antonioli <leo@tobeguarany.com>\n"
13
- "Language-Team: Leo Antonioli <leo@tobeguarany.com>\n"
14
- "Language: pt_BR\n"
15
- "MIME-Version: 1.0\n"
16
- "Content-Type: text/plain; charset=UTF-8\n"
17
- "Content-Transfer-Encoding: 8bit\n"
18
- "X-Launchpad-Export-Date: 2009-10-25 02:04+0000\n"
19
- "X-Generator: Poedit 1.8.4\n"
20
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
21
-
22
- #: autoptimize.php:93
23
- msgid ""
24
- "Thank you for installing and activating Autoptimize. Please configure it "
25
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
26
- "performance."
27
- msgstr ""
28
- "Obrigado por instalar e ativar o Autoptimize! Por favor, configure o plugin "
29
- "em \"Configurações\" -> \"Autoptimize\" para melhorar a performance do seu "
30
- "site."
31
-
32
- #: autoptimize.php:99
33
- msgid ""
34
- "Autoptimize has just been updated. Please <strong>test your site now</"
35
- "strong> and adapt Autoptimize config if needed."
36
- msgstr ""
37
- "Autoptimize foi atualizado. Por favor, <strong>teste seu site agora</strong> "
38
- "e adapte as configurações do Autoptimize se necessário."
39
-
40
- #: autoptimize.php:105
41
- msgid ""
42
- "Autoptimize cannot write to the cache directory (default: /wp-content/cache/"
43
- "autoptimize), please fix to enable CSS/ JS optimization!"
44
- msgstr ""
45
- "Autoptimize não pode gravar no diretório de cache (padrão: /wp-content/cache/"
46
- "autoptimize), por favor, resolva isso para possibilitar a otimização de CSS/"
47
- "JS!"
48
-
49
- #: classes/autoptimizeConfig.php:48
50
- msgid "Autoptimize Settings"
51
- msgstr "Configuração do Autoptimize "
52
-
53
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
54
- msgid "Show advanced settings"
55
- msgstr "Exibir configurações avançadas"
56
-
57
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
58
- msgid "Hide advanced settings"
59
- msgstr "Ocultar configurações avançadas"
60
-
61
- #: classes/autoptimizeConfig.php:69
62
- msgid "HTML Options"
63
- msgstr "Opções de HTML"
64
-
65
- #: classes/autoptimizeConfig.php:72
66
- msgid "Optimize HTML Code?"
67
- msgstr "Otimizar código HTML?"
68
-
69
- #: classes/autoptimizeConfig.php:76
70
- msgid "Keep HTML comments?"
71
- msgstr "Manter comentários HTML?"
72
-
73
- #: classes/autoptimizeConfig.php:78
74
- msgid ""
75
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
76
- "AdSense to function properly."
77
- msgstr ""
78
- "Habilitando essa opção, você faz com que comentários HTML permaneçam na "
79
- "página. Necessário, por exemplo, para que o AdSense funcione corretamente."
80
-
81
- #: classes/autoptimizeConfig.php:82
82
- msgid "JavaScript Options"
83
- msgstr "Opções de JavaScript"
84
-
85
- #: classes/autoptimizeConfig.php:85
86
- msgid "Optimize JavaScript Code?"
87
- msgstr "Otimizar código JavaScript?"
88
-
89
- #: classes/autoptimizeConfig.php:89
90
- msgid "Force JavaScript in &lt;head&gt;?"
91
- msgstr "Manter JavaScript na seção &lt;head&gt;?"
92
-
93
- #: classes/autoptimizeConfig.php:91
94
- msgid ""
95
- "Load JavaScript early, reducing the chance of JS-errors but making it render "
96
- "blocking. You can disable this if you're not aggregating inline JS and you "
97
- "want JS to be deferred."
98
- msgstr ""
99
- "Carrega o JavaScript mais cedo, reduzindo a chance de erros de script, mas "
100
- "bloqueando a renderização. Você pode desativar isso se não estiver agregando "
101
- "JavaScript inline e quiser adiar seu carregamento."
102
-
103
- #: classes/autoptimizeConfig.php:95
104
- msgid "Look for scripts only in &lt;head&gt;?"
105
- msgstr "Buscar scripts somente na seção &lt;head&gt;?"
106
-
107
- #: classes/autoptimizeConfig.php:95 classes/autoptimizeConfig.php:135
108
- msgid " <i>(deprecated)</i>"
109
- msgstr " <i>(obsoleto)</i>"
110
-
111
- #: classes/autoptimizeConfig.php:97
112
- msgid ""
113
- "Mostly useful in combination with previous option when using jQuery-based "
114
- "templates, but might help keeping cache size under control."
115
- msgstr ""
116
- "Normalmente usado em conjunto com a opção anterior quando se usa temas "
117
- "baseados em jQuery, mas também pode ajudar a manter o tamanho do cache sob "
118
- "controle."
119
-
120
- #: classes/autoptimizeConfig.php:101
121
- msgid "Also aggregate inline JS?"
122
- msgstr "Agregar JavaScript inline?"
123
-
124
- #: classes/autoptimizeConfig.php:103
125
- msgid ""
126
- "Check this option for Autoptimize to also aggregate JS in the HTML. If this "
127
- "option is not enabled, you might have to \"force JavaScript in head\"."
128
- msgstr ""
129
- "Marque para que o Autoptimize também agregue o JavaScript no HTML. Se esta "
130
- "opção não for habilitada, você pode ter que \"forçar o JavaScript no "
131
- "cabeçalho\"."
132
-
133
- #: classes/autoptimizeConfig.php:106
134
- msgid "Exclude scripts from Autoptimize:"
135
- msgstr "Excluir scripts do Autoptimize:"
136
-
137
- #: classes/autoptimizeConfig.php:108
138
- msgid ""
139
- "A comma-seperated list of scripts you want to exclude from being optimized, "
140
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
141
- "scripts from being aggregated and minimized by Autoptimize."
142
- msgstr ""
143
- "Lista (separada por vírgulas) de scripts que você quer excluir da "
144
- "otimização. Por exemplo: 'qualquerCoisa.js', 'outroScript.js' (sem aspas) "
145
- "para evitar que esses scripts sejam reduzidos pelo Autoptimize."
146
-
147
- #: classes/autoptimizeConfig.php:111
148
- msgid "Add try-catch wrapping?"
149
- msgstr "Adicionar encapsulamento try-catch?"
150
-
151
- #: classes/autoptimizeConfig.php:113
152
- msgid ""
153
- "If your scripts break because of a JS-error, you might want to try this."
154
- msgstr "Se seus scripts apresentarem erro, tente usar essa opção."
155
-
156
- #: classes/autoptimizeConfig.php:117
157
- msgid "CSS Options"
158
- msgstr "Opções de CSS"
159
-
160
- #: classes/autoptimizeConfig.php:120
161
- msgid "Optimize CSS Code?"
162
- msgstr "Otimizar código CSS?"
163
-
164
- #: classes/autoptimizeConfig.php:124
165
- msgid "Generate data: URIs for images?"
166
- msgstr "Gerar dados: URIs de imagens?"
167
-
168
- #: classes/autoptimizeConfig.php:126
169
- msgid ""
170
- "Enable this to include small background-images in the CSS itself instead of "
171
- "as seperate downloads."
172
- msgstr ""
173
- "Habilite essa opção para incluir imagens de fundo pequenas no próprio "
174
- "arquivo CSS, evitando downloads extras."
175
-
176
- #: classes/autoptimizeConfig.php:129
177
- msgid "Remove Google Fonts?"
178
- msgstr "Remover Google Fonts?"
179
-
180
- #: classes/autoptimizeConfig.php:131
181
- msgid "Check this if you don't need or want Google Fonts being loaded."
182
- msgstr "Marque se você não precisa que fontes do Google sejam carregadas."
183
-
184
- #: classes/autoptimizeConfig.php:135
185
- msgid "Look for styles only in &lt;head&gt;?"
186
- msgstr "Buscar estilos somente na seção &lt;head&gt;?"
187
-
188
- #: classes/autoptimizeConfig.php:137
189
- msgid ""
190
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
191
- "might want to enable this."
192
- msgstr ""
193
- "Não otimizar CSS fora da seção head. Se o cache ficar muito grande, você "
194
- "pode habilitar essa opção."
195
-
196
- #: classes/autoptimizeConfig.php:141
197
- msgid "Also aggregate inline CSS?"
198
- msgstr "Agregar CSS inline?"
199
-
200
- #: classes/autoptimizeConfig.php:143
201
- msgid "Check this option for Autoptimize to also aggregate CSS in the HTML."
202
- msgstr "Marque para que o Autoptimize também agregue o CSS no HTML."
203
-
204
- #: classes/autoptimizeConfig.php:146
205
- msgid "Inline and Defer CSS?"
206
- msgstr "CSS inline e adiado?"
207
-
208
- #: classes/autoptimizeConfig.php:148
209
- msgid ""
210
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
211
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
212
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
213
- msgstr ""
214
- "Coloca o CSS \"Acima da Borda\" inline, enquanto carrega o CSS principal "
215
- "autoptimizado só após a página carregar. <a href=\"http://wordpress.org/"
216
- "plugins/autoptimize/faq/\" target=\"_blank\">Leia o FAQ</a> (<em>deferring "
217
- "CSS</em>) antes de ativar essa opção!"
218
-
219
- #: classes/autoptimizeConfig.php:152
220
- msgid "Paste the above the fold CSS here."
221
- msgstr "Cole aqui o CSS \"Acima da Borda\""
222
-
223
- #: classes/autoptimizeConfig.php:155
224
- msgid "Inline all CSS?"
225
- msgstr "Colocar todo CSS inline?"
226
-
227
- #: classes/autoptimizeConfig.php:157
228
- msgid ""
229
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
230
- "visitor-rate, but may slow down performance otherwise."
231
- msgstr ""
232
- "Colocar o CSS inline pode melhorar a performance de sites com baixa taxa de "
233
- "pageviews/visitantes, mas pode diminuir a performance de sites maiores. "
234
-
235
- #: classes/autoptimizeConfig.php:160
236
- msgid "Exclude CSS from Autoptimize:"
237
- msgstr "Excluir CSS do Autoptimize:"
238
-
239
- #: classes/autoptimizeConfig.php:162
240
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
241
- msgstr "Lista (separada por vírgulas) do CSS que você NÃO deseja otimizar."
242
-
243
- #: classes/autoptimizeConfig.php:166
244
- msgid "CDN Options"
245
- msgstr "Opções de CDN"
246
-
247
- #: classes/autoptimizeConfig.php:169
248
- msgid "CDN Base URL"
249
- msgstr "URL-base do CDN:"
250
-
251
- #: classes/autoptimizeConfig.php:171
252
- msgid ""
253
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
254
- "referenced in the CSS."
255
- msgstr ""
256
- "Digite a URL do diretório-raiz do seu blog CDN se quiser habilitar CDN para "
257
- "imagens referenciadas no CSS."
258
-
259
- #: classes/autoptimizeConfig.php:175
260
- msgid "Cache Info"
261
- msgstr "Informação de Cache"
262
-
263
- #: classes/autoptimizeConfig.php:178
264
- msgid "Cache folder"
265
- msgstr "Diretório do cache"
266
-
267
- #: classes/autoptimizeConfig.php:182
268
- msgid "Can we write?"
269
- msgstr "Escrita habilitada?"
270
-
271
- #: classes/autoptimizeConfig.php:183
272
- msgid "Yes"
273
- msgstr "Sim"
274
-
275
- #: classes/autoptimizeConfig.php:183
276
- msgid "No"
277
- msgstr "Não"
278
-
279
- #: classes/autoptimizeConfig.php:186
280
- msgid "Cached styles and scripts"
281
- msgstr "Estilos e scripts no cache"
282
-
283
- #: classes/autoptimizeConfig.php:194
284
- msgid "Save aggregated script/css as static files?"
285
- msgstr "Salvar scripts/CSS agregados como arquivos estáticos?"
286
-
287
- #: classes/autoptimizeConfig.php:196
288
- msgid ""
289
- "By default files saved are static css/js, uncheck this option if your "
290
- "webserver doesn't properly handle the compression and expiry."
291
- msgstr ""
292
- "Por padrão, os arquivos são salvos como CSS/js estáticos. Desmarque essa "
293
- "opção se seu servidor não lida bem com compressão e validade de cache."
294
-
295
- #: classes/autoptimizeConfig.php:202
296
- msgid "Save Changes"
297
- msgstr "Salvar Modificações"
298
-
299
- #: classes/autoptimizeConfig.php:203
300
- msgid "Save Changes and Empty Cache"
301
- msgstr "Salvar Modificações e Esvaziar Cache"
302
-
303
- #: classes/autoptimizeConfig.php:224
304
- msgid ""
305
- "Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check "
306
- "out the FAQ</a> or post your question on <a href='http://wordpress.org/"
307
- "support/plugin/autoptimize'>the support-forum</a>."
308
- msgstr ""
309
- "Precisa de ajuda? <a href='https://wordpress.org/plugins/autoptimize/"
310
- "faq/'>Confira o FAQ</a> ou poste sua pergunta no <a href='http://wordpress."
311
- "org/support/plugin/autoptimize'>fórum de suporte</a>."
312
-
313
- #: classes/autoptimizeConfig.php:225
314
- msgid "Happy with Autoptimize?"
315
- msgstr "Gostou do Autoptimize?"
316
-
317
- #: classes/autoptimizeConfig.php:225
318
- msgid "Try my other plugins!"
319
- msgstr "Experimente meus outros plugins!"
320
-
321
- #: classes/autoptimizeConfig.php:231
322
- msgid "futtta about"
323
- msgstr "futtta about"
324
-
325
- #. Plugin Name of the plugin/theme
326
- #: classes/autoptimizeConfig.php:233
327
- msgid "Autoptimize"
328
- msgstr "Autoptimize"
329
-
330
- #: classes/autoptimizeConfig.php:234
331
- msgid "WordPress"
332
- msgstr "WordPress"
333
-
334
- #: classes/autoptimizeConfig.php:235
335
- msgid "Web Technology"
336
- msgstr "Tecnologia Web"
337
-
338
- #: classes/autoptimizeConfig.php:250
339
- msgid "Do not donate for this plugin!"
340
- msgstr "Não doe NADA pra esse plugin!"
341
-
342
- #: classes/autoptimizeConfig.php:370
343
- msgid "Autoptimize Options"
344
- msgstr "Opções do Autoptimize"
345
-
346
- #: classes/autoptimizeConfig.php:419 classes/autoptimizeConfig.php:425
347
- msgid "Settings"
348
- msgstr "Configurações"
349
-
350
- #: classes/autoptimizeConfig.php:488
351
- msgid "No items"
352
- msgstr "Sem itens"
353
-
354
- #: classes/autoptimizeConfig.php:493
355
- msgid "Posted %s"
356
- msgstr "Postado %s"
357
-
358
- #: classlesses/autoptimizeCacheChecker.php:50
359
- msgid ""
360
- "Autoptimize's cache size is getting big, consider purging the cache.<br /"
361
- "><br />Have a look at <a href=\"https://wordpress.org/plugins/autoptimize/"
362
- "faq/\" target=\"_blank\">the Autoptimize FAQ</a> to see how you can keep the "
363
- "cache size under control."
364
- msgstr ""
365
- "O cache do Autoptimize está ficando grande, considere limpá-lo.<br /><br /"
366
- ">Dê uma olhada <a href=\"https://wordpress.org/plugins/autoptimize/faq/\" "
367
- "target=\"_blank\">no FAQ do Autoptimize</a> para saber como manter o tamanho "
368
- "do cache sob controle."
369
-
370
- #. Plugin URI of the plugin/theme
371
- msgid "http://blog.futtta.be/autoptimize"
372
- msgstr "http://blog.futtta.be/autoptimize"
373
-
374
- #. Description of the plugin/theme
375
- msgid ""
376
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
377
- "compressing it."
378
- msgstr ""
379
- "Otimiza seu site, concatenando o código CSS e JavaScript, além de compactá-"
380
- "lo."
381
-
382
- #. Author of the plugin/theme
383
- msgid "Frank Goossens (futtta)"
384
- msgstr "Frank Goossens (futtta)"
385
-
386
- #. Author URI of the plugin/theme
387
- msgid "http://blog.futtta.be/"
388
- msgstr "http://blog.futtta.be/"
389
-
390
- #~ msgid ""
391
- #~ "For performance reasons it is better to include JavaScript at the bottom "
392
- #~ "of HTML, but this sometimes breaks things. Especially useful for jQuery-"
393
- #~ "based themes."
394
- #~ msgstr ""
395
- #~ "Por questões de performance, é melhor incluir o JavaScript no final do "
396
- #~ "HTML, mas isso pode estragar alguma coisa. Esta opção é especialmente "
397
- #~ "útil para temas baseados em jQuery."
398
-
399
- #~ msgid "Defer CSS loading?"
400
- #~ msgstr "Adiar carregamento do CSS?"
401
-
402
- #~ msgid "Use YUI compression?"
403
- #~ msgstr "¿Comprimir con YUI?"
404
-
405
- #~ msgid ""
406
- #~ "Disabled by default. Read [autoptimize]/yui/README.txt for more "
407
- #~ "information."
408
- #~ msgstr ""
409
- #~ "Deshabilitado por defecto. Lea [autoptimize]/yui/README.txt para más "
410
- #~ "información."
411
-
412
- #~ msgid "Look for styles on just &lt;head&gt;?"
413
- #~ msgstr "¿Buscar estilos solo en &lt;head&gt;?"
414
-
415
- #~ msgid ""
416
- #~ "Disabled by default. Enable this to include images on the CSS itself."
417
- #~ msgstr ""
418
- #~ "Deshabilitador por defecto. Habilite esto para incluir imágenes en el "
419
- #~ "código CSS."
420
-
421
- #~ msgid "Rewrite JavaScript URLs?"
422
- #~ msgstr "¿Reescribir URLs de JavaScript?"
423
-
424
- #~ msgid ""
425
- #~ "Disabled by default. Do not enable this unless you know what you are "
426
- #~ "doing."
427
- #~ msgstr ""
428
- #~ "Deshabilitado por defecto. No habilite esto a menos que sepa lo que está "
429
- #~ "haciendo."
430
-
431
- #~ msgid "JavaScript Base URL"
432
- #~ msgstr "URL Base para JavaScript"
433
-
434
- #~ msgid ""
435
- #~ "This is the new base URL that will be used when rewriting. It should "
436
- #~ "point to the blog root directory."
437
- #~ msgstr ""
438
- #~ "Esta es la nueva URL de base que se utilizará al reescribir. Debe apuntar "
439
- #~ "al directorio principal del blog."
440
-
441
- #~ msgid "Rewrite CSS URLs?"
442
- #~ msgstr "¿Reescribir URLs de CSS?"
443
-
444
- #~ msgid "Rewrite Image URLs?"
445
- #~ msgstr "¿Reescribir URLs de Imágenes?"
446
-
447
- #~ msgid "Image Base URL"
448
- #~ msgstr "URL Base para Imágenes"
449
-
450
- #~ msgid "Do not compress cache files"
451
- #~ msgstr "No comprimir archivos de cache"
452
-
453
- #~ msgid ""
454
- #~ "Disabled by default. Enable this if you want to compress the served files "
455
- #~ "using your webserver."
456
- #~ msgstr ""
457
- #~ "Deshabilitado por defecto. Habilite esto si quiere comprimir los archivos "
458
- #~ "servidos usando su servidor web."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-sv_SE.mo DELETED
Binary file
localization/autoptimize-sv_SE.po DELETED
@@ -1,305 +0,0 @@
1
- # Copyright (C) 2014 Autoptimize
2
- # This file is distributed under the same license as the Autoptimize package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Autoptimize 1.9.0\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
7
- "POT-Creation-Date: 2014-08-22 05:35:46+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2014-09-19 20:45+0100\n"
12
- "Last-Translator: Jonathan Sulo <jonathan@sulo.se>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "X-Generator: Poedit 1.5.4\n"
15
- "Language: Swedish\n"
16
-
17
- #: autoptimize.php:124
18
- msgid ""
19
- "Thank you for installing and activating Autoptimize. Please configure it "
20
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
21
- "performance."
22
- msgstr ""
23
- "Tack för att du installerat och aktiverat Autoptimize. Vänligen konfigurera "
24
- "det under \"Inställningar \" -> \"Autoptimize \" för att börja förbättra "
25
- "prestandan på din sida."
26
-
27
- #: autoptimize.php:130
28
- msgid ""
29
- "Autoptimize has just been updated. Please <strong>test your site now</"
30
- "strong> and adapt Autoptimize config if needed."
31
- msgstr ""
32
- "Autoptimize har precis uppdaterats. Vänligen <strong>testa din sida nu</"
33
- "strong> och ändra inställningarna för Autoptimize vid behov. "
34
-
35
- #: classes/autoptimizeConfig.php:48
36
- msgid "Autoptimize Settings"
37
- msgstr "Inställningar för Autoptimize"
38
-
39
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
40
- msgid "Show advanced settings"
41
- msgstr "Visa avancerade inställningar"
42
-
43
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
44
- msgid "Hide advanced settings"
45
- msgstr "Dölj avancerade inställningar"
46
-
47
- #: classes/autoptimizeConfig.php:69
48
- msgid "HTML Options"
49
- msgstr "HTML-alternativ"
50
-
51
- #: classes/autoptimizeConfig.php:72
52
- msgid "Optimize HTML Code?"
53
- msgstr "Optimera HTML-kod?"
54
-
55
- #: classes/autoptimizeConfig.php:76
56
- msgid "Keep HTML comments?"
57
- msgstr "Behåll HTML-kommentarer?"
58
-
59
- #: classes/autoptimizeConfig.php:78
60
- msgid ""
61
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
62
- "AdSense to function properly."
63
- msgstr ""
64
- "Välj detta för att behålla HTML-kommentarer på sidan, vilket behövs för att "
65
- "t ex AdSense ska fungera bra."
66
-
67
- #: classes/autoptimizeConfig.php:82
68
- msgid "JavaScript Options"
69
- msgstr "JavaScript-alternativ"
70
-
71
- #: classes/autoptimizeConfig.php:85
72
- msgid "Optimize JavaScript Code?"
73
- msgstr "Optimera JavaScript-kod?"
74
-
75
- #: classes/autoptimizeConfig.php:89
76
- msgid "Force JavaScript in &lt;head&gt;?"
77
- msgstr "Tvinga in JavaScript i &lt;head&gt;?"
78
-
79
- #: classes/autoptimizeConfig.php:91
80
- msgid ""
81
- "For performance reasons it is better to include JavaScript at the bottom of "
82
- "HTML, but this sometimes breaks things. Especially useful for jQuery-based "
83
- "themes."
84
- msgstr ""
85
- "Av prestandaskäl är det bättre att inkludera JavaScript i slutet av HTML-"
86
- "koden, men det kan ibland orsaka fel. Särskilt användbart för jQuery-"
87
- "baserade teman."
88
-
89
- #: classes/autoptimizeConfig.php:94
90
- msgid "Look for scripts only in &lt;head&gt;?"
91
- msgstr "Leta efter script enbart i &lt;head&gt;?"
92
-
93
- #: classes/autoptimizeConfig.php:96
94
- msgid ""
95
- "Mostly useful in combination with previous option when using jQuery-based "
96
- "templates, but might help keeping cache size under control."
97
- msgstr ""
98
- "Mest användbart i kombination med föregående alternativ, när jQuery-baserade "
99
- "teman används, men kan även reducera storleken på cachen."
100
-
101
- #: classes/autoptimizeConfig.php:99
102
- msgid "Exclude scripts from Autoptimize:"
103
- msgstr "Exkludera script från Autoptimize:"
104
-
105
- #: classes/autoptimizeConfig.php:101
106
- msgid ""
107
- "A comma-seperated list of scripts you want to exclude from being optimized, "
108
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
109
- "scripts from being aggregated and minimized by Autoptimize."
110
- msgstr ""
111
- "En komma-separerad lista med script som ska exkluderas från Autoptimize. "
112
- "Ange t ex 'whatever.js, another.js' (utan citattecken) för att inte "
113
- "sammanfoga och minimera dessa script."
114
-
115
- #: classes/autoptimizeConfig.php:104
116
- msgid "Add try-catch wrapping?"
117
- msgstr "Lägg till try-catch-inbäddning?"
118
-
119
- #: classes/autoptimizeConfig.php:106
120
- msgid ""
121
- "If your scripts break because of an script error, you might want to try this."
122
- msgstr ""
123
- "Om script slutar fungera pga ett script-fel, testa då detta alternativ."
124
-
125
- #: classes/autoptimizeConfig.php:110
126
- msgid "CSS Options"
127
- msgstr "CSS-alternativ"
128
-
129
- #: classes/autoptimizeConfig.php:113
130
- msgid "Optimize CSS Code?"
131
- msgstr "Optimera CSS-kod?"
132
-
133
- #: classes/autoptimizeConfig.php:117
134
- msgid "Generate data: URIs for images?"
135
- msgstr "Generera data: URI för bilder?"
136
-
137
- #: classes/autoptimizeConfig.php:119
138
- msgid ""
139
- "Enable this to include small background-images in the CSS itself instead of "
140
- "as seperate downloads."
141
- msgstr ""
142
- "Välj detta för att inkludera mindre bakgrundsbilder direkt i CSS, istället "
143
- "för som separata nedladdningar."
144
-
145
- #: classes/autoptimizeConfig.php:122
146
- msgid "Look for styles only in &lt;head&gt;?"
147
- msgstr "Leta efter stilmallar enbart inom &lt;head&gt;?"
148
-
149
- #: classes/autoptimizeConfig.php:124
150
- msgid ""
151
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
152
- "might want to enable this."
153
- msgstr ""
154
- "Optimera inte CSS utanför head-sektionen. Om cachen blir för stor, testa då "
155
- "detta alternativ."
156
-
157
- #: classes/autoptimizeConfig.php:127
158
- msgid "Inline and Defer CSS?"
159
- msgstr "Inkludera och senarelägg inladdning av CSS?"
160
-
161
- #: classes/autoptimizeConfig.php:129
162
- msgid ""
163
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
164
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
165
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
166
- msgstr ""
167
- "Inkludera \"det första/above the fold CSS\" medan huvudsaklig autoptimerad "
168
- "CSS laddas efter sidan har laddat. <a href=\"http://wordpress.org/plugins/"
169
- "autoptimize/faq/\" target=\"_blank\">Kontrollera FAQ:n</a> innan detta "
170
- "alternativ aktiveras!"
171
-
172
- #: classes/autoptimizeConfig.php:133
173
- msgid "Paste the above the fold CSS here."
174
- msgstr "Klistra in det första/above the fold CSS här."
175
-
176
- #: classes/autoptimizeConfig.php:136
177
- msgid "Inline all CSS?"
178
- msgstr "Inkludera all CSS?"
179
-
180
- #: classes/autoptimizeConfig.php:138
181
- msgid ""
182
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
183
- "visitor-rate, but may slow down performance otherwise."
184
- msgstr ""
185
- "Att inkludera all CSS (inline) kan förbättra prestandan på sidor med få "
186
- "sidvisningar/besökare, men det kan även försämra prestandan."
187
-
188
- #: classes/autoptimizeConfig.php:141
189
- msgid "Exclude CSS from Autoptimize:"
190
- msgstr "Exkludera CSS från Autoptimize:"
191
-
192
- #: classes/autoptimizeConfig.php:143
193
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
194
- msgstr ""
195
- "En komma-separerad lista med stilmallar som ska exkluderas från optimering."
196
-
197
- #: classes/autoptimizeConfig.php:147
198
- msgid "CDN Options"
199
- msgstr "CDN-alternativ"
200
-
201
- #: classes/autoptimizeConfig.php:150
202
- msgid "CDN Base URL"
203
- msgstr "CDN bas-URL"
204
-
205
- #: classes/autoptimizeConfig.php:152
206
- msgid ""
207
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
208
- "referenced in the CSS."
209
- msgstr ""
210
- "Ange sökväg med URL för din webbplats CDN om du vill aktivera CDN för bilder "
211
- "anropade via CSS."
212
-
213
- #: classes/autoptimizeConfig.php:156
214
- msgid "Cache Info"
215
- msgstr "Cache-information"
216
-
217
- #: classes/autoptimizeConfig.php:159
218
- msgid "Cache folder"
219
- msgstr "Cache-mapp"
220
-
221
- #: classes/autoptimizeConfig.php:163
222
- msgid "Can we write?"
223
- msgstr "Kan vi skriva?"
224
-
225
- #: classes/autoptimizeConfig.php:164
226
- msgid "Yes"
227
- msgstr "Ja"
228
-
229
- #: classes/autoptimizeConfig.php:164
230
- msgid "No"
231
- msgstr "Nej"
232
-
233
- #: classes/autoptimizeConfig.php:167
234
- msgid "Cached styles and scripts"
235
- msgstr "Stilmallar och script i cachen"
236
-
237
- #: classes/autoptimizeConfig.php:171
238
- msgid "Save aggregated script/css as static files?"
239
- msgstr "Spara sammanfogade script/stilmallar som statiska filer?"
240
-
241
- #: classes/autoptimizeConfig.php:173
242
- msgid ""
243
- "By default files saved are static css/js, uncheck this option if your "
244
- "webserver doesn't properly handle the compression and expiry."
245
- msgstr ""
246
- "Som standard sparas filer som statisk CSS/Javascript. Välj detta alternativ "
247
- "om din webbserver inte kan hantera komprimering och utgångstid ordentligt."
248
-
249
- #: classes/autoptimizeConfig.php:179
250
- msgid "Save Changes"
251
- msgstr "Spara ändringar"
252
-
253
- #: classes/autoptimizeConfig.php:180
254
- msgid "Save Changes and Empty Cache"
255
- msgstr "Spara ändringar och töm cache"
256
-
257
- #: classes/autoptimizeConfig.php:188
258
- msgid "futtta about"
259
- msgstr "Om futtta"
260
-
261
- #. #-#-#-#-# plugin.pot (Autoptimize 1.8.5) #-#-#-#-#
262
- #. Plugin Name of the plugin/theme
263
- #: classes/autoptimizeConfig.php:190
264
- msgid "Autoptimize"
265
- msgstr "Autoptimize"
266
-
267
- #: classes/autoptimizeConfig.php:191
268
- msgid "WordPress"
269
- msgstr "WordPress"
270
-
271
- #: classes/autoptimizeConfig.php:192
272
- msgid "Web Technology"
273
- msgstr "Webbteknik"
274
-
275
- #: classes/autoptimizeConfig.php:197
276
- msgid "Do not donate for this plugin!"
277
- msgstr "Donera inte för detta tillägg!"
278
-
279
- #: classes/autoptimizeConfig.php:313
280
- msgid "Autoptimize Options"
281
- msgstr "Autoptimize-alternativ"
282
-
283
- #: classes/autoptimizeConfig.php:358 classes/autoptimizeConfig.php:364
284
- msgid "Settings"
285
- msgstr "Inställningar"
286
-
287
- #. Plugin URI of the plugin/theme
288
- msgid "http://blog.futtta.be/autoptimize"
289
- msgstr "http://blog.futtta.be/autoptimize"
290
-
291
- #. Description of the plugin/theme
292
- msgid ""
293
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
294
- "compressing it."
295
- msgstr ""
296
- "Optimerar din webbplats genom att sammanfoga CSS/stilmallar och Javascript "
297
- "samt komprimerar filer."
298
-
299
- #. Author of the plugin/theme
300
- msgid "Frank Goossens (futtta)"
301
- msgstr "Frank Goossens (futtta)"
302
-
303
- #. Author URI of the plugin/theme
304
- msgid "http://blog.futtta.be/"
305
- msgstr "http://blog.futtta.be/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize-tr_TR.mo DELETED
Binary file
localization/autoptimize-tr_TR.po DELETED
@@ -1,412 +0,0 @@
1
- # Copyright (C) 2014 Autoptimize
2
- # This file is distributed under the same license as the Autoptimize package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Autoptimize 1.9.0\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
- "POT-Creation-Date: 2015-12-11 02:45+0200\n"
8
- "PO-Revision-Date: 2015-12-12 02:43+0200\n"
9
- "Last-Translator: Baris Unver <baris.unver@beyn.org>\n"
10
- "Language-Team: Barış Ünver <baris.unver@beyn.org>\n"
11
- "Language: tr_TR\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.8.4\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
-
18
- #: autoptimize.php:93
19
- msgid ""
20
- "Thank you for installing and activating Autoptimize. Please configure it "
21
- "under \"Settings\" -> \"Autoptimize\" to start improving your site's "
22
- "performance."
23
- msgstr ""
24
- "Autoptimize'ı kurup etkinleştirdiğiniz için teşekkür ederiz. \"Ayarlar\" -> "
25
- "\"Autoptimize\" sayfasına giderek ayarları yapabilir, sitenizin "
26
- "performansını artırmak için bir adım atabilirsiniz."
27
-
28
- #: autoptimize.php:99
29
- msgid ""
30
- "Autoptimize has just been updated. Please <strong>test your site now</"
31
- "strong> and adapt Autoptimize config if needed."
32
- msgstr ""
33
- "Autoptimize güncellendi. Lütfen <strong>hemen şimdi sitenizi test edin</"
34
- "strong> ve gerekiyorsa Autoptimize seçeneklerini güncelleyin."
35
-
36
- #: autoptimize.php:105
37
- msgid ""
38
- "Autoptimize cannot write to the cache directory (default: /wp-content/cache/"
39
- "autoptimize), please fix to enable CSS/ JS optimization!"
40
- msgstr ""
41
- "Autoptimize önbellek dizinine yazamıyor (varsayılan dizin: /wp-content/cache/"
42
- "autoptimize). Lütfen JS/CSS optimizasyonu özelliklerini etkinleştirebilmek "
43
- "için bunu düzetin!"
44
-
45
- #: classes/autoptimizeConfig.php:48
46
- msgid "Autoptimize Settings"
47
- msgstr "Autoptimize Ayarları"
48
-
49
- #: classes/autoptimizeConfig.php:54 classes/autoptimizeConfig.php:60
50
- msgid "Show advanced settings"
51
- msgstr "Gelişmiş ayarları göster"
52
-
53
- #: classes/autoptimizeConfig.php:55 classes/autoptimizeConfig.php:61
54
- msgid "Hide advanced settings"
55
- msgstr "Gelişmiş ayarları gizle"
56
-
57
- #: classes/autoptimizeConfig.php:69
58
- msgid "HTML Options"
59
- msgstr "HTML Seçenekleri"
60
-
61
- #: classes/autoptimizeConfig.php:72
62
- msgid "Optimize HTML Code?"
63
- msgstr "HTML kodunu optimize et"
64
-
65
- #: classes/autoptimizeConfig.php:76
66
- msgid "Keep HTML comments?"
67
- msgstr "HTML yorumlarına dokunma"
68
-
69
- #: classes/autoptimizeConfig.php:78
70
- msgid ""
71
- "Enable this if you want HTML comments to remain in the page, needed for e.g. "
72
- "AdSense to function properly."
73
- msgstr ""
74
- "AdSense gibi platformlarla sorunlar yaşamamak için HTML yorumların "
75
- "silinmeden sayfa kaynağında kalmasını isterseniz bu seçeneği işaretleyin."
76
-
77
- #: classes/autoptimizeConfig.php:82
78
- msgid "JavaScript Options"
79
- msgstr "JavaScript Seçenekleri"
80
-
81
- #: classes/autoptimizeConfig.php:85
82
- msgid "Optimize JavaScript Code?"
83
- msgstr "JavaScript kodunu optimize et"
84
-
85
- #: classes/autoptimizeConfig.php:89
86
- msgid "Force JavaScript in &lt;head&gt;?"
87
- msgstr "JavaScript'i zorla &lt;head&gt;'de yüklet"
88
-
89
- #: classes/autoptimizeConfig.php:91
90
- msgid ""
91
- "Load JavaScript early, reducing the chance of JS-errors but making it render "
92
- "blocking. You can disable this if you're not aggregating inline JS and you "
93
- "want JS to be deferred."
94
- msgstr ""
95
- "JavaScript hatalarını önlemek için JS dosyalarını erkenden yükler ama "
96
- "dosyalar yüklenmeden sayfa açılmaz. Satıriçi JS kodlarını tek bir yerde "
97
- "toparlamıyorsanız ve JS kodlarını defer'lemek istiyorsanız bunu devre dışı "
98
- "bırakabilirsiniz."
99
-
100
- #: classes/autoptimizeConfig.php:95
101
- msgid "Look for scripts only in &lt;head&gt;?"
102
- msgstr "Yalnızca &lt;head&gt;'deki JavaScript dosyalarıyla ilgilen"
103
-
104
- #: classes/autoptimizeConfig.php:95 classes/autoptimizeConfig.php:135
105
- msgid " <i>(deprecated)</i>"
106
- msgstr " <i>(artık kullanılmıyor)</i>"
107
-
108
- #: classes/autoptimizeConfig.php:97
109
- msgid ""
110
- "Mostly useful in combination with previous option when using jQuery-based "
111
- "templates, but might help keeping cache size under control."
112
- msgstr ""
113
- "Çoğunlukla, önceki seçenekle beraber jQuery ağırlıklı temalarında "
114
- "kullanıldığında işe yarar, ama önbellek boyutunu kontrol altında tutmanıza "
115
- "da yardımcı olur."
116
-
117
- #: classes/autoptimizeConfig.php:101
118
- msgid "Also aggregate inline JS?"
119
- msgstr "Satıriçi JS kodlarını toparla?"
120
-
121
- #: classes/autoptimizeConfig.php:103
122
- msgid ""
123
- "Check this option for Autoptimize to also aggregate JS in the HTML. If this "
124
- "option is not enabled, you might have to \"force JavaScript in head\"."
125
- msgstr ""
126
- "Autoptimize'ın JS kodlarını HTML içinde tek bir yerde toplamasını "
127
- "istiyorsanız bunu etkinleştirin. Bu seçenek etkin değilse, \"JavaScript'i "
128
- "&lt;head&gt;'de yüklemeye zorla\" seçeneğini etkinleştirmeniz gerekebilir."
129
-
130
- #: classes/autoptimizeConfig.php:106
131
- msgid "Exclude scripts from Autoptimize:"
132
- msgstr "Autoptimize'dan hariç tutulacak script'ler:"
133
-
134
- #: classes/autoptimizeConfig.php:108
135
- msgid ""
136
- "A comma-seperated list of scripts you want to exclude from being optimized, "
137
- "for example 'whatever.js, another.js' (without the quotes) to exclude those "
138
- "scripts from being aggregated and minimized by Autoptimize."
139
- msgstr ""
140
- "Virgülle ayırılmış, optimize edilmesini istemediğiniz dosya isimlerini "
141
- "buraya yazın (\"falan.js, filan.js\" gibi, tırnaklar olmadan). Bu script'ler "
142
- "Autoptimize tarafından sıkıştırılıp birleştirilmeyecektir."
143
-
144
- #: classes/autoptimizeConfig.php:111
145
- msgid "Add try-catch wrapping?"
146
- msgstr "\"Try-catch\" sarma özelliğini ekle"
147
-
148
- #: classes/autoptimizeConfig.php:113
149
- msgid ""
150
- "If your scripts break because of a JS-error, you might want to try this."
151
- msgstr ""
152
- "Bir JavaScript hatası yüzünden betikleriniz bozuluyorsa, bunu denemek "
153
- "isteyebilirsiniz."
154
-
155
- #: classes/autoptimizeConfig.php:117
156
- msgid "CSS Options"
157
- msgstr "CSS Seçenekleri"
158
-
159
- #: classes/autoptimizeConfig.php:120
160
- msgid "Optimize CSS Code?"
161
- msgstr "CSS kodunu optimize et"
162
-
163
- #: classes/autoptimizeConfig.php:124
164
- msgid "Generate data: URIs for images?"
165
- msgstr "Görseller için data:URI'lar kullan"
166
-
167
- #: classes/autoptimizeConfig.php:126
168
- msgid ""
169
- "Enable this to include small background-images in the CSS itself instead of "
170
- "as seperate downloads."
171
- msgstr ""
172
- "CSS'in içindeki ufak arkaplan görsellerini CSS'in içine gömmek için bunu "
173
- "kullanın."
174
-
175
- #: classes/autoptimizeConfig.php:129
176
- msgid "Remove Google Fonts?"
177
- msgstr "Google yazıtiplerini kaldır?"
178
-
179
- #: classes/autoptimizeConfig.php:131
180
- msgid "Check this if you don't need or want Google Fonts being loaded."
181
- msgstr ""
182
- "Google yazıtiplerinin yüklenmesini istemiyorsanız (veya ihtiyacınız yoksa) "
183
- "bunu işaretleyin."
184
-
185
- #: classes/autoptimizeConfig.php:135
186
- msgid "Look for styles only in &lt;head&gt;?"
187
- msgstr "Yalnızca &lt;head&gt;'deki stil dosyalarıyla ilgilen"
188
-
189
- #: classes/autoptimizeConfig.php:137
190
- msgid ""
191
- "Don't autoptimize CSS outside the head-section. If the cache gets big, you "
192
- "might want to enable this."
193
- msgstr ""
194
- "&lt;head&gt;'deki CSS'ler dışındaki stil dosyalarını hariç tutar. Önbellek "
195
- "dosyanız çok büyürse, bunu etkinleştirmeyi isteyebilirsiniz."
196
-
197
- #: classes/autoptimizeConfig.php:141
198
- msgid "Also aggregate inline CSS?"
199
- msgstr "Satıriçi CSS'i toparla?"
200
-
201
- #: classes/autoptimizeConfig.php:143
202
- msgid "Check this option for Autoptimize to also aggregate CSS in the HTML."
203
- msgstr ""
204
- "Autoptimize'ın satıriçi CSS kodlarını tek bir yerde toparlamasını "
205
- "istiyorsanız bunu işaretleyin."
206
-
207
- #: classes/autoptimizeConfig.php:146
208
- msgid "Inline and Defer CSS?"
209
- msgstr "CSS'i \"inline\" olarak düzenle ve ertele (defer)"
210
-
211
- #: classes/autoptimizeConfig.php:148
212
- msgid ""
213
- "Inline \"above the fold CSS\" while loading the main autoptimized CSS only "
214
- "after page load. <a href=\"http://wordpress.org/plugins/autoptimize/faq/\" "
215
- "target=\"_blank\">Check the FAQ</a> before activating this option!"
216
- msgstr ""
217
- "Sayfanın ekranda gözüken kısmını \"inline\" olarak sayfa içine "
218
- "yerleştirirken geri kalanını sayfa sonunda yükletir. Bu özelliği "
219
- "etkinleştirmeden önce <a href=\"http://wordpress.org/plugins/autoptimize/faq/"
220
- "\" target=\"_blank\">Sık Sorulan Sorular'ı inceleyin</a>!"
221
-
222
- #: classes/autoptimizeConfig.php:152
223
- msgid "Paste the above the fold CSS here."
224
- msgstr "İlk ekranda gözüken elemanların CSS'ini buraya yapıştırın."
225
-
226
- #: classes/autoptimizeConfig.php:155
227
- msgid "Inline all CSS?"
228
- msgstr "Tüm CSS'i \"inline\" olarak düzenle"
229
-
230
- #: classes/autoptimizeConfig.php:157
231
- msgid ""
232
- "Inlining all CSS can improve performance for sites with a low pageviews/ "
233
- "visitor-rate, but may slow down performance otherwise."
234
- msgstr ""
235
- "CSS'i \"inline\" olarak gömmek az ziyaretçi sayısına sahip sitelerde "
236
- "performansı artırırken, popüler sitelerde performansı azaltabilir."
237
-
238
- #: classes/autoptimizeConfig.php:160
239
- msgid "Exclude CSS from Autoptimize:"
240
- msgstr "Autoptimize'dan hariç tutulacak CSS"
241
-
242
- #: classes/autoptimizeConfig.php:162
243
- msgid "A comma-seperated list of CSS you want to exclude from being optimized."
244
- msgstr ""
245
- "Autoptimize'ın kullanmasını istemediğiniz CSS'i buraya koyarak onları hariç "
246
- "tutabilirsiniz."
247
-
248
- #: classes/autoptimizeConfig.php:166
249
- msgid "CDN Options"
250
- msgstr "CDN Seçenekleri"
251
-
252
- #: classes/autoptimizeConfig.php:169
253
- msgid "CDN Base URL"
254
- msgstr "CDN URL Temeli"
255
-
256
- #: classes/autoptimizeConfig.php:171
257
- msgid ""
258
- "Enter your CDN blog root directory URL if you want to enable CDN for images "
259
- "referenced in the CSS."
260
- msgstr ""
261
- "Burada, CSS içindeki URL'lerde kullanılmak üzere bir temel CDN adresi "
262
- "belirleyebilirsiniz."
263
-
264
- #: classes/autoptimizeConfig.php:175
265
- msgid "Cache Info"
266
- msgstr "Cache Bilgisi"
267
-
268
- #: classes/autoptimizeConfig.php:178
269
- msgid "Cache folder"
270
- msgstr "Önbellek dizini"
271
-
272
- #: classes/autoptimizeConfig.php:182
273
- msgid "Can we write?"
274
- msgstr "Yazılabilir durumda mı?"
275
-
276
- #: classes/autoptimizeConfig.php:183
277
- msgid "Yes"
278
- msgstr "Evet"
279
-
280
- #: classes/autoptimizeConfig.php:183
281
- msgid "No"
282
- msgstr "Hayır"
283
-
284
- #: classes/autoptimizeConfig.php:186
285
- msgid "Cached styles and scripts"
286
- msgstr "Önbelleklenen stil ve script'ler"
287
-
288
- #: classes/autoptimizeConfig.php:194
289
- msgid "Save aggregated script/css as static files?"
290
- msgstr "Çıktı script ve stilleri statik dosyalar olarak kaydet"
291
-
292
- #: classes/autoptimizeConfig.php:196
293
- msgid ""
294
- "By default files saved are static css/js, uncheck this option if your "
295
- "webserver doesn't properly handle the compression and expiry."
296
- msgstr ""
297
- "Stil ve script'ler varsayılan olarak statik dosyalar halinde kaydedilir. "
298
- "Eğer sunucunuz sıkıştırma ve expiry'leri düzgün şekilde işleyemiyorsa bunun "
299
- "işaretini kaldırın."
300
-
301
- #: classes/autoptimizeConfig.php:202
302
- msgid "Save Changes"
303
- msgstr "Değişiklikleri Kaydet"
304
-
305
- #: classes/autoptimizeConfig.php:203
306
- msgid "Save Changes and Empty Cache"
307
- msgstr "Değişiklikleri Kaydet ve Önbelleği Temizle"
308
-
309
- #: classes/autoptimizeConfig.php:224
310
- msgid ""
311
- "Need help? <a href='https://wordpress.org/plugins/autoptimize/faq/'>Check "
312
- "out the FAQ</a> or post your question on <a href='http://wordpress.org/"
313
- "support/plugin/autoptimize'>the support-forum</a>."
314
- msgstr ""
315
- "Yardıma mı ihtiyacınız var? <a href='https://wordpress.org/plugins/"
316
- "autoptimize/faq/'>SSS'yi inceleyin</a> (İngilizce) veya <a href='http://"
317
- "wordpress.org/support/plugin/autoptimize'>destek forumunda sorununuzu "
318
- "anlatın</a> (yine İngilizce)."
319
-
320
- #: classes/autoptimizeConfig.php:225
321
- msgid "Happy with Autoptimize?"
322
- msgstr "Autoptimize'dan memnun musunuz?"
323
-
324
- #: classes/autoptimizeConfig.php:225
325
- msgid "Try my other plugins!"
326
- msgstr "Diğer eklentilerime bakın!"
327
-
328
- #: classes/autoptimizeConfig.php:231
329
- msgid "futtta about"
330
- msgstr "futta hakkında"
331
-
332
- #. Plugin Name of the plugin/theme
333
- #: classes/autoptimizeConfig.php:233
334
- msgid "Autoptimize"
335
- msgstr "Autoptimize"
336
-
337
- #: classes/autoptimizeConfig.php:234
338
- msgid "WordPress"
339
- msgstr "WordPress"
340
-
341
- #: classes/autoptimizeConfig.php:235
342
- msgid "Web Technology"
343
- msgstr "Web Teknolojileri"
344
-
345
- #: classes/autoptimizeConfig.php:250
346
- msgid "Do not donate for this plugin!"
347
- msgstr "Bu eklentiye bağış yapmayın!é"
348
-
349
- #: classes/autoptimizeConfig.php:370
350
- msgid "Autoptimize Options"
351
- msgstr "Autoptimize Seçenekleri"
352
-
353
- #: classes/autoptimizeConfig.php:419 classes/autoptimizeConfig.php:425
354
- msgid "Settings"
355
- msgstr "Ayarlar"
356
-
357
- #: classes/autoptimizeConfig.php:488
358
- msgid "No items"
359
- msgstr "Öğe yok"
360
-
361
- #: classes/autoptimizeConfig.php:493
362
- msgid "Posted %s"
363
- msgstr "Gönderildi: %s"
364
-
365
- #: classlesses/autoptimizeCacheChecker.php:50
366
- msgid ""
367
- "Autoptimize's cache size is getting big, consider purging the cache.<br /"
368
- "><br />Have a look at <a href=\"https://wordpress.org/plugins/autoptimize/"
369
- "faq/\" target=\"_blank\">the Autoptimize FAQ</a> to see how you can keep the "
370
- "cache size under control."
371
- msgstr ""
372
- "Autoptimize'ın önbellek boyutu büyümüş, önbelleği temizlemek "
373
- "isteyebilirsiniz.<br /><br /><a href=\"https://wordpress.org/plugins/"
374
- "autoptimize/faq/\" target=\"_blank\">Autoptimize Sık Sorulan Sorularını</a> "
375
- "(İngilizce) inceleyerek önbellek boyutunu kontrol altında tutmayı "
376
- "öğrenebilirsiniz."
377
-
378
- #. Plugin URI of the plugin/theme
379
- msgid "http://blog.futtta.be/autoptimize"
380
- msgstr "http://blog.futtta.be/autoptimize"
381
-
382
- #. Description of the plugin/theme
383
- msgid ""
384
- "Optimizes your website, concatenating the CSS and JavaScript code, and "
385
- "compressing it."
386
- msgstr ""
387
- "CSS ve JavaScript kodlarınızı birleştirip sıkıştırarak, sitenizi optimize "
388
- "etmeye yardımcı olur."
389
-
390
- #. Author of the plugin/theme
391
- msgid "Frank Goossens (futtta)"
392
- msgstr "Frank Goossens (futtta)"
393
-
394
- #. Author URI of the plugin/theme
395
- msgid "http://blog.futtta.be/"
396
- msgstr "http://blog.futtta.be/"
397
-
398
- #~ msgid ""
399
- #~ "For performance reasons it is better to include JavaScript at the bottom "
400
- #~ "of HTML, but this sometimes breaks things. Especially useful for jQuery-"
401
- #~ "based themes."
402
- #~ msgstr ""
403
- #~ "Performans düşünüldüğünde JavaScript dosyalarının, sayfaların en sonunda "
404
- #~ "yüklenmesi tavsiye edilir, ama bu bazen bir takım kodların bozulmasına "
405
- #~ "sebep olur. jQuery ağırlıklı temalarda bu ayar özellikle işe yarar."
406
-
407
- #~ msgid ""
408
- #~ "If your scripts break because of an script error, you might want to try "
409
- #~ "this."
410
- #~ msgstr ""
411
- #~ "Bir script hatası yüzünden JavaScript'leriniz bozuluyorsa, bunu "
412
- #~ "etkinleştirmeyi deneyin."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
localization/autoptimize.pot CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Autoptimize package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Autoptimize 1.9.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
  "POT-Creation-Date: 2015-12-08 22:03:53+00:00\n"
8
  "MIME-Version: 1.0\n"
@@ -310,6 +310,10 @@ msgstr ""
310
  msgid "Posted %s"
311
  msgstr ""
312
 
 
 
 
 
313
  #: classlesses/autoptimizeCacheChecker.php:50
314
  msgid ""
315
  "Autoptimize's cache size is getting big, consider purging the cache.<br /"
2
  # This file is distributed under the same license as the Autoptimize package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Autoptimize 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autoptimize\n"
7
  "POT-Creation-Date: 2015-12-08 22:03:53+00:00\n"
8
  "MIME-Version: 1.0\n"
310
  msgid "Posted %s"
311
  msgstr ""
312
 
313
+ #: classes/autoptimizeToolbar.php:22
314
+ msgid "Delete Cache"
315
+ msgstr ""
316
+
317
  #: classlesses/autoptimizeCacheChecker.php:50
318
  msgid ""
319
  "Autoptimize's cache size is getting big, consider purging the cache.<br /"
localization/index.html ADDED
@@ -0,0 +1 @@
 
1
+ <html><head><meta name="robots" content="noindex, nofollow"></head><body>Generated by <a href="http://wordpress.org/extend/plugins/autoptimize/" rel="nofollow">Autoptimize</a></body></html>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Autoptimize ===
2
  Contributors: futtta, turl, optimizingmatters
3
- Tags: css, html, javascript, js, optimize, speed, cache, aggregate, minify, minification, performance, pagespeed
4
  Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
5
- Requires at least: 2.7
6
- Tested up to: 4.5
7
- Stable tag: 2.0.1
8
 
9
  Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.
10
 
@@ -12,16 +12,15 @@ Autoptimize speeds up your website and helps you save bandwidth by aggregating a
12
 
13
  Autoptimize makes optimizing your site really easy. It concatenates all scripts and styles, minifies and compresses them, adds expires headers, caches them, and moves styles to the page head and can move scripts to the footer. It also minifies the HTML code itself, making your page really lightweight. There are advanced options and an extensive API available to enable you to tailor Autoptimize to each and every site's specific needs.
14
 
15
- If you consider performance important, you really should use a caching-plugin such as e.g. [WP Super Cache](http://wordpress.org/extend/plugins/wp-super-cache/) or
16
- [HyperCache](http://wordpress.org/extend/plugins/hyper-cache/) to complement Autoptimize.
17
 
18
- (Image under creative commons [by LL Twistiti](https://www.flickr.com/photos/twistiti/818552808/))
19
 
20
  == Installation ==
21
 
22
  Just install from your WordPress "Plugins > Add New" screen and all will be well. Manual installation is very straightforward as well:
23
 
24
- 1. Upload the zip file and unzip it in the `/wp-content/plugins/` directory
25
  1. Activate the plugin through the 'Plugins' menu in WordPress
26
  1. Go to `Settings > Autoptimize` and enable the options you want. Generally this means "Optimize HTML/ CSS/ JavaScript".
27
 
@@ -41,7 +40,7 @@ CSS in general should go in the head of the document. Recently a.o. Google start
41
 
42
  = But how can one find out what the "above the fold CSS" is? =
43
 
44
- There's no easy solution for that as "above the fold" depends on where the fold is, which in turn depends on screensize. There are some tools available however, which try to identify just what is "above the fold". [This list of tools](https://github.com/addyosmani/above-the-fold-css-tools) is a great starting point and esp. [http://jonassebastianohlsson.com/criticalpathcssgenerator/](http://jonassebastianohlsson.com/criticalpathcssgenerator/) is an easy solution if you're not into node.js yourself. Alternatively [this bookmarklet](https://gist.github.com/PaulKinlan/6284142) (Chrome-only) can be helpful as well.
45
 
46
  = Or should you inline all CSS? =
47
 
@@ -49,7 +48,7 @@ The short answer: probably not (but I do).
49
 
50
  Back in the days CSS optimization was easy; put all CSS in your head, aggregating everything in one CSS-file per media-type and you were good to go. But ever since Google included mobile in PageSpeed Insights and started complaining about render blocking CSS, things got messy (see "deferring CSS" elsewhere in this FAQ). One of the solutions is inlining all your CSS, which as of Autoptimize 1.8.0 is supported.
51
 
52
- Inlining all CSS has one clear advantage (better PageSpeed score) and one big disadvantage; your base HTML-page gets significantly bigger and if the amount of CSS is big, Pagespeed Insights will complain of "roundtrip times". Also when looking at a test that includes multiple requests (let's say 5 pages), performance will be worse, as the CSS-payload is sent over again and again whereas normally the seperate CSS-files would not need to be sent any more as they would be in cache.
53
 
54
  So the choice should be based on your answer to some site-specific questions; how much CSS do you have? How many pages per visit do your visitors request? If you have a lot of CSS o a high number of pages/ visit, it's probably not a good idea to inline all CSS. But I do (as I have a low amount of average requests/ visitor and only a small amount of CSS as I use a pretty simple theme).
55
 
@@ -66,7 +65,7 @@ You can keep the cache size at an acceptable level by either:
66
 
67
  = Where is the "look only in head" option? =
68
 
69
- While "look only in head" still works, it is now (since Autoptimize 2.0.0) no longer visible on the settings-page if it is not active. As long as the option is active (for JS or CSS), it will however remain visible until you deactivate it. If you're comfortable with PHP, there however still are filters available to keep on using "look only in head".
70
 
71
  = So should I aggregate inline CSS/ JS? =
72
 
@@ -74,12 +73,16 @@ Before Autoptimize 2.0.0, inline code was always optimized with all CSS pushed i
74
 
75
  = What can I do with the API? =
76
 
77
- A whole lot; there are filters you can use to conditionally disable Autoptimize per request, to change the CSS- and JS-excludes, to change the limit for CSS background-images to be inlined in the CSS, to define what JS-files are moved behing the aggregated on, to change the defer-attribute on the aggregated JS script-tag, ... There are examples for many filters in autoptimize_helper.php_example and in this FAQ.
78
 
79
  = How can I use the code in autoptimize_helper.php_example? =
80
 
81
  Although you could add the code to your theme's functions.php, it would get overwritten with your next theme update. Therefor it is better to either create a helper plugin of your own or to simply use [the Code Snippets plugin](https://wordpress.org/plugins/code-snippets/) to manage any custom code.
82
 
 
 
 
 
83
  = How does CDN work? =
84
 
85
  Starting from version 1.7.0, CDN is activated upon entering the CDN blog root directory (e.g. http://cdn.example.net/wordpress/). If that URL is present, it will used for all Autoptimize-generated files (i.e. aggregated CSS and JS), including background-images in the CSS (when not using data-uri's).
@@ -98,11 +101,11 @@ If your webserver is properly configured to handle compression (gzip or deflate)
98
 
99
  = How does "exclude from optimizing" work? =
100
 
101
- Both CSS and JS optimization can skip code from being aggregated and minimized by adding "identifiers" to the comma-seperated exclusion list. The exact identifier string to use can be determined this way:
102
 
103
  * if you want to exclude a specific file, e.g. wp-content/plugins/funkyplugin/css/style.css, you could simply exclude "funkyplugin/css/style.css"
104
  * if you want to exclude all files of a specific plugin, e.g. wp-content/plugins/funkyplugin/js/*, you can exclude for example "funkyplugin/js/" or "plugins/funkyplugin"
105
- * if you want to exclude inline code, you'll have to find a specific, unique string in that block of code and add that to the exclusion list. Example: to exclude ´<script>funky_data='Won\'t you take me to, Funky Town'</script>`, the identifier is "funky_data".
106
 
107
  = Configuring & Troubleshooting Autoptimize =
108
 
@@ -112,7 +115,7 @@ If your blog doesn't function normally after having turned on Autoptimize, here
112
 
113
  * If all works but you notice your blog is slower, ensure you have a page caching plugin installed (WP Super Cache or similar) and check the info on cache size (the solution for that problem also impacts performance for uncached pages) in this FAQ as well.
114
  * In case your blog looks weird, i.e. when the layout gets messed up, there is problem with CSS optimization. In this case you can turn on the option "Look for styles on just head?" and see if that solves the problem. You can also force CSS not to be aggregated by wrapping it in noptimize-tags in your theme or widget or by adding filename (for external stylesheets) or string (for inline styles) to the exclude-list.
115
- * In case some functionality on your site stops working (a carroussel, a menu, the search input, ...) you're likely hitting JavaScript optimization trouble. Disable the option "Aggregate inline JS" and activate "Force JavaScript in <head>?" and try again. Excluding ´jquery.js´ from optimization (see below) and optionally activating "[Add try/catch wrapping](http://blog.futtta.be/2014/08/18/when-should-you-trycatch-javascript/)") can also help. Alternatively -for the technically savvy- you can exclude specific scripts from being treated (moved and/ or aggregated) by Autoptimize by adding a string that will match the offending Javascript or excluding it from within your template files or widgets by wrapping the code between noptimize-tags. Identifying the offending JavaScript and choosing the correct exclusion-string can be trial and error, but in the majority of cases JavaScript optimization issues can be solved this way. When debugging JavaScript issues, your browsers error console is the most important tool to help you understand what is going on.
116
  * If your theme or plugin require jQuery, you can try either forcing all in head and/ or excluding jquery.js (and jQuery-plugins if needed).
117
  * If you can't get either CSS or JS optimization working, you can off course always continue using the other two optimization-techniques.
118
  * If you tried the troubleshooting tips above and you still can't get CSS and JS working at all, you can ask for support on the [WordPress Autoptimize support forum](http://wordpress.org/support/plugin/autoptimize). See below for a description of what information you should provide in your "trouble ticket"
@@ -134,6 +137,7 @@ If you are running Apache, the htaccess file written by Autoptimize can in some
134
  = I get no error, but my pages are not optimized at all? =
135
 
136
  Autoptimize does a number of checks before actually optimizing. When one of the following is true, your pages won't be optimized:
 
137
  * if there is no opening `<html` tag
138
  * if there is `<xsl:stylesheet` in the response (indicating the output is not HTML but XML)
139
  * if there is `<html amp` in the response (as AMP-pages are optimized already)
@@ -141,6 +145,7 @@ Autoptimize does a number of checks before actually optimizing. When one of the
141
  * if the output is a WordPress administration page (is_admin() function)
142
  * if the page is requested with ?ao_noptimize=1 appended to the URL
143
  * if code hooks into Autoptimize to disable optimization (see topic on Visual Composer)
 
144
 
145
  = Visual Composer, Beaver Builder and similar page builder solutions are broken!! =
146
 
@@ -157,6 +162,14 @@ function pagebuilder_noptimize() {
157
  }
158
  `
159
 
 
 
 
 
 
 
 
 
160
  = My Autoptimized CSS/ JS is broken after upgrading from 1.9.4 to 2.0! =
161
 
162
  One of the bigger changes in Autoptimize 2.0 is that files that have "min.js" or "min.css" in their name are considered already minified and are only injected into the aggregated code after the actual minification, because this has an important performance-benefit. Although this has been tested rather thoroughly, it is possible that this approach does not always work. You can turn this behavior off by hooking into Autoptimize's API, like this;
@@ -188,6 +201,10 @@ define('AUTOPTIMIZE_CACHE_CHILD_DIR','/resources/');
188
  define('AUTOPTIMIZE_CACHEFILE_PREFIX','aggregated_');
189
  `
190
 
 
 
 
 
191
  = Where can I report an error? =
192
 
193
  You can report problems on the [wordpress.org support forum](http://wordpress.org/support/plugin/autoptimize). If you are 100% sure this your problem cannot be solved using Autoptimize configuration and that you in fact discovered a bug in the code, you can [create an issue on GitHub](https://github.com/futtta/autoptimize/issues).
@@ -212,15 +229,32 @@ Just [fork Autoptimize on Github](https://github.com/futtta/autoptimize) and cod
212
 
213
  == Changelog ==
214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  = 2.0.1 =
216
- * Improvement: Autoptimize now also tries to purge WP Engine cache when AOs cache is cleared
217
  * Improvement: for AMP pages (which are pretty optimized anyway) Autoptimize will not optimize to avoid issues with e.g. "inline & defer" and with AO adding attributes to link-tags that are not allowed in the subset of HTML that AMP is
218
  * Improvement: refactored the page cache purging mechanism (removing duplicate code, now nicely hooking into AO's own `autoptimize_action_cachepurged` action)
219
- * Improvement: Re-enable functionality to move non-aggregated JS if also aggregate inline JS is active (can be disabled with `autoptiize_filter_js_unmovable` filter)
220
  * Improvement: script tags with `data-noptimize` attribute will be excluded from optimization
221
  * Bugfix: Better support for renamed wp-content directories
222
- * Bugfix: Multiple fixes for late-injected CSS/ JS (changes in those files were not always picked up, fonts or background images were not being CDNed, )
223
- * Misc. other fixes & improvements, go read [the commit-log on GitHub](https://github.com/futtta/autoptimize/commits/master) if youre that curious
224
  * Tested & confirmed working with WordPress 4.5 (beta 3)
225
 
226
  = 2.0.0 =
@@ -230,9 +264,9 @@ Just [fork Autoptimize on Github](https://github.com/futtta/autoptimize) and cod
230
  * New: Cache-size will be checked daily and a notice will be shown on wp-admin if cache size goes over 512 MB (can be changed by filter).
231
  * New: Small autoptimized CSS (less then 256 characters, can be changed by filter) will be inlined instead of linked.
232
  * New in API: filters to declare a JS and CSS whitelist, where only files in that whitelist are autoptimized and all others are left untouched.
233
- * New in API: filters to declare removable CSS and JS, upon which Autoptimize will simply delete that code (emoji CSS/JS for example, if you prefer not to dequeue them).
234
  * New in API: filter to move fonts to CDN as well.
235
- * lots of small and bigger bugfixes, I wont bother you with a full list but have a look at [the commmit log on GitHub](https://github.com/futtta/autoptimize/commits/master).
236
  * tested and confirmed working with PHP7
237
 
238
  = 1.9.4 =
@@ -275,7 +309,7 @@ First of all; Happy holidays, all the best for 2015!!
275
  * "Inline and defer CSS" allows one to specify which "above the fold CSS" should be inlined, while the normal optimized CSS is deferred.
276
  * Inlined Base64-encoded background Images will now be cached as well and the threshold for inlining these images has been bumped up to 4096 bytes (from 2560).
277
  * Separate cache-directories for CSS and JS in /wp-content/cache/autoptimize, which should result in faster cache pruning (and in some cases possibly faster serving of individual aggregated files).
278
- * CSS is now added before the <title>-tag, JS before </body> (and after </title> when forced in head). This can be overridden in the API.
279
  * Some usability improvements of the administration-page
280
  * Multiple hooks added to the API a.o. filters to not aggregate inline CSS or JS and filters to aggregate but not minify CSS or JS.
281
  * Updated translations for Dutch, French, German, Persian and Polish and new translations for Brazilian Portuguese (thanks to [Leonardo Antonioli](http://tobeguarany.com/)) and Turkish (kudo's [Baris Unver](http://beyn.org/))
@@ -284,7 +318,7 @@ First of all; Happy holidays, all the best for 2015!!
284
 
285
  = 1.8.5 =
286
  * Updated to lastest version of [CSS minification component](https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/)
287
- * Improvement: for multi-sites the cache is now written to seperate directories, avoiding one site to clean out the cache for the entire installation. Code [contributed by Joern Lund](http://wordpress.org/support/topic/multisite-blog-admin-can-delete-entire-network-cache), kudo's Joern!!
288
  * Improvement: add WordPress plugin header to autoptimize_helper.php_example to make it easier to enable it as a module
289
  * Improvement: nonce and post_id are added to default configuration for JS exclusion
290
  * Improvement: explicitely exclude wp-admin from being Autoptimized
@@ -391,7 +425,7 @@ First of all; Happy holidays, all the best for 2015!!
391
  * fixed stupid typo in config/delayed.php which broke things badly (april fools-wise); strpos instead of str_pos as reported by Takahiro.
392
 
393
  = 1.6.0 =
394
- * You can now specify scripts that should not be Autoptimized in the admin page. Just add the names (or part of the path) of the scripts in a comma-seperated list and that JavaScript-file will remain untouched by Autoptimize.
395
  * Added support for ETag and LastModified (essentially for a better pagespeed score, as the files are explicitely cacheable for 1 year)
396
  * Autoptimizing for logged in users is enabled again
397
  * Autoptimize now creates an index.html in wp-content/cache/autoptimize to prevent snooping (as [proposed by Chris](http://blog.futtta.be/2013/01/07/adopting-an-oss-orphan-autoptimize/#li-comment-36292))
1
  === Autoptimize ===
2
  Contributors: futtta, turl, optimizingmatters
3
+ Tags: minify, css, html, javascript, js, optimize, speed, cache, aggregate, minification, performance, pagespeed
4
  Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
5
+ Requires at least: 4.0
6
+ Tested up to: 4.7
7
+ Stable tag: 2.1.0
8
 
9
  Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.
10
 
12
 
13
  Autoptimize makes optimizing your site really easy. It concatenates all scripts and styles, minifies and compresses them, adds expires headers, caches them, and moves styles to the page head and can move scripts to the footer. It also minifies the HTML code itself, making your page really lightweight. There are advanced options and an extensive API available to enable you to tailor Autoptimize to each and every site's specific needs.
14
 
15
+ If you consider performance important, you really should use one of the many caching plugins to do page caching. Some good candidates to complement Autoptimize that way are e.g. [WP Super Cache](http://wordpress.org/extend/plugins/wp-super-cache/), [HyperCache](http://wordpress.org/extend/plugins/hyper-cache/), [Comet Cache](https://wordpress.org/plugins/comet-cache/) or [KeyCDN's Cache Enabler](https://wordpress.org/plugins/cache-enabler).
 
16
 
17
+ (Speed-surfing image under creative commons [by LL Twistiti](https://www.flickr.com/photos/twistiti/818552808/))
18
 
19
  == Installation ==
20
 
21
  Just install from your WordPress "Plugins > Add New" screen and all will be well. Manual installation is very straightforward as well:
22
 
23
+ 1. Upload the zip file and unzip it in the `/wp-content/plugins/` directory.
24
  1. Activate the plugin through the 'Plugins' menu in WordPress
25
  1. Go to `Settings > Autoptimize` and enable the options you want. Generally this means "Optimize HTML/ CSS/ JavaScript".
26
 
40
 
41
  = But how can one find out what the "above the fold CSS" is? =
42
 
43
+ There's no easy solution for that as "above the fold" depends on where the fold is, which in turn depends on screensize. There are some tools available however, which try to identify just what is "above the fold". [This list of tools](https://github.com/addyosmani/above-the-fold-css-tools) is a great starting point. [http://jonassebastianohlsson.com/criticalpathcssgenerator/](http://jonassebastianohlsson.com/criticalpathcssgenerator/) is a nice basic solution and [http://criticalcss.com/](http://misc.optimizingmatters.com/partners/?from=faq&amp;partner=critcss) is a premium solution by the same developer. Alternatively [this bookmarklet](https://gist.github.com/PaulKinlan/6284142) (Chrome-only) can be helpful as well.
44
 
45
  = Or should you inline all CSS? =
46
 
48
 
49
  Back in the days CSS optimization was easy; put all CSS in your head, aggregating everything in one CSS-file per media-type and you were good to go. But ever since Google included mobile in PageSpeed Insights and started complaining about render blocking CSS, things got messy (see "deferring CSS" elsewhere in this FAQ). One of the solutions is inlining all your CSS, which as of Autoptimize 1.8.0 is supported.
50
 
51
+ Inlining all CSS has one clear advantage (better PageSpeed score) and one big disadvantage; your base HTML-page gets significantly bigger and if the amount of CSS is big, Pagespeed Insights will complain of "roundtrip times". Also when looking at a test that includes multiple requests (let's say 5 pages), performance will be worse, as the CSS-payload is sent over again and again whereas normally the separate CSS-files would not need to be sent any more as they would be in cache.
52
 
53
  So the choice should be based on your answer to some site-specific questions; how much CSS do you have? How many pages per visit do your visitors request? If you have a lot of CSS o a high number of pages/ visit, it's probably not a good idea to inline all CSS. But I do (as I have a low amount of average requests/ visitor and only a small amount of CSS as I use a pretty simple theme).
54
 
65
 
66
  = Where is the "look only in head" option? =
67
 
68
+ While "look only in head" still works, it is now (since Autoptimize 2.0.0) no longer visible on the settings-page if it is not active. As long as the option is active (for JS or CSS), it will however remain visible until you deactivate it. If you're comfortable with PHP, there still are filters available to keep on using "look only in head".
69
 
70
  = So should I aggregate inline CSS/ JS? =
71
 
73
 
74
  = What can I do with the API? =
75
 
76
+ A whole lot; there are filters you can use to conditionally disable Autoptimize per request, to change the CSS- and JS-excludes, to change the limit for CSS background-images to be inlined in the CSS, to define what JS-files are moved behind the aggregated one, to change the defer-attribute on the aggregated JS script-tag, ... There are examples for many filters in autoptimize_helper.php_example and in this FAQ.
77
 
78
  = How can I use the code in autoptimize_helper.php_example? =
79
 
80
  Although you could add the code to your theme's functions.php, it would get overwritten with your next theme update. Therefor it is better to either create a helper plugin of your own or to simply use [the Code Snippets plugin](https://wordpress.org/plugins/code-snippets/) to manage any custom code.
81
 
82
+ = Why is jquery.js not optimized =
83
+
84
+ Starting from AO 2.1 WordPress core's jquery.js is not optimized for the simple reason a lot of popular plugins inject inline JS that is not aggregated either (due to possible cache size issues with unique code in inline JS) which relies on jquery being available, so excluding jquery.js ensures that most sites will work out of the box. If you want optimize jquery as well, you can remove it from the JS optimization exclusion-list (you might have to enable "also aggregate inline JS" as well or switch to "force JS in head").
85
+
86
  = How does CDN work? =
87
 
88
  Starting from version 1.7.0, CDN is activated upon entering the CDN blog root directory (e.g. http://cdn.example.net/wordpress/). If that URL is present, it will used for all Autoptimize-generated files (i.e. aggregated CSS and JS), including background-images in the CSS (when not using data-uri's).
101
 
102
  = How does "exclude from optimizing" work? =
103
 
104
+ Both CSS and JS optimization can skip code from being aggregated and minimized by adding "identifiers" to the comma-separated exclusion list. The exact identifier string to use can be determined this way:
105
 
106
  * if you want to exclude a specific file, e.g. wp-content/plugins/funkyplugin/css/style.css, you could simply exclude "funkyplugin/css/style.css"
107
  * if you want to exclude all files of a specific plugin, e.g. wp-content/plugins/funkyplugin/js/*, you can exclude for example "funkyplugin/js/" or "plugins/funkyplugin"
108
+ * if you want to exclude inline code, you'll have to find a specific, unique string in that block of code and add that to the exclusion list. Example: to exclude `<script>funky_data='Won\'t you take me to, Funky Town'</script>`, the identifier is "funky_data".
109
 
110
  = Configuring & Troubleshooting Autoptimize =
111
 
115
 
116
  * If all works but you notice your blog is slower, ensure you have a page caching plugin installed (WP Super Cache or similar) and check the info on cache size (the solution for that problem also impacts performance for uncached pages) in this FAQ as well.
117
  * In case your blog looks weird, i.e. when the layout gets messed up, there is problem with CSS optimization. In this case you can turn on the option "Look for styles on just head?" and see if that solves the problem. You can also force CSS not to be aggregated by wrapping it in noptimize-tags in your theme or widget or by adding filename (for external stylesheets) or string (for inline styles) to the exclude-list.
118
+ * In case some functionality on your site stops working (a carroussel, a menu, the search input, ...) you're likely hitting JavaScript optimization trouble. Change the "Aggregate inline JS" and/ or "Force JavaScript in head?" settings and try again. Excluding 'js/jquery/jquery.js' from optimization (see below) and optionally activating "[Add try/catch wrapping](http://blog.futtta.be/2014/08/18/when-should-you-trycatch-javascript/)") can also help. Alternatively -for the technically savvy- you can exclude specific scripts from being treated (moved and/ or aggregated) by Autoptimize by adding a string that will match the offending Javascript or excluding it from within your template files or widgets by wrapping the code between noptimize-tags. Identifying the offending JavaScript and choosing the correct exclusion-string can be trial and error, but in the majority of cases JavaScript optimization issues can be solved this way. When debugging JavaScript issues, your browsers error console is the most important tool to help you understand what is going on.
119
  * If your theme or plugin require jQuery, you can try either forcing all in head and/ or excluding jquery.js (and jQuery-plugins if needed).
120
  * If you can't get either CSS or JS optimization working, you can off course always continue using the other two optimization-techniques.
121
  * If you tried the troubleshooting tips above and you still can't get CSS and JS working at all, you can ask for support on the [WordPress Autoptimize support forum](http://wordpress.org/support/plugin/autoptimize). See below for a description of what information you should provide in your "trouble ticket"
137
  = I get no error, but my pages are not optimized at all? =
138
 
139
  Autoptimize does a number of checks before actually optimizing. When one of the following is true, your pages won't be optimized:
140
+ * when in the customizer
141
  * if there is no opening `<html` tag
142
  * if there is `<xsl:stylesheet` in the response (indicating the output is not HTML but XML)
143
  * if there is `<html amp` in the response (as AMP-pages are optimized already)
145
  * if the output is a WordPress administration page (is_admin() function)
146
  * if the page is requested with ?ao_noptimize=1 appended to the URL
147
  * if code hooks into Autoptimize to disable optimization (see topic on Visual Composer)
148
+ * if other plugins use the output buffer in an incompatible manner (disable other plugins selectively to identify the culprit)
149
 
150
  = Visual Composer, Beaver Builder and similar page builder solutions are broken!! =
151
 
162
  }
163
  `
164
 
165
+ = Revolution Slider is broken! =
166
+
167
+ You can fix this by adding `js/jquery/jquery.js` to the comma-separated list of JS optimization exclusion.
168
+
169
+ = I'm getting "jQuery is not defined" errors =
170
+
171
+ In that case you have un-aggregated JavaScript that requires jQuery to be loaded, so you'll have to either aggregate that JavaScript (ticking the "also aggregate inline JS"-option) or add `js/jquery/jquery.js` to the comma-separated list of JS optimization exclusions.
172
+
173
  = My Autoptimized CSS/ JS is broken after upgrading from 1.9.4 to 2.0! =
174
 
175
  One of the bigger changes in Autoptimize 2.0 is that files that have "min.js" or "min.css" in their name are considered already minified and are only injected into the aggregated code after the actual minification, because this has an important performance-benefit. Although this has been tested rather thoroughly, it is possible that this approach does not always work. You can turn this behavior off by hooking into Autoptimize's API, like this;
201
  define('AUTOPTIMIZE_CACHEFILE_PREFIX','aggregated_');
202
  `
203
 
204
+ = Can the generated JS/ CSS be pre-gzipped? =
205
+
206
+ Yes, but this is off by default. You can enable this by passing ´true´ to ´autoptimize_filter_cache_create_static_gzip´. You'll obviously still have to configure your webserver to use these files instead of the non-gzipped ones to avoid the overhead of on-the-fly compression.
207
+
208
  = Where can I report an error? =
209
 
210
  You can report problems on the [wordpress.org support forum](http://wordpress.org/support/plugin/autoptimize). If you are 100% sure this your problem cannot be solved using Autoptimize configuration and that you in fact discovered a bug in the code, you can [create an issue on GitHub](https://github.com/futtta/autoptimize/issues).
229
 
230
  == Changelog ==
231
 
232
+ = 2.1.0 =
233
+ * new: Autoptimize now appears in admin-toolbar with an easy view on cache size and the possibility to purge the cache (pass `false` to `autoptimize_filter_toolbar_show` filter to disable), a big thanks to [Pablo Custo](https://github.com/pablocusto) for his hard work on this nice feature!
234
+ * new: An extra "More Optimization"-tab is shown (can be hidden with ´autoptimize_filter_show_partner_tabs´-filter) with information about related optimization tools- and services.
235
+ * new: If cache size becomes too big, a mail will be sent to the site admin (pass `false` to `autoptimize_filter_cachecheck_sendmail` filter to disable or pass alternative email to the `autoptimize_filter_cachecheck_mailto` filter to change email-address)
236
+ * new: power-users can enable Autoptimize to pre-gzip the autoptimized files by passing `true` to `autoptimize_filter_cache_create_static_gzip`, kudo's to (Draikin)[https://github.com/Draikin] for this!
237
+ * improvement: admin GUI updated (again; thanks Pablo!) with some responsiveness added in the mix (not showing the right hand column on smaller screen-sizes)
238
+ * improvement: settings-screen now accepts protocol-relative URL for CDN base URL
239
+ * improvement: new (smarter) defaults for JS (don't force in head + exclude jquery.js) and CSS optimization (include inline CSS)
240
+ * Misc. bugfixes & small improvements (see [commit-log on GitHub](https://github.com/futtta/autoptimize/commits/master))
241
+ * Minimal version updated from 2.7 (!) to 4.0
242
+ * Tested and confirmed working on WordPress 4.6
243
+
244
+ = 2.0.2 =
245
+ * bugfix: disallow moving non-aggregated JS by default (can be re-enabled by passing false to the `autoptimize_filter_js_unmovable`)
246
+ * bugfix: hook autoptimize_action_cachepurged into init to avoid ugly error-message for ZenCache (Comet Cache) users
247
+ * bugfix to allow for Autoptimize to work with PHP 5.2 (although [you really should upgrade](http://blog.futtta.be/2016/03/15/why-would-you-still-be-on-php-5-2/))
248
+
249
  = 2.0.1 =
250
+ * Improvement: Autoptimize now also tries to purge WP Engine cache when AO's cache is cleared
251
  * Improvement: for AMP pages (which are pretty optimized anyway) Autoptimize will not optimize to avoid issues with e.g. "inline & defer" and with AO adding attributes to link-tags that are not allowed in the subset of HTML that AMP is
252
  * Improvement: refactored the page cache purging mechanism (removing duplicate code, now nicely hooking into AO's own `autoptimize_action_cachepurged` action)
253
+ * Improvement: Re-enable functionality to move non-aggregated JS if "also aggregate inline JS" is active (can be disabled with `autoptimize_filter_js_unmovable` filter)
254
  * Improvement: script tags with `data-noptimize` attribute will be excluded from optimization
255
  * Bugfix: Better support for renamed wp-content directories
256
+ * Bugfix: Multiple fixes for late-injected CSS/ JS (changes in those files were not always picked up, fonts or background images were not being CDN'ed, ...)
257
+ * Misc. other fixes & improvements, go read [the commit-log on GitHub](https://github.com/futtta/autoptimize/commits/master) if you're that curious
258
  * Tested & confirmed working with WordPress 4.5 (beta 3)
259
 
260
  = 2.0.0 =
264
  * New: Cache-size will be checked daily and a notice will be shown on wp-admin if cache size goes over 512 MB (can be changed by filter).
265
  * New: Small autoptimized CSS (less then 256 characters, can be changed by filter) will be inlined instead of linked.
266
  * New in API: filters to declare a JS and CSS whitelist, where only files in that whitelist are autoptimized and all others are left untouched.
267
+ * New in API: filters to declare removable CSS and JS, upon which Autoptimize will simply delete that code (emoji CSS/JS for example, if you prefer not to dequeue them).
268
  * New in API: filter to move fonts to CDN as well.
269
+ * lots of small and bigger bugfixes, I won't bother you with a full list but have a look at [the commmit log on GitHub](https://github.com/futtta/autoptimize/commits/master).
270
  * tested and confirmed working with PHP7
271
 
272
  = 1.9.4 =
309
  * "Inline and defer CSS" allows one to specify which "above the fold CSS" should be inlined, while the normal optimized CSS is deferred.
310
  * Inlined Base64-encoded background Images will now be cached as well and the threshold for inlining these images has been bumped up to 4096 bytes (from 2560).
311
  * Separate cache-directories for CSS and JS in /wp-content/cache/autoptimize, which should result in faster cache pruning (and in some cases possibly faster serving of individual aggregated files).
312
+ * Autoptimized CSS is now injected before the <title>-tag, JS before </body> (and after </title> when forced in head). This can be overridden in the API.
313
  * Some usability improvements of the administration-page
314
  * Multiple hooks added to the API a.o. filters to not aggregate inline CSS or JS and filters to aggregate but not minify CSS or JS.
315
  * Updated translations for Dutch, French, German, Persian and Polish and new translations for Brazilian Portuguese (thanks to [Leonardo Antonioli](http://tobeguarany.com/)) and Turkish (kudo's [Baris Unver](http://beyn.org/))
318
 
319
  = 1.8.5 =
320
  * Updated to lastest version of [CSS minification component](https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/)
321
+ * Improvement: for multi-sites the cache is now written to separate directories, avoiding one site to clean out the cache for the entire installation. Code [contributed by Joern Lund](http://wordpress.org/support/topic/multisite-blog-admin-can-delete-entire-network-cache), kudo's Joern!!
322
  * Improvement: add WordPress plugin header to autoptimize_helper.php_example to make it easier to enable it as a module
323
  * Improvement: nonce and post_id are added to default configuration for JS exclusion
324
  * Improvement: explicitely exclude wp-admin from being Autoptimized
425
  * fixed stupid typo in config/delayed.php which broke things badly (april fools-wise); strpos instead of str_pos as reported by Takahiro.
426
 
427
  = 1.6.0 =
428
+ * You can now specify scripts that should not be Autoptimized in the admin page. Just add the names (or part of the path) of the scripts in a comma-separated list and that JavaScript-file will remain untouched by Autoptimize.
429
  * Added support for ETag and LastModified (essentially for a better pagespeed score, as the files are explicitely cacheable for 1 year)
430
  * Autoptimizing for logged in users is enabled again
431
  * Autoptimize now creates an index.html in wp-content/cache/autoptimize to prevent snooping (as [proposed by Chris](http://blog.futtta.be/2013/01/07/adopting-an-oss-orphan-autoptimize/#li-comment-36292))