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

Preview Image does not use HTTPS #4911

Closed
cihanandac opened this issue Jun 23, 2023 · 6 comments
Closed

Preview Image does not use HTTPS #4911

cihanandac opened this issue Jun 23, 2023 · 6 comments

Comments

@cihanandac
Copy link

Describe the bug
While testing the website I am working on with PageSpeed Insights, I realized that the pages that use preview images are getting this warning: "Does not use HTTPS". It is dropping the score for the 'Best Practices'. If the page doesn't have a preview image shown on it, then it does not have this issue.

Link for the webpage: https://rietveldschroderhuis.intk.com/nl/over/centraal-museum-rietveld
Link for the PageSpeed test: https://pagespeed.web.dev/analysis/https-rietveldschroderhuis-intk-com-nl-over-centraal-museum-rietveld/l1bq5otzia?form_factor=desktop

Link to repo (line 72) : https://github.com/cihanandac/new-RietveldSchroderhuisWebsite/blob/main/frontend/src/components/theme/Header/HeroSection.jsx

The preview image is called with the following code:

<Image
  image={content.preview_image}
  width="100vw"
  height="90vh"
/>

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://pagespeed.web.dev
  2. Write the link to the URL section -> https://rietveldschroderhuis.intk.com/nl/over/centraal-museum-rietveld
  3. Click on -> Analyze
  4. Scroll down to 'Best Practices' section
  5. See error 'Does not use HTTPS'

Expected behavior
Doesn't have "Does not use HTTPS" warning and has a better score in best practices.

Screenshots
Screenshot 2023-06-23 at 13 45 19

Screenshot 2023-06-23 at 13 56 44

Software (please complete the following information):

  • Volto Version: 16.20.8
  • Plone Version: 6.0.5
  • Plone REST API Version: 8.39.1
@manoharkumarsingh
Copy link

@cihanandac If the page doesn't have a preview image then you shouldn't render . I hope this will help you to fix issue

@cihanandac
Copy link
Author

Thanks, @manoharkumarsingh. Didn't help to solve it, but I understand your point.

@avoinea
Copy link
Sponsor Member

avoinea commented Jun 23, 2023

@cihanandac You should always use flattenToAppURL. See Image Block for example.

@cihanandac
Copy link
Author

Thanks for the tip @avoinea. This component is also using Image Block, thus it is utilizing flattenToAppURL. Please correct me if I am missing something here but I believe the issue is about something else.

@cihanandac
Copy link
Author

Thank you so much again @avoinea. Looks like you are right. I don't even know how I missed this one 🤦 .

nzambello added a commit to intk/bonnefanten that referenced this issue Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants