How to generate img secret including webp versions
-
Hello, thank you for the great plugin.
How can I include webp versions in my img srcset?
Today I commonly use for example
$thumbnail_id = get_post_thumbnail_id();
$image_srcset = wp_get_attachment_image_srcset( $thumbnail_id );
but here the webp versions are not included.
Also the wp_get_attachment_metadata($thumbnail_id) is not sensitive for webp image versions. the array holds only the jpgs
Many thanks for your help.
-
ah, sorry, here you go:
` wp-core version: 6.4.3
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: undefined
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 1
dotorg_communication: true wp-paths-sizes wordpress_path: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress
wordpress_size: 127.76 MB (133963610 bytes)
uploads_path: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress/wp-content/uploads
uploads_size: 3.39 MB (3554363 bytes)
themes_path: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress/wp-content/themes
themes_size: 12.23 MB (12828879 bytes)
plugins_path: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress/wp-content/plugins
plugins_size: 1.15 MB (1207124 bytes)
database_size: 1.09 MB (1146880 bytes)
total_size: 145.63 MB (152700856 bytes) wp-active-theme name: BlankSlate (blankslate)
version: 2024.1
author: Bryan Hadaway
author_website: https://opencollective.com/blankslate#section-contributors
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, title-tag, post-thumbnails, responsive-embeds, automatic-feed-links, html5, woocommerce, menus, widgets
theme_path: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress/wp-content/themes/blankslate
auto_update: Disabled wp-themes-inactive (3) Twenty Twenty-Four: version: 1.0, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Three: version: 1.3, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Two: version: 1.6, author: the WordPress team, Auto-updates disabled wp-mu-plugins (1) Health Check Troubleshooting Mode: author: (undefined), version: 1.9.1 wp-plugins-active (2) Health Check & Troubleshooting: version: 1.7.0, author: The www.ads-software.com community, Auto-updates disabled
WebP Uploads: version: 1.0.5, author: WordPress Performance Team, Auto-updates disabled wp-plugins-inactive (2) Akismet Anti-spam: Spam Protection: version: 5.3.1, author: Automattic - Anti-spam Team, Auto-updates disabled
Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled wp-media image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1690
imagemagick_version: ImageMagick 6.9.10-68 Q16 x86_64 2021-10-13 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 128M
upload_max_filesize: 128M
max_effective_size: 128 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 78 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 49152
imagick::RESOURCETYPE_MAP: 78 GB
imagick::RESOURCETYPE_MEMORY: 39 GB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.25 wp-server server_architecture: Linux 4.18.0-477.13.1.lve.el7h.x86_64 x86_64
httpd_software: Apache
php_version: 8.2.6 64bit
php_sapi: fpm-fcgi
max_input_variables: 8192
time_limit: 900
memory_limit: 512M
max_input_time: 900
upload_max_filesize: 128M
php_post_max_size: 128M
curl_version: 7.29.0 NSS/3.53.1
suhosin: false
imagick_availability: true
pretty_permalinks: true
current: 2024-03-15T16:56:23+00:00
utc-time: Friday, 15-Mar-24 16:56:23 UTC
server-time: 2024-03-15T16:56:21+00:00 wp-database extension: mysqli
server_version: 5.7.41
client_version: mysqlnd 8.2.6
max_allowed_packet: 67108864
max_connections: 500 wp-constants WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress/wp-content
WP_PLUGIN_DIR: /var/www/vhosts/h44633.web157.dogado.net/httpdocs/wordpress/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 512M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined wp-filesystem wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable@jtiebel Thanks for sharing the information. It’s possible that there may be something in your setup or code. I have replicated the same setup (theme and plugin) here:?https://testwebp.s2-tastewp.com/webp-image/. WebP images work for both cases.
Could you please share a video recording showing how you coded the template file and the directory in which the images are stored? Additionally, could I ask you to share the “Media Settings” for images located at Settings > Media Settings? This would help us identify any discrepancies.
Hi Adam
first of all thank you for your great support and the effort you put into it to help me fix this issue.
To be honest, this is the “black accident” that it works on your side. ?? On the other hand, there is hope that the error can be fixed. ??
I have absolutely no idea how to proceed. I have now tried it on two different servers/hosting platforms. I always get the same result/error. It’s kind of strange.Do you see any errors/ potential conflicts or what ever in the report? And/ or do you have any tips for me on how best to proceed in order to find the error?
Many thanks. Jakob
PS: I save the images by default, as wordpress does, in the common folder structure with months and years.
In the test I sent you on Friday, I didn’t change anything in the _blank theme. I installed the wordpress with one click via the webhosting panel, activated the plugin via the wp admin panel and then installed the snippets I sent.@jtiebel You are very welcome for the support. If you could share the information that I requested above then this could help us to potentially see where the issue may be for you.
Currently I don’t see anything standing out but the information above may help us to spot something.
Hi Adam
Please find attached a step by step guide, reproducing 100% how I install and configure wp and how I create the example.
https://test.h44633.web157.dogado.net/webP/wp-content/uploads/stepguide-webP.pdf
Hope you can find what I am doing wrong.
Many thanks in advance! Jakob
Yes, I encounter the same here: https://uglyarch.s1-tastewp.com/sample-page/
I followed exactly the seps already described in the pdf.
- This reply was modified 7 months, 1 week ago by Scardelant.
I’ve replicated the issue, and it seems that the multi mime type is not supported in those functions. Please refer to the following open tickets for ongoing discussions:
There’s still a desire to make the ‘Generate JPEG files in addition to WebP’ option workable from Settings > Media, then it should return WebP images for that function.
An additional comment has been added to issue?#155. Thanks for raising this and please feel free to follow the issues for further updates.
Hello Adam
Thank you very much. As unfortunate as it is that it doesn’t work optimally, I’m delighted that the error has now been found.
It’s so sad, because I think the plugin is totally brilliant. It does exactly what it should, no more and no less. Just as I expect from a good and lean plugin.
Please let me ask a few more questions about this:
- Is there a workaround to get the webP images at least temporarily out of a featured_image post loop? What other function can I use to achieve what I want?
- You also tried to reproduce the error on your site yesterday. To my astonishment, it worked! Can you tell me how you did that?
Please excuse me if I’ve been a bit long-winded here and there. I’ve been working on this issue on the side and had lost my nerve a bit in the meantime… ;-/ Sorry for that! I’m a miserable end user who just expects things to work. Shame on me! ?? Hahaha@jtiebel No problem at all and thanks for your continued patience throughout this process. Unfortunately at this time there isn’t a workaround I can suggest to you. With regards to your second question, this was likely due to the fact that we were still troubleshooting and gathering the facts so there may have been some steps that were missed when testing.
As mentioned above, we are aware of these and you can follow any updates on the issues linked above.
Is there anything else I can help you with?
hmm, very sad. Any recommendations for an alternative plugin that I can use until this is fixed? I saw the conversation about the issue startet in mid ’22. My gut feeling tells me that this won’t be solved in a few weeks, will it?
@jtiebel Unfortunately I can’t recommend other plugins to you. I am unable to give a time frame on when these issues may be resolved but please do feel free to follow for updates.
fair. let’s see, what future brings..
@adamdunnage sorry, please allow me one more question. Does this actually mean that WordPress in general is not yet able to handle the delivery of WebP images in its basic functions? Which means that other plugins also don’t work or only work partially?
Or is it a specific problem with how your plugin interacts with the basic functions of WordPress? This is not totally clear to me and has impact on how to further act in my projects…
If the former is the case, then I wouldn’t need to worry about alternatives for the time being if the problem is rotting in the core of WordPress and not on the plugin side…
@jtiebel No problem. This is specific to this plugin and not WordPress in general. I hope that helps and please let me know if there’s anything else I can help with.
- The topic ‘How to generate img secret including webp versions’ is closed to new replies.