ConnectThink / WP-SCSS

Wordpress Plugin that compiles sass using scssphp
http://wordpress.org/plugins/wp-scss/
249 stars 76 forks source link

5minutes before being updated #8

Closed cedriccharles4 closed 10 years ago

cedriccharles4 commented 10 years ago

Hi and thanks for this great plugin !

I've a problem. When I change something in my scss and save it, I have to reload the page a big number of times and wait 5 minutes to see the changes...

Could you help me ? Thanks !

adampatarino commented 10 years ago

Hey @cedriccharles4,

Do you have errors logging to the front or in a log file? Do you know what version of php you are running? Is this locally or on a remote server?

cedriccharles4 commented 10 years ago

Hi @adampatarino and thanks for the quick answer :) !

It's on a remote server. Here are the server spec : RAM 5,9/64M • SQL 68 • PHPv 5.4.4-14+deb7u7.5

Nothing showed on front ... Where is the log file ?

Thanks a lot !

cedriccharles4 commented 10 years ago

I use the Bones Starter Theme (http://themble.com/bones/)

It has a scss folder, with a styles.scss that includes multiple other scss... Don't know if it changes something ?

adampatarino commented 10 years ago

So the log file should be in your .scss folder. You can toggle where errors are sent on the settings page.

I also use bones for most of my development, so as long as you have defined the scss and css directories in the settings, it should be fine.

How are you editing your remote files? FTP? What FTP client do you use?

cedriccharles4 commented 10 years ago

I have no log file in my scss folder...

I'm editing my files with coda2, directly online.

adampatarino commented 10 years ago

An error file will only be generated upon an error. So it sounds like there are no issues with your .scss file.

I suspect Coda is taking a long time to upload the file to the server. Here's a google group discussing it: https://groups.google.com/forum/#!topic/coda-users/0E5z5v1zGK0

For background, the plugin will compile on page load, depending on if the modify time of the scss file is more recent than the css file. The nature of the process means problems with compilation delay the page load rather than run in the background. For this reason, my initial instinct is to wonder if there is a delay between the time you save changes and the time the file is actually modified on the server.

cedriccharles4 commented 10 years ago

It's weird cause if I edit the css file, the changes are shown instantly, but not if I modify the scss file :s

adampatarino commented 10 years ago

That is very weird. Can you test to see if there is a delay in uploading a scss file?

cedriccharles4 commented 10 years ago

If I upload a scss file, Coda tells me that the file has been uploaded instantly too :s It's like le compilation is not done... Do you use the last version of Bones ? Cause in 1.7, the scss files are in subfolders... Maybe this is the problem ?

adampatarino commented 10 years ago

What do you mean by subfolders? What does your directory structure look like?

cedriccharles4 commented 10 years ago

Here is the new Bones structure : https://github.com/eddiemachado/bones/tree/master/library/scss

There is one style.scss in the SCSS folder, than _mixin.scss, _base.scss, ... in the partials directory

adampatarino commented 10 years ago

Yeah that should not affect it. If there was en error with structure the plugin with throw an error. Can you take a screen shot of your settings page?

cedriccharles4 commented 10 years ago

Here it is ! https://space.zeo.net/g/1fd9n

adampatarino commented 10 years ago

Thanks. Very strange, your settings look fine. If it's not an issue with the FTP transfer I'll have to try and recreate it on my side.

Can you provide me some more details about your environment. OS, browser, hosting provider, etc?

How many lines of css does your sass compile to?

cedriccharles4 commented 10 years ago

Thanks for your time !

I'm on Mac OS X 10.9.2. 2Ghz Intel Core I7, 8 Go DDR3. Browser : Chrome Hosting Provider : Ghandi Server Info : RAM 5,9/64M • SQL 59 • PHPv 5.4.4-14+deb7u7.5

About the code, I've only copy the last Bones theme files (https://github.com/eddiemachado/bones/archive/master.zip). I've just change the color of the links in the /library/scss/partials/_mixins.scss to test your plugin. Nothing else has been change (except this color) from the orignial Bones theme.

Thanks a lot !

raulillana commented 10 years ago

Hi guys and nice plugin @adampatarino. :)

