Autoptimize - Version 1.6.6

Version Description

  • New: disable autoptimizatoin by putting part of your HTML, JS or CSS in between noptimize-tags, e.g.; <!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->
  • Added extra check to prevent plugin-files being called outside of WordPress as suggested in this good article on security.
  • Added small notice to be displayed after installation/ activation to ask user to configure the plugin as well.
  • Added Persian translation, thanks to Hamed T.
Download this release

Release Info

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

Code changes from version 1.6.5 to 1.6.6

autoptimize.php CHANGED
@@ -1,15 +1,16 @@
1
  <?php
2
  /*
3
  Plugin Name: Autoptimize
4
- Plugin URI: http://blog.futtta.be/category/autoptimize/
5
  Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
6
- Version: 1.6.5
7
  Author: Frank Goossens (futtta)
8
  Author URI: http://blog.futtta.be/
9
  Released under the GNU General Public License (GPL)
10
  http://www.gnu.org/licenses/gpl.txt
11
  */
12
 
 
13
  // Load config and cache class
14
  include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeConfig.php');
15
  include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeCache.php');
@@ -27,10 +28,13 @@ $conf = autoptimizeConfig::instance();
27
  /* Check if we're updating, in which case we need to flush the cache
28
  to avoid old versions of aggregated files lingering around */
29
 
30
- $autoptimize_version="1.6.5";
31
  $autoptimize_db_version=get_option('autoptimize_version','none');
32
 
33
  if ($autoptimize_db_version !== $autoptimize_version) {
 
 
 
34
  autoptimizeCache::clearall();
35
  update_option('autoptimize_version',$autoptimize_version);
36
  $autoptimize_db_version=$autoptimize_version;
@@ -43,6 +47,11 @@ define('AUTOPTIMIZE_CACHE_NOGZIP',(bool) $conf->get('autoptimize_cache_nogzip'))
43
  $plugin_dir = basename(dirname(__FILE__));
44
  load_plugin_textdomain('autoptimize','wp-content/plugins/'.$plugin_dir.'/localization',$plugin_dir.'/localization');
45
 
 
 
 
 
 
46
  // Set up the buffering
47
  function autoptimize_start_buffering()
48
  {
@@ -88,7 +97,6 @@ function autoptimize_start_buffering()
88
 
89
  // Now, start the real thing!
90
  ob_start('autoptimize_end_buffering');
91
-
92
  }
93
  }
94
 
1
  <?php
2
  /*
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: 1.6.6
7
  Author: Frank Goossens (futtta)
8
  Author URI: http://blog.futtta.be/
9
  Released under the GNU General Public License (GPL)
10
  http://www.gnu.org/licenses/gpl.txt
11
  */
12
 
13
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
  // Load config and cache class
15
  include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeConfig.php');
16
  include(WP_PLUGIN_DIR.'/autoptimize/classes/autoptimizeCache.php');
28
  /* Check if we're updating, in which case we need to flush the cache
29
  to avoid old versions of aggregated files lingering around */
30
 
31
+ $autoptimize_version="1.6.6";
32
  $autoptimize_db_version=get_option('autoptimize_version','none');
33
 
34
  if ($autoptimize_db_version !== $autoptimize_version) {
35
+ if ($autoptimize_db_version==="none") {
36
+ add_action('admin_notices', 'config_autoptimize_notice');
37
+ }
38
  autoptimizeCache::clearall();
39
  update_option('autoptimize_version',$autoptimize_version);
40
  $autoptimize_db_version=$autoptimize_version;
47
  $plugin_dir = basename(dirname(__FILE__));
48
  load_plugin_textdomain('autoptimize','wp-content/plugins/'.$plugin_dir.'/localization',$plugin_dir.'/localization');
49
 
50
+ function config_autoptimize_notice() {
51
+ echo '<div class="updated"><p>';
52
+ _e('Thank you for installing and activating Autoptimize. Please configure it under "Settings" -> "Autoptimize" to start improving your site\'s performance.', 'autoptimize' );
53
+ echo '</p></div>';
54
+ }
55
  // Set up the buffering
56
  function autoptimize_start_buffering()
57
  {
97
 
98
  // Now, start the real thing!
99
  ob_start('autoptimize_end_buffering');
 
100
  }
101
  }
102
 
