WP-LESS - Version 1.4.1

Version Description

= 1.4 =

As lessphp has been upgraded to 0.3.0, its behavior changed a little bit.

Please check your LESS syntax according to the document before applying this update.

Download this release

Release Info

Developer oncletom
Plugin Icon wp plugin WP-LESS
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.4 to 1.4.1

Files changed (3) hide show
  1. bootstrap.php +1 -1
  2. lib/Plugin.class.php +12 -3
  3. readme.txt +5 -1
bootstrap.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP LESS
4
  Description: LESS extends CSS with variables, mixins, operations and nested rules. This plugin magically parse all your <code>*.less</code> files queued with <code>wp_enqueue_style</code> in WordPress.
5
  Author: Oncle Tom
6
- Version: 1.4
7
  Author URI: http://case.oncle-tom.net/
8
  Plugin URI: http://wordpress.org/extend/plugins/wp-less/
9
 
3
  Plugin Name: WP LESS
4
  Description: LESS extends CSS with variables, mixins, operations and nested rules. This plugin magically parse all your <code>*.less</code> files queued with <code>wp_enqueue_style</code> in WordPress.
5
  Author: Oncle Tom
6
+ Version: 1.4.1
7
  Author URI: http://case.oncle-tom.net/
8
  Plugin URI: http://wordpress.org/extend/plugins/wp-less/
9
 
lib/Plugin.class.php CHANGED
@@ -51,7 +51,7 @@ class WPLessPlugin extends WPPluginToolkitPlugin
51
  *
52
  * @author oncletom
53
  * @since 1.2
54
- * @version 1.0
55
  * @param string $css parsed CSS
56
  * @param WPLessStylesheet Stylesheet currently processed
57
  * @return string parsed and fixed CSS
@@ -59,8 +59,17 @@ class WPLessPlugin extends WPPluginToolkitPlugin
59
  public function filterStylesheetUri($css, WPLessStylesheet $stylesheet)
60
  {
61
  $token = '@'.uniqid('wpless', true).'@';
62
- $css = preg_replace('#(url\s*\([\'"])([^/]+)#siU', '\1'.$token.'\2', $css);
63
- $css = str_replace($token, dirname($stylesheet->getSourceUri()).'/', $css);
 
 
 
 
 
 
 
 
 
64
 
65
  return $css;
66
  }
51
  *
52
  * @author oncletom
53
  * @since 1.2
54
+ * @version 1.1
55
  * @param string $css parsed CSS
56
  * @param WPLessStylesheet Stylesheet currently processed
57
  * @return string parsed and fixed CSS
59
  public function filterStylesheetUri($css, WPLessStylesheet $stylesheet)
60
  {
61
  $token = '@'.uniqid('wpless', true).'@';
62
+ $css = preg_replace('#url\s*\(([\'"]{0,1})([^\'"\)]+)\1\)#siU', 'url(\1'.$token.'\2\1)', $css);
63
+
64
+ /*
65
+ * Token replacement:
66
+ * - preserve data URI
67
+ * - prefix file URI with absolute path to the theme
68
+ */
69
+ $css = str_replace(
70
+ array($token.'data:', $token),
71
+ array('data:', dirname($stylesheet->getSourceUri()).'/'),
72
+ $css);
73
 
74
  return $css;
75
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: dev, theme, themes, toolkit, plugin-toolkit, less, lesscss, lessc, lessphp, productivity, style, stylesheet, api
5
  Requires at least: 2.8
6
  Tested up to: 3.3
7
- Stable tag: 1.4
8
 
9
  Implementation of LESS (Leaner CSS) in order to make themes development easier.
10
 
@@ -48,6 +48,10 @@ The sole requirement is to use WordPress API and LESS convention: the `.less` ex
48
 
49
  == Changelog ==
50
 
 
 
 
 
51
  = Version 1.4 =
52
 
53
  * action: `wp-less_compiler_parse_pre` now takes 3 arguments: class instance, text and variable arguments
4
  Tags: dev, theme, themes, toolkit, plugin-toolkit, less, lesscss, lessc, lessphp, productivity, style, stylesheet, api
5
  Requires at least: 2.8
6
  Tested up to: 3.3
7
+ Stable tag: 1.4.1
8
 
9
  Implementation of LESS (Leaner CSS) in order to make themes development easier.
10
 
48
 
49
  == Changelog ==
50
 
51
+ = Version 1.4.1 =
52
+
53
+ * bug: CSS `url()` are now properly resolved relative to the theme URL
54
+
55
  = Version 1.4 =
56
 
57
  * action: `wp-less_compiler_parse_pre` now takes 3 arguments: class instance, text and variable arguments