Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom CSS doesn't respect https #420

Closed
pippinsplugins opened this issue Mar 25, 2014 · 12 comments
Closed

Custom CSS doesn't respect https #420

pippinsplugins opened this issue Mar 25, 2014 · 12 comments
Labels
[Feature] Custom CSS [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Type] Bug When a feature is broken and / or not performing as intended

Comments

@pippinsplugins
Copy link

I haven't dug into this yet, but it seems that the custom CSS module does not properly respect pages that are loaded on https and load the custom CSS file over http, resulting in SSL invalidation.

@pippinsplugins
Copy link
Author

At least in the instance where I saw the issue, the scheme wasn't getting detected properly in home_url() here.

Perhaps it could be set explicitly?

@jeherve
Copy link
Member

jeherve commented Mar 25, 2014

home_url() should already use the appropriate protocol. I'm not sure what's happening here.

Would something like this help?

$prot = is_ssl() ? 'https' : 'http';
$href = home_url( '/', $prot );

@pippinsplugins
Copy link
Author

Yeah I think that would work, give me a few minutes and I can test it to confirm.

@pippinsplugins
Copy link
Author

Hmm, interestingly, even setting the schema to https directly fails to make it load via https.

@jeherve
Copy link
Member

jeherve commented Mar 25, 2014

I just tested it on a test site of mine, and setting the schema to https seems to work on my end.

Does your site use a reverse proxy, or anything that may force the use of http, as mentioned in the codex?

@georgestephanis
Copy link
Member

@jeherve Please don't use a ternary with is_ssl -- instead use either set_url_scheme or just //whatever.com protocol agnostic urls.

@pippinsplugins
Copy link
Author

Removing the schema complete would work fine.

@jeherve
Copy link
Member

jeherve commented Mar 25, 2014

👍 . I didn't know about set_url_scheme.

@georgestephanis
Copy link
Member

@pippinsplugins Did you test that? There's the chance that something in core would add a url scheme via set_url_scheme

@Ipstenu
Copy link

Ipstenu commented Mar 28, 2014

Just to pipe in, I use custom css on my https only site without any issues. See https://store.halfelf.org/ for it. No invalid SSL :)

@pippinsplugins
Copy link
Author

Setting the scheme did not work, but removing the call to home_url() completely did:

        $href = add_query_arg( 'custom-css', 1 );
        $href = add_query_arg( 'csblog', $blog_id, $href );
        $href = add_query_arg( 'cscache', 6, $href );
        $href = add_query_arg( 'csrev', (int) get_option( $option . '_rev' ), $href );

@lancewillett
Copy link
Contributor

Closing as "worksforme".

leogermani pushed a commit that referenced this issue Aug 12, 2022
Fixes #45
If a custom post type has no rewrite permalink then the plugin will
clear the entire cache in wp_cache_post_id_gc() because
get_current_url_supercache_dir() will strip the ?x=y from the URL,
resulting in the URL being the homepage. The plugin then deletes
everything below that.
See also Automattic/wp-super-cache#66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Custom CSS [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

5 participants