CSS question

Why is this plugin adding css broken css links across the site? Did I miss something here?

211> echo '<link rel="stylesheet" href="' . $url . $hash . '.css?build=' . date("Ymd", strtotime('-24 days') ) . '" type="text/css" media="screen" />';

and if it's going to add css, why isn't it using wp_enqueue_style ?

I'm commenting out this line.

  • fuzu42
    • Site Builder, Child of Zeus

    EDIT:
    That's twice, once in each domain plugin:

    line 981 in multi-domains.php v1.0.6
    echo '<link rel="stylesheet" href="' . $url . $hash . '.css?build=' . date( "Ymd", strtotime( '-24 days' ) ) . '" type="text/css" media="screen" />';

    and line 211 in domain-mapping.php v3.0
    echo '<link rel="stylesheet" href="' . $url . $hash . '.css?build=' . date("Ymd", strtotime('-24 days') ) . '" type="text/css" media="screen" />';

    nothing appears to be degraded by commenting them out, especially since they result in 404 links, but I'd love to find out what those lines are there for.

    I'm running WordPress 3.0.1 with batcache-APC (no memcached) on Apache/php-fpm/suhosin behind Varnish. No esi or anything fancy like that.

  • fuzu42
    • Site Builder, Child of Zeus

    I thought that could be what it's for, but the links result in 404 errors. Is there a problem with my redirects installation? They all appear as files in the root of the site -> http://mysite.tld/{generated-hash}.css but I currently don't have any mod_rewrite rules set up to deal with this. Should this be being handled by sunrise.php ?

    I'm using current multi-domain & domain mapping plugins. Perhaps I'm using the wrong sunrise.php file?

    Also, it's listing cross-subdomain css files, as well as cross-domain css files.

    My Varnish config is set up to drop all cookies & serve cached content unless ( req.http.Cookie ~ "wordpress_logged_in_" ) but I don't see how that would result in 404s...but figured I should let you know just in case.

  • fuzu42
    • Site Builder, Child of Zeus

    Yep, fixed. Now if the hash is b94108d3c39e88a648e3bcf5a8ff5b97, there's a link on every page (backend or not) on {mapped-name.tld} to
    http://{name.tld}/b94108d3c39e88a648e3bcf5a8ff5b97.css?build=20101005

    The file contains the following

    /* Sometimes me think what is love, and then me think love is what last cookie is for. Me give up the last cookie for you. */
    Array
    (
        [b94108d3c39e88a648e3bcf5a8ff5b97{name.tld}] => Array
            (
                [domain] => http://{name.tld}/
                [hash] => b94108d3c39e88a648e3bcf5a8ff5b97
                [user_id] => 1
                [action] => login
            )
    
    )

    Thanks!

  • fuzu42
    • Site Builder, Child of Zeus

    @Ulrich Whoa!

    BIG problems.

    It's not ok. I took it out of sandbox prematurely, since it seemed to be working (no 404s), and we ended up with {site-x}.{name.tld} linking to {site-n}.{name.tld} foreach 0 < n < [# of active blogs logged in user has account for] where {site-n} represents the respective blog-slug strings. Can I restrict this to load only in certain places? Say on the my-blogs page? That's not a how-to request, I'm wondering if it will break the intended design.

    A cookie value is set for wordpress_logged_in_ as "{username}{hash}" on .{name.tld} even on mapped domains, so this approach shouldn't be necessary within the primary, anyway.

    All our admin areas are hosted off subdomains of the same domain, perhaps we could get this plugin to only link these files across sites that have mappings?

  • Ulrich
    • The Crimson Coder

    Can I restrict this to load only in certain places? Say on the my-blogs page? That's not a how-to request, I'm wondering if it will break the intended design.

    Yes, it will break the intended design: users can login/logout from any page of the site.

    A cookie value is set for wordpress_logged_in_ as "{username}{hash}" on .{name.tld} even on mapped domains, so this approach shouldn't be necessary within the primary, anyway.

    It is necessary: when a user login to mapping.com, he should be automatically logged in to site.primary.com ; same for when he logout.

    All our admin areas are hosted off subdomains of the same domain, perhaps we could get this plugin to only link these files across sites that have mappings?

    This will also break it: Let's assume we have site1.primary.com with mapping mapping.com, and site2.primary.com without mapping. When a user login to mapping.com, he should also be automatically logged in to site2.primary.com. So, this is also necessary for sites without mapping.

  • fuzu42
    • Site Builder, Child of Zeus

    right, but when a user logs into site1.primary.tld, loading the css file site2.primary.tld can't set that cookie for mapped-site2.tld because it's cross-domain. It doesn't need to set another cookie for primary.tld either because site1 sets its cookes as .primary.tld, not site1.primary.tld. Loading the css file on mapped-site2.tld should be able to do that, as you have designed.

    Also, do we need to be logging users in to all their mapped sites on the network at the same time? What about only logging in/out for the mapping that they are currently on. That way there's never more than 1 external css file loaded instead of n css files.

    Thanks for walking me through this!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.