webp-sh / wordpress-plugin-webp-cloud

Wordpress plugin for WebP Cloud(WebP Cloud Services)
1 stars 0 forks source link

Featured Images links have not been updated #1

Open duetg opened 11 months ago

duetg commented 11 months ago

Hi, I found it used 'the_content' in the code. That can not update links in featured image which use the \<figure> tag outside the content.

n0vad3v commented 7 months ago

Apologies for the delayed response due to an oversight on our part. We're now actively addressing the issue you raised. Thank you for your patience.

In our demo Wordpress site, https://wordpress.webp.se/fk7-running-shanghai-tianma/ our featured image is using post-thumbnail class, could you please provide an example of your case that we could address it precisely?

duetg commented 7 months ago

The theme is the Twenty Twenty-Four and was Twenty Twenty-Three before. They can be modified by the block-editor. There are many kinds of blocks could be added to the page and the featured image which I mentioned is one of them. So that kind of featured image is not a part of post. It is using wp-block-post-featured-image class, and the sector of the image is also not in the_content (<main>), it is independent which using <figure> tag. It is like this: <figure class="wp-block-post-featured-image"><img ...></figure> Twenty Twenty-Four is the stock theme which is shipped with wordpress code. For this reason I think it is better that the plugin should be compatible with it. Thanks.

n0vad3v commented 7 months ago

Thanks for update, we'll look into this more.

Recently we've found a workaround for this that works even better than our plugin at the moment, by utilizing a famous plugin called WP Super Cache, the plugin contains another plugin called OSSDL CDN off-linker. (However that plugin itself seems not working in our dev environment).

OSSDL CDN off-linker has been integrated into WP Super Cache to provide basic CDN support.

Workaround is as below, suppose you:

  1. Have WP Super Cache installed and enabled
  2. Your site URL is https://duetg.com/
  3. Your images URL is https://duetg.com/wp-content/uploads/2023/10/teams-access-newway-diagram-1024x495.jpg, this should be the same as your site URL if your images are inserted using Wordpress's Media library
  4. Your Proxy Address on WebP Cloud Services is https://abc.webp.ee

Then you can configure WP Super Cache plugin as below:

  1. Site URL: https://duetg.com
  2. Off-site URL: https://abc.webp.ee
  3. Include directories: wp-content/uploads
  4. Exclude if substring: .php,.css,.js

Screenshot 2024-02-10 at 14-17-30 WP Super Cache ‹ WebP Cloud Services Wordpress Demo — WordPress

Please pay special attention to Include directories and Exclude if substring part, to make sure only images URL under wp-content/uploads are changed to WebP Cloud Services

In the configuration above, all images in posts and featured image will be changed accordingly, example site(with twentytwentythree theme):

  1. https://wordpress.webp.se/fk7-running-shanghai-tianma/
  2. https://wordpress.webp.se/