Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 796 forks source link

Tiled Galleries: automatically transform gallery shortcode with type parameter into Tiled Gallery block #12903

Open ghost opened 5 years ago

ghost commented 5 years ago

Updated issue description based on discussion below

Steps to reproduce

  1. Add a new post
  2. In that post, add a new classic block.
  3. In that classic block, add a gallery, and pick a tiled gallery type for that gallery.
  4. Publish your post.
  5. Come back to it in the editor, and choose the option to "convert to blocks".
  6. You would expect the gallery to be transformed into a Gallery block when this one is available, but that does not seem to work; the gallery is transformed into a standard Gallery block.

Original description below


Tiled Gallery does not work when using the block editor unless Photon is enabled.

However, this is not a requirement when using the classic editor. Working functions should be left as they are especially since they cause no adverse effect on the other changes in Jetpack .

Working functions should be left as they are especially since they cause no adverse effect on the other changes in Jetpack.

I would very much like to be able to use the tiled gallery feature when using the block editor as it does in the classic editor. Choosing a CDN should not be a forced option on the user because they want to continue using a feature that has been working without Photon, the CDN being turned on. This is particularly problematic for those of us using other CDNs. Using the Jetpack CDN is indeed quite cumbersome as deleting images or replacing them require special steps.

Continue offering tiled galleries without forcing the CDN being turned on. This will also cause a massive problem when the time comes to discontinue supporting the classic editor. Since the technology exists to make the tiled gallery to work without turning on the global Jetpack CDN it makes eminent sense to do the same for the block editor. Not doing so will result in potentially serious problems when the classic editor is discontinued if a post with a tiled gallery needs to be edited. The result will be a broken post, guaranteed, or forced use of the Jetpack CDN whether the user wants it or not.

Users who need a CDN may choose the Jetpack Photon but may also choose another one. This choice should not break their sites.

jeherve commented 5 years ago

I am afraid that's not an option right now. Jetpack's Tiled Galleries rely on our image CDN, regardless of the version of Jetpack you use or the editor you use to create those galleries.

Whether you use the Classic Editor or the Block editor, Jetpack's Tiled Galleries rely on Jetpack's Image CDN to resize images on the fly and create the tiled effect.

If you were to use tiled galleries without that CDN, you would have to load full-size images for each image in your gallery, and then resize those images with CSS. This could potentially be bad for your site's performance since those full-size images may be quite big, and it may also have an impact on your images's look since resizing via CSS is done by the browser and may vary from browser to browser.

Since the technology exists to make the tiled gallery to work without turning on the global Jetpack CDN

Could you give me more details about this? How do you currently use Jetpack's Tiled Galleries without Jetpack's Image CDN? Could you maybe post a link to a post using such a gallery?

Thank you!

ghost commented 5 years ago

Take a look at the following post:

https://www.keptlight.com/let-the-garden-talk/

You will recognize the tiled gallery presentation. On this site, I do not have Photon turned on globally. Several years ago, I was told that tiled galleries will use Photon whether it is activated on a site-wide basis or not. And the practice proved that. Tiled gallery images are served from your CDN and the rest of my images are served from my site and CloudFlare. All I am asking for is the same treatment of tiled galleries when I use the block editor. But, if I edit this or other similar posts in block editor the tiled gallery is broken even if I do not touch it. This is why I think it will be a major problem if and when the classic editor is discontinued. Any edit of these posts in the block editor will break the tiled galleries that may be inserted even if the edit is for fixing a typo.

I am not sure why I am having so much difficulty explaining myself, maybe my age is catching up with me. In summary:

Thank you,

simison commented 5 years ago

I'd love to see this happen as well and I think there might be ways to implement it, but it needs some investigation.

jeherve commented 5 years ago

When using the classic editor it is possible to insert and use tiled galleries without activating Photon site-wide When such a post is edited in the block editor without activating Photon on a site-wide basis the tiled gallery breaks

