Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @morgunovvit,

    Thank you for your message.

    Tell me please, what exactly do you mean? Smush has many functions. It is best if you check it yourself and in case of any problems let you know.

    I recommend using the FAQ. There you will find a lot of valuable information.

    Thread Starter MorgunovVit

    (@morgunovvit)

    I’ve just noticed, that eventhough I’ve generated the WebP images. In consoe log in the Network tab I can see the jpeg images unloaded and content-type: image/jpeg. Also in page speed insights test I see recomendation – use modern image formats. It seems that webp images doesn’t load. ( https://maketburg.ru/ )

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    I need a few things from you. Please send me content of your .htaccess files from directories /wp-content/uploads and /wp-content/uploads-webpc (pasting the code using the CODE shortcode in the editor).

    Could you test something for me?

    Please create two types of image files – one with a red background and the other with a green one (so that we can see the difference). Please upload them to the following paths (create two new directories):
    – red /wp-content/directory-red/example.png2 (change the extension to .png2 – I know it is invalid)
    – duplicated red /wp-content/directory-red/example.png
    – green /wp-content/directory-green/example.png2 (change the extension to .png2 – I know it is invalid)
    – duplicated green /wp-content/directory-green/example.png

    Then please create a file in the path /wp-content/.htaccess:

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_ACCEPT} image/webp
      RewriteCond %{DOCUMENT_ROOT}/wp-content/directory-green/$1 -f
      RewriteRule directory-red/(.+)$ directory-green/$1 [T=image/webp]
    </IfModule>

    The .htaccess file in the WP installation directory should be empty (clean it temporarily). The .htaccess file in the /wp-content/ directory should contains only the rules listed above.

    Go to the following file URLs (add a prefix with your domain):
    /wp-content/directory-red/000-example.png
    /wp-content/directory-red/000-example.png2

    Test it on a Chrome browser. Tell me please, what color do you see on both URLs? Please provide me with URLs for these files.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Thanks for assistance!
    Here .htaccess files from /wp-content/uploads:

    # BEGIN WebP Converter
    # ! --- DO NOT EDIT PREVIOUS LINE --- !
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_ACCEPT} image/webp
      RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.jpg.webp -f
      RewriteRule (.+)\.jpg$ /wp-content/uploads-webpc/$1.jpg.webp [T=image/webp]
      RewriteCond %{HTTP_ACCEPT} image/webp
      RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.jpeg.webp -f
      RewriteRule (.+)\.jpeg$ /wp-content/uploads-webpc/$1.jpeg.webp [T=image/webp]
      RewriteCond %{HTTP_ACCEPT} image/webp
      RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.png.webp -f
      RewriteRule (.+)\.png$ /wp-content/uploads-webpc/$1.png.webp [T=image/webp]
    </IfModule>
    # ! --- DO NOT EDIT NEXT LINE --- !
    # END WebP Converter

    Here from /wp-content/uploads-webpc:

    # BEGIN WebP Converter
    # ! --- DO NOT EDIT PREVIOUS LINE --- !
    <IfModule mod_mime.c>
      AddType image/webp .webp
    </IfModule>
    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType image/webp "access plus 1 year"
    </IfModule>
    # ! --- DO NOT EDIT NEXT LINE --- !
    # END WebP Converter

    And I’ll send you a test result later.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Thank you so much for your help.

    It looks like your server interprets .jpg and .png files in its own way. This test shows the differences in how the server handles .png and .png2 files. The redirections in the .htaccess file you added are the same for both the .jpg file and the .jpg2 file.

    The .png2 extension is invalid, so the server does not understand it. The .png extension is valid and the server reads this as an image. I suspect you have some additional settings that affect server operation.

    Please try the same test again, but now add the following rules to the /wp-content/.htaccess file:

    `<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{DOCUMENT_ROOT}/wp-content/directory-green/$1 -f
    RewriteRule directory-red/(.+)$ directory-green/$1 [T=image/webp,E=cache-control:private,L]
    </IfModule>

    Thread Starter MorgunovVit

    (@morgunovvit)

    So I ‘ve replaced the /wp-content/.htaccess file with this code:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{DOCUMENT_ROOT}/wp-content/directory-green/$1 -f
    RewriteRule directory-red/(.+)$ directory-green/$1 [T=image/webp,E=cache-control:private,L]
    </IfModule>

    And I’ve get the same result:
    – /wp-content/directory-red/000-example.png
    – /wp-content/directory-red/000-example.png2
    occurs the 404 error.
    – /wp-content/directory-red/example.png – green
    – /wp-content/directory-red/example.png2 – red

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Can you contact your server’s Administrator and ask why redirections for the .png2 file work and not for the .png file?

    As for 404 errors, I gave the wrong path. Sorry. The prefix 000- is not needed.

    Thread Starter MorgunovVit

    (@morgunovvit)

    I’ve met this problem in my second site also. But the second site on the other hosting provider server. Are you shure, that the problem in server options? There’s no error in .htaccess code?

    Thread Starter MorgunovVit

    (@morgunovvit)

    Maybe the reason in [T=image/webp] option? I use simple .png image not .webp

    Thread Starter MorgunovVit

    (@morgunovvit)

    I received the answer from hosting service:

    This is due to the fact that all statics are processed through nginx, bypassing apache. PNG2 is not included in this rule, but PNG is included, so the .htaccess rule in the second case is simply ignored.

    We can change this behavior for your site, but it will almost immediately increase the load on your account and increase the speed of loading the site.

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Can you find out what exactly the setting causes PNG processing? This is very important to me because several people had a similar problem. Can you get more details for me?

    In my opinion, you can agree to turn it off. By using WebP files your site will load even faster.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Ok. I’ve asked details for You.
    But could you explain to me why do you asking only about .png?
    The plugin precessing jpg as well for webp redirecting

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    I assume the same rules for JPG, GIF and PNG. So they have to enable it for both PNG and GIF and PNG.

    Thread Starter MorgunovVit

    (@morgunovvit)

    Ok. I’ll send You the answer as I receive it.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Is it compartible with Smush?’ is closed to new replies.