#45339 closed defect (bug) (invalid)
Media files randomly using http instead of https
Reported by: | hopetommola | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.8 |
Component: | Media | Keywords: | |
Focuses: | multisite | Cc: |
Description
This is a follow-up to #14867.
I was working on loading speed for blogs.hope.edu (multisite) and found what I believe is this same issue.
Images show as https in inspector AND in Media Library:
https://blogs.hope.edu/arts/theatrical-arts/a-professor-mother-and-sons-journey-into-the-woods/
Images load as http on frontend AND in Media Library:
https://blogs.hope.edu/alumni/alumni/we-love-you-nykerk/
I've reviewed the wp options table in the database and home and site are https://blogs.hope.edu
In the admin, Permalink settings for /arts shows https. Permalink settings for /alumni show http.
It seems that somewhere along the way, the value of $bloginfo->home is being assigned a protocol which is sub-blog specific, and not listening to the site / home values in wp options
Thoughts?
Change History (5)
#4
@
6 years ago
- Resolution set to invalid
- Status changed from new to closed
Time for a little humble pie ... apparently, somehow, 15 of the total 77 blogs created on the network at the tale end of 2015 had the site specific "Site Address (URL)" set to http:// on this page: https://blogs.hope.edu/wp-admin/network/site-info.php?id=30 ... Sorry I missed that. I'm not sure how the 30+ blogs created before those acquired the https and these didn't, nor am I sure why the 30ish blogs created after also acquired the https, but this one slice was missed (I did not edit them manually when updating the site to https) but I have edited those 15 blogs manually now, and new media is uploading with https. I will obviously have to go through and do a F&R for media loaded to those blogs over the last few years and make sure they're https.
Thanks for the WP CLI idea - I've read a bit about it and I do use command line for all WP updates, but I haven't gotten into WP CLI specifically yet. No time better than the present.
Without having access to code, I'm simply guessing, if the URL scheme used to be without SSL earlier, then changing the structure later does not change the URLs of all media files in the existing posts or pages and need to be changed manually, for that we can use WP CLI search-replace functionality. One more suspect is issue #25449, some plugins make use of function wp_upload_dir which only returns HTTP URLs.