Plugin Directory

Changeset 1018266


Ignore:
Timestamp:
11/02/2014 09:31:27 AM (11 years ago)
Author:
ale.carbo
Message:

Updated trunk to 1.2.3

Location:
assetsminify/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • assetsminify/trunk/AssetsMinifyInit.php

    r833449 r1018266  
    129129
    130130        $file_path = false;
     131        $wp_plugin_url = plugins_url();
     132        $wp_content_url = content_url();
    131133
    132134        // Script is enqueued from a plugin
    133         if( strpos($file_url, WP_PLUGIN_URL) !== false )
    134             $file_path = WP_PLUGIN_DIR . str_replace(WP_PLUGIN_URL, '', $file_url);
     135
     136        $url_regex = $this->getUrlRegex($wp_plugin_url);
     137        if( preg_match($url_regex, $file_url) > 0 )
     138            $file_path = WP_PLUGIN_DIR . preg_replace($url_regex, '', $file_url);
    135139
    136140        // Script is enqueued from a theme
    137         if( strpos($file_url, WP_CONTENT_URL) !== false )
    138             $file_path = WP_CONTENT_DIR . str_replace(WP_CONTENT_URL, '', $file_url);
     141        $url_regex = $this->getUrlRegex($wp_content_url);
     142        if( preg_match($url_regex, $file_url) > 0 )
     143            $file_path = WP_CONTENT_DIR . preg_replace($url_regex, '', $file_url);
    139144
    140145        // Script is enqueued from wordpress
     
    144149        return $file_path;
    145150    }
     151   
     152    /**
     153     * Returns Regular Expression string to match an URL.
     154     *
     155     * @param string $url The URL to be matched.
     156     * @return string The regular expression matching the URL.
     157     */
     158    protected function getUrlRegex( $url ) {
     159        $regex  = '@^' . str_replace( 'http\://','https?\:\/\/', preg_quote( $url )) . '@';
     160        return $regex;
     161    }
     162   
    146163
    147164    /**
     
    185202            //Unfortunately not every WP plugin developer is a JS ninja
    186203            //So... let's put it in the header.
    187             if ( empty($wp_scripts->registered[$handle]->extra) )
     204            if ( empty($wp_scripts->registered[$handle]->extra) && empty($wp_scripts->registered[$handle]->args) )
    188205                $where = 'header';
    189206
  • assetsminify/trunk/lib/CssMin.php

    r683393 r1018266  
    466466            elseif ($class === "CssAtKeyframesStartToken")
    467467                {
    468                 $r[] = $indent . "@keyframes \"" . $token->Name . "\"";
     468                $r[] = $indent . "@keyframes " . $token->Name . "";
    469469                $r[] = $this->indent . $indent . "{";
    470470                $level++;
     
    18411841            elseif ($class === "CssAtKeyframesStartToken")
    18421842                {
    1843                 $r[] = $indent . "@keyframes \"" . $token->Name . "\" {";
     1843                $r[] = $indent . "@keyframes " . $token->Name . " {";
    18441844                $level++;
    18451845                }
     
    33263326        {
    33273327        $r = 0;
    3328         $transformations = array("-moz-keyframes", "-webkit-keyframes");
     3328        $transformations = array("-moz-keyframes", "-webkit-keyframes", "-o-keyframes", "-ms-keyframes");
    33293329        for ($i = 0, $l = count($tokens); $i < $l; $i++)
    33303330            {
     
    44364436    public function __toString()
    44374437        {
    4438         return "@" . $this->AtRuleName . " \"" . $this->Name . "\"{";
     4438            return "@" . $this->AtRuleName . " " . $this->Name . "{";
    44394439        }
    44404440    }
     
    45754575            return $index + 15;
    45764576            }
     4577        // Start of @keyframes at-rule block (@-ms-keyframes)
     4578        else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 14)) === "@-ms-keyframes")
     4579            {
     4580            $this->atRuleName = "-ms-keyframes";
     4581            $this->parser->pushState("T_AT_KEYFRAMES::NAME");
     4582            $this->parser->clearBuffer();
     4583            return $index + 14;
     4584            }
     4585        // Start of @keyframes at-rule block (@-o-keyframes)
     4586        else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 13)) === "@-o-keyframes")
     4587            {
     4588            $this->atRuleName = "-o-keyframes";
     4589            $this->parser->pushState("T_AT_KEYFRAMES::NAME");
     4590            $this->parser->clearBuffer();
     4591            return $index + 13;
     4592            }                       
    45774593        // Start of @keyframes at-rule block (@-webkit-keyframes)
    45784594        elseif ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 18)) === "@-webkit-keyframes")
  • assetsminify/trunk/plugin.php

    r833449 r1018266  
    55Description: WordPress plugin to minify JS and CSS assets.
    66Author: Alessandro Carbone
    7 Version: 1.2.2
     7Version: 1.2.3
    88Author URI: http://www.artera.it
    99*/
  • assetsminify/trunk/readme.txt

    r833449 r1018266  
    44Tags: assets, minify, css, js, less, sass, compass, coffeescript
    55Requires at least: 3.3
    6 Tested up to: 3.8
     6Tested up to: 4.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    9 Stable tag: 1.2.2
     9Stable tag: 1.2.3
    1010
    1111Use Compass, SASS, LESS and CoffeeScript (NEW) to develop your themes and minify your stylesheets and JavaScript simply by installing AssetsMinify.
     
    6161== Changelog ==
    6262
     63= 1.2.3 =
     64
     65* SSL and keyframes bugfix thanks @pepe - http://mundschenk.at/
     66
    6367= 1.2.2 =
    6468
Note: See TracChangeset for help on using the changeset viewer.