Plugin Directory

Changeset 3439201


Ignore:
Timestamp:
01/14/2026 06:51:37 AM (5 weeks ago)
Author:
rosell.dk
Message:

0.25.14

Location:
webp-express
Files:
2 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • webp-express/tags/0.25.14/README.md

    r3425690 r3439201  
    727727I generally create a pre-release before publishing. If you [follow me on ko-fi](https://ko-fi.com/rosell), you will get notified when a pre-release is available. I generally create a pre-release on fridays and mark it as stable on mondays. In order to download a pre-release, go to [the advanced page](https://wordpress.org/plugins/webp-express/advanced/) and scroll down to "Please select a specific version to download". I don't name the pre-releases different. You will just see the next version here before it is available the usual way.
    728728
    729 ## Changes in 0.21.1
    730 *(released: 27 Oct 2021)*
    731 * Bugfix: File manager could not handle many images. It now loads tree branches on need basis instead of the complete tree in one go
    732 * Bugfix: For mulisite, the redirect after settings save was not working (bug introduced in 0.21.0)
    733 
    734 For more info, see the closed issues on the [webp-express 0.21.1 milestone](https://github.com/rosell-dk/webp-express/milestone/42?closed=1)
    735 
    736 ## Changes in 0.21.0
    737 *(released: 25 Oct 2021)*
    738 * Added image browser (in Media tab)
    739 * Updated webp convert library to 2.7.0.
    740 * ImageMagick now supports the "near-lossless" option (provided Imagick >= 7.0.10-54)
    741 * Added "try-common-system-paths" option for ImageMagick (default: true). Thanks to Henrik Alves for adding this option.
    742 * Bugfix: Handling Uncaught Fatal Exception during .htaccess read failure. Thanks to Manuel D'Orso from Italy for the fix.
    743 * Bugfix: File names which were not UTF8 caused trouble in the Bulk Convert. Thank to "mills4078" for the fix
    744 * Bugfix: Redirection back to settings after saving settings failed on some systems. Thanks to Martin Rehberger (@kingkero) from Germany for the fix.
    745 * Bugfix: Webp urls did not contain port number (only relevant when the website was not on default port number). Thanks to Nicolas LIENART (@nicolnt) from France for providing the fix.
    746 
    747 For more info, see the closed issues on the [webp-express 0.21.0 milestone](https://github.com/rosell-dk/webp-express/milestone/41?closed=1) and the
    748 [webp-convert 2.7.0 milestone](https://github.com/rosell-dk/webp-convert/milestone/24?closed=1)
    749 
    750 
    751 ## Changes in 0.20.1
    752 *(released: 20 Jun 2021)*
    753 * Bugfix: Removed composer.lock. It was locked on PHP 7.2, which caused server error on some sites.
    754 
    755 ## Changes in 0.20.0
    756 *(released: 17 Jun 2021)*
    757 * Added WP CLI support. Add "wp webp-express convert" to crontab for nightly conversions of new images! Thanks to Isuru Sampath Ratnayake from Sri Lanka for initializing this.
    758 * Added "sharp-yuv" (not as option, but as always on). Better YUV->RGB color conversion at almost no price. [Read more here](https://www.ctrl.blog/entry/webp-sharp-yuv.html). Supported by cwebp, vips, gmagick, graphicsmagick, imagick and imagemagick
    759 * Bumped cwebp binaries to 1.2.0
    760 * cwebp now only validates hash of supplied precompiled binaries when necessary. This cuts down conversion time.
    761 * Convert on upload now defaults to false, as it may impact upload experience in themes with many formats.
    762 * bugfix: Alpha quality was saved incorrectly for PNG. Thanks to Chriss Gibbs from the UK for finding and fixing this.
    763 * bugfix: wp-debug log could be flooded with "Undefined index: HTTP_ACCEPT". Thanks to @markusreis for finding and fixing this.
    764 
    765 ## Changes in 0.19.0
    766 *(released: 13 Nov 2020)*
    767 * New convertion method: ffmpeg
    768 * Fixed problem in Bulk Convert when files had special characters in their filename
    769 * Prevented problems if the plugin gets included twice (can anybody enlighten me on how this might happen?)
    770 
    771 For more info, see the closed issues on the [0.19.0 milestone on the github repository](https://github.com/rosell-dk/webp-express/milestone/36?closed=1)
    772 
    773 ## Changes in 0.18.3
    774 *(released: 5 Nov 2020)*
    775 * Bugfix: WebP Express uses live tests to determine the capabilities of the server in respect to .htaccess files (using the htaccess-capability-tester library). The results are used for warnings and also for optimizing the rules in the .htaccess files. However, HTTP Requests can fail due to other reasons than the feature not working (ie timeout). Such failures should lead to an indeterminate result, but it was interpreted as if the feature was not working.
    776 * The Live test now displays a bit more information if the HTTP request failed.
    777 * Changed default value for "destination structure" to "Image roots", as "Document root" doesn't work on hosts that have defined DOCUMENT_ROOT in an unusual way.
    778 * Added possibility to change "%{DOCUMENT_ROOT}" part of RewriteCond by adding a line to wp-config.php. THIS IS A BETA FEATURE AND MIGHT BE REVOKED IF NOBODY ACTUALLY NEEDS IT.
    779 * Got rid of PHP notice Constant WEBPEXPRESS_MIGRATION_VERSION already defined
    780 * Fixed donation link. It now points to https://ko-fi.com/rosell again
    781 
    782 For more info, see the closed issues on the 0.18.3 milestone on the github repository: https://github.com/rosell-dk/webp-express/milestone/34?closed=1
    783729
    784730## Supporting WebP Express
     
    789735
    790736
    791 **Persons / Companies currently backing the project via patreon - Thanks!**
    792 
    793 - Max Kreminsky
    794 - Nodeflame
    795 - [Mathieu Gollain-Dupont](https://www.linkedin.com/in/mathieu-gollain-dupont-9938a4a/)
    796 - Ruben Solvang
    797 
    798 **Persons who contributed with coffee within the last 30 days:**
    799 
    800 | Name                   | Date           | Message      |
    801 | ---------------------- | -------------- | ------------ |
    802 | Anon                   | 2020-08-18     | - |
    803 | Eder Ribeiro           | 2020-08-08     | Hello Bjørn I believe that it is a fantastic solution and that it deserves maximum support to keep getting better! If you can, check out my configuration tip, https://github.com/rosell-dk/webp-express/issues/433 |
    804 | Christian              | 2020-08-05     | Merci pour votre plugin. Exceptionnel et gratuit. |
    805 
    806 
    807 **Persons who contributed with extra generously amounts of coffee / lifetime backing (>50$) - thanks!:**
    808 
    809 | Name                   | Amount     |  Message  |
    810 | ---------------------- | -----------| --------- |
    811 | Justin - BigScoots     | $105       | Such an amazing plugin for so many reasons, thank you! |
    812 | Sebastian              | $99        | WebP for Wordpress – what a great plugin! Thank you!   |
    813 | Tammy Lee              | $90        |  |
    814 | Max Kreminsky          | $65        |  |
    815 | Steven Sullivan        | $51        | Thank you for such a wonderful plugin. |
     737**Persons who recently contributed with [ko-fi](https://ko-fi.com/rosell) - Thanks!**
     738
     739* 5 Jan: Joel
     740* 24 Dec: Patrick Müller
     741* 16 Dec: Dragos
     742* 9 Aug: Tanzi
     743* 3 Jul: Jen
     744* 26 Jun: Per
     745
     746
     747**Persons who recently contributed on [github sponsors](https://github.com/sponsors/rosell-dk) - Thanks!**
     748* 16 Dec: kcrlost
     749* 16 Dec: Yakovos Frountas (Greece)
     750
     751**Persons who contributed with extra generously amounts of coffee / lifetime backing (>30$) - thanks!:**
     752
     753* Patrick Müller ($250)
     754* Max Kreminsky ($115)
     755* Justin - BigScoots ($105)
     756* Bill Vallance ($102)
     757* Joel ($100)
     758* Label Vier ($100)
     759* Sebastian ($99)
     760* Tammy Lee ($90)
     761* Steven Sullivan ($51)
     762* Mathieu Gollain-Dupont ($50)
     763* Erica Dreisbach ($50)
     764* Brian Laursen ($50)
     765* Dimitris Vayenas ($50)
  • webp-express/tags/0.25.14/README.txt

    r3427221 r3439201  
    55Requires at least: 4.0
    66Tested up to: 6.9
    7 Stable tag: 0.25.13
     7Stable tag: 0.25.14
    88Requires PHP: 5.6
    99License: GPLv3
     
    174174**Persons who recently contributed with [ko-fi](https://ko-fi.com/rosell) - Thanks!**
    175175
     176* 5 Jan: Joel
    176177* 24 Dec: Patrick Müller
    177178* 16 Dec: Dragos
     
    189190* 16 Dec: Yakovos Frountas (Greece)
    190191
    191 **Persons who contributed with extra generously amounts of coffee / lifetime backing (>30$) - thanks!:**
     192**Persons who contributed with extra generously amounts of coffee / lifetime backing (>80$) - thanks!:**
    192193
    193194* Patrick Müller ($250)
     
    195196* Justin - BigScoots ($105)
    196197* Bill Vallance ($102)
     198* Joel ($100)
    197199* Label Vier ($100)
    198200* Sebastian ($99)
    199201* Tammy Lee ($90)
    200 * Steven Sullivan ($51)
    201 * Mathieu Gollain-Dupont ($50)
    202 * Erica Dreisbach ($50)
    203 * Brian Laursen ($50)
    204 * Dimitris Vayenas ($50)
    205202
    206203== Frequently Asked Questions ==
     
    835832== Changelog ==
    836833
     834= 0.25.14 =
     835(released 25 December 2025)
     836* Fixed issue that the delete images feature also deleted webp-images that was uploaded as such, when webp-express was configured to store converted images in same folder as originals (not the default option). Also fixed conversion triggered by redirection, which broke on a few systems in a recent update, causing images in the media library not to appear. It may however still be a problem on a very few systems. In that case: Simply disable "Enable redirection to converter" and "Create webp files upon request" and submit an issue.
     837
    837838= 0.25.13 =
    838839(released 25 December 2025)
     
    899900== Upgrade Notice ==
    900901
     902= 0.25.14 =
     903* Fixed issue that the delete images feature also deleted webp-images that was uploaded as such, when webp-express was configured to store converted images in same folder as originals (not the default option). Also fixed conversion triggered by redirection, which broke on a few systems in a recent update, causing images in the media library not to appear. It may however still be a problem on a very few systems. In that case: Simply disable "Enable redirection to converter" and "Create webp files upon request" and submit an issue
     904
    901905= 0.25.13 =
    902906* It is no longer a requirement on Nginx to modify redirection rules by adding a "hash" parameter. This was briefly required in 0.25.10-12
  • webp-express/tags/0.25.14/docs/publishing.md

    r3427221 r3439201  
    5353- https://developer.wordpress.org/plugins/wordpress-org/
    5454- Validate the readme: https://wordpress.org/plugins/developers/readme-validator/
     55- Update contributions sections in `README.txt` as well as `README.md`
    5556- Make sure you have pushed the latest commits to github
    5657- Make sure you have released the new version on github
  • webp-express/tags/0.25.14/lib/classes/CachePurge.php

    r2626571 r3439201  
    77use \WebPExpress\DismissableMessages;
    88use \WebPExpress\Paths;
     9use WebPExpress\MediaLibraryHelper;
     10
     11
    912
    1013// TODO! Needs to be updated to work with the new "destination-structure" setting
     
    2326        $filter = [
    2427            'only-png' => $onlyPng,
    25             'only-with-corresponding-original' => false
     28            'only-with-corresponding-original' => false,
     29            'check-if-registered' => ($config['destination-folder'] === 'mingled')
    2630        ];
    2731
     
    5256
    5357    }
    54 
    5558
    5659    /**
     
    9396                    if (!$skipThis && !preg_match('#\.webp$#', $filename)) {
    9497                        $skipThis = true;
     98                    }
     99
     100                    // filter: never delete media library originals
     101                    if (!$skipThis && $filter['check-if-registered'] && MediaLibraryHelper::isRegisteredAttachmentOrThumbnail($dir . '/' . $filename)) {
     102                        $skipThis = true;
     103
    95104                    }
    96105
  • webp-express/tags/0.25.14/lib/classes/ConvertHelperIndependent.php

    r3427221 r3439201  
    572572
    573573        // TODO: Put version number somewhere else. Ie \WebPExpress\VersionNumber::version
    574         $text = 'WebP Express 0.25.13. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
     574        $text = 'WebP Express 0.25.14. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
    575575
    576576        $logFile = self::getLogFilename($source, $logDir);
  • webp-express/tags/0.25.14/lib/classes/WodConfigLoader.php

    r3427221 r3439201  
    9191    }
    9292
     93    protected static function getPassedHash() {
     94        // First check if it is passed in as an environment variable
     95        $hash = self::getEnvPassedInRewriteRule('HASH');
     96        if ($hash !== false) {
     97          return $hash;
     98        }
     99        // Then check if it is passed in the query string
     100        if (isset($_GET['hash'])) {
     101            return $_GET['hash'];
     102        }
     103        return false;
     104    }
     105
     106
    93107    protected static function getWebPExpressContentDirWithDocRoot()
    94108    {
     
    184198     * Find the hash from config.[hash].json inside a directory.
    185199     *
    186      * @param string $configDir Absolute or relative path to the config directory
    187      * @return string Hash string, or empty string if not found
     200     * @param string $configDir Absolute path to the config directory (no trailing slash)
    188201     */
    189     protected static function findConfigHashByInspection($configDir)
    190     {
    191         // Normalize directory path
    192         $configDir = rtrim($configDir, DIRECTORY_SEPARATOR);
    193 
    194         if (!is_dir($configDir) || !is_readable($configDir)) {
    195             return '';
    196         }
    197 
    198         $files = glob($configDir . DIRECTORY_SEPARATOR . 'config.*.json');
     202    protected static function findConfigFileByInspection($configDir)
     203    {
     204        if (!is_dir($configDir)) {
     205            throw new \Exception(
     206              'WebP Express configuration directory was not found. ' .
     207              'Please check that wp-content/webp-express/config exists and is readable.'
     208            );
     209        }
     210
     211        if (!is_readable($configDir)) {
     212            throw new \Exception('WebP Express configuration directory is not readable. Please fix the permissions (wp-content/webp-express/config)');
     213        }
     214
     215        $files = glob($configDir . '/wod-options.*.json');
    199216
    200217        if ($files === false || empty($files)) {
    201             return '';
    202         }
     218            // Failed finding the pattern. Lets see if old plain "wod-options.json" is there due to migration not complete
     219            $oldFileName = $configDir . '/wod-options.json';
     220            if (file_exists($oldFileName)) {
     221                return $oldFileName;
     222            }
     223            throw new \Exception('Could not find a file that matches the pattern "wod-options.[hash].json" in the config dir. Is it there? Please check manually in this folder: wp-content/webp-express/config');
     224        }
     225
     226        // We expect only one match. But failed migrations / manual restores could perhaps cause there to be several
     227        // So therefore, lets make sure to pick the newest file, in case there are several
     228        usort($files, function ($a, $b) {
     229            return filemtime($b) <=> filemtime($a);
     230        });
     231
     232        $configFilename = $files[0];
     233        if (!file_exists($configFilename)) {
     234            throw new \Exception('Configuration file found in filesystem, but at the same, it seems not to exist!');
     235        }
     236        return $configFilename;
    203237
    204238        // Take the first match
    205         $filename = basename($files[0]);
    206 
     239        //$filename = basename($files[0]);
    207240        // Extract hash between "config." and ".json"
    208         if (preg_match('/^config\.([a-f0-9]+)\.json$/i', $filename, $matches)) {
     241        /*
     242        if (preg_match('/^wod-options\.([a-f0-9]+)\.json$/i', $filename, $matches)) {
    209243            return $matches[1];
    210         }
    211 
    212         return '';
     244        }*/
     245        // throw new \Exception('The filename Could not find a file that matches the pattern "wod-options.[hash].json" in the config dir. Is it there? Please check manually in this folder: wp-content/webp-express/config');
    213246    }
    214247
     
    251284        self::$checking = 'config file';
    252285
    253         $hash = self::getEnvPassedInRewriteRule('HASH');
     286        $hash = self::getPassedHash();
    254287        if ($hash === false) {
    255             // Passed in QS?
    256             if (isset($_GET['hash'])) {
    257                 $hash = $_GET['hash'];
    258             } else {
    259                 // In case above fails, find the hash by browsing the config dir
    260                 $hash = self::findConfigHashByInspection(self::$webExpressContentDirAbs . '/config/');
    261             }
    262         }
    263 
    264         $filename = '';
    265 
    266         if ($hash == '') {
    267             $filename = 'wod-options.json';
     288            self::$checking = 'finding config file by introspecting config dir';
     289            $configFilename = self::findConfigFileByInspection(self::$webExpressContentDirAbs . '/config');
    268290        } else {
    269             $filename = 'wod-options.' . $hash . '.json';
    270         }
    271 
    272 
    273         $configFilename = self::$webExpressContentDirAbs . '/config/' . $filename;
    274         if (!file_exists($configFilename)) {
    275             throw new \Exception('Configuration file was not found (' . $filename . ')');
     291            $hash = SanityCheck::noDirectoryTraversal($hash);
     292            if (!preg_match('/^[a-f0-9]{32}$/i', $hash)) {
     293                //throw new \Exception('Provided hash does not match correct pattern. Hash is expected to be 32 chars of letters/digits. Check the .htaccess files, its where the hash comes from (unless you are using Nginx - then check your Nginx rewrite rules)');
     294                self::$checking = 'finding config file by introspecting config dir (as no hash passed in did not conform to expected pattern, which is 32 chars of letters/digits)';
     295                $configFilename = self::findConfigFileByInspection(self::$webExpressContentDirAbs . '/config');
     296            }
     297            else {
     298                $filename = 'wod-options.' . $hash . '.json';
     299                $configFilename = self::$webExpressContentDirAbs . '/config/' . $filename;
     300                if (!file_exists($configFilename)) {
     301                    self::$checking = 'finding config file by introspecting config dir (as no config file was found using hash passed in)';
     302                    $configFilename = self::findConfigFileByInspection(self::$webExpressContentDirAbs . '/config');
     303                }
     304            }
    276305        }
    277306
     
    280309        $configLoadResult = file_get_contents($configFilename);
    281310        if ($configLoadResult === false) {
    282             throw new \Exception('Cannot open config file');
     311            throw new \Exception('Cannot open config file: ' . $configFilename);
    283312        }
    284313        $json = SanityCheck::isJSONObject($configLoadResult);
  • webp-express/tags/0.25.14/lib/dismissable-global-messages/0.25.10/renamed-config-file.php

    r3425690 r3439201  
    55$msgId = '0.25.10/renamed-config-file';
    66
     7/*
    78DismissableGlobalMessages::printDismissableMessage(
    89    'info',
     
    1516    ]
    1617);
     18*/
     19
     20// The message is old news, so dismiss it, so this code is not run again
     21DismissableGlobalMessages::dismissMessage($msgId);
  • webp-express/tags/0.25.14/lib/dismissable-global-messages/0.25.11/updated-htaccess.php

    r3425653 r3439201  
    33namespace WebPExpress;
    44
    5 
     5/*
    66DismissableGlobalMessages::printDismissableMessage(
    77    'info',
     
    1212    ]
    1313);
     14*/
     15
     16// The message is no longer relevant, as it is no longer neccessary
     17// So dismiss it, so this code is not run again
     18DismissableGlobalMessages::dismissMessage('0.25.11/updated-htaccess');
  • webp-express/tags/0.25.14/lib/dismissable-global-messages/0.25.12/nginx-rewrites-needs-updating.php

    r3427221 r3439201  
    55$msgId = '0.25.12/nginx-rewrites-needs-updating';
    66
     7/*
    78DismissableGlobalMessages::printDismissableMessage(
    89    'info',
     
    1617    ]
    1718);
     19*/
    1820
    19 // In next version, after 0.25.13, we can dismiss the message completely, like this:
    20 // DismissableGlobalMessages::dismissMessage($msgId);
     21// The message is no longer relevant, as it is no longer neccessary to pass the hash
     22// So dismiss it, so this code is not run again
     23DismissableGlobalMessages::dismissMessage($msgId);
  • webp-express/tags/0.25.14/webp-express.php

    r3427221 r3439201  
    44 * Plugin URI: https://github.com/rosell-dk/webp-express
    55 * Description: Serve autogenerated WebP images instead of jpeg/png to browsers that supports WebP. Works on anything (media library images, galleries, theme images etc).
    6  * Version: 0.25.13
     6 * Version: 0.25.14
    77 * Author: Bjørn Rosell
    88 * Author URI: https://www.bitwise-it.dk
     
    4141function webp_express_process_post() {
    4242    // strip query string
    43     $requestUriNoQS = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
    44     //echo '<pre>' . print_r($_SERVER, true) . '</pre>'; die();
     43    $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
     44    $requestUriNoQS = parse_url($requestUri, PHP_URL_PATH);
     45
     46    if (!is_string($requestUriNoQS)) {
     47        $requestUriNoQS = '';
     48    }
    4549
    4650    if (preg_match('/webp-express-web-service$/', $requestUriNoQS)) {
  • webp-express/trunk/README.md

    r3425690 r3439201  
    727727I generally create a pre-release before publishing. If you [follow me on ko-fi](https://ko-fi.com/rosell), you will get notified when a pre-release is available. I generally create a pre-release on fridays and mark it as stable on mondays. In order to download a pre-release, go to [the advanced page](https://wordpress.org/plugins/webp-express/advanced/) and scroll down to "Please select a specific version to download". I don't name the pre-releases different. You will just see the next version here before it is available the usual way.
    728728
    729 ## Changes in 0.21.1
    730 *(released: 27 Oct 2021)*
    731 * Bugfix: File manager could not handle many images. It now loads tree branches on need basis instead of the complete tree in one go
    732 * Bugfix: For mulisite, the redirect after settings save was not working (bug introduced in 0.21.0)
    733 
    734 For more info, see the closed issues on the [webp-express 0.21.1 milestone](https://github.com/rosell-dk/webp-express/milestone/42?closed=1)
    735 
    736 ## Changes in 0.21.0
    737 *(released: 25 Oct 2021)*
    738 * Added image browser (in Media tab)
    739 * Updated webp convert library to 2.7.0.
    740 * ImageMagick now supports the "near-lossless" option (provided Imagick >= 7.0.10-54)
    741 * Added "try-common-system-paths" option for ImageMagick (default: true). Thanks to Henrik Alves for adding this option.
    742 * Bugfix: Handling Uncaught Fatal Exception during .htaccess read failure. Thanks to Manuel D'Orso from Italy for the fix.
    743 * Bugfix: File names which were not UTF8 caused trouble in the Bulk Convert. Thank to "mills4078" for the fix
    744 * Bugfix: Redirection back to settings after saving settings failed on some systems. Thanks to Martin Rehberger (@kingkero) from Germany for the fix.
    745 * Bugfix: Webp urls did not contain port number (only relevant when the website was not on default port number). Thanks to Nicolas LIENART (@nicolnt) from France for providing the fix.
    746 
    747 For more info, see the closed issues on the [webp-express 0.21.0 milestone](https://github.com/rosell-dk/webp-express/milestone/41?closed=1) and the
    748 [webp-convert 2.7.0 milestone](https://github.com/rosell-dk/webp-convert/milestone/24?closed=1)
    749 
    750 
    751 ## Changes in 0.20.1
    752 *(released: 20 Jun 2021)*
    753 * Bugfix: Removed composer.lock. It was locked on PHP 7.2, which caused server error on some sites.
    754 
    755 ## Changes in 0.20.0
    756 *(released: 17 Jun 2021)*
    757 * Added WP CLI support. Add "wp webp-express convert" to crontab for nightly conversions of new images! Thanks to Isuru Sampath Ratnayake from Sri Lanka for initializing this.
    758 * Added "sharp-yuv" (not as option, but as always on). Better YUV->RGB color conversion at almost no price. [Read more here](https://www.ctrl.blog/entry/webp-sharp-yuv.html). Supported by cwebp, vips, gmagick, graphicsmagick, imagick and imagemagick
    759 * Bumped cwebp binaries to 1.2.0
    760 * cwebp now only validates hash of supplied precompiled binaries when necessary. This cuts down conversion time.
    761 * Convert on upload now defaults to false, as it may impact upload experience in themes with many formats.
    762 * bugfix: Alpha quality was saved incorrectly for PNG. Thanks to Chriss Gibbs from the UK for finding and fixing this.
    763 * bugfix: wp-debug log could be flooded with "Undefined index: HTTP_ACCEPT". Thanks to @markusreis for finding and fixing this.
    764 
    765 ## Changes in 0.19.0
    766 *(released: 13 Nov 2020)*
    767 * New convertion method: ffmpeg
    768 * Fixed problem in Bulk Convert when files had special characters in their filename
    769 * Prevented problems if the plugin gets included twice (can anybody enlighten me on how this might happen?)
    770 
    771 For more info, see the closed issues on the [0.19.0 milestone on the github repository](https://github.com/rosell-dk/webp-express/milestone/36?closed=1)
    772 
    773 ## Changes in 0.18.3
    774 *(released: 5 Nov 2020)*
    775 * Bugfix: WebP Express uses live tests to determine the capabilities of the server in respect to .htaccess files (using the htaccess-capability-tester library). The results are used for warnings and also for optimizing the rules in the .htaccess files. However, HTTP Requests can fail due to other reasons than the feature not working (ie timeout). Such failures should lead to an indeterminate result, but it was interpreted as if the feature was not working.
    776 * The Live test now displays a bit more information if the HTTP request failed.
    777 * Changed default value for "destination structure" to "Image roots", as "Document root" doesn't work on hosts that have defined DOCUMENT_ROOT in an unusual way.
    778 * Added possibility to change "%{DOCUMENT_ROOT}" part of RewriteCond by adding a line to wp-config.php. THIS IS A BETA FEATURE AND MIGHT BE REVOKED IF NOBODY ACTUALLY NEEDS IT.
    779 * Got rid of PHP notice Constant WEBPEXPRESS_MIGRATION_VERSION already defined
    780 * Fixed donation link. It now points to https://ko-fi.com/rosell again
    781 
    782 For more info, see the closed issues on the 0.18.3 milestone on the github repository: https://github.com/rosell-dk/webp-express/milestone/34?closed=1
    783729
    784730## Supporting WebP Express
     
    789735
    790736
    791 **Persons / Companies currently backing the project via patreon - Thanks!**
    792 
    793 - Max Kreminsky
    794 - Nodeflame
    795 - [Mathieu Gollain-Dupont](https://www.linkedin.com/in/mathieu-gollain-dupont-9938a4a/)
    796 - Ruben Solvang
    797 
    798 **Persons who contributed with coffee within the last 30 days:**
    799 
    800 | Name                   | Date           | Message      |
    801 | ---------------------- | -------------- | ------------ |
    802 | Anon                   | 2020-08-18     | - |
    803 | Eder Ribeiro           | 2020-08-08     | Hello Bjørn I believe that it is a fantastic solution and that it deserves maximum support to keep getting better! If you can, check out my configuration tip, https://github.com/rosell-dk/webp-express/issues/433 |
    804 | Christian              | 2020-08-05     | Merci pour votre plugin. Exceptionnel et gratuit. |
    805 
    806 
    807 **Persons who contributed with extra generously amounts of coffee / lifetime backing (>50$) - thanks!:**
    808 
    809 | Name                   | Amount     |  Message  |
    810 | ---------------------- | -----------| --------- |
    811 | Justin - BigScoots     | $105       | Such an amazing plugin for so many reasons, thank you! |
    812 | Sebastian              | $99        | WebP for Wordpress – what a great plugin! Thank you!   |
    813 | Tammy Lee              | $90        |  |
    814 | Max Kreminsky          | $65        |  |
    815 | Steven Sullivan        | $51        | Thank you for such a wonderful plugin. |
     737**Persons who recently contributed with [ko-fi](https://ko-fi.com/rosell) - Thanks!**
     738
     739* 5 Jan: Joel
     740* 24 Dec: Patrick Müller
     741* 16 Dec: Dragos
     742* 9 Aug: Tanzi
     743* 3 Jul: Jen
     744* 26 Jun: Per
     745
     746
     747**Persons who recently contributed on [github sponsors](https://github.com/sponsors/rosell-dk) - Thanks!**
     748* 16 Dec: kcrlost
     749* 16 Dec: Yakovos Frountas (Greece)
     750
     751**Persons who contributed with extra generously amounts of coffee / lifetime backing (>30$) - thanks!:**
     752
     753* Patrick Müller ($250)
     754* Max Kreminsky ($115)
     755* Justin - BigScoots ($105)
     756* Bill Vallance ($102)
     757* Joel ($100)
     758* Label Vier ($100)
     759* Sebastian ($99)
     760* Tammy Lee ($90)
     761* Steven Sullivan ($51)
     762* Mathieu Gollain-Dupont ($50)
     763* Erica Dreisbach ($50)
     764* Brian Laursen ($50)
     765* Dimitris Vayenas ($50)
  • webp-express/trunk/README.txt

    r3427221 r3439201  
    55Requires at least: 4.0
    66Tested up to: 6.9
    7 Stable tag: 0.25.13
     7Stable tag: 0.25.14
    88Requires PHP: 5.6
    99License: GPLv3
     
    174174**Persons who recently contributed with [ko-fi](https://ko-fi.com/rosell) - Thanks!**
    175175
     176* 5 Jan: Joel
    176177* 24 Dec: Patrick Müller
    177178* 16 Dec: Dragos
     
    189190* 16 Dec: Yakovos Frountas (Greece)
    190191
    191 **Persons who contributed with extra generously amounts of coffee / lifetime backing (>30$) - thanks!:**
     192**Persons who contributed with extra generously amounts of coffee / lifetime backing (>80$) - thanks!:**
    192193
    193194* Patrick Müller ($250)
     
    195196* Justin - BigScoots ($105)
    196197* Bill Vallance ($102)
     198* Joel ($100)
    197199* Label Vier ($100)
    198200* Sebastian ($99)
    199201* Tammy Lee ($90)
    200 * Steven Sullivan ($51)
    201 * Mathieu Gollain-Dupont ($50)
    202 * Erica Dreisbach ($50)
    203 * Brian Laursen ($50)
    204 * Dimitris Vayenas ($50)
    205202
    206203== Frequently Asked Questions ==
     
    835832== Changelog ==
    836833
     834= 0.25.14 =
     835(released 25 December 2025)
     836* Fixed issue that the delete images feature also deleted webp-images that was uploaded as such, when webp-express was configured to store converted images in same folder as originals (not the default option). Also fixed conversion triggered by redirection, which broke on a few systems in a recent update, causing images in the media library not to appear. It may however still be a problem on a very few systems. In that case: Simply disable "Enable redirection to converter" and "Create webp files upon request" and submit an issue.
     837
    837838= 0.25.13 =
    838839(released 25 December 2025)
     
    899900== Upgrade Notice ==
    900901
     902= 0.25.14 =
     903* Fixed issue that the delete images feature also deleted webp-images that was uploaded as such, when webp-express was configured to store converted images in same folder as originals (not the default option). Also fixed conversion triggered by redirection, which broke on a few systems in a recent update, causing images in the media library not to appear. It may however still be a problem on a very few systems. In that case: Simply disable "Enable redirection to converter" and "Create webp files upon request" and submit an issue
     904
    901905= 0.25.13 =
    902906* It is no longer a requirement on Nginx to modify redirection rules by adding a "hash" parameter. This was briefly required in 0.25.10-12
  • webp-express/trunk/docs/publishing.md

    r3427221 r3439201  
    5353- https://developer.wordpress.org/plugins/wordpress-org/
    5454- Validate the readme: https://wordpress.org/plugins/developers/readme-validator/
     55- Update contributions sections in `README.txt` as well as `README.md`
    5556- Make sure you have pushed the latest commits to github
    5657- Make sure you have released the new version on github
  • webp-express/trunk/lib/classes/CachePurge.php

    r2626571 r3439201  
    77use \WebPExpress\DismissableMessages;
    88use \WebPExpress\Paths;
     9use WebPExpress\MediaLibraryHelper;
     10
     11
    912
    1013// TODO! Needs to be updated to work with the new "destination-structure" setting
     
    2326        $filter = [
    2427            'only-png' => $onlyPng,
    25             'only-with-corresponding-original' => false
     28            'only-with-corresponding-original' => false,
     29            'check-if-registered' => ($config['destination-folder'] === 'mingled')
    2630        ];
    2731
     
    5256
    5357    }
    54 
    5558
    5659    /**
     
    9396                    if (!$skipThis && !preg_match('#\.webp$#', $filename)) {
    9497                        $skipThis = true;
     98                    }
     99
     100                    // filter: never delete media library originals
     101                    if (!$skipThis && $filter['check-if-registered'] && MediaLibraryHelper::isRegisteredAttachmentOrThumbnail($dir . '/' . $filename)) {
     102                        $skipThis = true;
     103
    95104                    }
    96105
  • webp-express/trunk/lib/classes/ConvertHelperIndependent.php

    r3427221 r3439201  
    572572
    573573        // TODO: Put version number somewhere else. Ie \WebPExpress\VersionNumber::version
    574         $text = 'WebP Express 0.25.13. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
     574        $text = 'WebP Express 0.25.14. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
    575575
    576576        $logFile = self::getLogFilename($source, $logDir);
  • webp-express/trunk/lib/classes/WodConfigLoader.php

    r3427221 r3439201  
    9191    }
    9292
     93    protected static function getPassedHash() {
     94        // First check if it is passed in as an environment variable
     95        $hash = self::getEnvPassedInRewriteRule('HASH');
     96        if ($hash !== false) {
     97          return $hash;
     98        }
     99        // Then check if it is passed in the query string
     100        if (isset($_GET['hash'])) {
     101            return $_GET['hash'];
     102        }
     103        return false;
     104    }
     105
     106
    93107    protected static function getWebPExpressContentDirWithDocRoot()
    94108    {
     
    184198     * Find the hash from config.[hash].json inside a directory.
    185199     *
    186      * @param string $configDir Absolute or relative path to the config directory
    187      * @return string Hash string, or empty string if not found
     200     * @param string $configDir Absolute path to the config directory (no trailing slash)
    188201     */
    189     protected static function findConfigHashByInspection($configDir)
    190     {
    191         // Normalize directory path
    192         $configDir = rtrim($configDir, DIRECTORY_SEPARATOR);
    193 
    194         if (!is_dir($configDir) || !is_readable($configDir)) {
    195             return '';
    196         }
    197 
    198         $files = glob($configDir . DIRECTORY_SEPARATOR . 'config.*.json');
     202    protected static function findConfigFileByInspection($configDir)
     203    {
     204        if (!is_dir($configDir)) {
     205            throw new \Exception(
     206              'WebP Express configuration directory was not found. ' .
     207              'Please check that wp-content/webp-express/config exists and is readable.'
     208            );
     209        }
     210
     211        if (!is_readable($configDir)) {
     212            throw new \Exception('WebP Express configuration directory is not readable. Please fix the permissions (wp-content/webp-express/config)');
     213        }
     214
     215        $files = glob($configDir . '/wod-options.*.json');
    199216
    200217        if ($files === false || empty($files)) {
    201             return '';
    202         }
     218            // Failed finding the pattern. Lets see if old plain "wod-options.json" is there due to migration not complete
     219            $oldFileName = $configDir . '/wod-options.json';
     220            if (file_exists($oldFileName)) {
     221                return $oldFileName;
     222            }
     223            throw new \Exception('Could not find a file that matches the pattern "wod-options.[hash].json" in the config dir. Is it there? Please check manually in this folder: wp-content/webp-express/config');
     224        }
     225
     226        // We expect only one match. But failed migrations / manual restores could perhaps cause there to be several
     227        // So therefore, lets make sure to pick the newest file, in case there are several
     228        usort($files, function ($a, $b) {
     229            return filemtime($b) <=> filemtime($a);
     230        });
     231
     232        $configFilename = $files[0];
     233        if (!file_exists($configFilename)) {
     234            throw new \Exception('Configuration file found in filesystem, but at the same, it seems not to exist!');
     235        }
     236        return $configFilename;
    203237
    204238        // Take the first match
    205         $filename = basename($files[0]);
    206 
     239        //$filename = basename($files[0]);
    207240        // Extract hash between "config." and ".json"
    208         if (preg_match('/^config\.([a-f0-9]+)\.json$/i', $filename, $matches)) {
     241        /*
     242        if (preg_match('/^wod-options\.([a-f0-9]+)\.json$/i', $filename, $matches)) {
    209243            return $matches[1];
    210         }
    211 
    212         return '';
     244        }*/
     245        // throw new \Exception('The filename Could not find a file that matches the pattern "wod-options.[hash].json" in the config dir. Is it there? Please check manually in this folder: wp-content/webp-express/config');
    213246    }
    214247
     
    251284        self::$checking = 'config file';
    252285
    253         $hash = self::getEnvPassedInRewriteRule('HASH');
     286        $hash = self::getPassedHash();
    254287        if ($hash === false) {
    255             // Passed in QS?
    256             if (isset($_GET['hash'])) {
    257                 $hash = $_GET['hash'];
    258             } else {
    259                 // In case above fails, find the hash by browsing the config dir
    260                 $hash = self::findConfigHashByInspection(self::$webExpressContentDirAbs . '/config/');
    261             }
    262         }
    263 
    264         $filename = '';
    265 
    266         if ($hash == '') {
    267             $filename = 'wod-options.json';
     288            self::$checking = 'finding config file by introspecting config dir';
     289            $configFilename = self::findConfigFileByInspection(self::$webExpressContentDirAbs . '/config');
    268290        } else {
    269             $filename = 'wod-options.' . $hash . '.json';
    270         }
    271 
    272 
    273         $configFilename = self::$webExpressContentDirAbs . '/config/' . $filename;
    274         if (!file_exists($configFilename)) {
    275             throw new \Exception('Configuration file was not found (' . $filename . ')');
     291            $hash = SanityCheck::noDirectoryTraversal($hash);
     292            if (!preg_match('/^[a-f0-9]{32}$/i', $hash)) {
     293                //throw new \Exception('Provided hash does not match correct pattern. Hash is expected to be 32 chars of letters/digits. Check the .htaccess files, its where the hash comes from (unless you are using Nginx - then check your Nginx rewrite rules)');
     294                self::$checking = 'finding config file by introspecting config dir (as no hash passed in did not conform to expected pattern, which is 32 chars of letters/digits)';
     295                $configFilename = self::findConfigFileByInspection(self::$webExpressContentDirAbs . '/config');
     296            }
     297            else {
     298                $filename = 'wod-options.' . $hash . '.json';
     299                $configFilename = self::$webExpressContentDirAbs . '/config/' . $filename;
     300                if (!file_exists($configFilename)) {
     301                    self::$checking = 'finding config file by introspecting config dir (as no config file was found using hash passed in)';
     302                    $configFilename = self::findConfigFileByInspection(self::$webExpressContentDirAbs . '/config');
     303                }
     304            }
    276305        }
    277306
     
    280309        $configLoadResult = file_get_contents($configFilename);
    281310        if ($configLoadResult === false) {
    282             throw new \Exception('Cannot open config file');
     311            throw new \Exception('Cannot open config file: ' . $configFilename);
    283312        }
    284313        $json = SanityCheck::isJSONObject($configLoadResult);
  • webp-express/trunk/lib/dismissable-global-messages/0.25.10/renamed-config-file.php

    r3425690 r3439201  
    55$msgId = '0.25.10/renamed-config-file';
    66
     7/*
    78DismissableGlobalMessages::printDismissableMessage(
    89    'info',
     
    1516    ]
    1617);
     18*/
     19
     20// The message is old news, so dismiss it, so this code is not run again
     21DismissableGlobalMessages::dismissMessage($msgId);
  • webp-express/trunk/lib/dismissable-global-messages/0.25.11/updated-htaccess.php

    r3425653 r3439201  
    33namespace WebPExpress;
    44
    5 
     5/*
    66DismissableGlobalMessages::printDismissableMessage(
    77    'info',
     
    1212    ]
    1313);
     14*/
     15
     16// The message is no longer relevant, as it is no longer neccessary
     17// So dismiss it, so this code is not run again
     18DismissableGlobalMessages::dismissMessage('0.25.11/updated-htaccess');
  • webp-express/trunk/lib/dismissable-global-messages/0.25.12/nginx-rewrites-needs-updating.php

    r3427221 r3439201  
    55$msgId = '0.25.12/nginx-rewrites-needs-updating';
    66
     7/*
    78DismissableGlobalMessages::printDismissableMessage(
    89    'info',
     
    1617    ]
    1718);
     19*/
    1820
    19 // In next version, after 0.25.13, we can dismiss the message completely, like this:
    20 // DismissableGlobalMessages::dismissMessage($msgId);
     21// The message is no longer relevant, as it is no longer neccessary to pass the hash
     22// So dismiss it, so this code is not run again
     23DismissableGlobalMessages::dismissMessage($msgId);
  • webp-express/trunk/webp-express.php

    r3427221 r3439201  
    44 * Plugin URI: https://github.com/rosell-dk/webp-express
    55 * Description: Serve autogenerated WebP images instead of jpeg/png to browsers that supports WebP. Works on anything (media library images, galleries, theme images etc).
    6  * Version: 0.25.13
     6 * Version: 0.25.14
    77 * Author: Bjørn Rosell
    88 * Author URI: https://www.bitwise-it.dk
     
    4141function webp_express_process_post() {
    4242    // strip query string
    43     $requestUriNoQS = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
    44     //echo '<pre>' . print_r($_SERVER, true) . '</pre>'; die();
     43    $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
     44    $requestUriNoQS = parse_url($requestUri, PHP_URL_PATH);
     45
     46    if (!is_string($requestUriNoQS)) {
     47        $requestUriNoQS = '';
     48    }
    4549
    4650    if (preg_match('/webp-express-web-service$/', $requestUriNoQS)) {
Note: See TracChangeset for help on using the changeset viewer.