BTW i found it necessary to change /library/scss/style.scss every time, to update the changes made to any imported scss file.

Guess that issue is related with this.

adampatarino commented 10 years ago

@raulillana Thanks for writing in. That should not be the case. The plugin should be watching for changes to any file in your scss directory. I'll try and debug this.

cedriccharles4 commented 10 years ago

I @raulillana !

Thanks, I've seen this this morning too. By the way, I hope @adampatarino can find a work around ;) !

adampatarino commented 10 years ago

I'm breaking out @raulillana 's issue into a separate issue #9

adampatarino commented 10 years ago

I've updated the plugin to watch for changes in subfolders of the scss directory. @cedriccharles4 can you download the latest from this repo and see if that helps? I'm not convinced @raulillana 's issue is related, but it's worth testing.

@raulillana the last commit should fix your issue. Download latest and post any feedback to issue #9

cedriccharles4 commented 10 years ago

Hi @adampatarino !

I have download the latest version. I've edited the $link-color variables in the _variables.scss (the website was not opened). Than I load the site, the color was the good one. Than I change the variables back to his its previous value, reload the site, nothing changes. So it seems the problem is still there :( !

Have you successfully recreated the issue ? So it's the last version of Wordpress, Wordpress Multisite activated, last version of Bones starter theme. And I only try to modify one color in the _variables.scss file.

Thank again for your time :)

raulillana commented 10 years ago

Hey guys.

I was having problems with this same setup (WPµ + bones last versions).

The extra code comments on bones style files messed with WP headers and WP-SCSS, so clean your bones and try again.

If i understood well, if you have configured WP-SCSS to enqueue the files for you, it might be a great idea to delete the file library/css/style.css and create one in the root of the site with just the WP headers for theme recognition.

BTW this last commit solved #9 for me. Good luck @cedriccharles4. ;)

adampatarino commented 10 years ago

@raulillana is correct. You should have a style.css in the root of your theme with just the standard theme information.

@cedriccharles4 would you mind trying his suggestion and cleaning out the comments? Also, can you try a simplified directory with just a couple scss files in order to isolate if the problem is something specific with the bones structure or with your setup? That way I can know what to look for when debugging.

Thanks for being patient on this!

cedriccharles4 commented 10 years ago

Hi @adampatarino !

It's the default Bones themes (no customization right now). So it has a style.css on the root of the theme with that :

