• Resolved Diosa-UK

    (@venus-hair-brighton)


    Hi there,

    We are running your Cloud version of the plugin and the image optimizations have been fantastic. But we can’t get webp images to be served.

    1. We’ve used your default htaccess code, entering it manually both at the very top or just under the #Begin WordPress rewrites.

    2. The Admin does not show the green webp (stuck on red png).

    3. We’ve confirmed with our VPS hosts that mod_rewrite and mod_Headers are switched on.

    But can I check one thing about how the plugin renames the WebP image files please? After Bulk Optimize we have our images named as follows…

    image1.jpg
    image1.jpg.webp
    etc etc

    Is this correct? Is the htaccess rewrite not looking for an identically named .webp file, but for a .webp file with .jpg appended to the original filename? (that make sense?!)

    ie. the rewrite code provided – is it looking for image1.jpg.webp or image1.webp ?

    Would love to get the WebP functionality running, but have to say extrememly pleased with the savings made already – thank you ??

    https://www.ads-software.com/plugins/ewww-image-optimizer-cloud/

Viewing 15 replies - 1 through 15 (of 31 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    The filenaming is correct. EWWW used to just change the extension, but that had some naming conflict potential, so we changed to appending the .webp extension.

    At any rate, what browser are you testing this with?

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Thanks for the incredibly quick response! ??

    Testing in Chrome – checked via Developer Resources and it’s showing MIMEtype as jpeg’s – example page https://goo.gl/FBJh6Q (all those jpg’s have a .jpg.webp alternative).

    Start of htaccess looks like this…

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    # EWWW WebP Rewrite Rules
    
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    
    # check if browser accepts webp
    RewriteCond %{HTTP_ACCEPT} image/webp
    
    # check if file is jpg or png
    RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png)$
    
    # check if corresponding webp file exists image.png -> image.webp
    RewriteCond %{REQUEST_FILENAME}\.webp -f
    
    # serve up webp instead
    RewriteRule (.+)\.(jpe?g|png)$ %{REQUEST_FILENAME}.webp [T=image/webp,E=accept:1]
    
    </IfModule>
    <IfModule mod_headers.c>
    Header append Vary Accept env=REDIRECT_accept
    </IfModule>
    
    AddType image/webp .webp
    
    # END WebP Rewrite Rules

    The only other Server issue I’m thinking might be causing this is our VPS has NGINX running in front of Apache – though htaccess should still work normally (I’m told).

    As I said would be nice for this to all work, but there’s so many possible variables with our server/htaccess etc., that if it doesn’t, it’s not a massive loss and ‘so be it’! ??

    ps. another thing I thought might affect this is that our WordPress is in a /sub-folder/ but runs as if from root – would this change the htaccess settings I need?

    Plugin Author nosilver4u

    (@nosilver4u)

    It’s hard to say what will happen if you have nginx in front of your server, but unless nginx is passing the Accept header to apache, you may need to use the Alt WebP Rewriting.

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Thank you – I might try that approach then instead.

    Could you point me in the right direction for where I can find the “Alt WebP” rewriting?

    Cheers.

    Plugin Author nosilver4u

    (@nosilver4u)

    It’s on the Conversion tab, right next to the WebP conversion option. Make sure you take the EWWW IO .htaccess rules out (although it doesn’t seem they are doing anything anyway).

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Missed that! Would have been real embarrassing had it worked lol

    Unfortunately switching the Alternative WebP Rewriting, removing the htaccess stuff and clearing my APC cache, just gives me a white screen on the website. Server error logs say…

    [Mon Jun 08 16:12:33 2015] [error] [client 81.141.25.5] PHP Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /var/www/vhosts/venushairdesign.co.uk/httpdocs/brighton_/wp-content/plugins/ewww-image-optimizer-cloud/common.php on line 295, referer: https://www.venushairdesign.co.uk/

    …so it’s switched back off again ??

    Plugin Author nosilver4u

    (@nosilver4u)

    The (optional) parameter for saveHTML() was added in PHP 5.3.6. I would strongly recommend seeing if you can get your PHP version upgraded, check with your webhost on how to do that.

    Plugin Author nosilver4u

    (@nosilver4u)

    I went back and looked at why I had the parameter there, and it seems it was an attempt to fix some encoding issues (pretty sure it did not work). I’ll remove it for the next release and see if that helps.

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Thanks for all your help…

    Our VPS server is getting its hosting panel upgraded tomorrow to include PHP 5.4, so once that’s done I’ll also move EWWW Cloud from v2.4.2 to v2.4.3 (which is just showing as now available), and try again with the Alt WebP.

    Cheers ??

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Todays Update:
    Server now running PHP 5.5.6 and I’ve updated EWWW to 2.4.3, but when I enable Alt WebP it still doesn’t serve up any webp images ??

    I also have a character problem scattered seemingly at random around the site which breaks some of the formatting (a?3 instead of “, ? where a &nbsp should be etc).

    Giving up on WebP for now – still extremely happy with the plugin though (review left) ??

    Plugin Author nosilver4u

    (@nosilver4u)

    I’ve got a potential fix in ‘dev’ for the webp problem. Can you give it a try?

    Download it from here:
    https://downloads.www.ads-software.com/plugin/ewww-image-optimizer-cloud.zip

    There’s only one or two changes, so it won’t break anything. At the very least, you’ll just have to disable the Alt WebP again. Make sure you’re using chrome, and that the images you’re checking actually have webp alternatives on your server.

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Installed v2.4.3.1… cache’s cleared etc, but still have the character issue and still no webp’s being served – sorry! (double-checked all have webp alternatives – thanks to the plugin virtually everything does).

    Plugin Author nosilver4u

    (@nosilver4u)

    Ok, good to know, now there are two other things we can try that I already have in the common.php file.

    1. On line 184, it will look something like this:

    // $buffer = mb_convert_encoding( $buffer....

    Remove the two slashes at the front, and see if that fixes the character issue.

    2. If that doesn’t do it, put the slashes back, and there is another function two lines above that like this:

    // $buffer = utf8_decode...

    Same with that, remove the two slashes, and try that out.

    Thread Starter Diosa-UK

    (@venus-hair-brighton)

    Removing // on line 184 – $buffer = mb_convert_encoding( $buffer, ‘HTML-ENTITIES’, ‘UTF-8’ ); – worked with the character issues. Still have a few broken line-breaks in our theme (X Theme), but nothing too major to fix easily.

    WebP still the same ??

    Plugin Author nosilver4u

    (@nosilver4u)

    Hmm, there’s a /brighton_/ in the image urls, seems like WP is installed in a sub-directory, but running at the site root. Does that sound correct?

    Or perhaps you just moved the wp-content folder?

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘WebP Problems’ is closed to new replies.