WordPress.org

Forums

Trouble with javascript and css after latest upgrade of W3 Total Cache (32 posts)

  1. Will
    Member
    Posted 5 years ago #

    Greetings,

    After having a bit of trouble getting the previous version to work with my site- you really helped me alot by giving me some tips on how to get it to work and it was successful.

    This is the original thread that you helped me fix my css trouble before:
    http://wordpress.org/support/topic/296526?replies=5#post-1188541

    ...Anyway, after upgrading to the latest version (v 0.7.5.1) I'm experience the same trouble with the plugin breaking my theme/css and some of the javascripts not working when minified. I didn't change any of my settings (line/comment breaks disabled, etc.) that worked in fixing the issues I was experiencing with the previous version- so I'm kind of back at square one again. I've tried to clear the cache completely and reset all my settings including JS and CSS files to minify, but no luck. Right now I'm successfully running the page and database cache part of the plugin, but unable to use minify for my JS/CSS files.

    I'd really appreciate any help you can give. Thanks again for such a great plugin. Until I upgraded, it really made my site fly and I really hope I can get this working again soon. =)

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 5 years ago #

    Hi @wramos, what has changed since last time? Could you tell me all of your current settings so I can take try to resolve?

  3. Will
    Member
    Posted 5 years ago #

    Nothing that I know of. I've just upgraded to the most recent version of the plugin (0.7.5.2) and everything seems to work fine except when I try to minify my main css file- that breaks the layout of my site.

    My main settings are:

    Page Caching Enabled (APC)
    Minify Enabled (APC)
    Database Caching Enabled (Memcached)
    CDN (not enabled yet)

    On the minify settings:

    HTTP compression (gzip / deflate) - Enabled
    HTTP compression for MSIE6 - Enabled
    Rewrite URL Structure - Enabled
    Automatically upload modified files - Enabled

    Update external: 3600

    HTML: Minify & Don't minify html for logged in users - both enabled
    JS: Minify - enabled
    CSS: Minify - enabled

    The only thing I tried to minify first is my main css style sheet- which, like I said- breaks the layout of my site.

    Any help would be greatly appreciated. Please let me know if you need any more info from me. Thanks again!! =)

  4. Frederick Townes
    Member
    Posted 5 years ago #

    Does the include file inserted by the plugin exist or is it a 404?

  5. Will
    Member
    Posted 5 years ago #

    The include file (in this case my main CSS style sheet) does indeed exist and I've also validated the url through the plugin as well. It does load it, but various attributes within my style sheet appear to get mangled.

  6. Frederick Townes
    Member
    Posted 5 years ago #

    Did you try to disable comment and line break removal?

  7. Will
    Member
    Posted 5 years ago #

    I did indeed.

  8. Will
    Member
    Posted 5 years ago #

    FYI: I just installed the latest version (v.8) and it appears that I'm unable to add javascript or css files in the minify section. I see a new drop-down list of groups for both- but when I enter my css or js files and hit save it does not seem to work. After adding the files and hitting save I'm returned to the minify settings screen but no list of the added files are displayed.

    Perhaps I'm just doing something wrong? Thanks in advance for your help! =)

  9. ecartz
    Member
    Posted 5 years ago #

    I am having the same problem. The .8 release loses the previous minify settings and I can't add them back. I have done a Verify URI on the file path and the popup shows the CSS file.

    If I do a view generated source after clicking the add stylesheet button, I see

    <ol id="css_files">
                        			<li><input class="css_enabled" name="css_files_include[]" value="" size="100" type="text">&nbsp;<input class="css_file_delete css_enabled button" value="Delete" type="button">&nbsp;<input class="css_file_verify css_enabled button" value="Verify URI" type="button"></li></ol>
                    <ol id="css_files"></ol>
        			<input id="css_file_add" class="css_enabled button" value="Add a style sheet" type="button">

    However, if I look in the options function in lib/W3/Plugin/TotalCache.php I see

    $css_files = W3_Request::get_array('css_files');

    If I add _include to css_files there:

    $css_files = W3_Request::get_array('css_files_include');

    It changes the behavior and the CSS file setting that I enter shows on the subsequent page. However, it doesn't actually include the CSS in the head. It does look like it removes the link if I enter one for the CSS manually in the head. I had to disable minify to get the site to work correctly.

  10. Frederick Townes
    Member
    Posted 5 years ago #

    I cannot duplicate this issue. Structure changes to the core do break old settings (depending on what they are), however you should be able to save them when you re-add. Keep in mind, that if you've selected a group other than default when you clicked saved settings, the default group will be shown, so if your default group is empty that may be a cause of confusion.

  11. Gravitydk
    Member
    Posted 5 years ago #

    I haven't had the problem of being unable to add CSS or JS files, but I did lose those I had previously (gone with the upgrade).

    The procedure I use to add scripts:
    1. select 'general'
    2. click 'add a script'
    3. type in details to the new blank box, then the verify URI
    4. click 'save changes'.

    ps. could you look at this problem please?

  12. joefletcher
    Member
    Posted 5 years ago #

    I have the same problem on a fresh install of .8 (never installed previous versions) on 2.8.6.

    I just installed the latest version (v.8) and it appears that I'm unable to add javascript or css files in the minify section. I see a new drop-down list of groups for both- but when I enter my css or js files and hit save it does not seem to work. After adding the files and hitting save I'm returned to the minify settings screen but no list of the added files are displayed.

  13. Frederick Townes
    Member
    Posted 5 years ago #

    For those of you having this issue, I apologize, it's remedied in the next release.

  14. joefletcher
    Member
    Posted 5 years ago #

    Thanks, Frederick. I wanted to point out that I noticed it actually does save the last js I enter on the screen. So, if I enter 7 js's, the last one entered get saved.

    Any rough ETA guestimate for the next release?

  15. Frederick Townes
    Member
    Posted 5 years ago #

    Hopefully this week. Meanwhile you an edit the settings file manually if you have to. :(

  16. joefletcher
    Member
    Posted 5 years ago #

    Ah cool, I was going to ask about that. Good idea. Thanks!

  17. swatgod
    Member
    Posted 5 years ago #

    Hi i am having an issue with minify using W3TC. I can get everything else to work(apc and memcached) but when i try to use minify, I can not get it to work at all. I am using wordpress 2.8.6 with W3TC .8.

    I tried different forms of paths for the css/js files but none of it made any difference at all. The settings show the files have been added correctly(or i think its correct, not installed this plugin before so i do not know if its right or not).

    Is there possibly something i am missing? I can not really find anyone else who is/has had this issue before which makes me think i may be doing something wrong.

    I saw some mention an issue with adding js and css files to the minify section, but i found that after adding them and clicking on minify section again a time or 2 that it showed the files i added.

  18. Frederick Townes
    Member
    Posted 5 years ago #

    Did you click "Verify URI" to make sure everything was ok?

    Did you check the wp-content/w3tc/ directory to make sure that the cache files were being created?

    Did you try to open the minify files found in your updated source code?

  19. swatgod
    Member
    Posted 5 years ago #

    It verifies ok, but when i go to load my home page or any other page, it wont load any of the css files i put in for it to minify. It wont create any files even though it has permissions to do so. It does create my cache files perfectly fine as all the cache stuff works(apc and memcache). It just wont do anything with minify.

  20. Frederick Townes
    Member
    Posted 5 years ago #

    If you select disk as the method. When you open the created files in your browser what happens?

  21. swatgod
    Member
    Posted 5 years ago #

    same as before, it will just return a 404 with bad request and wont load the css files anymore until i remove them from the minify section and still wont create any minified files.

  22. Frederick Townes
    Member
    Posted 5 years ago #

    Then I'm 100% sure that even though you have a scripts entered correctly, there is one that does not like to be minified. So you can either, try "combine only" for those scripts and see if it works then or you can remove scripts one by one until you original minification preferences work.

  23. swatgod
    Member
    Posted 5 years ago #

    No matter which css/js file i used to get it to work with, it just gave me back the same results and unsure where its breaking as its not writing anything out to the log file(i recreated it where its supposed to be with the correct file name as someone else suggested).

    I also am trying scripts one at a time so i can try to find any that may not work as well. Also trying different settings with no change to what it does.

  24. swatgod
    Member
    Posted 5 years ago #

    Sorry to double post but after a lucky guess, found out a plugin i use is the cause of the minifying to not work.

    I use a plugin called vbridge to let wordpress work with vbulletin and i guess something it does is breaking the ability for the W3 Total Cache plugin to minify the files properly as after i turn it off the minify settings work instantly without any issues aside from it not minifying jquery.

  25. swatgod
    Member
    Posted 5 years ago #

    Got a copy of the new version of W3TC and it works a lot better but i now have an issue with adding css and js files to the minify list. i even tried to manually add the files to the config and it than only shows 1 character of the url and if i hit save in the configuration it removes the changes i made to the config file.

  26. Frederick Townes
    Member
    Posted 5 years ago #

    Please backup your settings file, deactivate the plugin, remove the plugin, re-download, activate and restore your settings file. Sorry for the trouble.

  27. urban_mainframe
    Member
    Posted 5 years ago #

    I'm was having the same problem as swatgod. I followed your advice Frederick, a complete reinstall of W3TC, and the minify now works but has introduced a new problem:

    My page source still requests the original CSS file along with the new minified file.

    <link rel="stylesheet" type="text/css" href="http://assets.urbanmainframe.com/wp-content/w3tc/min/default.include.css" media="all" />

    <link rel="stylesheet" href="http://assets.urbanmainframe.com/wp-content/themes/options/styles/light/light.css" type="text/css" media="screen" />

    All that "default.include.css" contains at the moment is the minified version of "light.css" but the request for "light.css" remains in the source of the page. This didn't happen with the previous version of W3TC.

    Any ideas?

  28. Frederick Townes
    Member
    Posted 5 years ago #

    I know this might sound silly, but are you sure light.css is in your settings? Can you humor me and double check? Additionally the settings file changed a bit due to some core changes, so your groupings if any might require a check and re-save.

  29. urban_mainframe
    Member
    Posted 5 years ago #

    Hi Frederick. I just double-checked and light.css is definitely in my Minify settings. "Verify URI" result is positive too.

  30. Frederick Townes
    Member
    Posted 5 years ago #

    Ok, I don't have enough information to trouble shoot. Did you re-populate your settings after upgrade or reuse your old settings file? Can you submit a bug report (in the plugin) please?

Topic Closed

This topic has been closed to new replies.

About this Topic