WordPress.org

Ready to get started?Download WordPress

Forums

WP-LESS
CSS Paths break after site migration (6 posts)

  1. ferahl
    Member
    Posted 1 year ago #

    Hi,

    After moving my site from local to a dev domain wp less fails to compile any image paths correctly, e.g:

    before migration on local:
    background: url(http://localhost/cloud/tfi/wp-content/themes/tfi/less/../images/interface/site-logo.png) no-repeat;

    then after migration to demo subdomain:
    background: url(http://tfi.dreaminpixels.co.uk/wp-content/themes/tfi/less/) no-repeat;

    It replaces every single path with http://tfi.dreaminpixels.co.uk/wp-content/themes/tfi/less/ but without the actual file path, just the domain.

    ANy ideas?

    Thanks

    http://wordpress.org/extend/plugins/wp-less/

  2. ferahl
    Member
    Posted 1 year ago #

    Temporarily fixed this issue with the use of the @stylesheet_directory_uri variable. eg:

    background: url('@{stylesheet_directory_uri}/images/interface/site-logo.png') no-repeat;

    And then bypassing your regex stuff since it wasn't working. Interesting note that the final return was only happening once migrated.

    protected function _filterStylesheetUri($matches)
    {
        if (preg_match('#^(http|@|data:|/)#Ui', $matches['url'])) {
            return $matches[0];
        }
    
        /*return sprintf('url(%s%s%1$s)',
            $matches['quote'],
            $this->_TmpBaseDir . '/' . $matches['url']
        );*/
        return $matches[0];
    }
  3. oncletom
    Member
    Plugin Author

    Posted 1 year ago #

    It is not a recommended practice to alter the original plugin file — especially it it's updated later without a bugfix or because it is related to a misuse/misunderstanding.

    What's changing between your local and your production environment? Maybe do you configure a domain differently?

    Which version of the plugin do you use? Have you APC enabled?
    A fix has previously been introduced for hostname and generally, people had trouble because APC was caching old files so the new update of WP-LESS was in fact not taken in account.

    I need those informations to determine if it's either a bug or not.
    Thanks :-)

  4. ferahl
    Member
    Posted 1 year ago #

    Hi,

    Sorry it is the latest version of your plugin and latest wordpress version running PHP 5.3 without APC on live, and I think PHP 5.4 on local. Difference between domains is: http://localhost/cloud/tfi/ and http://tfi.dreaminpixels.net/

    I'll check soon and post what the $matches array is holding in both cases.

    Thanks.

  5. growdigital
    Member
    Posted 1 year ago #

    I've had a similar problem, migrating a site to my local machine (Mac 10.8.2, running MAMP Pro 2.1.1)

    The CSS is being called style-26bc35c3b9.css _but_ the file doesn't exist in wp-content/uploads/wp-less/themename/

    > What's changing between your local and your production environment? Maybe do you configure a domain differently?
    The site was running on a linux box, so I have had to chmod change the user to _www. I' have set all wordpress file permissions to 777.

    > Which version of the plugin do you use?
    1.5.2

    > Have you APC enabled?
    I don't think MAMP has APC installed by default.

    hth, Jake

  6. oncletom
    Member
    Plugin Author

    Posted 1 year ago #

    Hi both of you,

    within the new mechanism introduced in 1.5, some data are stored in database.
    It lacks of a "rebuild CSS" button so to fix the problem, simply update a LESS file to force the CSS compilation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic