• Resolved stefanfletcher

    (@stefanfletcher)


    Hi there,
    on my 2 wordpress pages the plugin doesnt show the webP images.
    In the folder “uploads-webpc” the images are contained.
    I dont use CDN.

    Thanks vor helping ??

    link to server configuration and list of plugins:
    https://drive.google.com/drive/folders/1cBMaBuNzxXzAlmEPOxIFFzEg3UNUt65m?usp=sharing

    .htacess:

    # BEGIN WebP Converter
    # ! — DO NOT EDIT PREVIOUS LINE — !
    <IfModule mod_mime.c>
    AddType image/webp .webp
    </IfModule>
    <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>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/webp “access plus 1 year”
    </IfModule>
    # ! — DO NOT EDIT NEXT LINE — !
    # END WebP Converter

    # BEGIN WebP Express
    # Die Anweisungen (Zeilen) zwischen BEGIN WebP Express und END WebP Express sind
    # dynamisch generiert und sollten nur über WordPress-Filter ge?ndert werden.
    # Alle ?nderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
    # Plugin is deactivated
    # END WebP Express

    The page I need help with: [log in to see the link]

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

    (@mateuszgbiorczyk)

    Hi @stefanfletcher,

    Thank you for your message. Will I try to help you?

    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

    Create a file please 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.

    Hi,

    I just installed your plugin and have the same problem.

    It converted all the images successfully and still does serve the original formats. I checked it in the dev console of Chrome as described in your FAQ.

    Now I followed your above steps to debug and if I enter the following URLs for the red image I get the green one:
    https://ai-power-seo.com/wp-content/directory-red/example.png
    https://ai-power-seo.com/wp-content/directory-red/example.png2

    What could be the issue here?

    Cheers,
    Sascha

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @fjordkommission, thank you very much for your cooperation.

    Can I ask you to contact me via email? My e-mail is mateusz[_at_]gbiorczyk[_dot_]pl. Unfortunately, in this case, without access to your site, to FTP, I am not able to help.

    Hi @mateuszgbiorczyk,

    thank you for your quick reply. Unfortunately, I am not allowed to grant administrator access to this site, as this is not my own.

    Can you guide me to do some other testing for you?

    I noticed, though, that the .htaccess file of the plugin is located in the folder /wp-content/uploads/

    Could this have something to do with the problem?

    Cheers,
    Sascha

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    The .htaccess file should be there. This is the right place. Can you try disabling other plugins and test it again?

    I cannot do that on the live site.

    I will set up a test environment tomorrow and get back to you when it’s ready to take a look at, OK?

    Cheers,
    Sascha

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @fjordkommission – yes, it’s the best solution.

    Hi @mateuszgbiorczyk

    I just set up a test environment with a copy of the website minus the pages and posts. Other than that everything is identical.

    Also here, the conversion does not work.

    I have added you as administrator, you should have gotten an e-mail by now with your credentials.

    Cheers,
    Sascha

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @fjordkommission, Thank you so much for your help.

    It turned out that the redirections worked, but your server did not support the MIME type image/webp. Therefore, in Dev Tools it was not visible that the webp type was loaded, only the default ones were still in use.

    I made changes to the plugin and released an update that fixes this error. Now everything is working.

    Please remember, however, that the plugin converts images from the media library. You load a lot of different images on your site that we don’t have access to because they are not a post in the media library.

    Can I help you somehow?

    Hi @mateuszgbiorczyk,

    thank you for your assistance. I see that you already installed version 1.2.2 on my testserver, and I updated the plugin on the live server as well.

    EDIT: My mistake. The images I claimed not working came from that other directory you mentioned. They are part of a template in Thrive Architect. So I created a test page with images from the media library, and now it works as expected.

    THANK YOU! YOU ROCK! ??

    Cheers,
    Sascha

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @fjordkommission, please turn the plugin off and on again. So that .htaccess files can be regenerated. Can you send the contents of .htaccess files from directories /uploads and /uploads-webp?

    Of course. Here they are:

    Directory “/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

    Directory “/uploads-webpc” (yes, with a “c”)

    # 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

    Cheers,
    Sascha

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @fjordkommission, so everything works?

    Yes, in the sense that the plugin converts images from the media library as described.

    It’s just too bad that Thrive Architect templates obviously store their images somewhere else. I will have to check if I can replace those by images from the media library.

    Thank you once again for you effort and support!

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    I am very pleased. If you feel like it, you can add a review. Thank you in advance!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘no webp images loaded on site’ is closed to new replies.