/******************************************************************
Theme Name: C'est quoi ce truck
Theme URI: http://www.themble.com/bones
Description: This site was built using the Bones Development Theme. For more information about Bones or to view documentation, you can visit the <a href="https://github.com/eddiemachado/bones/issues" title="Bones Issues">Bones Issues</a> page on Github. You'll want to customize this for your clients with your own information.
Author: Street Food Booster
Author URI: http://www.streetfoodbooster.com
Version: 1
Tags: fluid-layout, responsive-layout, accessibility-ready, translation-ready, microformats, rtl-language-support

License: WTFPL
License URI: http://sam.zoy.org/wtfpl/
Are You Serious? Yes.

MAKE SURE TO READ BELOW BEFORE GETTING STARTED FOR THE FIRST TIME!
------------------------------------------------------------------

You may be thinking…

WHOA, WHOA, WHOA…WHAT HAPPENED HERE?

But before you freak out, let me take a few minutes to explain.

Bones now uses Sass by default. If you prefer using regular CSS,
then feel free to modify this theme how you like and keep a copy
as your own personal starting point.

DON'T DISMISS IT JUST YET THOUGH, USING Sass ISN'T AS COMPLICATED AS YOU THINK.

It does take a few minutes to wrap your head around, but it will all
be worth it. Need a quick intro? Here are a few quick reads:

http://simplebits.com/notebook/2013/11/13/sass-book/ (BUY THIS)
http://cognition.happycog.com/article/preprocess-this
http://viget.com/inspire/sass-a-designers-perspective
http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to-css/
http://css-tricks.com/sass-style-guide/
http://net.tutsplus.com/tutorials/html-css-techniques/developing-with-sass-and-chrome-devtools/

I would HIGHLY RECOMMEND, if you are going to be working with Sass, that you work locally.
The browsers don't understand Sass and compiling it on the server takes a bit
of a setup.

That being said, here are a few MUST HAVE TOOLS for working with a
pre-processor: (You really only need one of them)

CodeKit: (Highly Recommended)
http://incident57.com/codekit/

Compass App: (Windows / Mac Users)
http://compass.handlino.com/

These applications compile Sass into valid CSS. This
way you can keep your production files easy to read and your
CSS minified and speedy. Simply set the output to the
library/css folder and you are all set. It's a thing of beauty.

You can also setup auto compiling with Grunt or using Terminal on
OSX. It's a bit complicated to setup so if you aren't familiar
with it, just get one of the automated applications.

---------------------------------------------------------------

Remember, once you download Bones it's up to you how to use it,
so go nuts. Set things up and develop in a way that's easiest for
you. If using Sass is still a bit confusing for you, then remove it
and customize this template as you see fit.

If you're a bit uneasy about using Sass or just want a familiar setup,
take a few minutes and think about how much better a developer you
can become by just TRYING out new technologies. It may be tough at
first but it WILL make you a better developer. TRUST ME ON THIS. Give
it a week, maybe two, and you will never go back.

If you STILL can't get on board and want to jump ship, that's cool.
Bones is not for everyone and that's ok, I mean I'm not hurt by it,
whatever, I never liked you anyway. Here are some other alternatives
if you're looking for a blank starter theme. I'll just be here waiting
by the window, in case you ever decide to come back.

http://roots.io/starter-theme (way more complex but has a ton of cool features)
http://html5reset.org (super clean and great markup)
https://github.com/viewportindustries/starkers (not sure if it's still active, but still good)

That's it. It's time to jump in and get your hands dirty.
Seriously, why are you still reading this? Get to work!
If you have any issues or problems, you can create an issue on github
or find me on Twitter: @eddiemachado (SHAMELESS PLUG!).

Happy Developing!

(When you're done, you may want to remove all this nonsense before
passing it along to your client.)

******************************************************************/

/*
WordPress Probz
So Theme Check (http://wordpress.org/plugins/theme-check/)
is constantly telling me that it needs these classes in the CSS even
though they are in the REAL stylesheet in library/css/style.css.
So we're gonna drop these here to keep it happy.
Great work, Theme Check (eye roll)
*/

.sticky {}          /* DO NOT EDIT THIS */
.gallery-caption {} /* THESE ARE USELESS */
.bypostauthor {}    /* THEY ARE ONLY TO KEEP THEME CHECK HAPPY */

I'll try with cleaning out the comments and let you know

cedriccharles4 commented 10 years ago

@raulillana said :

" it might be a great idea to delete the file library/css/style.css and create one in the root of the site with just the WP headers for theme recognition."

I have deleted the file (and Bones has a style.css at the root by default), and as soon as I update and upload style.scss, WP-SCSS automatically recreate the style.css in the /library/css/ folder. Is I update again the style.scss, the style.css is not updated... It seems that the plugin doesn't see that the file has been updated or that it doesn't update the style.css...

I'll try to clean out the comments...

cedriccharles4 commented 10 years ago

I've just installed this Wordpress Theme : http://noahbass.com/sass-wordpress-bootstrap/ It works great, as expected :) ! But I need it to work with my Bones theme :(

adampatarino commented 10 years ago

Ok, well we've narrowed it down to bones' structure then. Let me try and reproduce this and see if I can find the issue.

andywoz commented 10 years ago

Anyone have anything further on this? I can't get anything working.