classes/autoptimizeBase.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
-
3
  abstract class autoptimizeBase
4
  {
5
  protected $content = '';
@@ -38,11 +38,43 @@ abstract class autoptimizeBase
38
  $path = str_replace('//','/',WP_ROOT_DIR.$path);
39
  return $path;
40
  }
41
-
42
- // coz I'm a crappy developer and I need easy access to whatever I want to log
43
  protected function ao_logger($logmsg) {
44
  $logfile=WP_CONTENT_DIR.'/ao_log.txt';
45
  $logmsg.="\n";
46
  file_put_contents($logfile,$logmsg,FILE_APPEND);
47
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
  abstract class autoptimizeBase
4
  {
5
  protected $content = '';
38
  $path = str_replace('//','/',WP_ROOT_DIR.$path);
39
  return $path;
40
  }
41
+ // logger
 
42
  protected function ao_logger($logmsg) {
43
  $logfile=WP_CONTENT_DIR.'/ao_log.txt';
44
  $logmsg.="\n";
45
  file_put_contents($logfile,$logmsg,FILE_APPEND);
46
  }
47
+ // hide everything between noptimize-comment tags
48
+ protected function hide_noptimize($noptimize_in) {
49
+ if ( preg_match( '/<!--\s?noptimize\s?-->/', $noptimize_in ) ) {
50
+ $noptimize_out = preg_replace_callback(
51
+ '#<!--\s?noptimize\s?-->.*?<!--\s?/\s?noptimize\s?-->#is',
52
+ create_function(
53
+ '$matches',
54
+ 'return "%%NOPTIMIZE%%".base64_encode($matches[0])."%%NOPTIMIZE%%";'
55
+ ),
56
+ $noptimize_in
57
+ );
58
+ } else {
59
+ $noptimize_out = $noptimize_in;
60
+ }
61
+ return $noptimize_out;
62
+ }
63
+
64
+ // unhide noptimize-tags
65
+ protected function restore_noptimize($noptimize_in) {
66
+ if ( preg_match( '/%%NOPTIMIZE%%/', $noptimize_in ) ) {
67
+ $noptimize_out = preg_replace_callback(
68
+ '#%%NOPTIMIZE%%(.*?)%%NOPTIMIZE%%#is',
69
+ create_function(
70
+ '$matches',
71
+ 'return stripslashes(base64_decode($matches[1]));'
72
+ ),
73
+ $noptimize_in
74
+ );
75
+ } else {
76
+ $noptimize_out = $noptimize_in;
77
+ }
78
+ return $noptimize_out;
79
+ }
80
  }
classes/autoptimizeCache.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
 
3
  class autoptimizeCache
