Autoptimize - Version 1.1

Version Description

  • Add workarounds for amazon and fastclick
  • Add workaround for Comment Form Quicktags
  • Fix issue with Vipers Video Quicktags
  • Fix a bug in where some scripts that shouldn't be moved were moved
  • Fix a bug in where the config page wouldn't appear
  • Fix @import handling
  • Implement an option to disable js/css gzipping
  • Implement CDN functionality
  • Implement data: URI generation for images
  • Support YUI CSS/JS Compressor
  • Performance increases
  • Handle WP Super Cache's cache files better
  • Update translations
Download this release

Release Info

Developer turl
Plugin Icon 128x128 Autoptimize
Version 1.1
Comparing to
See all releases

Code changes from version 0.9 to 1.1

autoptimize.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Autoptimize
4
  Plugin URI: http://www.turleando.com.ar/autoptimize/
5
  Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
6
- Version: 0.9
7
  Author: Emilio López
8
  Author URI: http://www.turleando.com.ar/
9
  Released under the GNU General Public License (GPL)
@@ -17,6 +17,13 @@ include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeCache.php');
17
  //Plugin constants
18
  define('AUTOPTIMIZE_CACHE_DIR',WP_CONTENT_DIR.'/cache/autoptimize/');
19
  define('AUTOPTIMIZE_CACHE_URL',WP_CONTENT_URL.'/cache/autoptimize/');
 
 
 
 
 
 
 
20
 
21
  //Load translations
22
  $plugin_dir = basename(dirname(__FILE__));
@@ -53,6 +60,16 @@ function autoptimize_start_buffering()
53
  define('COMPRESS_CSS',false);
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
56
  //Now, start the real thing!
57
  ob_start('autoptimize_end_buffering');
58
  }
@@ -69,6 +86,8 @@ function autoptimize_end_buffering($content)
69
  $classes[] = 'autoptimizeScripts';
70
  if($conf->get('autoptimize_css'))
71
  $classes[] = 'autoptimizeStyles';
 
 
72
  if($conf->get('autoptimize_html'))
73
  $classes[] = 'autoptimizeHTML';
74
 
@@ -76,12 +95,24 @@ function autoptimize_end_buffering($content)
76
  $classoptions = array(
77
  'autoptimizeScripts' => array(
78
  'justhead' => $conf->get('autoptimize_js_justhead'),
79
- 'trycatch' => $conf->get('autoptimize_js_trycatch')
 
80
  ),
81
  'autoptimizeStyles' => array(
82
- 'justhead' => $conf->get('autoptimize_css_justhead')
 
 
 
 
 
 
 
 
 
 
83
  ),
84
  'autoptimizeHTML' => array(
 
85
  )
86
  );
87
 
@@ -104,9 +135,12 @@ function autoptimize_end_buffering($content)
104
  if(autoptimizeCache::cacheavail())
105
  {
106
  $conf = autoptimizeConfig::instance();
107
- if($conf->get('autoptimize_html') || $conf->get('autoptimize_js') || $conf->get('autoptimize_css'))
108
  {
109
  //Hook to wordpress
110
  add_action('template_redirect','autoptimize_start_buffering',2);
111
  }
112
  }
 
 
 
3
  Plugin Name: Autoptimize
4
  Plugin URI: http://www.turleando.com.ar/autoptimize/
5
  Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
6
+ Version: 1.1
7
  Author: Emilio López
8
  Author URI: http://www.turleando.com.ar/
9
  Released under the GNU General Public License (GPL)
17
  //Plugin constants
18
  define('AUTOPTIMIZE_CACHE_DIR',WP_CONTENT_DIR.'/cache/autoptimize/');
19
  define('AUTOPTIMIZE_CACHE_URL',WP_CONTENT_URL.'/cache/autoptimize/');
20
+ define('AUTOPTIMIZE_CACHE_DELAY',true);
21
+
22
+ //Initialize the cache at least once
23
+ $conf = autoptimizeConfig::instance();
24
+
25
+ //Do we gzip when caching?
26
+ define('AUTOPTIMIZE_CACHE_NOGZIP',(bool) $conf->get('autoptimize_cache_nogzip'));
27
 
28
  //Load translations
29
  $plugin_dir = basename(dirname(__FILE__));
60
  define('COMPRESS_CSS',false);
61
  }
62
 
63
+ if($conf->get('autoptimize_js_yui') || $conf->get('autoptimize_css_yui'))
64
+ {
65
+ include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeYUI.php');
66
+ }
67
+
68
+ if($conf->get('autoptimize_cdn_js') || $conf->get('autoptimize_cdn_css'))
69
+ {
70
+ include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeCDN.php');
71
+ }
72
+
73
  //Now, start the real thing!
74
  ob_start('autoptimize_end_buffering');
75
  }
86
  $classes[] = 'autoptimizeScripts';
87
  if($conf->get('autoptimize_css'))
88
  $classes[] = 'autoptimizeStyles';
89
+ if($conf->get('autoptimize_cdn_js') || $conf->get('autoptimize_cdn_css'))
90
+ $classes[] = 'autoptimizeCDN';
91
  if($conf->get('autoptimize_html'))
92
  $classes[] = 'autoptimizeHTML';
93
 
95
  $classoptions = array(
96
  'autoptimizeScripts' => array(
97
  'justhead' => $conf->get('autoptimize_js_justhead'),
98
+ 'trycatch' => $conf->get('autoptimize_js_trycatch'),
99
+ 'yui' => $conf->get('autoptimize_js_yui'),
100
  ),
101
  'autoptimizeStyles' => array(
102
+ 'justhead' => $conf->get('autoptimize_css_justhead'),
103
+ 'datauris' => $conf->get('autoptimize_css_datauris'),
104
+ 'yui' => $conf->get('autoptimize_css_yui'),
105
+ ),
106
+ 'autoptimizeCDN' => array(
107
+ 'js' => $conf->get('autoptimize_cdn_js'),
108
+ 'jsurl' => $conf->get('autoptimize_cdn_js_url'),
109
+ 'css' => $conf->get('autoptimize_cdn_css'),
110
+ 'cssurl' => $conf->get('autoptimize_cdn_css_url'),
111
+ 'img' => $conf->get('autoptimize_cdn_img'),
112
+ 'imgurl' => $conf->get('autoptimize_cdn_img_url')
113
  ),
114
  'autoptimizeHTML' => array(
115
+ 'keepcomments' => $conf->get('autoptimize_html_keepcomments')
116
  )
117
  );
118
 
135
  if(autoptimizeCache::cacheavail())
136
  {
137
  $conf = autoptimizeConfig::instance();
138
+ if($conf->get('autoptimize_html') || $conf->get('autoptimize_js') || $conf->get('autoptimize_css') || $conf->get('autoptimize_cdn_js') || $conf->get('autoptimize_cdn_css'))
139
  {
140
  //Hook to wordpress
141
  add_action('template_redirect','autoptimize_start_buffering',2);
142
  }
143
  }