Host: Rackspace Cloud Wordpress: 3.9.1 WP-SCSS: 1.1 Bones: eddiemachado-bones-v1.06-625-g329ea13

Thanks!

adampatarino commented 10 years ago

Ok, I still haven't replicated the issue. I've installed the latest bones, wp-scss, wordpress and thrown it all up on my sandbox server. Then I edited the _variables.scss file in the /partials/ directory via FTP. Changed $white: #fff; to $white: red;, clicked save, waited for it to upload, and refreshed my browser. All $white references changed to red. http://cl.ly/image/3c1Q3Q3E2e2Z

So it appears to be working fine with bones structure.

To be clear, no one is using a child theme correct? Bones has been activated as your theme? Settings should look like this with bones: http://cl.ly/image/0I3w3g2b2I20

If none of the above works, try unchecking enqueuing.

Post back if that still doesn't work.

cedriccharles4 commented 10 years ago

Hi @adampatarino !

Thanks for your time ! When I change it for the first time, it was ok. But if I continue change things and then refresh, it didn't work... Have you tried more changes ? Only the first refresh was ok for me...

Thanks !

cedriccharles4 commented 10 years ago

I have installed a clean WP on a new server, only install and activate the last version of bones. Then I edited the _variables.scss file in the /partials/ directory via FTP. Changed $white: #fff; to $white: red; , nothing happenened :s

cedriccharles4 commented 10 years ago

My mistake, with WP-SCSS 1.1.4 on a new clean install, it works !

Could it be an issue with multisite ? On the first project which gave me the issue, it's a wordpress multisite.

Thanks

adampatarino commented 10 years ago

@cedriccharles4 that's great news! I have not tested on multisite before, so it might be the culprit. I'll look into that and push an update accordingly.

Let me know if your problem persists. It could also be a permissions issue when writing to the cache directory.

cedriccharles4 commented 10 years ago

Since I need WP-SCSS on a multisite structure, I hope you can find a solution :) !

raulillana commented 10 years ago

Hey @adampatarino,

BTW i did notice you can't select log errors to a file option. It just doesn't in µ.

Tell me if i can provide more feedback to help.

2014-05-13 14:03 GMT+02:00 Adam Patarino notifications@github.com:

@cedriccharles4 https://github.com/cedriccharles4 that's great news! I have not tested on multisite before, so it might be the culprit. I'll look into that and push an update accordingly.

Let me know if your problem persists. It could also be a permissions issue when writing to the cache directory.

— Reply to this email directly or view it on GitHubhttps://github.com/ConnectThink/WP-SCSS/issues/8#issuecomment-42946208 .

cedriccharles4 commented 10 years ago

"It could also be a permissions issue when writing to the cache directory."

Where is this directory ? I'll check !

cedriccharles4 commented 10 years ago

It works on the multisite, but only after a few minutes...

adampatarino commented 10 years ago

You can find the cache directory in the wp-scss folder in the plugins directory. So the full path is /wp-content > plugins > wp-scss > cache.

Make sure it has sufficient permissions, usually 755 will do it. You should also make sure your scss and css directories have sufficient permissions. You can change permissions via FTP in transmit or filezilla.

I'll test multisite and see if I can reproduce.

andywoz commented 10 years ago

v1.1.4 has fixed the issue for me. Probably due to the SCSS being in sub folders in the latest version of Bones. Thanks!

cedriccharles4 commented 10 years ago

Ok... @adampatarino , stop looking for a solution ! I've found the problem --' !

Since a few weeks, we migrate some of our website to a new server, from Gandhi. In the plan of this specific server, Gandhi use Varnish to cache files (http://en.wikipedia.org/wiki/Varnish_(software))...

I've disabled it and now it works like a charm !

Sorry to have bothered you !

By the way, could you release the 1.1.4 version to the Wordpress Repository :) ?

Thanks, you can close this !

adampatarino commented 10 years ago

Sorry for the late reply. I'm so glad to hear you've worked out! I'll close this ticket!