4
  {
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeCache
5
  {
classes/autoptimizeConfig.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
 
3
  class autoptimizeConfig
4
  {
@@ -278,7 +279,6 @@ class autoptimizeConfig
278
  public function setmeta($links,$file=null)
279
  {
280
  //Inspired on http://wpengineer.com/meta-links-for-wordpress-plugins/
281
-
282
  //Do it only once - saves time
283
  static $plugin;
284
  if(empty($plugin))
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeConfig
5
  {
279
  public function setmeta($links,$file=null)
280
  {
281
  //Inspired on http://wpengineer.com/meta-links-for-wordpress-plugins/
 
282
  //Do it only once - saves time
283
  static $plugin;
284
  if(empty($plugin))
classes/autoptimizeHTML.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  class autoptimizeHTML extends autoptimizeBase
4
  {
5
  private $keepcomments = false;
@@ -19,23 +21,15 @@ class autoptimizeHTML extends autoptimizeBase
19
  {
20
  if(class_exists('Minify_HTML'))
21
  {
 
 
 
22
  // Minify html
23
- // but don't remove comment-blocks needed by WP Super Cache (& W3 Total Cache)
24
- if ( ($this->keepcomments===false) && (preg_match( '/<!--mclude|<!--mfunc|<!--dynamic-cached-content-->/', $this->content ))) {
25
- $this->content = preg_replace('#(<!--mclude .*<!--/mclude-->)#ise','\'%%MFUNC%%\'.base64_encode("$0").\'%%MFUNC%%\'', $this->content);
26
- $this->content = preg_replace('#(<!--mfunc.*<!--/mfunc-->)#ise','\'%%MFUNC%%\'.base64_encode("$1").\'%%MFUNC%%\'', $this->content);
27
- $this->content = preg_replace('#(<!--dynamic-cached-content-->.*<!--/dynamic-cached-content-->)#ise','\'%%MFUNC%%\'.base64_encode("$0").\'%%MFUNC%%\'', $this->content);
28
- $restore_mfuncs=true;
29
- }
30
-
31
  $options = array('keepComments' => $this->keepcomments);
32
  $this->content = Minify_HTML::minify($this->content,$options);
33
-
34
 
35
- if (isset($restore_mfuncs)) {
36
- $this->content = preg_replace('#%%MFUNC%%(.*)%%MFUNC%%#sie','stripslashes(base64_decode("$1"))',$this->content);
37
- }
38
-
39
  return true;
40
  }
41
 
@@ -55,4 +49,4 @@ class autoptimizeHTML extends autoptimizeBase
55
  {
56
  return $this->content;
57
  }
58
- }
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
  class autoptimizeHTML extends autoptimizeBase
6
  {
7
  private $keepcomments = false;
21
  {
22
  if(class_exists('Minify_HTML'))
23
  {
24
+ // noptimize me
25
+ $this->content = $this->hide_noptimize($this->content);
26
+
27
  // Minify html
 
 
 
 
 
 
 
 
28
  $options = array('keepComments' => $this->keepcomments);
29
  $this->content = Minify_HTML::minify($this->content,$options);
 
30
 
31
+ // restore noptimize
32
+ $this->content = $this->restore_noptimize($this->content);
 
 
33
  return true;
34
  }
35
 
49
  {
50
  return $this->content;
51
  }
52
+ }
classes/autoptimizeScripts.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
 
3
  class autoptimizeScripts extends autoptimizeBase
4
  {
@@ -39,10 +40,11 @@ class autoptimizeScripts extends autoptimizeBase
39
  // force js in head?
40
  if($options['forcehead'] == true)
41
  $this->forcehead = true;
42
-
43
  //Do we use yui?
44
  $this->yui = $options['yui'];
45
 
 
 
46
  //Save IE hacks
47
  $this->content = preg_replace('#(<\!--\[if.*\]>.*<\!\[endif\]-->)#Usie','\'%%IEHACK%%\'.base64_encode("$1").\'%%IEHACK%%\'',$this->content);
48
 
@@ -215,10 +217,11 @@ class autoptimizeScripts extends autoptimizeBase
215
  $bodyreplacement .= '<script type="text/javascript" src="'.$this->url.'"></script>';
216
  $bodyreplacement .= implode('',$this->move['last']).$replaceTag;
217
  $this->content = str_replace($replaceTag,$bodyreplacement,$this->content);
218
-
219
  //Restore IE hacks
220
  $this->content = preg_replace('#%%IEHACK%%(.*)%%IEHACK%%#Usie','stripslashes(base64_decode("$1"))',$this->content);
221
 
 
 
222
  //Return the modified HTML
223
  return $this->content;
224
  }
@@ -288,4 +291,4 @@ class autoptimizeScripts extends autoptimizeBase
288
  //Should be in 'first'
289
  return false;
290
  }
291
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class autoptimizeScripts extends autoptimizeBase
5
  {
40
  // force js in head?
41
  if($options['forcehead'] == true)
42
  $this->forcehead = true;
 
43
  //Do we use yui?
44
  $this->yui = $options['yui'];
45
 
46
+ // noptimize me
47
+ $this->content = $this->hide_noptimize($this->content);
48
  //Save IE hacks
49
  $this->content = preg_replace('#(<\!--\[if.*\]>.*<\!\[endif\]-->)#Usie','\'%%IEHACK%%\'.base64_encode("$1").\'%%IEHACK%%\'',$this->content);
50
 
217
  $bodyreplacement .= '<script type="text/javascript" src="'.$this->url.'"></script>';
218
  $bodyreplacement .= implode('',$this->move['last']).$replaceTag;
219
  $this->content = str_replace($replaceTag,$bodyreplacement,$this->content);
 
220
  //Restore IE hacks
221
  $this->content = preg_replace('#%%IEHACK%%(.*)%%IEHACK%%#Usie','stripslashes(base64_decode("$1"))',$this->content);
222
 
223
+ // restore noptimize
224
+ $this->content = $this->restore_noptimize($this->content);
225
  //Return the modified HTML
226
  return $this->content;
227
  }
291
  //Should be in 'first'
292
  return false;
293
  }
294
+ }
classes/autoptimizeStyles.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class autoptimizeStyles extends autoptimizeBase
3
  {
4
  private $css = array();
@@ -26,7 +27,8 @@ class autoptimizeStyles extends autoptimizeBase
26
 
27
  //Do we use yui?
28
  $this->yui = $options['yui'];
29
-
 
30
  //Save IE hacks
31
  $this->content = preg_replace('#(<\!--\[if.*\]>.*<\!\[endif\]-->)#Usie','\'%%IEHACK%%\'.base64_encode("$1").\'%%IEHACK%%\'',$this->content);
32
 
@@ -302,7 +304,8 @@ class autoptimizeStyles extends autoptimizeBase
302
  //Restore IE hacks
303
  // fgo: added stripslashes as e modifier escapes stuff
304
  $this->content = preg_replace('#%%IEHACK%%(.*)%%IEHACK%%#Usie','stripslashes(base64_decode("$1"))',$this->content);
305
-
 
306
  //Restore the full content
307
  if(!empty($this->restofcontent))
308
  {
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
  class autoptimizeStyles extends autoptimizeBase
4
  {
5
  private $css = array();
27
 
28
  //Do we use yui?
29
  $this->yui = $options['yui'];
30
+ // noptimize me
31
+ $this->content = $this->hide_noptimize($this->content);
32
  //Save IE hacks
33
  $this->content = preg_replace('#(<\!--\[if.*\]>.*<\!\[endif\]-->)#Usie','\'%%IEHACK%%\'.base64_encode("$1").\'%%IEHACK%%\'',$this->content);
34
 
304
  //Restore IE hacks
305
  // fgo: added stripslashes as e modifier escapes stuff
306
  $this->content = preg_replace('#%%IEHACK%%(.*)%%IEHACK%%#Usie','stripslashes(base64_decode("$1"))',$this->content);
307
+ // restore noptimize
308
+ $this->content = $this->restore_noptimize($this->content);
309
  //Restore the full content
310
  if(!empty($this->restofcontent))
311
  {
localization/autoptimize-fa_IR.mo ADDED
Binary file
localization/autoptimize-fa_IR.po ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR Emilio Lpez
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: Autoptimize\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/autoptimize\n"
10
+ "POT-Creation-Date: 2009-10-19 21:41+0000\n"
11
+ "PO-Revision-Date: 2013-09-15 10:38+0330\n"
12
+ "Last-Translator: Hamed.T <lh4medl@gmail.com>\n"
13
+ "Language-Team: http://basics.ir <ham3d.t@gmail.com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Generator: Poedit 1.5.7\n"
18
+ "Language: Persian\n"
19
+ "X-Poedit-SourceCharset: UTF-8\n"
20
+
21
+ #: classes/autoptimizeConfig.php:50
22
+ msgid "Autoptimize Settings"
23
+ msgstr "تنظیمات Autoptimize"
24
+
25
+ #: classes/autoptimizeConfig.php:71
26
+ msgid "HTML Options"
27
+ msgstr "تنضیمات HTML"
28
+
29
+ #: classes/autoptimizeConfig.php:74
30
+ msgid "Optimize HTML Code?"
31
+ msgstr "کد HTML بهینه سازی شوند؟"
32
+
33
+ #: classes/autoptimizeConfig.php:78
34
+ msgid "Keep HTML comments?"
35
+ msgstr "کامنت های HTML را نگه داریم؟"
36
+
37
+ #: classes/autoptimizeConfig.php:80
38
+ msgid ""
39
+ "Disabled by default. Enable this if you want HTML comments to remain in the "
40
+ "page."
41
+ msgstr ""
42
+ "به صورت پیش فرض غیرفعال است. اگر می خواهید کامنت های HTML در صفحه باقی بماند "
43
+ "این گزینه را فعال کنید."
44
+
45
+ #: classes/autoptimizeConfig.php:84
46
+ msgid "JavaScript Options"
47
+ msgstr "تنظیمات javascript"
48
+
49
+ #: classes/autoptimizeConfig.php:87
50
+ msgid "Optimize JavaScript Code?"
51
+ msgstr "کدهای javascript بهینه سازی شوند؟"
52
+
53
+ #: classes/autoptimizeConfig.php:91
54
+ msgid "Look for scripts only in &lt;head&gt;?"
55
+ msgstr "فقط اسکریپت های موجود در &lt;head&gt; را بهینه سازی کنیم؟"
56
+
57
+ #: classes/autoptimizeConfig.php:93 classes/autoptimizeConfig.php:116
58
+ msgid ""
59
+ "Disabled by default. If the cache gets big, you might want to enable this."
60
+ msgstr ""
61
+ "به صورت پیش فرض غیرفعال است. اگر حجم کش اسکریپت ها زیاد شد، شاید مایل باشید "
62
+ "از این گزینه استفاده کنید."
63
+
64
+ #: classes/autoptimizeConfig.php:96
65
+ msgid "Add try-catch wrapping?"
66
+ msgstr "سعی در درک کردن بسته بندی؟"
67
+
68
+ #: classes/autoptimizeConfig.php:98
69
+ msgid ""
70
+ "Disabled by default. If your scripts break because of an script error, you "
71
+ "might want to try this."
72
+ msgstr ""
73
+ "به صورت پیش فرض غیر فعال است. اگر اسکریپت های شما به دلیل خطای یک اسکریپت "
74
+ "درست نمایش داده نشوند، شاید مایل باشید از این گزینه استفاده کنید."
75
+
76
+ #: classes/autoptimizeConfig.php:101 classes/autoptimizeConfig.php:124
77
+ msgid "Use YUI compression?"
78
+ msgstr "از فشرده سازی YUI استفاده شود؟"
79
+
80
+ #: classes/autoptimizeConfig.php:103 classes/autoptimizeConfig.php:126
81
+ msgid ""
82
+ "Disabled by default. Read [autoptimize]/yui/README.txt for more information."
83
+ msgstr ""
84
+ "به صورت پیش فرض غیر فعال است. اطلاعات بیشتر [autoptimize]/yui/README.txt"
85
+
86
+ #: classes/autoptimizeConfig.php:107
87
+ msgid "CSS Options"
88
+ msgstr "تنظیمات CSS"
89
+
90
+ #: classes/autoptimizeConfig.php:110
91
+ msgid "Optimize CSS Code?"
92
+ msgstr "کدهای CSS بهینه سازی شوند؟"
93
+
94
+ #: classes/autoptimizeConfig.php:114
95
+ msgid "Look for styles on just &lt;head&gt;?"
96
+ msgstr "فقط استایل های موجود در تگ &lt;head&gt; بهینه سازی شوند؟"
97
+
98
+ #: classes/autoptimizeConfig.php:119
99
+ msgid "Generate data: URIs for images?"
100
+ msgstr "تولید data URIs برای تصاویر؟"
101
+
102
+ #: classes/autoptimizeConfig.php:121
103
+ msgid "Disabled by default. Enable this to include images on the CSS itself."
104
+ msgstr ""
105
+ "به صورت پیش فرض غیرفعال است. برای پیوست تصاویر به CSS از این گزینه استفاده "
106
+ "کنید."
107
+
108
+ #: classes/autoptimizeConfig.php:130
109
+ msgid "CDN Options"
110
+ msgstr "تنظیمات CDN"
111
+
112
+ #: classes/autoptimizeConfig.php:133
113
+ msgid "Rewrite JavaScript URLs?"
114
+ msgstr "بازنویسی آدرس 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
+ "به صورت پیش فرض غیر فعال است. این گزینه را فعال نکنید مگر اینکه از کار خود "
122
+ "آگاهی داشته باشید."
123
+
124
+ #: classes/autoptimizeConfig.php:138
125
+ msgid "JavaScript Base URL"
126
+ msgstr "آدرس پایه javascipt"
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
+ "این آدرس پایه جدید است که زمان بازنویسی استفاده خواهد شد. این باید در ریشه "
135
+ "دایرکتوری بلاگ قرار بگیرد."
136
+
137
+ #: classes/autoptimizeConfig.php:143
138
+ msgid "Rewrite CSS URLs?"
139
+ msgstr "بازنویسی آدرس CSS?"
140
+
141
+ #: classes/autoptimizeConfig.php:148
142
+ msgid "CSS Base URL"
143
+ msgstr "آدرس پایه CSS"
144
+
145
+ #: classes/autoptimizeConfig.php:153
146
+ msgid "Rewrite Image URLs?"
147
+ msgstr "بازنویسی آدرس تصاویر؟"
148
+
149
+ #: classes/autoptimizeConfig.php:158
150
+ msgid "Image Base URL"
151
+ msgstr "آدرس پایه تصاویر"
152
+
153
+ #: classes/autoptimizeConfig.php:164
154
+ msgid "Cache Info"
155
+ msgstr "اطلاعات کش"
156
+
157
+ #: classes/autoptimizeConfig.php:167
158
+ msgid "Cache folder"
159
+ msgstr "فولدر کش"
160
+
161
+ #: classes/autoptimizeConfig.php:171
162
+ msgid "Can we write?"
163
+ msgstr "قادر به نوشتن (write) هستیم؟"
164
+
165
+ #: classes/autoptimizeConfig.php:172
166
+ msgid "Yes"
167
+ msgstr "بله"
168
+
169
+ #: classes/autoptimizeConfig.php:172
170
+ msgid "No"
171
+ msgstr "خیر"
172
+
173
+ #: classes/autoptimizeConfig.php:175
174
+ msgid "Cached styles and scripts"
175
+ msgstr "برای استایل ها و اسکریپت ها از کش استفاده شود"
176
+
177
+ #: classes/autoptimizeConfig.php:179
178
+ msgid "Do not compress cache files"
179
+ msgstr "فایل های کش را فشرده سازی نکن"
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
+ "به صورت پیش فرض غیر فعال است. اگر مایل هستید فایل های ارائه شده توسط وب سرور "
187
+ "شما فشرده سازی شوند از این گزینه استفاده کنید."
188
+
189
+ #: classes/autoptimizeConfig.php:188
190
+ msgid "Save Changes"
191
+ msgstr "ذخیره تنظیمات"
192
+
193
+ #: classes/autoptimizeConfig.php:189
194
+ msgid "Save Changes and Empty Cache"
195
+ msgstr "ذخیره تنظیمات و تخلیه کش"
196
+
197
+ #: classes/autoptimizeConfig.php:199
198
+ msgid "Autoptimize Options"
199
+ msgstr "تنظیمات Autoptimize"
200
+
201
+ #: classes/autoptimizeConfig.php:236 classes/autoptimizeConfig.php:243
202
+ msgid "Settings"
203
+ msgstr "تنظیمات"
204
+
205
+ #. Description of an extension
206
+ msgid ""
207
+ "Optimizes your website, concatenating the CSS and JavaScript code, and "
208
+ "compressing it."
209
+ msgstr "بهینه سازی وبسایت، الحاق کدهای Javascript و CSS و فشرده سازی."
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: futtta, turl
3
  Tags: css, html, javascript, js, optimize, speed, cache, data-uri, aggregate, minimize, performance, pagespeed, booster, multisite
4
  Requires at least: 2.7
5
- Tested up to: 3.6
6
- Stable tag: 1.6.5
7
 
8
  Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS and CSS.
9
 
@@ -26,7 +26,7 @@ If you consider performance important, we recommend the use of a caching-plugin
26
 
27
  It concatenates all scripts and styles, minifies and compresses them, adds expires headers, caches them, and moves styles to the page head, and scripts to the footer. It also minifies the HTML code itself, making your page really lightweight.
28
 
29
- = Will this work with for my blog? =
30
 
31
  Yes, most of the time, but there will always be exceptions. Although Autoptimize goes through great lengths to work with as many themes and plugins possible, there undoubtably are circumstances in which Autoptimize will not work to the full extent (full HTML, JS and CSS optimization). See "Troubleshooting" below for info on how to proceed if you encounter issues.
32
 
@@ -46,11 +46,17 @@ YUI compression and the CDN options are marked as deprecated to indicate that th
46
  After having installed and activated the plugin, you'll have access to an admin page where you can to enable HTML, CSS and JavaScript optimization. According to your liking, you can start of just enabling all of them, or if you're more cautious one at a time.
47
 
48
  If your blog doens't function normally after having turned on Autoptimize, here are some pointers to identify & solve such issues:
49
- * 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.
50
- * In case some functionality on your site stops working (a carroussel, a menu, the search input, ...) you're likely hitting JavaScript optimization trouble. Enable the option "Look for scripts only in head?" and/or "Force JavaScript in <head>?" and try again. 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. 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.
51
  * If you can't get either CSS or JS optimization working, you can off course always continue using the other two optimization-techniques.
52
  * 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"
53
 
 
 
 
 
 
 
54
  = Where can I report an error? =
55
 
56
  You can report problems on the [wordpress.org support forum](http://wordpress.org/support/plugin/autoptimize), or [contact the maintainer using this contact form](http://blog.futtta.be/contact/).
@@ -65,6 +71,13 @@ You can report problems on the [wordpress.org support forum](http://wordpress.or
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
 
 
68
  = 1.6.5 =
69
  * new javascript-debug option to force the aggregated javascript file in the head-section of the HTML instead of at the bottom
70
  * YUI compression & CDN are now deprecated functionality that will be removed in 1.7.0
2
  Contributors: futtta, turl
3
  Tags: css, html, javascript, js, optimize, speed, cache, data-uri, aggregate, minimize, performance, pagespeed, booster, multisite
4
  Requires at least: 2.7
5
+ Tested up to: 3.6.1
6
+ Stable tag: 1.6.6
7
 
8
  Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS and CSS.
9
 
26
 
27
  It concatenates all scripts and styles, minifies and compresses them, adds expires headers, caches them, and moves styles to the page head, and scripts to the footer. It also minifies the HTML code itself, making your page really lightweight.
28
 
29
+ = Will this work with my blog? =
30
 
31
  Yes, most of the time, but there will always be exceptions. Although Autoptimize goes through great lengths to work with as many themes and plugins possible, there undoubtably are circumstances in which Autoptimize will not work to the full extent (full HTML, JS and CSS optimization). See "Troubleshooting" below for info on how to proceed if you encounter issues.
32
 
46
  After having installed and activated the plugin, you'll have access to an admin page where you can to enable HTML, CSS and JavaScript optimization. According to your liking, you can start of just enabling all of them, or if you're more cautious one at a time.
47
 
48
  If your blog doens't function normally after having turned on Autoptimize, here are some pointers to identify & solve such issues:
49
+ * 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.
50
+ * In case some functionality on your site stops working (a carroussel, a menu, the search input, ...) you're likely hitting JavaScript optimization trouble. Enable the option "Look for scripts only in head?" and/or "Force JavaScript in <head>?" and try again. 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.
51
  * If you can't get either CSS or JS optimization working, you can off course always continue using the other two optimization-techniques.
52
  * 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"
53
 
54
+ = How can I exclude some CSS/JS/HTML from being autoptimized? =
55
+ Starting with version 1.6.6 Autoptimize excludes everything inside noptimize tags, e.g.:
56
+ `<!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->`
57
+
58
+ You can do this in your page/ post content, in widgets and in your theme files (consider creating [a child theme](http://codex.wordpress.org/Child_Themes) to avoid your work being overwritten by theme updates).
59
+
60
  = Where can I report an error? =
61
 
62
  You can report problems on the [wordpress.org support forum](http://wordpress.org/support/plugin/autoptimize), or [contact the maintainer using this contact form](http://blog.futtta.be/contact/).
71
 
72
  == Changelog ==
73
 
74
+ = 1.6.6 =
75
+ * New: disable autoptimizatoin by putting part of your HTML, JS or CSS in between noptimize-tags, e.g.;
76
+ `<!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->`
77
+ * Added extra check to prevent plugin-files being called outside of WordPress as suggested in [this good article on security](http://mikejolley.com/2013/08/keeping-your-shit-secure-whilst-developing-for-wordpress/).
78
+ * Added small notice to be displayed after installation/ activation to ask user to configure the plugin as well.
79
+ * Added Persian translation, thanks to [Hamed T.](http://basics.ir/)
80
+
81
  = 1.6.5 =
82
  * new javascript-debug option to force the aggregated javascript file in the head-section of the HTML instead of at the bottom
83
  * YUI compression & CDN are now deprecated functionality that will be removed in 1.7.0