rosell-dk / webp-express

Wordpress plugin for serving autogenerated WebP images instead of jpeg/png to browsers that supports WebP
GNU General Public License v3.0
222 stars 63 forks source link

Old style htaccess does not work anymore #532

Closed utrenkner closed 2 years ago

utrenkner commented 2 years ago

We use the H2O webserver with your great plugin - many thanks for your superb work! A small Ruby-script makes the necessary translations that are performed via the .htaccess file when using Apache. Today the on-demand conversion by WebP Express stopped working, after upgrade to 0.22.

I was able to track down the cause, and I believe it does not apply to us only: The issue is in /lib/classes/WodConfigLoader.php

For us the fallback in Lines 135-152 applies. The last line of code reads: $wpContentDirRelToWEPluginDir = $wpContentDirRelToPluginDir . '/webp-express';

For us $wpContentDirRelToWEPluginDir evaluates to ..//webp-express.

However, in L160 another '/webp-express' is added to the path, making $webExpressContentDirAbs /path/to/my/wordpress/wp-content/plugins/webp-express/..//webp-express/webp-express, which cannot be found.

I will update our little Ruby script to reflect the new .htaccess style as of 0.22. But maybe you want to fix this problem, because it might also affect people using webservers other than Apache?

rosell-dk commented 2 years ago

ahh, whoops! Thanks for notifying me! I will deal with this as soon as I have time (in a couple of hours, I hope)

rosell-dk commented 2 years ago

Fixed and released as 0.22.1

rosell-dk commented 2 years ago

Actually, this bug also caused trouble on some Apache servers. On some systems, updating an .htaccess doesn't take immediate effect. https://wordpress.org/support/topic/error-with-last-update-4/