Could you tell me more about this? When you edit such a post, do you convert the classic block that includes the gallery into a Tiled Gallery block? What kinds of edits do you make on that post?

ghost commented 5 years ago

Yes, I convert the post to blocks and the Tiled Gallery becomes a regular gallery. It does not matter what kind of edits I make, the Tiled Gallery is gone as soon as the post is converted to blocks.

jeherve commented 5 years ago

Thank you! This seems to be the real issue here: you would expect the block editor to transform your old Tiled Gallery into a Tiled Gallery block, but it fails to do that. That is not an issue with Photon.

This issue is also tracked here: https://github.com/WordPress/gutenberg/issues/15134

Sounds to me like Jetpack needs to provide a custom block transform to make this work. Gutenberg itself cannot know what Jetpack does with the gallery, so it's the plugin's the responsibility to provide that info IMHO.

jeherve commented 5 years ago

Related: #11779

ghost commented 5 years ago

Thanks for the updates and identifying the real problem I tried to explain from the user end. Looking forward to a fix. I have also read the other threads, thank you.

jeherve commented 5 years ago

Thank you for reporting this!

tmksr commented 5 years ago

For me the problem is, that i have about 1000 posts where i mostly used tiled galleries since they are available. I never activated photon (it never worked for me without trouble). Right now i deactivated the Jetpack plugin, and after activating it again i am forced to use Photon for my entire site or any of my tiled galleries brake. They appear as medium sized images below each other! I don't want to use photon, but doing not so will brake my site - just add the function again of using tiled galleries without photon. it worked well for years! The most annoying part of the story is: when using photon my images will be delivered in less sharp version (5K Retina Display) to the jetpack carousel as the original file. and are you serious about this "currently the images are cached forever" … ?!

jeherve commented 5 years ago

just add the function again of using tiled galleries without photon. it worked well for years!

To clarify, Tiled Galleries have always used Photon, whether the Photon feature was on or off. In all the posts where you inserted Tiled Galleries, the gallery images have always been served by Photon. If you did not notice it before, it means that Photon was working well for all gallery images on your site.

This was confusing for a lot of people (indeed, one would not expect to see Photon in use on the site when they deactivated the Photon feature), so back in 2016 we updated the main Jetpack dashboard page to keep only one toggle, that would turn on both Photon and Tiled Galleries at the same time.

Since you would prefer to have only your gallery images use Photon on your site, and other images would be served locally, I would recommend that you go to this page in your dashboard, and enable Tiled Galleries while leaving the Image CDN feature off: https://yoursite.com/wp-admin/admin.php?page=jetpack_modules

The most annoying part of the story is: when using photon my images will be delivered in less sharp version (5K Retina Display) to the jetpack carousel as the original file.

Unless you've manually disabled Jetpack's devicepx feature with a code snippet (that feature is enabled by default when you activate Jetpack on your site), Jetpack should automatically serve larger images on Retina / HIDPi devices, so this should not happen. If it does, could you contact our support team with some examples of pages where we can see the issue?

Thank you!

are you serious about this "currently the images are cached forever"

Yes. If you'd like to update an image in one of your posts, I would recommend uploading a new image to your Media Library.

HammyHavoc commented 3 months ago

Absurd that this lock-in is a thing. Huge website with a lot of use of Jetpack's tiled image gallery, but disabling the CDN thus breaks it. I don't see why the image gallery rewrites URLs to https://i0.wp.com/www.mydomain.com/wp-content, surely the logical thing would be a toggle to just allow the image to be local? We already generate images at various sizes for thumbnails of "Featured Images" of posts.

This just strikes me as a way to strong-arm users into sticking with Jetpack, and potentially subscribing. Already have a CDN, we don't need a second one, and any potential service we might like, such as VaultPress, this puts me right off.

jeherve commented 3 months ago

@HammyHavoc I see you've also created #36707. I'll reply to your questions there, since they are not related to this specific issue.