WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Scripts Gzip] Two problems (user directories and css images) (17 posts)

  1. eryanv
    Member
    Posted 4 years ago #

    I have found two problems with this plugin:

    First of all, if WordPress is being run out of a user's home directory (like what I do for testing), this plugin cannot determine the path for each of the items it is trying to compress.

    <link rel="stylesheet" href="http://localhost/~eryanv/i4k/wp-content/plugins/scripts_gzip/gzip.php?css=http://localhost/;http://localhost/;http://localhost/" type="text/css" media="screen" />
    <script type="text/javascript" src="http://localhost/~eryanv/i4k/wp-content/plugins/scripts_gzip/gzip.php?js=http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/"></script>

    Second problem I found:

    When it is successful and compresses the files, the background images from a given CSS file may no longer point to the correct url. If WordPress is not installed in the web server root (for instance mine is in a directory called wp, and has to be accessed through http://hostname/wp), the path translations done in the CSS files are no longer accurate.

    Originally in the CSS file I had:
    url('images/topframe.png')
    which was then translated into:
    url('/wp-content/themes/i4k/images/topframe.png')
    which is close, but does not account for the fact that it should really look like:
    url('/wp/wp-content/themes/i4k/images/topframe.png')

    Other than that, I'll be excited to see where this goes.

  2. edward mindreantre
    Member
    Posted 4 years ago #

    I sorta expected subdirectory problems. Don't have WP installed in any subdirectory myself, but this problem should be solvable.

    I'll get right it on on sunday or monday.

  3. edward mindreantre
    Member
    Posted 4 years ago #

    Hm. Does this version help any?

  4. eryanv
    Member
    Posted 4 years ago #

    The second problem is fixed, however nothing has changed with the first situation.

  5. edward mindreantre
    Member
    Posted 4 years ago #

    Could y'all paste in the original CSS and script links?

  6. eryanv
    Member
    Posted 4 years ago #

    This is what I start off with, without the plugin.

    <script type="text/javascript" src="http://localhost/~eryanv/i4k/wp-includes/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="http://localhost/~eryanv/i4k/wp-content/themes/i4k/js/i4k.js"></script>
    
    <link rel="stylesheet" href="http://localhost/~eryanv/i4k/wp-content/themes/i4k/style.css" type="text/css" media="screen" />
    
    <script type='text/javascript' src='http://localhost/~eryanv/i4k/wp-includes/js/prototype.js?ver=1.6'></script>
    <script type='text/javascript' src='http://localhost/~eryanv/i4k/wp-includes/js/scriptaculous/wp-scriptaculous.js?ver=1.8.0'></script>
    <script type='text/javascript' src='http://localhost/~eryanv/i4k/wp-includes/js/scriptaculous/effects.js?ver=1.8.0'></script>
    <script type='text/javascript' src='http://localhost/~eryanv/i4k/wp-content/plugins/lightbox-2/lightbox.js?ver=1.8'></script>
    <script type='text/javascript' src='http://localhost/~eryanv/i4k/wp-content/plugins/picasaview/picasaview.js?ver=1.0'></script>

    This is what they reduce to.

    <link rel="stylesheet" href="http://localhost/~eryanv/i4k/wp-content/plugins/scripts_gzip/gzip.php?css=http://localhost/;http://localhost/;http://localhost/" type="text/css" media="screen" />
    
    <script type="text/javascript" src="http://localhost/~eryanv/i4k/wp-content/plugins/scripts_gzip/gzip.php?js=http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/;http://localhost/"></script>

    I'm sure it's the '~' character which is messing things up, probably has to do with it either not being escaped somewhere along the way, or possibly incorrectly escaped.

  7. edward mindreantre
    Member
    Posted 4 years ago #

    It was the ~ character.

    Here, how's this?

    pre2

    I've made a proper class of it and it should filter out the base address of the WordPress installation. With a bit of luck it'll work for others too.

  8. eryanv
    Member
    Posted 4 years ago #

    Works for me.

    Thanks!

  9. Jakets
    Member
    Posted 4 years ago #

    Still doesn't work for me, turns my site into a cssless mess like 0.5.1

    My install is in /blog

    You can have a look at my site at http://farmvillefanatic.com

    Let me know if there is any specific info I can get for you.

  10. not2bug
    Member
    Posted 4 years ago #

    Doesn't work on K2 Theme.

  11. Jakets
    Member
    Posted 4 years ago #

    I should mention I am using WP Super Cache plugin. Do I even need Scripts Gzip?

  12. edward mindreantre
    Member
    Posted 4 years ago #

    Yeah, some links still don't work correctly.

    I've been trying to fix PHP-css files. Try the link below?
    0.5.3pre1

    I've also just realized that <!--if ie7--> style things are either ignored or automatically included (not sure yet) so I have to fix that also.

    In the meantime, how does the above version work?

  13. edward mindreantre
    Member
    Posted 4 years ago #

    0.5.3 released. Should fix a few css problems.

  14. Jakets
    Member
    Posted 4 years ago #

    Nope, .5.3 still breaks my site heavily. Like I mentioned earlier though, is this needed or compatible with WP Super Cache? I use the gzip compression on it.

    Thanks.

  15. edward mindreantre
    Member
    Posted 4 years ago #

    I have no idea. I've never used Super Cache. I guess I'll download it later and try it out.

    If you disable Super Cache and scriptsgzip still breaks your site, could you show me the site so that I can see what kind of links are in it?

  16. Rich Spott
    Member
    Posted 4 years ago #

    I was also having problems with the scripts/gzip plugin...

    first, it appears to not display my leaderboard advertisement, but it does however display my sidebar advertisement. I was wondering if it is stopping the js from being displayed on the leaderboard ad.

    Also, if my domain is sportsblognet.com and my css is located on sportsblognet.com, it takes all images and assumes that they are dervied from sportsblognet.com.

    But in the css i mark the background urls as images.sportsblognet.com with the full address to the image, but the plugin turns it from url("http://images.sportsblognet.com/wp-content/themes/test-theme/_inc/images/logo.png") and turns it into url(../wp-content/themes/test-theme/_inc/images/logo.png) which is looking for the image on sportsblognet.com instead of images.sportsblognet.com, and the image does not appear.

  17. edward mindreantre
    Member
    Posted 4 years ago #

    New version should help. Does it?

Topic Closed

This topic has been closed to new replies.

About this Topic