144
+
145
+ //Do not pollute other plugins
146
+ unset($conf);
classes/autoptimizeCDN.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class autoptimizeCDN extends autoptimizeBase
4
+ {
5
+ private $js = false;
6
+ private $jsurl = null;
7
+ private $css = false;
8
+ private $cssurl = null;
9
+ private $replace = array();
10
+
11
+ //Gets the tags that need replacing
12
+ public function read($options)
13
+ {
14
+ //Remove the HTML comments?
15
+ $this->js = (bool) $options['js'];
16
+ $this->jsurl = $options['jsurl'];
17
+ $this->css = (bool) $options['css'];
18
+ $this->cssurl = $options['cssurl'];
19
+ $this->img = (bool) $options['img'];
20
+ $this->imgurl = $options['imgurl'];
21
+ $siteurl = get_bloginfo('siteurl');
22
+
23
+ if($this->js)
24
+ {
25
+ if(preg_match_all('#<script[^>]*src[^>]*>.*</script>#Usmi',$this->content,$matches))
26
+ {
27
+ foreach($matches[0] as $tag)
28
+ {
29
+ if(preg_match('#src=("|\')(.*)("|\')#Usmi',$tag,$url))
30
+ {
31
+ $url = $url[2];
32
+ if(strpos($url,$siteurl)!==false)
33
+ {
34
+ $this->replace[$tag] = str_replace($siteurl,$this->jsurl,$tag);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ if($this->css)
42
+ {
43
+ if(preg_match_all('#<link[^>]*stylesheet[^>]*>#Usmi',$this->content,$matches))
44
+ {
45
+ foreach($matches[0] as $tag)
46
+ {
47
+ if(preg_match('#href=("|\')(.*)("|\')#Usmi',$tag,$url))
48
+ {
49
+ $url = $url[2];
50
+ if(strpos($url,$siteurl)!==false)
51
+ {
52
+ $this->replace[$tag] = str_replace($siteurl,$this->cssurl,$tag);
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ if($this->img)
60
+ {
61
+ if(preg_match_all('#<img[^>]*src[^>]*>#Usmi',$this->content,$matches))
62
+ {
63
+ foreach($matches[0] as $tag)
64
+ {
65
+ if(preg_match('#src=("|\')(.*)("|\')#Usmi',$tag,$url))
66
+ {
67
+ $url = $url[2];
68
+ if(strpos($url,$siteurl)!==false)
69
+ {
70
+ $this->replace[$tag] = str_replace($siteurl,$this->imgurl,$tag);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ //Do we need further processing?
77
+ return (count($this->replace)>0);
78
+ }
79
+
80
+ //Do the tag replacing
81
+ public function minify()
82
+ {
83
+ //Replace the tags with the CDNed ones
84
+ $this->content = str_replace(array_keys($this->replace),array_values($this->replace),$this->content);
85
+ }
86
+
87
+ //Does nothing
88
+ public function cache()
89
+ {
90
+ //No cache for CDN
91
+ return true;
92
+ }
93
+
94
+ //Returns the content
95
+ public function getcontent()
96
+ {
97
+ return $this->content;
98
+ }
99
+ }
classes/autoptimizeCache.php CHANGED
@@ -5,11 +5,17 @@ class autoptimizeCache
5
  private $filename;
6
  private $mime;
7
  private $cachedir;
 
8
 
9
- public function __construct($md5)
10
  {
11
  $this->cachedir = AUTOPTIMIZE_CACHE_DIR;
12
- $this->filename = 'autoptimize_'.$md5.'.php';
 
 
 
 
 
13
  }
14
 
15
  public function check()
@@ -23,14 +29,37 @@ class autoptimizeCache
23
  return true;
24
  }
25
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  public function cache($code,$mime)
27
  {
28
- $phpcode = file_get_contents(WP_PLUGIN_DIR.'/autoptimize/config/default.php');
29
- $phpcode = str_replace(array('%%CONTENT%%','exit;'),array($mime,''),$phpcode);
30
- file_put_contents($this->cachedir.$this->filename,$phpcode);
31
- file_put_contents($this->cachedir.$this->filename.'.deflate',gzencode($code,9,FORCE_DEFLATE));
32
- file_put_contents($this->cachedir.$this->filename.'.gzip',gzencode($code,9,FORCE_GZIP));
33
- file_put_contents($this->cachedir.$this->filename.'.none',$code);
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
  public function getname()
@@ -50,19 +79,21 @@ class autoptimizeCache
50
  {
51
  if(!in_array($file,array('.','..')) && strpos($file,'autoptimize') !== false && is_file(AUTOPTIMIZE_CACHE_DIR.$file))
52
  {
53
- @@unlink(AUTOPTIMIZE_CACHE_DIR.$file);
54
  }
55
  }
56
 
57
  //Do we need to clean WP Super Cache's cache files?
58
- if(function_exists('wp_cache_clean_cache') && file_exists(WP_CONTENT_DIR.'/wp-cache-config.php'))
59
  {
60
- $cacheconfig = file_get_contents(WP_CONTENT_DIR.'/wp-cache-config.php');
61
- preg_match('#^\$file_prefix\s*=\s*(\'|")(.*)\\1;$#Um',$cacheconfig,$matches);
62
- $prefix = $matches[2];
63
- wp_cache_clean_cache($prefix);
64
- unset($cacheconfig,$prefix);
65
- echo 'WPSUPERCACHEEEE XD';
 
 
66
  }
67
 
68
  return true;
@@ -81,12 +112,17 @@ class autoptimizeCache
81
  {
82
  if(!in_array($file,array('.','..')) && strpos($file,'autoptimize') !== false)
83
  {
84
- if(is_file(AUTOPTIMIZE_CACHE_DIR.$file) && strpos($file,'none') !== false)
85
  {
86
- ++$count;
87
- }/*else{
88
- //Tricky one... it was a dir or a gzip/deflate file
89
- }*/
 
 
 
 
 
90
  }
91
  }
92
 
5
  private $filename;
6
  private $mime;
7
  private $cachedir;
8
+ private $delayed;
9
 
10
+ public function __construct($md5,$ext='php')
11
  {
12
  $this->cachedir = AUTOPTIMIZE_CACHE_DIR;
13
+ $this->delayed = AUTOPTIMIZE_CACHE_DELAY;
14
+ $this->nogzip = AUTOPTIMIZE_CACHE_NOGZIP;
15
+ if($this->nogzip == false)
16
+ $this->filename = 'autoptimize_'.$md5.'.php';
17
+ else
18
+ $this->filename = 'autoptimize_'.$md5.'.'.$ext;
19
  }
20
 
21
  public function check()
29
  return true;
30
  }
31
 
32
+ public function retrieve()
33
+ {
34
+ if($this->check())
35
+ {
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
+ return false;
42
+ }
43
+
44
  public function cache($code,$mime)
45
  {
46
+ if($this->nogzip == false)
47
+ {
48
+ $file = ($this->delayed ? 'delayed.php' : 'default.php');
49
+ $phpcode = file_get_contents(WP_PLUGIN_DIR.'/autoptimize/config/'.$file);
50
+ $phpcode = str_replace(array('%%CONTENT%%','exit;'),array($mime,''),$phpcode);
51
+ file_put_contents($this->cachedir.$this->filename,$phpcode);
52
+ file_put_contents($this->cachedir.$this->filename.'.none',$code);
53
+ if(!$this->delayed)
54
+ {
55
+ //Compress now!
56
+ file_put_contents($this->cachedir.$this->filename.'.deflate',gzencode($code,9,FORCE_DEFLATE));
57
+ file_put_contents($this->cachedir.$this->filename.'.gzip',gzencode($code,9,FORCE_GZIP));
58
+ }
59
+ }else{
60
+ //Write code to cache without doing anything else
61
+ file_put_contents($this->cachedir.$this->filename,$code);
62
+ }
63
  }
64
 
65
  public function getname()
79
  {
80
  if(!in_array($file,array('.','..')) && strpos($file,'autoptimize') !== false && is_file(AUTOPTIMIZE_CACHE_DIR.$file))
81
  {
82
+ @unlink(AUTOPTIMIZE_CACHE_DIR.$file);
83
  }
84
  }
85
 
86
  //Do we need to clean WP Super Cache's cache files?
87
+ if(function_exists('wp_cache_clear_cache'))
88
  {
89
+ //Newer WP-Super-Cache
90
+ //See http://ocaoimh.ie/wp-super-cache-developers/
91
+ wp_cache_clear_cache();
92
+ }elseif(file_exists(WP_CONTENT_DIR.'/wp-cache-config.php') && function_exists('prune_super_cache')){
93
+ //Old WP-Super-Cache
94
+ global $cache_path;
95
+ prune_super_cache($cache_path.'supercache/',true);
96
+ prune_super_cache($cache_path,true);
97
  }
98
 
99
  return true;
112
  {
113
  if(!in_array($file,array('.','..')) && strpos($file,'autoptimize') !== false)
114
  {
115
+ if(is_file(AUTOPTIMIZE_CACHE_DIR.$file))
116
  {
117
+ if(AUTOPTIMIZE_CACHE_NOGZIP && (strpos($file,'.js') !== false || strpos($file,'.css') !== false))
118
+ {
119
+ $count++;
120
+ }elseif(!AUTOPTIMIZE_CACHE_NOGZIP && strpos($file,'.none') !== false){
121
+ $count++;
122
+ }/*else{
123
+ //Tricky one... it was a dir or a gzip/deflate file
124
+ }*/
125
+ }
126
  }
127
  }
128
 
classes/autoptimizeConfig.php CHANGED
@@ -49,6 +49,22 @@ class autoptimizeConfig
49
  <div class="wrap">
50
  <h2><?php _e('Autoptimize Settings','autoptimize'); ?></h2>
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  <form method="post" action="options.php">
53
  <?php settings_fields('autoptimize'); ?>
54
 
@@ -58,6 +74,11 @@ class autoptimizeConfig
58
  <th scope="row"><?php _e('Optimize HTML Code?','autoptimize'); ?></th>
59
  <td><input type="checkbox" name="autoptimize_html" <?php echo get_option('autoptimize_html')?'checked="checked" ':''; ?>/></td>
60
  </tr>
 
 
 
 
 
61
  </table>
62
 
63
  <h3><?php _e('JavaScript Options','autoptimize'); ?></h3>
@@ -76,6 +97,11 @@ class autoptimizeConfig
76
  <td><label for="autoptimize_js_trycatch"><input type="checkbox" name="autoptimize_js_trycatch" <?php echo get_option('autoptimize_js_trycatch')?'checked="checked" ':''; ?>/>
77
  <?php _e('Disabled by default. If your scripts break because of an script error, you might want to try this.','autoptimize'); ?></label></td>
78
  </tr>
 
 
 
 
 
79
  </table>
80
 
81
  <h3><?php _e('CSS Options','autoptimize'); ?></h3>
@@ -89,6 +115,50 @@ class autoptimizeConfig
89
  <td><label for="autoptimize_css_justhead"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead')?'checked="checked" ':''; ?>/>
90
  <?php _e('Disabled by default. If the cache gets big, you might want to enable this.','autoptimize'); ?></label></td>
91
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  </table>
93
 
94
  <h3><?php _e('Cache Info','autoptimize'); ?></h3>
@@ -105,6 +175,11 @@ class autoptimizeConfig
105
  <th scope="row"><?php _e('Cached styles and scripts','autoptimize'); ?></th>
106
  <td><?php echo autoptimizeCache::stats(); ?></td>
107
  </tr>
 
 
 
 
 
108
  </table>
109
 
110
  </table>
@@ -127,12 +202,23 @@ class autoptimizeConfig
127
  public function registersettings()
128
  {
129
  register_setting('autoptimize','autoptimize_html');
 
130
  register_setting('autoptimize','autoptimize_js');
131
  register_setting('autoptimize','autoptimize_js_trycatch');
132
  register_setting('autoptimize','autoptimize_js_justhead');
 
133
  register_setting('autoptimize','autoptimize_css');
134
  register_setting('autoptimize','autoptimize_css_justhead');
 
 
 
 
 
 
 
 
135
  register_setting('autoptimize','autoptimize_cache_clean');
 
136
  }
137
 
138
  public function setmeta($links,$file=null)
@@ -168,11 +254,23 @@ class autoptimizeConfig
168
  {
169
  //Default config
170
  $config = array('autoptimize_html' => 0,
 
171
  'autoptimize_js' => 0,
172
  'autoptimize_js_trycatch' => 0,
173
  'autoptimize_js_justhead' => 0,
 
174
  'autoptimize_css' => 0,
175
- 'autoptimize_css_justhead' => 0);
 
 
 
 
 
 
 
 
 
 
176
 
177
  //Override with user settings
178
  foreach(array_keys($config) as $name)
49
  <div class="wrap">
50
  <h2><?php _e('Autoptimize Settings','autoptimize'); ?></h2>
51
 
52
+ <div style="position:absolute;right:50px;background:#FFFFE0;border:1px solid #E6DB55;padding:5px;text-align:center;">
53
+ Like Autoptimize?
54
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
55
+ <input type="hidden" name="cmd" value="_donations">
56
+ <input type="hidden" name="business" value="webmaster@turl.com.ar">
57
+ <input type="hidden" name="lc" value="AR">
58
+ <input type="hidden" name="item_name" value="Autoptimize">
59
+ <input type="hidden" name="item_number" value="autoptimize">
60
+ <input type="hidden" name="currency_code" value="USD">
61
+ <input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest">
62
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
63
+ <img alt="" border="0" src="https://www.paypal.com/es_XC/i/scr/pixel.gif" width="1" height="1">
64
+ </form>
65
+ Buy me a coffee :-)
66
+ </div>
67
+
68
  <form method="post" action="options.php">
69
  <?php settings_fields('autoptimize'); ?>
70
 
74
  <th scope="row"><?php _e('Optimize HTML Code?','autoptimize'); ?></th>
75
  <td><input type="checkbox" name="autoptimize_html" <?php echo get_option('autoptimize_html')?'checked="checked" ':''; ?>/></td>
76
  </tr>
77
+ <tr valign="top">
78
+ <th scope="row"><?php _e('Keep HTML comments?','autoptimize'); ?></th>
79
+ <td><label for="autoptimize_html_keepcomments"><input type="checkbox" name="autoptimize_html_keepcomments" <?php echo get_option('autoptimize_html_keepcomments')?'checked="checked" ':''; ?>/>
80
+ <?php _e('Disabled by default. Enable this if you want HTML comments to remain in the page.','autoptimize'); ?></label></td>
81
+ </tr>
82
  </table>
83
 
84
  <h3><?php _e('JavaScript Options','autoptimize'); ?></h3>
97
  <td><label for="autoptimize_js_trycatch"><input type="checkbox" name="autoptimize_js_trycatch" <?php echo get_option('autoptimize_js_trycatch')?'checked="checked" ':''; ?>/>
98
  <?php _e('Disabled by default. If your scripts break because of an script error, you might want to try this.','autoptimize'); ?></label></td>
99
  </tr>
100
+ <tr valign="top">
101
+ <th scope="row"><?php _e('Use YUI compression?','autoptimize'); ?></th>
102
+ <td><label for="autoptimize_js_yui"><input type="checkbox" name="autoptimize_js_yui" <?php echo get_option('autoptimize_js_yui')?'checked="checked" ':''; ?>/>
103
+ <?php _e('Disabled by default. Read [autoptimize]/yui/README.txt for more information.','autoptimize'); ?></label></td>
104
+ </tr>
105
  </table>
106
 
107
  <h3><?php _e('CSS Options','autoptimize'); ?></h3>
115
  <td><label for="autoptimize_css_justhead"><input type="checkbox" name="autoptimize_css_justhead" <?php echo get_option('autoptimize_css_justhead')?'checked="checked" ':''; ?>/>
116
  <?php _e('Disabled by default. If the cache gets big, you might want to enable this.','autoptimize'); ?></label></td>
117
  </tr>
118
+ <tr valign="top">
119
+ <th scope="row"><?php _e('Generate data: URIs for images?','autoptimize'); ?></th>
120
+ <td><label for="autoptimize_css_datauris"><input type="checkbox" name="autoptimize_css_datauris" <?php echo get_option('autoptimize_css_datauris')?'checked="checked" ':''; ?>/>
121
+ <?php _e('Disabled by default. Enable this to include images on the CSS itself.','autoptimize'); ?></label></td>
122
+ </tr>
123
+ <tr valign="top">
124
+ <th scope="row"><?php _e('Use YUI compression?','autoptimize'); ?></th>
125
+ <td><label for="autoptimize_css_yui"><input type="checkbox" name="autoptimize_css_yui" <?php echo get_option('autoptimize_css_yui')?'checked="checked" ':''; ?>/>
126
+ <?php _e('Disabled by default. Read [autoptimize]/yui/README.txt for more information.','autoptimize'); ?></label></td>
127
+ </tr>
128
+ </table>
129
+
130
+ <h3><?php _e('CDN Options','autoptimize'); ?></h3>
131
+ <table class="form-table">
132
+ <tr valign="top">
133
+ <th scope="row"><?php _e('Rewrite JavaScript URLs?','autoptimize'); ?></th>
134
+ <td><label for="autoptimize_cdn_js"><input type="checkbox" name="autoptimize_cdn_js" <?php echo get_option('autoptimize_cdn_js')?'checked="checked" ':''; ?>/>
135
+ <?php _e('Disabled by default. Do not enable this unless you know what you are doing.','autoptimize'); ?></label></td>
136
+ </tr>
137
+ <tr valign="top">
138
+ <th scope="row"><?php _e('JavaScript Base URL','autoptimize'); ?></th>
139
+ <td><label for="autoptimize_cdn_js_url"><input type="text" name="autoptimize_cdn_js_url" value="<?php $it = get_option('autoptimize_cdn_js_url');echo htmlentities($it?$it:get_bloginfo('siteurl')); ?>" />
140
+ <?php _e('This is the new base URL that will be used when rewriting. It should point to the blog root directory.','autoptimize'); ?></label></td>
141
+ </tr>
142
+ <tr valign="top">
143
+ <th scope="row"><?php _e('Rewrite CSS URLs?','autoptimize'); ?></th>
144
+ <td><label for="autoptimize_cdn_css"><input type="checkbox" name="autoptimize_cdn_css" <?php echo get_option('autoptimize_cdn_css')?'checked="checked" ':''; ?>/>
145
+ <?php _e('Disabled by default. Do not enable this unless you know what you are doing.','autoptimize'); ?></label></td>
146
+ </tr>
147
+ <tr valign="top">
148
+ <th scope="row"><?php _e('CSS Base URL','autoptimize'); ?></th>
149
+ <td><label for="autoptimize_cdn_css_url"><input type="text" name="autoptimize_cdn_css_url" value="<?php $it = get_option('autoptimize_cdn_css_url');echo htmlentities($it?$it:get_bloginfo('siteurl')); ?>" />
150
+ <?php _e('This is the new base URL that will be used when rewriting. It should point to the blog root directory.','autoptimize'); ?></label></td>
151
+ </tr>
152
+ <tr valign="top">
153
+ <th scope="row"><?php _e('Rewrite Image URLs?','autoptimize'); ?></th>
154
+ <td><label for="autoptimize_cdn_img"><input type="checkbox" name="autoptimize_cdn_img" <?php echo get_option('autoptimize_cdn_img')?'checked="checked" ':''; ?>/>
155
+ <?php _e('Disabled by default. Do not enable this unless you know what you are doing.','autoptimize'); ?></label></td>
156
+ </tr>
157
+ <tr valign="top">
158
+ <th scope="row"><?php _e('Image Base URL','autoptimize'); ?></th>
159
+ <td><label for="autoptimize_cdn_img_url"><input type="text" name="autoptimize_cdn_img_url" value="<?php $it = get_option('autoptimize_cdn_img_url');echo htmlentities($it?$it:get_bloginfo('siteurl')); ?>" />
160
+ <?php _e('This is the new base URL that will be used when rewriting. It should point to the blog root directory.','autoptimize'); ?></label></td>
161
+ </tr>
162
  </table>
163
 
164
  <h3><?php _e('Cache Info','autoptimize'); ?></h3>
175
  <th scope="row"><?php _e('Cached styles and scripts','autoptimize'); ?></th>
176
  <td><?php echo autoptimizeCache::stats(); ?></td>
177
  </tr>
178
+ <tr valign="top">
179
+ <th scope="row"><?php _e('Do not compress cache files','autoptimize'); ?></th>
180
+ <td><label for="autoptimize_cache_nogzip"><input type="checkbox" name="autoptimize_cache_nogzip" <?php echo get_option('autoptimize_cache_nogzip')?'checked="checked" ':''; ?>/>
181
+ <?php _e('Disabled by default. Enable this if you want to compress the served files using your webserver.','autoptimize'); ?></label></td>
182
+ </tr>
183
  </table>
184
 
185
  </table>
202
  public function registersettings()
203
  {
204
  register_setting('autoptimize','autoptimize_html');
205
+ register_setting('autoptimize','autoptimize_html_keepcomments');
206
  register_setting('autoptimize','autoptimize_js');
207
  register_setting('autoptimize','autoptimize_js_trycatch');
208
  register_setting('autoptimize','autoptimize_js_justhead');
209
+ register_setting('autoptimize','autoptimize_js_yui');
210
  register_setting('autoptimize','autoptimize_css');
211
  register_setting('autoptimize','autoptimize_css_justhead');
212
+ register_setting('autoptimize','autoptimize_css_datauris');
213
+ register_setting('autoptimize','autoptimize_css_yui');
214
+ register_setting('autoptimize','autoptimize_cdn_js');
215
+ register_setting('autoptimize','autoptimize_cdn_js_url');
216
+ register_setting('autoptimize','autoptimize_cdn_css');
217
+ register_setting('autoptimize','autoptimize_cdn_css_url');
218
+ register_setting('autoptimize','autoptimize_cdn_img');
219
+ register_setting('autoptimize','autoptimize_cdn_img_url');
220
  register_setting('autoptimize','autoptimize_cache_clean');
221
+ register_setting('autoptimize','autoptimize_cache_nogzip');
222
  }
223
 
224
  public function setmeta($links,$file=null)
254
  {
255
  //Default config
256
  $config = array('autoptimize_html' => 0,
257
+ 'autoptimize_html_keepcomments' => 0,
258
  'autoptimize_js' => 0,
259
  'autoptimize_js_trycatch' => 0,
260
  'autoptimize_js_justhead' => 0,
261
+ 'autoptimize_js_yui' => 0,
262
  'autoptimize_css' => 0,
263
+ 'autoptimize_css_justhead' => 0,
264
+ 'autoptimize_css_datauris' => 0,
265
+ 'autoptimize_css_yui' => 0,
266
+ 'autoptimize_cdn_js' => 0,
267
+ 'autoptimize_cdn_js_url' => get_bloginfo('siteurl'),
268
+ 'autoptimize_cdn_css' => 0,
269
+ 'autoptimize_cdn_css_url' => get_bloginfo('siteurl'),
270
+ 'autoptimize_cdn_img' => 0,
271
+ 'autoptimize_cdn_img_url' => get_bloginfo('siteurl'),
272
+ 'autoptimize_cache_nogzip' => 0,
273
+ );
274
 
275
  //Override with user settings
276
  foreach(array_keys($config) as $name)
classes/autoptimizeHTML.php CHANGED
@@ -2,10 +2,14 @@
2
 
3
  class autoptimizeHTML extends autoptimizeBase
4
  {
 
5
 
6
  //Does nothing
7
- public function read($justhead)
8
  {
 
 
 
9
  //Nothing to read for HTML
10
  return true;
11
  }
@@ -15,8 +19,9 @@ class autoptimizeHTML extends autoptimizeBase
15
  {
16
  if(class_exists('Minify_HTML'))
17
  {
18
- //Remove whitespace
19
- $this->content = Minify_HTML::minify($this->content);
 
20
  return true;
21
  }
22
 
2
 
3
  class autoptimizeHTML extends autoptimizeBase
4
  {
5
+ private $keepcomments = false;
6
 
7
  //Does nothing
8
+ public function read($options)
9
  {
10
+ //Remove the HTML comments?
11
+ $this->keepcomments = (bool) $options['keepcomments'];
12
+
13
  //Nothing to read for HTML
14
  return true;
15
  }
19
  {
20
  if(class_exists('Minify_HTML'))
21
  {
22
+ //Minify html
23
+ $options = array('keepComments' => $this->keepcomments);
24
+ $this->content = Minify_HTML::minify($this->content,$options);
25
  return true;
26
  }
27
 
classes/autoptimizeScripts.php CHANGED
@@ -3,14 +3,16 @@
3
  class autoptimizeScripts extends autoptimizeBase
4
  {
5
  private $scripts = array();
6
- private $dontmove = array('document.write','show_ads.js','google_ad','blogcatalog.com/w','tweetmeme.com/i','mybloglog.com/','swfobject.embedSWF(','var s_sid = ','histats.com/js','smowtion_size','ads.smowtion.com/ad.js','sc_project','statcounter.com/counter/counter.js');
7
- private $domove = array('gaJsHost','load_cmc','jd.gallery.transitions.js');
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');
9
  private $trycatch = false;
 
10
  private $jscode = '';
11
  private $url = '';
12
  private $move = array('first' => array(), 'last' => array());
13
  private $restofcontent = '';
 
14
 
15
  //Reads the page and collects script tags
16
  public function read($options)
@@ -27,6 +29,9 @@ class autoptimizeScripts extends autoptimizeBase
27
  if($options['trycatch'] == true)
28
  $this->trycatch = true;
29
 
 
 
 
30
  //Get script files
31
  if(preg_match_all('#<script.*</script>#Usmi',$this->content,$matches))
32
  {
@@ -39,8 +44,27 @@ class autoptimizeScripts extends autoptimizeBase
39
  $path = $this->getpath($url);
40
  if($path !==false && preg_match('#\.js$#',$path))
41
  {
42
- //Good script
43
- $this->scripts[] = $path;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }else{
45
  //External script (example: google analytics)
46
  //OR Script is dynamic (.php etc)
@@ -121,21 +145,33 @@ class autoptimizeScripts extends autoptimizeBase
121
  }
122
  }
123
 
 
 
 
 
 
 
 
 
 
 
124
  //$this->jscode has all the uncompressed code now.
125
- if(class_exists('JSMin'))
126
  {
127
  $this->jscode = trim(JSMin::minify($this->jscode));
128
  return true;
 
 
 
 
 
129
  }
130
-
131
- return false;
132
  }
133
 
134
  //Caches the JS in uncompressed, deflated and gzipped form.
135
  public function cache()
136
  {
137
- $md5 = md5($this->jscode);
138
- $cache = new autoptimizeCache($md5);
139
  if(!$cache->check())
140
  {
141
  //Cache our code
3
  class autoptimizeScripts extends autoptimizeBase
4
  {
5
  private $scripts = array();
6
+ private $dontmove = array('document.write','show_ads.js','google_ad','blogcatalog.com/w','tweetmeme.com/i','mybloglog.com/','var s_sid = ','histats.com/js','smowtion_size','ads.smowtion.com/ad.js','sc_project','statcounter.com/counter/counter.js','widgets.amung.us','WAU_','wau_add','ws.amazon.com/widgets','media.fastclick.net','/ads/','comment-form-quicktags/quicktags.php','edToolbar','intensedebate.com');
7
+ private $domove = array('gaJsHost','load_cmc','jd.gallery.transitions.js','swfobject.embedSWF(');
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(');
9
  private $trycatch = false;
10
+ private $yui = false;
11
  private $jscode = '';
12
  private $url = '';
13
  private $move = array('first' => array(), 'last' => array());
14
  private $restofcontent = '';
15
+ private $md5hash = '';
16
 
17
  //Reads the page and collects script tags
18
  public function read($options)
29
  if($options['trycatch'] == true)
30
  $this->trycatch = true;
31
 
32
+ //Do we use yui?
33
+ $this->yui = $options['yui'];
34
+
35
  //Get script files
36
  if(preg_match_all('#<script.*</script>#Usmi',$this->content,$matches))
37
  {
44
  $path = $this->getpath($url);
45
  if($path !==false && preg_match('#\.js$#',$path))
46
  {
47
+ //Inline
48
+ if($this->ismergeable($tag))
49
+ {
50
+ //We can merge it
51
+ $this->scripts[] = $path;
52
+ }else{
53
+ //No merge, but maybe we can move it
54
+ if($this->ismovable($tag))
55
+ {
56
+ //Yeah, move it
57
+ if($this->movetolast($tag))
58
+ {
59
+ $this->move['last'][] = $tag;
60
+ }else{
61
+ $this->move['first'][] = $tag;
62
+ }
63
+ }else{
64
+ //We shouldn't touch this
65
+ $tag = '';
66
+ }
67
+ }
68
  }else{
69
  //External script (example: google analytics)
70
  //OR Script is dynamic (.php etc)
145
  }
146
  }
147
 
148
+ //Check for already-minified code
149
+ $this->md5hash = md5($this->jscode);
150
+ $ccheck = new autoptimizeCache($this->md5hash,'js');
151
+ if($ccheck->check())
152
+ {
153
+ $this->jscode = $ccheck->retrieve();
154
+ return true;
155
+ }
156
+ unset($ccheck);
157
+
158
  //$this->jscode has all the uncompressed code now.
159
+ if($this->yui == false && class_exists('JSMin'))
160
  {
161
  $this->jscode = trim(JSMin::minify($this->jscode));
162
  return true;
163
+ }elseif($this->yui == true && autoptimizeYUI::available()){
164
+ $this->jscode = autoptimizeYUI::compress('js',$this->jscode);
165
+ return true;
166
+ }else{
167
+ return false;
168
  }
 
 
169
  }
170
 
171
  //Caches the JS in uncompressed, deflated and gzipped form.
172
  public function cache()
173
  {
174
+ $cache = new autoptimizeCache($this->md5hash,'js');
 
175
  if(!$cache->check())
176
  {
177
  //Cache our code
classes/autoptimizeStyles.php CHANGED
@@ -5,6 +5,10 @@ class autoptimizeStyles extends autoptimizeBase
5
  private $csscode = array();
6
  private $url = array();
7
  private $restofcontent = '';
 
 
 
 
8
 
9
  //Reads the page and collects style tags
10
  public function read($options)
@@ -17,6 +21,12 @@ class autoptimizeStyles extends autoptimizeBase
17
  $this->restofcontent = $content[1];
18
  }
19
 
 
 
 
 
 
 
20
  //Save IE hacks
21
  $this->content = preg_replace('#(<\!--\[if.*\]>.*<\!\[endif\]-->)#Usie',
22
  '\'%%IEHACK%%\'.base64_encode("$1").\'%%IEHACK%%\'',$this->content);
@@ -138,7 +148,7 @@ class autoptimizeStyles extends autoptimizeBase
138
  {
139
  foreach($matches[0] as $import)
140
  {
141
- $url = trim(preg_replace('#.+((?:https?|ftp)://.*\.css)(?:\s|"|\').+#','$1',$import)," \t\n\r\0\x0B\"'");
142
  $path = $this->getpath($url);
143
  if(file_exists($path) && is_readable($path))
144
  {
@@ -152,7 +162,7 @@ class autoptimizeStyles extends autoptimizeBase
152
  //media in @import - how should I handle these?
153
  //TODO: Infinite recursion!
154
  }*/
155
- $thiscss = preg_replace('#(/\*FILESTART\*/.*)'.preg_quote($import,'#').'#Us',$code.'$1',$thiscss);
156
  }else{
157
  //getpath is not working?
158
  //Encode so preg_match doesn't see it
@@ -160,6 +170,8 @@ class autoptimizeStyles extends autoptimizeBase
160
  $fiximports = true;
161
  }
162
  }
 
 
163
  }
164
 
165
  //Recover imports
@@ -171,26 +183,108 @@ class autoptimizeStyles extends autoptimizeBase
171
  unset($thiscss);
172
 
173
  //$this->csscode has all the uncompressed code now.
174
- if(class_exists('Minify_CSS_Compressor'))
 
175
  {
176
- foreach($this->csscode as &$code)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  {
178
  $code = trim(Minify_CSS_Compressor::process($code));
 
 
179
  }
180
- unset($code);
181
- return true;
182
  }
183
-
184
- return false;
185
  }
186
 
187
  //Caches the CSS in uncompressed, deflated and gzipped form.
188
  public function cache()
189
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  foreach($this->csscode as $media => $code)
191
  {
192
- $md5 = md5($code);
193
- $cache = new autoptimizeCache($md5);
 
 
 
 
 
 
194
  if(!$cache->check())
195
  {
196
  //Cache our code
5
  private $csscode = array();
6
  private $url = array();
7
  private $restofcontent = '';
8
+ private $mhtml = '';
9
+ private $datauris = false;
10
+ private $yui = false;
11
+ private $hashmap = array();
12
 
13
  //Reads the page and collects style tags
14
  public function read($options)
21
  $this->restofcontent = $content[1];
22
  }
23
 
24
+ //Store data: URIs setting for later use
25
+ $this->datauris = $options['datauris'];
26
+
27
+ //Do we use yui?
28
+ $this->yui = $options['yui'];
29
+
30
  //Save IE hacks
31
  $this->content = preg_replace('#(<\!--\[if.*\]>.*<\!\[endif\]-->)#Usie',
32
  '\'%%IEHACK%%\'.base64_encode("$1").\'%%IEHACK%%\'',$this->content);
148
  {
149
  foreach($matches[0] as $import)
150
  {
151
+ $url = trim(preg_replace('#^.*((?:https?|ftp)://.*\.css).*$#','$1',$import)," \t\n\r\0\x0B\"'");
152
  $path = $this->getpath($url);
153
  if(file_exists($path) && is_readable($path))
154
  {
162
  //media in @import - how should I handle these?
163
  //TODO: Infinite recursion!
164
  }*/
165
+ $thiscss = preg_replace('#(/\*FILESTART\*/.*)'.preg_quote($import,'#').'#Us','/*FILESTART2*/'.$code.'$1',$thiscss);
166
  }else{
167
  //getpath is not working?
168
  //Encode so preg_match doesn't see it
170
  $fiximports = true;
171
  }
172
  }
173
+ $thiscss = preg_replace('#/\*FILESTART\*/#','',$thiscss);
174
+ $thiscss = preg_replace('#/\*FILESTART2\*/#','/*FILESTART*/',$thiscss);
175
  }
176
 
177
  //Recover imports
183
  unset($thiscss);
184
 
185
  //$this->csscode has all the uncompressed code now.
186
+ $mhtmlcount = 0;
187
+ foreach($this->csscode as &$code)
188
  {
189
+ //Check for already-minified code
190
+ $hash = md5($code);
191
+ $ccheck = new autoptimizeCache($hash,'css');
192
+ if($ccheck->check())
193
+ {
194
+ $code = $ccheck->retrieve();
195
+ $this->hashmap[md5($code)] = $hash;
196
+ continue;
197
+ }
198
+ unset($ccheck);
199
+
200
+ $imgreplace = array();
201
+ //Do the imaging!
202
+ if($this->datauris == true && function_exists('base64_encode') && preg_match_all('#(background[^;}]*url\((.*)\)[^;}]*)(?:;|$|})#Usm',$code,$matches))
203
+ {
204
+ foreach($matches[2] as $count => $quotedurl)
205
+ {
206
+ $url = trim($quotedurl," \t\n\r\0\x0B\"'");
207
+ $path = $this->getpath($url);
208
+ if($path != false && preg_match('#\.(jpe?j|png|gif|bmp)$#',$path) && file_exists($path) && is_readable($path) && filesize($path) <= 5120)
209
+ {
210
+ //It's an image
211
+ //Get type
212
+ switch(end(explode('.',$path)))
213
+ {
214
+ case 'jpej':
215
+ case 'jpg':
216
+ $dataurihead = 'data:image/jpeg;base64,';
217
+ break;
218
+ case 'gif':
219
+ $dataurihead = 'data:image/gif;base64,';
220
+ break;
221
+ case 'png':
222
+ $dataurihead = 'data:image/png;base64,';
223
+ break;
224
+ case 'bmp':
225
+ $dataurihead = 'data:image/bmp;base64,';
226
+ break;
227
+ default:
228
+ $dataurihead = 'data:application/octet-stream;base64,';
229
+ }
230
+
231
+ //Encode the data
232
+ $base64data = base64_encode(file_get_contents($path));
233
+
234
+ //Add it to the list for replacement
235
+ $imgreplace[$matches[1][$count]] = str_replace($quotedurl,$dataurihead.$base64data,$matches[1][$count]).";\n*".str_replace($quotedurl,'mhtml:%%MHTML%%!'.$mhtmlcount,$matches[1][$count]).";\n_".$matches[1][$count].';';
236
+
237
+ //Store image on the mhtml document
238
+ $this->mhtml .= "--_\r\nContent-Location:{$mhtmlcount}\r\nContent-Transfer-Encoding:base64\r\n\r\n{$base64data}\r\n";
239
+ $mhtmlcount++;
240
+ }
241
+ }
242
+ //Replace the images
243
+ $code = str_replace(array_keys($imgreplace),array_values($imgreplace),$code);
244
+ }
245
+
246
+ //Minify
247
+ if($this->yui == false && class_exists('Minify_CSS_Compressor'))
248
  {
249
  $code = trim(Minify_CSS_Compressor::process($code));
250
+ }elseif($this->yui == true && autoptimizeYUI::available()){
251
+ $code = autoptimizeYUI::compress('css',$code);
252
  }
253
+
254
+ $this->hashmap[md5($code)] = $hash;
255
  }
256
+ unset($code);
257
+ return true;
258
  }
259
 
260
  //Caches the CSS in uncompressed, deflated and gzipped form.
261
  public function cache()
262
  {
263
+ if($this->datauris)
264
+ {
265
+ //MHTML Preparation
266
+ $this->mhtml = "/*\r\nContent-Type: multipart/related; boundary=\"_\"\r\n\r\n".$this->mhtml."*/\r\n";
267
+ $md5 = md5($this->mhtml);
268
+ $cache = new autoptimizeCache($md5,'txt');
269
+ if(!$cache->check())
270
+ {
271
+ //Cache our images for IE
272
+ $cache->cache($this->mhtml,'text/plain');
273
+ }
274
+ $mhtml = AUTOPTIMIZE_CACHE_URL.$cache->getname();
275
+ }
276
+
277
+ //CSS cache
278
  foreach($this->csscode as $media => $code)
279
  {
280
+ if($this->datauris)
281
+ {
282
+ //Images for ie! Get the right url
283
+ $code = str_replace('%%MHTML%%',$mhtml,$code);
284
+ }
285
+
286
+ $md5 = $this->hashmap[md5($code)];
287
+ $cache = new autoptimizeCache($md5,'css');
288
  if(!$cache->check())
289
  {
290
  //Cache our code
classes/autoptimizeYUI.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class autoptimizeYUI
4
+ {
5
+ static function available()
6
+ {
7
+ //If we can run apps
8
+ if(function_exists('shell_exec') && is_callable('shell_exec'))
9
+ {
10
+ //And if YUI is there for us
11
+ if(file_exists('/usr/bin/java') && file_exists(WP_PLUGIN_DIR.'/autoptimize/yui/yuicompressor.jar'))
12
+ {
13
+ //And we have a dir in where to work
14
+ if(is_writable(WP_PLUGIN_DIR.'/autoptimize/yui/'))
15
+ {
16
+ //Then we're available
17
+ return true;
18
+ }
19
+ }
20
+ }
21
+ //We can't use YUI :(
22
+ return false;
23
+ }
24
+
25
+ static function compress($type,$code)
26
+ {
27
+ //Check for supported types
28
+ if(!in_array($type,array('js','css')))
29
+ return false;
30
+
31
+ //Write temp file
32
+ $file = tempnam(WP_PLUGIN_DIR.'/autoptimize/yui/',$type);
33
+ file_put_contents($file,$code);
34
+
35
+ //Call YUI
36
+ $yuipath = escapeshellarg(WP_PLUGIN_DIR.'/autoptimize/yui/yuicompressor.jar');
37
+ $code = shell_exec('/usr/bin/java -jar '.$yuipath.' --type '.$type.' '.escapeshellarg($file));
38
+
39
+ //Delete temp file
40
+ unlink($file);
41
+
42
+ //Give the code!
43
+ return $code;
44
+ }
45
+ }
classes/minify-html.php CHANGED
@@ -33,6 +33,9 @@ class Minify_HTML {
33
  *
34
  * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
35
  * unset, minify will sniff for an XHTML doctype.
 
 
 
36
  *
37
  * @return string
38
  */
@@ -56,6 +59,9 @@ class Minify_HTML {
56
  * elements. Note: the type attribute is ignored.
57
  *
58
  * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
 
 
 
59
  * unset, minify will sniff for an XHTML doctype.
60
  *
61
  * @return null
@@ -72,6 +78,9 @@ class Minify_HTML {
72
  if (isset($options['jsMinifier'])) {
73
  $this->_jsMinifier = $options['jsMinifier'];
74
  }
 
 
 
75
  }
76
 
77
 
@@ -102,11 +111,13 @@ class Minify_HTML {
102
  ,$this->_html);
103
 
104
  // remove HTML comments (not containing IE conditional comments).
105
- $this->_html = preg_replace_callback(
106
- '/<!--([\\s\\S]*?)-->/'
107
- ,array($this, '_commentCB')
108
- ,$this->_html);
109
-
 
 
110
  // replace PREs with placeholders
111
  $this->_html = preg_replace_callback('/\\s*(<pre\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
112
  ,array($this, '_removePreCB')
@@ -172,6 +183,7 @@ class Minify_HTML {
172
  protected $_placeholders = array();
173
  protected $_cssMinifier = null;
174
  protected $_jsMinifier = null;
 
175
 
176
  protected function _outsideTagCB($m)
177
  {
33
  *
34
  * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
35
  * unset, minify will sniff for an XHTML doctype.
36
+ *
37
+ * 'keepComments' : (optional boolean) should the HTML comments be kept
38
+ * in the HTML Code?
39
  *
40
  * @return string
41
  */
59
  * elements. Note: the type attribute is ignored.
60
  *
61
  * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
62
+ * unset, minify will sniff for an XHTML doctype.
63
+ *
64
+ * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
65
  * unset, minify will sniff for an XHTML doctype.
66
  *
67
  * @return null
78
  if (isset($options['jsMinifier'])) {
79
  $this->_jsMinifier = $options['jsMinifier'];
80
  }
81
+ if (isset($options['keepComments'])) {
82
+ $this->_keepComments = $options['keepComments'];
83
+ }
84
  }
85
 
86
 
111
  ,$this->_html);
112
 
113
  // remove HTML comments (not containing IE conditional comments).
114
+ if ($this->_keepComments == false) {
115
+ $this->_html = preg_replace_callback(
116
+ '/<!--([\\s\\S]*?)-->/'
117
+ ,array($this, '_commentCB')
118
+ ,$this->_html);
119
+ }
120
+
121
  // replace PREs with placeholders
122
  $this->_html = preg_replace_callback('/\\s*(<pre\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
123
  ,array($this, '_removePreCB')
183
  protected $_placeholders = array();
184
  protected $_cssMinifier = null;
185
  protected $_jsMinifier = null;
186
+ protected $_keepComments = false;
187
 
188
  protected function _outsideTagCB($m)
189
  {
config/default.php CHANGED
@@ -1,4 +1,11 @@
1
  <?php exit;
 
 
 
 
 
 
 
2
  // Determine supported compression method
3
  $gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
4
  $deflate = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate');
@@ -19,16 +26,20 @@ if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') &&
19
  $encoding = 'none';
20
  }
21
 
 
 
 
 
22
  //Get data
23
  $contents = file_get_contents(__FILE__.'.'.$encoding);
24
 
25
- if (isset($encoding) && $encoding != 'none')
26
  {
27
  // Send compressed contents
28
  header('Content-Encoding: '.$encoding);
29
- header('Content-Length: '.strlen($contents));
30
  }
31
  header('Vary: Accept-Encoding');
 
32
 
33
  header('Content-type: %%CONTENT%%; charset=utf-8');
34
  header('Cache-Control: max-age=315360000, public, must-revalidate');
1
  <?php exit;
2
+
3
+ //Check everything exists before using it
4
+ if(!isset($_SERVER['HTTP_ACCEPT_ENCODING']))
5
+ $_SERVER['HTTP_ACCEPT_ENCODING'] = '';
6
+ if(!isset($_SERVER['HTTP_USER_AGENT']))
7
+ $_SERVER['HTTP_USER_AGENT'] = '';
8
+
9
  // Determine supported compression method
10
  $gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
11
  $deflate = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate');
26
  $encoding = 'none';
27
  }
28
 
29
+ //Some servers compress the output of PHP - Don't break in those cases
30
+ if(ini_get('output_handler') == 'ob_gzhandler' || ini_get('zlib.output_compression') == 1)
31
+ $encoding = 'none';
32
+
33
  //Get data
34
  $contents = file_get_contents(__FILE__.'.'.$encoding);
35
 
36
+ if(isset($encoding) && $encoding != 'none')
37
  {
38
  // Send compressed contents
39
  header('Content-Encoding: '.$encoding);
 
40
  }
41
  header('Vary: Accept-Encoding');
42
+ header('Content-Length: '.strlen($contents));
43
 
44
  header('Content-type: %%CONTENT%%; charset=utf-8');
45
  header('Cache-Control: max-age=315360000, public, must-revalidate');
config/delayed.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php exit;
2
+
3
+ //Check everything exists before using it
4
+ if(!isset($_SERVER['HTTP_ACCEPT_ENCODING']))
5
+ $_SERVER['HTTP_ACCEPT_ENCODING'] = '';
6
+ if(!isset($_SERVER['HTTP_USER_AGENT']))
7
+ $_SERVER['HTTP_USER_AGENT'] = '';
8
+
9
+ // Determine supported compression method
10
+ $gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
11
+ $deflate = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate');
12
+
13
+ // Determine used compression method
14
+ $encoding = $gzip ? 'gzip' : ($deflate ? 'deflate' : 'none');
15
+
16
+ // Check for buggy versions of Internet Explorer
17
+ if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') &&
18
+ preg_match('/^Mozilla\/4\.0 \(compatible; MSIE ([0-9]\.[0-9])/i', $_SERVER['HTTP_USER_AGENT'], $matches))
19
+ {
20
+ $version = floatval($matches[1]);
21
+
22
+ if ($version < 6)
23
+ $encoding = 'none';
24
+
25
+ if ($version == 6 && !strstr($_SERVER['HTTP_USER_AGENT'], 'EV1'))
26
+ $encoding = 'none';
27
+ }
28
+
29
+ //Some servers compress the output of PHP - Don't break in those cases
30
+ if(ini_get('output_handler') == 'ob_gzhandler' || ini_get('zlib.output_compression') == 1)
31
+ $encoding = 'none';
32
+
33
+ $iscompressed = file_exists(__FILE__.'.'.$encoding);
34
+ if($encoding != 'none' && $iscompressed == false)
35
+ {
36
+ $flag = ($encoding == 'gzip' ? FORCE_GZIP : FORCE_DEFLATE);
37
+ $code = file_get_contents(__FILE__.'.none');
38
+ $contents = gzencode($code,9,$flag);
39
+ }else{
40
+ //Get data
41
+ $contents = file_get_contents(__FILE__.'.'.$encoding);
42
+ }
43
+
44
+ if ($encoding != 'none')
45
+ {
46
+ // Send compressed contents
47
+ header('Content-Encoding: '.$encoding);
48
+ }
49
+ header('Vary: Accept-Encoding');
50
+ header('Content-Length: '.strlen($contents));
51
+
52
+ header('Content-type: %%CONTENT%%; charset=utf-8');
53
+ header('Cache-Control: max-age=315360000, public, must-revalidate');
54
+ header('Expires: '.gmdate('D, d M Y H:i:s', time() + 315360000).' GMT'); //10 years
55
+
56
+ echo $contents;
57
+
58
+ //Write it here
59
+ if($encoding != 'none' && $iscompressed == false)
60
+ {
61
+ //Write the content we sent
62
+ file_put_contents(__FILE__.'.'.$encoding,$contents);
63
+
64
+ //And write the new content
65
+ $flag = ($encoding == 'gzip' ? FORCE_DEFLATE : FORCE_GZIP);
66
+ $ext = ($encoding == 'gzip' ? 'deflate' : 'gzip');
67
+ $contents = gzencode($code,9,$flag);
68
+ file_put_contents(__FILE__.'.'.$ext,$contents);
69
+ }
localization/autoptimize-es_ES.mo CHANGED
Binary file
localization/autoptimize-es_ES.po CHANGED
@@ -7,107 +7,205 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: autoptimize\n"
9
  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
- "POT-Creation-Date: 2009-07-24 22:40+0000\n"
11
- "PO-Revision-Date: 2009-07-24 20:10-0300\n"
12
- "Last-Translator: Emilio López <turl@tuxfamily.org>\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-07-24 23: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:55
25
  msgid "HTML Options"
26
  msgstr "Opciones de HTML"
27
 
28
- #: classes/autoptimizeConfig.php:58
29
  msgid "Optimize HTML Code?"
30
  msgstr "¿Optimizar el código HTML?"
31
 
32
- #: classes/autoptimizeConfig.php:63
 
 
 
 
 
 
 
 
 
 
 
 
33
  msgid "JavaScript Options"
34
  msgstr "Opciones de JavaScript"
35
 
36
- #: classes/autoptimizeConfig.php:66
37
  msgid "Optimize JavaScript Code?"
38
  msgstr "¿Optimizar el código JavaScript?"
39
 
40
- #: classes/autoptimizeConfig.php:70
41
  msgid "Look for scripts only in &lt;head&gt;?"
42
  msgstr "¿Buscar scripts solo en &lt;head&gt;?"
43
 
44
- #: classes/autoptimizeConfig.php:72
45
- #: classes/autoptimizeConfig.php:90
46
- msgid "Disabled by default. If the cache gets big, you might want to enable this."
47
- msgstr "Deshabilitado por defecto. Si el cache se hace grande, tal vez quiera habilitar esto."
 
 
48
 
49
- #: classes/autoptimizeConfig.php:75
50
  msgid "Add try-catch wrapping?"
51
  msgstr "¿Añadir envolturas try-catch?"
52
 
53
- #: classes/autoptimizeConfig.php:77
54
- msgid "Disabled by default. If your scripts break because of an script error, you might want to try this."
55
- msgstr "Deshabilitado por defecto. Si sus scripts dejan de funcionar por un error de scripting, tal vez quiera probar esto."
 
 
 
 
 
 
 
 
56
 
57
- #: classes/autoptimizeConfig.php:81
 
 
 
 
 
 
 
58
  msgid "CSS Options"
59
  msgstr "Opciones de CSS"
60
 
61
- #: classes/autoptimizeConfig.php:84
62
  msgid "Optimize CSS Code?"
63
  msgstr "¿Optimizar el código CSS?"
64
 
65
- #: classes/autoptimizeConfig.php:88
66
  msgid "Look for styles on just &lt;head&gt;?"
67
  msgstr "¿Buscar estilos solo en &lt;head&gt;?"
68
 
69
- #: classes/autoptimizeConfig.php:94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  msgid "Cache Info"
71
  msgstr "Información sobre el Caché"
72
 
73
- #: classes/autoptimizeConfig.php:97
74
  msgid "Cache folder"
75
  msgstr "Carpeta de Caché"
76
 
77
- #: classes/autoptimizeConfig.php:101
78
  msgid "Can we write?"
79
  msgstr "¿Se puede escribir?"
80
 
81
- #: classes/autoptimizeConfig.php:102
82
  msgid "Yes"
83
  msgstr "Si"
84
 
85
- #: classes/autoptimizeConfig.php:102
86
  msgid "No"
87
  msgstr "No"
88
 
89
- #: classes/autoptimizeConfig.php:105
90
  msgid "Cached styles and scripts"
91
  msgstr "Estilos y scripts cacheados"
92
 
93
- #: classes/autoptimizeConfig.php:113
 
 
 
 
 
 
 
 
 
 
 
 
94
  msgid "Save Changes"
95
  msgstr "Guardar Cambios"
96
 
97
- #: classes/autoptimizeConfig.php:114
98
  msgid "Save Changes and Empty Cache"
99
  msgstr "Guardar Cambios y Vaciar el Caché"
100
 
101
- #: classes/autoptimizeConfig.php:124
102
  msgid "Autoptimize Options"
103
  msgstr "Configuración de Autoptimize"
104
 
105
- #: classes/autoptimizeConfig.php:150
106
- #: classes/autoptimizeConfig.php:157
107
  msgid "Settings"
108
  msgstr "Configuración"
109
 
110
  #. Description of an extension
111
- msgid "Optimizes your website, concatenating the CSS and JavaScript code, and compressing it."
112
- msgstr "Optimiza tu sitio web, concatenando el código CSS y Javascript, y comprimiéndolo."
113
-
 
 
 
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 ADDED
Binary file
localization/autoptimize-fr_FR.po ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # French 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-07-25 18:25+0000\n"
12
+ "Last-Translator: Emilio <Unknown>\n"
13
+ "Language-Team: French <fr@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 "Configuration d'Autoptimize"
23
+
24
+ #: classes/autoptimizeConfig.php:71
25
+ msgid "HTML Options"
26
+ msgstr "Options HTML"
27
+
28
+ #: classes/autoptimizeConfig.php:74
29
+ msgid "Optimize HTML Code?"
30
+ msgstr "Optimiser le code HTML ?"
31
+
32
+ #: classes/autoptimizeConfig.php:78
33
+ msgid "Keep HTML comments?"
34
+ msgstr "Conserver les commentaires 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
+ "Désactivé par défaut. Activez cette option si vous voulez conserver les "
42
+ "commentaires HTML dans la page."
43
+
44
+ #: classes/autoptimizeConfig.php:84
45
+ msgid "JavaScript Options"
46
+ msgstr "Options Javascript"
47
+
48
+ #: classes/autoptimizeConfig.php:87
49
+ msgid "Optimize JavaScript Code?"
50
+ msgstr "Optimiser le code Javascript ?"
51
+
52
+ #: classes/autoptimizeConfig.php:91
53
+ msgid "Look for scripts only in &lt;head&gt;?"
54
+ msgstr "Chercher les scripts uniquement dans l'en-tête ?"
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
+ "Désactivé par défaut. Si le cache devient trop important, vous devriez "
61
+ "activer ceci."
62
+
63
+ #: classes/autoptimizeConfig.php:96
64
+ msgid "Add try-catch wrapping?"
65
+ msgstr ""
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
+ "Désactivé par défaut. Si vos scripts plantent à cause d'une erreur de "
73
+ "script, vous devriez essayer ceci."
74
+
75
+ #: classes/autoptimizeConfig.php:101 classes/autoptimizeConfig.php:124
76
+ msgid "Use YUI compression?"
77
+ msgstr ""
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
+
84
+ #: classes/autoptimizeConfig.php:107
85
+ msgid "CSS Options"
86
+ msgstr "Options CSS"
87
+
88
+ #: classes/autoptimizeConfig.php:110
89
+ msgid "Optimize CSS Code?"
90
+ msgstr "Optimiser le code CSS ?"
91
+
92
+ #: classes/autoptimizeConfig.php:114
93
+ msgid "Look for styles on just &lt;head&gt;?"
94
+ msgstr "Chercher les styles uniquement dans l'en-tête ?"
95
+
96
+ #: classes/autoptimizeConfig.php:119
97
+ msgid "Generate data: URIs for images?"
98
+ msgstr ""
99
+
100
+ #: classes/autoptimizeConfig.php:121
101
+ msgid "Disabled by default. Enable this to include images on the CSS itself."
102
+ msgstr ""
103
+
104
+ #: classes/autoptimizeConfig.php:130
105
+ msgid "CDN Options"
106
+ msgstr ""
107
+
108
+ #: classes/autoptimizeConfig.php:133
109
+ msgid "Rewrite JavaScript URLs?"
110
+ msgstr ""
111
+
112
+ #: classes/autoptimizeConfig.php:135 classes/autoptimizeConfig.php:145
113
+ #: classes/autoptimizeConfig.php:155
114
+ msgid ""
115
+ "Disabled by default. Do not enable this unless you know what you are doing."
116
+ msgstr ""
117
+
118
+ #: classes/autoptimizeConfig.php:138
119
+ msgid "JavaScript Base URL"
120
+ msgstr ""
121
+
122
+ #: classes/autoptimizeConfig.php:140 classes/autoptimizeConfig.php:150
123
+ #: classes/autoptimizeConfig.php:160
124
+ msgid ""
125
+ "This is the new base URL that will be used when rewriting. It should point "
126
+ "to the blog root directory."
127
+ msgstr ""
128
+
129
+ #: classes/autoptimizeConfig.php:143
130
+ msgid "Rewrite CSS URLs?"
131
+ msgstr ""
132
+
133
+ #: classes/autoptimizeConfig.php:148
134
+ msgid "CSS Base URL"
135
+ msgstr ""
136
+
137
+ #: classes/autoptimizeConfig.php:153
138
+ msgid "Rewrite Image URLs?"
139
+ msgstr ""
140
+
141
+ #: classes/autoptimizeConfig.php:158
142
+ msgid "Image Base URL"
143
+ msgstr ""
144
+
145
+ #: classes/autoptimizeConfig.php:164
146
+ msgid "Cache Info"
147
+ msgstr "Informations du cache"
148
+
149
+ #: classes/autoptimizeConfig.php:167
150
+ msgid "Cache folder"
151
+ msgstr "Dossier du cache"
152
+
153
+ #: classes/autoptimizeConfig.php:171
154
+ msgid "Can we write?"
155
+ msgstr ""
156
+
157
+ #: classes/autoptimizeConfig.php:172
158
+ msgid "Yes"
159
+ msgstr "Oui"
160
+
161
+ #: classes/autoptimizeConfig.php:172
162
+ msgid "No"
163
+ msgstr "Non"
164
+
165
+ #: classes/autoptimizeConfig.php:175
166
+ msgid "Cached styles and scripts"
167
+ msgstr "Styles et scripts en cache"
168
+
169
+ #: classes/autoptimizeConfig.php:179
170
+ msgid "Do not compress cache files"
171
+ msgstr ""
172
+
173
+ #: classes/autoptimizeConfig.php:181
174
+ msgid ""
175
+ "Disabled by default. Enable this if you want to compress the served files "
176
+ "using your webserver."
177
+ msgstr ""
178
+
179
+ #: classes/autoptimizeConfig.php:188
180
+ msgid "Save Changes"
181
+ msgstr "Enregistrer les modifications"
182
+
183
+ #: classes/autoptimizeConfig.php:189
184
+ msgid "Save Changes and Empty Cache"
185
+ msgstr ""
186
+
187
+ #: classes/autoptimizeConfig.php:199
188
+ msgid "Autoptimize Options"
189
+ msgstr "Options d'Autoptimize"
190
+
191
+ #: classes/autoptimizeConfig.php:236 classes/autoptimizeConfig.php:243
192
+ msgid "Settings"
193
+ msgstr "Paramètres"
194
+
195
+ #. Description of an extension
196
+ msgid ""
197
+ "Optimizes your website, concatenating the CSS and JavaScript code, and "
198
+ "compressing it."
199
+ msgstr ""
200
+ "Optimise votre site web en concaténant le code CSS et Javascript et en le "
201
+ "compressant."
localization/autoptimize-ru_RU.mo ADDED
Binary file
localization/autoptimize-ru_RU.po ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Russian 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-08-28 18:49+0000\n"
12
+ "Last-Translator: Sergei Sedov <Unknown>\n"
13
+ "Language-Team: Russian <ru@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 "Настройки Autoptimize"
23
+
24
+ #: classes/autoptimizeConfig.php:71
25
+ msgid "HTML Options"
26
+ msgstr "Параметры HTML"
27
+
28
+ #: classes/autoptimizeConfig.php:74
29
+ msgid "Optimize HTML Code?"
30
+ msgstr "Оптимизировать код HTML?"
31
+
32
+ #: classes/autoptimizeConfig.php:78
33
+ msgid "Keep HTML comments?"
34
+ msgstr "Сохранять комментарии 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
+ "По умолчанию отключено. Включите, если вы хотите, чтобы HTML комментарии "
42
+ "остались на этой странице."
43
+
44
+ #: classes/autoptimizeConfig.php:84
45
+ msgid "JavaScript Options"
46
+ msgstr "Опции JavaScript"
47
+
48
+ #: classes/autoptimizeConfig.php:87
49
+ msgid "Optimize JavaScript Code?"
50
+ msgstr "Оптимизировать код JavaScript?"
51
+
52
+ #: classes/autoptimizeConfig.php:91
53
+ msgid "Look for scripts only in &lt;head&gt;?"
54
+ msgstr ""
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
+ "По умолчанию отключено. Если кэш становится большим, то вы можете включить "
61
+ "это."
62
+
63
+ #: classes/autoptimizeConfig.php:96
64
+ msgid "Add try-catch wrapping?"
65
+ msgstr ""
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
+ "По умолчанию отключено. Если ваш скрипт прерывается из за ошибки, то "
73
+ "попробуйте включить."
74
+
75
+ #: classes/autoptimizeConfig.php:101 classes/autoptimizeConfig.php:124
76
+ msgid "Use YUI compression?"
77
+ msgstr ""
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
+
84
+ #: classes/autoptimizeConfig.php:107
85
+ msgid "CSS Options"
86
+ msgstr "Опции CSS"
87
+
88
+ #: classes/autoptimizeConfig.php:110
89
+ msgid "Optimize CSS Code?"
90
+ msgstr "Оптимизировать код CSS?"
91
+
92
+ #: classes/autoptimizeConfig.php:114
93
+ msgid "Look for styles on just &lt;head&gt;?"
94
+ msgstr ""
95
+
96
+ #: classes/autoptimizeConfig.php:119
97
+ msgid "Generate data: URIs for images?"
98
+ msgstr ""
99
+
100
+ #: classes/autoptimizeConfig.php:121
101
+ msgid "Disabled by default. Enable this to include images on the CSS itself."
102
+ msgstr ""
103
+
104
+ #: classes/autoptimizeConfig.php:130
105
+ msgid "CDN Options"
106
+ msgstr ""
107
+
108
+ #: classes/autoptimizeConfig.php:133
109
+ msgid "Rewrite JavaScript URLs?"
110
+ msgstr ""
111
+
112
+ #: classes/autoptimizeConfig.php:135 classes/autoptimizeConfig.php:145
113
+ #: classes/autoptimizeConfig.php:155
114
+ msgid ""
115
+ "Disabled by default. Do not enable this unless you know what you are doing."
116
+ msgstr ""
117
+
118
+ #: classes/autoptimizeConfig.php:138
119
+ msgid "JavaScript Base URL"
120
+ msgstr ""
121
+
122
+ #: classes/autoptimizeConfig.php:140 classes/autoptimizeConfig.php:150
123
+ #: classes/autoptimizeConfig.php:160
124
+ msgid ""
125
+ "This is the new base URL that will be used when rewriting. It should point "
126
+ "to the blog root directory."
127
+ msgstr ""
128
+
129
+ #: classes/autoptimizeConfig.php:143
130
+ msgid "Rewrite CSS URLs?"
131
+ msgstr ""
132
+
133
+ #: classes/autoptimizeConfig.php:148
134
+ msgid "CSS Base URL"
135
+ msgstr ""
136
+
137
+ #: classes/autoptimizeConfig.php:153
138
+ msgid "Rewrite Image URLs?"
139
+ msgstr ""
140
+
141
+ #: classes/autoptimizeConfig.php:158
142
+ msgid "Image Base URL"
143
+ msgstr ""
144
+
145
+ #: classes/autoptimizeConfig.php:164
146
+ msgid "Cache Info"
147
+ msgstr "Информация о кэше"
148
+
149
+ #: classes/autoptimizeConfig.php:167
150
+ msgid "Cache folder"
151
+ msgstr "Каталог кэша"
152
+
153
+ #: classes/autoptimizeConfig.php:171
154
+ msgid "Can we write?"
155
+ msgstr "Начнём?"
156
+
157
+ #: classes/autoptimizeConfig.php:172
158
+ msgid "Yes"
159
+ msgstr "Да"
160
+
161
+ #: classes/autoptimizeConfig.php:172
162
+ msgid "No"
163
+ msgstr "Нет"
164
+
165
+ #: classes/autoptimizeConfig.php:175
166
+ msgid "Cached styles and scripts"
167
+ msgstr ""
168
+
169
+ #: classes/autoptimizeConfig.php:179
170
+ msgid "Do not compress cache files"
171
+ msgstr ""
172
+
173
+ #: classes/autoptimizeConfig.php:181
174
+ msgid ""
175
+ "Disabled by default. Enable this if you want to compress the served files "
176
+ "using your webserver."
177
+ msgstr ""
178
+
179
+ #: classes/autoptimizeConfig.php:188
180
+ msgid "Save Changes"
181
+ msgstr "Сохранить изменения"
182
+
183
+ #: classes/autoptimizeConfig.php:189
184
+ msgid "Save Changes and Empty Cache"
185
+ msgstr "Сохранить изменения и очистить кэш"
186
+
187
+ #: classes/autoptimizeConfig.php:199
188
+ msgid "Autoptimize Options"
189
+ msgstr "Опции Autoptimize"
190
+
191
+ #: classes/autoptimizeConfig.php:236 classes/autoptimizeConfig.php:243
192
+ msgid "Settings"
193
+ msgstr "Настройки"
194
+
195
+ #. Description of an extension
196
+ msgid ""
197
+ "Optimizes your website, concatenating the CSS and JavaScript code, and "
198
+ "compressing it."
199
+ msgstr ""
localization/autoptimize-zh_CN.mo CHANGED
Binary file
localization/autoptimize-zh_CN.po CHANGED
@@ -4,7 +4,7 @@ msgstr ""
4
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
5
  "POT-Creation-Date: 2009-07-21 03:53+0000\n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: Donald <donaldz@live.com>\n"
8
  "Language-Team: Donald <donaldz@live.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
4
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
5
  "POT-Creation-Date: 2009-07-21 03:53+0000\n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: Emilio López <turl@tuxfamily.org>\n"
8
  "Language-Team: Donald <donaldz@live.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
localization/autoptimize.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
11
- "POT-Creation-Date: 2009-07-24 22:40+0000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -20,90 +20,168 @@ msgstr ""
20
  msgid "Autoptimize Settings"
21
  msgstr ""
22
 
23
- #: classes/autoptimizeConfig.php:55
24
  msgid "HTML Options"
25
  msgstr ""
26
 
27
- #: classes/autoptimizeConfig.php:58
28
  msgid "Optimize HTML Code?"
29
  msgstr ""
30
 
31
- #: classes/autoptimizeConfig.php:63
 
 
 
 
 
 
 
 
 
 
32
  msgid "JavaScript Options"
33
  msgstr ""
34
 
35
- #: classes/autoptimizeConfig.php:66
36
  msgid "Optimize JavaScript Code?"
37
  msgstr ""
38
 
39
- #: classes/autoptimizeConfig.php:70
40
  msgid "Look for scripts only in &lt;head&gt;?"
41
  msgstr ""
42
 
43
- #: classes/autoptimizeConfig.php:72 classes/autoptimizeConfig.php:90
44
  msgid ""
45
  "Disabled by default. If the cache gets big, you might want to enable this."
46
  msgstr ""
47
 
48
- #: classes/autoptimizeConfig.php:75
49
  msgid "Add try-catch wrapping?"
50
  msgstr ""
51
 
52
- #: classes/autoptimizeConfig.php:77
53
  msgid ""
54
  "Disabled by default. If your scripts break because of an script error, you "
55
  "might want to try this."
56
  msgstr ""
57
 
58
- #: classes/autoptimizeConfig.php:81
 
 
 
 
 
 
 
 
 
59
  msgid "CSS Options"
60
  msgstr ""
61
 
62
- #: classes/autoptimizeConfig.php:84
63
  msgid "Optimize CSS Code?"
64
  msgstr ""
65
 
66
- #: classes/autoptimizeConfig.php:88
67
  msgid "Look for styles on just &lt;head&gt;?"
68
  msgstr ""
69
 
70
- #: classes/autoptimizeConfig.php:94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  msgid "Cache Info"
72
  msgstr ""
73
 
74
- #: classes/autoptimizeConfig.php:97
75
  msgid "Cache folder"
76
  msgstr ""
77
 
78
- #: classes/autoptimizeConfig.php:101
79
  msgid "Can we write?"
80
  msgstr ""
81
 
82
- #: classes/autoptimizeConfig.php:102
83
  msgid "Yes"
84
  msgstr ""
85
 
86
- #: classes/autoptimizeConfig.php:102
87
  msgid "No"
88
  msgstr ""
89
 
90
- #: classes/autoptimizeConfig.php:105
91
  msgid "Cached styles and scripts"
92
  msgstr ""
93
 
94
- #: classes/autoptimizeConfig.php:113
 
 
 
 
 
 
 
 
 
 
95
  msgid "Save Changes"
96
  msgstr ""
97
 
98
- #: classes/autoptimizeConfig.php:114
99
  msgid "Save Changes and Empty Cache"
100
  msgstr ""
101
 
102
- #: classes/autoptimizeConfig.php:124
103
  msgid "Autoptimize Options"
104
  msgstr ""
105
 
106
- #: classes/autoptimizeConfig.php:150 classes/autoptimizeConfig.php:157
107
  msgid "Settings"
108
  msgstr ""
109
 
@@ -112,4 +190,3 @@ msgid ""
112
  "Optimizes your website, concatenating the CSS and JavaScript code, and "
113
  "compressing it."
114
  msgstr ""
115
-
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
11
+ "POT-Creation-Date: 2009-10-19 21:41+0000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
20
  msgid "Autoptimize Settings"
21
  msgstr ""
22
 
23
+ #: classes/autoptimizeConfig.php:71
24
  msgid "HTML Options"
25
  msgstr ""
26
 
27
+ #: classes/autoptimizeConfig.php:74
28
  msgid "Optimize HTML Code?"
29
  msgstr ""
30
 
31
+ #: classes/autoptimizeConfig.php:78
32
+ msgid "Keep HTML comments?"
33
+ msgstr ""
34
+
35
+ #: classes/autoptimizeConfig.php:80
36
+ msgid ""
37
+ "Disabled by default. Enable this if you want HTML comments to remain in the "
38
+ "page."
39
+ msgstr ""
40
+
41
+ #: classes/autoptimizeConfig.php:84
42
  msgid "JavaScript Options"
43
  msgstr ""
44
 
45
+ #: classes/autoptimizeConfig.php:87
46
  msgid "Optimize JavaScript Code?"
47
  msgstr ""
48
 
49
+ #: classes/autoptimizeConfig.php:91
50
  msgid "Look for scripts only in &lt;head&gt;?"
51
  msgstr ""
52
 
53
+ #: classes/autoptimizeConfig.php:93 classes/autoptimizeConfig.php:116
54
  msgid ""
55
  "Disabled by default. If the cache gets big, you might want to enable this."
56
  msgstr ""
57
 
58
+ #: classes/autoptimizeConfig.php:96
59
  msgid "Add try-catch wrapping?"
60
  msgstr ""
61
 
62
+ #: classes/autoptimizeConfig.php:98
63
  msgid ""
64
  "Disabled by default. If your scripts break because of an script error, you "
65
  "might want to try this."
66
  msgstr ""
67
 
68
+ #: classes/autoptimizeConfig.php:101 classes/autoptimizeConfig.php:124
69
+ msgid "Use YUI compression?"
70
+ msgstr ""
71
+
72
+ #: classes/autoptimizeConfig.php:103 classes/autoptimizeConfig.php:126
73
+ msgid ""
74
+ "Disabled by default. Read [autoptimize]/yui/README.txt for more information."
75
+ msgstr ""
76
+
77
+ #: classes/autoptimizeConfig.php:107
78
  msgid "CSS Options"
79
  msgstr ""
80
 
81
+ #: classes/autoptimizeConfig.php:110
82
  msgid "Optimize CSS Code?"
83
  msgstr ""
84
 
85
+ #: classes/autoptimizeConfig.php:114
86
  msgid "Look for styles on just &lt;head&gt;?"
87
  msgstr ""
88
 
89
+ #: classes/autoptimizeConfig.php:119
90
+ msgid "Generate data: URIs for images?"
91
+ msgstr ""
92
+
93
+ #: classes/autoptimizeConfig.php:121
94
+ msgid "Disabled by default. Enable this to include images on the CSS itself."
95
+ msgstr ""
96
+
97
+ #: classes/autoptimizeConfig.php:130
98
+ msgid "CDN Options"
99
+ msgstr ""
100
+
101
+ #: classes/autoptimizeConfig.php:133
102
+ msgid "Rewrite JavaScript URLs?"
103
+ msgstr ""
104
+
105
+ #: classes/autoptimizeConfig.php:135 classes/autoptimizeConfig.php:145
106
+ #: classes/autoptimizeConfig.php:155
107
+ msgid ""
108
+ "Disabled by default. Do not enable this unless you know what you are doing."
109
+ msgstr ""
110
+
111
+ #: classes/autoptimizeConfig.php:138
112
+ msgid "JavaScript Base URL"
113
+ msgstr ""
114
+
115
+ #: classes/autoptimizeConfig.php:140 classes/autoptimizeConfig.php:150
116
+ #: classes/autoptimizeConfig.php:160
117
+ msgid ""
118
+ "This is the new base URL that will be used when rewriting. It should point "
119
+ "to the blog root directory."
120
+ msgstr ""
121
+
122
+ #: classes/autoptimizeConfig.php:143
123
+ msgid "Rewrite CSS URLs?"
124
+ msgstr ""
125
+
126
+ #: classes/autoptimizeConfig.php:148
127
+ msgid "CSS Base URL"
128
+ msgstr ""
129
+
130
+ #: classes/autoptimizeConfig.php:153
131
+ msgid "Rewrite Image URLs?"
132
+ msgstr ""
133
+
134
+ #: classes/autoptimizeConfig.php:158
135
+ msgid "Image Base URL"
136
+ msgstr ""
137
+
138
+ #: classes/autoptimizeConfig.php:164
139
  msgid "Cache Info"
140
  msgstr ""
141
 
142
+ #: classes/autoptimizeConfig.php:167
143
  msgid "Cache folder"
144
  msgstr ""
145
 
146
+ #: classes/autoptimizeConfig.php:171
147
  msgid "Can we write?"
148
  msgstr ""
149
 
150
+ #: classes/autoptimizeConfig.php:172
151
  msgid "Yes"
152
  msgstr ""
153
 
154
+ #: classes/autoptimizeConfig.php:172
155
  msgid "No"
156
  msgstr ""
157
 
158
+ #: classes/autoptimizeConfig.php:175
159
  msgid "Cached styles and scripts"
160
  msgstr ""
161
 
162
+ #: classes/autoptimizeConfig.php:179
163
+ msgid "Do not compress cache files"
164
+ msgstr ""
165
+
166
+ #: classes/autoptimizeConfig.php:181
167
+ msgid ""
168
+ "Disabled by default. Enable this if you want to compress the served files "
169
+ "using your webserver."
170
+ msgstr ""
171
+
172
+ #: classes/autoptimizeConfig.php:188
173
  msgid "Save Changes"
174
  msgstr ""
175
 
176
+ #: classes/autoptimizeConfig.php:189
177
  msgid "Save Changes and Empty Cache"
178
  msgstr ""
179
 
180
+ #: classes/autoptimizeConfig.php:199
181
  msgid "Autoptimize Options"
182
  msgstr ""
183
 
184
+ #: classes/autoptimizeConfig.php:236 classes/autoptimizeConfig.php:243
185
  msgid "Settings"
186
  msgstr ""
187
 
190
  "Optimizes your website, concatenating the CSS and JavaScript code, and "
191
  "compressing it."
192
  msgstr ""
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: turl
3
  Donate link: http://www.turleando.com.ar/autoptimize/
4
  Tags: css, html, javascript, js, optimize, speed, cache
5
  Requires at least: 2.7
6
- Tested up to: 2.8.2
7
- Stable tag: 0.9
8
 
9
  Autoptimize is a Wordpress plugin that speeds up your website, and helps you save bandwidth.
10
 
@@ -38,6 +38,28 @@ Sure, you can help with translations in the [Launchpad translation page](https:/
38
 
39
  == Changelog ==
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  = 0.9 =
42
  * Add workaround for networkedblogs.
43
  * Add workarounds for histats and statscounter
3
  Donate link: http://www.turleando.com.ar/autoptimize/
4
  Tags: css, html, javascript, js, optimize, speed, cache
5
  Requires at least: 2.7
6
+ Tested up to: 2.8.6
7
+ Stable tag: 1.1
8
 
9
  Autoptimize is a Wordpress plugin that speeds up your website, and helps you save bandwidth.
10
 
38
 
39
  == Changelog ==
40
 
41
+ = 1.1 =
42
+ * Add workarounds for amazon and fastclick
43
+ * Add workaround for Comment Form Quicktags
44
+ * Fix issue with Vipers Video Quicktags
45
+ * Fix a bug in where some scripts that shouldn't be moved were moved
46
+ * Fix a bug in where the config page wouldn't appear
47
+ * Fix @import handling
48
+ * Implement an option to disable js/css gzipping
49
+ * Implement CDN functionality
50
+ * Implement data: URI generation for images
51
+ * Support YUI CSS/JS Compressor
52
+ * Performance increases
53
+ * Handle WP Super Cache's cache files better
54
+ * Update translations
55
+
56
+ = 1.0 =
57
+ * Add workaround for whos.among.us
58
+ * Support preserving HTML Comments.
59
+ * Implement "delayed cache compression"
60
+ * French translation
61
+ * Update Spanish translation
62
+
63
  = 0.9 =
64
  * Add workaround for networkedblogs.
65
  * Add workarounds for histats and statscounter
yui/README.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ HOW TO USE YUI COMPRESSION
2
+ --------------------------
3
+
4
+ To use YUI Compression for JavaScript and CSS code, you need:
5
+ 1- java installed and working on the server
6
+ 2- YUI Compressor .jar file on the same directory as this file, with
7
+ "yuicompressor.jar" as name. You can get it here:
8
+ http://yuilibrary.com/downloads/#yuicompressor
9
+ 3- PHP's shell_exec function enabled.
10
+ 4- Writing permissions on this directory
11
+
12
+ When all the requerimients are fullfilled, you will be able to enable
13
+ YUI compression on Autoptimize's config page.