WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 7 weeks ago

#42841 reopened defect (bug)

Media Library - Mixed content warnings

Reported by: nebri Owned by:
Milestone: Priority: normal
Severity: major Version: 4.9.1
Component: Media Keywords: needs-patch reporter-feedback
Focuses: multisite, coding-standards Cc:

Description

I'm attempting to migrate over our entire to SSL in a development environment. I've applied a self signed ssl certificate for the sake of testing, I've ensured that the config file the force ssl login is set to true:

define( 'FORCE_SSL_LOGIN', true );

however we still get mixed content warnings in the media library, and images are no longer being displayed on the front facing side of the website.

See screenshot attached:

Attachments (1)

wordpress_bug_media.JPG (333.2 KB) - added by nebri 3 years ago.
url in address bar is https:// but the file being served is in http://

Download all attachments as: .zip

Change History (9)

@nebri
3 years ago

url in address bar is https:// but the file being served is in http://

#1 follow-up: @Ipstenu
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

@nebri You have to also do a search/replace on your content to fix images :( Since the paths are hardcoded, you should be able to use wp-cli or the interconnect/it tool - https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ - to do this.

wp search-replace http://mydomain.com/wp-content/ https://mydomain.com/wp-content/

This is not really a bug in WP but a 'quirk' of migrating anywhere, even in the same place :(

#2 in reply to: ↑ 1 @nebri
3 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Replying to Ipstenu:

@nebri You have to also do a search/replace on your content to fix images :( Since the paths are hardcoded, you should be able to use wp-cli or the interconnect/it tool - https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ - to do this.

wp search-replace http://mydomain.com/wp-content/ https://mydomain.com/wp-content/

This is not really a bug in WP but a 'quirk' of migrating anywhere, even in the same place :(

I have run "wp search-replace 'http://www.mydomain.com' 'https://www.mydomain.com' --all-tables-with-prefix" to try and correct this issue, however the problem persists even after running that command.

Please consider this before closing my ticket immediately.

#3 @Presskopp
3 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

The problem cannot persist if the command was run successfully. Looking at your site (you didn't hide it very well) all seems ok. You may try https://wordpress.org/plugins/ssl-insecure-content-fixer/ but we have no core bug here.

#4 @nebri
3 years ago

@Presskopp

anyone willing to accept a team viewer session to observe what we're seeing here?

I just tried running ssl-insecure-content-fixer and problem is persisting in my media library, and we've lost a large chunk of the images from being displayed.

ryan@… I'll happily get into a shared session and have a quick chat. On our live site we have enabled the ssl certificate, but before I roll out the database changes I'm trying to verify it in our local development environment, which is where I am observing this behavior.

Last edited 3 years ago by nebri (previous) (diff)

#5 follow-up: @Ipstenu
3 years ago

As horrible as this sounds... no.

This isn't a core bug in WordPress. You've done 'something' wrong when switching over. You can post in the fixing-wordpress forum - https://wordpress.org/support/forum/how-to-and-troubleshooting/ - to get help, but as it stands, this is working as designed.

I recommend you make sure you flush your caches (server and local to your browser), but like Presskopp, when I go to your domain I don't see any issues clicking around.

This is sadly not an appropriate use of the trac ticketing system :(

#6 @netweb
3 years ago

  • Milestone Awaiting Review deleted

#7 in reply to: ↑ 5 @PhotoMan
7 weeks ago

  • Focuses multisite coding-standards added
  • Keywords needs-patch reporter-feedback added
  • Resolution invalid deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened

I also have this exact same issue. I'm also NOT migrating a site. This is for a fresh install using a WP Multisite instance in the latest stable version, 5.5.1

To reproduce:

  • On a HTTPS connection, upload an image into the library.
  • Add the image to a page or post using the TwentyTwenty or any default theme.
  • Inspect the image on the page/post -- the ahref url will be HTTP not HTTPS.
  • Open the image in the library. Refer to the "FILE URL" in the in the attachment details, it shows HTTP.
  • With the attachment panel still open - inspect the example image -- it will show http for it's URL reference.

If this was correct, any image would inherit the https protocol from the site.

Even after 3 years since this post was created, the issue still persists.

Thank you.

Replying to Ipstenu:

As horrible as this sounds... no.

This isn't a core bug in WordPress. You've done 'something' wrong when switching over. You can post in the fixing-wordpress forum - https://wordpress.org/support/forum/how-to-and-troubleshooting/ - to get help, but as it stands, this is working as designed.

I recommend you make sure you flush your caches (server and local to your browser), but like Presskopp, when I go to your domain I don't see any issues clicking around.

This is sadly not an appropriate use of the trac ticketing system :(

Last edited 7 weeks ago by PhotoMan (previous) (diff)

#8 @knutsp
7 weeks ago

@PhotoMan Your Site URL uses http or https? It's not enough to just access the site via https.

The real issue here may be that you can't edit the main site URL from /wp-admin/network/site-info.php?id=1 so if originally installed as http it can't be secured without manipulating the db. I have no idea why, or if there is a ticket to fix that.

But when the above is correct, I can not confirm such issue as ticket describes.

Note: See TracTickets for help on using tickets.